@customize-agent/server 4.0.116 → 4.0.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +65 -61
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +3 -1
- package/.next/server/chunks/1928.js +1 -1
- package/.next/server/chunks/1936.js +1 -1
- package/.next/server/chunks/6041.js +69 -69
- package/.next/server/chunks/8204.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/asset-library.html +1 -1
- package/.next/server/pages/document-roles.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/guide.html +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/prompt.html +1 -1
- package/.next/server/pages/settings.html +1 -1
- package/.next/server/pages/system/logs.html +1 -1
- package/.next/server/pages-manifest.json +24 -24
- package/.next/static/56P8i_y0wG1AJbu_xC4nI/_buildManifest.js +1 -0
- package/.next/static/chunks/187-358527d7061417bf.js +1 -0
- package/.next/static/chunks/209-5117020514c2bd0c.js +4 -0
- package/.next/static/chunks/230-8184e70eae35f2bb.js +1 -0
- package/.next/static/chunks/{945-9e9382e35f024c04.js → 238-16333381c574f65b.js} +1 -1
- package/.next/static/chunks/{289-39ef5df8097382b4.js → 289-35ac595388bbd018.js} +14 -14
- package/.next/static/chunks/455-e1b41ac4946d2b6f.js +6 -0
- package/.next/static/chunks/506-93f730bc149d0dce.js +1 -0
- package/.next/static/chunks/576-6699fed6c88502fe.js +1 -0
- package/.next/static/chunks/580-618d7d7e7b74daf6.js +19 -0
- package/.next/static/chunks/644-3299885a9dc1ef78.js +11 -0
- package/.next/static/chunks/649-06b72042a4de8074.js +4 -0
- package/.next/static/chunks/665-88e20299084b9e73.js +1 -0
- package/.next/static/chunks/7-20bcc985742a9ae1.js +10 -0
- package/.next/static/chunks/788-3afeb069ed706ac0.js +1 -0
- package/.next/static/chunks/pages/_app-34260fc817f32ddc.js +185 -0
- package/.next/static/chunks/pages/{asset-library-dc19b6ccd193de27.js → asset-library-bedc7113dfc7ad6a.js} +1 -1
- package/.next/static/chunks/pages/{document-roles-33e93d6bee1b0381.js → document-roles-3d8c5440cc3f15fd.js} +1 -1
- package/.next/static/chunks/pages/documents-fcf2ad9543097b4d.js +1 -0
- package/.next/static/chunks/pages/{guide-40908b2721e92d01.js → guide-9d7d88a25d972c06.js} +1 -1
- package/.next/static/chunks/pages/knowledge/{file-detail-58d6d3365af15b4c.js → file-detail-b9b728f62832b91c.js} +1 -1
- package/.next/static/chunks/pages/knowledge/{files-3bf25ca6491cebe3.js → files-cf9a04089447fcd8.js} +1 -1
- package/.next/static/chunks/pages/knowledge/{manage-c98ed288e65c3e84.js → manage-67b5c7fe257f37c5.js} +1 -1
- package/.next/static/chunks/pages/{models-4fb81218cff53e21.js → models-89f9769a32da8e5f.js} +1 -1
- package/.next/static/chunks/pages/{prompt-031bc6ab32830ae5.js → prompt-09514790e22505cb.js} +1 -1
- package/.next/static/chunks/pages/system/{logs-b073e55810452aca.js → logs-b274976ce158117c.js} +1 -1
- package/.next/static/css/58ab2477d4a05124.css +1 -0
- package/next.config.ts +0 -1
- package/package.json +2 -2
- package/scripts/verify-next-static.js +9 -5
- package/.next/static/SYuSSOYmrJbaCRIbjCuR_/_buildManifest.js +0 -1
- package/.next/static/chunks/155-2f71ef31b9336adb.js +0 -1
- package/.next/static/chunks/337-b06909f6d29f6d1f.js +0 -1
- package/.next/static/chunks/403-0469cb096084301f.js +0 -1
- package/.next/static/chunks/405-74ecbacd0b5a3128.js +0 -8
- package/.next/static/chunks/433-233659be69169c19.js +0 -1
- package/.next/static/chunks/455-97ad88d6604f54b7.js +0 -6
- package/.next/static/chunks/478-ac4777b05b3c42e8.js +0 -1
- package/.next/static/chunks/497-58fdc9f4b4437f94.js +0 -4
- package/.next/static/chunks/576-fdadae734b47b56b.js +0 -1
- package/.next/static/chunks/713-efe6b531f7a30a5f.js +0 -1
- package/.next/static/chunks/985-4b4a3ed36ada16eb.js +0 -4
- package/.next/static/chunks/pages/_app-35958e1c02c7aede.js +0 -212
- package/.next/static/chunks/pages/documents-31b36cb18b965b3b.js +0 -1
- package/.next/static/css/31dcc01973fbcb8a.css +0 -1
- /package/.next/static/{SYuSSOYmrJbaCRIbjCuR_ → 56P8i_y0wG1AJbu_xC4nI}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{63806:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var a=s(65321),n=s(97109),r=s(17807),l=s(25258),o=s(88762),i=s(33442),c=s(85114),d=s(84253),p=s(21289),m=s(384),h=s(11702),x=s(71102),u=s(58209),y=s(75548),g=s(56768),w=s(93051),j=s(81668),v=s(64254),f=s(85855),k=s(48321),A=s(6578);let b={cover:"magenta",reference:"blue",generated:"purple",attachment:"cyan",map:"orange",operator:"geekblue"};function S(){let e=(0,k.Vr)(),{message:t}=r.A.useApp(),s=(t,s)=>e(t).replace("{count}",String(s)),[S,N]=(0,n.useState)([]),[C,T]=(0,n.useState)(new Set),[_,I]=(0,n.useState)(!0),[z,D]=(0,n.useState)(""),E=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z;try{N((await (0,A.f$)(e||void 0)).assets)}catch(e){N([])}};(0,n.useEffect)(()=>{let e=!1;return I(!0),(0,A.dx)().then(t=>{var s,a,n;if(e)return;let r=(null==(s=t.find(e=>e.selected))?void 0:s.projectRoot)||(null==(a=t.find(e=>e.isCurrent))?void 0:a.projectRoot)||(null==(n=t[0])?void 0:n.projectRoot)||"";return D(r),E(r)}).finally(()=>{e||I(!1)}),()=>{e=!0}},[]);let F=async s=>{var a;s&&(await (null==(a=navigator.clipboard)?void 0:a.writeText(s)),t.success(e("assets.copiedPath")))},R=async(s,a)=>{try{"openFile"===a?await (0,A.oS)(s,"file",z||void 0):"openDirectory"===a?await (0,A.oS)(s,"directory",z||void 0):"delete"===a&&(N((await (0,A.JU)(s,z||void 0)).assets),T(e=>{let t=new Set(e);return t.delete(s),t}))}catch(s){t.error(s instanceof Error?s.message:e("assets.operationFailed"))}},P=a=>{let n="selected"===a?[...C]:S.map(e=>e.id);0!==n.length&&l.A.confirm({title:"all"===a?e("assets.deleteAllConfirm"):s("assets.deleteSelectedConfirm",n.length),content:e("assets.deleteIrreversible"),okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{I(!0);try{await Promise.all(n.map(e=>(0,A.JU)(e,z||void 0))),await E(),T(new Set),t.success(s("assets.deleted",n.length))}catch(s){t.error(e("assets.batchDeleteFailed"))}finally{I(!1)}}})};return _?(0,a.jsx)("div",{className:"space-y-5 animateFadeIn",children:(0,a.jsx)(o.A,{active:!0,title:!0,paragraph:{rows:8}})}):(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"pageTitle",children:e("nav.assetLibrary")}),(0,a.jsx)("p",{className:"pageDesc",children:e("assets.description")})]}),(0,a.jsxs)(i.A,{size:8,children:[(0,a.jsx)("span",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:s("assets.total",S.length)}),(0,a.jsx)(c.Ay,{danger:!0,size:"small",disabled:0===C.size,icon:(0,a.jsx)(u.A,{}),onClick:()=>P("selected"),children:s("assets.deleteSelected",C.size||"")}),(0,a.jsx)(c.Ay,{danger:!0,size:"small",disabled:0===S.length,onClick:()=>P("all"),children:e("assets.deleteAll")})]})]}),0===S.length?(0,a.jsx)(d.A,{description:e("assets.empty")}):(0,a.jsx)(p.A,{className:"modern-table",rowKey:"id",size:"middle",dataSource:S,pagination:{pageSize:12,showSizeChanger:!0,pageSizeOptions:[12,24,48],showTotal:e=>s("assets.total",e)},rowSelection:{selectedRowKeys:[...C],onChange:e=>T(new Set(e.map(String)))},columns:[{title:e("assets.resource"),dataIndex:"name",key:"name",width:360,render:(e,t)=>{let s="image"===t.type&&t.path?"/api/assets/generated/preview?id=".concat(encodeURIComponent(t.id)).concat(z?"&projectRoot=".concat(encodeURIComponent(z)):""):void 0;return(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-lg bg-[var(--colorBgHover)] flex items-center justify-center overflow-hidden shrink-0",children:s?(0,a.jsx)(m.A,{src:s,alt:t.name,width:48,height:48,style:{objectFit:"cover"},preview:!1}):"image"===t.type?(0,a.jsx)(y.A,{className:"text-[var(--colorWarning)]"}):(0,a.jsx)(g.A,{className:"text-[var(--colorAccent)]"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"font-medium text-[var(--colorText)] whitespace-normal break-words leading-snug",children:t.name}),(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap gap-1",children:[(0,a.jsx)(h.A,{color:b[t.role]||"blue",bordered:!1,className:"m-0",children:t.role}),(0,a.jsx)(h.A,{bordered:!1,className:"m-0",children:t.type})]})]})]})}},{title:e("assets.path"),dataIndex:"path",key:"path",render:e=>e?(0,a.jsx)("span",{className:"font-mono text-xs text-[var(--colorTextSecondary)] whitespace-normal break-all",children:e}):(0,a.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"-"})},{title:e("assets.source"),dataIndex:"source",key:"source",width:110,render:t=>(0,a.jsx)(h.A,{bordered:!1,className:"m-0",children:{knowledge_base:e("assets.sourceKnowledgeBase"),generated:e("assets.sourceGenerated"),uploaded:e("assets.sourceUploaded"),external_url:e("assets.sourceExternalUrl")}[t]||t})},{title:e("assets.usedDocuments"),dataIndex:"usedByDocumentIds",key:"usedByDocumentIds",width:100,render:e=>(0,a.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:e.length})},{title:e("assets.updatedAt"),dataIndex:"updatedAt",key:"updatedAt",width:130,render:e=>(0,a.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:new Date(e).toLocaleDateString()})},{title:e("assets.actions"),key:"actions",width:88,align:"right",render:(t,s)=>{let n=[...s.path?[{key:"copy",icon:(0,a.jsx)(w.A,{}),label:e("assets.copyPath"),onClick:()=>{F(s.path)}}]:[],...s.path?[{key:"open",icon:(0,a.jsx)(j.A,{}),label:e("assets.openFile"),onClick:()=>{R(s.id,"openFile")}}]:[],...s.path?[{key:"folder",icon:(0,a.jsx)(v.A,{}),label:e("assets.openDirectory"),onClick:()=>{R(s.id,"openDirectory")}}]:[],{type:"divider"},{key:"delete",icon:(0,a.jsx)(u.A,{}),label:e("common.delete"),danger:!0,onClick:()=>{R(s.id,"delete")}}];return(0,a.jsx)(x.A,{menu:{items:n},trigger:["click"],placement:"bottomRight",children:(0,a.jsx)(c.Ay,{type:"text",size:"small",icon:(0,a.jsx)(f.A,{}),onClick:e=>e.stopPropagation()})})}}]})]})}},85015:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/asset-library",function(){return s(63806)}])}},e=>{e.O(0,[
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{63806:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var a=s(65321),n=s(97109),r=s(17807),l=s(25258),o=s(88762),i=s(33442),c=s(85114),d=s(84253),p=s(21289),m=s(384),h=s(11702),x=s(71102),u=s(58209),y=s(75548),g=s(56768),w=s(93051),j=s(81668),v=s(64254),f=s(85855),k=s(48321),A=s(6578);let b={cover:"magenta",reference:"blue",generated:"purple",attachment:"cyan",map:"orange",operator:"geekblue"};function S(){let e=(0,k.Vr)(),{message:t}=r.A.useApp(),s=(t,s)=>e(t).replace("{count}",String(s)),[S,N]=(0,n.useState)([]),[C,T]=(0,n.useState)(new Set),[_,I]=(0,n.useState)(!0),[z,D]=(0,n.useState)(""),E=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z;try{N((await (0,A.f$)(e||void 0)).assets)}catch(e){N([])}};(0,n.useEffect)(()=>{let e=!1;return I(!0),(0,A.dx)().then(t=>{var s,a,n;if(e)return;let r=(null==(s=t.find(e=>e.selected))?void 0:s.projectRoot)||(null==(a=t.find(e=>e.isCurrent))?void 0:a.projectRoot)||(null==(n=t[0])?void 0:n.projectRoot)||"";return D(r),E(r)}).finally(()=>{e||I(!1)}),()=>{e=!0}},[]);let F=async s=>{var a;s&&(await (null==(a=navigator.clipboard)?void 0:a.writeText(s)),t.success(e("assets.copiedPath")))},R=async(s,a)=>{try{"openFile"===a?await (0,A.oS)(s,"file",z||void 0):"openDirectory"===a?await (0,A.oS)(s,"directory",z||void 0):"delete"===a&&(N((await (0,A.JU)(s,z||void 0)).assets),T(e=>{let t=new Set(e);return t.delete(s),t}))}catch(s){t.error(s instanceof Error?s.message:e("assets.operationFailed"))}},P=a=>{let n="selected"===a?[...C]:S.map(e=>e.id);0!==n.length&&l.A.confirm({title:"all"===a?e("assets.deleteAllConfirm"):s("assets.deleteSelectedConfirm",n.length),content:e("assets.deleteIrreversible"),okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{I(!0);try{await Promise.all(n.map(e=>(0,A.JU)(e,z||void 0))),await E(),T(new Set),t.success(s("assets.deleted",n.length))}catch(s){t.error(e("assets.batchDeleteFailed"))}finally{I(!1)}}})};return _?(0,a.jsx)("div",{className:"space-y-5 animateFadeIn",children:(0,a.jsx)(o.A,{active:!0,title:!0,paragraph:{rows:8}})}):(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"pageTitle",children:e("nav.assetLibrary")}),(0,a.jsx)("p",{className:"pageDesc",children:e("assets.description")})]}),(0,a.jsxs)(i.A,{size:8,children:[(0,a.jsx)("span",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:s("assets.total",S.length)}),(0,a.jsx)(c.Ay,{danger:!0,size:"small",disabled:0===C.size,icon:(0,a.jsx)(u.A,{}),onClick:()=>P("selected"),children:s("assets.deleteSelected",C.size||"")}),(0,a.jsx)(c.Ay,{danger:!0,size:"small",disabled:0===S.length,onClick:()=>P("all"),children:e("assets.deleteAll")})]})]}),0===S.length?(0,a.jsx)(d.A,{description:e("assets.empty")}):(0,a.jsx)(p.A,{className:"modern-table",rowKey:"id",size:"middle",dataSource:S,pagination:{pageSize:12,showSizeChanger:!0,pageSizeOptions:[12,24,48],showTotal:e=>s("assets.total",e)},rowSelection:{selectedRowKeys:[...C],onChange:e=>T(new Set(e.map(String)))},columns:[{title:e("assets.resource"),dataIndex:"name",key:"name",width:360,render:(e,t)=>{let s="image"===t.type&&t.path?"/api/assets/generated/preview?id=".concat(encodeURIComponent(t.id)).concat(z?"&projectRoot=".concat(encodeURIComponent(z)):""):void 0;return(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-lg bg-[var(--colorBgHover)] flex items-center justify-center overflow-hidden shrink-0",children:s?(0,a.jsx)(m.A,{src:s,alt:t.name,width:48,height:48,style:{objectFit:"cover"},preview:!1}):"image"===t.type?(0,a.jsx)(y.A,{className:"text-[var(--colorWarning)]"}):(0,a.jsx)(g.A,{className:"text-[var(--colorAccent)]"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"font-medium text-[var(--colorText)] whitespace-normal break-words leading-snug",children:t.name}),(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap gap-1",children:[(0,a.jsx)(h.A,{color:b[t.role]||"blue",bordered:!1,className:"m-0",children:t.role}),(0,a.jsx)(h.A,{bordered:!1,className:"m-0",children:t.type})]})]})]})}},{title:e("assets.path"),dataIndex:"path",key:"path",render:e=>e?(0,a.jsx)("span",{className:"font-mono text-xs text-[var(--colorTextSecondary)] whitespace-normal break-all",children:e}):(0,a.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"-"})},{title:e("assets.source"),dataIndex:"source",key:"source",width:110,render:t=>(0,a.jsx)(h.A,{bordered:!1,className:"m-0",children:{knowledge_base:e("assets.sourceKnowledgeBase"),generated:e("assets.sourceGenerated"),uploaded:e("assets.sourceUploaded"),external_url:e("assets.sourceExternalUrl")}[t]||t})},{title:e("assets.usedDocuments"),dataIndex:"usedByDocumentIds",key:"usedByDocumentIds",width:100,render:e=>(0,a.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:e.length})},{title:e("assets.updatedAt"),dataIndex:"updatedAt",key:"updatedAt",width:130,render:e=>(0,a.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:new Date(e).toLocaleDateString()})},{title:e("assets.actions"),key:"actions",width:88,align:"right",render:(t,s)=>{let n=[...s.path?[{key:"copy",icon:(0,a.jsx)(w.A,{}),label:e("assets.copyPath"),onClick:()=>{F(s.path)}}]:[],...s.path?[{key:"open",icon:(0,a.jsx)(j.A,{}),label:e("assets.openFile"),onClick:()=>{R(s.id,"openFile")}}]:[],...s.path?[{key:"folder",icon:(0,a.jsx)(v.A,{}),label:e("assets.openDirectory"),onClick:()=>{R(s.id,"openDirectory")}}]:[],{type:"divider"},{key:"delete",icon:(0,a.jsx)(u.A,{}),label:e("common.delete"),danger:!0,onClick:()=>{R(s.id,"delete")}}];return(0,a.jsx)(x.A,{menu:{items:n},trigger:["click"],placement:"bottomRight",children:(0,a.jsx)(c.Ay,{type:"text",size:"small",icon:(0,a.jsx)(f.A,{}),onClick:e=>e.stopPropagation()})})}}]})]})}},85015:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/asset-library",function(){return s(63806)}])}},e=>{e.O(0,[580,665,209,7,289,238,636,593,792],()=>e(e.s=85015)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[623],{23507:(e,l,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/document-roles",function(){return r(59889)}])},59889:(e,l,r)=>{"use strict";r.r(l),r.d(l,{default:()=>Q});var s=r(65321),o=r(97109),t=r(35292),n=r(17807),i=r(63455),a=r(11702),c=r(84253),d=r(85114),p=r(26171),x=r(33442),m=r(50883),u=r(85493),h=r(58569),g=r(34052),f=r(7576),j=r(2256),y=r(38770),v=r(68787),b=r(25345),A=r(80042),N=r(75548),w=r(26631),I=r(84662),S=r(30486),T=r(99650),C=r(8263),R=r(84742),k=r(43094),z=r(8579),B=r(81668),_=r(58209),F=r(96091),E=r(54746),O=r(96651),D=r(60470),P=r(6578),H=r(48321);let{Paragraph:U}=t.A,q={rule:(0,s.jsx)(b.A,{}),table:(0,s.jsx)(A.A,{}),drawing:(0,s.jsx)(N.A,{}),specification:(0,s.jsx)(w.A,{}),reference:(0,s.jsx)(I.A,{})},L={fact_extraction:(0,s.jsx)(S.A,{}),chapter_generation:(0,s.jsx)(T.A,{}),llm_review:(0,s.jsx)(C.A,{}),validation:(0,s.jsx)(R.A,{}),formatting:(0,s.jsx)(k.A,{}),reference:(0,s.jsx)(I.A,{})},V={rule:"#fa8c16",table:"#52c41a",drawing:"#722ed1",specification:"#eb2f96",reference:"#13c2c2"},W={fact_extraction:"#fa8c16",chapter_generation:"#1677ff",llm_review:"#722ed1",validation:"#52c41a",formatting:"#eb2f96",reference:"#13c2c2"},G={rule:"roles.ruleFile",table:"roles.tableFile",drawing:"roles.drawingFile",specification:"roles.specificationFile",reference:"roles.reference"},J={fact_extraction:"roles.factExtraction",chapter_generation:"roles.chapterGeneration",llm_review:"roles.llmReview",validation:"roles.validation",formatting:"roles.formatting",reference:"roles.reference"};function M(e,l){let r=new Blob([JSON.stringify(l,null,2)],{type:"application/json;charset=utf-8"}),s=URL.createObjectURL(r),o=document.createElement("a");o.href=s,o.download=e,o.click(),URL.revokeObjectURL(s)}function X(e){return e.trim().replace(/[\\/:*?"<>|]/g,"-").slice(0,80)||"untitled"}function K(e,l){return{type:"customize-agent.documentRoles",version:1,exportedAt:new Date().toISOString(),roles:e,configs:l}}function Q(){let e,l,r=(0,H.Vr)(),{message:t}=n.A.useApp(),[b]=i.A.useForm(),[A]=i.A.useForm(),[N,I]=(0,o.useState)([]),[S,C]=(0,o.useState)([]),[R,k]=(0,o.useState)([]),[Q,Y]=(0,o.useState)(!1),[Z,$]=(0,o.useState)(!1),[ee,el]=(0,o.useState)(!1),[er,es]=(0,o.useState)("file"),[eo,et]=(0,o.useState)("custom"),[en,ei]=(0,o.useState)(!1),ea=(0,o.useRef)(null),ec=async()=>{let[e,l]=await Promise.all([(0,P.lv)(),(0,P.dx)()]);I(e.roles),C(e.configs),k(l)};(0,o.useEffect)(()=>{ec().catch(()=>t.error(r("common.error")))},[t,r]);let ed=()=>"all"===eo||"custom"===eo,ep=N.filter(ed),ex=S.filter(ed),em=ep.filter(e=>"file"===e.type),eu=ep.filter(e=>"prompt"===e.type),eh=N.filter(e=>"file"===e.type),eg=N.filter(e=>"prompt"===e.type),ef=async()=>{try{let e=await b.validateFields(),l="file"===e.type?{...e,resourceId:void 0,resourceIds:[]}:e,s=await (0,P.dg)(l);I(s.roles),C(s.configs),Y(!1),t.success(r("common.success"))}catch(e){t.error(r("common.error"))}},ej=async()=>{try{let e=await A.validateFields(),l=e=>(null!=e?e:[]).map((e,l)=>{var r;return{roleId:e.roleId,order:Number(null!=(r=e.order)?r:l)}}),s=await (0,P.NR)({...e,fileRoles:l(e.fileRoles),promptRoles:l(e.promptRoles)});I(s.roles),C(s.configs),$(!1),t.success(r("common.success"))}catch(e){t.error(r("common.error"))}},ey=async e=>{try{let l=await (0,P.FV)(e.type,e.id);I(l.roles),C(l.configs),t.success("角色已删除")}catch(e){t.error(e instanceof Error?e.message:"角色删除失败")}},ev=async e=>{try{let l=await (0,P.dw)(e);I(l.roles),C(l.configs),t.success("项目角色配置已删除")}catch(e){t.error(e instanceof Error?e.message:"项目角色配置删除失败")}},eb=async e=>{if(e){ei(!0);try{let l=JSON.parse(await e.text()),r=await fetch("/api/documents/roles?mode=import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!r.ok)throw Error(await r.text());let s=await r.json();I(s.roles),C(s.configs),t.success("已导入 ".concat(s.importedRoles," 个角色、").concat(s.importedConfigs," 个配置"))}catch(e){t.error("导入失败,请确认 JSON 文件格式正确")}finally{ei(!1),ea.current&&(ea.current.value="")}}},eA=function(e){var l;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file";b.setFieldsValue(e?{...e,resourceIds:(null==(l=e.resourceIds)?void 0:l.length)?e.resourceIds:e.resourceId?[e.resourceId]:[]}:{id:"role-".concat(Date.now()),name:"",description:"",type:r,resourceIds:[],executionType:"prompt"===r?"reference":void 0,processingType:"file"===r?"reference":void 0}),Y(!0)},eN=e=>{A.setFieldsValue(null!=e?e:{id:"config-".concat(Date.now()),name:"",description:"",fileRoles:[],promptRoles:[],builtIn:!1}),$(!0)},ew=e=>N.find(l=>l.id===e),eI=e=>{var l;return(null==e?void 0:e.type)==="prompt"?(null==(l=e.resourceIds)?void 0:l.length)?e.resourceIds:e.resourceId?[e.resourceId]:[]:[]},eS=e=>{var l;return(null==(l=R.find(l=>l.id===e))?void 0:l.projectName)||e},eT=e=>(0,s.jsx)(a.A,{closable:e.closable,onClose:e.onClose,color:"purple",title:e.value,style:{margin:"1px 2px",fontSize:11,lineHeight:"18px"},children:eS(e.value)}),eC=(e,l)=>{let o="file"===l?"blue":"purple",t="file"===l?G:J,n=[...e].sort((e,l)=>{var r,s;return Number(null!=(r=e.order)?r:0)-Number(null!=(s=l.order)?s:0)}).map(e=>ew(e.roleId)).filter(e=>!!e);return 0===n.length?(0,s.jsx)(c.A,{image:c.A.PRESENTED_IMAGE_SIMPLE,description:"file"===l?r("roles.noFileRoleSelected"):r("roles.noPromptRoleSelected")}):(0,s.jsx)("div",{className:"flex flex-col gap-2",children:n.map((e,l)=>{var n,i;let c=eI(e),d="file"===e.type?null!=(n=e.processingType)?n:"":null!=(i=e.executionType)?i:"";return(0,s.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-[var(--colorBgContainer)] border border-[var(--borderColor)]",children:[(0,s.jsxs)(a.A,{color:o,className:"m-0",children:["#",l+1]}),(0,s.jsx)("span",{className:"font-semibold flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e.name}),(0,s.jsx)(a.A,{className:"m-0",children:r(t[d]||"roles.reference")}),"prompt"===e.type&&(0,s.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:r("roles.bindPromptCount").replace("{count}",String(c.length))})]},e.id)})})},eR=e=>{if(!e)return null;let l=eI(e);return(0,s.jsxs)("div",{style:{marginTop:8,padding:8,borderRadius:8,background:"var(--colorFillQuaternary)",fontSize:12,color:"var(--colorTextSecondary)"},children:[e.description&&(0,s.jsx)("div",{style:{marginBottom:4*("prompt"===e.type)},children:e.description}),"prompt"===e.type&&(0,s.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[l.slice(0,4).map(e=>(0,s.jsx)(a.A,{title:e,style:{margin:0,fontSize:10,lineHeight:"16px",maxWidth:180,overflow:"hidden",textOverflow:"ellipsis"},children:eS(e)},e)),l.length>4&&(0,s.jsxs)(a.A,{style:{margin:0,fontSize:10,lineHeight:"16px"},children:["+",l.length-4]}),0===l.length&&(0,s.jsx)("span",{children:"未绑定提示词"})]})]})};return(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"pageTitle",children:r("roles.title")}),(0,s.jsx)("p",{className:"pageDesc",children:r("roles.description")})]}),(0,s.jsxs)(x.A,{children:[(0,s.jsx)(m.A,{value:eo,onChange:et,style:{width:170},options:[{label:"我的配置 (".concat(N.length+S.length,")"),value:"custom"},{label:"全部来源 (".concat(N.length+S.length,")"),value:"all"}]}),(0,s.jsx)("input",{ref:ea,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:e=>{var l;eb(null==(l=e.target.files)?void 0:l[0])}}),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(F.A,{}),loading:en,onClick:()=>{var e;return null==(e=ea.current)?void 0:e.click()},children:"导入"}),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(B.A,{}),disabled:N.length+S.length===0,onClick:()=>{M("customize-document-roles-".concat(new Date().toISOString().slice(0,10),".json"),K(N,S)),t.success("已导出 ".concat(N.length," 个角色、").concat(S.length," 个配置"))},children:"导出全部"}),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(E.A,{}),onClick:()=>eA(void 0,"file"),children:r("roles.newFileRole")}),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(E.A,{}),onClick:()=>eA(void 0,"prompt"),children:r("roles.newPromptRole")}),(0,s.jsx)(d.Ay,{type:"primary",icon:(0,s.jsx)(E.A,{}),onClick:()=>eN(),children:r("roles.newConfig")})]})]}),(0,s.jsx)(u.A,{type:"info",showIcon:!0,message:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,s.jsx)("span",{children:r("roles.plainGuideTitle")}),(0,s.jsx)(d.Ay,{type:"link",size:"small",icon:ee?(0,s.jsx)(O.A,{}):(0,s.jsx)(D.A,{}),onClick:()=>el(!ee),style:{padding:"0 4px"},children:ee?"收起说明":"展开说明"})]}),description:ee?r("roles.plainGuideDesc"):void 0}),(0,s.jsxs)("div",{className:"bg-[var(--colorBg)] rounded-xl border border-[var(--borderColor)] mt-4",children:[(0,s.jsx)(h.A,{className:"px-6 pt-2 custom-tabs",items:[{key:"file",label:"文件角色 (".concat(em.length,")")},{key:"prompt",label:"提示词角色 (".concat(eu.length,")")},{key:"configs",label:"项目角色配置 (".concat(ex.length,")")}],activeKey:er,onChange:es}),(0,s.jsx)("div",{className:"p-6 pt-2",children:"configs"===er?0===ex.length?(0,s.jsx)(c.A,{description:r("common.noData")}):(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:ex.map(e=>{let l=e.fileRoles.map(e=>({...e,role:ew(e.roleId)})).filter(e=>e.role),o=e.promptRoles.map(e=>({...e,role:ew(e.roleId)})).filter(e=>e.role);return(0,s.jsxs)("div",{className:"group p-5 rounded-xl border border-transparent hover:border-[var(--borderColorStrong)] bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] hover:shadow-sm flex flex-col transition-all duration-300 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-4 min-w-0",children:[(0,s.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate flex-1",children:e.name}),(0,s.jsx)("div",{className:"flex gap-2 flex-shrink-0",children:(0,s.jsx)(a.A,{color:"cyan",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:"我的配置"})})]}),e.description&&(0,s.jsx)(U,{ellipsis:{rows:2},className:"text-xs text-[var(--colorTextSecondary)] mb-4",children:e.description}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 mt-auto pt-4 border-t border-[var(--borderColor)]",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:["文件角色 (",e.fileRoles.length,")"]}),l.length>0?(0,s.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[l.slice(0,4).map(e=>(0,s.jsx)(a.A,{color:"blue",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:e.role.name},e.roleId)),l.length>4&&(0,s.jsxs)(a.A,{bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:["+",l.length-4]})]}):(0,s.jsx)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:"无"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:["提示词角色 (",e.promptRoles.length,")"]}),o.length>0?(0,s.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[o.slice(0,4).map(e=>(0,s.jsx)(a.A,{color:"purple",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:e.role.name},e.roleId)),o.length>4&&(0,s.jsxs)(a.A,{bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:["+",o.length-4]})]}):(0,s.jsx)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:"无"})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-1 opacity-0 group-hover:opacity-100 transition-opacity mt-4",children:[(0,s.jsx)(d.Ay,{type:"text",size:"small",icon:(0,s.jsx)(T.A,{className:"text-[var(--colorTextSecondary)]"}),onClick:()=>eN(e)}),!e.builtIn&&(0,s.jsx)(d.Ay,{type:"text",size:"small",icon:(0,s.jsx)(B.A,{className:"text-[var(--colorTextSecondary)]"}),onClick:()=>(e=>{let l=new Set([...e.fileRoles.map(e=>e.roleId),...e.promptRoles.map(e=>e.roleId)]);M("customize-role-config-".concat(X(e.name),"-").concat(new Date().toISOString().slice(0,10),".json"),K(N.filter(e=>l.has(e.id)&&!e.builtIn),[e])),t.success("已导出 1 个配置")})(e)}),(0,s.jsx)(p.A,{title:r("common.confirm"),onConfirm:()=>{ev(e.id)},children:(0,s.jsx)(d.Ay,{type:"text",size:"small",danger:!0,icon:(0,s.jsx)(_.A,{})})})]})]},e.id)})}):(e="file"===er?em:eu,l=r,0===e.length?(0,s.jsx)(c.A,{description:r("common.noData")}):(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:e.map(e=>{var o,n,i,c,x,m,u,h,g;let f="prompt"===e.type?(null==(o=e.resourceIds)?void 0:o.length)?e.resourceIds:e.resourceId?[e.resourceId]:[]:[],j=f.slice(0,3),y=f.length-j.length,v="file"===e.type?null!=(i=q[null!=(n=e.processingType)?n:""])?i:(0,s.jsx)(w.A,{}):null!=(x=L[null!=(c=e.executionType)?c:""])?x:(0,s.jsx)(z.A,{}),b="file"===e.type?null!=(u=V[null!=(m=e.processingType)?m:""])?u:"var(--colorAccent)":null!=(g=W[null!=(h=e.executionType)?h:""])?g:"var(--colorWarning)";return(0,s.jsxs)("div",{className:"group p-5 rounded-xl border border-transparent hover:border-[var(--borderColorStrong)] bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] hover:shadow-sm flex flex-col transition-all duration-300 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-4 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,s.jsx)("span",{style:{color:b,fontSize:20,flexShrink:0,lineHeight:1},children:v}),(0,s.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate mb-1",children:e.name})]}),(0,s.jsx)("div",{className:"flex gap-2 flex-shrink-0",children:(0,s.jsx)(a.A,{color:"cyan",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:"我的角色"})})]}),e.description&&(0,s.jsx)(U,{ellipsis:{rows:2},className:"text-xs text-[var(--colorTextSecondary)] mb-4",children:e.description}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 mt-auto pt-4 border-t border-[var(--borderColor)]",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)(a.A,{color:"file"===e.type?"blue":"purple",bordered:!1,className:"m-0",children:function(e,l){var r,s,o;let t="file"===e.type?G[null!=(r=e.processingType)?r:""]:J[null!=(s=e.executionType)?s:""];return t?l(t):null!=(o="file"===e.type?e.processingType:e.executionType)?o:""}(e,l)}),f.length>0&&(0,s.jsxs)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:["绑定 ",f.length," 个提示词"]})]}),j.length>0&&(0,s.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[j.map(e=>(0,s.jsx)(a.A,{color:"purple",bordered:!1,title:e,className:"m-0 text-[10px] leading-[18px] max-w-[140px] truncate",children:eS(e)},e)),y>0&&(0,s.jsxs)(a.A,{bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:["+",y]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-1 opacity-0 group-hover:opacity-100 transition-opacity mt-2",children:[(0,s.jsx)(d.Ay,{type:"text",size:"small",icon:(0,s.jsx)(T.A,{className:"text-[var(--colorTextSecondary)]"}),onClick:()=>eA(e)}),!e.builtIn&&(0,s.jsx)(d.Ay,{type:"text",size:"small",icon:(0,s.jsx)(B.A,{className:"text-[var(--colorTextSecondary)]"}),onClick:()=>{M("customize-role-".concat(X(e.name),"-").concat(new Date().toISOString().slice(0,10),".json"),K([e],[])),t.success("已导出 1 个角色")}}),(0,s.jsx)(p.A,{title:r("common.confirm"),onConfirm:()=>{ey(e)},children:(0,s.jsx)(d.Ay,{type:"text",size:"small",danger:!0,icon:(0,s.jsx)(_.A,{})})})]})]})]},e.id)})}))})]}),(0,s.jsx)(g.A,{title:r("roles.roleEditor"),open:Q,onClose:()=>Y(!1),size:"large",maskClosable:!1,styles:{body:{padding:"24px 32px"},header:{padding:"16px 32px",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,s.jsx)(d.Ay,{type:"primary",onClick:()=>{ef()},children:r("common.save")}),children:(0,s.jsxs)(i.A,{form:b,layout:"vertical",children:[(0,s.jsx)(i.A.Item,{name:"id",hidden:!0,children:(0,s.jsx)(f.A,{})}),(0,s.jsxs)(j.A,{gutter:16,children:[(0,s.jsx)(y.A,{span:12,children:(0,s.jsx)(i.A.Item,{name:"type",label:r("roles.roleType"),rules:[{required:!0}],children:(0,s.jsx)(m.A,{options:[{label:r("roles.fileRole"),value:"file"},{label:r("roles.promptRole"),value:"prompt"}]})})}),(0,s.jsx)(y.A,{span:12,children:(0,s.jsx)(i.A.Item,{name:"name",label:r("roles.roleName"),rules:[{required:!0}],children:(0,s.jsx)(f.A,{})})})]}),(0,s.jsx)(i.A.Item,{name:"description",label:r("roles.roleDescription"),children:(0,s.jsx)(f.A.TextArea,{rows:2})}),(0,s.jsx)(i.A.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.type!==l.type,children:e=>{let{getFieldValue:l}=e,o="prompt"===l("type");return(0,s.jsx)(v.A,{size:"small",title:o?"提示词角色配置":"文件角色配置",style:{border:"1px solid var(--colorBorderSecondary)"},children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A.Item,{name:"executionType",label:r("roles.executionType"),rules:[{required:!0}],style:{marginBottom:12},children:(0,s.jsx)(m.A,{options:[{label:r("roles.factExtraction"),value:"fact_extraction"},{label:r("roles.chapterGeneration"),value:"chapter_generation"},{label:r("roles.validation"),value:"validation"},{label:r("roles.formatting"),value:"formatting"},{label:r("roles.reference"),value:"reference"}]})}),(0,s.jsx)(i.A.Item,{name:"resourceIds",label:r("roles.bindPrompt"),style:{marginBottom:0},help:(0,s.jsx)("span",{style:{fontSize:11,color:"var(--colorTextSecondary)"},children:r("roles.multiBindPromptHelp")}),children:(0,s.jsx)(m.A,{mode:"multiple",showSearch:!0,tagRender:eT,placeholder:"选择提示词",options:R.filter(e=>e.hasFile).map(e=>({label:e.projectName,value:e.id}))})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A.Item,{name:"processingType",label:r("roles.processingType"),rules:[{required:!0}],style:{marginBottom:12},children:(0,s.jsx)(m.A,{options:[{label:r("roles.ruleFile"),value:"rule"},{label:r("roles.tableFile"),value:"table"},{label:r("roles.drawingFile"),value:"drawing"},{label:r("roles.specificationFile"),value:"specification"},{label:r("roles.reference"),value:"reference"}]})}),(0,s.jsx)(u.A,{type:"info",showIcon:!0,message:"文件角色只定义处理类型",description:"具体项目文件由生成流程自动识别,或在模板的高级固定绑定资料中手动覆盖;这里不再绑定知识库文件,避免角色复用时混入其他项目资料。"})]})})}})]})}),(0,s.jsx)(g.A,{title:r("roles.configEditor"),open:Z,onClose:()=>$(!1),size:"large",maskClosable:!1,styles:{body:{padding:"24px 32px"},header:{padding:"16px 32px",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,s.jsx)(d.Ay,{type:"primary",onClick:()=>{ej()},children:r("common.save")}),children:(0,s.jsxs)(i.A,{form:A,layout:"vertical",children:[(0,s.jsx)(i.A.Item,{name:"id",hidden:!0,children:(0,s.jsx)(f.A,{})}),(0,s.jsxs)(j.A,{gutter:16,children:[(0,s.jsx)(y.A,{span:12,children:(0,s.jsx)(i.A.Item,{name:"name",label:r("roles.configName"),rules:[{required:!0}],children:(0,s.jsx)(f.A,{})})}),(0,s.jsx)(y.A,{span:12,children:(0,s.jsx)(i.A.Item,{name:"description",label:r("roles.configDescription"),children:(0,s.jsx)(f.A,{})})})]}),(0,s.jsx)(i.A.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.fileRoles!==l.fileRoles||e.promptRoles!==l.promptRoles,children:e=>{let{getFieldValue:l}=e,o=l("fileRoles")||[],t=l("promptRoles")||[];return(0,s.jsx)(h.A,{destroyInactiveTabPane:!1,items:[{key:"file",label:"文件角色 (".concat(o.length,"/").concat(eh.length,")"),children:(0,s.jsx)(i.A.List,{name:"fileRoles",children:(e,l)=>{let{add:t,remove:n}=l;return(0,s.jsxs)("div",{className:"flex flex-col gap-6 pt-4",children:[(0,s.jsx)(v.A,{size:"small",title:"已选文件角色",className:"bg-[var(--colorBgHover)] border-[var(--borderColorStrong)]",styles:{header:{borderBottom:"1px solid var(--borderColorStrong)"}},children:eC(o,"file")}),0===e.length&&(0,s.jsx)(c.A,{description:"暂未添加文件角色"}),e.map((e,l)=>(0,s.jsxs)(v.A,{size:"small",style:{border:"1px solid var(--colorBorderSecondary)",position:"relative"},children:[(0,s.jsxs)("div",{style:{position:"absolute",top:-10,left:12,background:"#1677ff",color:"#fff",fontSize:11,fontWeight:700,padding:"1px 8px",borderRadius:10},children:["#",l+1]}),(0,s.jsx)(d.Ay,{danger:!0,size:"small",icon:(0,s.jsx)(_.A,{}),onClick:()=>n(e.name),style:{position:"absolute",top:8,right:8,zIndex:1}}),(0,s.jsxs)(j.A,{gutter:[16,8],align:"middle",style:{marginTop:4},children:[(0,s.jsxs)(y.A,{flex:"auto",children:[(0,s.jsx)(i.A.Item,{name:[e.name,"roleId"],label:"文件角色",rules:[{required:!0}],style:{marginBottom:0},children:(0,s.jsx)(m.A,{placeholder:"选择文件角色",size:"small",options:eh.map(e=>{var l;return{label:"".concat(e.name," (").concat(r(G[null!=(l=e.processingType)?l:""]||"roles.reference"),")"),value:e.id}})})}),(0,s.jsx)(i.A.Item,{noStyle:!0,shouldUpdate:!0,children:l=>{let{getFieldValue:r}=l;return eR(ew(r(["fileRoles",e.name,"roleId"])))}})]}),(0,s.jsx)(y.A,{style:{width:90},children:(0,s.jsx)(i.A.Item,{name:[e.name,"order"],label:"排序",initialValue:l,style:{marginBottom:0},children:(0,s.jsx)(f.A,{type:"number",size:"small"})})})]})]},e.key)),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(E.A,{}),onClick:()=>t({order:e.length}),children:r("roles.addRole")})]})}})},{key:"prompt",label:"提示词角色 (".concat(t.length,"/").concat(eg.length,")"),children:(0,s.jsx)(i.A.List,{name:"promptRoles",children:(e,l)=>{let{add:o,remove:n}=l;return(0,s.jsxs)("div",{className:"flex flex-col gap-6 pt-4",children:[(0,s.jsx)(v.A,{size:"small",title:"已选提示词角色",className:"bg-[var(--colorBgHover)] border-[var(--borderColorStrong)]",styles:{header:{borderBottom:"1px solid var(--borderColorStrong)"}},children:eC(t,"prompt")}),0===e.length&&(0,s.jsx)(c.A,{description:"暂未添加提示词角色"}),e.map((e,l)=>(0,s.jsxs)(v.A,{size:"small",style:{border:"1px solid var(--colorBorderSecondary)",position:"relative"},children:[(0,s.jsxs)("div",{style:{position:"absolute",top:-10,left:12,background:"#722ed1",color:"#fff",fontSize:11,fontWeight:700,padding:"1px 8px",borderRadius:10},children:["#",l+1]}),(0,s.jsx)(d.Ay,{danger:!0,size:"small",icon:(0,s.jsx)(_.A,{}),onClick:()=>n(e.name),style:{position:"absolute",top:8,right:8,zIndex:1}}),(0,s.jsxs)(j.A,{gutter:[16,8],align:"middle",style:{marginTop:4},children:[(0,s.jsxs)(y.A,{flex:"auto",children:[(0,s.jsx)(i.A.Item,{name:[e.name,"roleId"],label:"提示词角色",rules:[{required:!0}],style:{marginBottom:0},children:(0,s.jsx)(m.A,{placeholder:"选择提示词角色",size:"small",options:eg.map(e=>{var l;return{label:"".concat(e.name," (").concat(r(J[null!=(l=e.executionType)?l:""]||"roles.reference"),")"),value:e.id}})})}),(0,s.jsx)(i.A.Item,{noStyle:!0,shouldUpdate:!0,children:l=>{let{getFieldValue:r}=l;return eR(ew(r(["promptRoles",e.name,"roleId"])))}})]}),(0,s.jsx)(y.A,{style:{width:90},children:(0,s.jsx)(i.A.Item,{name:[e.name,"order"],label:"排序",initialValue:l,style:{marginBottom:0},children:(0,s.jsx)(f.A,{type:"number",size:"small"})})})]})]},e.key)),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(E.A,{}),onClick:()=>o({order:e.length}),children:r("roles.addRole")})]})}})}]})}})]})})]})}}},e=>{e.O(0,[433,155,576,787,195,455,466,636,593,792],()=>e(e.s=23507)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[623],{23507:(e,l,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/document-roles",function(){return r(59889)}])},59889:(e,l,r)=>{"use strict";r.r(l),r.d(l,{default:()=>Q});var s=r(65321),o=r(97109),t=r(35292),n=r(17807),i=r(63455),a=r(11702),c=r(84253),d=r(85114),p=r(26171),x=r(33442),m=r(50883),u=r(85493),h=r(58569),g=r(34052),f=r(7576),j=r(2256),y=r(38770),v=r(68787),b=r(25345),A=r(80042),N=r(75548),w=r(26631),I=r(84662),S=r(30486),T=r(99650),C=r(8263),R=r(84742),k=r(43094),z=r(8579),B=r(81668),_=r(58209),F=r(96091),E=r(54746),O=r(96651),D=r(60470),P=r(6578),H=r(48321);let{Paragraph:U}=t.A,q={rule:(0,s.jsx)(b.A,{}),table:(0,s.jsx)(A.A,{}),drawing:(0,s.jsx)(N.A,{}),specification:(0,s.jsx)(w.A,{}),reference:(0,s.jsx)(I.A,{})},L={fact_extraction:(0,s.jsx)(S.A,{}),chapter_generation:(0,s.jsx)(T.A,{}),llm_review:(0,s.jsx)(C.A,{}),validation:(0,s.jsx)(R.A,{}),formatting:(0,s.jsx)(k.A,{}),reference:(0,s.jsx)(I.A,{})},V={rule:"#fa8c16",table:"#52c41a",drawing:"#722ed1",specification:"#eb2f96",reference:"#13c2c2"},W={fact_extraction:"#fa8c16",chapter_generation:"#1677ff",llm_review:"#722ed1",validation:"#52c41a",formatting:"#eb2f96",reference:"#13c2c2"},G={rule:"roles.ruleFile",table:"roles.tableFile",drawing:"roles.drawingFile",specification:"roles.specificationFile",reference:"roles.reference"},J={fact_extraction:"roles.factExtraction",chapter_generation:"roles.chapterGeneration",llm_review:"roles.llmReview",validation:"roles.validation",formatting:"roles.formatting",reference:"roles.reference"};function M(e,l){let r=new Blob([JSON.stringify(l,null,2)],{type:"application/json;charset=utf-8"}),s=URL.createObjectURL(r),o=document.createElement("a");o.href=s,o.download=e,o.click(),URL.revokeObjectURL(s)}function X(e){return e.trim().replace(/[\\/:*?"<>|]/g,"-").slice(0,80)||"untitled"}function K(e,l){return{type:"customize-agent.documentRoles",version:1,exportedAt:new Date().toISOString(),roles:e,configs:l}}function Q(){let e,l,r=(0,H.Vr)(),{message:t}=n.A.useApp(),[b]=i.A.useForm(),[A]=i.A.useForm(),[N,I]=(0,o.useState)([]),[S,C]=(0,o.useState)([]),[R,k]=(0,o.useState)([]),[Q,Y]=(0,o.useState)(!1),[Z,$]=(0,o.useState)(!1),[ee,el]=(0,o.useState)(!1),[er,es]=(0,o.useState)("file"),[eo,et]=(0,o.useState)("custom"),[en,ei]=(0,o.useState)(!1),ea=(0,o.useRef)(null),ec=async()=>{let[e,l]=await Promise.all([(0,P.lv)(),(0,P.dx)()]);I(e.roles),C(e.configs),k(l)};(0,o.useEffect)(()=>{ec().catch(()=>t.error(r("common.error")))},[t,r]);let ed=()=>"all"===eo||"custom"===eo,ep=N.filter(ed),ex=S.filter(ed),em=ep.filter(e=>"file"===e.type),eu=ep.filter(e=>"prompt"===e.type),eh=N.filter(e=>"file"===e.type),eg=N.filter(e=>"prompt"===e.type),ef=async()=>{try{let e=await b.validateFields(),l="file"===e.type?{...e,resourceId:void 0,resourceIds:[]}:e,s=await (0,P.dg)(l);I(s.roles),C(s.configs),Y(!1),t.success(r("common.success"))}catch(e){t.error(r("common.error"))}},ej=async()=>{try{let e=await A.validateFields(),l=e=>(null!=e?e:[]).map((e,l)=>{var r;return{roleId:e.roleId,order:Number(null!=(r=e.order)?r:l)}}),s=await (0,P.NR)({...e,fileRoles:l(e.fileRoles),promptRoles:l(e.promptRoles)});I(s.roles),C(s.configs),$(!1),t.success(r("common.success"))}catch(e){t.error(r("common.error"))}},ey=async e=>{try{let l=await (0,P.FV)(e.type,e.id);I(l.roles),C(l.configs),t.success("角色已删除")}catch(e){t.error(e instanceof Error?e.message:"角色删除失败")}},ev=async e=>{try{let l=await (0,P.dw)(e);I(l.roles),C(l.configs),t.success("项目角色配置已删除")}catch(e){t.error(e instanceof Error?e.message:"项目角色配置删除失败")}},eb=async e=>{if(e){ei(!0);try{let l=JSON.parse(await e.text()),r=await fetch("/api/documents/roles?mode=import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!r.ok)throw Error(await r.text());let s=await r.json();I(s.roles),C(s.configs),t.success("已导入 ".concat(s.importedRoles," 个角色、").concat(s.importedConfigs," 个配置"))}catch(e){t.error("导入失败,请确认 JSON 文件格式正确")}finally{ei(!1),ea.current&&(ea.current.value="")}}},eA=function(e){var l;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file";b.setFieldsValue(e?{...e,resourceIds:(null==(l=e.resourceIds)?void 0:l.length)?e.resourceIds:e.resourceId?[e.resourceId]:[]}:{id:"role-".concat(Date.now()),name:"",description:"",type:r,resourceIds:[],executionType:"prompt"===r?"reference":void 0,processingType:"file"===r?"reference":void 0}),Y(!0)},eN=e=>{A.setFieldsValue(null!=e?e:{id:"config-".concat(Date.now()),name:"",description:"",fileRoles:[],promptRoles:[],builtIn:!1}),$(!0)},ew=e=>N.find(l=>l.id===e),eI=e=>{var l;return(null==e?void 0:e.type)==="prompt"?(null==(l=e.resourceIds)?void 0:l.length)?e.resourceIds:e.resourceId?[e.resourceId]:[]:[]},eS=e=>{var l;return(null==(l=R.find(l=>l.id===e))?void 0:l.projectName)||e},eT=e=>(0,s.jsx)(a.A,{closable:e.closable,onClose:e.onClose,color:"purple",title:e.value,style:{margin:"1px 2px",fontSize:11,lineHeight:"18px"},children:eS(e.value)}),eC=(e,l)=>{let o="file"===l?"blue":"purple",t="file"===l?G:J,n=[...e].sort((e,l)=>{var r,s;return Number(null!=(r=e.order)?r:0)-Number(null!=(s=l.order)?s:0)}).map(e=>ew(e.roleId)).filter(e=>!!e);return 0===n.length?(0,s.jsx)(c.A,{image:c.A.PRESENTED_IMAGE_SIMPLE,description:"file"===l?r("roles.noFileRoleSelected"):r("roles.noPromptRoleSelected")}):(0,s.jsx)("div",{className:"flex flex-col gap-2",children:n.map((e,l)=>{var n,i;let c=eI(e),d="file"===e.type?null!=(n=e.processingType)?n:"":null!=(i=e.executionType)?i:"";return(0,s.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-[var(--colorBgContainer)] border border-[var(--borderColor)]",children:[(0,s.jsxs)(a.A,{color:o,className:"m-0",children:["#",l+1]}),(0,s.jsx)("span",{className:"font-semibold flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e.name}),(0,s.jsx)(a.A,{className:"m-0",children:r(t[d]||"roles.reference")}),"prompt"===e.type&&(0,s.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:r("roles.bindPromptCount").replace("{count}",String(c.length))})]},e.id)})})},eR=e=>{if(!e)return null;let l=eI(e);return(0,s.jsxs)("div",{style:{marginTop:8,padding:8,borderRadius:8,background:"var(--colorFillQuaternary)",fontSize:12,color:"var(--colorTextSecondary)"},children:[e.description&&(0,s.jsx)("div",{style:{marginBottom:4*("prompt"===e.type)},children:e.description}),"prompt"===e.type&&(0,s.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[l.slice(0,4).map(e=>(0,s.jsx)(a.A,{title:e,style:{margin:0,fontSize:10,lineHeight:"16px",maxWidth:180,overflow:"hidden",textOverflow:"ellipsis"},children:eS(e)},e)),l.length>4&&(0,s.jsxs)(a.A,{style:{margin:0,fontSize:10,lineHeight:"16px"},children:["+",l.length-4]}),0===l.length&&(0,s.jsx)("span",{children:"未绑定提示词"})]})]})};return(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"pageTitle",children:r("roles.title")}),(0,s.jsx)("p",{className:"pageDesc",children:r("roles.description")})]}),(0,s.jsxs)(x.A,{children:[(0,s.jsx)(m.A,{value:eo,onChange:et,style:{width:170},options:[{label:"我的配置 (".concat(N.length+S.length,")"),value:"custom"},{label:"全部来源 (".concat(N.length+S.length,")"),value:"all"}]}),(0,s.jsx)("input",{ref:ea,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:e=>{var l;eb(null==(l=e.target.files)?void 0:l[0])}}),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(F.A,{}),loading:en,onClick:()=>{var e;return null==(e=ea.current)?void 0:e.click()},children:"导入"}),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(B.A,{}),disabled:N.length+S.length===0,onClick:()=>{M("customize-document-roles-".concat(new Date().toISOString().slice(0,10),".json"),K(N,S)),t.success("已导出 ".concat(N.length," 个角色、").concat(S.length," 个配置"))},children:"导出全部"}),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(E.A,{}),onClick:()=>eA(void 0,"file"),children:r("roles.newFileRole")}),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(E.A,{}),onClick:()=>eA(void 0,"prompt"),children:r("roles.newPromptRole")}),(0,s.jsx)(d.Ay,{type:"primary",icon:(0,s.jsx)(E.A,{}),onClick:()=>eN(),children:r("roles.newConfig")})]})]}),(0,s.jsx)(u.A,{type:"info",showIcon:!0,message:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,s.jsx)("span",{children:r("roles.plainGuideTitle")}),(0,s.jsx)(d.Ay,{type:"link",size:"small",icon:ee?(0,s.jsx)(O.A,{}):(0,s.jsx)(D.A,{}),onClick:()=>el(!ee),style:{padding:"0 4px"},children:ee?"收起说明":"展开说明"})]}),description:ee?r("roles.plainGuideDesc"):void 0}),(0,s.jsxs)("div",{className:"bg-[var(--colorBg)] rounded-xl border border-[var(--borderColor)] mt-4",children:[(0,s.jsx)(h.A,{className:"px-6 pt-2 custom-tabs",items:[{key:"file",label:"文件角色 (".concat(em.length,")")},{key:"prompt",label:"提示词角色 (".concat(eu.length,")")},{key:"configs",label:"项目角色配置 (".concat(ex.length,")")}],activeKey:er,onChange:es}),(0,s.jsx)("div",{className:"p-6 pt-2",children:"configs"===er?0===ex.length?(0,s.jsx)(c.A,{description:r("common.noData")}):(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:ex.map(e=>{let l=e.fileRoles.map(e=>({...e,role:ew(e.roleId)})).filter(e=>e.role),o=e.promptRoles.map(e=>({...e,role:ew(e.roleId)})).filter(e=>e.role);return(0,s.jsxs)("div",{className:"group p-5 rounded-xl border border-transparent hover:border-[var(--borderColorStrong)] bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] hover:shadow-sm flex flex-col transition-all duration-300 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-4 min-w-0",children:[(0,s.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate flex-1",children:e.name}),(0,s.jsx)("div",{className:"flex gap-2 flex-shrink-0",children:(0,s.jsx)(a.A,{color:"cyan",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:"我的配置"})})]}),e.description&&(0,s.jsx)(U,{ellipsis:{rows:2},className:"text-xs text-[var(--colorTextSecondary)] mb-4",children:e.description}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 mt-auto pt-4 border-t border-[var(--borderColor)]",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:["文件角色 (",e.fileRoles.length,")"]}),l.length>0?(0,s.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[l.slice(0,4).map(e=>(0,s.jsx)(a.A,{color:"blue",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:e.role.name},e.roleId)),l.length>4&&(0,s.jsxs)(a.A,{bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:["+",l.length-4]})]}):(0,s.jsx)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:"无"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:["提示词角色 (",e.promptRoles.length,")"]}),o.length>0?(0,s.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[o.slice(0,4).map(e=>(0,s.jsx)(a.A,{color:"purple",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:e.role.name},e.roleId)),o.length>4&&(0,s.jsxs)(a.A,{bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:["+",o.length-4]})]}):(0,s.jsx)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:"无"})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-1 opacity-0 group-hover:opacity-100 transition-opacity mt-4",children:[(0,s.jsx)(d.Ay,{type:"text",size:"small",icon:(0,s.jsx)(T.A,{className:"text-[var(--colorTextSecondary)]"}),onClick:()=>eN(e)}),!e.builtIn&&(0,s.jsx)(d.Ay,{type:"text",size:"small",icon:(0,s.jsx)(B.A,{className:"text-[var(--colorTextSecondary)]"}),onClick:()=>(e=>{let l=new Set([...e.fileRoles.map(e=>e.roleId),...e.promptRoles.map(e=>e.roleId)]);M("customize-role-config-".concat(X(e.name),"-").concat(new Date().toISOString().slice(0,10),".json"),K(N.filter(e=>l.has(e.id)&&!e.builtIn),[e])),t.success("已导出 1 个配置")})(e)}),(0,s.jsx)(p.A,{title:r("common.confirm"),onConfirm:()=>{ev(e.id)},children:(0,s.jsx)(d.Ay,{type:"text",size:"small",danger:!0,icon:(0,s.jsx)(_.A,{})})})]})]},e.id)})}):(e="file"===er?em:eu,l=r,0===e.length?(0,s.jsx)(c.A,{description:r("common.noData")}):(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:e.map(e=>{var o,n,i,c,x,m,u,h,g;let f="prompt"===e.type?(null==(o=e.resourceIds)?void 0:o.length)?e.resourceIds:e.resourceId?[e.resourceId]:[]:[],j=f.slice(0,3),y=f.length-j.length,v="file"===e.type?null!=(i=q[null!=(n=e.processingType)?n:""])?i:(0,s.jsx)(w.A,{}):null!=(x=L[null!=(c=e.executionType)?c:""])?x:(0,s.jsx)(z.A,{}),b="file"===e.type?null!=(u=V[null!=(m=e.processingType)?m:""])?u:"var(--colorAccent)":null!=(g=W[null!=(h=e.executionType)?h:""])?g:"var(--colorWarning)";return(0,s.jsxs)("div",{className:"group p-5 rounded-xl border border-transparent hover:border-[var(--borderColorStrong)] bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] hover:shadow-sm flex flex-col transition-all duration-300 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-4 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,s.jsx)("span",{style:{color:b,fontSize:20,flexShrink:0,lineHeight:1},children:v}),(0,s.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate mb-1",children:e.name})]}),(0,s.jsx)("div",{className:"flex gap-2 flex-shrink-0",children:(0,s.jsx)(a.A,{color:"cyan",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:"我的角色"})})]}),e.description&&(0,s.jsx)(U,{ellipsis:{rows:2},className:"text-xs text-[var(--colorTextSecondary)] mb-4",children:e.description}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 mt-auto pt-4 border-t border-[var(--borderColor)]",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)(a.A,{color:"file"===e.type?"blue":"purple",bordered:!1,className:"m-0",children:function(e,l){var r,s,o;let t="file"===e.type?G[null!=(r=e.processingType)?r:""]:J[null!=(s=e.executionType)?s:""];return t?l(t):null!=(o="file"===e.type?e.processingType:e.executionType)?o:""}(e,l)}),f.length>0&&(0,s.jsxs)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:["绑定 ",f.length," 个提示词"]})]}),j.length>0&&(0,s.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[j.map(e=>(0,s.jsx)(a.A,{color:"purple",bordered:!1,title:e,className:"m-0 text-[10px] leading-[18px] max-w-[140px] truncate",children:eS(e)},e)),y>0&&(0,s.jsxs)(a.A,{bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:["+",y]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-1 opacity-0 group-hover:opacity-100 transition-opacity mt-2",children:[(0,s.jsx)(d.Ay,{type:"text",size:"small",icon:(0,s.jsx)(T.A,{className:"text-[var(--colorTextSecondary)]"}),onClick:()=>eA(e)}),!e.builtIn&&(0,s.jsx)(d.Ay,{type:"text",size:"small",icon:(0,s.jsx)(B.A,{className:"text-[var(--colorTextSecondary)]"}),onClick:()=>{M("customize-role-".concat(X(e.name),"-").concat(new Date().toISOString().slice(0,10),".json"),K([e],[])),t.success("已导出 1 个角色")}}),(0,s.jsx)(p.A,{title:r("common.confirm"),onConfirm:()=>{ey(e)},children:(0,s.jsx)(d.Ay,{type:"text",size:"small",danger:!0,icon:(0,s.jsx)(_.A,{})})})]})]})]},e.id)})}))})]}),(0,s.jsx)(g.A,{title:r("roles.roleEditor"),open:Q,onClose:()=>Y(!1),size:"large",maskClosable:!1,styles:{body:{padding:"24px 32px"},header:{padding:"16px 32px",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,s.jsx)(d.Ay,{type:"primary",onClick:()=>{ef()},children:r("common.save")}),children:(0,s.jsxs)(i.A,{form:b,layout:"vertical",children:[(0,s.jsx)(i.A.Item,{name:"id",hidden:!0,children:(0,s.jsx)(f.A,{})}),(0,s.jsxs)(j.A,{gutter:16,children:[(0,s.jsx)(y.A,{span:12,children:(0,s.jsx)(i.A.Item,{name:"type",label:r("roles.roleType"),rules:[{required:!0}],children:(0,s.jsx)(m.A,{options:[{label:r("roles.fileRole"),value:"file"},{label:r("roles.promptRole"),value:"prompt"}]})})}),(0,s.jsx)(y.A,{span:12,children:(0,s.jsx)(i.A.Item,{name:"name",label:r("roles.roleName"),rules:[{required:!0}],children:(0,s.jsx)(f.A,{})})})]}),(0,s.jsx)(i.A.Item,{name:"description",label:r("roles.roleDescription"),children:(0,s.jsx)(f.A.TextArea,{rows:2})}),(0,s.jsx)(i.A.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.type!==l.type,children:e=>{let{getFieldValue:l}=e,o="prompt"===l("type");return(0,s.jsx)(v.A,{size:"small",title:o?"提示词角色配置":"文件角色配置",style:{border:"1px solid var(--colorBorderSecondary)"},children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A.Item,{name:"executionType",label:r("roles.executionType"),rules:[{required:!0}],style:{marginBottom:12},children:(0,s.jsx)(m.A,{options:[{label:r("roles.factExtraction"),value:"fact_extraction"},{label:r("roles.chapterGeneration"),value:"chapter_generation"},{label:r("roles.validation"),value:"validation"},{label:r("roles.formatting"),value:"formatting"},{label:r("roles.reference"),value:"reference"}]})}),(0,s.jsx)(i.A.Item,{name:"resourceIds",label:r("roles.bindPrompt"),style:{marginBottom:0},help:(0,s.jsx)("span",{style:{fontSize:11,color:"var(--colorTextSecondary)"},children:r("roles.multiBindPromptHelp")}),children:(0,s.jsx)(m.A,{mode:"multiple",showSearch:!0,tagRender:eT,placeholder:"选择提示词",options:R.filter(e=>e.hasFile).map(e=>({label:e.projectName,value:e.id}))})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A.Item,{name:"processingType",label:r("roles.processingType"),rules:[{required:!0}],style:{marginBottom:12},children:(0,s.jsx)(m.A,{options:[{label:r("roles.ruleFile"),value:"rule"},{label:r("roles.tableFile"),value:"table"},{label:r("roles.drawingFile"),value:"drawing"},{label:r("roles.specificationFile"),value:"specification"},{label:r("roles.reference"),value:"reference"}]})}),(0,s.jsx)(u.A,{type:"info",showIcon:!0,message:"文件角色只定义处理类型",description:"具体项目文件由生成流程自动识别,或在模板的高级固定绑定资料中手动覆盖;这里不再绑定知识库文件,避免角色复用时混入其他项目资料。"})]})})}})]})}),(0,s.jsx)(g.A,{title:r("roles.configEditor"),open:Z,onClose:()=>$(!1),size:"large",maskClosable:!1,styles:{body:{padding:"24px 32px"},header:{padding:"16px 32px",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,s.jsx)(d.Ay,{type:"primary",onClick:()=>{ej()},children:r("common.save")}),children:(0,s.jsxs)(i.A,{form:A,layout:"vertical",children:[(0,s.jsx)(i.A.Item,{name:"id",hidden:!0,children:(0,s.jsx)(f.A,{})}),(0,s.jsxs)(j.A,{gutter:16,children:[(0,s.jsx)(y.A,{span:12,children:(0,s.jsx)(i.A.Item,{name:"name",label:r("roles.configName"),rules:[{required:!0}],children:(0,s.jsx)(f.A,{})})}),(0,s.jsx)(y.A,{span:12,children:(0,s.jsx)(i.A.Item,{name:"description",label:r("roles.configDescription"),children:(0,s.jsx)(f.A,{})})})]}),(0,s.jsx)(i.A.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.fileRoles!==l.fileRoles||e.promptRoles!==l.promptRoles,children:e=>{let{getFieldValue:l}=e,o=l("fileRoles")||[],t=l("promptRoles")||[];return(0,s.jsx)(h.A,{destroyInactiveTabPane:!1,items:[{key:"file",label:"文件角色 (".concat(o.length,"/").concat(eh.length,")"),children:(0,s.jsx)(i.A.List,{name:"fileRoles",children:(e,l)=>{let{add:t,remove:n}=l;return(0,s.jsxs)("div",{className:"flex flex-col gap-6 pt-4",children:[(0,s.jsx)(v.A,{size:"small",title:"已选文件角色",className:"bg-[var(--colorBgHover)] border-[var(--borderColorStrong)]",styles:{header:{borderBottom:"1px solid var(--borderColorStrong)"}},children:eC(o,"file")}),0===e.length&&(0,s.jsx)(c.A,{description:"暂未添加文件角色"}),e.map((e,l)=>(0,s.jsxs)(v.A,{size:"small",style:{border:"1px solid var(--colorBorderSecondary)",position:"relative"},children:[(0,s.jsxs)("div",{style:{position:"absolute",top:-10,left:12,background:"#1677ff",color:"#fff",fontSize:11,fontWeight:700,padding:"1px 8px",borderRadius:10},children:["#",l+1]}),(0,s.jsx)(d.Ay,{danger:!0,size:"small",icon:(0,s.jsx)(_.A,{}),onClick:()=>n(e.name),style:{position:"absolute",top:8,right:8,zIndex:1}}),(0,s.jsxs)(j.A,{gutter:[16,8],align:"middle",style:{marginTop:4},children:[(0,s.jsxs)(y.A,{flex:"auto",children:[(0,s.jsx)(i.A.Item,{name:[e.name,"roleId"],label:"文件角色",rules:[{required:!0}],style:{marginBottom:0},children:(0,s.jsx)(m.A,{placeholder:"选择文件角色",size:"small",options:eh.map(e=>{var l;return{label:"".concat(e.name," (").concat(r(G[null!=(l=e.processingType)?l:""]||"roles.reference"),")"),value:e.id}})})}),(0,s.jsx)(i.A.Item,{noStyle:!0,shouldUpdate:!0,children:l=>{let{getFieldValue:r}=l;return eR(ew(r(["fileRoles",e.name,"roleId"])))}})]}),(0,s.jsx)(y.A,{style:{width:90},children:(0,s.jsx)(i.A.Item,{name:[e.name,"order"],label:"排序",initialValue:l,style:{marginBottom:0},children:(0,s.jsx)(f.A,{type:"number",size:"small"})})})]})]},e.key)),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(E.A,{}),onClick:()=>t({order:e.length}),children:r("roles.addRole")})]})}})},{key:"prompt",label:"提示词角色 (".concat(t.length,"/").concat(eg.length,")"),children:(0,s.jsx)(i.A.List,{name:"promptRoles",children:(e,l)=>{let{add:o,remove:n}=l;return(0,s.jsxs)("div",{className:"flex flex-col gap-6 pt-4",children:[(0,s.jsx)(v.A,{size:"small",title:"已选提示词角色",className:"bg-[var(--colorBgHover)] border-[var(--borderColorStrong)]",styles:{header:{borderBottom:"1px solid var(--borderColorStrong)"}},children:eC(t,"prompt")}),0===e.length&&(0,s.jsx)(c.A,{description:"暂未添加提示词角色"}),e.map((e,l)=>(0,s.jsxs)(v.A,{size:"small",style:{border:"1px solid var(--colorBorderSecondary)",position:"relative"},children:[(0,s.jsxs)("div",{style:{position:"absolute",top:-10,left:12,background:"#722ed1",color:"#fff",fontSize:11,fontWeight:700,padding:"1px 8px",borderRadius:10},children:["#",l+1]}),(0,s.jsx)(d.Ay,{danger:!0,size:"small",icon:(0,s.jsx)(_.A,{}),onClick:()=>n(e.name),style:{position:"absolute",top:8,right:8,zIndex:1}}),(0,s.jsxs)(j.A,{gutter:[16,8],align:"middle",style:{marginTop:4},children:[(0,s.jsxs)(y.A,{flex:"auto",children:[(0,s.jsx)(i.A.Item,{name:[e.name,"roleId"],label:"提示词角色",rules:[{required:!0}],style:{marginBottom:0},children:(0,s.jsx)(m.A,{placeholder:"选择提示词角色",size:"small",options:eg.map(e=>{var l;return{label:"".concat(e.name," (").concat(r(J[null!=(l=e.executionType)?l:""]||"roles.reference"),")"),value:e.id}})})}),(0,s.jsx)(i.A.Item,{noStyle:!0,shouldUpdate:!0,children:l=>{let{getFieldValue:r}=l;return eR(ew(r(["promptRoles",e.name,"roleId"])))}})]}),(0,s.jsx)(y.A,{style:{width:90},children:(0,s.jsx)(i.A.Item,{name:[e.name,"order"],label:"排序",initialValue:l,style:{marginBottom:0},children:(0,s.jsx)(f.A,{type:"number",size:"small"})})})]})]},e.key)),(0,s.jsx)(d.Ay,{icon:(0,s.jsx)(E.A,{}),onClick:()=>o({order:e.length}),children:r("roles.addRole")})]})}})}]})}})]})})]})}}},e=>{e.O(0,[580,665,576,787,195,455,466,636,593,792],()=>e(e.s=23507)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[298],{16403:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/documents",function(){return r(19562)}])},19562:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ei});var l=r(65321),s=r(97109),a=r(26171),n=r(7576),o=r(35292),i=r(33442),c=r(17807),d=r(63455),u=r(11702),m=r(88762),p=r(85114),x=r(58569),h=r(84253),g=r(34052),f=r(68787),v=r(42700),j=r(2256),y=r(38770),w=r(38332),b=r(76506),A=r(50883),k=r(23718),S=r(23216),I=r(26619),C=r(8263),N=r(16285),T=r(8579),R=r(75548),E=r(7851),B=r(84742),z=r(29071),M=r(63552),F=r(26631),_=r(7225),D=r(83914),P=r(58209),L=r(54746),G=r(93051),O=r(64068),W=r(38762),q=r(64629),H=r(1310),V=r(67547),K=r(76830),U=r(6578),Q=r(48321);let{TextArea:X}=n.A,{Text:J}=o.A,Y=a.A;function Z(e){let{type:t="info",title:r,children:s,style:a}=e,n="error"===t?"var(--colorError)":"warning"===t?"var(--colorWarning)":"success"===t?"var(--colorSuccess)":"var(--colorInfo)";return(0,l.jsxs)("div",{style:{border:"1px solid ".concat(n),background:"error"===t?"var(--colorErrorBg)":"warning"===t?"var(--colorWarningBg)":"success"===t?"var(--colorSuccessBg)":"var(--colorInfoBg)",borderRadius:8,padding:"9px 12px",...a},children:[(0,l.jsx)(J,{strong:!0,style:{color:n},children:r}),s&&(0,l.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12},children:s})]})}function $(e){let{children:t,gap:r=12,style:s}=e;return(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:r,...s},children:t})}let ee=null;function et(){null==ee||ee.listeners.forEach(e=>e())}let er={role_binding:(0,l.jsx)(S.A,{}),knowledge_retrieval:(0,l.jsx)(I.A,{}),file_understanding:(0,l.jsx)(C.A,{}),fact_extraction:(0,l.jsx)(N.A,{}),chapter_generation:(0,l.jsx)(T.A,{}),asset_generation:(0,l.jsx)(R.A,{}),validation:(0,l.jsx)(E.A,{}),formatting:(0,l.jsx)(B.A,{}),llm_review:(0,l.jsx)(z.A,{}),export_ready:(0,l.jsx)(M.A,{}),reference:(0,l.jsx)(R.A,{})},el={施工组织设计:(0,l.jsx)(E.A,{}),投标文件:(0,l.jsx)(M.A,{}),技术方案:(0,l.jsx)(N.A,{}),报告:(0,l.jsx)(F.A,{}),自定义:(0,l.jsx)(T.A,{})};function es(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function ea(e){return e.map(e=>({key:e.key,value:e.key,rawTitle:e.title,title:e.isFolder?(0,l.jsxs)("div",{className:"flex items-center justify-between w-full pr-4",children:[(0,l.jsxs)(i.A,{size:4,children:[(0,l.jsx)(_.A,{style:{color:"#faad14"}}),(0,l.jsx)("span",{children:e.title})]}),(0,l.jsxs)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:[e.fileCount||0," 项"]})]}):(0,l.jsx)("span",{title:e.key,children:e.title}),isFolder:e.isFolder,fileCount:e.fileCount||+!e.isFolder,isLeaf:e.isLeaf}))}let en={role_binding:"角色配置绑定",knowledge_retrieval:"知识库检索",file_understanding:"多模态文件理解",fact_extraction:"LLM 事实抽取",chapter_generation:"LLM 章节生成",asset_generation:"多模态资源生成",validation:"规则校验",formatting:"格式化排版",llm_review:"LLM 审查优化",export_ready:"导出就绪",reference:"参考资源处理"},eo={"knowledge-base":"知识库","document-readiness":"生成准备度检查","quality-repair":"质量补写","export-gate":"导出门禁","context-memory":"项目上下文","final-format":"正式排版","multimodal-files":"多模态文件理解",tender_announcement:"招标公告"};function ei(){var e,t,r,a,o;let R=(0,Q.Vr)(),{message:_}=c.A.useApp(),[ei]=d.A.useForm(),ec=(0,s.useRef)(null),[ed,eu]=(0,s.useState)([]),[em,ep]=(0,s.useState)("construction-organization-design"),[ex,eh]=(0,s.useState)([]),[eg,ef]=(0,s.useState)([]),[ev,ej]=(0,s.useState)([]),[ey,ew]=(0,s.useState)([]),[eb,eA]=(0,s.useState)(!1),[ek,eS]=(0,s.useState)(),[eI,eC]=(0,s.useState)(!0),[eN,eT]=(0,s.useState)(!1),[eR,eE]=(0,s.useState)(null),[eB,ez]=(0,s.useState)(""),[eM,eF]=(0,s.useState)([]),[e_,eD]=(0,s.useState)(null),[eP,eL]=(0,s.useState)(null),[eG,eO]=(0,s.useState)(""),[eW,eq]=(0,s.useState)(!1),[eH,eV]=(0,s.useState)("idle"),[eK,eU]=(0,s.useState)(null),[eQ,eX]=(0,s.useState)(null),[eJ,eY]=(0,s.useState)({start:0,end:0}),[eZ,e$]=(0,s.useState)([]),[e0,e1]=(0,s.useState)(!1),[e2,e6]=(0,s.useState)(!1),[e5,e8]=(0,s.useState)({}),e3=d.A.useWatch("projectRoleConfigId",ei),e4=(0,s.useMemo)(()=>eg.find(e=>e.id===e3),[eg,e3]),e7=(0,s.useMemo)(()=>new Set(((null==e4?void 0:e4.fileRoles)||[]).map(e=>e.roleId)),[e4]),e9=(0,s.useMemo)(()=>ex.filter(e=>"file"===e.type&&(!e3||e7.has(e.id))).map(e=>({label:e.name,value:e.id})),[ex,e7,e3]),te=d.A.useWatch("fileBindingGroups",ei)||{},tt=(0,s.useMemo)(()=>{var e,t,r;return(null==(e=ev.find(e=>e.selected))?void 0:e.projectRoot)||(null==(t=ev.find(e=>e.isCurrent))?void 0:t.projectRoot)||(null==(r=ev[0])?void 0:r.projectRoot)||""},[ev]);(0,s.useEffect)(()=>{if(!e2||!e3)return;let e=ei.getFieldValue("fileBindingGroups")||{},t=Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return e7.has(t)}));Object.keys(t).length!==Object.keys(e).length&&ei.setFieldValue("fileBindingGroups",t)},[ei,e7,e3,e2]),(0,s.useEffect)(()=>{if(e2){if(0===e9.length)return void eS(void 0);ek&&e9.some(e=>e.value===ek)||eS(e9[0].value)}},[ek,e9,e2]);let[tr,tl]=(0,s.useState)([]),[ts,ta]=(0,s.useState)(null),[tn,to]=(0,s.useState)(null),[ti,tc]=(0,s.useState)("templates"),[td,tu]=(0,s.useState)(!1),[tm,tp]=(0,s.useState)("workflow"),tx=(0,s.useRef)(null),th=(0,s.useRef)(null),tg=(0,s.useRef)(""),tf=(0,s.useRef)(0),tv=(0,s.useMemo)(()=>"activeGenDocId:".concat(tt||"default"),[tt]),tj=async()=>{try{eF((await (0,U.cQ)(tt||void 0)).documents)}catch(e){eF([])}};(0,s.useEffect)(()=>{let e=()=>{ee&&(tl(ee.flowSteps),ta(ee.activeFlowKey),eT(ee.loading),ee.documentId&&eD(ee.documentId),ee.draft&&eE(ee.draft),void 0!==ee.content&&ez(ee.content))},t=ee;return null==t||t.listeners.add(e),e(),()=>{null==t||t.listeners.delete(e)}},[]),(0,s.useEffect)(()=>{eC(!0),Promise.all([(0,U.Dl)().then(e=>{var t,r;eu(e.templates),ep(null!=(r=null==(t=e.templates[0])?void 0:t.id)?r:"construction-organization-design")}),(0,U.lv)().then(e=>{eh(e.roles),ef(e.configs)}),(0,U.dx)().then(e=>ej(e))]).catch(()=>_.error(R("common.error"))).finally(()=>eC(!1))},[_,R]),(0,s.useEffect)(()=>{tt&&(localStorage.removeItem("activeGenDocId"),tj())},[tt]),(0,s.useEffect)(()=>{if(eI||0===ed.length)return;let e="".concat(tt||"default",":").concat(ed.map(e=>"".concat(e.id,":").concat(e.projectRoleConfigId||"",":").concat(JSON.stringify(e.fileBindings||[]))).join("|"));if(tg.current===e)return;tg.current=e;let t=!1;return(async()=>{let e=(await Promise.all(ed.map(async e=>{try{let{validation:t}=await (0,U.SM)(e.id,tt||void 0);return[e.id,t]}catch(e){return}}))).filter(e=>!!e);t||e8(Object.fromEntries(e))})(),()=>{t=!0}},[tt,eI,ed]),(0,s.useEffect)(()=>{if(0===eM.length)return;let e=localStorage.getItem(tv);if(!e)return;if(!eM.find(t=>t.id===e&&"generating"===t.status))return void localStorage.removeItem(tv);let t=setInterval(()=>{(async()=>{try{let{document:r}=await (0,U.v7)(e,!1,tt||void 0);await tj(),"generating"!==r.status&&(localStorage.removeItem(tv),clearInterval(t))}catch(e){clearInterval(t)}})()},3e3);return()=>clearInterval(t)},[eM]);let ty=(0,s.useMemo)(()=>ed.find(e=>e.id===em),[ed,em]),tw=eg.map(e=>({label:e.name,value:e.id})),tb=Math.max(0,tr.findIndex(e=>e.key===ts)),tA=e=>{var t;return e?(null==(t=ex.find(t=>t.id===e))?void 0:t.name)||eo[e]||"未知角色":""},tk=e=>e.subtitle||e.roleName||tA(e.roleId)||en[e.type]||e.type,tS=e=>{var t,r,l;return e.promptName||((t=e.promptId)?(null==(r=ev.find(e=>e.id===t))?void 0:r.projectName)||(null==(l=ex.find(e=>e.id===t))?void 0:l.name)||eo[t]||"未知提示词":"")},tI=()=>{tf.current+=1,eO(""),eU(null),eX(null),e$([]),e1(!1),eq(!1),eV("idle")},tC=e=>{ep(e),eD(null),eE(null),ez(""),tI(),tp("workflow"),tu(!0),tc("drafts")},tN=async e=>{eD(e.id),ep(e.templateId);let t=tT(e.status);if(t||"failed"===e.status||"aborted"===e.status){tI(),to(e),eE(null),ez(""),eT(t),tp("workflow"),tu(!0);try{let{document:t}=await (0,U.v7)(e.id,!1,e.projectRoot||tt||void 0);tB(t),tT(t.status)?tz(t.id,t.projectRoot||e.projectRoot||tt||void 0):await tj()}catch(t){tB(e)}return}tp("editor"),tl([]),ta(null),tI();try{let{document:t}=await (0,U.v7)(e.id,!1,e.projectRoot||tt||void 0);eE(t.draft||null),ez(t.editedMarkdown||t.markdown)}catch(e){_.error(R("common.error"))}tu(!0)},tT=e=>"completed"!==e&&"warning"!==e&&"failed"!==e&&"aborted"!==e,tR=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eN;(null==ee?void 0:ee.loading)&&(ee.flowSteps=e,ee.activeFlowKey=t,ee.loading=r,et())},tE=e=>{var t,r,s,a,n;let o=e.executionStages||(null==(t=e.draft)?void 0:t.executionStages)||[];if(o.length>0){let t=o.map((t,r)=>{var s;let a,n=("failed"===e.status||"aborted"===e.status)&&"running"===t.status||"failed"===(a=t.status)?"error":"running"===a?"process":"fallback"===a?"warning":"finish";return{key:"".concat(t.type,"-").concat(r),title:t.title||en[t.type]||t.type,subtitle:tk(t),description:t.message||"",status:n,icon:"role_binding"===(s=t.type)?(0,l.jsx)(S.A,{}):"knowledge_retrieval"===s?(0,l.jsx)(I.A,{}):"file_understanding"===s?(0,l.jsx)(C.A,{}):"fact_extraction"===s?(0,l.jsx)(N.A,{}):"chapter_generation"===s?(0,l.jsx)(T.A,{}):"llm_review"===s?(0,l.jsx)(z.A,{}):"validation"===s?(0,l.jsx)(E.A,{}):"formatting"===s?(0,l.jsx)(B.A,{}):"export_ready"===s?(0,l.jsx)(M.A,{}):(0,l.jsx)(F.A,{}),subSteps:((e,t,r)=>{let l=Array.isArray(e.details)?e.details.filter(Boolean):[],s=e.progress?"".concat(e.progress.label||"进度",":").concat(e.progress.current,"/").concat(e.progress.total):"",a=[...s?[s]:[],...l];return 0===a.length?[{key:"stage-".concat(r),title:tS(e)?"提示词:".concat(tS(e)):tk(e),status:t}]:a.slice(0,8).map((e,l)=>({key:"stage-".concat(r,"-").concat(l),title:e,status:"process"===t&&0===l?"process":"error"===t&&0===l?"error":"warning"===t?"warning":"process"===t?"finish":t}))})(t,n,r)}});"generating"===e.status&&t.length>0&&(null==(r=t.at(-1))?void 0:r.status)==="finish"&&(t[t.length-1]={...t[t.length-1],status:"process"});let i="generating"===e.status?(null==(s=t.at(-1))?void 0:s.key)||"prepare":"failed"===e.status||"aborted"===e.status?(null==(a=t.find(e=>"error"===e.status))?void 0:a.key)||(null==(n=t.at(-1))?void 0:n.key)||"prepare":"done";return{steps:t,activeKey:i}}return{steps:[],activeKey:null}},tB=e=>{to(e);let{steps:t,activeKey:r}=tE(e);tl(t),ta(r),eT(tT(e.status)),tR(t,r,tT(e.status)),("failed"===e.status||"aborted"===e.status)&&tp("workflow"),("completed"===e.status||"warning"===e.status)&&e.draft&&(eE(e.draft),ez(e.editedMarkdown||e.markdown),tp("editor"),tl([]),ta(null))},tz=(e,t)=>{tx.current&&clearInterval(tx.current),tx.current=setInterval(()=>{(async()=>{try{let{document:r}=await (0,U.v7)(e,!0,t||tt||void 0);tB(r),await tj(),tT(r.status)||(tx.current&&clearInterval(tx.current),tx.current=null,localStorage.removeItem(tv))}catch(e){}})()},2e3)};(0,s.useEffect)(()=>()=>{tx.current&&(clearInterval(tx.current),tx.current=null),th.current&&(clearTimeout(th.current),th.current=null)},[]),(0,s.useEffect)(()=>{if(!eN||!ts)return;let e=window.setInterval(()=>tl(e=>{let t=e.map(e=>{if(e.key!==ts||"process"!==e.status)return e;let t=e.subSteps.findIndex(e=>"process"===e.status),r=t<0?0:Math.min(t+1,e.subSteps.length-1);return{...e,subSteps:e.subSteps.map((e,t)=>t<r?{...e,status:"finish"}:t===r?{...e,status:"process"}:{...e,status:"wait"})}});return tR(t,ts),t}),1400);return()=>window.clearInterval(e)},[ts,eN]);let tM=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";eA(!0);try{let t=await (0,U.Fi)(e,tt||void 0);ew(ea(t.nodes))}catch(e){_.error("知识库文件加载失败")}finally{eA(!1)}},tF=async e=>{var t;let r=String(null!=(t=e.key)?t:"");if(r)try{let e=await (0,U.Fi)(r,tt||void 0),t=ea(e.nodes),l=e=>e.map(e=>e.key===r?{...e,children:t}:e.children?{...e,children:l(e.children)}:e);ew(e=>l(e))}catch(e){_.error("加载子文件夹失败")}},t_=e=>{var t,r,l;let s=null!=e?e:{id:"tpl-".concat(Date.now()),name:"",description:"",category:"自定义",outputTitle:"",projectRoleConfigId:void 0,chapters:[],fileBindings:[]};ei.resetFields(),ei.setFieldsValue({...s,fileBindingGroups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((e,t)=>(t.roleId&&t.filePath&&(e[t.roleId]=es([...e[t.roleId]||[],t.filePath])),e),{})}(s.fileBindings)}),eS(null==(l=eg.find(e=>e.id===s.projectRoleConfigId))||null==(r=l.fileRoles)||null==(t=r[0])?void 0:t.roleId),tM(),e6(!0)},tD=(e,t)=>{let r=ei.getFieldValue("fileBindingGroups")||{};ei.setFieldValue("fileBindingGroups",{...r,[e]:es(t)})},tP=async()=>{try{var e;await ei.validateFields();let t=ei.getFieldsValue(!0),r=new Set(((null==(e=eg.find(e=>e.id===t.projectRoleConfigId))?void 0:e.fileRoles)||[]).map(e=>e.roleId)),l=t.fileBindingGroups||{},s=Object.entries(l).filter(e=>{let[t]=e;return 0===r.size||r.has(t)}).flatMap(e=>{let[t,r]=e;return es(r||[]).map(e=>({roleId:t,filePath:e}))}),{fileBindingGroups:a,...n}=t,o={...n,chapters:[],fileBindings:s},i=await (0,U.l2)(o);eu(i.templates),ep(i.template.id),e6(!1),await tj(),_.success(R("common.success"))}catch(e){e instanceof Error&&_.error(e.message)}},tL=async e=>{try{let t=await (0,U.bV)(e);eu(t.templates),ep(t.template.id),_.success(R("common.success"))}catch(e){_.error(R("common.error"))}},tG=async e=>{try{var t,r;let l=await (0,U.h0)(e);eu(l.templates),ep(null!=(r=null==(t=l.templates[0])?void 0:t.id)?r:""),_.success(R("common.success"))}catch(e){_.error(R("common.error"))}},tO=async e=>{try{let{validation:t}=await (0,U.SM)(e,tt||void 0);e8(r=>({...r,[e]:t}));let r=t.issues.filter(e=>"error"===e.level);if(ep(e),r.length>0)return void _.warning("模板运行前检查未通过,请先处理阻断项");t.issues.length>0&&_.warning("模板存在非阻断警告,已继续运行"),tC(e)}catch(e){_.error(e instanceof Error?e.message:"模板运行前检查失败")}},tW=async e=>{try{await (0,U.QG)(e.id,e.projectRoot||tt||void 0),e_===e.id&&(eD(null),eE(null),ez("")),await tj(),_.success(R("common.success"))}catch(e){_.error(R("common.error"))}},tq=async(e,t)=>{let r=Date.now(),l=0,s=Date.now();for(;;){let a;if(null==t?void 0:t.aborted)throw Error("用户中止");let n=new AbortController;t&&(t.pollController=n);try{({document:a}=await (0,U.v7)(e,!0,tt||void 0,n.signal))}finally{(null==t?void 0:t.pollController)===n&&(t.pollController=void 0)}if(tB(a),a.updatedAt!==l&&(l=a.updatedAt,s=Date.now()),("completed"===a.status||"warning"===a.status)&&a.draft)return a;if("failed"===a.status||"aborted"===a.status)throw Error(a.error||("aborted"===a.status?"生成已中止":"生成失败"));if(Date.now()-r>75e5||Date.now()-s>96e4)throw Error("生成任务疑似卡住,请点击继续生成或重新生成");await new Promise(e=>window.setTimeout(e,1500))}},tH=async()=>{if(!em)return;if((null==ee?void 0:ee.aborted)&&(ee=null),null==ee?void 0:ee.loading){tl(ee.flowSteps),ta(ee.activeFlowKey),eT(!0);return}if(!tt)return void _.error("未识别当前项目,请先选择或打开项目后再生成文件");eT(!0);let e=(0,U.OX)({templateId:em,projectRoot:tt});ee={id:Date.now(),templateId:em,loading:!0,flowSteps:[],activeFlowKey:null,promise:e,listeners:new Set},tl([]),ta(null);let t=[];try{let r=await e;r.documentId&&(localStorage.setItem(tv,r.documentId),eD(r.documentId),(null==ee?void 0:ee.promise)===e&&(ee.documentId=r.documentId)),await tj();let l=r.documentId?await tq(r.documentId,(null==ee?void 0:ee.promise)===e?ee:void 0):void 0,s=r.draft||(null==l?void 0:l.draft);if(!s)throw Error("生成结果为空");(r.documentId||(null==l?void 0:l.id))&&eD(r.documentId||l.id),t.forEach(e=>window.clearTimeout(e)),eE(s),ez((null==l?void 0:l.editedMarkdown)||(null==l?void 0:l.markdown)||s.markdown),(null==ee?void 0:ee.promise)===e&&(ee.draft=s,ee.content=(null==l?void 0:l.editedMarkdown)||(null==l?void 0:l.markdown)||s.markdown);let a=l||{id:r.documentId||"draft-".concat(Date.now()),templateId:em,title:s.title,requirement:s.requirement,projectRoot:s.projectRoot||tt,projectId:s.projectId,markdown:s.markdown,status:s.validationIssues.some(e=>"error"===e.level||"warning"===e.level)||!s.exportGate.passed?"warning":"completed",draft:s,executionStages:s.executionStages,assets:s.assets||[],createdAt:s.generatedAt,updatedAt:Date.now()},{steps:n}=tE(a);tl(n),tR(n,"done",!1),ta("done"),(null==ee?void 0:ee.promise)===e&&(ee.activeFlowKey="done",ee.loading=!1,et(),ee=null),localStorage.removeItem(tv),await tj(),_.success(R("common.success")),window.setTimeout(()=>{var e;return null==(e=ec.current)?void 0:e.scrollIntoView({behavior:"smooth",block:"start"})},200)}catch(l){localStorage.removeItem(tv);let t=l instanceof Error?l.message:R("common.error"),r=/用户中止|abort|aborted/i.test(t);r||tl(e=>{let r=e.map(e=>"process"===e.status?{...e,status:"error",description:t,subSteps:((e,t)=>{if("wait"===t)return e.subSteps.map(e=>({...e,status:"wait"}));if("finish"===t)return e.subSteps.map(e=>({...e,status:"finish"}));if("error"===t)return e.subSteps.map((e,t)=>({...e,status:0===t?"error":e.status}));let r=e.subSteps.findIndex(e=>"wait"===e.status);return e.subSteps.map((e,t)=>t<r||-1===r?{...e,status:"finish"}:t===r?{...e,status:"process"}:e)})(e,"error")}:e);return tR(r,ts,!1),r}),(null==ee?void 0:ee.promise)===e&&(ee.loading=!1,ee.error=t,et(),ee=null),await tj().catch(()=>void 0),r||_.error(t)}finally{t.forEach(e=>window.clearTimeout(e)),eT(!1),(null==ee?void 0:ee.promise)===e&&(ee.loading=!1,et())}},tV=(0,s.useRef)(!1);(0,s.useEffect)(()=>(th.current&&(clearTimeout(th.current),th.current=null),!td||"workflow"!==tm||e_||tV.current||(null==ee?void 0:ee.loading)||null==ty||!ty.projectRoleConfigId||(tV.current=!0,th.current=setTimeout(()=>{th.current=null,td&&"workflow"===tm&&!e_&&em==em&&tH()},300)),td||(tV.current=!1),()=>{th.current&&(clearTimeout(th.current),th.current=null)}),[td,tm,e_,ty,em]);let tK=async e=>{try{eD(e.id),ep(e.templateId),tp("workflow"),tu(!0),eT(!0);let t=await (0,U.UQ)(e.id,e.projectRoot||tt||void 0);localStorage.setItem(tv,t.documentId),await tj();let r=await tq(t.documentId);r.draft&&(eE(r.draft),ez(r.editedMarkdown||r.markdown||r.draft.markdown),tp("editor")),localStorage.removeItem(tv),await tj(),_.success("已继续生成并完成")}catch(e){_.error(e instanceof Error?e.message:"继续生成失败")}finally{eT(!1)}},tU=async e=>{if((null==ee?void 0:ee.loading)&&ee.documentId===e.id){var t;ee.aborted=!0,null==(t=ee.pollController)||t.abort(),ee.loading=!1,ee.error="用户中止",et(),ee=null,eT(!1)}localStorage.removeItem(tv),tx.current&&(clearInterval(tx.current),tx.current=null);try{await (0,U.r)(e.id,e.projectRoot||tt||void 0),_.success("已中止生成任务")}catch(e){_.info("任务已不在运行,已刷新状态")}finally{await tj(),e_===e.id&&(eD(null),to(null),eE(null),ez(""))}},tQ=async e=>{if(eR){eL(e);try{eR.exportGate.passed||_.warning("导出门禁存在风险项,已允许导出,请下载后人工复核。");let t={documentId:e_||void 0,title:eR.title,markdown:eB,format:e,enforceGate:!1,exportGate:eR.exportGate,useClientMarkdown:!0,projectRoot:eR.projectRoot||tt||void 0},r=await (0,U.UE)(t);((e,t,r)=>{let l=new Blob([e],{type:r}),s=URL.createObjectURL(l),a=document.createElement("a");a.href=s,a.download=t,a.target="_self",a.rel="noopener",a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),a.remove(),window.setTimeout(()=>URL.revokeObjectURL(s),1e3)})(r,"".concat(eR.title,".").concat("markdown"===e?"md":e),{markdown:"text/markdown;charset=utf-8",html:"text/html;charset=utf-8",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}[e])}catch(e){_.error(e instanceof Error?e.message:R("common.error"))}finally{eL(null)}}},tX=async()=>{if(eR)try{if(e_)await (0,U.a6)(e_,{editedMarkdown:eB,markdown:eB},eR.projectRoot||tt||void 0);else{let e=await (0,U.Af)({...eR,markdown:eB});eE(e.draft)}await tj(),_.success(R("common.success"))}catch(e){_.error(R("common.error"))}},tJ=(e,t)=>{e$(r=>[{id:"".concat(Date.now()),content:e,prompt:t,createdAt:Date.now()},...r].slice(0,12))},tY=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&eO(""),eU(null),eX(null),eY({start:0,end:0})},tZ=(e,t)=>{var r,l;return{title:(null==eR?void 0:eR.title)||"未命名文档",markdown:t,instruction:e,facts:null==eR||null==(r=eR.structuredFacts)?void 0:r.map(e=>"".concat(e.key,": ").concat(e.value)),chapters:null==eR||null==(l=eR.chapters)?void 0:l.map(e=>e.title),...(()=>{let e=eJ.start,t=eJ.end;return t>e?{selection:{start:e,end:t,text:eB.slice(e,t)},cursorOffset:e}:{cursorOffset:e}})()}},t$=async()=>{let e=eG.trim();if(!eR||!e||eW)return;let t=tf.current+1;tf.current=t,eq(!0),eV("planning"),eX(null);try{let r=await (0,U.Gi)({mode:"plan",...tZ(e,eB)});if(tf.current!==t||e_!=e_)return;if(!r.plan)throw Error("AI 未返回修改计划");eU(r.plan)}catch(e){tf.current===t&&_.error(e instanceof Error?e.message:R("common.error"))}finally{tf.current===t&&(eq(!1),eV("idle"))}},t0=async e=>{let t=eG.trim();if(!eR||!t||eW)return;let r=tf.current+1;tf.current=r,eq(!0),eV("applying");try{let l=await (0,U.Gi)({mode:"apply",...tZ(t,eB),plan:e});if(tf.current!==r||e_!=e_)return;if(!l.markdown)throw Error("AI 未返回修改结果");eX({plan:l.plan||e,markdown:l.markdown,beforeSnippet:l.beforeSnippet,afterSnippet:l.afterSnippet,summary:l.summary,changedChars:l.changedChars,prompt:t,before:eB})}catch(e){tf.current===r&&_.error(e instanceof Error?e.message:R("common.error"))}finally{tf.current===r&&(eq(!1),eV("idle"))}};if(eI)return(0,l.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,l.jsx)(m.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,l.jsx)(m.A,{active:!0,paragraph:{rows:2}}),(0,l.jsx)(m.A,{active:!0,paragraph:{rows:8}})]});let t1="workflow"===tm?"工作流:".concat((null==ty?void 0:ty.name)||"选择模板"):"编辑:".concat((null==eR?void 0:eR.title)||(null==ty?void 0:ty.outputTitle)||"文档");return(0,l.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 mb-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2.5 flex items-center gap-2",children:[(0,l.jsx)(S.A,{className:"text-[var(--colorAccent)]"}),R("documents.title")]}),(0,l.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)]",children:R("documents.description")})]}),(0,l.jsx)(p.Ay,{type:"primary",icon:(0,l.jsx)(L.A,{}),onClick:()=>t_(),className:"shadow-none rounded-lg",children:R("documents.newTemplate")})]}),(0,l.jsxs)("div",{className:"bg-[var(--colorBgContainer)] rounded-2xl shadow-sm overflow-hidden",children:[(0,l.jsx)(x.A,{items:[{key:"templates",label:(0,l.jsxs)("span",{className:"px-4",children:["模板库 ",(0,l.jsx)(u.A,{className:"ml-2 border-0 bg-[var(--colorFillAlter)]",children:ed.length})]})},{key:"drafts",label:(0,l.jsxs)("span",{className:"px-4",children:["生成记录 ",(0,l.jsx)(u.A,{className:"ml-2 border-0 bg-[var(--colorFillAlter)]",children:eM.length})]})}],activeKey:ti,onChange:tc,className:"documents-tabs",size:"large",tabBarStyle:{margin:0,padding:"0 16px",background:"var(--colorBgHover)",borderBottom:"1px solid var(--borderColor)"}}),(0,l.jsx)("div",{className:"p-4 bg-[var(--colorFillAlter)] min-h-[500px]",children:"templates"===ti?0===ed.length?(0,l.jsx)("div",{className:"py-32 text-center border border-dashed border-[var(--borderColor)] rounded-2xl bg-[var(--colorBgContainer)]",children:(0,l.jsx)(h.A,{description:(0,l.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:R("common.noData")})})}):(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4",children:ed.map(e=>(0,l.jsxs)("div",{className:"group flex items-center p-4 rounded-2xl transition-all cursor-pointer ".concat(em===e.id?"bg-[var(--colorBgSelected)] shadow-md":"bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] shadow-sm hover:shadow-md"),onClick:()=>ep(e.id),children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0 pr-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-2 min-w-0",children:[function(e,t){let r=el[e]||(0,l.jsx)(F.A,{});return(0,l.jsx)("span",{style:{color:t?"var(--colorAccent)":"var(--colorTextSecondary)",fontSize:16,marginTop:2,flexShrink:0},children:r})}(e.category,em===e.id),(0,l.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate",children:e.name}),em===e.id&&(0,l.jsx)(u.A,{color:"blue",className:"border-0 m-0 shrink-0",children:"当前选中"}),(0,l.jsx)(u.A,{className:"border-0 bg-[var(--colorFillSecondary)] m-0 shrink-0",children:e.category})]}),e.description&&(0,l.jsx)("div",{className:"text-sm text-[var(--colorTextSecondary)] line-clamp-2 leading-relaxed mb-3",children:e.description}),e5[e.id]&&(0,l.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"flex flex-col items-start gap-2",children:[(0,l.jsxs)("div",{className:"inline-flex items-center gap-2 p-1.5 px-3 rounded-lg border text-xs ".concat(e5[e.id].issues.some(e=>"error"===e.level)?"border-red-200 bg-red-50/50":e5[e.id].issues.length?"border-yellow-200 bg-yellow-50/50":"border-green-200 bg-green-50/50"),children:[(0,l.jsx)("span",{className:"font-medium",children:e5[e.id].issues.some(e=>"error"===e.level)?"检查未通过":e5[e.id].issues.length?"存在警告":"检查通过"}),(0,l.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,l.jsxs)("span",{children:["文件角色 ",e5[e.id].fileDiagnostics.length]}),(0,l.jsxs)("span",{children:["提示词 ",e5[e.id].promptDiagnostics.length]}),!e5[e.id].issues.some(e=>"error"===e.level)&&e5[e.id].issues.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,l.jsx)("span",{className:"text-blue-500 cursor-pointer hover:underline",onClick:()=>tC(e.id),children:"忽略警告"})]})]}),e5[e.id].promptDiagnostics.length>0&&(0,l.jsxs)("div",{className:"flex max-w-full flex-col gap-1 rounded-lg border border-[var(--borderColor)] bg-[var(--colorFillQuaternary)] px-3 py-2 text-xs text-[var(--colorTextSecondary)]",children:[(0,l.jsx)("span",{className:"font-medium text-[var(--colorText)]",children:"实际提示词绑定"}),e5[e.id].promptDiagnostics.slice(0,3).map(e=>(0,l.jsxs)("div",{className:"max-w-full truncate",title:"".concat(e.roleName||e.roleId," -> ").concat(e.promptId,"\n").concat(e.contentPreview||""),children:[e.roleName||e.roleId," → ",e.promptId," \xb7 ",e.promptTitle||"未命名提示词"," \xb7 ",e.contentLength," 字符",e.contentHash?" \xb7 ".concat(e.contentHash):""]},"".concat(e.roleId,"-").concat(e.promptId))),e5[e.id].promptDiagnostics.length>3&&(0,l.jsxs)("span",{children:["另有 ",e5[e.id].promptDiagnostics.length-3," 个提示词绑定"]})]})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 shrink-0 transition-opacity ".concat(em===e.id?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(p.Ay,{size:"small",onClick:t=>{t.stopPropagation(),t_(e)},className:"rounded-md",children:"配置"}),(0,l.jsx)(p.Ay,{size:"small",icon:(0,l.jsx)(G.A,{}),onClick:t=>{t.stopPropagation(),tL(e.id)},className:"rounded-md"}),(0,l.jsx)(Y,{title:R("documents.deleteTemplateConfirm"),onConfirm:t=>{null==t||t.stopPropagation(),tG(e.id)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,icon:(0,l.jsx)(P.A,{}),onClick:e=>e.stopPropagation(),className:"rounded-md"})}),(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:(0,l.jsx)(O.A,{}),onClick:t=>{t.stopPropagation(),tO(e.id)},className:"rounded-md justify-center",children:"运行"})]})]},e.id))}):0===eM.length?(0,l.jsx)("div",{className:"py-32 text-center border border-dashed border-[var(--borderColor)] rounded-2xl bg-[var(--colorBgContainer)]",children:(0,l.jsx)(h.A,{description:(0,l.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:R("common.noData")})})}):(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4",children:eM.slice(0,15).map((e,t)=>{var r,s,a,n,o;let i,c;return(0,l.jsxs)("div",{className:"group flex items-center gap-4 p-4 rounded-2xl transition-all cursor-pointer ".concat(e_===e.id?"bg-[var(--colorBgSelected)] shadow-md":"bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgHover)] shadow-sm hover:shadow-md"),onClick:()=>{tN(e)},children:[(0,l.jsx)("div",{className:"mt-1",children:"completed"===e.status?(0,l.jsx)(B.A,{className:"text-xl text-[var(--colorOk)]"}):"failed"===e.status||"aborted"===e.status?(0,l.jsx)(W.A,{className:"text-xl text-[var(--colorDanger)]"}):"warning"===e.status?(0,l.jsx)(E.A,{className:"text-xl text-[var(--colorWarning)]"}):(0,l.jsx)(q.A,{spin:!0,className:"text-xl text-blue-500"})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0 pr-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,l.jsx)("span",{className:"font-bold text-base text-[var(--colorText)] truncate",children:e.title}),(0,l.jsxs)(u.A,{className:"border-0 bg-[var(--colorFillSecondary)] m-0 shrink-0",children:["#",t+1]}),(0,l.jsx)(u.A,{color:"completed"===(i=e.status)?"success":"warning"===i?"warning":"failed"===i?"error":"aborted"===i?"default":"processing",className:"border-0 m-0 shrink-0",children:"completed"===(c=e.status)?"已完成":"warning"===c?"需复核":"failed"===c?"失败":"aborted"===c?"已中止":"生成中"})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-2 text-xs text-[var(--colorTextSecondary)] mb-3",children:[(0,l.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,l.jsx)(H.A,{})," ",new Date(e.updatedAt).toLocaleString()]}),(0,l.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,l.jsxs)("span",{children:["耗时 ",(e=>{let t=Math.max(0,Math.round(((e.completedAt||e.updatedAt)-e.createdAt)/1e3));if(t<60)return"".concat(t," 秒");let r=Math.floor(t/60),l=t%60;if(r<60)return l?"".concat(r," 分 ").concat(l," 秒"):"".concat(r," 分");let s=Math.floor(r/60),a=r%60;return a?"".concat(s," 小时 ").concat(a," 分"):"".concat(s," 小时")})(e)]}),e.partialChapters&&e.partialChapters.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,l.jsxs)("span",{children:["进度 ",e.partialChapters.filter(e=>"completed"===e.status).length,"/",e.partialChapters.length," 章"]}),(0,l.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,l.jsxs)("span",{children:["共 ",e.partialChapters.reduce((e,t)=>e+t.chars,0).toLocaleString()," 字"]})]})]}),("warning"===e.status||"failed"===e.status||"aborted"===e.status)&&(0,l.jsxs)("div",{className:"inline-flex items-center gap-2 p-1.5 px-3 rounded-lg border text-xs ".concat("failed"===e.status||"aborted"===e.status?"border-red-200 bg-red-50/50":"border-yellow-200 bg-yellow-50/50"),children:[(0,l.jsx)("span",{className:"font-medium",children:"failed"===e.status?"生成失败":"aborted"===e.status?"已中止":"需复核"}),(0,l.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"|"}),(0,l.jsx)("span",{className:"truncate max-w-[400px]",children:e.error||(null==(r=e.warningIssues)?void 0:r[0])||(null==(a=e.draft)||null==(s=a.validationIssues.find(e=>"error"===e.level||"warning"===e.level))?void 0:s.message)||"需复核"})]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 shrink-0 transition-opacity ".concat(e_===e.id?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:tT(e.status)?(0,l.jsx)(q.A,{spin:!0}):(0,l.jsx)(O.A,{}),onClick:t=>{t.stopPropagation(),tN(e)},className:"rounded-md w-full justify-center",children:"打开"}),(0,l.jsxs)("div",{className:"flex gap-2 justify-end",children:[tT(e.status)&&(0,l.jsx)(Y,{title:"确定中止此生成任务?",onConfirm:t=>{null==t||t.stopPropagation(),tU(e)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,onClick:e=>e.stopPropagation(),className:"rounded-md flex-1",children:"中止"})}),("failed"===e.status||"aborted"===e.status||"warning"===e.status&&!!(null==(n=e.checkpointChapters)?void 0:n.length)&&/继续生成|重新生成|中断|卡住|未完成/u.test(e.error||(null==(o=e.warningIssues)?void 0:o.join(";"))||""))&&(0,l.jsx)(p.Ay,{size:"small",onClick:t=>{t.stopPropagation(),tK(e)},className:"rounded-md flex-1",children:"继续"}),(0,l.jsx)(Y,{title:"确认删除?",onConfirm:t=>{null==t||t.stopPropagation(),tW(e)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,icon:(0,l.jsx)(P.A,{}),onClick:e=>e.stopPropagation(),className:"rounded-md"})})]})]})]},e.id)})})})]}),(0,l.jsx)(g.A,{title:t1,open:td,onClose:()=>{tu(!1),tx.current&&(clearInterval(tx.current),tx.current=null)},size:"large",mask:{closable:!1},style:{borderRadius:"12px 0 0 12px"},styles:{body:{padding:"16px 24px"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:eR?(0,l.jsxs)(i.A,{wrap:!0,children:[(0,l.jsx)(p.Ay,{icon:(0,l.jsx)(V.A,{}),disabled:eW,onClick:()=>{tX()},children:R("documents.saveDraft")}),(0,l.jsx)(p.Ay,{icon:(0,l.jsx)(K.A,{}),disabled:eW,loading:"markdown"===eP,onClick:()=>{tQ("markdown")},children:"MD"}),(0,l.jsx)(p.Ay,{disabled:eW,loading:"html"===eP,onClick:()=>{tQ("html")},children:"HTML"}),(0,l.jsx)(p.Ay,{disabled:eW,loading:"docx"===eP,onClick:()=>{tQ("docx")},children:"DOCX"}),(0,l.jsx)(p.Ay,{type:"primary",disabled:eW,loading:"pdf"===eP,onClick:()=>{tQ("pdf")},children:"PDF"})]}):eN&&"workflow"===tm?(0,l.jsx)(p.Ay,{danger:!0,onClick:()=>{(async()=>{if(e_&&await (0,U.r)(e_,tt||void 0).catch(()=>void 0),ee){var e;ee.aborted=!0,null==(e=ee.pollController)||e.abort(),ee.loading=!1,ee.error="用户中止",et(),ee=null}localStorage.removeItem(tv),tx.current&&(clearInterval(tx.current),tx.current=null),eT(!1),tl([]),ta(null),tu(!1),await tj(),_.info("已中止生成任务")})()},children:"中止任务"}):void 0,children:(0,l.jsxs)($,{style:{width:"100%"},gap:16,children:["workflow"===tm&&tr.length>0&&(0,l.jsx)($,{gap:10,children:tr.map((e,t)=>{let r;return(0,l.jsxs)("div",{style:{display:"flex",gap:10,padding:10,border:"1px solid var(--colorBorderSecondary)",borderRadius:10,background:t===tb?"var(--colorFillAlter)":"var(--colorBgContainer)"},children:[(0,l.jsx)("span",{children:"process"===e.status?(0,l.jsx)(D.A,{}):"warning"===e.status?(0,l.jsx)(E.A,{style:{color:"var(--colorWarning)"}}):e.icon}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsxs)(i.A,{wrap:!0,children:[(0,l.jsx)(J,{strong:!0,children:e.title}),(0,l.jsx)(u.A,{color:"finish"===e.status?"success":"error"===e.status?"error":"warning"===e.status?"warning":"process"===e.status?"processing":"default",children:"warning"===(r=e.status)?"finish":r})]}),(0,l.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12,whiteSpace:"pre-wrap"},children:(0,l.jsxs)("div",{children:[e.subtitle&&(0,l.jsx)("div",{style:{marginBottom:4},children:(0,l.jsx)(u.A,{children:e.subtitle})}),(0,l.jsx)("div",{children:e.description}),(0,l.jsx)("div",{style:{marginTop:4},children:e.subSteps.map(e=>{var t;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"process"===e.status?"var(--colorPrimary)":"var(--colorTextSecondary)"},children:["process"===(t=e.status)?(0,l.jsx)(D.A,{}):"finish"===t?(0,l.jsx)(B.A,{}):"warning"===t?(0,l.jsx)(E.A,{style:{color:"var(--colorWarning)"}}):"error"===t?(0,l.jsx)(P.A,{}):(0,l.jsx)("span",{style:{display:"inline-block",height:6,width:6,borderRadius:"50%",background:"var(--colorTextTertiary)"}}),(0,l.jsx)("span",{children:e.title})]},e.key)})})]})})]})]},e.key)})}),"workflow"===tm&&(null==tn?void 0:tn.partialChapters)&&tn.partialChapters.length>0&&(0,l.jsx)(f.A,{size:"small",title:"章节进度",extra:(0,l.jsxs)(u.A,{color:"blue",children:[tn.partialChapters.filter(e=>"completed"===e.status).length,"/",tn.partialChapters.length]}),children:(0,l.jsx)($,{gap:6,style:{width:"100%"},children:tn.partialChapters.map(e=>(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:8,fontSize:12},children:[(0,l.jsx)(J,{ellipsis:!0,style:{maxWidth:480},children:e.title}),(0,l.jsxs)(i.A,{size:6,children:[(0,l.jsx)(u.A,{color:"failed"===e.status?"error":"success",children:"failed"===e.status?"失败":"完成"}),(0,l.jsxs)(J,{type:"secondary",children:[e.chars.toLocaleString()," 字"]})]})]},e.id))})}),"workflow"===tm&&(null==tn||null==(e=tn.reviewMetadata)?void 0:e.diagnostics)&&(0,l.jsx)(Z,{type:"info",title:"后台自动优化",children:"策略:".concat(tn.reviewMetadata.diagnostics.strategy.mode,";LLM 调用 ").concat(tn.reviewMetadata.diagnostics.llm.calls," 次;噪声过滤 ").concat((null==(t=tn.reviewMetadata.diagnostics.evidence)?void 0:t.filteredNoise)||0," 条;质量门禁 阻断").concat((null==(r=tn.reviewMetadata.diagnostics.quality)?void 0:r.blockingCount)||0,"/重要").concat((null==(a=tn.reviewMetadata.diagnostics.quality)?void 0:a.importantCount)||0,"/轻微").concat((null==(o=tn.reviewMetadata.diagnostics.quality)?void 0:o.minorCount)||0,";自动限流调整 ").concat(tn.reviewMetadata.diagnostics.llm.limitAdjustments," 次。审查与诊断信息仅用于系统修复,不会写入正文或导出文件。")}),"workflow"===tm&&eN&&0===tr.length&&(0,l.jsxs)("div",{style:{textAlign:"center",padding:40},children:[(0,l.jsx)(v.A,{}),(0,l.jsx)("div",{style:{marginTop:12,color:"var(--colorTextSecondary)"},children:"正在准备生成…"})]}),eR&&(0,l.jsx)("div",{ref:ec,children:(0,l.jsx)(x.A,{items:[{key:"edit",label:R("documents.edit"),children:(0,l.jsxs)($,{gap:16,style:{width:"100%"},children:[(0,l.jsx)(X,{rows:28,value:eB,disabled:eW,onSelect:e=>{var t,r,l;return eY({start:null!=(t=e.currentTarget.selectionStart)?t:0,end:null!=(l=null!=(r=e.currentTarget.selectionEnd)?r:e.currentTarget.selectionStart)?l:0})},onChange:e=>{var t,r,l;ez(e.target.value),eU(null),eX(null),eY({start:null!=(t=e.target.selectionStart)?t:0,end:null!=(l=null!=(r=e.target.selectionEnd)?r:e.target.selectionStart)?l:0})}}),(0,l.jsx)(f.A,{size:"small",style:{borderRadius:12,background:"linear-gradient(135deg, var(--colorFillAlter), var(--colorBgContainer))"},children:(0,l.jsxs)($,{gap:16,style:{width:"100%"},children:[(0,l.jsxs)(i.A,{align:"start",style:{width:"100%",justifyContent:"space-between"},children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)(i.A,{size:6,children:[(0,l.jsx)(z.A,{style:{color:"var(--colorAccent)"}}),(0,l.jsx)(J,{strong:!0,children:"精准修改"}),(0,l.jsx)(u.A,{color:"blue",children:"AI 辅助"})]}),(0,l.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12},children:"针对当前编辑内容补充更具体的要求,AI 会保留文档结构并按你的提示细化修改。"})]}),(0,l.jsxs)(p.Ay,{size:"small",icon:(0,l.jsx)(H.A,{}),onClick:()=>e1(e=>!e),disabled:0===eZ.length,children:["历史版本 ",eZ.length>0?eZ.length:""]})]}),(0,l.jsx)(Z,{type:"info",title:"系统只负责识别修改范围,不改写你的提示词;选中文字后优先只改选区,没有选区时按光标所在小节/章节定位。"}),(0,l.jsx)(X,{rows:4,value:eG,disabled:eW,onChange:e=>{eO(e.target.value),eU(null),eX(null)},placeholder:"例如:写细一点;润色这段;第七章补充高处作业和临电安全措施;把安全检查频次改成每周一次。"}),(0,l.jsxs)(i.A,{wrap:!0,style:{width:"100%",justifyContent:"space-between"},children:[(0,l.jsx)(i.A,{wrap:!0,children:["写细一点","更专业","只润色选区","补充可执行措施"].map(e=>(0,l.jsx)(p.Ay,{size:"small",disabled:eW,onClick:()=>eO(t=>t?"".concat(t,";").concat(e):e),children:e},e))}),(0,l.jsx)(p.Ay,{type:"primary",icon:(0,l.jsx)(z.A,{}),loading:eW&&"planning"===eH,disabled:!eG.trim()||eW,onClick:()=>{t$()},children:"识别修改范围"})]}),eK&&!eQ&&(0,l.jsx)(f.A,{size:"small",style:{borderRadius:10,borderColor:"var(--colorAccent)"},children:(0,l.jsxs)($,{gap:8,style:{width:"100%"},children:[(0,l.jsxs)(i.A,{wrap:!0,children:[(0,l.jsx)(u.A,{color:"purple",children:eK.scope}),(0,l.jsx)(u.A,{color:"blue",children:eK.action}),(0,l.jsxs)(u.A,{color:eK.confidence>=.8?"green":"orange",children:["置信度 ",Math.round(100*eK.confidence),"%"]}),eK.targetTitle&&(0,l.jsx)(J,{strong:!0,children:eK.targetTitle})]}),(0,l.jsx)(J,{children:eK.summary}),(0,l.jsx)(J,{type:"secondary",style:{fontSize:12},children:"将按你的原始提示词执行,不添加额外编辑任务。"}),(0,l.jsxs)(i.A,{children:[(0,l.jsx)(p.Ay,{type:"primary",loading:eW&&"applying"===eH,onClick:()=>{t0(eK)},children:"执行并预览"}),(0,l.jsx)(p.Ay,{disabled:eW,onClick:()=>eU(null),children:"取消"})]})]})}),eQ&&(0,l.jsx)(f.A,{size:"small",style:{borderRadius:10,borderColor:"var(--colorSuccess)"},children:(0,l.jsxs)($,{gap:8,style:{width:"100%"},children:[(0,l.jsxs)(i.A,{wrap:!0,children:[(0,l.jsx)(u.A,{color:"green",children:"修改预览"}),(0,l.jsx)(J,{children:eQ.summary||eQ.plan.summary}),(0,l.jsxs)(u.A,{children:[eQ.changedChars&&eQ.changedChars>0?"+".concat(eQ.changedChars):eQ.changedChars," 字符"]})]}),(0,l.jsxs)(j.A,{gutter:12,children:[(0,l.jsxs)(y.A,{span:12,children:[(0,l.jsx)(J,{strong:!0,children:"修改前"}),(0,l.jsx)("div",{style:{marginTop:6,maxHeight:180,overflow:"auto",padding:10,borderRadius:8,background:"var(--colorFillAlter)",whiteSpace:"pre-wrap",fontSize:12},children:eQ.beforeSnippet||"无片段预览"})]}),(0,l.jsxs)(y.A,{span:12,children:[(0,l.jsx)(J,{strong:!0,children:"修改后"}),(0,l.jsx)("div",{style:{marginTop:6,maxHeight:180,overflow:"auto",padding:10,borderRadius:8,background:"var(--colorFillAlter)",whiteSpace:"pre-wrap",fontSize:12},children:eQ.afterSnippet||"无片段预览"})]})]}),(0,l.jsxs)(i.A,{children:[(0,l.jsx)(p.Ay,{type:"primary",onClick:()=>{eQ&&(tJ(eQ.before,eQ.prompt),ez(eQ.markdown),tY(!0),_.success("已应用精准修改"))},children:"应用到文档"}),(0,l.jsx)(p.Ay,{onClick:()=>eX(null),children:"返回计划"}),(0,l.jsx)(p.Ay,{danger:!0,onClick:()=>{eU(null),eX(null)},children:"放弃"})]})]})}),e0&&(0,l.jsx)("div",{style:{borderTop:"1px solid var(--colorBorderSecondary)",paddingTop:12},children:(0,l.jsx)(w.A,{size:"small",dataSource:eZ,locale:{emptyText:"暂无历史版本"},renderItem:e=>(0,l.jsx)(w.A.Item,{actions:[(0,l.jsx)(p.Ay,{size:"small",disabled:eW,onClick:()=>{tJ(eB,"恢复前版本"),ez(e.content),tY(!0),_.success("已恢复历史版本")},children:"恢复"},"restore")],children:(0,l.jsx)(w.A.Item.Meta,{title:(0,l.jsxs)(i.A,{children:[(0,l.jsx)(J,{children:new Date(e.createdAt).toLocaleString()}),(0,l.jsx)(u.A,{children:e.prompt})]}),description:(0,l.jsx)(J,{type:"secondary",ellipsis:!0,children:e.content.replace(/\s+/gu," ").slice(0,120)})})})})})]})})]})},{key:"chapters-facts",label:"章节与事实",children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[eR.chapters.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsxs)(J,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["章节 (",eR.chapters.length,")"]}),(0,l.jsx)(w.A,{size:"small",dataSource:eR.chapters,renderItem:e=>(0,l.jsx)(w.A.Item,{children:(0,l.jsx)(w.A.Item.Meta,{title:e.title,description:"证据: ".concat(e.evidence.length," \xb7 缺失: ").concat(e.missingFacts.length)})})})]}),eR.structuredFacts.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsxs)(J,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["结构化事实 (",eR.structuredFacts.length,")"]}),(0,l.jsx)(b.A,{size:"small",column:1,bordered:!0,children:eR.structuredFacts.map((e,t)=>(0,l.jsxs)(b.A.Item,{label:e.key,children:[(0,l.jsx)("span",{children:e.value}),(0,l.jsx)(u.A,{style:{marginLeft:8},children:e.confidence.toFixed(2)}),(0,l.jsx)(J,{type:"secondary",style:{fontSize:11,marginLeft:8},children:e.sourceFile})]},t))})]})]})},{key:"sources-missing",label:"来源与缺失",children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)(J,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["引用来源 (",eR.sources.length,")"]}),0===eR.sources.length?(0,l.jsx)(h.A,{description:"暂无"}):(0,l.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:eR.sources.map(e=>(0,l.jsxs)(u.A,{color:"blue",children:[e.filePath," (",e.count,")"]},e.filePath))})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)(J,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["缺失项 (",eR.missingItems.length,")"]}),0===eR.missingItems.length?(0,l.jsx)(h.A,{description:"无缺失"}):(0,l.jsx)(w.A,{size:"small",dataSource:eR.missingItems,renderItem:e=>(0,l.jsx)(w.A.Item,{children:e})})]})]})},{key:"validation",label:"校验 (".concat(eR.validationIssues.length,")"),children:0===eR.validationIssues.length?(0,l.jsx)(h.A,{description:"校验通过"}):(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[eR.validationIssues.map(e=>(0,l.jsxs)("div",{style:{border:"1px solid var(--colorBorderSecondary)",borderRadius:8,padding:12},children:[(0,l.jsx)(u.A,{color:"error"===e.level?"error":"warning"===e.level?"warning":"blue",children:e.level}),(0,l.jsx)("div",{style:{marginTop:6,whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-all",lineHeight:1.6},children:e.message}),e.suggestion&&(0,l.jsx)("div",{style:{marginTop:6,color:"var(--colorTextSecondary)",whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-all"},children:e.suggestion})]},"".concat(e.level,"-").concat(e.message))),eR.exportGate.checklist.length>0&&(0,l.jsxs)("div",{style:{marginTop:8},children:[(0,l.jsx)(J,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:"导出门禁"}),(0,l.jsx)(w.A,{size:"small",dataSource:eR.exportGate.checklist,renderItem:e=>(0,l.jsxs)(w.A.Item,{children:[(0,l.jsx)(J,{style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:e.label}),(0,l.jsx)(u.A,{color:e.passed?"success":"error",children:e.passed?"PASS":"FAIL"})]})})]})]})},{key:"stages",label:"执行阶段 (".concat(eR.executionStages.length,")"),children:(0,l.jsx)(w.A,{size:"small",dataSource:eR.executionStages,renderItem:e=>(0,l.jsxs)(w.A.Item,{children:[(0,l.jsx)(w.A.Item.Meta,{avatar:er[e.type]||(0,l.jsx)(F.A,{}),title:(0,l.jsx)(J,{title:e.roleId,style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:"".concat(en[e.type]||e.type," \xb7 ").concat(e.roleName||tA(e.roleId))}),description:(0,l.jsx)(J,{type:"secondary",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-word"},children:e.message})}),(0,l.jsx)(u.A,{color:"success"===e.status?"success":"failed"===e.status?"error":"skipped"===e.status?"default":"warning",children:e.status})]})})}]})})]})}),(0,l.jsx)(g.A,{title:R("documents.templateEditor"),open:e2,onClose:()=>e6(!1),size:"large",mask:{closable:!1},styles:{body:{padding:20,overflow:"auto"},header:{borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,l.jsxs)(i.A,{children:[(0,l.jsx)(p.Ay,{onClick:()=>e6(!1),children:R("common.cancel")}),(0,l.jsx)(p.Ay,{type:"primary",onClick:()=>{tP()},children:R("common.save")})]}),children:(0,l.jsxs)(d.A,{form:ei,layout:"vertical",requiredMark:"optional",children:[(0,l.jsxs)(j.A,{gutter:12,children:[(0,l.jsx)(d.A.Item,{name:"id",hidden:!0,children:(0,l.jsx)(n.A,{})}),(0,l.jsx)(y.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"name",label:R("documents.templateName"),rules:[{required:!0}],children:(0,l.jsx)(n.A,{})})}),(0,l.jsx)(y.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"category",label:R("documents.templateCategory"),children:(0,l.jsx)(n.A,{})})}),(0,l.jsx)(y.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"outputTitle",label:R("documents.outputTitle"),children:(0,l.jsx)(n.A,{})})}),(0,l.jsx)(y.A,{xs:24,md:12,children:(0,l.jsx)(d.A.Item,{name:"description",label:R("documents.templateDescription"),children:(0,l.jsx)(n.A,{})})})]}),(0,l.jsx)(d.A.Item,{name:"projectRoleConfigId",label:R("documents.projectRoleConfig"),rules:[{required:!0,message:R("documents.projectRoleConfigRequired")}],children:(0,l.jsx)(A.A,{showSearch:!0,placeholder:R("documents.projectRoleConfigRequired"),options:tw})}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(J,{strong:!0,className:"text-base text-[var(--colorText)] block mb-1",children:"项目文件绑定"}),(0,l.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:"每个文件角色可直接从下拉树形列表中多选文件或文件夹。"})]}),(0,l.jsx)(u.A,{color:"blue",className:"border-0",children:"按文件角色多选"})]}),eb?(0,l.jsxs)("div",{className:"text-center py-8",children:[(0,l.jsx)(v.A,{}),(0,l.jsx)("div",{className:"mt-3 text-[var(--colorTextSecondary)] text-xs",children:"正在加载知识库文件…"})]}):0===e9.length?(0,l.jsx)(h.A,{image:h.A.PRESENTED_IMAGE_SIMPLE,description:e3?"当前项目角色未配置文件角色":"请先选择项目角色"}):0===ey.length?(0,l.jsx)(h.A,{image:h.A.PRESENTED_IMAGE_SIMPLE,description:"暂无知识库文件"}):(0,l.jsx)("div",{className:"flex flex-col gap-4",children:e9.map(e=>{let t=e.value,r=t?es(te[t]||[]):[];return(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"font-medium text-sm text-[var(--colorText)]",children:e.label}),(0,l.jsx)(p.Ay,{type:"link",size:"small",danger:!0,disabled:0===r.length,onClick:()=>tD(t,[]),className:"p-0 h-auto",children:"清空"})]}),(0,l.jsx)(d.A.Item,{name:["fileBindingGroups",t],hidden:!0,children:(0,l.jsx)(n.A,{})}),(0,l.jsx)(k.A,{treeData:ey,loadData:tF,fieldNames:{label:"rawTitle",value:"value",children:"children"},value:r,onChange:e=>{tD(t,e.map(e=>String(e)))},treeCheckable:!0,showCheckedStrategy:k.A.SHOW_PARENT,placeholder:"点击这里搜索或选择文件...",style:{width:"100%"},listHeight:300,showSearch:!0,maxTagCount:"responsive",size:"large"})]},e.value)})})]})]})})]})}}},e=>{e.O(0,[580,665,576,209,7,787,195,455,506,230,636,593,792],()=>e(e.s=16403)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[920],{2548:(e,s,l)=>{"use strict";l.r(s),l.d(s,{default:()=>w});var i=l(65321),r=l(35292),c=l(68787),n=l(2256),d=l(38770),t=l(11702),x=l(80300),h=l(55122),j=l(15622),a=l(71330),m=l(8579),A=l(66926),o=l(7851),g=l(84742),p=l(48321);let{Paragraph:u,Title:z,Text:N}=r.A,k=[{icon:(0,i.jsx)(a.A,{}),title:"准备阶段",color:"blue",items:["配置模型","上传知识库资料","创建提示词"]},{icon:(0,i.jsx)(m.A,{}),title:"编排阶段",color:"purple",items:["创建文件角色","创建提示词角色","创建项目角色配置并排序"]},{icon:(0,i.jsx)(A.A,{}),title:"生成阶段",color:"processing",items:["创建模板","知识库证据增强","动态执行状态"]},{icon:(0,i.jsx)(o.A,{}),title:"交付阶段",color:"green",items:["检查事实和来源","检查导出门禁","导出正式文件"]}],y=[{title:"第一步:配置模型",goal:"让系统具备 LLM JSON 事实抽取、章节生成、自动规则检查和修复能力。",path:"左侧菜单 → 模型配置",steps:["点击新增供应商,选择 OpenAI、DeepSeek、OpenRouter、Ollama 或其他兼容 OpenAI 协议的服务。","填写 Base URL、API Key、供应商名称并保存。","添加模型名称,建议至少准备一个用于生成和推理的模型。","把模型设置为当前启用模型。","执行健康检查,确认模型可调用。"],checks:["模型健康检查通过","至少有一个启用模型","API Key 和 Base URL 正确"],tips:"如果模型不可用,系统会回退到本地确定性抽取,但事实抽取质量会下降。"},{title:"第二步:上传知识库资料",goal:"把项目资料放入系统,让后续文件角色可以绑定。",path:"左侧菜单 → 知识库 → 文件管理 / 管理",steps:["上传招标文件、工程概况、合同条件、技术要求等项目事实资料。","上传工程量清单、劳动力计划、机械设备计划、材料计划等表格资料。","上传图纸目录、图纸说明、设计说明等图纸类资料。","上传规范、规程、企业标准、评分办法、编制要求等规则类资料。","等待索引完成,并在知识库文件列表中确认文件可见。"],checks:["文件上传成功","索引完成","文件能在文件角色绑定下拉框中看到"],tips:"表格资料最好有清晰表头;图纸资料最好附带目录或文字说明。"},{title:"第三步:创建提示词",goal:"定义每个执行阶段的模型行为,并写清系统需要自动抽取的检查规则。",path:"左侧菜单 → 提示词管理",steps:["创建事实抽取提示词:要求只抽取资料中明确出现的事实,返回结构化 JSON,不允许编造。","创建章节生成提示词:定义文档类型、专业语气、章节风格、引用事实和禁止事项。","在总控、章节生成或角色提示词中写清工程名称、工期、质量目标、数字、表格引用、章节完整性等约束,系统运行时会自动抽取为检查规则。","创建格式化提示词:定义编号、表格、分页和正式输出样式。","保存后确认提示词能在提示词角色绑定下拉框中看到。"],checks:["事实抽取提示词已创建","章节生成提示词已创建","格式化提示词或角色约束已创建"],tips:"提示词越明确,生成结果越稳定。系统会自动抽取规则用于生成、检查和修复,建议明确写上“没有来源的数据不要写”。"},{title:"第四步:创建文件角色",goal:"告诉系统每个文件在生成流程中的用途。",path:"左侧菜单 → 角色配置 → 新建文件角色",steps:["填写角色名称,例如“招标文件事实源”“工程量清单表格”“图纸说明文件”。","选择处理类型:规则文件、项目事实文件、表格数据、图纸文件、规范文件或参考资料。","绑定对应知识库文件。","保存角色。","按文件用途创建多个文件角色,不建议把不同用途资料混在一个角色里。"],checks:["文件角色有名称","已选择处理类型","具体项目文件由生成流程自动识别"],tips:"处理类型很重要:系统会根据它决定是否进行表格解析、事实抽取、规则引用或来源追踪。"},{title:"第五步:创建提示词角色",goal:"告诉系统每条提示词在哪个执行阶段使用,并让系统从提示词中自动抽取检查规则。",path:"左侧菜单 → 角色配置 → 新建提示词角色",steps:["填写角色名称,例如“施工组织设计事实抽取”“章节生成规则”“格式与交付规则”。","选择执行类型:事实抽取、章节生成、格式化或参考;需要检查的要求直接写进对应提示词,系统运行时会自动抽取规则。","绑定对应提示词。","保存角色。","一个执行阶段可以有多个提示词角色,后续在项目角色配置中排序。"],checks:["提示词角色有名称","已选择执行类型","已绑定提示词"],tips:"不需要单独维护检查类提示词;系统会从已绑定提示词中抽取禁止项、章节规则、事实规则、字数要求和导出检查规则。"},{title:"第六步:创建项目角色配置并排序",goal:"把文件角色和提示词角色组合成一个可复用的项目生成方案。",path:"左侧菜单 → 角色配置 → 新建项目配置",steps:["填写配置名称,例如“某项目施工组织设计配置”。","添加文件角色,并设置顺序。推荐:规则文件 → 项目事实文件 → 表格数据 → 图纸文件 → 规范文件 → 参考资料。","添加提示词角色,并设置顺序。推荐:事实抽取 → 章节生成 → 格式化 → 参考;检查规则会从已绑定提示词中自动抽取。","保存项目角色配置。","后续模板只绑定项目角色配置,不再重复绑定文件和提示词。"],checks:["至少包含一个文件角色","至少包含一个提示词角色","顺序符合业务流程"],tips:"排序决定系统读取资料和应用提示词的优先级,是生产级生成稳定性的关键。"},{title:"第七步:创建模板并绑定项目配置",goal:"定义要生成哪种文档,以及使用哪套项目角色配置。",path:"左侧菜单 → 生成编辑 → 新建模板",steps:["填写模板 ID。ID 由系统生成或保持唯一,不建议手动频繁修改。","填写模板名称,例如“施工组织设计”“技术标文件”“专项施工方案”。","填写分类、输出标题和模板说明。","选择第六步创建的项目角色配置。","为章节填写查询词和必需事实;系统会自动按章节检索知识库证据。","高级优先证据通常无需填写;只有必须指定某份官方资料、图纸或表格时才使用。","保存模板。"],checks:["模板名称清晰","输出标题正确","已绑定项目角色配置"],tips:"模板负责文档入口;项目角色配置负责资料、提示词和顺序。两者分离后更容易复用。"},{title:"第八步:执行生成并查看状态",goal:"让用户明确知道生成流程进行到哪一步。",path:"左侧菜单 → 生成编辑 → 选择模板 → 点击生成",steps:["点击生成按钮后,页面会出现“执行状态”卡片。","系统会先绑定文件角色和提示词角色,再按章节自动检索知识库证据;只有在必须指定官方资料、图纸或表格时,才需要使用高级优先证据。","执行状态会根据当前模板、后台自动规范、文件角色、提示词角色、运行时规则、证据增强和章节自动生成,不是固定工程流程。","当前执行节点会高亮显示,子状态会展示正在处理的章节、事实字段、文件角色、运行时规则、增强贡献或门禁规则。","生成任务在后台运行,页面通过 documentId 轮询;切换页面后回到生成编辑仍可恢复状态。","生成完成后,系统会用后端真实 executionStages 回填最终状态。","如果导出门禁存在风险,生成完成节点会提示需要查看规则检查结果。"],checks:["执行状态 Card 出现","当前节点有高亮","生成完成后有执行阶段结果"],tips:"如果长时间停留在某一步,优先检查模型配置、知识库索引和文件角色绑定。"},{title:"第九步:审查结果并导出",goal:"确保文档可追溯、可检查、可交付,同时能区分高风险问题和可复核 warning。",path:"生成编辑 → 编辑器下方 Tabs → 导出按钮 / 草稿历史",steps:["查看“结构化事实”,确认事实字段是否按后台自动规范动态 schema 抽取,并检查冲突提示。","查看“来源”,确认事实来自后台自动规范要求的文件角色和绑定资料。","查看“缺失项”,补齐缺失资料或调整角色配置。","查看“规则检查”,优先处理 error;warning 表示可导出但建议复核。","查看“导出门禁”,真实 blockingIssues 会作为风险提示保留,但不阻断用户导出。","在草稿历史中确认生成状态、warning 原因、整体生成耗时,并可删除不需要的记录。","可以先导出 HTML 预览排版,再导出 DOCX/PDF。"],checks:["无真实阻断问题","关键事实有来源","章节有证据","warning 原因已复核","导出文件可打开"],tips:"导出不是简单放行:真实阻断仍会拦截;生成完成但存在可复核问题时显示 warning,用户可以继续导出并按原因优化资料。"}];function w(){let e=(0,p.Vr)();return(0,i.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,i.jsxs)(c.A,{className:"cardGlass",styles:{body:{padding:24}},children:[(0,i.jsx)(z,{level:2,className:"mb-2",children:e("guide.title")}),(0,i.jsx)(u,{className:"pageDesc mb-0",children:e("guide.description")})]}),(0,i.jsx)(n.A,{gutter:[16,16],children:k.map(e=>(0,i.jsx)(d.A,{xs:24,md:12,xl:6,children:(0,i.jsx)(c.A,{className:"h-full",title:(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[e.icon,e.title]}),children:(0,i.jsx)("div",{className:"space-y-2",children:e.items.map(s=>(0,i.jsx)("div",{children:(0,i.jsx)(t.A,{color:e.color,children:s})},s))})})},e.title))}),(0,i.jsx)(c.A,{title:e("guide.fullFlow"),children:(0,i.jsx)(n.A,{gutter:[12,12],children:y.map((e,s)=>(0,i.jsx)(d.A,{xs:24,sm:12,lg:8,xl:6,children:(0,i.jsx)(c.A,{size:"small",className:"h-full",children:(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[(0,i.jsx)(t.A,{color:"blue",className:"mt-1",children:s+1}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)(N,{strong:!0,children:e.title.replace(/^第.+?:/u,"")}),(0,i.jsx)(u,{className:"mb-1 text-xs",ellipsis:{rows:2,tooltip:e.goal},children:e.goal}),(0,i.jsx)(N,{type:"secondary",className:"text-xs break-words",children:e.path})]})]})})},e.title))})}),(0,i.jsx)(c.A,{title:"详细步骤说明:照着做即可跑通",children:(0,i.jsx)(x.A,{mode:"left",items:y.map(e=>({dot:(0,i.jsx)(g.A,{}),children:(0,i.jsxs)("div",{className:"space-y-3",children:[(0,i.jsx)(z,{level:4,className:"mb-0",children:e.title}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"目标:"}),e.goal]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"入口:"}),e.path]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(N,{strong:!0,children:"操作步骤:"}),(0,i.jsx)("ol",{className:"list-decimal pl-6 mt-2 space-y-1",children:e.steps.map(e=>(0,i.jsx)("li",{children:e},e))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(N,{strong:!0,children:"完成检查:"}),(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:e.checks.map(e=>(0,i.jsx)(t.A,{color:"success",children:e},e))})]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"提示:"}),e.tips]}),(0,i.jsx)(h.A,{})]})}))})}),(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{title:e("guide.roleDesign"),children:[(0,i.jsx)(u,{children:e("guide.roleDesignDesc")}),(0,i.jsxs)("div",{className:"space-y-3",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(t.A,{color:"blue",children:"file"}),(0,i.jsx)(N,{strong:!0,children:e("guide.fileRole")}),(0,i.jsx)(u,{children:e("guide.fileRoleDesc")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t.A,{color:"purple",children:"prompt"}),(0,i.jsx)(N,{strong:!0,children:e("guide.promptRole")}),(0,i.jsx)(u,{children:e("guide.promptRoleDesc")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t.A,{color:"processing",children:"config"}),(0,i.jsx)(N,{strong:!0,children:e("guide.projectConfig")}),(0,i.jsx)(u,{children:e("guide.projectConfigDesc")})]})]})]})}),(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{title:e("guide.generationEngine"),children:[(0,i.jsx)(u,{children:e("guide.generationEngineDesc")}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.A,{children:e("roles.factExtraction")}),(0,i.jsx)(t.A,{children:e("roles.chapterGeneration")}),(0,i.jsx)(t.A,{children:"自动规则检查"}),(0,i.jsx)(t.A,{children:e("roles.formatting")}),(0,i.jsx)(t.A,{children:e("documents.exportGate")})]})]})})]}),(0,i.jsx)(c.A,{title:"文件角色和提示词角色案例:它们在模板生成中到底起什么作用",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{size:"small",title:"案例 A:创建文件角色“招标文件事实源”",children:[(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"类型选择 file,处理类型选择“项目事实文件”,绑定招标文件、合同摘要或项目概况。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统会从这个角色绑定的文件里抽取工程名称、建设地点、工期、质量目标、范围边界等事实,并把来源带入结构化事实和章节证据。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"带来的提升:"}),"模型不再凭空补项目事实;章节生成和导出校验都会追踪“这句话来自哪个文件角色、哪个文件”。"]})]})}),(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{size:"small",title:"案例 B:创建文件角色“工程量清单表格”",children:[(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"类型选择 file,处理类型选择“表格数据”,绑定 Excel、CSV、清单表或计划表。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统会读取 Sheet、表头、行列和来源范围,把表格数据转换成可引用的结构化资源证据。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"带来的提升:"}),"章节中涉及数量、清单、计划、资源配置时,优先引用表格来源,减少数字编造和漏项。"]})]})}),(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{size:"small",title:"案例 C:创建提示词角色“章节生成规则”",children:[(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"先在提示词管理中写好生成规则,例如“必须引用来源、不要写无来源数据、输出正式报告语气”;再创建 prompt 角色,执行类型选择“章节生成”。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统生成每个章节时会把这个提示词加入 LLM 上下文,用它约束语气、结构、引用方式和禁止事项。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"带来的提升:"}),"同一套资料可以生成更稳定的文档风格;不同模板只需替换提示词角色,就能调整写法而不改知识库文件。"]})]})}),(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{size:"small",title:"案例 D:在提示词中写入交付检查要求",children:[(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"提示词内容写清楚必须检查的交付要求,例如“不能出现资料未提供、图片引用必须可访问、关键事实必须有来源”;执行类型选择章节生成、格式化或参考即可。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统会在运行时自动抽取这些要求,结合证据来源、事实落位和导出门禁检查文档是否可交付。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"带来的提升:"}),"不需要维护单独检查类提示词,也能把人工审稿经验前置到生成流程,降低导出后才发现缺来源、缺图片、格式不合格的概率。"]})]})})]})}),(0,i.jsx)(c.A,{title:"运行时规则自动抽取说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"用户只维护业务提示词",children:(0,i.jsx)(u,{children:"系统不要求用户单独创建检查类提示词。用户只需要在总控、章节生成、格式化或参考提示词中写清“必须怎么写、不能写什么、字数和章节要求”。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"运行时自动抽取规则",children:(0,i.jsx)(u,{children:"生成开始时,系统会从已绑定提示词中抽取禁止词、章节规则、主体表达、商务敏感项、事实真实性、字数要求和角色关注点,并统一用于生成、检查和修复。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"执行状态可追踪",children:(0,i.jsx)(u,{children:"生成状态会展示提示词规则执行摘要,方便确认用户写入的约束是否被识别并参与本次生成流程。"})})})]})}),(0,i.jsx)(c.A,{title:"联网增强说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"默认关闭",children:(0,i.jsx)(u,{children:"联网增强在模型配置页手动开启。开启后,系统会受控检索公开规范、政策和通用技术资料,用于增强措施准确性。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"不覆盖项目事实",children:(0,i.jsx)(u,{children:"联网资料不会用于生成或修改项目名称、地点、规模、工期、质量标准、工程量、材料规格、商务数据等项目事实。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"有报告和门禁",children:(0,i.jsx)(u,{children:"生成状态会展示联网增强报告;导出前会检查并清理联网过程性话术,避免正式正文出现搜索过程描述。"})})})]})}),(0,i.jsx)(c.A,{title:"我的数据和门禁规则说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"使用自己的数据",children:(0,i.jsx)(u,{children:"文件、提示词、角色配置和规范包都来自用户自己创建或上传的内容,生成流程会按当前项目配置读取,并自动抽取检查规则参与生成和导出门禁。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"自定义门禁类型会执行",children:(0,i.jsx)(u,{children:"门禁规则由后台根据模板、提示词和角色绑定自动形成,并与系统门禁一起参与规则检查,不需要用户手动维护单独检查类提示词。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"上传后关注索引状态",children:(0,i.jsx)(u,{children:"文件上传完成后,知识库索引会继续在后台写入。请在文件管理页查看状态,如果失败,页面会展示原因,方便重新配置模型或重试。"})})})]})}),(0,i.jsx)(c.A,{title:"知识库证据和增强贡献说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"自动检索为主",children:(0,i.jsx)(u,{children:"模板章节的查询词、章节目的和必需事实会驱动系统自动检索知识库证据。高级优先证据只是兜底能力,用于必须指定官方资料、图纸或表格的场景,不是日常必填项。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"增强贡献可追踪",children:(0,i.jsx)(u,{children:"生成流程会展示知识库证据、人工确认/固定证据和自动检索证据的数量,帮助判断本次增强是否真的参与生成,而不是增加用户维护成本。"})})})]})}),(0,i.jsx)(c.A,{title:"动态 schema、证据和执行状态说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"动态事实 schema",children:(0,i.jsx)(u,{children:"系统不会写死工程字段。后台自动规范会结合模板章节 requiredFacts、角色绑定和提示词形成抽取 schema,并驱动事实抽取、冲突检测、规则检查和导出门禁。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"结构化资源证据",children:(0,i.jsx)(u,{children:"文本、PDF/Word、Excel/CSV、图片、地图图纸和其他附件都会被整理成资源证据,包含文件角色、处理类型、正文用途、关联事实和证据片段,模型据此理解资料关系。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"动态执行状态",children:(0,i.jsx)(u,{children:"生成编辑页的执行节点会随模板、规范包、文件角色、提示词角色、章节和门禁规则变化;用户生成不同项目文件时看到的是对应项目的流程,而不是固定示例流程。"})})})]})}),(0,i.jsx)(c.A,{title:"生成记录、warning 和导出门禁怎么理解",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,lg:8,children:(0,i.jsxs)(c.A,{size:"small",title:"草稿历史记录",children:[(0,i.jsxs)(u,{children:["每次后台生成都会写入全局项目目录 ",(0,i.jsxs)(N,{code:!0,children:["~/.customize-agent/projects/","{projectId}","/generatedDocuments"]}),"。记录会保存标题、模板、状态、创建时间、完成时间、生成耗时、正文、结构化结果和资源引用。"]}),(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"completed:生成完成且无需要关注的问题。"}),(0,i.jsx)("li",{children:"warning:生成完成,但存在可复核问题。"}),(0,i.jsx)("li",{children:"failed:生成失败,需要查看错误原因。"}),(0,i.jsx)("li",{children:"generating:后台任务仍在执行,可轮询恢复。"})]})]})}),(0,i.jsx)(d.A,{xs:24,lg:8,children:(0,i.jsxs)(c.A,{size:"small",title:"warning 不是失败",children:[(0,i.jsx)(u,{children:"warning 用于提醒用户“文档已经生成,但建议复核”。例如必需事实没有在最佳来源角色中抽到、部分来源需要人工确认、格式或内容有优化建议。warning 会显示在草稿历史和校验详情中,并保留导出能力。"}),(0,i.jsx)(u,{children:"如果存在明确风险问题,例如正文包含临时图片生成 URL、出现“资料未提供”占位、真实 blockingIssues 未解决,导出门禁会提示风险,但仍保留 DOCX/PDF 导出能力。"})]})}),(0,i.jsx)(d.A,{xs:24,lg:8,children:(0,i.jsxs)(c.A,{size:"small",title:"导出门禁规则",children:[(0,i.jsx)(u,{children:"门禁分为“高风险提示”和“复核建议”。系统不会禁止导出,但会在出现高风险问题时提醒用户复核交付质量。"}),(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"Markdown/HTML 更适合快速预览和人工调整。"}),(0,i.jsx)("li",{children:"DOCX/PDF 会启用真实门禁检查。"}),(0,i.jsx)("li",{children:"草稿历史可保留多个版本,便于对比和再次导出。"})]})]})})]})}),(0,i.jsx)(c.A,{title:"生成资源和知识库的关系",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsxs)(c.A,{size:"small",title:"生成资源不进入知识库",children:[(0,i.jsx)(u,{children:"模板运行生成的文档、图片、封面或后处理资源只会登记到生成资源管理页,不会写入 knowledgeBase,也不会建立知识库索引。"}),(0,i.jsx)(u,{children:"这样可以避免模型产物污染事实来源;需要作为资料复用时,应由用户明确上传到知识库。"})]})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsxs)(c.A,{size:"small",title:"资源预览和坏图处理",children:[(0,i.jsx)(u,{children:"资源预览会从全局 generatedDocuments 目录解析文件,不依赖当前页面临时路径。图片下载会识别“image is generating”等占位响应,并校验 PNG/JPEG/WebP 字节,避免把占位文本当成图片保存。"}),(0,i.jsx)(u,{children:"如果预览失败,优先查看资源管理页中的文件路径、资源状态和原始生成记录。"})]})})]})}),(0,i.jsx)(c.A,{title:"文件角色处理类型大白话说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"规则文件",children:(0,i.jsx)(u,{children:"用来告诉系统“必须怎么写、不能怎么写、按什么标准判断”。适合放评分办法、甲方编制要求、攻略写作要求、输出格式要求。生成时会优先作为约束使用。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"项目事实文件",children:(0,i.jsx)(u,{children:"用来告诉系统“真实情况是什么”。适合放项目概况、合同摘要、招标文件关键信息、游戏角色资料、产品资料。事实字段通常从这里抽取。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"表格数据",children:(0,i.jsx)(u,{children:"用来解析结构化数据。适合放 Excel、CSV、清单、计划表、评分表、推荐指数表。系统会读取 Sheet、表头、行列和来源范围。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"图纸文件",children:(0,i.jsx)(u,{children:"用来表达空间关系、路线、结构、站位或设计说明。可以是图纸目录、设计说明、路线示意、阵型图说明。没有 CAD 时也可以用文字图纸说明。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"规范文件",children:(0,i.jsx)(u,{children:"用来作为专业依据。适合放国家规范、行业标准、企业标准、攻略结构规范、质量标准。生成、规则检查和导出门禁会把它当成依据。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"参考资料",children:(0,i.jsx)(u,{children:"只作为辅助阅读材料,不建议放关键事实。适合放图片来源、公开网页链接、背景资料、案例资料。系统可以参考,但不应把它当成强事实。"})})})]})}),(0,i.jsx)(c.A,{title:"推荐资料清单",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"必备资料",children:(0,i.jsxs)("ul",{className:"list-disc pl-5",children:[(0,i.jsx)("li",{children:"项目事实文件"}),(0,i.jsx)("li",{children:"招标或编制规则"}),(0,i.jsx)("li",{children:"章节生成提示词"})]})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"强烈建议",children:(0,i.jsxs)("ul",{className:"list-disc pl-5",children:[(0,i.jsx)("li",{children:"表格数据"}),(0,i.jsx)("li",{children:"图纸说明"}),(0,i.jsx)("li",{children:"规范或企业标准"})]})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"导出前确认",children:(0,i.jsxs)("ul",{className:"list-disc pl-5",children:[(0,i.jsx)("li",{children:"无 error 校验"}),(0,i.jsx)("li",{children:"事实有来源"}),(0,i.jsx)("li",{children:"导出门禁通过"})]})})})]})}),(0,i.jsx)(c.A,{title:"生产级生成前检查清单",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:12,xl:6,children:(0,i.jsx)(c.A,{size:"small",title:"资料完整性",children:(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"事实源、规则源、表格源、图片/图纸源分开绑定。"}),(0,i.jsx)("li",{children:"关键事实在知识库检索中可以搜索到。"}),(0,i.jsx)("li",{children:"表格有清晰表头,图片和图纸有说明文字。"}),(0,i.jsx)("li",{children:"只有必须指定资料时才维护高级优先证据。"})]})})}),(0,i.jsx)(d.A,{xs:24,md:12,xl:6,children:(0,i.jsx)(c.A,{size:"small",title:"角色配置",children:(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"文件角色处理类型选对。"}),(0,i.jsx)("li",{children:"提示词角色执行类型选对。"}),(0,i.jsx)("li",{children:"项目角色配置排序符合生成流程。"}),(0,i.jsx)("li",{children:"生成后查看增强贡献,确认上下文和证据是否真实参与。"})]})})}),(0,i.jsx)(d.A,{xs:24,md:12,xl:6,children:(0,i.jsx)(c.A,{size:"small",title:"规范包",children:(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"required fact 不要过度配置。"}),(0,i.jsx)("li",{children:"sourceRoleIds 只绑定真正应该提供该事实的角色。"}),(0,i.jsx)("li",{children:"gateRules 区分 error 和 warning。"})]})})}),(0,i.jsx)(d.A,{xs:24,md:12,xl:6,children:(0,i.jsx)(c.A,{size:"small",title:"交付检查",children:(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"草稿历史记录状态合理。"}),(0,i.jsx)("li",{children:"warning 原因已经阅读。"}),(0,i.jsx)("li",{children:"导出文件打开正常,图片和表格可读。"})]})})})]})}),(0,i.jsx)(c.A,{title:"常见问题和处理建议",children:(0,i.jsx)(j.A,{items:[{key:"warning-export",label:"为什么生成完成后显示 warning,但仍然可以导出?",children:(0,i.jsx)(u,{children:"warning 表示文档已生成,但存在建议复核的问题,例如来源角色不完全匹配、某些事实需要人工确认或格式可优化。它不是失败,也不会阻断导出;真实 blockingIssues 或 error 级门禁问题会作为高风险提示展示,导出后请人工复核。"})},{key:"missing-facts",label:"为什么提示必需事实缺失?",children:(0,i.jsx)(u,{children:"优先检查后台自动规范生成的事实字段、模板章节 requiredFacts 和文件角色绑定。很多情况下不是模型失败,而是资料没有被绑定到正确角色,或字段要求比资料实际内容更严格。"})},{key:"draft-duration",label:"草稿历史里的耗时怎么计算?",children:(0,i.jsx)(u,{children:"耗时使用生成记录的 createdAt 到 completedAt 计算;旧记录或未完成记录会使用 updatedAt 兜底。它用于判断本次生成链路整体成本,包括知识库检索、事实抽取、章节生成、资源处理、校验和格式化。"})},{key:"asset-index",label:"生成资源会如何进入知识库?",children:(0,i.jsx)(u,{children:"生成资源不会自动或手动写入知识库,也不会建立知识库索引,避免生成内容再次被当作事实证据召回。确需复用时,请由用户明确上传到知识库。"})},{key:"priority-evidence",label:"什么时候需要维护高级优先证据?",children:(0,i.jsx)(u,{children:"日常不需要维护。只有当某章必须引用指定官方资料、图纸、表格,或自动检索结果不稳定时,才从知识库搜索页复制文件路径并填入章节高级优先证据。"})}]})}),(0,i.jsx)(j.A,{items:[{key:"prepare",label:e("guide.prepareTitle"),children:(0,i.jsx)(u,{children:e("guide.prepareContent")})},{key:"roles",label:e("guide.rolesTitle"),children:(0,i.jsx)(u,{children:e("guide.rolesContent")})},{key:"template",label:e("guide.templateTitle"),children:(0,i.jsx)(u,{children:e("guide.templateContent")})},{key:"generate",label:e("guide.generateTitle"),children:(0,i.jsx)(u,{children:e("guide.generateContent")})},{key:"qa",label:e("guide.qaTitle"),children:(0,i.jsx)(u,{children:e("guide.qaContent")})}]})]})}},34899:(e,s,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/guide",function(){return l(2548)}])}},e=>{e.O(0,[433,787,405,636,593,792],()=>e(e.s=34899)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[920],{2548:(e,s,l)=>{"use strict";l.r(s),l.d(s,{default:()=>w});var i=l(65321),r=l(35292),c=l(68787),n=l(2256),d=l(38770),t=l(11702),x=l(80300),h=l(55122),j=l(15622),a=l(71330),m=l(8579),A=l(66926),o=l(7851),g=l(84742),p=l(48321);let{Paragraph:u,Title:z,Text:N}=r.A,k=[{icon:(0,i.jsx)(a.A,{}),title:"准备阶段",color:"blue",items:["配置模型","上传知识库资料","创建提示词"]},{icon:(0,i.jsx)(m.A,{}),title:"编排阶段",color:"purple",items:["创建文件角色","创建提示词角色","创建项目角色配置并排序"]},{icon:(0,i.jsx)(A.A,{}),title:"生成阶段",color:"processing",items:["创建模板","知识库证据增强","动态执行状态"]},{icon:(0,i.jsx)(o.A,{}),title:"交付阶段",color:"green",items:["检查事实和来源","检查导出门禁","导出正式文件"]}],y=[{title:"第一步:配置模型",goal:"让系统具备 LLM JSON 事实抽取、章节生成、自动规则检查和修复能力。",path:"左侧菜单 → 模型配置",steps:["点击新增供应商,选择 OpenAI、DeepSeek、OpenRouter、Ollama 或其他兼容 OpenAI 协议的服务。","填写 Base URL、API Key、供应商名称并保存。","添加模型名称,建议至少准备一个用于生成和推理的模型。","把模型设置为当前启用模型。","执行健康检查,确认模型可调用。"],checks:["模型健康检查通过","至少有一个启用模型","API Key 和 Base URL 正确"],tips:"如果模型不可用,系统会回退到本地确定性抽取,但事实抽取质量会下降。"},{title:"第二步:上传知识库资料",goal:"把项目资料放入系统,让后续文件角色可以绑定。",path:"左侧菜单 → 知识库 → 文件管理 / 管理",steps:["上传招标文件、工程概况、合同条件、技术要求等项目事实资料。","上传工程量清单、劳动力计划、机械设备计划、材料计划等表格资料。","上传图纸目录、图纸说明、设计说明等图纸类资料。","上传规范、规程、企业标准、评分办法、编制要求等规则类资料。","等待索引完成,并在知识库文件列表中确认文件可见。"],checks:["文件上传成功","索引完成","文件能在文件角色绑定下拉框中看到"],tips:"表格资料最好有清晰表头;图纸资料最好附带目录或文字说明。"},{title:"第三步:创建提示词",goal:"定义每个执行阶段的模型行为,并写清系统需要自动抽取的检查规则。",path:"左侧菜单 → 提示词管理",steps:["创建事实抽取提示词:要求只抽取资料中明确出现的事实,返回结构化 JSON,不允许编造。","创建章节生成提示词:定义文档类型、专业语气、章节风格、引用事实和禁止事项。","在总控、章节生成或角色提示词中写清工程名称、工期、质量目标、数字、表格引用、章节完整性等约束,系统运行时会自动抽取为检查规则。","创建格式化提示词:定义编号、表格、分页和正式输出样式。","保存后确认提示词能在提示词角色绑定下拉框中看到。"],checks:["事实抽取提示词已创建","章节生成提示词已创建","格式化提示词或角色约束已创建"],tips:"提示词越明确,生成结果越稳定。系统会自动抽取规则用于生成、检查和修复,建议明确写上“没有来源的数据不要写”。"},{title:"第四步:创建文件角色",goal:"告诉系统每个文件在生成流程中的用途。",path:"左侧菜单 → 角色配置 → 新建文件角色",steps:["填写角色名称,例如“招标文件事实源”“工程量清单表格”“图纸说明文件”。","选择处理类型:规则文件、项目事实文件、表格数据、图纸文件、规范文件或参考资料。","绑定对应知识库文件。","保存角色。","按文件用途创建多个文件角色,不建议把不同用途资料混在一个角色里。"],checks:["文件角色有名称","已选择处理类型","具体项目文件由生成流程自动识别"],tips:"处理类型很重要:系统会根据它决定是否进行表格解析、事实抽取、规则引用或来源追踪。"},{title:"第五步:创建提示词角色",goal:"告诉系统每条提示词在哪个执行阶段使用,并让系统从提示词中自动抽取检查规则。",path:"左侧菜单 → 角色配置 → 新建提示词角色",steps:["填写角色名称,例如“施工组织设计事实抽取”“章节生成规则”“格式与交付规则”。","选择执行类型:事实抽取、章节生成、格式化或参考;需要检查的要求直接写进对应提示词,系统运行时会自动抽取规则。","绑定对应提示词。","保存角色。","一个执行阶段可以有多个提示词角色,后续在项目角色配置中排序。"],checks:["提示词角色有名称","已选择执行类型","已绑定提示词"],tips:"不需要单独维护检查类提示词;系统会从已绑定提示词中抽取禁止项、章节规则、事实规则、字数要求和导出检查规则。"},{title:"第六步:创建项目角色配置并排序",goal:"把文件角色和提示词角色组合成一个可复用的项目生成方案。",path:"左侧菜单 → 角色配置 → 新建项目配置",steps:["填写配置名称,例如“某项目施工组织设计配置”。","添加文件角色,并设置顺序。推荐:规则文件 → 项目事实文件 → 表格数据 → 图纸文件 → 规范文件 → 参考资料。","添加提示词角色,并设置顺序。推荐:事实抽取 → 章节生成 → 格式化 → 参考;检查规则会从已绑定提示词中自动抽取。","保存项目角色配置。","后续模板只绑定项目角色配置,不再重复绑定文件和提示词。"],checks:["至少包含一个文件角色","至少包含一个提示词角色","顺序符合业务流程"],tips:"排序决定系统读取资料和应用提示词的优先级,是生产级生成稳定性的关键。"},{title:"第七步:创建模板并绑定项目配置",goal:"定义要生成哪种文档,以及使用哪套项目角色配置。",path:"左侧菜单 → 生成编辑 → 新建模板",steps:["填写模板 ID。ID 由系统生成或保持唯一,不建议手动频繁修改。","填写模板名称,例如“施工组织设计”“技术标文件”“专项施工方案”。","填写分类、输出标题和模板说明。","选择第六步创建的项目角色配置。","为章节填写查询词和必需事实;系统会自动按章节检索知识库证据。","高级优先证据通常无需填写;只有必须指定某份官方资料、图纸或表格时才使用。","保存模板。"],checks:["模板名称清晰","输出标题正确","已绑定项目角色配置"],tips:"模板负责文档入口;项目角色配置负责资料、提示词和顺序。两者分离后更容易复用。"},{title:"第八步:执行生成并查看状态",goal:"让用户明确知道生成流程进行到哪一步。",path:"左侧菜单 → 生成编辑 → 选择模板 → 点击生成",steps:["点击生成按钮后,页面会出现“执行状态”卡片。","系统会先绑定文件角色和提示词角色,再按章节自动检索知识库证据;只有在必须指定官方资料、图纸或表格时,才需要使用高级优先证据。","执行状态会根据当前模板、后台自动规范、文件角色、提示词角色、运行时规则、证据增强和章节自动生成,不是固定工程流程。","当前执行节点会高亮显示,子状态会展示正在处理的章节、事实字段、文件角色、运行时规则、增强贡献或门禁规则。","生成任务在后台运行,页面通过 documentId 轮询;切换页面后回到生成编辑仍可恢复状态。","生成完成后,系统会用后端真实 executionStages 回填最终状态。","如果导出门禁存在风险,生成完成节点会提示需要查看规则检查结果。"],checks:["执行状态 Card 出现","当前节点有高亮","生成完成后有执行阶段结果"],tips:"如果长时间停留在某一步,优先检查模型配置、知识库索引和文件角色绑定。"},{title:"第九步:审查结果并导出",goal:"确保文档可追溯、可检查、可交付,同时能区分高风险问题和可复核 warning。",path:"生成编辑 → 编辑器下方 Tabs → 导出按钮 / 草稿历史",steps:["查看“结构化事实”,确认事实字段是否按后台自动规范动态 schema 抽取,并检查冲突提示。","查看“来源”,确认事实来自后台自动规范要求的文件角色和绑定资料。","查看“缺失项”,补齐缺失资料或调整角色配置。","查看“规则检查”,优先处理 error;warning 表示可导出但建议复核。","查看“导出门禁”,真实 blockingIssues 会作为风险提示保留,但不阻断用户导出。","在草稿历史中确认生成状态、warning 原因、整体生成耗时,并可删除不需要的记录。","可以先导出 HTML 预览排版,再导出 DOCX/PDF。"],checks:["无真实阻断问题","关键事实有来源","章节有证据","warning 原因已复核","导出文件可打开"],tips:"导出不是简单放行:真实阻断仍会拦截;生成完成但存在可复核问题时显示 warning,用户可以继续导出并按原因优化资料。"}];function w(){let e=(0,p.Vr)();return(0,i.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,i.jsxs)(c.A,{className:"cardGlass",styles:{body:{padding:24}},children:[(0,i.jsx)(z,{level:2,className:"mb-2",children:e("guide.title")}),(0,i.jsx)(u,{className:"pageDesc mb-0",children:e("guide.description")})]}),(0,i.jsx)(n.A,{gutter:[16,16],children:k.map(e=>(0,i.jsx)(d.A,{xs:24,md:12,xl:6,children:(0,i.jsx)(c.A,{className:"h-full",title:(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[e.icon,e.title]}),children:(0,i.jsx)("div",{className:"space-y-2",children:e.items.map(s=>(0,i.jsx)("div",{children:(0,i.jsx)(t.A,{color:e.color,children:s})},s))})})},e.title))}),(0,i.jsx)(c.A,{title:e("guide.fullFlow"),children:(0,i.jsx)(n.A,{gutter:[12,12],children:y.map((e,s)=>(0,i.jsx)(d.A,{xs:24,sm:12,lg:8,xl:6,children:(0,i.jsx)(c.A,{size:"small",className:"h-full",children:(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[(0,i.jsx)(t.A,{color:"blue",className:"mt-1",children:s+1}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)(N,{strong:!0,children:e.title.replace(/^第.+?:/u,"")}),(0,i.jsx)(u,{className:"mb-1 text-xs",ellipsis:{rows:2,tooltip:e.goal},children:e.goal}),(0,i.jsx)(N,{type:"secondary",className:"text-xs break-words",children:e.path})]})]})})},e.title))})}),(0,i.jsx)(c.A,{title:"详细步骤说明:照着做即可跑通",children:(0,i.jsx)(x.A,{mode:"left",items:y.map(e=>({dot:(0,i.jsx)(g.A,{}),children:(0,i.jsxs)("div",{className:"space-y-3",children:[(0,i.jsx)(z,{level:4,className:"mb-0",children:e.title}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"目标:"}),e.goal]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"入口:"}),e.path]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(N,{strong:!0,children:"操作步骤:"}),(0,i.jsx)("ol",{className:"list-decimal pl-6 mt-2 space-y-1",children:e.steps.map(e=>(0,i.jsx)("li",{children:e},e))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(N,{strong:!0,children:"完成检查:"}),(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:e.checks.map(e=>(0,i.jsx)(t.A,{color:"success",children:e},e))})]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"提示:"}),e.tips]}),(0,i.jsx)(h.A,{})]})}))})}),(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{title:e("guide.roleDesign"),children:[(0,i.jsx)(u,{children:e("guide.roleDesignDesc")}),(0,i.jsxs)("div",{className:"space-y-3",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(t.A,{color:"blue",children:"file"}),(0,i.jsx)(N,{strong:!0,children:e("guide.fileRole")}),(0,i.jsx)(u,{children:e("guide.fileRoleDesc")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t.A,{color:"purple",children:"prompt"}),(0,i.jsx)(N,{strong:!0,children:e("guide.promptRole")}),(0,i.jsx)(u,{children:e("guide.promptRoleDesc")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t.A,{color:"processing",children:"config"}),(0,i.jsx)(N,{strong:!0,children:e("guide.projectConfig")}),(0,i.jsx)(u,{children:e("guide.projectConfigDesc")})]})]})]})}),(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{title:e("guide.generationEngine"),children:[(0,i.jsx)(u,{children:e("guide.generationEngineDesc")}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.A,{children:e("roles.factExtraction")}),(0,i.jsx)(t.A,{children:e("roles.chapterGeneration")}),(0,i.jsx)(t.A,{children:"自动规则检查"}),(0,i.jsx)(t.A,{children:e("roles.formatting")}),(0,i.jsx)(t.A,{children:e("documents.exportGate")})]})]})})]}),(0,i.jsx)(c.A,{title:"文件角色和提示词角色案例:它们在模板生成中到底起什么作用",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{size:"small",title:"案例 A:创建文件角色“招标文件事实源”",children:[(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"类型选择 file,处理类型选择“项目事实文件”,绑定招标文件、合同摘要或项目概况。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统会从这个角色绑定的文件里抽取工程名称、建设地点、工期、质量目标、范围边界等事实,并把来源带入结构化事实和章节证据。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"带来的提升:"}),"模型不再凭空补项目事实;章节生成和导出校验都会追踪“这句话来自哪个文件角色、哪个文件”。"]})]})}),(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{size:"small",title:"案例 B:创建文件角色“工程量清单表格”",children:[(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"类型选择 file,处理类型选择“表格数据”,绑定 Excel、CSV、清单表或计划表。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统会读取 Sheet、表头、行列和来源范围,把表格数据转换成可引用的结构化资源证据。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"带来的提升:"}),"章节中涉及数量、清单、计划、资源配置时,优先引用表格来源,减少数字编造和漏项。"]})]})}),(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{size:"small",title:"案例 C:创建提示词角色“章节生成规则”",children:[(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"先在提示词管理中写好生成规则,例如“必须引用来源、不要写无来源数据、输出正式报告语气”;再创建 prompt 角色,执行类型选择“章节生成”。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统生成每个章节时会把这个提示词加入 LLM 上下文,用它约束语气、结构、引用方式和禁止事项。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"带来的提升:"}),"同一套资料可以生成更稳定的文档风格;不同模板只需替换提示词角色,就能调整写法而不改知识库文件。"]})]})}),(0,i.jsx)(d.A,{xs:24,lg:12,children:(0,i.jsxs)(c.A,{size:"small",title:"案例 D:在提示词中写入交付检查要求",children:[(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"提示词内容写清楚必须检查的交付要求,例如“不能出现资料未提供、图片引用必须可访问、关键事实必须有来源”;执行类型选择章节生成、格式化或参考即可。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统会在运行时自动抽取这些要求,结合证据来源、事实落位和导出门禁检查文档是否可交付。"]}),(0,i.jsxs)(u,{children:[(0,i.jsx)(N,{strong:!0,children:"带来的提升:"}),"不需要维护单独检查类提示词,也能把人工审稿经验前置到生成流程,降低导出后才发现缺来源、缺图片、格式不合格的概率。"]})]})})]})}),(0,i.jsx)(c.A,{title:"运行时规则自动抽取说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"用户只维护业务提示词",children:(0,i.jsx)(u,{children:"系统不要求用户单独创建检查类提示词。用户只需要在总控、章节生成、格式化或参考提示词中写清“必须怎么写、不能写什么、字数和章节要求”。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"运行时自动抽取规则",children:(0,i.jsx)(u,{children:"生成开始时,系统会从已绑定提示词中抽取禁止词、章节规则、主体表达、商务敏感项、事实真实性、字数要求和角色关注点,并统一用于生成、检查和修复。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"执行状态可追踪",children:(0,i.jsx)(u,{children:"生成状态会展示提示词规则执行摘要,方便确认用户写入的约束是否被识别并参与本次生成流程。"})})})]})}),(0,i.jsx)(c.A,{title:"联网增强说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"默认关闭",children:(0,i.jsx)(u,{children:"联网增强在模型配置页手动开启。开启后,系统会受控检索公开规范、政策和通用技术资料,用于增强措施准确性。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"不覆盖项目事实",children:(0,i.jsx)(u,{children:"联网资料不会用于生成或修改项目名称、地点、规模、工期、质量标准、工程量、材料规格、商务数据等项目事实。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"有报告和门禁",children:(0,i.jsx)(u,{children:"生成状态会展示联网增强报告;导出前会检查并清理联网过程性话术,避免正式正文出现搜索过程描述。"})})})]})}),(0,i.jsx)(c.A,{title:"我的数据和门禁规则说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"使用自己的数据",children:(0,i.jsx)(u,{children:"文件、提示词、角色配置和规范包都来自用户自己创建或上传的内容,生成流程会按当前项目配置读取,并自动抽取检查规则参与生成和导出门禁。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"自定义门禁类型会执行",children:(0,i.jsx)(u,{children:"门禁规则由后台根据模板、提示词和角色绑定自动形成,并与系统门禁一起参与规则检查,不需要用户手动维护单独检查类提示词。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"上传后关注索引状态",children:(0,i.jsx)(u,{children:"文件上传完成后,知识库索引会继续在后台写入。请在文件管理页查看状态,如果失败,页面会展示原因,方便重新配置模型或重试。"})})})]})}),(0,i.jsx)(c.A,{title:"知识库证据和增强贡献说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"自动检索为主",children:(0,i.jsx)(u,{children:"模板章节的查询词、章节目的和必需事实会驱动系统自动检索知识库证据。高级优先证据只是兜底能力,用于必须指定官方资料、图纸或表格的场景,不是日常必填项。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"增强贡献可追踪",children:(0,i.jsx)(u,{children:"生成流程会展示知识库证据、人工确认/固定证据和自动检索证据的数量,帮助判断本次增强是否真的参与生成,而不是增加用户维护成本。"})})})]})}),(0,i.jsx)(c.A,{title:"动态 schema、证据和执行状态说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"动态事实 schema",children:(0,i.jsx)(u,{children:"系统不会写死工程字段。后台自动规范会结合模板章节 requiredFacts、角色绑定和提示词形成抽取 schema,并驱动事实抽取、冲突检测、规则检查和导出门禁。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"结构化资源证据",children:(0,i.jsx)(u,{children:"文本、PDF/Word、Excel/CSV、图片、地图图纸和其他附件都会被整理成资源证据,包含文件角色、处理类型、正文用途、关联事实和证据片段,模型据此理解资料关系。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"动态执行状态",children:(0,i.jsx)(u,{children:"生成编辑页的执行节点会随模板、规范包、文件角色、提示词角色、章节和门禁规则变化;用户生成不同项目文件时看到的是对应项目的流程,而不是固定示例流程。"})})})]})}),(0,i.jsx)(c.A,{title:"生成记录、warning 和导出门禁怎么理解",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,lg:8,children:(0,i.jsxs)(c.A,{size:"small",title:"草稿历史记录",children:[(0,i.jsxs)(u,{children:["每次后台生成都会写入全局项目目录 ",(0,i.jsxs)(N,{code:!0,children:["~/.customize-agent/projects/","{projectId}","/generatedDocuments"]}),"。记录会保存标题、模板、状态、创建时间、完成时间、生成耗时、正文、结构化结果和资源引用。"]}),(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"completed:生成完成且无需要关注的问题。"}),(0,i.jsx)("li",{children:"warning:生成完成,但存在可复核问题。"}),(0,i.jsx)("li",{children:"failed:生成失败,需要查看错误原因。"}),(0,i.jsx)("li",{children:"generating:后台任务仍在执行,可轮询恢复。"})]})]})}),(0,i.jsx)(d.A,{xs:24,lg:8,children:(0,i.jsxs)(c.A,{size:"small",title:"warning 不是失败",children:[(0,i.jsx)(u,{children:"warning 用于提醒用户“文档已经生成,但建议复核”。例如必需事实没有在最佳来源角色中抽到、部分来源需要人工确认、格式或内容有优化建议。warning 会显示在草稿历史和校验详情中,并保留导出能力。"}),(0,i.jsx)(u,{children:"如果存在明确风险问题,例如正文包含临时图片生成 URL、出现“资料未提供”占位、真实 blockingIssues 未解决,导出门禁会提示风险,但仍保留 DOCX/PDF 导出能力。"})]})}),(0,i.jsx)(d.A,{xs:24,lg:8,children:(0,i.jsxs)(c.A,{size:"small",title:"导出门禁规则",children:[(0,i.jsx)(u,{children:"门禁分为“高风险提示”和“复核建议”。系统不会禁止导出,但会在出现高风险问题时提醒用户复核交付质量。"}),(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"Markdown/HTML 更适合快速预览和人工调整。"}),(0,i.jsx)("li",{children:"DOCX/PDF 会启用真实门禁检查。"}),(0,i.jsx)("li",{children:"草稿历史可保留多个版本,便于对比和再次导出。"})]})]})})]})}),(0,i.jsx)(c.A,{title:"生成资源和知识库的关系",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsxs)(c.A,{size:"small",title:"生成资源不进入知识库",children:[(0,i.jsx)(u,{children:"模板运行生成的文档、图片、封面或后处理资源只会登记到生成资源管理页,不会写入 knowledgeBase,也不会建立知识库索引。"}),(0,i.jsx)(u,{children:"这样可以避免模型产物污染事实来源;需要作为资料复用时,应由用户明确上传到知识库。"})]})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsxs)(c.A,{size:"small",title:"资源预览和坏图处理",children:[(0,i.jsx)(u,{children:"资源预览会从全局 generatedDocuments 目录解析文件,不依赖当前页面临时路径。图片下载会识别“image is generating”等占位响应,并校验 PNG/JPEG/WebP 字节,避免把占位文本当成图片保存。"}),(0,i.jsx)(u,{children:"如果预览失败,优先查看资源管理页中的文件路径、资源状态和原始生成记录。"})]})})]})}),(0,i.jsx)(c.A,{title:"文件角色处理类型大白话说明",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"规则文件",children:(0,i.jsx)(u,{children:"用来告诉系统“必须怎么写、不能怎么写、按什么标准判断”。适合放评分办法、甲方编制要求、攻略写作要求、输出格式要求。生成时会优先作为约束使用。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"项目事实文件",children:(0,i.jsx)(u,{children:"用来告诉系统“真实情况是什么”。适合放项目概况、合同摘要、招标文件关键信息、游戏角色资料、产品资料。事实字段通常从这里抽取。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"表格数据",children:(0,i.jsx)(u,{children:"用来解析结构化数据。适合放 Excel、CSV、清单、计划表、评分表、推荐指数表。系统会读取 Sheet、表头、行列和来源范围。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"图纸文件",children:(0,i.jsx)(u,{children:"用来表达空间关系、路线、结构、站位或设计说明。可以是图纸目录、设计说明、路线示意、阵型图说明。没有 CAD 时也可以用文字图纸说明。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"规范文件",children:(0,i.jsx)(u,{children:"用来作为专业依据。适合放国家规范、行业标准、企业标准、攻略结构规范、质量标准。生成、规则检查和导出门禁会把它当成依据。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"参考资料",children:(0,i.jsx)(u,{children:"只作为辅助阅读材料,不建议放关键事实。适合放图片来源、公开网页链接、背景资料、案例资料。系统可以参考,但不应把它当成强事实。"})})})]})}),(0,i.jsx)(c.A,{title:"推荐资料清单",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"必备资料",children:(0,i.jsxs)("ul",{className:"list-disc pl-5",children:[(0,i.jsx)("li",{children:"项目事实文件"}),(0,i.jsx)("li",{children:"招标或编制规则"}),(0,i.jsx)("li",{children:"章节生成提示词"})]})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"强烈建议",children:(0,i.jsxs)("ul",{className:"list-disc pl-5",children:[(0,i.jsx)("li",{children:"表格数据"}),(0,i.jsx)("li",{children:"图纸说明"}),(0,i.jsx)("li",{children:"规范或企业标准"})]})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"导出前确认",children:(0,i.jsxs)("ul",{className:"list-disc pl-5",children:[(0,i.jsx)("li",{children:"无 error 校验"}),(0,i.jsx)("li",{children:"事实有来源"}),(0,i.jsx)("li",{children:"导出门禁通过"})]})})})]})}),(0,i.jsx)(c.A,{title:"生产级生成前检查清单",children:(0,i.jsxs)(n.A,{gutter:[16,16],children:[(0,i.jsx)(d.A,{xs:24,md:12,xl:6,children:(0,i.jsx)(c.A,{size:"small",title:"资料完整性",children:(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"事实源、规则源、表格源、图片/图纸源分开绑定。"}),(0,i.jsx)("li",{children:"关键事实在知识库检索中可以搜索到。"}),(0,i.jsx)("li",{children:"表格有清晰表头,图片和图纸有说明文字。"}),(0,i.jsx)("li",{children:"只有必须指定资料时才维护高级优先证据。"})]})})}),(0,i.jsx)(d.A,{xs:24,md:12,xl:6,children:(0,i.jsx)(c.A,{size:"small",title:"角色配置",children:(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"文件角色处理类型选对。"}),(0,i.jsx)("li",{children:"提示词角色执行类型选对。"}),(0,i.jsx)("li",{children:"项目角色配置排序符合生成流程。"}),(0,i.jsx)("li",{children:"生成后查看增强贡献,确认上下文和证据是否真实参与。"})]})})}),(0,i.jsx)(d.A,{xs:24,md:12,xl:6,children:(0,i.jsx)(c.A,{size:"small",title:"规范包",children:(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"required fact 不要过度配置。"}),(0,i.jsx)("li",{children:"sourceRoleIds 只绑定真正应该提供该事实的角色。"}),(0,i.jsx)("li",{children:"gateRules 区分 error 和 warning。"})]})})}),(0,i.jsx)(d.A,{xs:24,md:12,xl:6,children:(0,i.jsx)(c.A,{size:"small",title:"交付检查",children:(0,i.jsxs)("ul",{className:"list-disc pl-5 space-y-1",children:[(0,i.jsx)("li",{children:"草稿历史记录状态合理。"}),(0,i.jsx)("li",{children:"warning 原因已经阅读。"}),(0,i.jsx)("li",{children:"导出文件打开正常,图片和表格可读。"})]})})})]})}),(0,i.jsx)(c.A,{title:"常见问题和处理建议",children:(0,i.jsx)(j.A,{items:[{key:"warning-export",label:"为什么生成完成后显示 warning,但仍然可以导出?",children:(0,i.jsx)(u,{children:"warning 表示文档已生成,但存在建议复核的问题,例如来源角色不完全匹配、某些事实需要人工确认或格式可优化。它不是失败,也不会阻断导出;真实 blockingIssues 或 error 级门禁问题会作为高风险提示展示,导出后请人工复核。"})},{key:"missing-facts",label:"为什么提示必需事实缺失?",children:(0,i.jsx)(u,{children:"优先检查后台自动规范生成的事实字段、模板章节 requiredFacts 和文件角色绑定。很多情况下不是模型失败,而是资料没有被绑定到正确角色,或字段要求比资料实际内容更严格。"})},{key:"draft-duration",label:"草稿历史里的耗时怎么计算?",children:(0,i.jsx)(u,{children:"耗时使用生成记录的 createdAt 到 completedAt 计算;旧记录或未完成记录会使用 updatedAt 兜底。它用于判断本次生成链路整体成本,包括知识库检索、事实抽取、章节生成、资源处理、校验和格式化。"})},{key:"asset-index",label:"生成资源会如何进入知识库?",children:(0,i.jsx)(u,{children:"生成资源不会自动或手动写入知识库,也不会建立知识库索引,避免生成内容再次被当作事实证据召回。确需复用时,请由用户明确上传到知识库。"})},{key:"priority-evidence",label:"什么时候需要维护高级优先证据?",children:(0,i.jsx)(u,{children:"日常不需要维护。只有当某章必须引用指定官方资料、图纸、表格,或自动检索结果不稳定时,才从知识库搜索页复制文件路径并填入章节高级优先证据。"})}]})}),(0,i.jsx)(j.A,{items:[{key:"prepare",label:e("guide.prepareTitle"),children:(0,i.jsx)(u,{children:e("guide.prepareContent")})},{key:"roles",label:e("guide.rolesTitle"),children:(0,i.jsx)(u,{children:e("guide.rolesContent")})},{key:"template",label:e("guide.templateTitle"),children:(0,i.jsx)(u,{children:e("guide.templateContent")})},{key:"generate",label:e("guide.generateTitle"),children:(0,i.jsx)(u,{children:e("guide.generateContent")})},{key:"qa",label:e("guide.qaTitle"),children:(0,i.jsx)(u,{children:e("guide.qaContent")})}]})]})}},34899:(e,s,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/guide",function(){return l(2548)}])}},e=>{e.O(0,[665,787,644,636,593,792],()=>e(e.s=34899)),_N_E=e.O()}]);
|