@customize-agent/server 4.0.84 → 4.0.85
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 +21 -21
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/api/config/healthCheck.js +1 -1
- package/.next/server/pages/asset-library.html +1 -1
- package/.next/server/pages/context/long-term.html +1 -1
- package/.next/server/pages/context/short-term.html +1 -1
- package/.next/server/pages/document-roles.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/guide.html +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge/search.html +1 -1
- package/.next/server/pages/knowledge.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/prompt.html +1 -1
- package/.next/server/pages/settings.html +1 -1
- package/.next/server/pages/system/logs.html +1 -1
- package/.next/server/pages-manifest.json +29 -29
- package/.next/static/{hy7wt2kTzIzcW5Uh0HtWr → 37XAh0E9YCoej2skkcLoJ}/_buildManifest.js +1 -1
- package/.next/static/chunks/375-f731e5ec66ab942c.js +1 -0
- package/.next/static/chunks/466-a54223cadb7cfad9.js +1 -0
- package/.next/static/chunks/63-47dff441816f712f.js +4 -0
- package/.next/static/chunks/642-b325b80d595ec100.js +8 -0
- package/.next/static/chunks/694-b6ab4967c35bbcee.js +1 -0
- package/.next/static/chunks/{767-e97ea5dee1ab87b5.js → 767-4f3b0ae7bff68fde.js} +1 -1
- package/.next/static/chunks/788-db05269178a28c20.js +1 -0
- package/.next/static/chunks/795-262a7ef599d655f4.js +1 -0
- package/.next/static/chunks/pages/document-roles-7e5a02b0f03eb951.js +1 -0
- package/.next/static/chunks/pages/documents-e6a276951f092076.js +1 -0
- package/.next/static/chunks/pages/guide-c45dc4e0a02247c9.js +1 -0
- package/.next/static/chunks/pages/models-e2914678369d2823.js +1 -0
- package/package.json +3 -3
- package/.next/static/chunks/375-4a1c73eb22d653d2.js +0 -1
- package/.next/static/chunks/466-1cd359f130473697.js +0 -1
- package/.next/static/chunks/63-dd8eeb8edd766bae.js +0 -4
- package/.next/static/chunks/642-708b928fbafc6c20.js +0 -8
- package/.next/static/chunks/694-2d545cfbb9779f2c.js +0 -1
- package/.next/static/chunks/788-7f7359a830e3f4fd.js +0 -1
- package/.next/static/chunks/795-d8fb7a0420512701.js +0 -1
- package/.next/static/chunks/pages/document-roles-60f29e52f817dc11.js +0 -1
- package/.next/static/chunks/pages/documents-988649336d226901.js +0 -1
- package/.next/static/chunks/pages/guide-c00be7803483b703.js +0 -1
- package/.next/static/chunks/pages/models-d5e80645dc4a61b1.js +0 -1
- /package/.next/static/{hy7wt2kTzIzcW5Uh0HtWr → 37XAh0E9YCoej2skkcLoJ}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
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:()=>K});var i=r(65321),n=r(97109),t=r(35292),s=r(17807),o=r(63455),a=r(11702),c=r(84253),d=r(68787),p=r(85114),x=r(26171),m=r(33442),h=r(57271),u=r(85493),y=r(34052),f=r(7576),g=r(2256),j=r(38770),A=r(58569),v=r(25345),b=r(80042),w=r(75548),I=r(26631),S=r(84662),z=r(30486),T=r(99650),R=r(8263),k=r(84742),C=r(43094),B=r(8579),_=r(81668),F=r(58209),N=r(96091),O=r(54746),W=r(96651),E=r(60470),D=r(6578),H=r(79059);let{Paragraph:P}=t.A,L={rule:(0,i.jsx)(v.A,{}),table:(0,i.jsx)(b.A,{}),drawing:(0,i.jsx)(w.A,{}),specification:(0,i.jsx)(I.A,{}),reference:(0,i.jsx)(S.A,{})},U={fact_extraction:(0,i.jsx)(z.A,{}),chapter_generation:(0,i.jsx)(T.A,{}),llm_review:(0,i.jsx)(R.A,{}),validation:(0,i.jsx)(k.A,{}),formatting:(0,i.jsx)(C.A,{}),reference:(0,i.jsx)(S.A,{})},q={rule:"#fa8c16",table:"#52c41a",drawing:"#722ed1",specification:"#eb2f96",reference:"#13c2c2"},V={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"},Q={fact_extraction:"roles.factExtraction",chapter_generation:"roles.chapterGeneration",llm_review:"roles.llmReview",validation:"roles.validation",formatting:"roles.formatting",reference:"roles.reference"};function J(e,l){let r=new Blob([JSON.stringify(l,null,2)],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(r),n=document.createElement("a");n.href=i,n.download=e,n.click(),URL.revokeObjectURL(i)}function M(e){return e.trim().replace(/[\\/:*?"<>|]/g,"-").slice(0,80)||"untitled"}function X(e,l){return{type:"customize-agent.documentRoles",version:1,exportedAt:new Date().toISOString(),roles:e,configs:l}}function K(){let e,l,r=(0,H.Vr)(),{message:t}=s.A.useApp(),[v]=o.A.useForm(),[b]=o.A.useForm(),[w,S]=(0,n.useState)([]),[z,R]=(0,n.useState)([]),[k,C]=(0,n.useState)([]),[K,Y]=(0,n.useState)(!1),[Z,$]=(0,n.useState)(!1),[ee,el]=(0,n.useState)(!1),[er,ei]=(0,n.useState)("file"),[en,et]=(0,n.useState)("custom"),[es,eo]=(0,n.useState)(!1),ea=(0,n.useRef)(null),ec=async()=>{let[e,l]=await Promise.all([(0,D.lv)(),(0,D.dx)()]);S(e.roles),R(e.configs),C(l)};(0,n.useEffect)(()=>{ec().catch(()=>t.error(r("common.error")))},[t,r]);let ed=()=>"all"===en||"custom"===en,ep=w.filter(ed),ex=z.filter(ed),em=ep.filter(e=>"file"===e.type),eh=ep.filter(e=>"prompt"===e.type),eu=w.filter(e=>"file"===e.type),ey=w.filter(e=>"prompt"===e.type),ef=async()=>{try{let e=await v.validateFields(),l="file"===e.type?{...e,resourceId:void 0,resourceIds:[]}:e,i=await (0,D.dg)(l);S(i.roles),R(i.configs),Y(!1),t.success(r("common.success"))}catch(e){t.error(r("common.error"))}},eg=async()=>{try{let e=await b.validateFields(),l=e=>(null!=e?e:[]).map((e,l)=>{var r;return{roleId:e.roleId,order:Number(null!=(r=e.order)?r:l)}}),i=await (0,D.NR)({...e,fileRoles:l(e.fileRoles),promptRoles:l(e.promptRoles)});S(i.roles),R(i.configs),$(!1),t.success(r("common.success"))}catch(e){t.error(r("common.error"))}},ej=async e=>{let l=await (0,D.FV)(e.type,e.id);S(l.roles),R(l.configs)},eA=async e=>{let l=await (0,D.dw)(e);S(l.roles),R(l.configs)},ev=async e=>{if(e){eo(!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 i=await r.json();S(i.roles),R(i.configs),t.success("已导入 ".concat(i.importedRoles," 个角色、").concat(i.importedConfigs," 个配置"))}catch(e){t.error("导入失败,请确认 JSON 文件格式正确")}finally{eo(!1),ea.current&&(ea.current.value="")}}},eb=function(e){var l;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file";v.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)},ew=e=>{b.setFieldsValue(null!=e?e:{id:"config-".concat(Date.now()),name:"",description:"",fileRoles:[],promptRoles:[],builtIn:!1}),$(!0)},eI=e=>w.find(l=>l.id===e),eS=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]:[]:[]},ez=e=>{var l;return(null==(l=k.find(l=>l.id===e))?void 0:l.projectName)||e},eT=e=>(0,i.jsx)(a.A,{closable:e.closable,onClose:e.onClose,color:"purple",title:e.value,style:{margin:"1px 2px",fontSize:11,lineHeight:"18px"},children:ez(e.value)}),eR=(e,l)=>{let n="file"===l?"blue":"purple",t="file"===l?G:Q,s=[...e].sort((e,l)=>{var r,i;return Number(null!=(r=e.order)?r:0)-Number(null!=(i=l.order)?i:0)}).map(e=>eI(e.roleId)).filter(e=>!!e);return 0===s.length?(0,i.jsx)(c.A,{image:c.A.PRESENTED_IMAGE_SIMPLE,description:"file"===l?"暂未选择文件角色":"暂未选择提示词角色"}):(0,i.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:s.map((e,l)=>{var s,o;let c=eS(e),d="file"===e.type?null!=(s=e.processingType)?s:"":null!=(o=e.executionType)?o:"";return(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:8,background:"var(--colorBgContainer)",border:"1px solid var(--colorBorderSecondary)"},children:[(0,i.jsxs)(a.A,{color:n,style:{margin:0},children:["#",l+1]}),(0,i.jsx)("span",{style:{fontWeight:600,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,i.jsx)(a.A,{style:{margin:0},children:r(t[d]||"roles.reference")}),"prompt"===e.type&&(0,i.jsxs)("span",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:["绑定 ",c.length," 个提示词"]})]},e.id)})})},ek=e=>{if(!e)return null;let l=eS(e);return(0,i.jsxs)("div",{style:{marginTop:8,padding:8,borderRadius:8,background:"var(--colorFillQuaternary)",fontSize:12,color:"var(--colorTextSecondary)"},children:[e.description&&(0,i.jsx)("div",{style:{marginBottom:4*("prompt"===e.type)},children:e.description}),"prompt"===e.type&&(0,i.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[l.slice(0,4).map(e=>(0,i.jsx)(a.A,{title:e,style:{margin:0,fontSize:10,lineHeight:"16px",maxWidth:180,overflow:"hidden",textOverflow:"ellipsis"},children:ez(e)},e)),l.length>4&&(0,i.jsxs)(a.A,{style:{margin:0,fontSize:10,lineHeight:"16px"},children:["+",l.length-4]}),0===l.length&&(0,i.jsx)("span",{children:"未绑定提示词"})]})]})};return(0,i.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{className:"pageTitle",children:r("roles.title")}),(0,i.jsx)("p",{className:"pageDesc",children:r("roles.description")})]}),(0,i.jsxs)(m.A,{children:[(0,i.jsx)(h.A,{value:en,onChange:et,style:{width:170},options:[{label:"我的配置 (".concat(w.length+z.length,")"),value:"custom"},{label:"全部来源 (".concat(w.length+z.length,")"),value:"all"}]}),(0,i.jsx)("input",{ref:ea,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:e=>{var l;ev(null==(l=e.target.files)?void 0:l[0])}}),(0,i.jsx)(p.Ay,{icon:(0,i.jsx)(N.A,{}),loading:es,onClick:()=>{var e;return null==(e=ea.current)?void 0:e.click()},children:"导入"}),(0,i.jsx)(p.Ay,{icon:(0,i.jsx)(_.A,{}),disabled:w.length+z.length===0,onClick:()=>{J("customize-document-roles-".concat(new Date().toISOString().slice(0,10),".json"),X(w,z)),t.success("已导出 ".concat(w.length," 个角色、").concat(z.length," 个配置"))},children:"导出全部"}),(0,i.jsx)(p.Ay,{icon:(0,i.jsx)(O.A,{}),onClick:()=>eb(void 0,"file"),children:r("roles.newFileRole")}),(0,i.jsx)(p.Ay,{icon:(0,i.jsx)(O.A,{}),onClick:()=>eb(void 0,"prompt"),children:r("roles.newPromptRole")}),(0,i.jsx)(p.Ay,{type:"primary",icon:(0,i.jsx)(O.A,{}),onClick:()=>ew(),children:r("roles.newConfig")})]})]}),(0,i.jsx)(u.A,{type:"info",showIcon:!0,message:(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)("span",{children:r("roles.plainGuideTitle")}),(0,i.jsx)(p.Ay,{type:"link",size:"small",icon:ee?(0,i.jsx)(W.A,{}):(0,i.jsx)(E.A,{}),onClick:()=>el(!ee),style:{padding:"0 4px"},children:ee?"收起说明":"展开说明"})]}),description:ee?r("roles.plainGuideDesc"):void 0}),(0,i.jsx)(d.A,{size:"small",tabList:[{key:"file",label:"文件角色 (".concat(em.length,")")},{key:"prompt",label:"提示词角色 (".concat(eh.length,")")},{key:"configs",label:"项目角色配置 (".concat(ex.length,")")}],activeTabKey:er,onTabChange:ei,children:"configs"===er?0===ex.length?(0,i.jsx)(c.A,{description:r("common.noData")}):(0,i.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:12},children:ex.map(e=>{let l=e.fileRoles.map(e=>({...e,role:eI(e.roleId)})).filter(e=>e.role),n=e.promptRoles.map(e=>({...e,role:eI(e.roleId)})).filter(e=>e.role);return(0,i.jsxs)(d.A,{size:"small",hoverable:!0,style:{minWidth:0},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,marginBottom:6},children:[(0,i.jsx)("span",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:e.name}),(0,i.jsx)(a.A,{color:"cyan",style:{margin:0,fontSize:10,lineHeight:"16px"},children:"我的配置"}),(0,i.jsxs)("div",{style:{display:"flex",gap:4,flexShrink:0},children:[(0,i.jsx)(p.Ay,{size:"small",icon:(0,i.jsx)(T.A,{}),onClick:()=>ew(e),children:"编辑"}),!e.builtIn&&(0,i.jsx)(p.Ay,{size:"small",icon:(0,i.jsx)(_.A,{}),onClick:()=>(e=>{let l=new Set([...e.fileRoles.map(e=>e.roleId),...e.promptRoles.map(e=>e.roleId)]);J("customize-role-config-".concat(M(e.name),"-").concat(new Date().toISOString().slice(0,10),".json"),X(w.filter(e=>l.has(e.id)&&!e.builtIn),[e])),t.success("已导出 1 个配置")})(e),children:"导出"}),(0,i.jsx)(x.A,{title:r("common.confirm"),onConfirm:()=>{eA(e.id)},children:(0,i.jsx)(p.Ay,{size:"small",danger:!0,icon:(0,i.jsx)(F.A,{})})})]})]}),e.description&&(0,i.jsx)(P,{ellipsis:{rows:2},style:{fontSize:12,color:"var(--colorTextSecondary)",marginBottom:8},children:e.description}),(0,i.jsxs)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:[(0,i.jsxs)("div",{style:{marginBottom:4},children:[(0,i.jsxs)("span",{children:["文件角色 (",e.fileRoles.length,"): "]}),l.length>0?(0,i.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:2},children:[l.slice(0,4).map(e=>(0,i.jsx)(a.A,{color:"blue",style:{margin:0,fontSize:10,lineHeight:"16px"},children:e.role.name},e.roleId)),l.length>4&&(0,i.jsxs)(a.A,{style:{margin:0,fontSize:10,lineHeight:"16px"},children:["+",l.length-4]})]}):(0,i.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"无"})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("span",{children:["提示词角色 (",e.promptRoles.length,"): "]}),n.length>0?(0,i.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:2},children:[n.slice(0,4).map(e=>(0,i.jsx)(a.A,{color:"purple",style:{margin:0,fontSize:10,lineHeight:"16px"},children:e.role.name},e.roleId)),n.length>4&&(0,i.jsxs)(a.A,{style:{margin:0,fontSize:10,lineHeight:"16px"},children:["+",n.length-4]})]}):(0,i.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"无"})]})]})]},e.id)})}):(e="file"===er?em:eh,l=r,0===e.length?(0,i.jsx)(c.A,{description:r("common.noData")}):(0,i.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(270px, 1fr))",gap:12},children:e.map(e=>{var n,s,o,c,m,h,u,y,f;let g="prompt"===e.type?(null==(n=e.resourceIds)?void 0:n.length)?e.resourceIds:e.resourceId?[e.resourceId]:[]:[],j=g.slice(0,3),A=g.length-j.length,v="file"===e.type?null!=(o=L[null!=(s=e.processingType)?s:""])?o:(0,i.jsx)(I.A,{}):null!=(m=U[null!=(c=e.executionType)?c:""])?m:(0,i.jsx)(B.A,{}),b="file"===e.type?null!=(u=q[null!=(h=e.processingType)?h:""])?u:"var(--colorAccent)":null!=(f=V[null!=(y=e.executionType)?y:""])?f:"var(--colorWarning)";return(0,i.jsxs)(d.A,{size:"small",hoverable:!0,style:{minWidth:0},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,marginBottom:8},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,minWidth:0,flex:1},children:[(0,i.jsx)("span",{style:{color:b,fontSize:16,flexShrink:0,lineHeight:1},children:v}),(0,i.jsx)("span",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:"20px"},children:e.name})]}),(0,i.jsx)("div",{style:{display:"flex",gap:4,flexShrink:0},children:(0,i.jsx)(a.A,{color:"cyan",style:{margin:0,fontSize:10,lineHeight:"16px"},children:"我的角色"})})]}),e.description&&(0,i.jsx)(P,{ellipsis:{rows:2},style:{fontSize:12,color:"var(--colorTextSecondary)",marginBottom:8},children:e.description}),(0,i.jsxs)("div",{style:{marginBottom:8,display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,i.jsx)(a.A,{color:"file"===e.type?"blue":"purple",style:{margin:0},children:function(e,l){var r,i,n;let t="file"===e.type?G[null!=(r=e.processingType)?r:""]:Q[null!=(i=e.executionType)?i:""];return t?l(t):null!=(n="file"===e.type?e.processingType:e.executionType)?n:""}(e,l)}),g.length>0&&(0,i.jsxs)("span",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:["绑定 ",g.length," 个提示词"]})]}),j.length>0&&(0,i.jsx)("div",{style:{marginBottom:10},children:(0,i.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[j.map(e=>(0,i.jsx)(a.A,{color:"purple",title:e,style:{margin:0,fontSize:10,lineHeight:"16px",maxWidth:140,overflow:"hidden",textOverflow:"ellipsis"},children:ez(e)},e)),A>0&&(0,i.jsxs)(a.A,{style:{margin:0,fontSize:10,lineHeight:"16px"},children:["+",A]})]})}),(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:6,paddingTop:4,borderTop:"1px solid var(--colorBorderSecondary)"},children:[(0,i.jsx)(p.Ay,{size:"small",icon:(0,i.jsx)(T.A,{}),onClick:()=>eb(e),children:"编辑"}),!e.builtIn&&(0,i.jsx)(p.Ay,{size:"small",icon:(0,i.jsx)(_.A,{}),onClick:()=>{J("customize-role-".concat(M(e.name),"-").concat(new Date().toISOString().slice(0,10),".json"),X([e],[])),t.success("已导出 1 个角色")},children:"导出"}),(0,i.jsx)(x.A,{title:r("common.confirm"),onConfirm:()=>{ej(e)},children:(0,i.jsx)(p.Ay,{size:"small",danger:!0,icon:(0,i.jsx)(F.A,{})})})]})]},e.id)})}))}),(0,i.jsx)(y.A,{title:r("roles.roleEditor"),open:K,onClose:()=>Y(!1),width:800,maskClosable:!1,style:{borderRadius:"12px 0 0 12px"},styles:{body:{padding:"16px 24px"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,i.jsx)(p.Ay,{type:"primary",onClick:()=>{ef()},children:r("common.save")}),children:(0,i.jsxs)(o.A,{form:v,layout:"vertical",children:[(0,i.jsx)(o.A.Item,{name:"id",hidden:!0,children:(0,i.jsx)(f.A,{})}),(0,i.jsxs)(g.A,{gutter:16,children:[(0,i.jsx)(j.A,{span:12,children:(0,i.jsx)(o.A.Item,{name:"type",label:r("roles.roleType"),rules:[{required:!0}],children:(0,i.jsx)(h.A,{options:[{label:r("roles.fileRole"),value:"file"},{label:r("roles.promptRole"),value:"prompt"}]})})}),(0,i.jsx)(j.A,{span:12,children:(0,i.jsx)(o.A.Item,{name:"name",label:r("roles.roleName"),rules:[{required:!0}],children:(0,i.jsx)(f.A,{})})})]}),(0,i.jsx)(o.A.Item,{name:"description",label:r("roles.roleDescription"),children:(0,i.jsx)(f.A.TextArea,{rows:2})}),(0,i.jsx)(o.A.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.type!==l.type,children:e=>{let{getFieldValue:l}=e,n="prompt"===l("type");return(0,i.jsx)(d.A,{size:"small",title:n?"提示词角色配置":"文件角色配置",style:{border:"1px solid var(--colorBorderSecondary)"},children:n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.A.Item,{name:"executionType",label:r("roles.executionType"),rules:[{required:!0}],style:{marginBottom:12},children:(0,i.jsx)(h.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,i.jsx)(o.A.Item,{name:"resourceIds",label:r("roles.bindPrompt"),style:{marginBottom:0},help:(0,i.jsx)("span",{style:{fontSize:11,color:"var(--colorTextSecondary)"},children:r("roles.multiBindPromptHelp")}),children:(0,i.jsx)(h.A,{mode:"multiple",showSearch:!0,tagRender:eT,placeholder:"选择提示词",options:k.filter(e=>e.hasFile).map(e=>({label:e.projectName,value:e.id}))})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.A.Item,{name:"processingType",label:r("roles.processingType"),rules:[{required:!0}],style:{marginBottom:12},children:(0,i.jsx)(h.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,i.jsx)(u.A,{type:"info",showIcon:!0,message:"文件角色只定义处理类型",description:"具体项目文件由生成流程自动识别,或在模板的高级固定绑定资料中手动覆盖;这里不再绑定知识库文件,避免角色复用时混入其他项目资料。"})]})})}})]})}),(0,i.jsx)(y.A,{title:r("roles.configEditor"),open:Z,onClose:()=>$(!1),width:800,maskClosable:!1,style:{borderRadius:"12px 0 0 12px"},styles:{body:{padding:"16px 24px"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,i.jsx)(p.Ay,{type:"primary",onClick:()=>{eg()},children:r("common.save")}),children:(0,i.jsxs)(o.A,{form:b,layout:"vertical",children:[(0,i.jsx)(o.A.Item,{name:"id",hidden:!0,children:(0,i.jsx)(f.A,{})}),(0,i.jsxs)(g.A,{gutter:16,children:[(0,i.jsx)(j.A,{span:12,children:(0,i.jsx)(o.A.Item,{name:"name",label:r("roles.configName"),rules:[{required:!0}],children:(0,i.jsx)(f.A,{})})}),(0,i.jsx)(j.A,{span:12,children:(0,i.jsx)(o.A.Item,{name:"description",label:r("roles.configDescription"),children:(0,i.jsx)(f.A,{})})})]}),(0,i.jsx)(o.A.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.fileRoles!==l.fileRoles||e.promptRoles!==l.promptRoles,children:e=>{let{getFieldValue:l}=e,n=l("fileRoles")||[],t=l("promptRoles")||[];return(0,i.jsx)(A.A,{destroyInactiveTabPane:!1,items:[{key:"file",label:"文件角色 (".concat(n.length,"/").concat(eu.length,")"),children:(0,i.jsx)(o.A.List,{name:"fileRoles",children:(e,l)=>{let{add:t,remove:s}=l;return(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,i.jsx)(d.A,{size:"small",title:"已选文件角色",style:{background:"var(--colorFillQuaternary)"},children:eR(n,"file")}),0===e.length&&(0,i.jsx)(c.A,{description:"暂未添加文件角色"}),e.map((e,l)=>(0,i.jsxs)(d.A,{size:"small",style:{border:"1px solid var(--colorBorderSecondary)",position:"relative"},children:[(0,i.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,i.jsx)(p.Ay,{danger:!0,size:"small",icon:(0,i.jsx)(F.A,{}),onClick:()=>s(e.name),style:{position:"absolute",top:8,right:8,zIndex:1}}),(0,i.jsxs)(g.A,{gutter:[16,8],align:"middle",style:{marginTop:4},children:[(0,i.jsxs)(j.A,{flex:"auto",children:[(0,i.jsx)(o.A.Item,{name:[e.name,"roleId"],label:"文件角色",rules:[{required:!0}],style:{marginBottom:0},children:(0,i.jsx)(h.A,{placeholder:"选择文件角色",size:"small",options:eu.map(e=>{var l;return{label:"".concat(e.name," (").concat(r(G[null!=(l=e.processingType)?l:""]||"roles.reference"),")"),value:e.id}})})}),(0,i.jsx)(o.A.Item,{noStyle:!0,shouldUpdate:!0,children:l=>{let{getFieldValue:r}=l;return ek(eI(r(["fileRoles",e.name,"roleId"])))}})]}),(0,i.jsx)(j.A,{style:{width:90},children:(0,i.jsx)(o.A.Item,{name:[e.name,"order"],label:"排序",initialValue:l,style:{marginBottom:0},children:(0,i.jsx)(f.A,{type:"number",size:"small"})})})]})]},e.key)),(0,i.jsx)(p.Ay,{icon:(0,i.jsx)(O.A,{}),onClick:()=>t({order:e.length}),children:r("roles.addRole")})]})}})},{key:"prompt",label:"提示词角色 (".concat(t.length,"/").concat(ey.length,")"),children:(0,i.jsx)(o.A.List,{name:"promptRoles",children:(e,l)=>{let{add:n,remove:s}=l;return(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,i.jsx)(d.A,{size:"small",title:"已选提示词角色",style:{background:"var(--colorFillQuaternary)"},children:eR(t,"prompt")}),0===e.length&&(0,i.jsx)(c.A,{description:"暂未添加提示词角色"}),e.map((e,l)=>(0,i.jsxs)(d.A,{size:"small",style:{border:"1px solid var(--colorBorderSecondary)",position:"relative"},children:[(0,i.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,i.jsx)(p.Ay,{danger:!0,size:"small",icon:(0,i.jsx)(F.A,{}),onClick:()=>s(e.name),style:{position:"absolute",top:8,right:8,zIndex:1}}),(0,i.jsxs)(g.A,{gutter:[16,8],align:"middle",style:{marginTop:4},children:[(0,i.jsxs)(j.A,{flex:"auto",children:[(0,i.jsx)(o.A.Item,{name:[e.name,"roleId"],label:"提示词角色",rules:[{required:!0}],style:{marginBottom:0},children:(0,i.jsx)(h.A,{placeholder:"选择提示词角色",size:"small",options:ey.map(e=>{var l;return{label:"".concat(e.name," (").concat(r(Q[null!=(l=e.executionType)?l:""]||"roles.reference"),")"),value:e.id}})})}),(0,i.jsx)(o.A.Item,{noStyle:!0,shouldUpdate:!0,children:l=>{let{getFieldValue:r}=l;return ek(eI(r(["promptRoles",e.name,"roleId"])))}})]}),(0,i.jsx)(j.A,{style:{width:90},children:(0,i.jsx)(o.A.Item,{name:[e.name,"order"],label:"排序",initialValue:l,style:{marginBottom:0},children:(0,i.jsx)(f.A,{type:"number",size:"small"})})})]})]},e.key)),(0,i.jsx)(p.Ay,{icon:(0,i.jsx)(O.A,{}),onClick:()=>n({order:e.length}),children:r("roles.addRole")})]})}})}]})}})]})})]})}}},e=>{e.O(0,[433,787,576,195,455,466,636,593,792],()=>e(e.s=23507)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[298],{16403:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/documents",function(){return r(19562)}])},19562:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ec});var l=r(65321),n=r(97109),s=r(7576),o=r(35292),i=r(33442),a=r(11702),c=r(17807),d=r(63455),u=r(88762),p=r(85114),h=r(68787),m=r(84253),g=r(38332),x=r(26171),f=r(34052),j=r(42700),v=r(58569),y=r(2256),w=r(38770),A=r(76506),S=r(57271),b=r(49604),k=r(23216),I=r(16285),C=r(26619),T=r(8263),z=r(8579),B=r(75548),E=r(7851),R=r(84742),M=r(29071),_=r(63552),D=r(26631),F=r(29606),P=r(83914),L=r(58209),W=r(54746),G=r(71330),N=r(64068),O=r(93051),q=r(38762),H=r(64629),K=r(67547),V=r(76830),U=r(1310),X=r(6578),Q=r(79059);let{TextArea:J}=s.A,{Text:Y}=o.A;function Z(e){let{type:t="info",title:r,children:n,style:s}=e,o="error"===t?"var(--colorError)":"warning"===t?"var(--colorWarning)":"success"===t?"var(--colorSuccess)":"var(--colorInfo)";return(0,l.jsxs)("div",{style:{border:"1px solid ".concat(o),background:"error"===t?"var(--colorErrorBg)":"warning"===t?"var(--colorWarningBg)":"success"===t?"var(--colorSuccessBg)":"var(--colorInfoBg)",borderRadius:8,padding:"9px 12px",...s},children:[(0,l.jsx)(Y,{strong:!0,style:{color:o},children:r}),n&&(0,l.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12},children:n})]})}function $(e){let{children:t,gap:r=12,style:n}=e;return(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:r,...n},children:t})}let ee=null;function et(){null==ee||ee.listeners.forEach(e=>e())}let er={role_binding:(0,l.jsx)(k.A,{}),context_recall:(0,l.jsx)(I.A,{}),knowledge_retrieval:(0,l.jsx)(C.A,{}),file_understanding:(0,l.jsx)(T.A,{}),fact_extraction:(0,l.jsx)(I.A,{}),chapter_generation:(0,l.jsx)(z.A,{}),asset_generation:(0,l.jsx)(B.A,{}),validation:(0,l.jsx)(E.A,{}),formatting:(0,l.jsx)(R.A,{}),llm_review:(0,l.jsx)(M.A,{}),export_ready:(0,l.jsx)(_.A,{}),reference:(0,l.jsx)(B.A,{})},el={施工组织设计:(0,l.jsx)(E.A,{}),投标文件:(0,l.jsx)(_.A,{}),技术方案:(0,l.jsx)(I.A,{}),报告:(0,l.jsx)(D.A,{}),自定义:(0,l.jsx)(z.A,{})};function en(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function es(e){return e?e.split(/[\\/]/u).pop()||e:""}function eo(e){let t=[],r=e=>{for(let l of e)l.isFolder?l.children&&r(l.children):t.push(l.key)};return r(e),t}let ei={role_binding:"角色配置绑定",context_recall:"上下文召回",knowledge_retrieval:"知识库检索",file_understanding:"多模态文件理解",fact_extraction:"LLM 事实抽取",chapter_generation:"LLM 章节生成",asset_generation:"多模态资源生成",validation:"规则校验",formatting:"格式化排版",llm_review:"LLM 审查优化",export_ready:"导出就绪",reference:"参考资源处理"},ea={"knowledge-base":"知识库","document-readiness":"生成准备度检查","quality-repair":"质量补写","export-gate":"导出门禁","context-memory":"项目上下文","final-format":"正式排版","multimodal-files":"多模态文件理解",tender_announcement:"招标公告"};function ec(){var e,t,r,o,B;let ec=(0,Q.Vr)(),{message:ed}=c.A.useApp(),[eu]=d.A.useForm(),ep=(0,n.useRef)(null),[eh,em]=(0,n.useState)([]),[eg,ex]=(0,n.useState)("construction-organization-design"),[ef,ej]=(0,n.useState)([]),[ev,ey]=(0,n.useState)([]),[ew,eA]=(0,n.useState)([]),[eS,eb]=(0,n.useState)([]),[ek,eI]=(0,n.useState)(!1),[eC,eT]=(0,n.useState)(""),[ez,eB]=(0,n.useState)([]),[eE,eR]=(0,n.useState)(!0),[eM,e_]=(0,n.useState)(!1),[eD,eF]=(0,n.useState)(null),[eP,eL]=(0,n.useState)(""),[eW,eG]=(0,n.useState)([]),[eN,eO]=(0,n.useState)(null),[eq,eH]=(0,n.useState)(null),[eK,eV]=(0,n.useState)(""),[eU,eX]=(0,n.useState)(!1),[eQ,eJ]=(0,n.useState)("idle"),[eY,eZ]=(0,n.useState)(null),[e$,e0]=(0,n.useState)(null),[e1,e2]=(0,n.useState)({start:0,end:0}),[e6,e8]=(0,n.useState)([]),[e3,e4]=(0,n.useState)(!1),[e5,e7]=(0,n.useState)(!1),[e9,te]=(0,n.useState)({}),tt=ef.filter(e=>"file"===e.type).map(e=>({label:e.name,value:e.id})),tr=d.A.useWatch("fileBindingGroups",eu)||{},tl=(0,n.useMemo)(()=>(function(e){let t={};for(let n of[...e].sort((e,t)=>e.relativePath.localeCompare(t.relativePath,"zh-CN"))){let e=n.relativePath.split("/").filter(Boolean),s="";for(let o=0;o<e.length;o++){let a=e[o],c=s;s=s?"".concat(s,"/").concat(a):a;let d=o===e.length-1;if(!t[s]){var r;t[s]={key:s,rawTitle:a,title:d?(0,l.jsx)("span",{title:n.relativePath,children:a}):(0,l.jsxs)(i.A,{size:4,children:[(0,l.jsx)(F.A,{style:{color:"#faad14"}}),(0,l.jsx)("span",{children:a})]}),isFolder:!d,fileCount:+!!d,...d?{}:{children:[]}},c&&(null==(r=t[c])?void 0:r.children)&&t[c].children.push(t[s])}d&&(t[s].fileCount=1)}}let n=e=>{for(let r of e){var t;(null==(t=r.children)?void 0:t.length)&&(n(r.children),r.fileCount=r.children.reduce((e,t)=>e+t.fileCount,0),r.title=(0,l.jsxs)(i.A,{size:4,children:[(0,l.jsx)(F.A,{style:{color:"#faad14"}}),(0,l.jsx)("span",{children:r.rawTitle}),(0,l.jsx)(a.A,{style:{margin:0},children:r.fileCount})]}))}},s=Object.values(t).filter(e=>!e.key.includes("/"));return n(s),s.filter(e=>!e.isFolder||e.fileCount>0)})(eS),[eS]),tn=(0,n.useMemo)(()=>(function e(t,r){let l=r.trim().toLowerCase();return l?t.flatMap(t=>{let r=t.children?e(t.children,l):void 0;return t.key.toLowerCase().includes(l)||t.rawTitle.toLowerCase().includes(l)||(null==r?void 0:r.length)?[{...t,children:r}]:[]}):t})(tl,eC),[tl,eC]),ts=(0,n.useMemo)(()=>eo(tl),[tl]),to=(0,n.useMemo)(()=>{var e,t,r;return(null==(e=ew.find(e=>e.selected))?void 0:e.projectRoot)||(null==(t=ew.find(e=>e.isCurrent))?void 0:t.projectRoot)||(null==(r=ew[0])?void 0:r.projectRoot)||""},[ew]),ti=(0,n.useMemo)(()=>{let e=[],t=r=>{for(let l of r)e.push(l.key),l.children&&t(l.children)};return t(tl),e},[tl]),[ta,tc]=(0,n.useState)([]),[td,tu]=(0,n.useState)(null),[tp,th]=(0,n.useState)(null),[tm,tg]=(0,n.useState)("templates"),[tx,tf]=(0,n.useState)(!1),[tj,tv]=(0,n.useState)("workflow"),ty=(0,n.useRef)(null),tw=(0,n.useRef)(null),tA=(0,n.useRef)(0),tS=(0,n.useMemo)(()=>"activeGenDocId:".concat(to||"default"),[to]),tb=async()=>{try{eG((await (0,X.cQ)(to||void 0)).documents)}catch(e){eG([])}};(0,n.useEffect)(()=>{let e=()=>{ee&&(tc(ee.flowSteps),tu(ee.activeFlowKey),e_(ee.loading),ee.documentId&&eO(ee.documentId),ee.draft&&eF(ee.draft),void 0!==ee.content&&eL(ee.content))},t=ee;return null==t||t.listeners.add(e),e(),()=>{null==t||t.listeners.delete(e)}},[]),(0,n.useEffect)(()=>{eR(!0),Promise.all([(0,X.Dl)().then(e=>{var t,r;em(e.templates),ex(null!=(r=null==(t=e.templates[0])?void 0:t.id)?r:"construction-organization-design")}),(0,X.lv)().then(e=>{ej(e.roles),ey(e.configs)}),(0,X.dx)().then(e=>eA(e))]).catch(()=>ed.error(ec("common.error"))).finally(()=>eR(!1))},[ed,ec]),(0,n.useEffect)(()=>{to&&(localStorage.removeItem("activeGenDocId"),tb())},[to]),(0,n.useEffect)(()=>{if(0===eW.length)return;let e=localStorage.getItem(tS);if(!e)return;if(!eW.find(t=>t.id===e&&"generating"===t.status))return void localStorage.removeItem(tS);let t=setInterval(()=>{(async()=>{try{let{document:r}=await (0,X.v7)(e,!1,to||void 0);await tb(),"generating"!==r.status&&(localStorage.removeItem(tS),clearInterval(t))}catch(e){clearInterval(t)}})()},3e3);return()=>clearInterval(t)},[eW]);let tk=(0,n.useMemo)(()=>eh.find(e=>e.id===eg),[eh,eg]),tI=ev.map(e=>({label:e.name,value:e.id})),tC=Math.max(0,ta.findIndex(e=>e.key===td)),tT=e=>{var t;return e?(null==(t=ef.find(t=>t.id===e))?void 0:t.name)||ea[e]||"未知角色":""},tz=e=>e.subtitle||e.roleName||tT(e.roleId)||ei[e.type]||e.type,tB=e=>{var t,r,l;return e.promptName||((t=e.promptId)?(null==(r=ew.find(e=>e.id===t))?void 0:r.projectName)||(null==(l=ef.find(e=>e.id===t))?void 0:l.name)||ea[t]||"未知提示词":"")},tE=()=>{tA.current+=1,eV(""),eZ(null),e0(null),e8([]),e4(!1),eX(!1),eJ("idle")},tR=e=>{ex(e),eO(null),eF(null),eL(""),tE(),tv("workflow"),tf(!0),tg("drafts")},tM=async e=>{eO(e.id),ex(e.templateId);let t=t_(e.status);if(t||"failed"===e.status||"aborted"===e.status){tE(),th(e),eF(null),eL(""),e_(t),tv("workflow"),tf(!0);try{let{document:t}=await (0,X.v7)(e.id,!1,e.projectRoot||to||void 0);tP(t),t_(t.status)?tL(t.id,t.projectRoot||e.projectRoot||to||void 0):await tb()}catch(t){tP(e)}return}tv("editor"),tc([]),tu(null),tE();try{let{document:t}=await (0,X.v7)(e.id,!1,e.projectRoot||to||void 0);eF(t.draft||null),eL(t.editedMarkdown||t.markdown)}catch(e){ed.error(ec("common.error"))}tf(!0)},t_=e=>"completed"!==e&&"warning"!==e&&"failed"!==e&&"aborted"!==e,tD=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eM;(null==ee?void 0:ee.loading)&&(ee.flowSteps=e,ee.activeFlowKey=t,ee.loading=r,et())},tF=e=>{var t,r,n,s,o;let i=e.executionStages||(null==(t=e.draft)?void 0:t.executionStages)||[];if(i.length>0){let t=i.map((t,r)=>{var n;let s,o=("failed"===e.status||"aborted"===e.status)&&"running"===t.status||"failed"===(s=t.status)?"error":"running"===s?"process":"fallback"===s?"warning":"finish";return{key:"".concat(t.type,"-").concat(r),title:t.title||ei[t.type]||t.type,subtitle:tz(t),description:t.message||"",status:o,icon:"role_binding"===(n=t.type)?(0,l.jsx)(k.A,{}):"knowledge_retrieval"===n?(0,l.jsx)(C.A,{}):"context_recall"===n?(0,l.jsx)(I.A,{}):"file_understanding"===n?(0,l.jsx)(T.A,{}):"fact_extraction"===n?(0,l.jsx)(I.A,{}):"chapter_generation"===n?(0,l.jsx)(z.A,{}):"llm_review"===n?(0,l.jsx)(M.A,{}):"validation"===n?(0,l.jsx)(E.A,{}):"formatting"===n?(0,l.jsx)(R.A,{}):"export_ready"===n?(0,l.jsx)(_.A,{}):(0,l.jsx)(D.A,{}),subSteps:((e,t,r)=>{let l=Array.isArray(e.details)?e.details.filter(Boolean):[],n=e.progress?"".concat(e.progress.label||"进度",":").concat(e.progress.current,"/").concat(e.progress.total):"",s=[...n?[n]:[],...l];return 0===s.length?[{key:"stage-".concat(r),title:tB(e)?"提示词:".concat(tB(e)):tz(e),status:t}]:s.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,o,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 a="generating"===e.status?(null==(n=t.at(-1))?void 0:n.key)||"prepare":"failed"===e.status||"aborted"===e.status?(null==(s=t.find(e=>"error"===e.status))?void 0:s.key)||(null==(o=t.at(-1))?void 0:o.key)||"prepare":"done";return{steps:t,activeKey:a}}return{steps:[],activeKey:null}},tP=e=>{th(e);let{steps:t,activeKey:r}=tF(e);tc(t),tu(r),e_(t_(e.status)),tD(t,r,t_(e.status)),("failed"===e.status||"aborted"===e.status)&&tv("workflow"),("completed"===e.status||"warning"===e.status)&&e.draft&&(eF(e.draft),eL(e.editedMarkdown||e.markdown),tv("editor"),tc([]),tu(null))},tL=(e,t)=>{ty.current&&clearInterval(ty.current),ty.current=setInterval(()=>{(async()=>{try{let{document:r}=await (0,X.v7)(e,!0,t||to||void 0);tP(r),await tb(),t_(r.status)||(ty.current&&clearInterval(ty.current),ty.current=null,localStorage.removeItem(tS))}catch(e){}})()},2e3)};(0,n.useEffect)(()=>()=>{ty.current&&(clearInterval(ty.current),ty.current=null),tw.current&&(clearTimeout(tw.current),tw.current=null)},[]),(0,n.useEffect)(()=>{if(!eM||!td)return;let e=window.setInterval(()=>tc(e=>{let t=e.map(e=>{if(e.key!==td||"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 tD(t,td),t}),1400);return()=>window.clearInterval(e)},[td,eM]);let tW=async()=>{eI(!0);try{let e=await (0,X.HT)({limit:5e3,projectRoot:to||void 0});eb(e.files)}catch(e){ed.error("知识库文件加载失败")}finally{eI(!1)}},tG=e=>{let t=null!=e?e:{id:"tpl-".concat(Date.now()),name:"",description:"",category:"自定义",outputTitle:"",projectRoleConfigId:void 0,chapters:[],fileBindings:[]};eu.resetFields(),eu.setFieldsValue({...t,fileBindingGroups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((e,t)=>(t.roleId&&t.filePath&&(e[t.roleId]=en([...e[t.roleId]||[],t.filePath])),e),{})}(t.fileBindings)}),eT(""),tW(),e7(!0)},tN=(e,t)=>{let r=eu.getFieldValue("fileBindingGroups")||{};eu.setFieldValue("fileBindingGroups",{...r,[e]:en(t)})},tO=async()=>{try{await eu.validateFields();let e=eu.getFieldsValue(!0),t=e.fileBindingGroups||{},r=Object.entries(t).flatMap(e=>{let[t,r]=e;return en(r||[]).map(e=>({roleId:t,filePath:e}))}),{fileBindingGroups:l,...n}=e,s={...n,chapters:[],fileBindings:r},o=await (0,X.l2)(s);em(o.templates),ex(o.template.id),e7(!1),await tb(),ed.success(ec("common.success"))}catch(e){e instanceof Error&&ed.error(e.message)}},tq=async e=>{try{let t=await (0,X.bV)(e);em(t.templates),ex(t.template.id),ed.success(ec("common.success"))}catch(e){ed.error(ec("common.error"))}},tH=async e=>{try{var t,r;let l=await (0,X.h0)(e);em(l.templates),ex(null!=(r=null==(t=l.templates[0])?void 0:t.id)?r:""),ed.success(ec("common.success"))}catch(e){ed.error(ec("common.error"))}},tK=async e=>{try{let{validation:t}=await (0,X.SM)(e,to||void 0);te(r=>({...r,[e]:t}));let r=t.issues.filter(e=>"error"===e.level);if(ex(e),r.length>0)return void ed.warning("模板运行前检查未通过,请先处理阻断项");if(t.issues.length>0)return void ed.warning("模板存在警告,可在检查面板确认后继续运行");tR(e)}catch(e){ed.error(e instanceof Error?e.message:"模板运行前检查失败")}},tV=async e=>{try{await (0,X.QG)(e.id,e.projectRoot||to||void 0),eN===e.id&&(eO(null),eF(null),eL("")),await tb(),ed.success(ec("common.success"))}catch(e){ed.error(ec("common.error"))}},tU=async(e,t)=>{let r=Date.now(),l=0,n=Date.now();for(;;){let s;if(null==t?void 0:t.aborted)throw Error("用户中止");let o=new AbortController;t&&(t.pollController=o);try{({document:s}=await (0,X.v7)(e,!0,to||void 0,o.signal))}finally{(null==t?void 0:t.pollController)===o&&(t.pollController=void 0)}if(tP(s),s.updatedAt!==l&&(l=s.updatedAt,n=Date.now()),("completed"===s.status||"warning"===s.status)&&s.draft)return s;if("failed"===s.status||"aborted"===s.status)throw Error(s.error||("aborted"===s.status?"生成已中止":"生成失败"));if(Date.now()-r>75e5||Date.now()-n>96e4)throw Error("生成任务疑似卡住,请点击继续生成或重新生成");await new Promise(e=>window.setTimeout(e,1500))}},tX=async()=>{if(!eg)return;if((null==ee?void 0:ee.aborted)&&(ee=null),null==ee?void 0:ee.loading){tc(ee.flowSteps),tu(ee.activeFlowKey),e_(!0);return}if(!to)return void ed.error("未识别当前项目,请先选择或打开项目后再生成文件");e_(!0);let e=(0,X.OX)({templateId:eg,projectRoot:to});ee={id:Date.now(),templateId:eg,loading:!0,flowSteps:[],activeFlowKey:null,promise:e,listeners:new Set},tc([]),tu(null);let t=[];try{let r=await e;r.documentId&&(localStorage.setItem(tS,r.documentId),eO(r.documentId),(null==ee?void 0:ee.promise)===e&&(ee.documentId=r.documentId)),await tb();let l=r.documentId?await tU(r.documentId,(null==ee?void 0:ee.promise)===e?ee:void 0):void 0,n=r.draft||(null==l?void 0:l.draft);if(!n)throw Error("生成结果为空");(r.documentId||(null==l?void 0:l.id))&&eO(r.documentId||l.id),t.forEach(e=>window.clearTimeout(e)),eF(n),eL((null==l?void 0:l.editedMarkdown)||(null==l?void 0:l.markdown)||n.markdown),(null==ee?void 0:ee.promise)===e&&(ee.draft=n,ee.content=(null==l?void 0:l.editedMarkdown)||(null==l?void 0:l.markdown)||n.markdown);let s=l||{id:r.documentId||"draft-".concat(Date.now()),templateId:eg,title:n.title,requirement:n.requirement,projectRoot:n.projectRoot||to,projectId:n.projectId,markdown:n.markdown,status:n.validationIssues.some(e=>"error"===e.level||"warning"===e.level)||!n.exportGate.passed?"warning":"completed",draft:n,executionStages:n.executionStages,assets:n.assets||[],createdAt:n.generatedAt,updatedAt:Date.now()},{steps:o}=tF(s);tc(o),tD(o,"done",!1),tu("done"),(null==ee?void 0:ee.promise)===e&&(ee.activeFlowKey="done",ee.loading=!1,et(),ee=null),localStorage.removeItem(tS),await tb(),ed.success(ec("common.success")),window.setTimeout(()=>{var e;return null==(e=ep.current)?void 0:e.scrollIntoView({behavior:"smooth",block:"start"})},200)}catch(l){localStorage.removeItem(tS);let t=l instanceof Error?l.message:ec("common.error"),r=/用户中止|abort|aborted/i.test(t);r||tc(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 tD(r,td,!1),r}),(null==ee?void 0:ee.promise)===e&&(ee.loading=!1,ee.error=t,et(),ee=null),await tb().catch(()=>void 0),r||ed.error(t)}finally{t.forEach(e=>window.clearTimeout(e)),e_(!1),(null==ee?void 0:ee.promise)===e&&(ee.loading=!1,et())}},tQ=(0,n.useRef)(!1);(0,n.useEffect)(()=>(tw.current&&(clearTimeout(tw.current),tw.current=null),!tx||"workflow"!==tj||eN||tQ.current||(null==ee?void 0:ee.loading)||null==tk||!tk.projectRoleConfigId||(tQ.current=!0,tw.current=setTimeout(()=>{tw.current=null,tx&&"workflow"===tj&&!eN&&eg==eg&&tX()},300)),tx||(tQ.current=!1),()=>{tw.current&&(clearTimeout(tw.current),tw.current=null)}),[tx,tj,eN,tk,eg]);let tJ=async e=>{try{eO(e.id),ex(e.templateId),tv("workflow"),tf(!0),e_(!0);let t=await (0,X.UQ)(e.id,e.projectRoot||to||void 0);localStorage.setItem(tS,t.documentId),await tb();let r=await tU(t.documentId);r.draft&&(eF(r.draft),eL(r.editedMarkdown||r.markdown||r.draft.markdown),tv("editor")),localStorage.removeItem(tS),await tb(),ed.success("已继续生成并完成")}catch(e){ed.error(e instanceof Error?e.message:"继续生成失败")}finally{e_(!1)}},tY=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,e_(!1)}localStorage.removeItem(tS),ty.current&&(clearInterval(ty.current),ty.current=null);try{await (0,X.r)(e.id,e.projectRoot||to||void 0),ed.success("已中止生成任务")}catch(e){ed.info("任务已不在运行,已刷新状态")}finally{await tb(),eN===e.id&&(eO(null),th(null),eF(null),eL(""))}},tZ=async e=>{if(eD){eH(e);try{eD.exportGate.passed||ed.warning("导出门禁存在风险项,已允许导出,请下载后人工复核。");let t={documentId:eN||void 0,title:eD.title,markdown:eP,format:e,enforceGate:!1,exportGate:eD.exportGate,useClientMarkdown:!0,projectRoot:eD.projectRoot||to||void 0},r=await (0,X.UE)(t);((e,t,r)=>{let l=new Blob([e],{type:r}),n=URL.createObjectURL(l),s=document.createElement("a");s.href=n,s.download=t,s.target="_self",s.rel="noopener",s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),s.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)})(r,"".concat(eD.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){ed.error(e instanceof Error?e.message:ec("common.error"))}finally{eH(null)}}},t$=async()=>{if(eD)try{if(eN)await (0,X.a6)(eN,{editedMarkdown:eP,markdown:eP},eD.projectRoot||to||void 0);else{let e=await (0,X.Af)({...eD,markdown:eP});eF(e.draft)}await tb(),ed.success(ec("common.success"))}catch(e){ed.error(ec("common.error"))}},t0=(e,t)=>{e8(r=>[{id:"".concat(Date.now()),content:e,prompt:t,createdAt:Date.now()},...r].slice(0,12))},t1=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&eV(""),eZ(null),e0(null),e2({start:0,end:0})},t2=(e,t)=>{var r,l;return{title:(null==eD?void 0:eD.title)||"未命名文档",markdown:t,instruction:e,facts:null==eD||null==(r=eD.structuredFacts)?void 0:r.map(e=>"".concat(e.key,": ").concat(e.value)),chapters:null==eD||null==(l=eD.chapters)?void 0:l.map(e=>e.title),...(()=>{let e=e1.start,t=e1.end;return t>e?{selection:{start:e,end:t,text:eP.slice(e,t)},cursorOffset:e}:{cursorOffset:e}})()}},t6=async()=>{let e=eK.trim();if(!eD||!e||eU)return;let t=tA.current+1;tA.current=t,eX(!0),eJ("planning"),e0(null);try{let r=await (0,X.Gi)({mode:"plan",...t2(e,eP)});if(tA.current!==t||eN!=eN)return;if(!r.plan)throw Error("AI 未返回修改计划");eZ(r.plan)}catch(e){tA.current===t&&ed.error(e instanceof Error?e.message:ec("common.error"))}finally{tA.current===t&&(eX(!1),eJ("idle"))}},t8=async e=>{let t=eK.trim();if(!eD||!t||eU)return;let r=tA.current+1;tA.current=r,eX(!0),eJ("applying");try{let l=await (0,X.Gi)({mode:"apply",...t2(t,eP),plan:e});if(tA.current!==r||eN!=eN)return;if(!l.markdown)throw Error("AI 未返回修改结果");e0({plan:l.plan||e,markdown:l.markdown,beforeSnippet:l.beforeSnippet,afterSnippet:l.afterSnippet,summary:l.summary,changedChars:l.changedChars,prompt:t,before:eP})}catch(e){tA.current===r&&ed.error(e instanceof Error?e.message:ec("common.error"))}finally{tA.current===r&&(eX(!1),eJ("idle"))}};if(eE)return(0,l.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,l.jsx)(u.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,l.jsx)(u.A,{active:!0,paragraph:{rows:2}}),(0,l.jsx)(u.A,{active:!0,paragraph:{rows:8}})]});let t3="workflow"===tj?"工作流:".concat((null==tk?void 0:tk.name)||"选择模板"):"编辑:".concat((null==eD?void 0:eD.title)||(null==tk?void 0:tk.outputTitle)||"文档");return(0,l.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"pageTitle",children:ec("documents.title")}),(0,l.jsx)("p",{className:"pageDesc",children:ec("documents.description")})]}),(0,l.jsx)(p.Ay,{type:"primary",icon:(0,l.jsx)(W.A,{}),onClick:()=>tG(),children:ec("documents.newTemplate")})]}),(0,l.jsx)(h.A,{size:"small",tabList:[{key:"templates",label:"模板库 (".concat(eh.length,")")},{key:"drafts",label:"生成记录 (".concat(eW.length,")")}],activeTabKey:tm,onTabChange:tg,children:"templates"===tm?0===eh.length?(0,l.jsx)(m.A,{description:ec("common.noData")}):(0,l.jsx)(g.A,{dataSource:eh,renderItem:e=>(0,l.jsx)(g.A.Item,{style:{cursor:"pointer",padding:"10px 0"},actions:[(0,l.jsx)(p.Ay,{size:"small",icon:(0,l.jsx)(G.A,{}),onClick:t=>{t.stopPropagation(),tG(e)},children:"配置"},"cfg"),(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:(0,l.jsx)(N.A,{}),onClick:t=>{t.stopPropagation(),tK(e.id)},children:"运行"},"run"),(0,l.jsx)(p.Ay,{size:"small",icon:(0,l.jsx)(O.A,{}),onClick:t=>{t.stopPropagation(),tq(e.id)}},"copy"),(0,l.jsx)(x.A,{title:ec("documents.deleteTemplateConfirm"),onConfirm:t=>{null==t||t.stopPropagation(),tH(e.id)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,icon:(0,l.jsx)(L.A,{}),onClick:e=>e.stopPropagation()})},"del")],onClick:()=>ex(e.id),children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10,minWidth:0,flex:1},children:[function(e,t){let r=el[e]||(0,l.jsx)(D.A,{});return(0,l.jsx)("span",{style:{color:t?"var(--colorAccent)":"var(--colorTextSecondary)",fontSize:16,marginTop:2,flexShrink:0},children:r})}(e.category,eg===e.id),(0,l.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:2},children:[(0,l.jsx)("span",{style:{fontWeight:eg===e.id?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),eg===e.id&&(0,l.jsx)(a.A,{color:"blue",style:{margin:0,fontSize:10,lineHeight:"16px",flexShrink:0},children:"当前"}),(0,l.jsx)(a.A,{style:{margin:0,fontSize:10,lineHeight:"16px",flexShrink:0},children:e.category}),e9[e.id]&&(0,l.jsxs)(a.A,{color:e9[e.id].issues.some(e=>"error"===e.level)?"error":e9[e.id].issues.length?"warning":"success",style:{margin:0,fontSize:10,lineHeight:"16px",flexShrink:0},children:["检查 ",e9[e.id].fileDiagnostics.length," 文件 / ",e9[e.id].promptDiagnostics.length," 提示词"]})]}),e.description&&(0,l.jsx)(Y,{type:"secondary",style:{fontSize:12,lineHeight:"18px"},children:e.description}),e9[e.id]&&(0,l.jsx)("div",{onClick:e=>e.stopPropagation(),style:{marginTop:8,padding:10,border:"1px solid ".concat(e9[e.id].issues.some(e=>"error"===e.level)?"var(--colorErrorBorder)":e9[e.id].issues.length?"var(--colorWarningBorder)":"var(--colorSuccessBorder)"),borderRadius:10,background:e9[e.id].issues.some(e=>"error"===e.level)?"var(--colorErrorBg)":e9[e.id].issues.length?"var(--colorWarningBg)":"var(--colorSuccessBg)"},children:(0,l.jsxs)($,{gap:6,style:{width:"100%"},children:[(0,l.jsxs)(i.A,{wrap:!0,children:[(0,l.jsx)(Y,{strong:!0,children:e9[e.id].issues.some(e=>"error"===e.level)?"运行前检查未通过":e9[e.id].issues.length?"运行前检查存在警告":"运行前检查通过"}),(0,l.jsxs)(a.A,{color:"blue",children:["文件角色 ",e9[e.id].fileDiagnostics.length]}),(0,l.jsxs)(a.A,{color:"purple",children:["提示词角色 ",e9[e.id].promptDiagnostics.length]})]}),e9[e.id].issues.length>0?e9[e.id].issues.map(e=>(0,l.jsx)(Z,{type:"error"===e.level?"error":"warning",title:e.message},e.message)):(0,l.jsx)(Z,{type:"success",title:"文件角色、提示词角色和后台自动规范检查通过,可以运行。"}),!e9[e.id].issues.some(e=>"error"===e.level)&&e9[e.id].issues.length>0&&(0,l.jsx)("div",{children:(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:(0,l.jsx)(N.A,{}),onClick:()=>tR(e.id),children:"忽略警告并继续运行"})})]})})]})]})})}):0===eW.length?(0,l.jsx)(m.A,{description:ec("common.noData")}):(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:eW.slice(0,15).map((e,t)=>{var r,n,s,o,c;let d,u;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10,padding:"10px 12px",border:"1px solid var(--colorBorderSecondary)",borderRadius:10,cursor:"pointer",background:eN===e.id?"var(--colorFillAlter)":void 0,minWidth:0},onClick:()=>{tM(e)},children:["completed"===e.status?(0,l.jsx)(R.A,{style:{fontSize:18,color:"var(--colorOk)",flexShrink:0,marginTop:2}}):"failed"===e.status||"aborted"===e.status?(0,l.jsx)(q.A,{style:{fontSize:18,color:"var(--colorDanger)",flexShrink:0,marginTop:2}}):"warning"===e.status?(0,l.jsx)(E.A,{style:{fontSize:18,color:"var(--colorWarning)",flexShrink:0,marginTop:2}}):(0,l.jsx)(H.A,{spin:!0,style:{fontSize:18,color:"#1677ff",flexShrink:0,marginTop:2}}),(0,l.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,l.jsx)("div",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginBottom:3},children:e.title}),(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px 10px",color:"var(--colorTextSecondary)",fontSize:11},children:[(0,l.jsx)("span",{children:new Date(e.updatedAt).toLocaleString()}),(0,l.jsxs)("span",{children:["耗时 ",(e=>{let t=Math.max(0,Math.round(((e.completedAt||e.updatedAt)-e.createdAt)/1e3));if(t<60)return"".concat(t," 秒");let r=Math.floor(t/60),l=t%60;if(r<60)return l?"".concat(r," 分 ").concat(l," 秒"):"".concat(r," 分");let n=Math.floor(r/60),s=r%60;return s?"".concat(n," 小时 ").concat(s," 分"):"".concat(n," 小时")})(e)]})]}),e.partialChapters&&e.partialChapters.length>0&&(0,l.jsxs)("div",{style:{marginTop:3,fontSize:11,color:"var(--colorTextSecondary)"},children:["已完成章节 ",e.partialChapters.filter(e=>"completed"===e.status).length,"/",e.partialChapters.length," \xb7 ",e.partialChapters.reduce((e,t)=>e+t.chars,0).toLocaleString()," 字"]}),("warning"===e.status||"failed"===e.status||"aborted"===e.status)&&(0,l.jsx)("div",{style:{marginTop:3,color:"failed"===e.status||"aborted"===e.status?"var(--colorError)":"var(--colorWarning)",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.error||(null==(r=e.warningIssues)?void 0:r[0])||(null==(s=e.draft)||null==(n=s.validationIssues.find(e=>"error"===e.level||"warning"===e.level))?void 0:n.message)||"需复核"})]}),(0,l.jsxs)(i.A,{size:4,align:"center",children:[(0,l.jsx)(a.A,{color:"completed"===(d=e.status)?"success":"warning"===d?"warning":"failed"===d?"error":"aborted"===d?"default":"processing",style:{margin:0,fontSize:10,lineHeight:"18px"},children:"completed"===(u=e.status)?"已完成":"warning"===u?"需复核":"failed"===u?"失败":"aborted"===u?"已中止":"生成中"}),(0,l.jsxs)(a.A,{style:{margin:0,fontSize:10,lineHeight:"18px"},children:["#",t+1]}),(0,l.jsx)(x.A,{title:"确认删除?",onConfirm:t=>{null==t||t.stopPropagation(),tV(e)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,icon:(0,l.jsx)(L.A,{}),onClick:e=>e.stopPropagation()})}),t_(e.status)&&(0,l.jsx)(x.A,{title:"确定中止此生成任务?",onConfirm:t=>{null==t||t.stopPropagation(),tY(e)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,onClick:e=>e.stopPropagation(),children:"中止"})}),("failed"===e.status||"aborted"===e.status||"warning"===e.status&&!!(null==(o=e.checkpointChapters)?void 0:o.length)&&/继续生成|重新生成|中断|卡住|未完成/u.test(e.error||(null==(c=e.warningIssues)?void 0:c.join(";"))||""))&&(0,l.jsx)(p.Ay,{size:"small",onClick:t=>{t.stopPropagation(),tJ(e)},children:"继续"}),(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:t_(e.status)?(0,l.jsx)(H.A,{spin:!0}):(0,l.jsx)(N.A,{}),onClick:t=>{t.stopPropagation(),tM(e)},children:"打开"})]})]},e.id)})})}),(0,l.jsx)(f.A,{title:t3,open:tx,onClose:()=>{tf(!1),ty.current&&(clearInterval(ty.current),ty.current=null)},size:800,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:eD?(0,l.jsxs)(i.A,{wrap:!0,children:[(0,l.jsx)(p.Ay,{icon:(0,l.jsx)(K.A,{}),disabled:eU,onClick:()=>{t$()},children:ec("documents.saveDraft")}),(0,l.jsx)(p.Ay,{icon:(0,l.jsx)(V.A,{}),disabled:eU,loading:"markdown"===eq,onClick:()=>{tZ("markdown")},children:"MD"}),(0,l.jsx)(p.Ay,{disabled:eU,loading:"html"===eq,onClick:()=>{tZ("html")},children:"HTML"}),(0,l.jsx)(p.Ay,{disabled:eU,loading:"docx"===eq,onClick:()=>{tZ("docx")},children:"DOCX"}),(0,l.jsx)(p.Ay,{type:"primary",disabled:eU,loading:"pdf"===eq,onClick:()=>{tZ("pdf")},children:"PDF"})]}):eM&&"workflow"===tj?(0,l.jsx)(p.Ay,{danger:!0,onClick:()=>{(async()=>{if(eN&&await (0,X.r)(eN,to||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(tS),ty.current&&(clearInterval(ty.current),ty.current=null),e_(!1),tc([]),tu(null),tf(!1),await tb(),ed.info("已中止生成任务")})()},children:"中止任务"}):void 0,children:(0,l.jsxs)($,{style:{width:"100%"},gap:16,children:["workflow"===tj&&ta.length>0&&(0,l.jsx)($,{gap:10,children:ta.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===tC?"var(--colorFillAlter)":"var(--colorBgContainer)"},children:[(0,l.jsx)("span",{children:"process"===e.status?(0,l.jsx)(P.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)(Y,{strong:!0,children:e.title}),(0,l.jsx)(a.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)(a.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)(P.A,{}):"finish"===t?(0,l.jsx)(R.A,{}):"warning"===t?(0,l.jsx)(E.A,{style:{color:"var(--colorWarning)"}}):"error"===t?(0,l.jsx)(L.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"===tj&&(null==tp?void 0:tp.partialChapters)&&tp.partialChapters.length>0&&(0,l.jsx)(h.A,{size:"small",title:"章节进度",extra:(0,l.jsxs)(a.A,{color:"blue",children:[tp.partialChapters.filter(e=>"completed"===e.status).length,"/",tp.partialChapters.length]}),children:(0,l.jsx)($,{gap:6,style:{width:"100%"},children:tp.partialChapters.map(e=>(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:8,fontSize:12},children:[(0,l.jsx)(Y,{ellipsis:!0,style:{maxWidth:480},children:e.title}),(0,l.jsxs)(i.A,{size:6,children:[(0,l.jsx)(a.A,{color:"failed"===e.status?"error":"success",children:"failed"===e.status?"失败":"完成"}),(0,l.jsxs)(Y,{type:"secondary",children:[e.chars.toLocaleString()," 字"]})]})]},e.id))})}),"workflow"===tj&&(null==tp||null==(e=tp.reviewMetadata)?void 0:e.diagnostics)&&(0,l.jsx)(Z,{type:"info",title:"后台自动优化",children:"策略:".concat(tp.reviewMetadata.diagnostics.strategy.mode,";LLM 调用 ").concat(tp.reviewMetadata.diagnostics.llm.calls," 次;噪声过滤 ").concat((null==(t=tp.reviewMetadata.diagnostics.evidence)?void 0:t.filteredNoise)||0," 条;质量门禁 阻断").concat((null==(r=tp.reviewMetadata.diagnostics.quality)?void 0:r.blockingCount)||0,"/重要").concat((null==(o=tp.reviewMetadata.diagnostics.quality)?void 0:o.importantCount)||0,"/轻微").concat((null==(B=tp.reviewMetadata.diagnostics.quality)?void 0:B.minorCount)||0,";自动限流调整 ").concat(tp.reviewMetadata.diagnostics.llm.limitAdjustments," 次。审查与诊断信息仅用于系统修复,不会写入正文或导出文件。")}),"workflow"===tj&&eM&&0===ta.length&&(0,l.jsxs)("div",{style:{textAlign:"center",padding:40},children:[(0,l.jsx)(j.A,{}),(0,l.jsx)("div",{style:{marginTop:12,color:"var(--colorTextSecondary)"},children:"正在准备生成…"})]}),eD&&(0,l.jsx)("div",{ref:ep,children:(0,l.jsx)(v.A,{items:[{key:"edit",label:ec("documents.edit"),children:(0,l.jsxs)($,{gap:16,style:{width:"100%"},children:[(0,l.jsx)(J,{rows:28,value:eP,disabled:eU,onSelect:e=>{var t,r,l;return e2({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;eL(e.target.value),eZ(null),e0(null),e2({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)(h.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)(M.A,{style:{color:"var(--colorAccent)"}}),(0,l.jsx)(Y,{strong:!0,children:"精准修改"}),(0,l.jsx)(a.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)(U.A,{}),onClick:()=>e4(e=>!e),disabled:0===e6.length,children:["历史版本 ",e6.length>0?e6.length:""]})]}),(0,l.jsx)(Z,{type:"info",title:"系统只负责识别修改范围,不改写你的提示词;选中文字后优先只改选区,没有选区时按光标所在小节/章节定位。"}),(0,l.jsx)(J,{rows:4,value:eK,disabled:eU,onChange:e=>{eV(e.target.value),eZ(null),e0(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:eU,onClick:()=>eV(t=>t?"".concat(t,";").concat(e):e),children:e},e))}),(0,l.jsx)(p.Ay,{type:"primary",icon:(0,l.jsx)(M.A,{}),loading:eU&&"planning"===eQ,disabled:!eK.trim()||eU,onClick:()=>{t6()},children:"识别修改范围"})]}),eY&&!e$&&(0,l.jsx)(h.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)(a.A,{color:"purple",children:eY.scope}),(0,l.jsx)(a.A,{color:"blue",children:eY.action}),(0,l.jsxs)(a.A,{color:eY.confidence>=.8?"green":"orange",children:["置信度 ",Math.round(100*eY.confidence),"%"]}),eY.targetTitle&&(0,l.jsx)(Y,{strong:!0,children:eY.targetTitle})]}),(0,l.jsx)(Y,{children:eY.summary}),(0,l.jsx)(Y,{type:"secondary",style:{fontSize:12},children:"将按你的原始提示词执行,不添加额外编辑任务。"}),(0,l.jsxs)(i.A,{children:[(0,l.jsx)(p.Ay,{type:"primary",loading:eU&&"applying"===eQ,onClick:()=>{t8(eY)},children:"执行并预览"}),(0,l.jsx)(p.Ay,{disabled:eU,onClick:()=>eZ(null),children:"取消"})]})]})}),e$&&(0,l.jsx)(h.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)(a.A,{color:"green",children:"修改预览"}),(0,l.jsx)(Y,{children:e$.summary||e$.plan.summary}),(0,l.jsxs)(a.A,{children:[e$.changedChars&&e$.changedChars>0?"+".concat(e$.changedChars):e$.changedChars," 字符"]})]}),(0,l.jsxs)(y.A,{gutter:12,children:[(0,l.jsxs)(w.A,{span:12,children:[(0,l.jsx)(Y,{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:e$.beforeSnippet||"无片段预览"})]}),(0,l.jsxs)(w.A,{span:12,children:[(0,l.jsx)(Y,{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:e$.afterSnippet||"无片段预览"})]})]}),(0,l.jsxs)(i.A,{children:[(0,l.jsx)(p.Ay,{type:"primary",onClick:()=>{e$&&(t0(e$.before,e$.prompt),eL(e$.markdown),t1(!0),ed.success("已应用精准修改"))},children:"应用到文档"}),(0,l.jsx)(p.Ay,{onClick:()=>e0(null),children:"返回计划"}),(0,l.jsx)(p.Ay,{danger:!0,onClick:()=>{eZ(null),e0(null)},children:"放弃"})]})]})}),e3&&(0,l.jsx)("div",{style:{borderTop:"1px solid var(--colorBorderSecondary)",paddingTop:12},children:(0,l.jsx)(g.A,{size:"small",dataSource:e6,locale:{emptyText:"暂无历史版本"},renderItem:e=>(0,l.jsx)(g.A.Item,{actions:[(0,l.jsx)(p.Ay,{size:"small",disabled:eU,onClick:()=>{t0(eP,"恢复前版本"),eL(e.content),t1(!0),ed.success("已恢复历史版本")},children:"恢复"},"restore")],children:(0,l.jsx)(g.A.Item.Meta,{title:(0,l.jsxs)(i.A,{children:[(0,l.jsx)(Y,{children:new Date(e.createdAt).toLocaleString()}),(0,l.jsx)(a.A,{children:e.prompt})]}),description:(0,l.jsx)(Y,{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:[eD.chapters.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsxs)(Y,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["章节 (",eD.chapters.length,")"]}),(0,l.jsx)(g.A,{size:"small",dataSource:eD.chapters,renderItem:e=>(0,l.jsx)(g.A.Item,{children:(0,l.jsx)(g.A.Item.Meta,{title:e.title,description:"证据: ".concat(e.evidence.length," \xb7 缺失: ").concat(e.missingFacts.length)})})})]}),eD.structuredFacts.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsxs)(Y,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["结构化事实 (",eD.structuredFacts.length,")"]}),(0,l.jsx)(A.A,{size:"small",column:1,bordered:!0,children:eD.structuredFacts.map((e,t)=>(0,l.jsxs)(A.A.Item,{label:e.key,children:[(0,l.jsx)("span",{children:e.value}),(0,l.jsx)(a.A,{style:{marginLeft:8},children:e.confidence.toFixed(2)}),(0,l.jsx)(Y,{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)(Y,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["引用来源 (",eD.sources.length,")"]}),0===eD.sources.length?(0,l.jsx)(m.A,{description:"暂无"}):(0,l.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:eD.sources.map(e=>(0,l.jsxs)(a.A,{color:"blue",children:[e.filePath," (",e.count,")"]},e.filePath))})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)(Y,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["缺失项 (",eD.missingItems.length,")"]}),0===eD.missingItems.length?(0,l.jsx)(m.A,{description:"无缺失"}):(0,l.jsx)(g.A,{size:"small",dataSource:eD.missingItems,renderItem:e=>(0,l.jsx)(g.A.Item,{children:e})})]})]})},{key:"validation",label:"校验 (".concat(eD.validationIssues.length,")"),children:0===eD.validationIssues.length?(0,l.jsx)(m.A,{description:"校验通过"}):(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[eD.validationIssues.map(e=>(0,l.jsxs)("div",{style:{border:"1px solid var(--colorBorderSecondary)",borderRadius:8,padding:12},children:[(0,l.jsx)(a.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))),eD.exportGate.checklist.length>0&&(0,l.jsxs)("div",{style:{marginTop:8},children:[(0,l.jsx)(Y,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:"导出门禁"}),(0,l.jsx)(g.A,{size:"small",dataSource:eD.exportGate.checklist,renderItem:e=>(0,l.jsxs)(g.A.Item,{children:[(0,l.jsx)(Y,{style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:e.label}),(0,l.jsx)(a.A,{color:e.passed?"success":"error",children:e.passed?"PASS":"FAIL"})]})})]})]})},{key:"stages",label:"执行阶段 (".concat(eD.executionStages.length,")"),children:(0,l.jsx)(g.A,{size:"small",dataSource:eD.executionStages,renderItem:e=>(0,l.jsxs)(g.A.Item,{children:[(0,l.jsx)(g.A.Item.Meta,{avatar:er[e.type]||(0,l.jsx)(D.A,{}),title:(0,l.jsx)(Y,{title:e.roleId,style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:"".concat(ei[e.type]||e.type," \xb7 ").concat(e.roleName||tT(e.roleId))}),description:(0,l.jsx)(Y,{type:"secondary",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-word"},children:e.message})}),(0,l.jsx)(a.A,{color:"success"===e.status?"success":"failed"===e.status?"error":"skipped"===e.status?"default":"warning",children:e.status})]})})}]})})]})}),(0,l.jsx)(f.A,{title:ec("documents.templateEditor"),open:e5,onClose:()=>e7(!1),size:860,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:()=>e7(!1),children:ec("common.cancel")}),(0,l.jsx)(p.Ay,{type:"primary",onClick:()=>{tO()},children:ec("common.save")})]}),children:(0,l.jsxs)(d.A,{form:eu,layout:"vertical",requiredMark:"optional",children:[(0,l.jsxs)(y.A,{gutter:12,children:[(0,l.jsx)(d.A.Item,{name:"id",hidden:!0,children:(0,l.jsx)(s.A,{})}),(0,l.jsx)(w.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"name",label:ec("documents.templateName"),rules:[{required:!0}],children:(0,l.jsx)(s.A,{})})}),(0,l.jsx)(w.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"category",label:ec("documents.templateCategory"),children:(0,l.jsx)(s.A,{})})}),(0,l.jsx)(w.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"outputTitle",label:ec("documents.outputTitle"),children:(0,l.jsx)(s.A,{})})}),(0,l.jsx)(w.A,{xs:24,md:12,children:(0,l.jsx)(d.A.Item,{name:"description",label:ec("documents.templateDescription"),children:(0,l.jsx)(s.A,{})})})]}),(0,l.jsx)(d.A.Item,{name:"projectRoleConfigId",label:ec("documents.projectRoleConfig"),rules:[{required:!0,message:ec("documents.projectRoleConfigRequired")}],children:(0,l.jsx)(S.A,{showSearch:!0,placeholder:ec("documents.projectRoleConfigRequired"),options:tI})}),(0,l.jsxs)("div",{style:{marginBottom:16},children:[(0,l.jsxs)(i.A,{style:{width:"100%",justifyContent:"space-between",marginBottom:8},children:[(0,l.jsx)(Y,{strong:!0,children:"项目文件绑定"}),(0,l.jsx)(a.A,{color:"blue",children:"按文件角色多选"})]}),(0,l.jsx)(Z,{type:"info",title:"每个文件角色可直接勾选文件或文件夹;勾选文件夹会自动绑定该文件夹下所有文件。保存时仍按具体文件路径绑定,兼容现有模板和生成流程。",style:{marginBottom:12}}),(0,l.jsx)(s.A.Search,{allowClear:!0,placeholder:"搜索文件或文件夹",value:eC,onChange:e=>eT(e.target.value),style:{marginBottom:12}}),ek?(0,l.jsxs)("div",{style:{textAlign:"center",padding:24},children:[(0,l.jsx)(j.A,{}),(0,l.jsx)("div",{style:{marginTop:12,color:"var(--colorTextSecondary)"},children:"正在加载知识库文件…"})]}):0===tt.length?(0,l.jsx)(m.A,{image:m.A.PRESENTED_IMAGE_SIMPLE,description:"暂无可用文件角色"}):0===tl.length?(0,l.jsx)(m.A,{image:m.A.PRESENTED_IMAGE_SIMPLE,description:"暂无知识库文件"}):tt.map(e=>{let t=en(tr[e.value]||[]).filter(e=>ts.includes(e)),r=new Set(eo(tn));return(0,l.jsxs)(h.A,{size:"small",style:{marginBottom:12},title:(0,l.jsxs)(i.A,{children:[(0,l.jsx)(Y,{children:e.label}),(0,l.jsxs)(a.A,{color:"blue",children:["已选 ",t.length]})]}),extra:(0,l.jsx)(p.Ay,{size:"small",disabled:0===t.length,onClick:()=>tN(e.value,[]),children:"清空"}),children:[(0,l.jsx)(d.A.Item,{name:["fileBindingGroups",e.value],hidden:!0,children:(0,l.jsx)(s.A,{})}),(0,l.jsx)("div",{style:{marginBottom:8,color:"var(--colorTextSecondary)",fontSize:12},children:t.length>0?t.slice(0,3).map(es).join("、")+(t.length>3?" 等 ".concat(t.length," 个文件"):""):"未选择文件"}),(0,l.jsx)(b.A,{checkable:!0,blockNode:!0,height:320,treeData:tn,checkedKeys:t,expandedKeys:eC.trim()?ti:ez,onExpand:e=>eB(e),onCheck:(l,n)=>{let s=new Set(t.filter(e=>!r.has(e)));for(let e of n.checkedNodes)e.isFolder?eo([e]).forEach(e=>s.add(e)):s.add(e.key);tN(e.value,Array.from(s))}})]},e.value)})]}),(0,l.jsx)(Z,{type:"info",title:"文档规范由后台根据模板、提示词和角色绑定自动生成,无需手动维护规范包。"})]})})]})}}},e=>{e.O(0,[433,787,576,195,375,455,506,63,636,593,792],()=>e(e.s=16403)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[920],{2548:(e,s,l)=>{"use strict";l.r(s),l.d(s,{default:()=>f});var i=l(65321),r=l(35292),c=l(68787),n=l(2256),d=l(38770),t=l(11702),x=l(9730),h=l(13399),j=l(55122),a=l(15622),o=l(71330),g=l(8579),m=l(66926),A=l(7851),p=l(84742),u=l(79059);let{Paragraph:k,Title:z,Text:N}=r.A,y=[{icon:(0,i.jsx)(o.A,{}),title:"准备阶段",color:"blue",items:["配置模型","上传知识库资料","创建提示词"]},{icon:(0,i.jsx)(g.A,{}),title:"编排阶段",color:"purple",items:["创建文件角色","创建提示词角色","创建项目角色配置并排序"]},{icon:(0,i.jsx)(m.A,{}),title:"生成阶段",color:"geekblue",items:["创建模板","上下文召回","知识库证据增强","动态执行状态"]},{icon:(0,i.jsx)(A.A,{}),title:"交付阶段",color:"green",items:["审查事实和来源","检查导出门禁","导出正式文件"]}],b=[{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 f(){let e=(0,u.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)(k,{className:"pageDesc mb-0",children:e("guide.description")})]}),(0,i.jsx)(n.A,{gutter:[16,16],children:y.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)(x.A,{direction:"vertical",items:b.map(e=>({title:e.title,description:"".concat(e.goal,"(入口:").concat(e.path,")")}))})}),(0,i.jsx)(c.A,{title:"详细步骤说明:照着做即可跑通",children:(0,i.jsx)(h.A,{mode:"left",items:b.map(e=>({dot:(0,i.jsx)(p.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)(k,{children:[(0,i.jsx)(N,{strong:!0,children:"目标:"}),e.goal]}),(0,i.jsxs)(k,{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)(k,{children:[(0,i.jsx)(N,{strong:!0,children:"提示:"}),e.tips]}),(0,i.jsx)(j.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)(k,{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)(k,{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)(k,{children:e("guide.promptRoleDesc")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t.A,{color:"geekblue",children:"config"}),(0,i.jsx)(N,{strong:!0,children:e("guide.projectConfig")}),(0,i.jsx)(k,{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)(k,{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:e("roles.validation")}),(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)(k,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"类型选择 file,处理类型选择“项目事实文件”,绑定招标文件、合同摘要或项目概况。"]}),(0,i.jsxs)(k,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统会从这个角色绑定的文件里抽取工程名称、建设地点、工期、质量目标、范围边界等事实,并把来源带入结构化事实和章节证据。"]}),(0,i.jsxs)(k,{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)(k,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"类型选择 file,处理类型选择“表格数据”,绑定 Excel、CSV、清单表或计划表。"]}),(0,i.jsxs)(k,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统会读取 Sheet、表头、行列和来源范围,把表格数据转换成可引用的结构化资源证据。"]}),(0,i.jsxs)(k,{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)(k,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"先在提示词管理中写好生成规则,例如“必须引用来源、不要写无来源数据、输出正式报告语气”;再创建 prompt 角色,执行类型选择“章节生成”。"]}),(0,i.jsxs)(k,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"系统生成每个章节时会把这个提示词加入 LLM 上下文,用它约束语气、结构、引用方式和禁止事项。"]}),(0,i.jsxs)(k,{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)(k,{children:[(0,i.jsx)(N,{strong:!0,children:"怎么创建:"}),"提示词内容写清楚必须检查的交付要求,例如“不能出现资料未提供、图片引用必须可访问、关键事实必须有来源”;prompt 角色执行类型选择“校验”或“格式化”。"]}),(0,i.jsxs)(k,{children:[(0,i.jsx)(N,{strong:!0,children:"生成时的作用:"}),"生成完成后,系统会结合后台自动规范、证据来源和导出门禁检查文档是否可交付。"]}),(0,i.jsxs)(k,{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)(k,{children:"文件、提示词、角色配置和规范包都来自用户自己创建或上传的内容,生成流程会按当前项目配置读取并参与校验。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"自定义门禁类型会执行",children:(0,i.jsx)(k,{children:"门禁规则由后台根据模板、提示词和角色绑定自动形成,并与系统门禁一起参与生成校验,不需要用户手动维护规范包。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"上传后关注索引状态",children:(0,i.jsx)(k,{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)(k,{children:"生成前会按当前项目召回短期/长期上下文,但它只用于用户偏好、历史纠偏和连续性参考。如果上下文与知识库证据冲突,系统提示词会要求以知识库证据、模板要求和规范包为准。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"自动检索为主",children:(0,i.jsx)(k,{children:"模板章节的查询词、章节目的和必需事实会驱动系统自动检索知识库证据。高级优先证据只是兜底能力,用于必须指定官方资料、图纸或表格的场景,不是日常必填项。"})})}),(0,i.jsx)(d.A,{xs:24,md:8,children:(0,i.jsx)(c.A,{size:"small",title:"增强贡献可追踪",children:(0,i.jsx)(k,{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)(k,{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)(k,{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)(k,{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)(k,{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)(k,{children:"warning 用于提醒用户“文档已经生成,但建议复核”。例如必需事实没有在最佳来源角色中抽到、部分来源需要人工确认、格式或内容有优化建议。warning 会显示在草稿历史和校验详情中,并保留导出能力。"}),(0,i.jsx)(k,{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)(k,{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)(k,{children:"模板运行生成的文档、图片、封面或后处理资源只会登记到生成资源管理页,不会写入 knowledgeBase,也不会建立知识库索引。"}),(0,i.jsx)(k,{children:"这样可以避免模型产物污染事实来源;需要作为资料复用时,应由用户明确上传到知识库。"})]})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsxs)(c.A,{size:"small",title:"资源预览和坏图处理",children:[(0,i.jsx)(k,{children:"资源预览会从全局 generatedDocuments 目录解析文件,不依赖当前页面临时路径。图片下载会识别“image is generating”等占位响应,并校验 PNG/JPEG/WebP 字节,避免把占位文本当成图片保存。"}),(0,i.jsx)(k,{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)(k,{children:"用来告诉系统“必须怎么写、不能怎么写、按什么标准判断”。适合放评分办法、甲方编制要求、攻略写作要求、输出格式要求。生成时会优先作为约束使用。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"项目事实文件",children:(0,i.jsx)(k,{children:"用来告诉系统“真实情况是什么”。适合放项目概况、合同摘要、招标文件关键信息、游戏角色资料、产品资料。事实字段通常从这里抽取。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"表格数据",children:(0,i.jsx)(k,{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)(k,{children:"用来表达空间关系、路线、结构、站位或设计说明。可以是图纸目录、设计说明、路线示意、阵型图说明。没有 CAD 时也可以用文字图纸说明。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"规范文件",children:(0,i.jsx)(k,{children:"用来作为专业依据。适合放国家规范、行业标准、企业标准、攻略结构规范、质量标准。校验和生成时会把它当成依据。"})})}),(0,i.jsx)(d.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",title:"参考资料",children:(0,i.jsx)(k,{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)(a.A,{items:[{key:"warning-export",label:"为什么生成完成后显示 warning,但仍然可以导出?",children:(0,i.jsx)(k,{children:"warning 表示文档已生成,但存在建议复核的问题,例如来源角色不完全匹配、某些事实需要人工确认或格式可优化。它不是失败,也不会阻断导出;真实 blockingIssues 或 error 级门禁问题会作为高风险提示展示,导出后请人工复核。"})},{key:"missing-facts",label:"为什么提示必需事实缺失?",children:(0,i.jsx)(k,{children:"优先检查后台自动规范生成的事实字段、模板章节 requiredFacts 和文件角色绑定。很多情况下不是模型失败,而是资料没有被绑定到正确角色,或字段要求比资料实际内容更严格。"})},{key:"draft-duration",label:"草稿历史里的耗时怎么计算?",children:(0,i.jsx)(k,{children:"耗时使用生成记录的 createdAt 到 completedAt 计算;旧记录或未完成记录会使用 updatedAt 兜底。它用于判断本次生成链路整体成本,包括知识库检索、事实抽取、章节生成、资源处理、校验和格式化。"})},{key:"asset-index",label:"生成资源会如何进入知识库?",children:(0,i.jsx)(k,{children:"生成资源不会自动或手动写入知识库,也不会建立知识库索引,避免生成内容再次被当作事实证据召回。确需复用时,请由用户明确上传到知识库。"})},{key:"context-accuracy",label:"上下文召回会不会影响准确度?",children:(0,i.jsx)(k,{children:"上下文只作为当前项目的偏好、历史纠偏和连续性参考,不作为事实来源。生成和审查提示词都要求:如果上下文与知识库证据、模板要求或后台自动规范冲突,以知识库证据和后台自动规范为准。"})},{key:"priority-evidence",label:"什么时候需要维护高级优先证据?",children:(0,i.jsx)(k,{children:"日常不需要维护。只有当某章必须引用指定官方资料、图纸、表格,或自动检索结果不稳定时,才从知识库搜索页复制文件路径并填入章节高级优先证据。"})}]})}),(0,i.jsx)(a.A,{items:[{key:"prepare",label:e("guide.prepareTitle"),children:(0,i.jsx)(k,{children:e("guide.prepareContent")})},{key:"roles",label:e("guide.rolesTitle"),children:(0,i.jsx)(k,{children:e("guide.rolesContent")})},{key:"template",label:e("guide.templateTitle"),children:(0,i.jsx)(k,{children:e("guide.templateContent")})},{key:"generate",label:e("guide.generateTitle"),children:(0,i.jsx)(k,{children:e("guide.generateContent")})},{key:"qa",label:e("guide.qaTitle"),children:(0,i.jsx)(k,{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,642,636,593,792],()=>e(e.s=34899)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46],{22708:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>U});var o=s(65321),a=s(97109),r=s(79059),i=s(17807),t=s(88762),n=s(68787),c=s(85114),d=s(2256),m=s(38770),h=s(33442),p=s(26171),x=s(11702),y=s(85493),v=s(57271),u=s(7576),j=s(48318),g=s(34052),A=s(63455),f=s(56985),b=s(54746),S=s(29071),w=s(59188),z=s(4216),k=s(13114),C=s(99650),B=s(58209),I=s(76981),T=s(61825),K=s(6578);let P=[{label:"OpenAI 兼容",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"Google",value:"google"},{label:"Ollama",value:"ollama"},{label:"OpenRouter",value:"openrouter"}],E=[{key:"reader",labelKey:"models.tierReader",descKey:"models.tierReaderDesc"},{key:"reasoning",labelKey:"models.tierReasoning",descKey:"models.tierReasoningDesc"},{key:"action",labelKey:"models.tierAction",descKey:"models.tierActionDesc"}],N=[{key:"imageGeneration",label:"图片生成"},{key:"imageUnderstanding",label:"图片理解"},{key:"fileUnderstanding",label:"文件理解"},{key:"audio",label:"音频能力"},{key:"video",label:"视频能力"}];function U(){let e=(0,r.Vr)(),{message:l}=i.A.useApp(),[s,U]=(0,a.useState)(!0),[_,O]=(0,a.useState)([]),[R,F]=(0,a.useState)(null),[H,D]=(0,a.useState)({provider:"transformers-local",model:"BAAI/bge-small-zh-v1.5",dimensions:512}),[W,M]=(0,a.useState)(!1),[G,L]=(0,a.useState)(!1),[X,Z]=(0,a.useState)(null),[V,q]=(0,a.useState)(null),[J,Q]=(0,a.useState)({}),[Y,$]=(0,a.useState)(!1),[ee,el]=(0,a.useState)(!1),[es,eo]=(0,a.useState)(""),[ea,er]=(0,a.useState)(""),[ei,et]=(0,a.useState)(""),[en,ec]=(0,a.useState)(""),[ed,em]=(0,a.useState)("openai"),[eh,ep]=(0,a.useState)(!1),[ex,ey]=(0,a.useState)({}),[ev,eu]=(0,a.useState)(!1),ej=async()=>{U(!0);try{let[e,l,s]=await Promise.all([(0,K.Z3)().catch(()=>[]),(0,K.zr)().catch(()=>null),(0,K.II)().catch(()=>({provider:"transformers-local",model:"BAAI/bge-small-zh-v1.5",dimensions:512}))]);O(e),F(l),D(s)}catch(s){l.error(e("common.error"))}finally{U(!1)}};(0,a.useEffect)(()=>{ej()},[]);let eg=async e=>{el(!0),eo(e.name),er(e.name),et(""),ec(e.baseUrl||""),em(e.protocol||e.detectedProtocol||"openai"),ey(e.capabilities||{});try{let l=await (0,K.Bh)(e.name);et(l.apiKey?"••••••••":""),ec(l.baseUrl||""),ey(l.capabilities||{})}catch(e){}$(!0)},eA=async()=>{if(ea.trim()){eu(!0);try{let s=ee&&ei.includes("•")?void 0:ei||void 0;await (0,K._m)(ea.trim(),{oldName:ee?es:void 0,apiKey:s,baseUrl:en||void 0,protocol:ed,directEndpoint:eh,capabilities:ex}),$(!1),await ej(),l.success(e("common.success"))}catch(s){l.error(e("common.error"))}finally{eu(!1)}}},ef=async s=>{try{await (0,K.h1)(s),await ej(),l.success(e("common.success"))}catch(s){l.error(e("common.error"))}},eb=async s=>{q(s);try{let o=await (0,K.bZ)(s);Q(e=>({...e,[s]:o.success})),l[o.success?"success":"error"](o.success?e("models.connected"):e("models.connectionFailed"))}catch(e){Q(e=>({...e,[s]:!1}))}finally{q(null)}},eS=async(s,o)=>{if(!R)return;let a={...R},r=a[s];if(!o){r.active="",F(a);try{await (0,K.aP)(a)}catch(s){l.error(e("common.error"))}return}let[i,t]=o.includes(":")?o.split(":"):[o,o];r.active=t,r.list.some(e=>e.name===t&&e.provider===i)||r.list.push({name:t,provider:i}),F(a);try{await (0,K.aP)(a)}catch(s){l.error(e("common.error"))}},ew=async()=>{M(!0);try{let s=await (0,K.dd)(H);D(s),Z(null),l.success(e("common.success"))}catch(s){l.error(e("common.error"))}finally{M(!1)}},ez=async()=>{L(!0);try{let s=await (0,K.u6)();Z(s.success),l[s.success?"success":"error"](s.message||(s.success?e("models.connected"):e("models.connectionFailed")))}catch(e){Z(!1)}finally{L(!1)}};return s?(0,o.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,o.jsx)(t.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,o.jsx)(n.A,{size:"small",children:(0,o.jsx)(t.A,{active:!0,paragraph:{rows:6}})}),(0,o.jsx)(n.A,{size:"small",children:(0,o.jsx)(t.A,{active:!0,paragraph:{rows:4}})}),(0,o.jsx)(n.A,{size:"small",children:(0,o.jsx)(t.A,{active:!0,paragraph:{rows:3}})})]}):(0,o.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"pageTitle",children:e("models.title")}),(0,o.jsx)("p",{className:"pageDesc",children:e("models.description")})]}),(0,o.jsx)(c.Ay,{type:"primary",icon:(0,o.jsx)(b.A,{}),onClick:()=>{el(!1),eo(""),er(""),et(""),ec(""),em("openai"),ep(!1),ey({}),$(!0)},children:e("models.addModel")})]}),(0,o.jsx)(n.A,{size:"small",title:"".concat(e("models.modelList")," (").concat(_.length,")"),children:0===_.length?(0,o.jsx)("span",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:e("models.noProviders")}):(0,o.jsx)(d.A,{gutter:[12,12],children:_.map((l,s)=>(0,o.jsx)(m.A,{xs:24,sm:12,lg:8,xl:6,children:(0,o.jsxs)(n.A,{size:"small",hoverable:!0,style:{height:"100%"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,marginBottom:8,minWidth:0},children:[(0,o.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,o.jsx)("div",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.name}),(0,o.jsxs)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:[(0,o.jsx)(S.A,{})," ",l.protocol||l.detectedProtocol||"openai"]})]}),(0,o.jsxs)(h.A,{size:2,children:[(0,o.jsx)(c.Ay,{size:"small",loading:V===l.name,onClick:()=>{eb(l.name)},icon:!0===J[l.name]?(0,o.jsx)(w.A,{style:{color:"var(--colorOk)"}}):!1===J[l.name]?(0,o.jsx)(z.A,{style:{color:"var(--colorDanger)"}}):(0,o.jsx)(k.A,{})}),(0,o.jsx)(c.Ay,{size:"small",icon:(0,o.jsx)(C.A,{}),onClick:()=>{eg(l)}}),(0,o.jsx)(p.A,{title:e("models.deleteProviderConfirm"),onConfirm:()=>{ef(l.name)},children:(0,o.jsx)(c.Ay,{size:"small",danger:!0,icon:(0,o.jsx)(B.A,{})})})]})]}),(0,o.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,o.jsxs)("span",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:[(0,o.jsx)(I.A,{})," ",l.hasApiKey?"••••••••":"—"]}),l.baseUrl&&(0,o.jsxs)("span",{style:{fontSize:12,color:"var(--colorTextSecondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:l.baseUrl,children:[(0,o.jsx)(T.A,{})," ",l.baseUrl]}),(0,o.jsx)(h.A,{size:4,wrap:!0,children:N.filter(e=>{var s;return null==(s=l.capabilities)?void 0:s[e.key]}).map(e=>(0,o.jsx)(x.A,{color:"purple",style:{margin:0,fontSize:10,lineHeight:"16px"},children:e.label},e.key))})]})]})},l.name))})}),(0,o.jsxs)(n.A,{size:"small",title:e("models.embeddingConfig"),children:[(0,o.jsx)(y.A,{type:"info",showIcon:!0,message:e("models.embeddingHint"),style:{marginBottom:16}}),(0,o.jsxs)(d.A,{gutter:[12,12],children:[(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.embeddingProvider")}),(0,o.jsx)(v.A,{value:H.provider,style:{width:"100%"},options:[{label:"本地语义模型(推荐)",value:"transformers-local"},{label:"外部 Embedding(高级)",value:"openai-compatible"}],onChange:e=>D(l=>({...l,provider:e,model:"transformers-local"===e?l.model||"BAAI/bge-small-zh-v1.5":l.model,dimensions:"transformers-local"===e?512:l.dimensions||1024}))})]}),"openai-compatible"===H.provider&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:"Base URL"}),(0,o.jsx)(u.A,{value:H.baseUrl,onChange:e=>D(l=>({...l,baseUrl:e.target.value})),placeholder:"http://localhost:11434/v1"})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.model")}),(0,o.jsx)(u.A,{value:H.model,onChange:e=>D(l=>({...l,model:e.target.value})),placeholder:"bge-m3"})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.apiKey")}),(0,o.jsx)(u.A.Password,{value:H.apiKey,onFocus:()=>{var e;(null==(e=H.apiKey)?void 0:e.includes("•"))&&D(e=>({...e,apiKey:""}))},onChange:e=>D(l=>({...l,apiKey:e.target.value})),placeholder:e("models.optional")}),H.hasApiKey&&(0,o.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginTop:4},children:e("models.embeddingApiKeyHint")})]})]}),"transformers-local"===H.provider&&(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.model")}),(0,o.jsx)(u.A,{value:H.model,onChange:e=>D(l=>({...l,model:e.target.value})),placeholder:"BAAI/bge-small-zh-v1.5"})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.dimensions")}),(0,o.jsx)(j.A,{style:{width:"100%"},min:1,value:H.dimensions,onChange:e=>D(l=>({...l,dimensions:Number(e||("transformers-local"===l.provider?512:1024))}))})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.status")}),(0,o.jsxs)(h.A,{children:[(0,o.jsx)(x.A,{color:"blue",children:"transformers-local"===H.provider?"本地语义模型":e("models.openAICompatible")}),!0===X&&(0,o.jsx)(x.A,{color:"success",children:e("models.connected")}),!1===X&&(0,o.jsx)(x.A,{color:"error",children:e("models.connectionFailed")})]})]})]}),(0,o.jsxs)(h.A,{style:{marginTop:16},children:[(0,o.jsx)(c.Ay,{type:"primary",loading:W,onClick:()=>{ew()},children:e("models.saveEmbedding")}),(0,o.jsx)(c.Ay,{loading:G,onClick:()=>{ez()},children:e("models.testEmbedding")})]})]}),R&&(0,o.jsx)(n.A,{size:"small",title:e("models.modelTiers"),children:(0,o.jsx)(d.A,{gutter:[12,12],children:E.map(l=>{let{key:s,labelKey:a,descKey:r}=l,i=R[s],t=i.list.map(e=>({label:"".concat(e.provider," / ").concat(e.name),value:"".concat(e.provider,":").concat(e.name)})),c=_.filter(e=>!i.list.some(l=>l.provider===e.name)).map(e=>({label:e.name,value:"".concat(e.name,":").concat(e.name)})),d=i.active?i.list.find(e=>e.name===i.active):null;return(0,o.jsx)(m.A,{xs:24,lg:8,children:(0,o.jsxs)(n.A,{size:"small",title:(0,o.jsx)("span",{style:{fontSize:14},children:e(a)}),style:{height:"100%"},children:[(0,o.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)",marginBottom:8,lineHeight:1.5},children:e(r)}),(0,o.jsx)(v.A,{value:i.active?"".concat((null==d?void 0:d.provider)||"",":").concat(i.active):void 0,onChange:e=>{eS(s,e)},allowClear:!0,placeholder:e("models.selectModelPlaceholder"),style:{width:"100%"},options:[...t,...c]}),d&&(()=>{let e=_.find(e=>e.name===d.provider);return(0,o.jsxs)("div",{style:{marginTop:12,padding:"8px 12px",background:"var(--colorBgElevated)",borderRadius:6,border:"1px solid var(--colorBorderSecondary)",display:"flex",alignItems:"center",gap:8},children:[(0,o.jsx)(k.A,{style:{color:"var(--colorAccent)",fontSize:14,flexShrink:0}}),(0,o.jsx)("span",{style:{fontSize:12,fontWeight:500,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.provider}),(null==e?void 0:e.capabilities)&&N.filter(l=>e.capabilities[l.key]).length>0&&(0,o.jsx)(h.A,{size:4,wrap:!0,style:{flexShrink:0},children:N.filter(l=>e.capabilities[l.key]).slice(0,2).map(e=>(0,o.jsx)(x.A,{color:"purple",style:{margin:0,fontSize:10,lineHeight:"16px"},children:e.label},e.key))}),(0,o.jsx)(x.A,{color:"blue",style:{margin:0,fontSize:10,lineHeight:"18px",flexShrink:0},children:"激活"})]})})()]})},s)})})}),(0,o.jsx)(g.A,{title:ee?e("models.editModel"):e("models.addModel"),open:Y,onClose:()=>$(!1),width:800,maskClosable:!1,style:{borderRadius:"12px 0 0 12px"},styles:{body:{padding:"16px 24px"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,o.jsx)(c.Ay,{type:"primary",loading:ev,onClick:()=>{eA()},children:e("common.save")}),children:(0,o.jsxs)(A.A,{layout:"vertical",children:[(0,o.jsx)(A.A.Item,{label:e("models.modelName"),children:(0,o.jsx)(u.A,{value:ea,onChange:e=>er(e.target.value),placeholder:e("models.modelNamePlaceholder")})}),(0,o.jsx)(A.A.Item,{label:e("models.apiKey"),help:ee?e("models.apiKeyEditHint"):void 0,children:(0,o.jsx)(u.A.Password,{value:ei,onFocus:()=>{ee&&ei.includes("•")&&et("")},onChange:e=>et(e.target.value),placeholder:ee?e("models.apiKeyEditPlaceholder"):"sk-..."})}),(0,o.jsx)(A.A.Item,{label:e("models.baseUrl"),children:(0,o.jsx)(u.A,{value:en,onChange:e=>ec(e.target.value),placeholder:"https://api.openai.com/v1"})}),(0,o.jsx)(A.A.Item,{label:e("models.protocol"),children:(0,o.jsx)(v.A,{value:ed,onChange:em,options:P})}),(0,o.jsx)(A.A.Item,{label:"直连端点",children:(0,o.jsx)(f.A,{checked:eh,onChange:e=>ep(e.target.checked),children:"Base URL 是完整接口地址"})}),(0,o.jsx)(A.A.Item,{label:"多模态能力",children:(0,o.jsx)(f.A.Group,{value:N.filter(e=>ex[e.key]).map(e=>e.key),options:N.map(e=>({label:e.label,value:e.key})),onChange:e=>ey(Object.fromEntries(N.map(l=>[l.key,e.includes(l.key)])))})})]})})]})}},77305:(e,l,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/models",function(){return s(22708)}])}},e=>{e.O(0,[433,787,576,195,985,455,938,647,636,593,792],()=>e(e.s=77305)),_N_E=e.O()}]);
|
|
File without changes
|