@customize-agent/server 4.1.7 → 4.1.9
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 +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/chunks/1924.js +85 -72
- package/.next/server/chunks/5840.js +1 -1
- package/.next/server/chunks/8203.js +1 -1
- package/.next/server/chunks/8661.js +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/documents/export.js +4 -4
- package/.next/server/pages/api/kb/evaluate.js +10 -0
- package/.next/server/pages/api/kb/evaluate.js.nft.json +1 -0
- package/.next/server/pages/api/kb/files/reindex.js +1 -1
- package/.next/server/pages/asset-library.html +1 -1
- package/.next/server/pages/document-roles.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/guide.html +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/prompt.html +1 -1
- package/.next/server/pages/settings.html +1 -1
- package/.next/server/pages/system/logs.html +1 -1
- package/.next/server/pages-manifest.json +35 -34
- package/.next/static/{nK9OeE3ShyoUYlQv98vDl → 36CQbX6U97QG4cfpNGQMs}/_buildManifest.js +1 -1
- package/.next/static/chunks/pages/knowledge/files-3b5d049efb076e4b.js +1 -0
- package/package.json +13 -13
- package/scripts/kb-index-worker.cjs +9 -7
- package/.next/package.json +0 -1
- package/.next/static/chunks/pages/knowledge/files-1717b23d66330620.js +0 -1
- /package/.next/static/{nK9OeE3ShyoUYlQv98vDl → 36CQbX6U97QG4cfpNGQMs}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=8644,a.ids=[8644],a.modules={15751:a=>{a.exports=require("xlsx")},16006:(a,b,c)=>{c.d(b,{j:()=>e});var d=c(91879);function e(a,b){return async function(c,e){try{await b(c,e)}catch(g){let f=(0,d.wF)({source:a,functionName:b.name||"anonymous",error:g,req:c});console.error(`[${a}]`,f.id,g),e.headersSent||e.status(500).json({error:g instanceof Error?g.message:"Internal server error",requestId:f.id})}}}(0,d.mG)()},19898:a=>{a.exports=require("@customize-agent/knowledge")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},48161:a=>{a.exports=require("node:os")},73024:a=>{a.exports=require("node:fs")},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},83142:a=>{a.exports=import("marked")},83237:a=>{a.exports=import("playwright")},83258:(a,b,c)=>{c.r(b),c.d(b,{config:()=>af,default:()=>ae,handler:()=>ah});var d={};c.r(d),c.d(d,{__documentExportTest__:()=>aa,config:()=>u,default:()=>ab});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(31421),j=c(73024),k=c(48161),l=c(76760);let m=require("node:url"),n=require("node:util"),o=require("jszip");var p=c.n(o),q=c(48661),r=c(44533),s=c(91879),t=c(16006);let u={api:{bodyParser:{sizeLimit:"50mb"},responseLimit:!1}};function v(a){return a.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""")}let w=(0,n.promisify)(i.execFile),x={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml"};function y(a){return x[l.extname(a).toLowerCase()]||""}function z(a,b){let c=l.relative(b,a);return!!c&&!c.startsWith("..")&&!l.isAbsolute(c)}function A(a,b=(0,r.aY)()){if(!a||/^(?:https?:|data:|file:|blob:|#)/iu.test(a))return null;let c=function(a){try{return decodeURIComponent(a.split(/[?#]/u)[0]||a)}catch{return""}}(a);if(!c||l.isAbsolute(c))return null;let d=l.resolve(b,"knowledgeBase"),e=l.resolve((0,q.Gl)(b),"assets");return[c.startsWith("generatedDocuments/assets/")?l.resolve(e,c.replace(/^generatedDocuments\/assets\//u,"")):"",l.resolve(d,c)].filter(Boolean).find(a=>{let b=l.resolve(a);return(z(b,d)||z(b,e))&&!!y(b)&&j.existsSync(b)&&j.statSync(b).isFile()})||null}function B(a,b=(0,r.aY)()){let c=new Map,d=0;return a.replace(/<img\b([^>]*?)\bsrc=["']([^"']+)["']([^>]*)>/giu,(a,e,f,g)=>{let h=A(f,b);if(!h)return a;let i=j.statSync(h);if(i.size>8388608||d+i.size>0x2000000)return a;let k=c.get(h);return k||(k=`data:${y(h)};base64,${j.readFileSync(h).toString("base64")}`,c.set(h,k),d+=i.size),`<img${e}src="${k}"${g}>`})}function C(a){return/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/u.test(a.trim())}function D(a){let b=a.trim();return!(!b||/^#{1,6}\s+/u.test(b)||C(b))&&(b.match(/(?<!\\)\|/gu)||[]).length>=1}function E(a){return a.trim().replace(/^\|/u,"").replace(/\|$/u,"").trim().split(/(?<!\\)\|/u).map(a=>a.replace(/\\\|/gu,"|").trim())}function F(a,b){let c=a.slice(0,b);for(a.length>b&&b>0&&(c[b-1]=[c[b-1],...a.slice(b)].filter(Boolean).join(" | "));c.length<b;)c.push("");return`| ${c.map(a=>a.replace(/\|/gu,"\\|")).join(" | ")} |`}function G(a){if(2===a)return["信息项","内容"];let b=["项目","内容","备注","说明"];return Array.from({length:a},(a,c)=>b[c]||`列${c+1}`)}function H(a){return function(a){let b=a.replace(/\r?\n/gu,"\n").split("\n"),c=[];for(let a=0;a<b.length;){let d=b[a]||"",e=d.replace(/([^|\n])\|\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/u,"$1"),f=b[a+1]?.trim()===""?a+2:a+1,g=b[f];if(D(d)&&void 0!==g&&C(g)){let e=E(d),h=E(g).length,i=[],j=f+1;for(;j<b.length;){let a=b[j]||"";if(!D(a))break;i.push(E(a)),j+=1}let k=Math.max(2,e.length,h,...i.map(a=>a.length));for(c.length>0&&c[c.length-1]?.trim()&&c.push(""),c.push(F(e,k)),c.push(`| ${Array.from({length:k},()=>"---").join(" | ")} |`),a=f+1;a<b.length;){let d=b[a]||"";if(!D(d))break;c.push(F(E(d),k)),a+=1}a<b.length&&b[a]?.trim()&&c.push("");continue}let h=D(d)?function(a,b){let c=[],d=b;for(;d<a.length&&D(a[d]||"");)c.push(a[d]||""),d+=1;let e=Math.max(...c.map(a=>E(a).length),0);return c.length<2||e<2?null:{rows:c,columns:e,next:d}}(b,a):null;if(h){for(let a of(c.length>0&&c[c.length-1]?.trim()&&c.push(""),c.push(F(G(h.columns),h.columns)),c.push(`| ${Array.from({length:h.columns},()=>"---").join(" | ")} |`),h.rows))c.push(F(E(a),h.columns));(a=h.next)<b.length&&b[a]?.trim()&&c.push("");continue}if(C(d)){let e=function(a,b){let c=[],d=b;for(;d<a.length&&D(a[d]||"");)c.push(a[d]||""),d+=1;return{rows:c,next:d}}(b,a+1);if(e.rows.length>0){let f=Math.max(2,E(d).length,...e.rows.map(a=>E(a).length));for(let a of(c.length>0&&c[c.length-1]?.trim()&&c.push(""),c.push(F(G(f),f)),c.push(`| ${Array.from({length:f},()=>"---").join(" | ")} |`),e.rows))c.push(F(E(a),f));(a=e.next)<b.length&&b[a]?.trim()&&c.push("");continue}}c.push(e),a+=1}return c.join("\n").replace(/\n{3,}/gu,"\n\n")}((function(a){let b=a.trim(),c=/^```(?:markdown|md)?\s*\n([\s\S]*?)\n```\s*$/iu.exec(b);return c?c[1].trim():a})(a).replace(/m\s*<sup>\s*2\s*<\/sup>/giu,"m\xb2").replace(/m\s*<sup>\s*3\s*<\/sup>/giu,"m\xb3").replace(/m\s*\^\s*2/giu,"m\xb2").replace(/m\s*\^\s*3/giu,"m\xb3").replace(/㎡/gu,"m\xb2").replace(/㎥/gu,"m\xb3").replace(/(?<=\d)m\s*2(?![\p{L}\p{N}_])/giu,"m\xb2").replace(/(?<=\d)m\s*3(?![\p{L}\p{N}_])/giu,"m\xb3").replace(/(?<![\p{L}\p{N}_])m\s*2(?![\p{L}\p{N}_])/giu,"m\xb2").replace(/(?<![\p{L}\p{N}_])m\s*3(?![\p{L}\p{N}_])/giu,"m\xb3"))}function I(a){return H(a).replace(/!\[[^\]]*\]\([^)]*\)/gu,"").replace(/\[([^\]]+)\]\([^)]*\)/gu,"$1").replace(/[*_`]/gu,"").replace(/<br\s*\/?>/giu,"\n").replace(/<[^>]+>/gu,"").trim()}function J(a,b){let c=/([\d.]+)\s*(pt|px)?/iu.exec(a||"");if(!c)return b;let d=Number(c[1]);return Number.isFinite(d)?c[2]?.toLowerCase()==="px"?.75*d:d:b}function K(a,b){return`${J(a,b)}pt`}function L(a,b){let c=/([\d.]+)\s*(cm|mm|in|pt)?/iu.exec(a||"");if(!c)return Math.round(567*b);let d=Number(c[1]);if(!Number.isFinite(d))return Math.round(567*b);let e=(c[2]||"cm").toLowerCase();return"mm"===e?Math.round(56.7*d):"in"===e?Math.round(1440*d):"pt"===e?Math.round(20*d):Math.round(567*d)}function M(a){let b=R(a),c=J(b.bodySize,14),d=J(b.titleSize,16),e=J(b.lineHeight,22);return{...b,bodyPt:c,titlePt:d,linePt:e,bodyHalfPoints:Math.round(2*c),titleHalfPoints:Math.round(2*d),lineTwips:Math.round(20*e),fontEastAsia:"宋体",fontAscii:"SimSun",bodyCss:`${c}pt`,titleCss:`${d}pt`,lineCss:`${e}pt`}}function N(a,b={}){if(b.pageBreak)return'<w:p><w:r><w:br w:type="page"/></w:r></w:p>';let c=[b.indentLeft?`w:left="${b.indentLeft}"`:"",b.firstLine?`w:firstLine="${b.firstLine}"`:"",b.hanging?`w:hanging="${b.hanging}"`:""].filter(Boolean).join(" "),d=[b.styleId?`<w:pStyle w:val="${v(b.styleId)}"/>`:"",b.numbering?`<w:numPr><w:ilvl w:val="${b.numbering.level}"/><w:numId w:val="${b.numbering.numId}"/></w:numPr>`:"",b.keepNext?"<w:keepNext/>":"",`<w:spacing w:line="${b.line??440}" w:lineRule="exact" w:before="${b.spacingBefore??0}" w:after="${b.spacingAfter??120}"/>`,c?`<w:ind ${c}/>`:"",b.align?`<w:jc w:val="${b.align}"/>`:"","number"==typeof b.outlineLevel?`<w:outlineLvl w:val="${b.outlineLevel}"/>`:""].filter(Boolean).join("");return`<w:p><w:pPr>${d}</w:pPr>${function(a,b={}){let c=b.fontEastAsia||"宋体",d=b.fontAscii||"SimSun",e=[`<w:rFonts w:ascii="${v(d)}" w:hAnsi="${v(d)}" w:eastAsia="${v(c)}" w:cs="${v(d)}"/>`,b.bold?"<w:b/>":"",b.size?`<w:sz w:val="${b.size}"/><w:szCs w:val="${b.size}"/>`:""].filter(Boolean).join("");return`<w:r><w:rPr>${e}</w:rPr><w:t xml:space="preserve">${v(a)}</w:t></w:r>`}(a,b)}</w:p>`}async function O(a,b,c,d=[]){a.folder("word")?.file("styles.xml",function(a){let b=M(a),c=`w:ascii="${v(b.fontAscii)}" w:hAnsi="${v(b.fontAscii)}" w:eastAsia="${v(b.fontEastAsia)}" w:cs="${v(b.fontAscii)}"`,d=(a,d,e,f,g,h,i)=>`<w:style w:type="paragraph" w:styleId="${a}"><w:name w:val="${d}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="${9+f}"/><w:qFormat/><w:rPr><w:b/><w:rFonts ${c}/><w:sz w:val="${e}"/><w:szCs w:val="${e}"/></w:rPr><w:pPr><w:keepNext/><w:keepLines/><w:outlineLvl w:val="${f}"/><w:spacing w:line="${b.lineTwips}" w:lineRule="exact" w:before="${g}" w:after="${h}"/>${i?`<w:jc w:val="${i}"/>`:""}</w:pPr></w:style>`;return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts ${c}/><w:sz w:val="${b.bodyHalfPoints}"/><w:szCs w:val="${b.bodyHalfPoints}"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:line="${b.lineTwips}" w:lineRule="exact" w:after="120"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/><w:rPr><w:rFonts ${c}/><w:sz w:val="${b.bodyHalfPoints}"/><w:szCs w:val="${b.bodyHalfPoints}"/></w:rPr><w:pPr><w:spacing w:line="${b.lineTwips}" w:lineRule="exact" w:after="120"/></w:pPr></w:style>${d("Heading1","heading 1",Math.max(b.titleHalfPoints+4,36),0,260,180,"center")}${d("Heading2","heading 2",Math.max(b.titleHalfPoints,32),1,180,100)}${d("Heading3","heading 3",Math.max(b.bodyHalfPoints,28),2,120,80)}<w:style w:type="paragraph" w:styleId="ListParagraph"><w:name w:val="List Paragraph"/><w:basedOn w:val="Normal"/><w:uiPriority w:val="34"/><w:qFormat/><w:pPr><w:ind w:left="720" w:hanging="360"/></w:pPr></w:style></w:styles>`}(c)),a.folder("word")?.file("numbering.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:numbering xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:abstractNum w:abstractNumId="1"><w:multiLevelType w:val="hybridMultilevel"/><w:lvl w:ilvl="0"><w:start w:val="1"/><w:numFmt w:val="decimal"/><w:lvlText w:val="%1."/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="720" w:hanging="360"/></w:pPr></w:lvl><w:lvl w:ilvl="1"><w:start w:val="1"/><w:numFmt w:val="decimal"/><w:lvlText w:val="%1.%2"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="1080" w:hanging="420"/></w:pPr></w:lvl><w:lvl w:ilvl="2"><w:start w:val="1"/><w:numFmt w:val="decimal"/><w:lvlText w:val="%1.%2.%3"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="1440" w:hanging="480"/></w:pPr></w:lvl></w:abstractNum><w:num w:numId="1"><w:abstractNumId w:val="1"/></w:num></w:numbering>'),a.folder("word")?.file("settings.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:settings xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:updateFields w:val="true"/><w:compat><w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="15"/></w:compat></w:settings>'),a.folder("word")?.file("fontTable.xml",function(a){let b=M(a);return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:fonts xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:font w:name="${v(b.fontEastAsia)}"><w:charset w:val="86"/><w:family w:val="roman"/></w:font><w:font w:name="${v(b.fontAscii)}"><w:family w:val="roman"/></w:font></w:fonts>`}(c)),a.folder("docProps")?.file("core.xml",function(a){let b=new Date().toISOString();return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title>${v(a)}</dc:title><dc:creator>Customize Agent</dc:creator><cp:lastModifiedBy>Customize Agent</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">${b}</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">${b}</dcterms:modified></cp:coreProperties>`}(b)),a.folder("docProps")?.file("app.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Customize Agent</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>1.0</AppVersion></Properties>');let e=a.folder("word")?.folder("media");for(let a of d)e?.file(a.fileName,a.buffer);let f=a.file("word/_rels/document.xml.rels"),g=f?await f.async("string"):'<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>';for(let[a,b,c]of[["rStyle","http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"],["rNumbering","http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"],["rSettings","http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"],["rFontTable","http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"]])g.includes(b)||(g=g.replace("</Relationships>",`<Relationship Id="${a}" Type="${b}" Target="${c}"/></Relationships>`));for(let a of d)g.includes(`Id="${a.relationshipId}"`)||(g=g.replace("</Relationships>",`<Relationship Id="${a.relationshipId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/${a.fileName}"/></Relationships>`));a.folder("word")?.folder("_rels")?.file("document.xml.rels",g);let h=a.file("_rels/.rels"),i=h?await h.async("string"):'<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/></Relationships>';i.includes("metadata/core-properties")||(i=i.replace("</Relationships>",'<Relationship Id="rCore" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/></Relationships>')),i.includes("extended-properties")||(i=i.replace("</Relationships>",'<Relationship Id="rApp" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/></Relationships>')),a.folder("_rels")?.file(".rels",i);let j=a.file("[Content_Types].xml"),k=j?await j.async("string"):'<?xml version="1.0" encoding="UTF-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/></Types>';for(let a of new Set(d.map(a=>l.extname(a.fileName).slice(1).toLowerCase()).filter(Boolean))){let b="jpg"===a||"jpeg"===a?"image/jpeg":"png"===a?"image/png":"gif"===a?"image/gif":"webp"===a?"image/webp":void 0;b&&!k.includes(`Extension="${a}"`)&&(k=k.replace("</Types>",`<Default Extension="${a}" ContentType="${b}"/></Types>`))}for(let[a,b]of[["/word/styles.xml","application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"],["/word/numbering.xml","application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"],["/word/settings.xml","application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"],["/word/fontTable.xml","application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"],["/docProps/core.xml","application/vnd.openxmlformats-package.core-properties+xml"],["/docProps/app.xml","application/vnd.openxmlformats-officedocument.extended-properties+xml"]])k.includes(`PartName="${a}"`)||(k=k.replace("</Types>",`<Override PartName="${a}" ContentType="${b}"/></Types>`));a.file("[Content_Types].xml",k)}async function P(a,b,c,d,e=process.cwd()){let f={projectRoot:e,images:[]},g=function(a,b,c){let d=M(b),e=d.titleHalfPoints,f=d.bodyHalfPoints,g=H(a).replace(/<div class="page-break"><\/div>/gu,"\n[[PAGE_BREAK]]\n").split("\n"),h=[],i=!1,k=!1,m=!1;for(let a=0;a<g.length;){var n;let b=g[a].trim();if(!b){a+=1;continue}if(/<div\s+class=["']document-cover["']\s*>/iu.test(b)){k=!0,a+=1;continue}if(k&&/^<\/div>$/iu.test(b)){k=!1,a+=1;continue}if("[[PAGE_BREAK]]"===b){i=!1,k=!1,h.push(N("",{pageBreak:!0})),a+=1;continue}if(k){let c=I(b.replace(/^#\s+/u,""));c&&h.push(N(c,{bold:!0,size:Math.max(e+8,44),line:Math.round(1.15*d.lineTwips),fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,align:"center",spacingBefore:360,spacingAfter:220})),a+=1;continue}let o=c?function(a,b){let c=/!\[([^\]]*)\]\(([^)]+)\)/u.exec(a);if(!c)return null;let d=A(c[2].trim(),b.projectRoot);if(!d)return null;let e=j.readFileSync(d),f=y(d);if(!f||"image/svg+xml"===f||e.length>8388608)return null;let g=b.images.length+1,h=l.extname(d).toLowerCase()||".png",i=function(a,b){if("image/png"===b&&a.length>=24&&"PNG"===a.toString("ascii",1,4))return{width:a.readUInt32BE(16),height:a.readUInt32BE(20)};if("image/jpeg"===b){let b=2;for(;b+9<a.length&&255===a[b];){let c=a[b+1],d=a.readUInt16BE(b+2);if(c>=192&&c<=195)return{height:a.readUInt16BE(b+5),width:a.readUInt16BE(b+7)};b+=2+d}}return{width:640,height:360}}(e,f),k=Math.min(1,620/Math.max(i.width,1)),m={relationshipId:`rImage${g}`,fileName:`image${g}${h}`,buffer:e,contentType:f,widthEmu:Math.round(i.width*k*9525),heightEmu:Math.round(i.height*k*9525),altText:c[1]||`image${g}`};return b.images.push(m),m}(b,c):null;if(o){h.push(`<w:p><w:pPr><w:jc w:val="center"/><w:spacing w:after="120"/></w:pPr><w:r><w:drawing><wp:inline xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"><wp:extent cx="${o.widthEmu}" cy="${o.heightEmu}"/><wp:docPr id="${o.relationshipId.replace(/\D/gu,"")||"1"}" name="${v(o.altText||o.fileName)}"/><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="0" name="${v(o.fileName)}"/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${o.relationshipId}" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${o.widthEmu}" cy="${o.heightEmu}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r></w:p>`),a+=1;continue}let p=function(a,b){let c=a[b+1]?.trim()===""?b+2:b+1;if(c>=a.length||!D(a[b]||"")||!C(a[c]||""))return null;let d=E(a[b]||"").map(a=>I(a)),e=E(a[c]||"").length,f=[],g=c+1;for(;g<a.length&&D(a[g]||"");)f.push(E(a[g]||"").map(a=>I(a))),g+=1;let h=Math.max(2,d.length,e,...f.map(a=>a.length)),i=a=>{let b=a.slice(0,h);for(a.length>h&&h>0&&(b[h-1]=[b[h-1],...a.slice(h)].filter(Boolean).join(" | "));b.length<h;)b.push("");return b};return{rows:[i(d),...f.map(i)],next:g}}(g,a);if(p){h.push(function(a,b){let c=Math.max(1,...a.map(a=>a.length)),d=Math.floor(9638/c),e=Array.from({length:c},(a,b)=>b===c-1?9638-d*(c-1):d),f=`<w:tblGrid>${e.map(a=>`<w:gridCol w:w="${a}"/>`).join("")}</w:tblGrid>`;return`<w:tbl><w:tblPr><w:tblW w:w="9638" w:type="dxa"/><w:tblLook w:firstRow="1" w:noHBand="0"/><w:tblBorders><w:top w:val="single" w:sz="6" w:color="666666"/><w:left w:val="single" w:sz="6" w:color="666666"/><w:bottom w:val="single" w:sz="6" w:color="666666"/><w:right w:val="single" w:sz="6" w:color="666666"/><w:insideH w:val="single" w:sz="4" w:color="666666"/><w:insideV w:val="single" w:sz="4" w:color="666666"/></w:tblBorders></w:tblPr>${f}${a.map((a,c)=>`<w:tr>${e.map((d,e)=>{let f=a[e]||"";return`<w:tc><w:tcPr><w:tcW w:w="${d}" w:type="dxa"/><w:tcMar><w:top w:w="80" w:type="dxa"/><w:left w:w="120" w:type="dxa"/><w:bottom w:w="80" w:type="dxa"/><w:right w:w="120" w:type="dxa"/></w:tcMar>${0===c?'<w:shd w:val="clear" w:fill="F3F4F6"/>':""}</w:tcPr>${N(f,{bold:0===c,size:b.bodyHalfPoints,line:b.lineTwips,fontEastAsia:b.fontEastAsia,fontAscii:b.fontAscii,spacingAfter:0,align:0===c?"center":"left"})}</w:tc>`}).join("")}</w:tr>`).join("")}</w:tbl>`}(p.rows,d),N("",{spacingAfter:80,line:d.lineTwips})),a=p.next;continue}let q=/^(#{1,4})\s+(.+)$/u.exec(b);if(q){let b=I(q[2]);i="目录"===b,h.push((n=q[1].length,2===n?N(b,{styleId:"Heading1",outlineLevel:0,bold:!0,size:Math.max(d.titleHalfPoints+4,36),line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,align:"center",spacingBefore:260,spacingAfter:180,keepNext:!0}):3===n?N(b,{styleId:"Heading2",outlineLevel:1,bold:!0,size:Math.max(d.titleHalfPoints,32),line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,spacingBefore:180,spacingAfter:100,keepNext:!0}):N(b,{styleId:"Heading3",outlineLevel:2,bold:!0,size:Math.max(d.bodyHalfPoints,28),line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,spacingBefore:120,spacingAfter:80,keepNext:!0}))),i&&!m&&(h.push(`<w:p><w:pPr><w:spacing w:line="${d.lineTwips}" w:lineRule="exact" w:after="120"/></w:pPr><w:r><w:fldChar w:fldCharType="begin"/></w:r><w:r><w:instrText xml:space="preserve">TOC \\o "1-3" \\h \\z \\u</w:instrText></w:r><w:r><w:fldChar w:fldCharType="separate"/></w:r><w:r><w:t>请在 Word 中右键更新目录</w:t></w:r><w:r><w:fldChar w:fldCharType="end"/></w:r></w:p>`),m=!0),a+=1;continue}let r=I(b),s=function(a){let b=/^\s*(\d+(?:\.\d+){0,2})([.、])\s+(.+)$/u.exec(a);return b?{level:Math.min(b[1].split(".").length-1,2),marker:`${b[1]}${b[2]}`,text:I(b[3])}:null}(b),t=function(a){let b=/^\s*[-*+]\s+(.+)$/u.exec(a);return b?I(b[1]):null}(b);if(!i&&s){let b=0===s.level?720:1===s.level?1080:1440,c=0===s.level?360:1===s.level?420:480;h.push(N(`${s.marker} ${s.text}`,{styleId:"ListParagraph",numbering:{numId:1,level:s.level},size:f,line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,indentLeft:b,hanging:c,spacingAfter:60})),a+=1;continue}if(!i&&t){h.push(N(`• ${t}`,{styleId:"ListParagraph",size:f,line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,indentLeft:720,hanging:360,spacingAfter:60})),a+=1;continue}let u=/^\*\*[^*]+\*\*\s*[::]?\s*$/u.test(b)||/^([一二三四五六七八九十]+)/u.test(r)||/^[一二三四五六七八九十]+、/u.test(r);h.push(i?function(a,b){let c=/^\s*\d+\.\d+\s+\S/u.test(a);return N(I(a),{bold:!c,size:b.bodyHalfPoints,line:b.lineTwips,fontEastAsia:b.fontEastAsia,fontAscii:b.fontAscii,spacingAfter:c?30:80,indentLeft:420*!!c,align:"left"})}(b,d):N(r,{bold:u,size:f,line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,align:"both",firstLine:560*!u,spacingBefore:80*!!u})),a+=1}return h.join("")}(b,c,f);if(d&&j.existsSync(d)){let b=await p().loadAsync(j.readFileSync(d)),e=b.file("word/document.xml");if(e){let d=await e.async("string");return b.file("word/document.xml",d.replace(/\{\{title\}\}/gu,v(a)).replace(/\{\{content\}\}/gu,g)),await O(b,a,c,f.images),b.generateAsync({type:"nodebuffer"})}}let h=c?.page||{},i=new(p());return i.folder("word")?.file("document.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:body>${g}<w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="${L(h.marginTop,2.5)}" w:right="${L(h.marginRight,2)}" w:bottom="${L(h.marginBottom,2)}" w:left="${L(h.marginLeft,2)}"/></w:sectPr></w:body></w:document>`),await O(i,a,c,f.images),i.generateAsync({type:"nodebuffer"})}function Q(a,b){return a&&/^[\w\s\u4e00-\u9fa5,"'().-]+$/u.test(a)?a:b}function R(a){let b=a?.page||{},c=a?.typography||{},d=Q(b.paper,"A4"),e=Q(b.marginTop,"24mm"),f=Q(b.marginRight,"18mm"),g=Q(b.marginBottom,"22mm"),h=Q(b.marginLeft,"18mm"),i=Q(c.fontFamily,"SimSun, 宋体, serif"),j=K(c.lineHeight,22);return{paper:d,marginTop:e,marginRight:f,marginBottom:g,marginLeft:h,fontFamily:i,lineHeight:j,titleSize:K(c.titleSize,16),bodySize:K(c.bodySize,14)}}function S(a){return a.replace(/(<h2[^>]*>\s*目录\s*<\/h2>)([\s\S]*?)(<div class="page-break"><\/div>)/u,(a,b,c,d)=>{let e=c.replace(/<ol>\s*([\s\S]*?)\s*<\/ol>/u,(a,b)=>b).replace(/<li>\s*([^<]+?)\s*<\/li>/gu,"<p>$1</p>").replace(/<p>(?:\s| | )*(\d+\.\d+\s+[^<]+)<\/p>/giu,'<p class="toc-section">$1</p>').replace(/<p>(?!(?:\s| | )*<\/p>|(?:\s| | )*\d+\.\d+\s)([\s\S]*?)<\/p>/giu,'<p class="toc-chapter">$1</p>');return`<section class="document-toc">${b}${e}</section>${d}`})}function T(a){let b=a.message.trim();return!/^(事实冲突|必需章节缺失):/u.test(b)&&/出现禁用文本\s*(资料未提供|占位|TODO|TBD)|正文包含.*(资料未提供|占位)|图片、地图或附件引用路径明显无效|无效路径|表格语法错误|临时远程生成 URL|提示词全文|内部错误|生成未完成|低于目标页数|低于目标字数|文档预算未达成|正文篇幅低于目标|缺少规划小节|缺少必要的正式表格|正文缺少章节标题/iu.test(b)}function U(a){return{chars:a.trim().length,h2:(a.match(/^##\s+/gmu)||[]).length,h3:(a.match(/^###\s+/gmu)||[]).length,tables:(a.match(/\n\s*\|\s*:?-{3,}/gu)||[]).length}}function V(a,b){let c=U(a),d=b?U(b):void 0,e=[];c.chars<200&&e.push("导出内容为空或过短"),d&&d.chars>1e3&&c.chars<.8*d.chars&&e.push("导出内容明显少于服务端生成记录"),d&&d.h3>0&&0===c.h3&&e.push("导出内容缺少服务端生成记录中的二级小节"),d&&d.tables>0&&0===c.tables&&e.push("导出内容缺少服务端生成记录中的表格");let f=a.split(/\r?\n/u).map(a=>/^(#{2,4})\s+(.+)$/u.exec(a.trim())).filter(a=>!!a).map(a=>({level:a[1].length,title:I(a[2])})).filter(a=>a.title&&"目录"!==a.title);0===f.length&&e.push("正文缺少章节标题"),f.some((a,b)=>b>0&&a.level-f[b-1].level>1)&&e.push("标题层级存在跳级,可能影响导出目录和导航");let g=f.map(a=>a.title.replace(/^第[一二三四五六七八九十百]+章\s*/u,"").replace(/^\d+(?:\.\d+)*\s*/u,"").replace(/[\s::.。]+$/gu,"").trim()).filter(Boolean).filter((a,b,c)=>c.indexOf(a)!==b);g.length>0&&e.push(`存在重复标题:${[...new Set(g)].slice(0,3).join("、")}`);let h=a.split(/\r?\n/u).map(a=>I(a)).filter(a=>a.length>0&&!/^#+\s/u.test(a));h.some(a=>a.length<=1)&&e.push("正文存在孤立字或残缺段落"),h.some(a=>/[,、;:和与在为对将]$/u.test(a)||/(通过|包括|如下|主要包括)$/u.test(a))&&e.push("正文存在疑似截断句或未完结段落"),h.some(a=>a.length>380)&&e.push("正文存在过长段落,建议拆分以改善导出版式");let i=function(a){let b=new Map,c=[];for(let d of a.split(/\n{2,}/u).map(a=>I(a)).filter(a=>a.length>=45&&!/^#+\s/u.test(a))){let a=d.replace(/\s+/gu,"").slice(0,90),e=(b.get(a)||0)+1;b.set(a,e),2===e&&c.push(d.slice(0,60))}return c}(a);return i.length>0&&e.push(`正文存在重复段落:${i.slice(0,2).join(";")}`),e.push(...function(a){let b=[],c=a.split(/\r?\n/u);for(let a=0;a<c.length;a+=1){let d=c[a]||"";if(!D(d))continue;let e=c[a+1]?.trim()===""?a+2:a+1;if(e<c.length&&C(c[e]||"")){let f=[],g=e+1;for(;g<c.length&&D(c[g]||"");)f.push(c[g]||""),g+=1;0===f.length&&b.push(`第 ${a+1} 行表格只有表头,没有数据行`);let h=[d,...f].map(a=>E(a).length);Math.max(...h)-Math.min(...h)>2&&b.push(`第 ${a+1} 行附近表格列数差异较大,导出版式可能异常`),a=g-1;continue}a+1<c.length&&D(c[a+1]||"")&&b.push(`第 ${a+1} 行附近疑似裸表格,已尝试自动规范化`)}return(a.match(/```/gu)||[]).length%2==1&&b.push("存在未闭合代码块,可能影响后续内容导出"),[...new Set(b)].slice(0,20)}(a)),[...new Set(e)]}function W(a,b){let c=H(a),d=H(b||"");return{markdown:c,baselineMarkdown:d,issues:V(c,d)}}async function X(a,b,d,e){let{marked:f}=await Promise.resolve().then(c.bind(c,83142));return B(function(a,b,c){let d=M(c),e=S(b);return`<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>${v(a)}</title><style>
|
|
1
|
+
"use strict";(()=>{var a={};a.id=8644,a.ids=[8644],a.modules={15751:a=>{a.exports=require("xlsx")},16006:(a,b,c)=>{c.d(b,{j:()=>e});var d=c(91879);function e(a,b){return async function(c,e){try{await b(c,e)}catch(g){let f=(0,d.wF)({source:a,functionName:b.name||"anonymous",error:g,req:c});console.error(`[${a}]`,f.id,g),e.headersSent||e.status(500).json({error:g instanceof Error?g.message:"Internal server error",requestId:f.id})}}}(0,d.mG)()},19898:a=>{a.exports=require("@customize-agent/knowledge")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},48161:a=>{a.exports=require("node:os")},73024:a=>{a.exports=require("node:fs")},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},83142:a=>{a.exports=import("marked")},83237:a=>{a.exports=import("playwright")},83258:(a,b,c)=>{c.r(b),c.d(b,{config:()=>af,default:()=>ae,handler:()=>ah});var d={};c.r(d),c.d(d,{__documentExportTest__:()=>aa,config:()=>u,default:()=>ab});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(31421),j=c(73024),k=c(48161),l=c(76760);let m=require("node:url"),n=require("node:util"),o=require("jszip");var p=c.n(o),q=c(48661),r=c(44533),s=c(91879),t=c(16006);let u={api:{bodyParser:{sizeLimit:"50mb"},responseLimit:!1}};function v(a){return a.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""")}let w=(0,n.promisify)(i.execFile),x={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml"};function y(a){return x[l.extname(a).toLowerCase()]||""}function z(a,b){let c=l.relative(b,a);return!!c&&!c.startsWith("..")&&!l.isAbsolute(c)}function A(a,b=(0,r.aY)()){if(!a||/^(?:https?:|data:|file:|blob:|#)/iu.test(a))return null;let c=function(a){try{return decodeURIComponent(a.split(/[?#]/u)[0]||a)}catch{return""}}(a);if(!c||l.isAbsolute(c))return null;let d=l.resolve(b,"knowledgeBase"),e=l.resolve((0,q.Gl)(b),"assets");return[c.startsWith("generatedDocuments/assets/")?l.resolve(e,c.replace(/^generatedDocuments\/assets\//u,"")):"",l.resolve(d,c)].filter(Boolean).find(a=>{let b=l.resolve(a);return(z(b,d)||z(b,e))&&!!y(b)&&j.existsSync(b)&&j.statSync(b).isFile()})||null}function B(a,b=(0,r.aY)()){let c=new Map,d=0;return a.replace(/<img\b([^>]*?)\bsrc=["']([^"']+)["']([^>]*)>/giu,(a,e,f,g)=>{let h=A(f,b);if(!h)return a;let i=j.statSync(h);if(i.size>8388608||d+i.size>0x2000000)return a;let k=c.get(h);return k||(k=`data:${y(h)};base64,${j.readFileSync(h).toString("base64")}`,c.set(h,k),d+=i.size),`<img${e}src="${k}"${g}>`})}function C(a){return/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/u.test(a.trim())}function D(a){let b=a.trim();return!(!b||/^#{1,6}\s+/u.test(b)||C(b))&&(b.match(/(?<!\\)\|/gu)||[]).length>=1}function E(a){return a.trim().replace(/^\|/u,"").replace(/\|$/u,"").trim().split(/(?<!\\)\|/u).map(a=>a.replace(/\\\|/gu,"|").trim())}function F(a,b){let c=a.slice(0,b);for(a.length>b&&b>0&&(c[b-1]=[c[b-1],...a.slice(b)].filter(Boolean).join(" | "));c.length<b;)c.push("");return`| ${c.map(a=>a.replace(/\|/gu,"\\|")).join(" | ")} |`}function G(a){if(2===a)return["信息项","内容"];let b=["控制项目","控制内容","执行要求","责任主体","检查与验收","备注"];return Array.from({length:a},(a,c)=>b[c]||`补充说明${c+1}`)}function H(a){return function(a){let b=a.replace(/\r?\n/gu,"\n").split("\n"),c=[];for(let a=0;a<b.length;){let d=b[a]||"",e=d.replace(/([^|\n])\|\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/u,"$1"),f=b[a+1]?.trim()===""?a+2:a+1,g=b[f];if(D(d)&&void 0!==g&&C(g)){let e=E(d),h=E(g).length,i=[],j=f+1;for(;j<b.length;){let a=b[j]||"";if(!D(a))break;i.push(E(a)),j+=1}let k=Math.max(2,e.length,h,...i.map(a=>a.length));for(c.length>0&&c[c.length-1]?.trim()&&c.push(""),c.push(F(e,k)),c.push(`| ${Array.from({length:k},()=>"---").join(" | ")} |`),a=f+1;a<b.length;){let d=b[a]||"";if(!D(d))break;c.push(F(E(d),k)),a+=1}a<b.length&&b[a]?.trim()&&c.push("");continue}let h=D(d)?function(a,b){let c=[],d=b;for(;d<a.length&&D(a[d]||"");)c.push(a[d]||""),d+=1;let e=Math.max(...c.map(a=>E(a).length),0);return c.length<2||e<2?null:{rows:c,columns:e,next:d}}(b,a):null;if(h){for(let a of(c.length>0&&c[c.length-1]?.trim()&&c.push(""),c.push(F(G(h.columns),h.columns)),c.push(`| ${Array.from({length:h.columns},()=>"---").join(" | ")} |`),h.rows))c.push(F(E(a),h.columns));(a=h.next)<b.length&&b[a]?.trim()&&c.push("");continue}if(C(d)){let e=function(a,b){let c=[],d=b;for(;d<a.length&&D(a[d]||"");)c.push(a[d]||""),d+=1;return{rows:c,next:d}}(b,a+1);if(e.rows.length>0){let f=Math.max(2,E(d).length,...e.rows.map(a=>E(a).length));for(let a of(c.length>0&&c[c.length-1]?.trim()&&c.push(""),c.push(F(G(f),f)),c.push(`| ${Array.from({length:f},()=>"---").join(" | ")} |`),e.rows))c.push(F(E(a),f));(a=e.next)<b.length&&b[a]?.trim()&&c.push("");continue}}c.push(e),a+=1}return c.join("\n").replace(/\n{3,}/gu,"\n\n")}((function(a){let b=a.trim(),c=/^```(?:markdown|md)?\s*\n([\s\S]*?)\n```\s*$/iu.exec(b);return c?c[1].trim():a})(a).replace(/m\s*<sup>\s*2\s*<\/sup>/giu,"m\xb2").replace(/m\s*<sup>\s*3\s*<\/sup>/giu,"m\xb3").replace(/m\s*\^\s*2/giu,"m\xb2").replace(/m\s*\^\s*3/giu,"m\xb3").replace(/㎡/gu,"m\xb2").replace(/㎥/gu,"m\xb3").replace(/(?<=\d)m\s*2(?![\p{L}\p{N}_])/giu,"m\xb2").replace(/(?<=\d)m\s*3(?![\p{L}\p{N}_])/giu,"m\xb3").replace(/(?<![\p{L}\p{N}_])m\s*2(?![\p{L}\p{N}_])/giu,"m\xb2").replace(/(?<![\p{L}\p{N}_])m\s*3(?![\p{L}\p{N}_])/giu,"m\xb3"))}function I(a){return H(a).replace(/!\[[^\]]*\]\([^)]*\)/gu,"").replace(/\[([^\]]+)\]\([^)]*\)/gu,"$1").replace(/[*_`]/gu,"").replace(/<br\s*\/?>/giu,"\n").replace(/<[^>]+>/gu,"").trim()}function J(a,b){let c=/([\d.]+)\s*(pt|px)?/iu.exec(a||"");if(!c)return b;let d=Number(c[1]);return Number.isFinite(d)?c[2]?.toLowerCase()==="px"?.75*d:d:b}function K(a,b){return`${J(a,b)}pt`}function L(a,b){let c=/([\d.]+)\s*(cm|mm|in|pt)?/iu.exec(a||"");if(!c)return Math.round(567*b);let d=Number(c[1]);if(!Number.isFinite(d))return Math.round(567*b);let e=(c[2]||"cm").toLowerCase();return"mm"===e?Math.round(56.7*d):"in"===e?Math.round(1440*d):"pt"===e?Math.round(20*d):Math.round(567*d)}function M(a){let b=R(a),c=J(b.bodySize,14),d=J(b.titleSize,16),e=J(b.lineHeight,22);return{...b,bodyPt:c,titlePt:d,linePt:e,bodyHalfPoints:Math.round(2*c),titleHalfPoints:Math.round(2*d),lineTwips:Math.round(20*e),fontEastAsia:"宋体",fontAscii:"SimSun",bodyCss:`${c}pt`,titleCss:`${d}pt`,lineCss:`${e}pt`}}function N(a,b={}){if(b.pageBreak)return'<w:p><w:r><w:br w:type="page"/></w:r></w:p>';let c=[b.indentLeft?`w:left="${b.indentLeft}"`:"",b.firstLine?`w:firstLine="${b.firstLine}"`:"",b.hanging?`w:hanging="${b.hanging}"`:""].filter(Boolean).join(" "),d=[b.styleId?`<w:pStyle w:val="${v(b.styleId)}"/>`:"",b.numbering?`<w:numPr><w:ilvl w:val="${b.numbering.level}"/><w:numId w:val="${b.numbering.numId}"/></w:numPr>`:"",b.keepNext?"<w:keepNext/>":"",`<w:spacing w:line="${b.line??440}" w:lineRule="exact" w:before="${b.spacingBefore??0}" w:after="${b.spacingAfter??120}"/>`,c?`<w:ind ${c}/>`:"",b.align?`<w:jc w:val="${b.align}"/>`:"","number"==typeof b.outlineLevel?`<w:outlineLvl w:val="${b.outlineLevel}"/>`:""].filter(Boolean).join("");return`<w:p><w:pPr>${d}</w:pPr>${function(a,b={}){let c=b.fontEastAsia||"宋体",d=b.fontAscii||"SimSun",e=[`<w:rFonts w:ascii="${v(d)}" w:hAnsi="${v(d)}" w:eastAsia="${v(c)}" w:cs="${v(d)}"/>`,b.bold?"<w:b/>":"",b.size?`<w:sz w:val="${b.size}"/><w:szCs w:val="${b.size}"/>`:""].filter(Boolean).join("");return`<w:r><w:rPr>${e}</w:rPr><w:t xml:space="preserve">${v(a)}</w:t></w:r>`}(a,b)}</w:p>`}async function O(a,b,c,d=[]){a.folder("word")?.file("styles.xml",function(a){let b=M(a),c=`w:ascii="${v(b.fontAscii)}" w:hAnsi="${v(b.fontAscii)}" w:eastAsia="${v(b.fontEastAsia)}" w:cs="${v(b.fontAscii)}"`,d=(a,d,e,f,g,h,i)=>`<w:style w:type="paragraph" w:styleId="${a}"><w:name w:val="${d}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="${9+f}"/><w:qFormat/><w:rPr><w:b/><w:rFonts ${c}/><w:sz w:val="${e}"/><w:szCs w:val="${e}"/></w:rPr><w:pPr><w:keepNext/><w:keepLines/><w:outlineLvl w:val="${f}"/><w:spacing w:line="${b.lineTwips}" w:lineRule="exact" w:before="${g}" w:after="${h}"/>${i?`<w:jc w:val="${i}"/>`:""}</w:pPr></w:style>`;return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts ${c}/><w:sz w:val="${b.bodyHalfPoints}"/><w:szCs w:val="${b.bodyHalfPoints}"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:line="${b.lineTwips}" w:lineRule="exact" w:after="120"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/><w:rPr><w:rFonts ${c}/><w:sz w:val="${b.bodyHalfPoints}"/><w:szCs w:val="${b.bodyHalfPoints}"/></w:rPr><w:pPr><w:spacing w:line="${b.lineTwips}" w:lineRule="exact" w:after="120"/></w:pPr></w:style>${d("Heading1","heading 1",Math.max(b.titleHalfPoints+4,36),0,260,180,"center")}${d("Heading2","heading 2",Math.max(b.titleHalfPoints,32),1,180,100)}${d("Heading3","heading 3",Math.max(b.bodyHalfPoints,28),2,120,80)}<w:style w:type="paragraph" w:styleId="ListParagraph"><w:name w:val="List Paragraph"/><w:basedOn w:val="Normal"/><w:uiPriority w:val="34"/><w:qFormat/><w:pPr><w:ind w:left="720" w:hanging="360"/></w:pPr></w:style></w:styles>`}(c)),a.folder("word")?.file("numbering.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:numbering xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:abstractNum w:abstractNumId="1"><w:multiLevelType w:val="hybridMultilevel"/><w:lvl w:ilvl="0"><w:start w:val="1"/><w:numFmt w:val="decimal"/><w:lvlText w:val="%1."/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="720" w:hanging="360"/></w:pPr></w:lvl><w:lvl w:ilvl="1"><w:start w:val="1"/><w:numFmt w:val="decimal"/><w:lvlText w:val="%1.%2"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="1080" w:hanging="420"/></w:pPr></w:lvl><w:lvl w:ilvl="2"><w:start w:val="1"/><w:numFmt w:val="decimal"/><w:lvlText w:val="%1.%2.%3"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="1440" w:hanging="480"/></w:pPr></w:lvl></w:abstractNum><w:num w:numId="1"><w:abstractNumId w:val="1"/></w:num></w:numbering>'),a.folder("word")?.file("settings.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:settings xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:updateFields w:val="true"/><w:compat><w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="15"/></w:compat></w:settings>'),a.folder("word")?.file("fontTable.xml",function(a){let b=M(a);return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:fonts xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:font w:name="${v(b.fontEastAsia)}"><w:charset w:val="86"/><w:family w:val="roman"/></w:font><w:font w:name="${v(b.fontAscii)}"><w:family w:val="roman"/></w:font></w:fonts>`}(c)),a.folder("docProps")?.file("core.xml",function(a){let b=new Date().toISOString();return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title>${v(a)}</dc:title><dc:creator>Customize Agent</dc:creator><cp:lastModifiedBy>Customize Agent</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">${b}</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">${b}</dcterms:modified></cp:coreProperties>`}(b)),a.folder("docProps")?.file("app.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Customize Agent</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>1.0</AppVersion></Properties>');let e=a.folder("word")?.folder("media");for(let a of d)e?.file(a.fileName,a.buffer);let f=a.file("word/_rels/document.xml.rels"),g=f?await f.async("string"):'<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>';for(let[a,b,c]of[["rStyle","http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"],["rNumbering","http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"],["rSettings","http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"],["rFontTable","http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"]])g.includes(b)||(g=g.replace("</Relationships>",`<Relationship Id="${a}" Type="${b}" Target="${c}"/></Relationships>`));for(let a of d)g.includes(`Id="${a.relationshipId}"`)||(g=g.replace("</Relationships>",`<Relationship Id="${a.relationshipId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/${a.fileName}"/></Relationships>`));a.folder("word")?.folder("_rels")?.file("document.xml.rels",g);let h=a.file("_rels/.rels"),i=h?await h.async("string"):'<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/></Relationships>';i.includes("metadata/core-properties")||(i=i.replace("</Relationships>",'<Relationship Id="rCore" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/></Relationships>')),i.includes("extended-properties")||(i=i.replace("</Relationships>",'<Relationship Id="rApp" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/></Relationships>')),a.folder("_rels")?.file(".rels",i);let j=a.file("[Content_Types].xml"),k=j?await j.async("string"):'<?xml version="1.0" encoding="UTF-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/></Types>';for(let a of new Set(d.map(a=>l.extname(a.fileName).slice(1).toLowerCase()).filter(Boolean))){let b="jpg"===a||"jpeg"===a?"image/jpeg":"png"===a?"image/png":"gif"===a?"image/gif":"webp"===a?"image/webp":void 0;b&&!k.includes(`Extension="${a}"`)&&(k=k.replace("</Types>",`<Default Extension="${a}" ContentType="${b}"/></Types>`))}for(let[a,b]of[["/word/styles.xml","application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"],["/word/numbering.xml","application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"],["/word/settings.xml","application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"],["/word/fontTable.xml","application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"],["/docProps/core.xml","application/vnd.openxmlformats-package.core-properties+xml"],["/docProps/app.xml","application/vnd.openxmlformats-officedocument.extended-properties+xml"]])k.includes(`PartName="${a}"`)||(k=k.replace("</Types>",`<Override PartName="${a}" ContentType="${b}"/></Types>`));a.file("[Content_Types].xml",k)}async function P(a,b,c,d,e=process.cwd()){let f={projectRoot:e,images:[]},g=function(a,b,c){let d=M(b),e=d.titleHalfPoints,f=d.bodyHalfPoints,g=H(a).replace(/<div class="page-break"><\/div>/gu,"\n[[PAGE_BREAK]]\n").split("\n"),h=[],i=!1,k=!1,m=!1;for(let a=0;a<g.length;){var n;let b=g[a].trim();if(!b){a+=1;continue}if(/<div\s+class=["']document-cover["']\s*>/iu.test(b)){k=!0,a+=1;continue}if(k&&/^<\/div>$/iu.test(b)){k=!1,a+=1;continue}if("[[PAGE_BREAK]]"===b){i=!1,k=!1,h.push(N("",{pageBreak:!0})),a+=1;continue}if(k){let c=I(b.replace(/^#\s+/u,""));c&&h.push(N(c,{bold:!0,size:Math.max(e+8,44),line:Math.round(1.15*d.lineTwips),fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,align:"center",spacingBefore:360,spacingAfter:220})),a+=1;continue}let o=c?function(a,b){let c=/!\[([^\]]*)\]\(([^)]+)\)/u.exec(a);if(!c)return null;let d=A(c[2].trim(),b.projectRoot);if(!d)return null;let e=j.readFileSync(d),f=y(d);if(!f||"image/svg+xml"===f||e.length>8388608)return null;let g=b.images.length+1,h=l.extname(d).toLowerCase()||".png",i=function(a,b){if("image/png"===b&&a.length>=24&&"PNG"===a.toString("ascii",1,4))return{width:a.readUInt32BE(16),height:a.readUInt32BE(20)};if("image/jpeg"===b){let b=2;for(;b+9<a.length&&255===a[b];){let c=a[b+1],d=a.readUInt16BE(b+2);if(c>=192&&c<=195)return{height:a.readUInt16BE(b+5),width:a.readUInt16BE(b+7)};b+=2+d}}return{width:640,height:360}}(e,f),k=Math.min(1,620/Math.max(i.width,1)),m={relationshipId:`rImage${g}`,fileName:`image${g}${h}`,buffer:e,contentType:f,widthEmu:Math.round(i.width*k*9525),heightEmu:Math.round(i.height*k*9525),altText:c[1]||`image${g}`};return b.images.push(m),m}(b,c):null;if(o){h.push(`<w:p><w:pPr><w:jc w:val="center"/><w:spacing w:after="120"/></w:pPr><w:r><w:drawing><wp:inline xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"><wp:extent cx="${o.widthEmu}" cy="${o.heightEmu}"/><wp:docPr id="${o.relationshipId.replace(/\D/gu,"")||"1"}" name="${v(o.altText||o.fileName)}"/><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="0" name="${v(o.fileName)}"/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${o.relationshipId}" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${o.widthEmu}" cy="${o.heightEmu}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r></w:p>`),a+=1;continue}let p=function(a,b){let c=a[b+1]?.trim()===""?b+2:b+1;if(c>=a.length||!D(a[b]||"")||!C(a[c]||""))return null;let d=E(a[b]||"").map(a=>I(a)),e=E(a[c]||"").length,f=[],g=c+1;for(;g<a.length&&D(a[g]||"");)f.push(E(a[g]||"").map(a=>I(a))),g+=1;let h=Math.max(2,d.length,e,...f.map(a=>a.length)),i=a=>{let b=a.slice(0,h);for(a.length>h&&h>0&&(b[h-1]=[b[h-1],...a.slice(h)].filter(Boolean).join(" | "));b.length<h;)b.push("");return b};return{rows:[i(d),...f.map(i)],next:g}}(g,a);if(p){h.push(function(a,b){let c=Math.max(1,...a.map(a=>a.length)),d=Math.floor(9638/c),e=Array.from({length:c},(a,b)=>b===c-1?9638-d*(c-1):d),f=`<w:tblGrid>${e.map(a=>`<w:gridCol w:w="${a}"/>`).join("")}</w:tblGrid>`;return`<w:tbl><w:tblPr><w:tblW w:w="9638" w:type="dxa"/><w:tblLook w:firstRow="1" w:noHBand="0"/><w:tblBorders><w:top w:val="single" w:sz="6" w:color="666666"/><w:left w:val="single" w:sz="6" w:color="666666"/><w:bottom w:val="single" w:sz="6" w:color="666666"/><w:right w:val="single" w:sz="6" w:color="666666"/><w:insideH w:val="single" w:sz="4" w:color="666666"/><w:insideV w:val="single" w:sz="4" w:color="666666"/></w:tblBorders></w:tblPr>${f}${a.map((a,c)=>`<w:tr>${e.map((d,e)=>{let f=a[e]||"";return`<w:tc><w:tcPr><w:tcW w:w="${d}" w:type="dxa"/><w:tcMar><w:top w:w="80" w:type="dxa"/><w:left w:w="120" w:type="dxa"/><w:bottom w:w="80" w:type="dxa"/><w:right w:w="120" w:type="dxa"/></w:tcMar>${0===c?'<w:shd w:val="clear" w:fill="F3F4F6"/>':""}</w:tcPr>${N(f,{bold:0===c,size:b.bodyHalfPoints,line:b.lineTwips,fontEastAsia:b.fontEastAsia,fontAscii:b.fontAscii,spacingAfter:0,align:0===c?"center":"left"})}</w:tc>`}).join("")}</w:tr>`).join("")}</w:tbl>`}(p.rows,d),N("",{spacingAfter:80,line:d.lineTwips})),a=p.next;continue}let q=/^(#{1,4})\s+(.+)$/u.exec(b);if(q){let b=I(q[2]);i="目录"===b,h.push((n=q[1].length,2===n?N(b,{styleId:"Heading1",outlineLevel:0,bold:!0,size:Math.max(d.titleHalfPoints+4,36),line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,align:"center",spacingBefore:260,spacingAfter:180,keepNext:!0}):3===n?N(b,{styleId:"Heading2",outlineLevel:1,bold:!0,size:Math.max(d.titleHalfPoints,32),line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,spacingBefore:180,spacingAfter:100,keepNext:!0}):N(b,{styleId:"Heading3",outlineLevel:2,bold:!0,size:Math.max(d.bodyHalfPoints,28),line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,spacingBefore:120,spacingAfter:80,keepNext:!0}))),i&&!m&&(h.push(`<w:p><w:pPr><w:spacing w:line="${d.lineTwips}" w:lineRule="exact" w:after="120"/></w:pPr><w:r><w:fldChar w:fldCharType="begin"/></w:r><w:r><w:instrText xml:space="preserve">TOC \\o "1-3" \\h \\z \\u</w:instrText></w:r><w:r><w:fldChar w:fldCharType="separate"/></w:r><w:r><w:t>请在 Word 中右键更新目录</w:t></w:r><w:r><w:fldChar w:fldCharType="end"/></w:r></w:p>`),m=!0),a+=1;continue}let r=I(b),s=function(a){let b=/^\s*(\d+(?:\.\d+){0,2})([.、])\s+(.+)$/u.exec(a);return b?{level:Math.min(b[1].split(".").length-1,2),marker:`${b[1]}${b[2]}`,text:I(b[3])}:null}(b),t=function(a){let b=/^\s*[-*+]\s+(.+)$/u.exec(a);return b?I(b[1]):null}(b);if(!i&&s){let b=0===s.level?720:1===s.level?1080:1440,c=0===s.level?360:1===s.level?420:480;h.push(N(`${s.marker} ${s.text}`,{styleId:"ListParagraph",numbering:{numId:1,level:s.level},size:f,line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,indentLeft:b,hanging:c,spacingAfter:60})),a+=1;continue}if(!i&&t){h.push(N(`• ${t}`,{styleId:"ListParagraph",size:f,line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,indentLeft:720,hanging:360,spacingAfter:60})),a+=1;continue}let u=/^\*\*[^*]+\*\*\s*[::]?\s*$/u.test(b)||/^([一二三四五六七八九十]+)/u.test(r)||/^[一二三四五六七八九十]+、/u.test(r);h.push(i?function(a,b){let c=/^\s*\d+\.\d+\s+\S/u.test(a);return N(I(a),{bold:!c,size:b.bodyHalfPoints,line:b.lineTwips,fontEastAsia:b.fontEastAsia,fontAscii:b.fontAscii,spacingAfter:c?30:80,indentLeft:420*!!c,align:"left"})}(b,d):N(r,{bold:u,size:f,line:d.lineTwips,fontEastAsia:d.fontEastAsia,fontAscii:d.fontAscii,align:"both",firstLine:560*!u,spacingBefore:80*!!u})),a+=1}return h.join("")}(b,c,f);if(d&&j.existsSync(d)){let b=await p().loadAsync(j.readFileSync(d)),e=b.file("word/document.xml");if(e){let d=await e.async("string");return b.file("word/document.xml",d.replace(/\{\{title\}\}/gu,v(a)).replace(/\{\{content\}\}/gu,g)),await O(b,a,c,f.images),b.generateAsync({type:"nodebuffer"})}}let h=c?.page||{},i=new(p());return i.folder("word")?.file("document.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:body>${g}<w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="${L(h.marginTop,2.5)}" w:right="${L(h.marginRight,2)}" w:bottom="${L(h.marginBottom,2)}" w:left="${L(h.marginLeft,2)}"/></w:sectPr></w:body></w:document>`),await O(i,a,c,f.images),i.generateAsync({type:"nodebuffer"})}function Q(a,b){return a&&/^[\w\s\u4e00-\u9fa5,"'().-]+$/u.test(a)?a:b}function R(a){let b=a?.page||{},c=a?.typography||{},d=Q(b.paper,"A4"),e=Q(b.marginTop,"24mm"),f=Q(b.marginRight,"18mm"),g=Q(b.marginBottom,"22mm"),h=Q(b.marginLeft,"18mm"),i=Q(c.fontFamily,"SimSun, 宋体, serif"),j=K(c.lineHeight,22);return{paper:d,marginTop:e,marginRight:f,marginBottom:g,marginLeft:h,fontFamily:i,lineHeight:j,titleSize:K(c.titleSize,16),bodySize:K(c.bodySize,14)}}function S(a){return a.replace(/(<h2[^>]*>\s*目录\s*<\/h2>)([\s\S]*?)(<div class="page-break"><\/div>)/u,(a,b,c,d)=>{let e=c.replace(/<ol>\s*([\s\S]*?)\s*<\/ol>/u,(a,b)=>b).replace(/<li>\s*([^<]+?)\s*<\/li>/gu,"<p>$1</p>").replace(/<p>(?:\s| | )*(\d+\.\d+\s+[^<]+)<\/p>/giu,'<p class="toc-section">$1</p>').replace(/<p>(?!(?:\s| | )*<\/p>|(?:\s| | )*\d+\.\d+\s)([\s\S]*?)<\/p>/giu,'<p class="toc-chapter">$1</p>');return`<section class="document-toc">${b}${e}</section>${d}`})}function T(a){let b=a.message.trim();return!/^(事实冲突|必需章节缺失):/u.test(b)&&/出现禁用文本\s*(资料未提供|占位|TODO|TBD)|正文包含.*(资料未提供|占位)|图片、地图或附件引用路径明显无效|无效路径|表格语法错误|临时远程生成 URL|提示词全文|内部错误|生成未完成|低于目标页数|低于目标字数|文档预算未达成|正文篇幅低于目标|缺少规划小节|缺少必要的正式表格|正文缺少章节标题/iu.test(b)}function U(a){return{chars:a.trim().length,h2:(a.match(/^##\s+/gmu)||[]).length,h3:(a.match(/^###\s+/gmu)||[]).length,tables:(a.match(/\n\s*\|\s*:?-{3,}/gu)||[]).length}}function V(a,b){let c=U(a),d=b?U(b):void 0,e=[];c.chars<200&&e.push("导出内容为空或过短"),d&&d.chars>1e3&&c.chars<.8*d.chars&&e.push("导出内容明显少于服务端生成记录"),d&&d.h3>0&&0===c.h3&&e.push("导出内容缺少服务端生成记录中的二级小节"),d&&d.tables>0&&0===c.tables&&e.push("导出内容缺少服务端生成记录中的表格");let f=a.split(/\r?\n/u).map(a=>/^(#{2,4})\s+(.+)$/u.exec(a.trim())).filter(a=>!!a).map(a=>({level:a[1].length,title:I(a[2])})).filter(a=>a.title&&"目录"!==a.title);0===f.length&&e.push("正文缺少章节标题"),f.some((a,b)=>b>0&&a.level-f[b-1].level>1)&&e.push("标题层级存在跳级,可能影响导出目录和导航");let g=f.map(a=>a.title.replace(/^第[一二三四五六七八九十百]+章\s*/u,"").replace(/^\d+(?:\.\d+)*\s*/u,"").replace(/[\s::.。]+$/gu,"").trim()).filter(Boolean).filter((a,b,c)=>c.indexOf(a)!==b);g.length>0&&e.push(`存在重复标题:${[...new Set(g)].slice(0,3).join("、")}`);let h=a.split(/\r?\n/u).map(a=>I(a)).filter(a=>a.length>0&&!/^#+\s/u.test(a));h.some(a=>a.length<=1)&&e.push("正文存在孤立字或残缺段落"),h.some(a=>/[,、;:和与在为对将]$/u.test(a)||/(通过|包括|如下|主要包括)$/u.test(a))&&e.push("正文存在疑似截断句或未完结段落"),h.some(a=>a.length>380)&&e.push("正文存在过长段落,建议拆分以改善导出版式");let i=function(a){let b=new Map,c=[];for(let d of a.split(/\n{2,}/u).map(a=>I(a)).filter(a=>a.length>=45&&!/^#+\s/u.test(a))){let a=d.replace(/\s+/gu,"").slice(0,90),e=(b.get(a)||0)+1;b.set(a,e),2===e&&c.push(d.slice(0,60))}return c}(a);return i.length>0&&e.push(`正文存在重复段落:${i.slice(0,2).join(";")}`),e.push(...function(a){let b=[],c=a.split(/\r?\n/u);for(let a=0;a<c.length;a+=1){let d=c[a]||"";if(!D(d))continue;let e=c[a+1]?.trim()===""?a+2:a+1;if(e<c.length&&C(c[e]||"")){let f=[],g=e+1;for(;g<c.length&&D(c[g]||"");)f.push(c[g]||""),g+=1;0===f.length&&b.push(`第 ${a+1} 行表格只有表头,没有数据行`);let h=[d,...f].map(a=>E(a).length);Math.max(...h)-Math.min(...h)>2&&b.push(`第 ${a+1} 行附近表格列数差异较大,导出版式可能异常`),a=g-1;continue}a+1<c.length&&D(c[a+1]||"")&&b.push(`第 ${a+1} 行附近疑似裸表格,已尝试自动规范化`)}return(a.match(/```/gu)||[]).length%2==1&&b.push("存在未闭合代码块,可能影响后续内容导出"),[...new Set(b)].slice(0,20)}(a)),[...new Set(e)]}function W(a,b){let c=H(a),d=H(b||"");return{markdown:c,baselineMarkdown:d,issues:V(c,d)}}async function X(a,b,d,e){let{marked:f}=await Promise.resolve().then(c.bind(c,83142));return B(function(a,b,c){let d=M(c),e=S(b);return`<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>${v(a)}</title><style>
|
|
2
2
|
@page{size:${d.paper};margin:${d.marginTop} ${d.marginRight} ${d.marginBottom} ${d.marginLeft}}
|
|
3
3
|
*{box-sizing:border-box}
|
|
4
4
|
html,body{margin:0;padding:0;background:#fff}
|
|
@@ -9,8 +9,8 @@ strong{font-weight:700}
|
|
|
9
9
|
ul,ol{margin:0 0 8pt 2em;padding:0}li{margin:0 0 4pt 0;text-align:justify;break-inside:avoid}
|
|
10
10
|
h1,h2,h3,h4{font-family:${d.fontFamily};line-height:${d.lineCss};font-weight:700;color:#111827;page-break-after:avoid;break-after:avoid;break-inside:avoid}
|
|
11
11
|
h1{text-align:center;font-size:${Math.max(d.titlePt+6,22)}pt;margin:80pt 0 28pt 0}
|
|
12
|
-
h2{text-align:center;font-size:${Math.max(d.titlePt+2,18)}pt;border:0;padding:0;margin:24pt 0 14pt 0;break-before:auto}
|
|
13
|
-
h2:not(:first-child){page-break-before:always;break-before:page}
|
|
12
|
+
h2{text-align:center;font-size:${Math.max(d.titlePt+2,18)}pt;border:0;padding:0;margin:24pt 0 14pt 0;break-before:auto;page-break-before:auto}
|
|
13
|
+
h2.document-chapter-heading:not(:first-child){page-break-before:always;break-before:page}
|
|
14
14
|
h3{font-size:${d.titleCss};margin:16pt 0 7pt 0}
|
|
15
15
|
h4{font-size:${d.bodyCss};margin:10pt 0 5pt 0}
|
|
16
16
|
.document-toc{page-break-after:always;break-after:page}.document-toc h2{text-align:center;margin-top:0;page-break-before:auto;break-before:auto}.document-toc p{margin:0 0 4pt 0;text-align:left;text-indent:0}.document-toc .toc-chapter{font-weight:700;margin-top:8pt}.document-toc .toc-section{margin-left:2em}
|
|
@@ -22,5 +22,5 @@ th,td{font-family:${d.fontFamily};font-size:${d.bodyCss};line-height:${d.lineCss
|
|
|
22
22
|
th{background:#f3f4f6;font-weight:700;text-align:center}
|
|
23
23
|
pre{white-space:pre-wrap;font-family:${d.fontFamily};font-size:${d.bodyCss};line-height:${d.lineCss};page-break-inside:avoid;break-inside:avoid}.page-break{page-break-after:always;break-after:page;height:0}
|
|
24
24
|
@media print{body{-webkit-print-color-adjust:exact;print-color-adjust:exact}a{text-decoration:none;color:#111827}}
|
|
25
|
-
</style></head><body>${e}</body></html>`}(a,f.parse(b,{async:!1}),d),e)}function Y(){let a=[process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH,process.env.CHROME_PATH].filter(Boolean),b=k.homedir();return[...new Set([...a,..."darwin"===process.platform?["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",l.join(b,"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),l.join(b,"Applications/Chromium.app/Contents/MacOS/Chromium")]:"win32"===process.platform?[l.join(process.env.PROGRAMFILES||"C:\\Program Files","Google/Chrome/Application/chrome.exe"),l.join(process.env["PROGRAMFILES(X86)"]||"C:\\Program Files (x86)","Google/Chrome/Application/chrome.exe"),l.join(process.env.LOCALAPPDATA||"","Google/Chrome/Application/chrome.exe"),l.join(process.env.PROGRAMFILES||"C:\\Program Files","Microsoft/Edge/Application/msedge.exe")]:["/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/usr/bin/chromium","/usr/bin/chromium-browser","/snap/bin/chromium","/usr/bin/microsoft-edge"]].filter(a=>a&&j.existsSync(a)))]}async function Z(a,b,c){let d=j.mkdtempSync(l.join(k.tmpdir(),"customize-agent-pdf-")),e=l.join(d,"document.html"),f=l.join(d,"document.pdf"),g=l.join(d,"profile");j.writeFileSync(e,a,"utf-8");try{let a=R(c),d=(0,m.pathToFileURL)(e).href,h=["--disable-gpu","--no-sandbox","--disable-setuid-sandbox",`--user-data-dir=${g}`,`--print-to-pdf=${f}`,`--print-to-pdf-page-size=${a.paper}`,d],i=[];for(let a of["--headless=new","--headless"])try{if(await w(b,[a,...h],{timeout:3e4,maxBuffer:1048576}),j.existsSync(f)&&j.statSync(f).size>=1024)return j.readFileSync(f);i.push(`${a}: browser command did not produce a valid PDF`)}catch(b){i.push(`${a}: ${b instanceof Error?b.message:String(b)}`)}throw Error(i.join("\n"))}finally{j.rmSync(d,{recursive:!0,force:!0})}}async function $(a,b){let{chromium:d}=await Promise.resolve().then(c.bind(c,83237)),e=[{label:"playwright-bundled-chromium",options:{headless:!0,args:["--no-sandbox","--disable-setuid-sandbox"]}},{label:"system-chrome-channel",options:{channel:"chrome",headless:!0,args:["--no-sandbox","--disable-setuid-sandbox"]}},{label:"system-msedge-channel",options:{channel:"msedge",headless:!0,args:["--no-sandbox","--disable-setuid-sandbox"]}},...Y().map(a=>({label:a,options:{executablePath:a,headless:!0,args:["--no-sandbox","--disable-setuid-sandbox"]}}))],f=[];for(let c of e)try{let e=await d.launch(c.options);try{let c=await e.newPage({locale:"zh-CN"});await c.setContent(a,{waitUntil:"load"}),await c.waitForFunction(()=>Array.from(document.images).every(a=>a.complete),void 0,{timeout:1e4}).catch(()=>void 0),await c.emulateMedia({media:"print"});let d=M(b),f=await c.pdf({format:d.paper,printBackground:!0,preferCSSPageSize:!0,margin:{top:d.marginTop,right:d.marginRight,bottom:d.marginBottom,left:d.marginLeft},displayHeaderFooter:!0,headerTemplate:"<div></div>",footerTemplate:`<div style="font-family:${d.fontFamily};font-size:10.5pt;line-height:12pt;width:100%;text-align:center;color:#666;">第 <span class="pageNumber"></span> 页 / 共 <span class="totalPages"></span> 页</div>`});return Buffer.from(f)}finally{await e.close()}}catch(a){f.push(`${c.label}: ${a instanceof Error?a.message:String(a)}`)}for(let c of Y())try{return await Z(a,c,b)}catch(a){f.push(`browser-command ${c}: ${a instanceof Error?a.message:String(a)}`)}throw Error(f.join("\n"))}async function _(a,b){if("POST"!==a.method)return b.status(405).json({error:"Method not allowed"});let c=a.body,d=c.projectRoot||(0,r.aY)(),e=c.documentId?(0,q.v7)(c.documentId,d):null;if(c.documentId&&!e)return b.status(404).json({error:"Document not found"});let f=c.title||e?.title||"document",g=e?.draft?.exportSettings,h=e?.editedMarkdown||e?.markdown||e?.draft?.markdown||"",i=W(c.useClientMarkdown&&"string"==typeof c.markdown?c.markdown:h||c.markdown||"",e?.draft?.markdown||e?.markdown||""),{markdown:j}=i,k=c.format;if(!k||!["markdown","html","pdf","docx"].includes(k))return b.status(400).json({error:"INVALID_EXPORT_FORMAT",message:"请选择有效的导出格式。"});i.issues.length>0&&b.setHeader("X-Export-Content-Issues",encodeURIComponent(JSON.stringify(i.issues.slice(0,20))));let l=e?.draft?.exportGate||c.exportGate,m=l?.blockingIssues?.filter(T)||[],n=l?.passed===!1&&0===m.length?[{message:"导出门禁未通过:存在未完成的检查项"}]:[],o=[...m,...n];b.setHeader("X-Export-Gate-Passed",0===o.length?"true":"false"),o.length>0&&b.setHeader("X-Export-Gate-Issues",encodeURIComponent(JSON.stringify(o.map(a=>a.message).slice(0,20))));let p=f.replace(/[\\/:*?"<>|]/gu,"-").slice(0,80)||"document";if("markdown"===k)return b.setHeader("Content-Type","text/markdown; charset=utf-8"),b.setHeader("Content-Disposition",`attachment; filename*=UTF-8''${encodeURIComponent(`${p}.md`)}`),b.status(200).send(j);if("docx"===k){let a=await P(f,j,g,c.wordTemplatePath,d);return b.setHeader("Content-Type","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),b.setHeader("Content-Disposition",`attachment; filename*=UTF-8''${encodeURIComponent(`${p}.docx`)}`),b.status(200).send(a)}let t=await X(f,j,g,d);if("html"===k)return b.setHeader("Content-Type","text/html; charset=utf-8"),b.setHeader("Content-Disposition",`attachment; filename*=UTF-8''${encodeURIComponent(`${p}.html`)}`),b.status(200).send(t);try{let a=await $(t,g),c=function(a){let b=a.toString("latin1").match(/\/Type\s*\/Page\b/gu);return b?.length||void 0}(a);return b.setHeader("Content-Type","application/pdf"),c&&b.setHeader("X-PDF-Page-Count",String(c)),b.setHeader("Content-Disposition",`attachment; filename*=UTF-8''${encodeURIComponent(`${p}.pdf`)}`),b.status(200).send(a)}catch(c){return(0,s.wF)({level:"error",source:"api/documents/export",functionName:"pdfExportChromium",error:c,req:a,meta:{fallback:"system-browser-attempted"}}),b.status(500).json({error:"PDF_RENDER_FAILED",message:"PDF 渲染失败:未找到或无法启动可用的 Chrome/Chromium/Edge。请安装 Chrome,或设置 PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH 后重试。"})}}let aa={inlineLocalImages:B,resolveLocalImagePath:A,normalizeExportUnits:H,prepareExportMarkdown:W,stripInlineMarkdown:I,enhanceTocHtml:S,buildExportHtml:X,buildDocx:P,validateExportMarkdown:V},ab=(0,t.j)("api/documents/export",_);var ac=c(68970),ad=c(50296);let ae=(0,h.M)(d,"default"),af=(0,h.M)(d,"config"),ag=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/documents/export",pathname:"/api/documents/export",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function ah(a,b,c){let d=await ag.prepare(a,b,{srcPage:"/api/documents/export"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,ac.getTracer)(),e=d.getActiveScopeSpan(),j=ag.instrumentationOnRequestError.bind(ag),k=async e=>ag.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:ag.isDev,page:"/api/documents/export",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==ad.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(ad.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:ac.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(ag.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},87550:a=>{a.exports=require("better-sqlite3")},91879:(a,b,c)=>{c.d(b,{hH:()=>p,mG:()=>r,cW:()=>o,wF:()=>n});var d=c(29021),e=c.n(d),f=c(21820),g=c.n(f),h=c(33873),i=c.n(h);let j=require("crypto");var k=c.n(j);let l=i().join(g().homedir(),".customize-agent","logs"),m=i().join(l,"errors.jsonl");function n(a){let{message:b,stack:c}=function(a){if(a instanceof Error)return{message:a.message,stack:a.stack};if("string"==typeof a)return{message:a};try{return{message:JSON.stringify(a)}}catch{return{message:String(a)}}}(a.error),d={id:`err_${Date.now()}_${k().randomBytes(4).toString("hex")}`,level:a.level||"error",source:a.source,functionName:a.functionName,message:b,stack:c,request:a.req?{method:a.req.method,url:a.req.url,query:a.req.query}:void 0,meta:a.meta,createdAt:Date.now()};try{e().mkdirSync(l,{recursive:!0}),function(){try{if(e().statSync(m).size<=2097152)return;e().renameSync(m,i().join(l,`errors-${Date.now()}.jsonl`))}catch{}}(),e().appendFileSync(m,`${JSON.stringify(d)}
|
|
25
|
+
</style></head><body>${e}</body></html>`}(a,f.parse(b,{async:!1}).replace(/<h2([^>]*)>(第[一二三四五六七八九十百千万\d]+章\s*[\s\S]*?)<\/h2>/gu,(a,b,c)=>/\bclass=/iu.test(b)?`<h2${b.replace(/class=(['"])(.*?)\1/iu,(a,b,c)=>`class=${b}${c} document-chapter-heading${b}`)}>${c}</h2>`:`<h2${b} class="document-chapter-heading">${c}</h2>`),d),e)}function Y(){let a=[process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH,process.env.CHROME_PATH].filter(Boolean),b=k.homedir();return[...new Set([...a,..."darwin"===process.platform?["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",l.join(b,"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),l.join(b,"Applications/Chromium.app/Contents/MacOS/Chromium")]:"win32"===process.platform?[l.join(process.env.PROGRAMFILES||"C:\\Program Files","Google/Chrome/Application/chrome.exe"),l.join(process.env["PROGRAMFILES(X86)"]||"C:\\Program Files (x86)","Google/Chrome/Application/chrome.exe"),l.join(process.env.LOCALAPPDATA||"","Google/Chrome/Application/chrome.exe"),l.join(process.env.PROGRAMFILES||"C:\\Program Files","Microsoft/Edge/Application/msedge.exe")]:["/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/usr/bin/chromium","/usr/bin/chromium-browser","/snap/bin/chromium","/usr/bin/microsoft-edge"]].filter(a=>a&&j.existsSync(a)))]}async function Z(a,b,c){let d=j.mkdtempSync(l.join(k.tmpdir(),"customize-agent-pdf-")),e=l.join(d,"document.html"),f=l.join(d,"document.pdf"),g=l.join(d,"profile");j.writeFileSync(e,a,"utf-8");try{let a=R(c),d=(0,m.pathToFileURL)(e).href,h=["--disable-gpu","--no-sandbox","--disable-setuid-sandbox",`--user-data-dir=${g}`,`--print-to-pdf=${f}`,`--print-to-pdf-page-size=${a.paper}`,d],i=[];for(let a of["--headless=new","--headless"])try{if(await w(b,[a,...h],{timeout:3e4,maxBuffer:1048576}),j.existsSync(f)&&j.statSync(f).size>=1024)return j.readFileSync(f);i.push(`${a}: browser command did not produce a valid PDF`)}catch(b){i.push(`${a}: ${b instanceof Error?b.message:String(b)}`)}throw Error(i.join("\n"))}finally{j.rmSync(d,{recursive:!0,force:!0})}}async function $(a,b){let{chromium:d}=await Promise.resolve().then(c.bind(c,83237)),e=[{label:"playwright-bundled-chromium",options:{headless:!0,args:["--no-sandbox","--disable-setuid-sandbox"]}},{label:"system-chrome-channel",options:{channel:"chrome",headless:!0,args:["--no-sandbox","--disable-setuid-sandbox"]}},{label:"system-msedge-channel",options:{channel:"msedge",headless:!0,args:["--no-sandbox","--disable-setuid-sandbox"]}},...Y().map(a=>({label:a,options:{executablePath:a,headless:!0,args:["--no-sandbox","--disable-setuid-sandbox"]}}))],f=[];for(let c of e)try{let e=await d.launch(c.options);try{let c=await e.newPage({locale:"zh-CN"});await c.setContent(a,{waitUntil:"load"}),await c.waitForFunction(()=>Array.from(document.images).every(a=>a.complete),void 0,{timeout:1e4}).catch(()=>void 0),await c.emulateMedia({media:"print"});let d=M(b),f=await c.pdf({format:d.paper,printBackground:!0,preferCSSPageSize:!0,margin:{top:d.marginTop,right:d.marginRight,bottom:d.marginBottom,left:d.marginLeft},displayHeaderFooter:!0,headerTemplate:"<div></div>",footerTemplate:`<div style="font-family:${d.fontFamily};font-size:10.5pt;line-height:12pt;width:100%;text-align:center;color:#666;">第 <span class="pageNumber"></span> 页 / 共 <span class="totalPages"></span> 页</div>`});return Buffer.from(f)}finally{await e.close()}}catch(a){f.push(`${c.label}: ${a instanceof Error?a.message:String(a)}`)}for(let c of Y())try{return await Z(a,c,b)}catch(a){f.push(`browser-command ${c}: ${a instanceof Error?a.message:String(a)}`)}throw Error(f.join("\n"))}async function _(a,b){if("POST"!==a.method)return b.status(405).json({error:"Method not allowed"});let c=a.body,d=c.projectRoot||(0,r.aY)(),e=c.documentId?(0,q.v7)(c.documentId,d):null;if(c.documentId&&!e)return b.status(404).json({error:"Document not found"});let f=c.title||e?.title||"document",g=e?.draft?.exportSettings,h=e?.editedMarkdown||e?.markdown||e?.draft?.markdown||"",i=W(c.useClientMarkdown&&"string"==typeof c.markdown?c.markdown:h||c.markdown||"",e?.draft?.markdown||e?.markdown||""),{markdown:j}=i,k=c.format;if(!k||!["markdown","html","pdf","docx"].includes(k))return b.status(400).json({error:"INVALID_EXPORT_FORMAT",message:"请选择有效的导出格式。"});i.issues.length>0&&b.setHeader("X-Export-Content-Issues",encodeURIComponent(JSON.stringify(i.issues.slice(0,20))));let l=e?.draft?.exportGate||c.exportGate,m=l?.blockingIssues?.filter(T)||[],n=l?.passed===!1&&0===m.length?[{message:"导出门禁未通过:存在未完成的检查项"}]:[],o=[...m,...n];b.setHeader("X-Export-Gate-Passed",0===o.length?"true":"false"),o.length>0&&b.setHeader("X-Export-Gate-Issues",encodeURIComponent(JSON.stringify(o.map(a=>a.message).slice(0,20))));let p=f.replace(/[\\/:*?"<>|]/gu,"-").slice(0,80)||"document";if("markdown"===k)return b.setHeader("Content-Type","text/markdown; charset=utf-8"),b.setHeader("Content-Disposition",`attachment; filename*=UTF-8''${encodeURIComponent(`${p}.md`)}`),b.status(200).send(j);if("docx"===k){let a=await P(f,j,g,c.wordTemplatePath,d);return b.setHeader("Content-Type","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),b.setHeader("Content-Disposition",`attachment; filename*=UTF-8''${encodeURIComponent(`${p}.docx`)}`),b.status(200).send(a)}let t=await X(f,j,g,d);if("html"===k)return b.setHeader("Content-Type","text/html; charset=utf-8"),b.setHeader("Content-Disposition",`attachment; filename*=UTF-8''${encodeURIComponent(`${p}.html`)}`),b.status(200).send(t);try{let a=await $(t,g),c=function(a){let b=a.toString("latin1").match(/\/Type\s*\/Page\b/gu);return b?.length||void 0}(a);return b.setHeader("Content-Type","application/pdf"),c&&b.setHeader("X-PDF-Page-Count",String(c)),b.setHeader("Content-Disposition",`attachment; filename*=UTF-8''${encodeURIComponent(`${p}.pdf`)}`),b.status(200).send(a)}catch(c){return(0,s.wF)({level:"error",source:"api/documents/export",functionName:"pdfExportChromium",error:c,req:a,meta:{fallback:"system-browser-attempted"}}),b.status(500).json({error:"PDF_RENDER_FAILED",message:"PDF 渲染失败:未找到或无法启动可用的 Chrome/Chromium/Edge。请安装 Chrome,或设置 PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH 后重试。"})}}let aa={inlineLocalImages:B,resolveLocalImagePath:A,normalizeExportUnits:H,prepareExportMarkdown:W,stripInlineMarkdown:I,enhanceTocHtml:S,buildExportHtml:X,buildDocx:P,validateExportMarkdown:V},ab=(0,t.j)("api/documents/export",_);var ac=c(68970),ad=c(50296);let ae=(0,h.M)(d,"default"),af=(0,h.M)(d,"config"),ag=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/documents/export",pathname:"/api/documents/export",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function ah(a,b,c){let d=await ag.prepare(a,b,{srcPage:"/api/documents/export"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,ac.getTracer)(),e=d.getActiveScopeSpan(),j=ag.instrumentationOnRequestError.bind(ag),k=async e=>ag.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:ag.isDev,page:"/api/documents/export",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==ad.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(ad.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:ac.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(ag.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},87550:a=>{a.exports=require("better-sqlite3")},91879:(a,b,c)=>{c.d(b,{hH:()=>p,mG:()=>r,cW:()=>o,wF:()=>n});var d=c(29021),e=c.n(d),f=c(21820),g=c.n(f),h=c(33873),i=c.n(h);let j=require("crypto");var k=c.n(j);let l=i().join(g().homedir(),".customize-agent","logs"),m=i().join(l,"errors.jsonl");function n(a){let{message:b,stack:c}=function(a){if(a instanceof Error)return{message:a.message,stack:a.stack};if("string"==typeof a)return{message:a};try{return{message:JSON.stringify(a)}}catch{return{message:String(a)}}}(a.error),d={id:`err_${Date.now()}_${k().randomBytes(4).toString("hex")}`,level:a.level||"error",source:a.source,functionName:a.functionName,message:b,stack:c,request:a.req?{method:a.req.method,url:a.req.url,query:a.req.query}:void 0,meta:a.meta,createdAt:Date.now()};try{e().mkdirSync(l,{recursive:!0}),function(){try{if(e().statSync(m).size<=2097152)return;e().renameSync(m,i().join(l,`errors-${Date.now()}.jsonl`))}catch{}}(),e().appendFileSync(m,`${JSON.stringify(d)}
|
|
26
26
|
`)}catch(a){console.error("[errorLogService] failed to write error log",a)}return d}function o(a=200){try{return e().readFileSync(m,"utf8").split("\n").filter(Boolean).slice(-a).reverse().map(a=>JSON.parse(a))}catch{return[]}}function p(){try{e().rmSync(m,{force:!0})}catch{}}let q=!1;function r(){q||(q=!0,process.on("uncaughtException",a=>{n({source:"process",functionName:"uncaughtException",error:a}),console.error("[process] uncaughtException",a)}),process.on("unhandledRejection",a=>{n({source:"process",functionName:"unhandledRejection",error:a}),console.error("[process] unhandledRejection",a)}))}},95393:a=>{a.exports=require("@customize-agent/llm")},96770:a=>{a.exports=require("@customize-agent/runtime")}};var b=require("../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705,5840,1924,8661],()=>b(b.s=83258));module.exports=c})();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";(()=>{var a={};a.id=2182,a.ids=[2182],a.modules={19898:a=>{a.exports=require("@customize-agent/knowledge")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},33873:a=>{a.exports=require("path")},44533:(a,b,c)=>{c.d(b,{Qh:()=>l,VS:()=>p,Yy:()=>o,aY:()=>n});var d=c(19898),e=c(87550),f=c.n(e),g=c(33873),h=c(21820),i=c(29021);let j=null;function k(){return g.join(h.homedir(),".customize-agent")}function l(){return j||(j=new d.MultiProjectManager(k())),j}function m(a){let b=g.resolve(a),c=g.resolve(g.join(h.homedir(),".customize-agent"));return!(i.existsSync(g.join(b,"pnpm-workspace.yaml"))&&i.existsSync(g.join(b,"apps","server")))&&(b===c||b.includes(`${g.sep}.customize-agent${g.sep}`)||b.endsWith(`${g.sep}apps${g.sep}server`)||b.endsWith(`${g.sep}apps${g.sep}cli`))}function n(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&i.existsSync(a)&&!m(a))return g.resolve(a);let b=function(){let a=g.join(k(),"projects","registry.db");if(!i.existsSync(a))return[];let b=new(f())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>g.resolve(a.project_root)).filter(a=>!m(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!m(process.env.INIT_CWD)?process.env.INIT_CWD:g.resolve(process.cwd(),"../..")}function o(a,b={}){let c=new Map;for(let b of function(a){let b=g.join(h.homedir(),".customize-agent","projects",(0,d.computeProjectId)(g.resolve(a)),"kb.db");if(!i.existsSync(b))return[];let c=new d.IndexStateStore(b);try{return c.listRecords().map(a=>({...a,matchedBy:"metadata"}))}finally{c.close()}}(a))c.set(b.relativePath,b);for(let b of function(a){let b=g.join(a,"knowledgeBase");if(!i.existsSync(b))return[];let c=[],d=a=>{for(let e of i.readdirSync(a,{withFileTypes:!0})){let f=g.join(a,e.name);if(e.isDirectory()){d(f);continue}if(e.name.endsWith(".source.txt"))continue;let h=i.statSync(f),j=g.relative(b,f).split(g.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:g.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:h.size,mtime:h.mtimeMs,chunkCount:0,collectionName:"",indexedAt:0,lastVerifiedAt:0,status:"disk",matchedBy:"disk"})}};return d(b),c}(a)){let a=c.get(b.relativePath);c.set(b.relativePath,a?{...a,fileSize:b.fileSize,mtime:b.mtime,matchedBy:"metadata"}:b)}return Array.from(c.values()).filter(a=>!b.category||a.category===b.category).sort((a,b)=>b.mtime-a.mtime||a.relativePath.localeCompare(b.relativePath,"zh-CN"))}async function p(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=o(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
2
|
+
${a.category}
|
|
3
|
+
${a.format}
|
|
4
|
+
${a.status}`.toLowerCase().includes(c.toLowerCase()))&&e.set(a.relativePath,{...a,matchedBy:c?"path":a.matchedBy});if(c&&!1!==b.includeContent)try{for(let b of(await l().search(a,c,{limit:Math.max(20,d)})).results){let a=b.filePath,c=e.get(a)||f.find(b=>b.relativePath===a);e.set(a,{...c||{relativePath:a,category:"content",format:"knowledge",fileSize:0,mtime:0,chunkCount:0,indexedAt:0,lastVerifiedAt:0,status:"active"},matchedBy:"content",score:b.score})}}catch{}let g=Array.from(e.values()).sort((a,b)=>{let c=a=>"content"===a.matchedBy?3:"path"===a.matchedBy?2:+("metadata"===a.matchedBy);return c(b)-c(a)||(b.score??0)-(a.score??0)||b.mtime-a.mtime||a.relativePath.localeCompare(b.relativePath,"zh-CN")});return{files:g.slice(0,d),total:g.length}}},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},87550:a=>{a.exports=require("better-sqlite3")},87926:(a,b,c)=>{c.r(b),c.d(b,{config:()=>B,default:()=>A,handler:()=>D});var d={};c.r(d),c.d(d,{default:()=>x});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);function j(a){return a.toLowerCase().replace(/\s+/gu,"").trim()}function k(a){return a.split("\\").join("/").toLowerCase()}function l(a){return[...new Set(a.map(a=>a.trim()).filter(Boolean))]}function m(a){return Math.round(1e4*a)/1e4}function n(a){return a.reduce((a,b,c)=>a+b/Math.log2(c+2),0)}function o(a,b){let c=k(a);return b.some(a=>{let b=k(a);return c===b||c.endsWith(b)||b.endsWith(c)})}async function p(a,b){let c=l([...a.filePaths||[],...b?.filePaths||[]]),d=l([...a.filePathPrefixes||[],...b?.filePathPrefixes||[]]).map(k);return 0===d.length?c:l([...c,...(await (0,i.Qh)().getProject(a.projectRoot)).listFiles().map(a=>a.relativePath).filter(a=>d.some(b=>k(a).startsWith(b)))])}let q=[{label:"项目名称",regex:/(?:招标项目名称|项目名称|工程名称)[::\s|]*([^。;;\n|]{4,80})/gu,query:a=>`${a} 项目名称 工程名称`},{label:"招标人",regex:/(?:招标人|项目业主|建设单位)[::\s|]*([^。;;\n|]{4,80})/gu,query:a=>`${a} 招标人 建设单位 项目业主`},{label:"建设地点",regex:/(?:建设地点|工程地点|项目地点)[::\s|]*([^。;;\n|]{4,120})/gu,query:a=>`${a} 建设地点 项目地点`},{label:"资金来源",regex:/(?:资金来源|资金落实情况)[::\s|]*([^。;;\n|]{2,80})/gu,query:a=>`${a} 资金来源`},{label:"出资比例",regex:/(?:出资比例|项目出资比例)[::\s|]*([^。;;\n|]{2,80})/gu,query:a=>`${a} 出资比例`},{label:"项目编号",regex:/(?:招标项目编号|项目编号|招标编号)[::\s|]*([A-Za-z0-9()()[\]【】-]{4,80})/gu,query:a=>`${a} 项目编号 招标编号`},{label:"立项批准",regex:/(?:批准文号|备案表|立项批准文号)[::\s|]*([^。;;\n|]{4,100})/gu,query:a=>`${a} 立项批准 文号 备案`},{label:"工期",regex:/(?:计划工期|总工期|工期)[::\s|]*([^。;;\n|]{2,100})/gu,query:a=>`${a} 工期 计划工期`},{label:"质量标准",regex:/(?:质量标准|质量要求)[::\s|]*([^。;;\n|]{2,100})/gu,query:a=>`${a} 质量标准 质量要求`},{label:"建筑面积",regex:/(?:总建筑面积|建筑面积)[::\s|约]*([0-9,.]+\s*(?:m2|㎡|平方米))/giu,query:a=>`${a} 总建筑面积 建筑面积`},{label:"结构",regex:/(地上[一二三四五六七八九十\d]+层[^。;;\n|]{0,20}结构)/gu,query:a=>`${a} 建筑结构 现状建筑物`},{label:"场地限制",regex:/(不具备材料堆场|搭设加工区|搭设办公区|搭设生活区|场地限制)/gu,query:a=>`${a} 场地限制 材料堆场 办公区 生活区`},{label:"临水临电",regex:/(临水临电|临时水电接引|接驳点挂表计量|挂表计量|施工水电接引费)/gu,query:a=>`${a} 临水临电 接驳点 挂表计量`},{label:"拆除修补",regex:/(改造维修项目|拆除内容比较多|破损处进行修补|拆除工程|修补)/gu,query:a=>`${a} 改造维修 拆除 修补`},{label:"安全文明",regex:/(安全文明施工|安全生产|文明施工|扬尘治理|消防安全)/gu,query:a=>`${a} 安全文明 安全生产 文明施工`}];function r(a){return a.replace(/#{1,6}\s*/gu,"").replace(/\|/gu," ").replace(/\s+/gu,"").trim()}function s(a){return a.split(/\n+/u).filter(a=>!/^\s*(?:资料类型|MIME|文件大小|PDF\s*第|工作表:|COL\d+)/iu.test(a)).join("\n")}function t(a){return(a.match(/[\u4e00-\u9fa5A-Za-z0-9()()【】《》、,。;;::,.\-/㎡%]/gu)?.length||0)/Math.max(1,a.length)>=.65&&!function(a){return!!/[爀攀最椀猀琀礀开氀漀挀愀渀捁扄潓瑲湥獴慔汢]/u.test(a)||(a.match(/[\u4e00-\u9fa5]/gu)?.length||0)>=8&&!/工程|项目|施工|建筑|结构|装饰|电气|给排水|消防|暖通|平面|立面|剖面|节点|详图|材料|尺寸|标高|轴线|图层|门窗|墙|地面|顶面|照明|配电|弱电|空调|卫生间|楼梯|屋面|基础|柱|梁|板/u.test(a)}(a)}function u(a){return l(a.match(/[\u4e00-\u9fa5A-Za-z0-9()()【】《》-]{4,18}/gu)||[]).filter(a=>!/^(?:招标文件|投标文件|投标人|承包人|发包人|中标人|工程项目|施工单位|相关费用)$/u.test(a)).slice(0,3)}async function v(a){let b=Math.max(1,Math.min(1e3,Math.ceil(a.limit??300))),c=Math.max(1,Math.min(300,Math.ceil(a.perFileLimit??12))),d=await (0,i.Qh)().getProject(a.projectRoot),e=await p(a),f=function(a,b){let c=l(b.includeExtensions||[]).map(a=>a.replace(/^\./u,"").toLowerCase()),d=l(b.excludeExtensions||[]).map(a=>a.replace(/^\./u,"").toLowerCase());return a.filter(a=>{let e=a.split(".").pop()?.toLowerCase()||"";return!(c.length>0&&!c.includes(e)||d.includes(e))&&("cad"===b.fileLayer?["dwg","dxf"].includes(e):"document"!==b.fileLayer||!["dwg","dxf","png","jpg","jpeg","gif","webp"].includes(e))})}(e.length>0?e:d.listFiles().map(a=>a.relativePath),a),g=[],h=new Set;for(let a of f){if(g.length>=b)break;let e=0;for(let i of d.listChunks({relativePath:a,limit:1e3})){if(g.length>=b||e>=c)break;let d=`${i.sectionTitle||""}
|
|
5
|
+
${i.titlePath||""}
|
|
6
|
+
${s(i.content)}`;if(!(d.length<20||/工作表:|COL\d+|^\s*[|:-]+\s*$/u.test(d))){for(let i of q){if(g.length>=b||e>=c)break;for(let j of(i.regex.lastIndex=0,d.matchAll(i.regex))){let d=(j[1]||j[0]||"").replace(/[|*_`#]/gu,"").replace(/\s+/gu,"").trim().slice(0,80);if(!(d.length>=2&&!/^(?:无|否|是|详见|见|按|按图|相关资料|相关专业图纸)$/u.test(d)&&!/^[-—::|]+$/u.test(d)&&!/[、,,]*(?:工程内容|金额|计入投标总价|产权单位|索赔|费用|事宜)[、,,]*/u.test(d)&&!/^(?:第\d+页共\d+页|COL\d+|项目名称计算基础|所列的金额)/iu.test(d)))continue;let k=`${i.label}:${d}`;if(!h.has(k)&&(h.add(k),g.push({id:`auto-${g.length+1}`,query:i.query(d),expectedTerms:[d],relevantFiles:[a],filePaths:f.length>0?f:void 0,topK:20}),e+=1,g.length>=b||e>=c))break}}for(let n of s(d).replace(/#{1,6}\s*/gu,"").replace(/\|/gu,"。").split(/[。;;!?!?\n]/u).map(a=>r(a)).filter(a=>a.length>=16&&a.length<=90).filter(a=>!/资料类型|工作表:|COL\d+|---|第\d+页共\d+页|MIME|文件大小|customize-agent-cad/iu.test(a)).filter(a=>/[\u4e00-\u9fa5]{4,}/u.test(a)).filter(t)){var j,k,m;if(g.length>=b||e>=c)break;let d=u(n);if(0===d.length)continue;let o=(j=n,k=i.sectionTitle,m=i.titlePath,l([r(s(`${k||""}
|
|
7
|
+
${m||""}`)).slice(0,30),u(j).join(" ")]).join(" "));if(o.length<8)continue;let p=`sentence:${d.join("|")}:${a}`;h.has(p)||(h.add(p),g.push({id:`auto-${g.length+1}`,query:o,expectedTerms:d,relevantFiles:[a],filePaths:f.length>0?f:void 0,topK:20}),e+=1)}}}}return g}async function w(a){let b=Math.max(1,Math.min(100,Math.ceil(a.topK??20))),c=(0,i.Qh)(),d=[],e=[];for(let[f,g]of a.cases.entries()){let h=g.id||`case-${f+1}`,i=g.query.trim(),k=l(g.relevantFiles||[]),q=l(g.relevantSnippets||[]),r=l(g.expectedTerms||[]),s=Math.max(1,Math.min(100,Math.ceil(g.topK??b))),t=k.length+q.length+r.length,u=await p(a,g);if(!i||0===t){e.push({id:h,query:i,reason:"评测用例必须包含 query,且至少提供 relevantFiles、relevantSnippets 或 expectedTerms 之一。"});continue}if((a.filePathPrefixes?.length||g.filePathPrefixes?.length)&&0===u.length){e.push({id:h,query:i,reason:"filePathPrefixes 未匹配到任何已索引文件。"});continue}let v=await c.search(a.projectRoot,i,{limit:s,weights:a.weights,generationMode:a.generationMode,disableReranker:a.disableReranker,filters:u.length>0?{filePaths:u}:void 0}),w=v.results.slice(0,s),x=w.map(a=>`${a.filePath}
|
|
8
|
+
${a.sectionTitle||""}
|
|
9
|
+
${a.content}`).join("\n"),y=k.filter(a=>w.some(b=>o(b.filePath,[a]))),z=q.filter(a=>j(x).includes(j(a))),A=r.filter(a=>j(x).includes(j(a))),B=y.length+z.length+A.length,C=w.map((a,b)=>{let c=[];return o(a.filePath,k)&&c.push("file"),function(a,b){let c=j(a);return b.filter(a=>c.includes(j(a)))}(a.content,q).length>0&&c.push("snippet"),function(a,b){let c=j(a);return b.filter(a=>c.includes(j(a)))}(`${a.sectionTitle||""}
|
|
10
|
+
${a.content}`,r).length>0&&c.push("term"),{rank:b+1,filePath:a.filePath,score:a.score,relevant:c.length>0,matchedBy:c,preview:a.content.replace(/\s+/gu," ").slice(0,180)}}),D=C.find(a=>a.relevant)?.rank,E=C.map(a=>+!!a.relevant),F=n([...E].sort((a,b)=>b-a)),G={id:h,query:i,topK:s,returned:w.length,recall:m(B/t),precision:m(C.filter(a=>a.relevant).length/Math.max(1,w.length)),mrr:D?m(1/D):0,ndcg:F>0?m(n(E)/F):0,hitUnits:B,totalUnits:t,firstHitRank:D,matchedFiles:y,missingFiles:k.filter(a=>!y.includes(a)),matchedSnippets:z,missingSnippets:q.filter(a=>!z.includes(a)),matchedTerms:A,missingTerms:r.filter(a=>!A.includes(a)),results:a.compact?C.slice(0,3):C,debug:a.compact?void 0:v.debug};d.push(G)}let f=d.length,g=a=>f>0?d.reduce((b,c)=>b+a(c),0)/f:0,h=m(g(a=>a.recall)),k=m(g(a=>a.precision)),q=m(g(a=>a.mrr)),r=m(g(a=>a.ndcg));return{totalCases:a.cases.length,validCases:f,invalidCases:e.length,topK:b,recallAtK:h,precisionAtK:k,mrr:q,ndcgAtK:r,pass95:f>0&&h>=.95,cases:d,invalid:e}}async function x(a,b){if("POST"!==a.method)return b.status(405).json({error:"Method not allowed"});try{var c;let d=a.body&&"object"==typeof a.body?a.body:{},e="string"==typeof d.projectRoot&&d.projectRoot.trim()?d.projectRoot:(0,i.aY)();if(!e)return b.status(400).json({error:"projectRoot is required"});let f=Array.isArray(d.filePaths)?d.filePaths.filter(a=>"string"==typeof a):void 0,g=Array.isArray(d.filePathPrefixes)?d.filePathPrefixes.filter(a=>"string"==typeof a):void 0,h=!0===d.autoGenerate,j=h?await v({projectRoot:e,filePaths:f,filePathPrefixes:g,limit:"number"==typeof d.limit?d.limit:void 0,perFileLimit:"number"==typeof d.perFileLimit?d.perFileLimit:void 0,fileLayer:"document"===d.fileLayer||"cad"===d.fileLayer||"all"===d.fileLayer?d.fileLayer:void 0,includeExtensions:Array.isArray(d.includeExtensions)?d.includeExtensions.filter(a=>"string"==typeof a):void 0,excludeExtensions:Array.isArray(d.excludeExtensions)?d.excludeExtensions.filter(a=>"string"==typeof a):void 0}):(c=d.cases,Array.isArray(c)?c.map(a=>a&&"object"==typeof a?a:void 0).filter(Boolean).map(a=>({id:"string"==typeof a.id?a.id:void 0,query:"string"==typeof a.query?a.query:"",relevantFiles:Array.isArray(a.relevantFiles)?a.relevantFiles.filter(a=>"string"==typeof a):void 0,relevantSnippets:Array.isArray(a.relevantSnippets)?a.relevantSnippets.filter(a=>"string"==typeof a):void 0,expectedTerms:Array.isArray(a.expectedTerms)?a.expectedTerms.filter(a=>"string"==typeof a):void 0,filePaths:Array.isArray(a.filePaths)?a.filePaths.filter(a=>"string"==typeof a):void 0,filePathPrefixes:Array.isArray(a.filePathPrefixes)?a.filePathPrefixes.filter(a=>"string"==typeof a):void 0,topK:"number"==typeof a.topK?a.topK:void 0})):[]);if(0===j.length)return b.status(400).json({error:"cases is required"});let k=await w({projectRoot:e,cases:j,topK:"number"==typeof d.topK?d.topK:void 0,generationMode:"boolean"==typeof d.generationMode?d.generationMode:void 0,filePaths:h?void 0:f,filePathPrefixes:h?void 0:g,compact:"boolean"==typeof d.compact?d.compact:void 0,disableReranker:"boolean"==typeof d.disableReranker?d.disableReranker:void 0});b.status(200).json(k)}catch(a){console.error("[api] kb/evaluate",a),b.status(500).json({error:"Internal server error"})}}var y=c(68970),z=c(50296);let A=(0,h.M)(d,"default"),B=(0,h.M)(d,"config"),C=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/evaluate",pathname:"/api/kb/evaluate",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function D(a,b,c){let d=await C.prepare(a,b,{srcPage:"/api/kb/evaluate"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,y.getTracer)(),e=d.getActiveScopeSpan(),j=C.instrumentationOnRequestError.bind(C),k=async e=>C.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:C.isDev,page:"/api/kb/evaluate",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==z.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(z.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:y.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(C.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}}};var b=require("../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=87926));module.exports=c})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":1,"files":["../../../../../../../node_modules/.pnpm/@huggingface+jinja@0.5.9/node_modules/@huggingface/jinja/dist/index.cjs","../../../../../../../node_modules/.pnpm/@huggingface+jinja@0.5.9/node_modules/@huggingface/jinja/dist/index.js","../../../../../../../node_modules/.pnpm/@huggingface+jinja@0.5.9/node_modules/@huggingface/jinja/package.json","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/jinja","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/dist/transformers.node.mjs","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/package.json","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/backends/onnx.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/base/feature_extraction_utils.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/base/image_processors_utils.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/base/processing_utils.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/configs.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/env.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/generation/configuration_utils.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/generation/logits_process.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/generation/logits_sampler.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/generation/stopping_criteria.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/generation/streamers.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/auto/feature_extraction_auto.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/auto/image_processing_auto.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/auto/processing_auto.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/beit/image_processing_beit.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/bit/image_processing_bit.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/chinese_clip/image_processing_chinese_clip.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/clap/feature_extraction_clap.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/clip/image_processing_clip.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/convnext/image_processing_convnext.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/dac/feature_extraction_dac.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/deit/image_processing_deit.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/detr/image_processing_detr.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/dinov3_vit/image_processing_dinov3_vit.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/donut/image_processing_donut.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/dpt/image_processing_dpt.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/efficientnet/image_processing_efficientnet.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/encodec/feature_extraction_encodec.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/feature_extractors.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/florence2/processing_florence2.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/gemma3n/feature_extraction_gemma3n.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/gemma3n/processing_gemma3n.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/glpn/image_processing_glpn.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/grounding_dino/image_processing_grounding_dino.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/grounding_dino/processing_grounding_dino.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/idefics3/image_processing_idefics3.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/idefics3/processing_idefics3.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/image_processors.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/janus/image_processing_janus.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/janus/processing_janus.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/jina_clip/image_processing_jina_clip.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/jina_clip/processing_jina_clip.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/llava/processing_llava.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/llava_onevision/image_processing_llava_onevision.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/mask2former/image_processing_mask2former.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/maskformer/image_processing_maskformer.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/mgp_str/processing_mgp_str.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/mobilenet_v1/image_processing_mobilenet_v1.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/mobilenet_v2/image_processing_mobilenet_v2.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/mobilenet_v3/image_processing_mobilenet_v3.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/mobilenet_v4/image_processing_mobilenet_v4.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/mobilevit/image_processing_mobilevit.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/moonshine/feature_extraction_moonshine.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/moonshine/processing_moonshine.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/nougat/image_processing_nougat.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/owlv2/image_processing_owlv2.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/owlvit/image_processing_owlvit.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/owlvit/processing_owlvit.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/paligemma/processing_paligemma.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/parakeet/feature_extraction_parakeet.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/phi3_v/image_processing_phi3_v.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/phi3_v/processing_phi3_v.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/pixtral/image_processing_pixtral.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/pixtral/processing_pixtral.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/processors.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/pvt/image_processing_pvt.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/pyannote/feature_extraction_pyannote.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/pyannote/processing_pyannote.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/qwen2_vl/image_processing_qwen2_vl.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/qwen2_vl/processing_qwen2_vl.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/rt_detr/image_processing_rt_detr.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/sam/image_processing_sam.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/sam/processing_sam.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/sam2/image_processing_sam2.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/sam2/processing_sam2.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/sam3/image_processing_sam3.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/seamless_m4t/feature_extraction_seamless_m4t.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/segformer/image_processing_segformer.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/siglip/image_processing_siglip.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/smolvlm/image_processing_smolvlm.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/smolvlm/processing_smolvlm.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/snac/feature_extraction_snac.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/speecht5/feature_extraction_speecht5.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/speecht5/processing_speecht5.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/swin2sr/image_processing_swin2sr.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/ultravox/processing_ultravox.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/vit/image_processing_vit.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/vitmatte/image_processing_vitmatte.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/vitpose/image_processing_vitpose.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/voxtral/processing_voxtral.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/wav2vec2/feature_extraction_wav2vec2.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/wav2vec2/processing_wav2vec2.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/wespeaker/feature_extraction_wespeaker.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/whisper/common_whisper.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/whisper/feature_extraction_whisper.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/whisper/generation_whisper.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/whisper/processing_whisper.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/models/yolos/image_processing_yolos.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/ops/registry.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/pipelines.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/tokenizers.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/transformers.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/audio.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/constants.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/core.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/data-structures.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/devices.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/dtypes.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/generic.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/hub.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/image.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/maths.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/tensor.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/@huggingface/transformers/src/utils/video.js","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/onnxruntime-node","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/onnxruntime-web","../../../../../../../node_modules/.pnpm/@huggingface+transformers@3.8.1/node_modules/sharp","../../../../../../../node_modules/.pnpm/@img+colour@1.1.0/node_modules/@img/colour/color.cjs","../../../../../../../node_modules/.pnpm/@img+colour@1.1.0/node_modules/@img/colour/index.cjs","../../../../../../../node_modules/.pnpm/@img+colour@1.1.0/node_modules/@img/colour/package.json","../../../../../../../node_modules/.pnpm/@img+sharp-darwin-arm64@0.34.5/node_modules/@img/sharp-darwin-arm64/LICENSE","../../../../../../../node_modules/.pnpm/@img+sharp-darwin-arm64@0.34.5/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node","../../../../../../../node_modules/.pnpm/@img+sharp-darwin-arm64@0.34.5/node_modules/@img/sharp-darwin-arm64/package.json","../../../../../../../node_modules/.pnpm/@img+sharp-darwin-arm64@0.34.5/node_modules/@img/sharp-libvips-darwin-arm64","../../../../../../../node_modules/.pnpm/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/lib/index.js","../../../../../../../node_modules/.pnpm/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib","../../../../../../../node_modules/.pnpm/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/package.json","../../../../../../../node_modules/.pnpm/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/versions.json","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/package.json","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.stat","../../../../../../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/run-parallel","../../../../../../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/package.json","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.scandir","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/package.json","../../../../../../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/fastq","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/database.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/index.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/methods/function.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/methods/table.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/lib/util.js","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/package.json","../../../../../../../node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/bindings","../../../../../../../node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/bindings.js","../../../../../../../node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/package.json","../../../../../../../node_modules/.pnpm/bindings@1.5.0/node_modules/file-uri-to-path","../../../../../../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js","../../../../../../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js","../../../../../../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js","../../../../../../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js","../../../../../../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js","../../../../../../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js","../../../../../../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js","../../../../../../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/package.json","../../../../../../../node_modules/.pnpm/braces@3.0.3/node_modules/fill-range","../../../../../../../node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/detect-libc.js","../../../../../../../node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/elf.js","../../../../../../../node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/filesystem.js","../../../../../../../node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/process.js","../../../../../../../node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/package.json","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/@nodelib/fs.stat","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/@nodelib/fs.walk","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/index.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/managers/tasks.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/async.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/deep.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/entry.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/error.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/matcher.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/partial.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/stream.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/sync.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/transformers/entry.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/async.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/stream.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/sync.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/settings.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/errno.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/fs.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/index.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/stream.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/string.js","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/package.json","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/glob-parent","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/merge2","../../../../../../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/micromatch","../../../../../../../node_modules/.pnpm/fastq@1.20.1/node_modules/fastq/package.json","../../../../../../../node_modules/.pnpm/fastq@1.20.1/node_modules/fastq/queue.js","../../../../../../../node_modules/.pnpm/fastq@1.20.1/node_modules/reusify","../../../../../../../node_modules/.pnpm/file-uri-to-path@1.0.0/node_modules/file-uri-to-path/index.js","../../../../../../../node_modules/.pnpm/file-uri-to-path@1.0.0/node_modules/file-uri-to-path/package.json","../../../../../../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js","../../../../../../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/package.json","../../../../../../../node_modules/.pnpm/fill-range@7.1.1/node_modules/to-regex-range","../../../../../../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js","../../../../../../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/package.json","../../../../../../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/is-glob","../../../../../../../node_modules/.pnpm/hnswlib-node@3.0.0/node_modules/bindings","../../../../../../../node_modules/.pnpm/hnswlib-node@3.0.0/node_modules/hnswlib-node/build/Release/addon.node","../../../../../../../node_modules/.pnpm/hnswlib-node@3.0.0/node_modules/hnswlib-node/lib/index.js","../../../../../../../node_modules/.pnpm/hnswlib-node@3.0.0/node_modules/hnswlib-node/package.json","../../../../../../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js","../../../../../../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/package.json","../../../../../../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-extglob","../../../../../../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js","../../../../../../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/package.json","../../../../../../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js","../../../../../../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/package.json","../../../../../../../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.js","../../../../../../../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/package.json","../../../../../../../node_modules/.pnpm/micromatch@4.0.8/node_modules/braces","../../../../../../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js","../../../../../../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/package.json","../../../../../../../node_modules/.pnpm/micromatch@4.0.8/node_modules/picomatch","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/client/components/app-router-headers.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/compiled/bytes/index.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/compiled/bytes/package.json","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/compiled/raw-body/index.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/compiled/raw-body/package.json","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/lib/client-and-server-references.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/lib/constants.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/lib/interop-default.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/lib/is-error.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/lib/semver-noop.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/lib/cache-handlers/default.external.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/lib/lru-cache.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/load-manifest.external.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/server/response-cache/types.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../../node_modules/.pnpm/next@15.5.19_react-dom@19.2.7_react@19.2.7__react@19.2.7_sass@1.101.0/node_modules/next/package.json","../../../../../../../node_modules/.pnpm/node_modules/onnxruntime-common","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/backend-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/backend.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/env-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/env.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/index.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/inference-session-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/inference-session.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/onnx-model.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/onnx-value.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/package.json","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/tensor-conversion-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/tensor-conversion.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/tensor-factory-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/tensor-factory.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/tensor-impl-type-mapping.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/tensor-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/tensor-utils-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/tensor.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/trace.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/dist/cjs/version.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.21.0/node_modules/onnxruntime-common/package.json","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/backend-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/backend.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/env-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/env.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/index.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/inference-session-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/inference-session.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/onnx-model.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/onnx-value.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/package.json","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/tensor-conversion-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/tensor-conversion.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/tensor-factory-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/tensor-factory.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/tensor-impl-type-mapping.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/tensor-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/tensor-utils-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/tensor.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/trace.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/cjs/version.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/backend-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/backend.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/env-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/env.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/index.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/inference-session-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/inference-session.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/onnx-model.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/onnx-value.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/package.json","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/tensor-conversion-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/tensor-conversion.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/tensor-factory-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/tensor-factory.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/tensor-impl-type-mapping.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/tensor-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/tensor-utils-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/tensor.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/trace.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/dist/esm/version.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common/package.json","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/backend-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/backend.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/env-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/env.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/index.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/inference-session-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/inference-session.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/onnx-model.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/onnx-value.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/package.json","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/tensor-conversion-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/tensor-conversion.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/tensor-factory-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/tensor-factory.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/tensor-impl-type-mapping.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/tensor-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/tensor-utils-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/tensor.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/trace.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/cjs/version.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/backend-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/backend.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/env-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/env.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/index.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/inference-session-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/inference-session.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/onnx-model.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/onnx-value.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/package.json","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/tensor-conversion-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/tensor-conversion.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/tensor-factory-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/tensor-factory.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/tensor-impl-type-mapping.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/tensor-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/tensor-utils-impl.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/tensor.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/trace.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/dist/esm/version.js","../../../../../../../node_modules/.pnpm/onnxruntime-common@1.27.0/node_modules/onnxruntime-common/package.json","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-common","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/darwin/arm64/libonnxruntime.1.21.0.dylib","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/darwin/arm64/onnxruntime_binding.node","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/darwin/x64/libonnxruntime.1.21.0.dylib","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/darwin/x64/onnxruntime_binding.node","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/linux/arm64/libonnxruntime.so.1","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/linux/arm64/libonnxruntime.so.1.21.0","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/linux/arm64/onnxruntime_binding.node","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/linux/x64/libonnxruntime.so.1","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/linux/x64/libonnxruntime.so.1.21.0","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/linux/x64/libonnxruntime_providers_shared.so","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/linux/x64/onnxruntime_binding.node","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/win32/arm64/onnxruntime_binding.node","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/bin/napi-v3/win32/x64/onnxruntime_binding.node","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/dist/backend.js","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/dist/binding.js","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/dist/index.js","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/dist/version.js","../../../../../../../node_modules/.pnpm/onnxruntime-node@1.21.0/node_modules/onnxruntime-node/package.json","../../../../../../../node_modules/.pnpm/onnxruntime-web@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-common","../../../../../../../node_modules/.pnpm/onnxruntime-web@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-web/dist/ort.node.min.js","../../../../../../../node_modules/.pnpm/onnxruntime-web@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-web/dist/ort.node.min.mjs","../../../../../../../node_modules/.pnpm/onnxruntime-web@1.22.0-dev.20250409-89f8206ba4/node_modules/onnxruntime-web/package.json","../../../../../../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/index.js","../../../../../../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js","../../../../../../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/parse.js","../../../../../../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js","../../../../../../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/scan.js","../../../../../../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js","../../../../../../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/package.json","../../../../../../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js","../../../../../../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/package.json","../../../../../../../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/package.json","../../../../../../../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js","../../../../../../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/queue-microtask","../../../../../../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.js","../../../../../../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/package.json","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/comparator.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/range.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/semver.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/cmp.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/coerce.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/eq.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gt.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gte.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lt.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lte.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/neq.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/parse.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/satisfies.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/constants.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/debug.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/identifiers.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/lrucache.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/parse-options.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/re.js","../../../../../../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/package.json","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/@img/colour","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/@img/sharp-darwin-arm64","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/@img/sharp-libvips-darwin-arm64","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/detect-libc","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/semver","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/channel.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/colour.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/composite.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/constructor.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/index.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/input.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/is.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/libvips.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/operation.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/output.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/resize.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/sharp.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/utility.js","../../../../../../../node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/package.json","../../../../../../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/is-number","../../../../../../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js","../../../../../../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/package.json","../../../../../../../package.json","../../../../../../../packages/knowledge/dist/chunking/bge-tokenizer.js","../../../../../../../packages/knowledge/dist/chunking/text-chunker.js","../../../../../../../packages/knowledge/dist/classification/classifier.js","../../../../../../../packages/knowledge/dist/constants.js","../../../../../../../packages/knowledge/dist/core/change-tracker.js","../../../../../../../packages/knowledge/dist/core/file-scanner.js","../../../../../../../packages/knowledge/dist/core/index-state-store.js","../../../../../../../packages/knowledge/dist/core/knowledge-base-manager.js","../../../../../../../packages/knowledge/dist/core/multi-project-manager.js","../../../../../../../packages/knowledge/dist/core/project-config.js","../../../../../../../packages/knowledge/dist/core/project-id.js","../../../../../../../packages/knowledge/dist/core/project-registry.js","../../../../../../../packages/knowledge/dist/dedup/dedup-engine.js","../../../../../../../packages/knowledge/dist/dedup/relationship-detector.js","../../../../../../../packages/knowledge/dist/embedding/embedding-provider.js","../../../../../../../packages/knowledge/dist/embedding/local-reranker.js","../../../../../../../packages/knowledge/dist/extraction/content-extractor.js","../../../../../../../packages/knowledge/dist/extraction/external-extractor.js","../../../../../../../packages/knowledge/dist/extraction/module-resolver.js","../../../../../../../packages/knowledge/dist/extraction/ocr-providers.js","../../../../../../../packages/knowledge/dist/index.js","../../../../../../../packages/knowledge/dist/search/federation-search.js","../../../../../../../packages/knowledge/dist/vector/collection-manager.js","../../../../../../../packages/knowledge/dist/vector/hnsw-vector-store.js","../../../../../../../packages/knowledge/dist/vector/vector-indexer.js","../../../../../../../packages/knowledge/node_modules/@huggingface/transformers","../../../../../../../packages/knowledge/node_modules/better-sqlite3","../../../../../../../packages/knowledge/node_modules/fast-glob","../../../../../../../packages/knowledge/node_modules/hnswlib-node","../../../../../../../packages/knowledge/package.json","../../../../../node_modules/@customize-agent/knowledge","../../../../../node_modules/better-sqlite3","../../../../../node_modules/next","../../../../../package.json","../../../../package.json","../../../chunks/9705.js","../../../webpack-api-runtime.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=5796,a.ids=[5796],a.modules={19898:a=>{a.exports=require("@customize-agent/knowledge")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},33873:a=>{a.exports=require("path")},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79646:a=>{a.exports=require("child_process")},87176:(a,b,c)=>{c.r(b),c.d(b,{config:()=>r,default:()=>q,handler:()=>t});var d={};c.r(d),c.d(d,{default:()=>n});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(29021),j=c(33873),k=c(44533),l=c(48203),m=c(37095);async function n(a,b){if("POST"!==a.method)return b.status(405).json({error:"method not allowed"});try{let c=a.body?.projectRoot||(0,k.aY)(),d=a.body?.relativePath;if(!c||!d)return b.status(400).json({error:"projectRoot and relativePath are required"});let e=j.join(c,"knowledgeBase"),f=j.resolve(e,d);if(!f.startsWith(j.resolve(e)+j.sep))return b.status(400).json({error:"invalid relativePath"});if(!i.existsSync(f))return b.status(404).json({error:"file not found"});let g=(0,l.ls)(c);if(
|
|
1
|
+
"use strict";(()=>{var a={};a.id=5796,a.ids=[5796],a.modules={19898:a=>{a.exports=require("@customize-agent/knowledge")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},33873:a=>{a.exports=require("path")},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79646:a=>{a.exports=require("child_process")},87176:(a,b,c)=>{c.r(b),c.d(b,{config:()=>r,default:()=>q,handler:()=>t});var d={};c.r(d),c.d(d,{default:()=>n});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(29021),j=c(33873),k=c(44533),l=c(48203),m=c(37095);async function n(a,b){if("POST"!==a.method)return b.status(405).json({error:"method not allowed"});try{let c=a.body?.projectRoot||(0,k.aY)(),d=a.body?.relativePath;if(!c||!d)return b.status(400).json({error:"projectRoot and relativePath are required"});let e=j.join(c,"knowledgeBase"),f=j.resolve(e,d);if(!f.startsWith(j.resolve(e)+j.sep))return b.status(400).json({error:"invalid relativePath"});if(!i.existsSync(f))return b.status(404).json({error:"file or folder not found"});let g=i.statSync(f),h=g.isDirectory()?function a(b,c){let d=[];for(let e of i.readdirSync(b,{withFileTypes:!0})){let f=j.join(b,e.name);e.isDirectory()?d.push(...a(f,c)):e.name.endsWith(".source.txt")||d.push(j.relative(c,f).split(j.sep).join("/"))}return d}(f,e):[d];if(0===h.length)return b.status(400).json({error:"folder has no indexable files"});let n=(0,l.ls)(c);if(n){let a=(0,m.JB)(c,n.operationId);return b.status(202).json({success:!0,accepted:!0,alreadyRunning:!0,operationId:n.operationId,job:a})}let o=`file-reindex-${Date.now()}-${Math.random().toString(36).slice(2)}`,p=g.isDirectory()?`重新解析文件夹 ${d}`:`重新解析 ${d}`,q=(0,m.Qf)(c,{id:o,type:"reindex",title:p,stage:"uploading",status:"processing",percent:5,message:g.isDirectory()?`文件夹重新解析任务已提交,共 ${h.length} 个文件`:"单文件重新解析任务已提交,正在后台排队执行",filePath:d,fileName:d.split("/").filter(Boolean).pop()});return(0,l.DA)({id:o,projectRoot:c,relativePath:d,relativePaths:h,forceReindexAll:!1}),b.status(202).json({success:!0,accepted:!0,operationId:o,job:q,fileCount:h.length})}catch(a){console.error("[api] kb/files/reindex",a),b.status(500).json({error:"Internal server error"})}}var o=c(68970),p=c(50296);let q=(0,h.M)(d,"default"),r=(0,h.M)(d,"config"),s=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/files/reindex",pathname:"/api/kb/files/reindex",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function t(a,b,c){let d=await s.prepare(a,b,{srcPage:"/api/kb/files/reindex"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,o.getTracer)(),e=d.getActiveScopeSpan(),j=s.instrumentationOnRequestError.bind(s),k=async e=>s.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:s.isDev,page:"/api/kb/files/reindex",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(p.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:o.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(s.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},87550:a=>{a.exports=require("better-sqlite3")}};var b=require("../../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705,8203],()=>b(b.s=87176));module.exports=c})();
|