@customize-agent/server 4.22.1 → 4.22.3
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 +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/chunks/208.js +3 -3
- package/.next/server/chunks/4931.js +9 -9
- package/.next/server/chunks/5284.js +18 -9
- package/.next/server/chunks/8163.js +7 -7
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/api/jobs/[id].js +2 -2
- package/.next/server/pages/api/jobs.js +2 -2
- package/.next/server/pages/api/kb/categories.js +2 -2
- package/.next/server/pages/api/kb/duplicates.js +2 -2
- package/.next/server/pages/api/kb/evaluate.js +2 -2
- package/.next/server/pages/api/kb/files/detail.js +2 -2
- package/.next/server/pages/api/kb/files/export.js +2 -2
- package/.next/server/pages/api/kb/files/open.js +2 -2
- package/.next/server/pages/api/kb/files/preview-pdf-page.js +2 -2
- package/.next/server/pages/api/kb/files/search.js +2 -2
- package/.next/server/pages/api/kb/files/tree.js +2 -2
- package/.next/server/pages/api/kb/files.js +2 -2
- package/.next/server/pages/api/kb/ignore.js +2 -2
- package/.next/server/pages/api/kb/operations.js +2 -2
- package/.next/server/pages/api/kb/search.js +2 -2
- package/.next/server/pages/api/kb/stats.js +2 -2
- package/.next/server/pages/api/kb/tags.js +2 -2
- package/.next/server/pages/api/kb/upload/progress.js +2 -2
- 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/template-references.html +1 -1
- package/.next/server/pages-manifest.json +31 -31
- package/package.json +1 -1
- /package/.next/static/{07Y_5mRHzJpxIj7CoRu6M → j8fr40eY_GBXxJqTLN5qq}/_buildManifest.js +0 -0
- /package/.next/static/{07Y_5mRHzJpxIj7CoRu6M → j8fr40eY_GBXxJqTLN5qq}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=2864,a.ids=[2864],a.modules={17532:a=>{a.exports=import("pdfjs-dist/legacy/build/pdf.mjs")},19898:a=>{a.exports=require("@customize-agent/knowledge")},21820:a=>{a.exports=require("os")},28183:a=>{a.exports=require("@napi-rs/canvas")},29021:a=>{a.exports=require("fs")},29283:(a,b,c)=>{c.r(b),c.d(b,{config:()=>o,default:()=>n,handler:()=>q});var d={};c.r(d),c.d(d,{config:()=>j,default:()=>k});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);let j={api:{responseLimit:!1}};async function k(a,b){if("GET"!==a.method)return b.status(405).json({error:"Method not allowed"});try{let d=a.query.projectRoot||(0,i.aY)(),e=a.query.relativePath,f=Math.max(1,Number(a.query.page??1));if(!d||!e)return b.status(400).json({error:"projectRoot and relativePath are required"});let g=(await (0,i.Qh)().getProject(d)).getFileDetail(e);if(!g?.absolutePath||"pdf"!==g.file.format)return b.status(404).json({error:"pdf not found"});let[{createCanvas:h},j]=await Promise.all([Promise.resolve().then(c.t.bind(c,28183,23)),Promise.resolve().then(c.bind(c,17532))]),k=await Promise.resolve().then(c.t.bind(c,73024,23)),l=new Uint8Array(k.readFileSync(g.absolutePath)),m=await j.getDocument({data:l}).promise,n=await m.getPage(Math.min(f,m.numPages)),o=n.getViewport({scale:1.6}),p=h(Math.ceil(o.width),Math.ceil(o.height));await n.render({canvasContext:p.getContext("2d"),viewport:o}).promise,b.setHeader("Content-Type","image/png"),b.setHeader("Cache-Control","private, max-age=3600"),b.status(200).send(p.toBuffer("image/png"))}catch(a){console.error("[api] kb/files/preview-pdf-page",a),b.status(500).json({error:"Internal server error"})}}var l=c(68970),m=c(50296);let n=(0,h.M)(d,"default"),o=(0,h.M)(d,"config"),p=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/files/preview-pdf-page",pathname:"/api/kb/files/preview-pdf-page",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function q(a,b,c){let d=await p.prepare(a,b,{srcPage:"/api/kb/files/preview-pdf-page"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,l.getTracer)(),e=d.getActiveScopeSpan(),j=p.instrumentationOnRequestError.bind(p),k=async e=>p.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:p.isDev,page:"/api/kb/files/preview-pdf-page",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(m.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:l.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(p.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},33873:a=>{a.exports=require("path")},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m
|
|
1
|
+
"use strict";(()=>{var a={};a.id=2864,a.ids=[2864],a.modules={17532:a=>{a.exports=import("pdfjs-dist/legacy/build/pdf.mjs")},19898:a=>{a.exports=require("@customize-agent/knowledge")},21820:a=>{a.exports=require("os")},28183:a=>{a.exports=require("@napi-rs/canvas")},29021:a=>{a.exports=require("fs")},29283:(a,b,c)=>{c.r(b),c.d(b,{config:()=>o,default:()=>n,handler:()=>q});var d={};c.r(d),c.d(d,{config:()=>j,default:()=>k});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);let j={api:{responseLimit:!1}};async function k(a,b){if("GET"!==a.method)return b.status(405).json({error:"Method not allowed"});try{let d=a.query.projectRoot||(0,i.aY)(),e=a.query.relativePath,f=Math.max(1,Number(a.query.page??1));if(!d||!e)return b.status(400).json({error:"projectRoot and relativePath are required"});let g=(await (0,i.Qh)().getProject(d)).getFileDetail(e);if(!g?.absolutePath||"pdf"!==g.file.format)return b.status(404).json({error:"pdf not found"});let[{createCanvas:h},j]=await Promise.all([Promise.resolve().then(c.t.bind(c,28183,23)),Promise.resolve().then(c.bind(c,17532))]),k=await Promise.resolve().then(c.t.bind(c,73024,23)),l=new Uint8Array(k.readFileSync(g.absolutePath)),m=await j.getDocument({data:l}).promise,n=await m.getPage(Math.min(f,m.numPages)),o=n.getViewport({scale:1.6}),p=h(Math.ceil(o.width),Math.ceil(o.height));await n.render({canvasContext:p.getContext("2d"),viewport:o}).promise,b.setHeader("Content-Type","image/png"),b.setHeader("Cache-Control","private, max-age=3600"),b.status(200).send(p.toBuffer("image/png"))}catch(a){console.error("[api] kb/files/preview-pdf-page",a),b.status(500).json({error:"Internal server error"})}}var l=c(68970),m=c(50296);let n=(0,h.M)(d,"default"),o=(0,h.M)(d,"config"),p=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/files/preview-pdf-page",pathname:"/api/kb/files/preview-pdf-page",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function q(a,b,c){let d=await p.prepare(a,b,{srcPage:"/api/kb/files/preview-pdf-page"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,l.getTracer)(),e=d.getActiveScopeSpan(),j=p.instrumentationOnRequestError.bind(p),k=async e=>p.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:p.isDev,page:"/api/kb/files/preview-pdf-page",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(m.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:l.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(p.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},33873:a=>{a.exports=require("path")},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m});var d=c(19898),e=c(33873),f=c(21820),g=c(29021);let h=null;function i(){return e.join(f.homedir(),".customize-agent")}function j(a){return(0,d.getProjectKbPath)(e.resolve(a))}function k(){return h||(h=new d.MultiProjectManager(i())),h}function l(a){let b=e.resolve(a),c=e.resolve(e.join(f.homedir(),".customize-agent"));return!(g.existsSync(e.join(b,"pnpm-workspace.yaml"))&&g.existsSync(e.join(b,"apps","server")))&&(b===c||b.includes(`${e.sep}.customize-agent${e.sep}`)||b.endsWith(`${e.sep}apps${e.sep}server`)||b.endsWith(`${e.sep}apps${e.sep}cli`))}function m(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&g.existsSync(a)&&!l(a))return e.resolve(a);let b=function(){let a=e.join(i(),"projects","registry.db");if(!g.existsSync(a))return[];let b=new((0,d.loadBetterSqlite3)())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>e.resolve(a.project_root)).filter(a=>!l(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!l(process.env.INIT_CWD)?process.env.INIT_CWD:e.resolve(process.cwd(),"../..")}function n(a,b={}){let c=new Map;for(let b of function(a){let b=e.join(f.homedir(),".customize-agent","projects",(0,d.computeProjectId)(e.resolve(a)),"kb.db");if(!g.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=j(a);if(!g.existsSync(b))return[];let c=[],d=a=>{for(let f of g.readdirSync(a,{withFileTypes:!0})){let h=e.join(a,f.name);if(f.isDirectory()){d(h);continue}if(f.name.endsWith(".source.txt"))continue;let i=g.statSync(h),j=e.relative(b,h).split(e.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:e.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:i.size,mtime:i.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 o(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=n(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
2
2
|
${a.category}
|
|
3
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 k().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}}
|
|
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 k().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}}},73024:a=>{a.exports=require("node:fs")},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")}};var b=require("../../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=29283));module.exports=c})();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=6251,a.ids=[6251],a.modules={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")},33873:a=>{a.exports=require("path")},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m
|
|
1
|
+
"use strict";(()=>{var a={};a.id=6251,a.ids=[6251],a.modules={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")},33873:a=>{a.exports=require("path")},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m});var d=c(19898),e=c(33873),f=c(21820),g=c(29021);let h=null;function i(){return e.join(f.homedir(),".customize-agent")}function j(a){return(0,d.getProjectKbPath)(e.resolve(a))}function k(){return h||(h=new d.MultiProjectManager(i())),h}function l(a){let b=e.resolve(a),c=e.resolve(e.join(f.homedir(),".customize-agent"));return!(g.existsSync(e.join(b,"pnpm-workspace.yaml"))&&g.existsSync(e.join(b,"apps","server")))&&(b===c||b.includes(`${e.sep}.customize-agent${e.sep}`)||b.endsWith(`${e.sep}apps${e.sep}server`)||b.endsWith(`${e.sep}apps${e.sep}cli`))}function m(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&g.existsSync(a)&&!l(a))return e.resolve(a);let b=function(){let a=e.join(i(),"projects","registry.db");if(!g.existsSync(a))return[];let b=new((0,d.loadBetterSqlite3)())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>e.resolve(a.project_root)).filter(a=>!l(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!l(process.env.INIT_CWD)?process.env.INIT_CWD:e.resolve(process.cwd(),"../..")}function n(a,b={}){let c=new Map;for(let b of function(a){let b=e.join(f.homedir(),".customize-agent","projects",(0,d.computeProjectId)(e.resolve(a)),"kb.db");if(!g.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=j(a);if(!g.existsSync(b))return[];let c=[],d=a=>{for(let f of g.readdirSync(a,{withFileTypes:!0})){let h=e.join(a,f.name);if(f.isDirectory()){d(h);continue}if(f.name.endsWith(".source.txt"))continue;let i=g.statSync(h),j=e.relative(b,h).split(e.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:e.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:i.size,mtime:i.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 o(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=n(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
2
2
|
${a.category}
|
|
3
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 k().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}}
|
|
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 k().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}}},46688:(a,b,c)=>{c.r(b),c.d(b,{config:()=>o,default:()=>n,handler:()=>q});var d={};c.r(d),c.d(d,{default:()=>k});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);async function j(a,b){if("GET"!==a.method)return b.status(405).json({error:"Method not allowed"});let c=a.query.projectRoot||(0,i.aY)();if(!c)return b.status(200).json({files:[],total:0});let d=String(a.query.q||""),e="string"==typeof a.query.category&&a.query.category?a.query.category:void 0,f=parseInt(a.query.limit||"50",10),g="0"!==a.query.includeContent,h=await (0,i.VS)(c,{query:d,category:e,limit:f,includeContent:g});return b.status(200).json(h)}let k=(0,c(16006).j)("api/kb/files/search",j);var l=c(68970),m=c(50296);let n=(0,h.M)(d,"default"),o=(0,h.M)(d,"config"),p=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/files/search",pathname:"/api/kb/files/search",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function q(a,b,c){let d=await p.prepare(a,b,{srcPage:"/api/kb/files/search"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,l.getTracer)(),e=d.getActiveScopeSpan(),j=p.instrumentationOnRequestError.bind(p),k=async e=>p.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:p.isDev,page:"/api/kb/files/search",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(m.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:l.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(p.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},91879:(a,b,c)=>{c.d(b,{hH:()=>p,mG:()=>s,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)}
|
|
5
5
|
`)}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(a,b,c,d=20){let e=0,f=0;return g=>{try{b(g);let h=Date.now();h-e>6e4&&(e=h,f=0),f<d&&(f+=1,c(a,g))}catch{}}}function s(){q||(q=!0,process.on("uncaughtException",r("uncaughtException",a=>n({source:"process",functionName:"uncaughtException",error:a}),(a,b)=>console.error(`[process] ${a}`,b))),process.on("unhandledRejection",r("unhandledRejection",a=>n({source:"process",functionName:"unhandledRejection",error:a}),(a,b)=>console.error(`[process] ${a}`,b))))}}};var b=require("../../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=46688));module.exports=c})();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=4111,a.ids=[4111],a.modules={7307:(a,b,c)=>{c.r(b),c.d(b,{config:()=>o,default:()=>n,handler:()=>q});var d={};c.r(d),c.d(d,{default:()=>k});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);async function j(a,b){if("GET"!==a.method)return b.status(405).json({error:"Method not allowed"});let c=a.query.projectRoot||(0,i.aY)();if(!c)return b.status(200).json({nodes:[]});let d=String(a.query.parentPath||"").replace(/^\/+|\/+$/gu,""),e=(0,i.Yy)(c),f=new Map;for(let a of e){if(d&&a.relativePath!==d&&!a.relativePath.startsWith(`${d}/`))continue;let b=d?a.relativePath.slice(d.length).replace(/^\//u,""):a.relativePath;if(!b)continue;let[c,...e]=b.split("/");if(!c)continue;let g=e.length>0,h=d?`${d}/${c}`:c,i=f.get(h);i?g&&(i.fileCount=(i.fileCount||0)+1):f.set(h,{key:h,title:c,isFolder:g,isLeaf:!g,fileCount:g?1:void 0})}let g=Array.from(f.values()).sort((a,b)=>a.isFolder&&!b.isFolder?-1:!a.isFolder&&b.isFolder?1:a.title.localeCompare(b.title,"zh-CN"));return b.status(200).json({nodes:g})}let k=(0,c(16006).j)("api/kb/files/tree",j);var l=c(68970),m=c(50296);let n=(0,h.M)(d,"default"),o=(0,h.M)(d,"config"),p=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/files/tree",pathname:"/api/kb/files/tree",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function q(a,b,c){let d=await p.prepare(a,b,{srcPage:"/api/kb/files/tree"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,l.getTracer)(),e=d.getActiveScopeSpan(),j=p.instrumentationOnRequestError.bind(p),k=async e=>p.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:p.isDev,page:"/api/kb/files/tree",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(m.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:l.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(p.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},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")},33873:a=>{a.exports=require("path")},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m
|
|
1
|
+
"use strict";(()=>{var a={};a.id=4111,a.ids=[4111],a.modules={7307:(a,b,c)=>{c.r(b),c.d(b,{config:()=>o,default:()=>n,handler:()=>q});var d={};c.r(d),c.d(d,{default:()=>k});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);async function j(a,b){if("GET"!==a.method)return b.status(405).json({error:"Method not allowed"});let c=a.query.projectRoot||(0,i.aY)();if(!c)return b.status(200).json({nodes:[]});let d=String(a.query.parentPath||"").replace(/^\/+|\/+$/gu,""),e=(0,i.Yy)(c),f=new Map;for(let a of e){if(d&&a.relativePath!==d&&!a.relativePath.startsWith(`${d}/`))continue;let b=d?a.relativePath.slice(d.length).replace(/^\//u,""):a.relativePath;if(!b)continue;let[c,...e]=b.split("/");if(!c)continue;let g=e.length>0,h=d?`${d}/${c}`:c,i=f.get(h);i?g&&(i.fileCount=(i.fileCount||0)+1):f.set(h,{key:h,title:c,isFolder:g,isLeaf:!g,fileCount:g?1:void 0})}let g=Array.from(f.values()).sort((a,b)=>a.isFolder&&!b.isFolder?-1:!a.isFolder&&b.isFolder?1:a.title.localeCompare(b.title,"zh-CN"));return b.status(200).json({nodes:g})}let k=(0,c(16006).j)("api/kb/files/tree",j);var l=c(68970),m=c(50296);let n=(0,h.M)(d,"default"),o=(0,h.M)(d,"config"),p=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/files/tree",pathname:"/api/kb/files/tree",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function q(a,b,c){let d=await p.prepare(a,b,{srcPage:"/api/kb/files/tree"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,l.getTracer)(),e=d.getActiveScopeSpan(),j=p.instrumentationOnRequestError.bind(p),k=async e=>p.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:p.isDev,page:"/api/kb/files/tree",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(m.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:l.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(p.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},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")},33873:a=>{a.exports=require("path")},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m});var d=c(19898),e=c(33873),f=c(21820),g=c(29021);let h=null;function i(){return e.join(f.homedir(),".customize-agent")}function j(a){return(0,d.getProjectKbPath)(e.resolve(a))}function k(){return h||(h=new d.MultiProjectManager(i())),h}function l(a){let b=e.resolve(a),c=e.resolve(e.join(f.homedir(),".customize-agent"));return!(g.existsSync(e.join(b,"pnpm-workspace.yaml"))&&g.existsSync(e.join(b,"apps","server")))&&(b===c||b.includes(`${e.sep}.customize-agent${e.sep}`)||b.endsWith(`${e.sep}apps${e.sep}server`)||b.endsWith(`${e.sep}apps${e.sep}cli`))}function m(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&g.existsSync(a)&&!l(a))return e.resolve(a);let b=function(){let a=e.join(i(),"projects","registry.db");if(!g.existsSync(a))return[];let b=new((0,d.loadBetterSqlite3)())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>e.resolve(a.project_root)).filter(a=>!l(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!l(process.env.INIT_CWD)?process.env.INIT_CWD:e.resolve(process.cwd(),"../..")}function n(a,b={}){let c=new Map;for(let b of function(a){let b=e.join(f.homedir(),".customize-agent","projects",(0,d.computeProjectId)(e.resolve(a)),"kb.db");if(!g.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=j(a);if(!g.existsSync(b))return[];let c=[],d=a=>{for(let f of g.readdirSync(a,{withFileTypes:!0})){let h=e.join(a,f.name);if(f.isDirectory()){d(h);continue}if(f.name.endsWith(".source.txt"))continue;let i=g.statSync(h),j=e.relative(b,h).split(e.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:e.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:i.size,mtime:i.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 o(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=n(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
2
2
|
${a.category}
|
|
3
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 k().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}}
|
|
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 k().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")},91879:(a,b,c)=>{c.d(b,{hH:()=>p,mG:()=>s,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)}
|
|
5
5
|
`)}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(a,b,c,d=20){let e=0,f=0;return g=>{try{b(g);let h=Date.now();h-e>6e4&&(e=h,f=0),f<d&&(f+=1,c(a,g))}catch{}}}function s(){q||(q=!0,process.on("uncaughtException",r("uncaughtException",a=>n({source:"process",functionName:"uncaughtException",error:a}),(a,b)=>console.error(`[process] ${a}`,b))),process.on("unhandledRejection",r("unhandledRejection",a=>n({source:"process",functionName:"unhandledRejection",error:a}),(a,b)=>console.error(`[process] ${a}`,b))))}}};var b=require("../../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=7307));module.exports=c})();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";(()=>{var a={};a.id=5592,a.ids=[5592],a.modules={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")},24501:(a,b,c)=>{c.r(b),c.d(b,{config:()=>q,default:()=>p,handler:()=>s});var d={};c.r(d),c.d(d,{default:()=>m});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533),j=c(37095);async function k(a,b){if(!["GET","DELETE","POST"].includes(a.method))return b.status(405).json({error:"Method not allowed"});let c="string"==typeof a.body?.projectRoot?a.body.projectRoot:void 0,d=a.query.projectRoot||c||(0,i.aY)();if(!d)return b.status(200).json({files:[],total:0});if("GET"===a.method&&"1"!==a.query.reindex){let c=a.query.category,e=parseInt(a.query.page||"1",10),f=parseInt(a.query.limit||"50",10),g=(0,i.Yy)(d,{category:c}),h=g.length,j=g.slice((e-1)*f,e*f),k=(await (0,i.Qh)().getProject(d)).getVectorStatus();return b.status(200).json({files:j,total:h,page:e,limit:f,vectorStatus:k,initializing:!1})}if("POST"===a.method&&"1"!==a.query.reindex)return b.status(400).json({error:"reindex=1 is required"});let e=await (0,i.Qh)().getProject(d);if("POST"===a.method||"1"===a.query.reindex){if("1"!==a.query.reindex)return b.status(400).json({error:"reindex=1 is required"});await e.incrementalIndex();let c=a.query.category,f=parseInt(a.query.page||"1",10),g=parseInt(a.query.limit||"50",10),h=(0,i.Yy)(d,{category:c}),j=e.getVectorStatus(),k=h.length,l=h.slice((f-1)*g,f*g);return b.status(200).json({files:l,total:k,page:f,limit:g,vectorStatus:j})}if("DELETE"===a.method){let{relativePath:c,relativePaths:f,folderPath:g,folderPaths:h,all:k}=a.body,l=(0,i.Yy)(d),m=Array.from(new Set([...k?l.map(a=>a.relativePath):Array.isArray(f)?f.map(String):c?[String(c)]:[],...(Array.isArray(h)?h.map(String):g?[String(g)]:[]).flatMap(a=>{let b=a.replace(/^\/+|\/+$/gu,"");return l.filter(a=>a.relativePath===b||a.relativePath.startsWith(`${b}/`)).map(a=>a.relativePath)})]));if(0===m.length)return b.status(400).json({error:"relativePath, relativePaths or folderPaths is required"});let n=`delete-${Date.now()}-${Math.random().toString(36).slice(2)}`,o=k?`删除全部用户文件 ${m.length} 个`:1===m.length?`删除 ${m[0]}`:`批量删除 ${m.length} 个文件`;(0,j.Qf)(d,{id:n,type:"delete",title:o,stage:"uploading",status:"processing",percent:10,message:"正在删除文件和索引",filePath:m[0],fileName:m[0]?.split("/").pop()});let p=0;for(let a of m)await e.removeFile(a),p++,(0,j.Qf)(d,{id:n,type:"delete",title:o,stage:"uploading",status:"processing",percent:Math.min(95,Math.round(p/m.length*90)),message:`已删除 ${p}/${m.length}`,filePath:a,fileName:a.split("/").pop()});return(0,j.Qf)(d,{id:n,type:"delete",title:o,stage:"done",status:"success",percent:100,message:`已删除 ${p} 个文件和索引`,filePath:m[0],fileName:m[0]?.split("/").pop()}),b.status(200).json({success:!0,deleted:p})}let f=a.query.category,g=parseInt(a.query.page||"1",10),h=parseInt(a.query.limit||"50",10),k=(0,i.Yy)(d,{category:f}),l=e.getVectorStatus(),m=k.length,n=k.slice((g-1)*h,g*h);return b.status(200).json({files:n,total:m,page:g,limit:h,vectorStatus:l})}let l=(0,c(16006).j)("api/kb/files",k);async function m(a,b){return l(a,b)}var n=c(68970),o=c(50296);let p=(0,h.M)(d,"default"),q=(0,h.M)(d,"config"),r=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/files",pathname:"/api/kb/files",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function s(a,b,c){let d=await r.prepare(a,b,{srcPage:"/api/kb/files"});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,n.getTracer)(),e=d.getActiveScopeSpan(),j=r.instrumentationOnRequestError.bind(r),k=async e=>r.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:r.isDev,page:"/api/kb/files",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")!==o.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(o.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:n.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(r.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},29021:a=>{a.exports=require("fs")},33873:a=>{a.exports=require("path")},37095:(a,b,c)=>{c.d(b,{CU:()=>t,H7:()=>s,JB:()=>p,Qf:()=>n,kW:()=>q,oy:()=>o,sn:()=>r});var d=c(29021),e=c(21820),f=c(33873),g=c(19898);function h(a){return f.join(e.homedir(),".customize-agent","projects",(0,g.computeProjectId)(a),"kb-operations.jsonl")}function i(a,b){let c=h(a);d.mkdirSync(f.dirname(c),{recursive:!0});let e=`${c}.${process.pid}.${Date.now()}.tmp`;d.writeFileSync(e,`${b.slice(-200).map(a=>JSON.stringify(a)).join("\n")}
|
|
2
|
-
`,"utf8"),d.renameSync(e,c);let g=k.get(a);g&&(g.mtimeMs=l(c))}let j=Math.round(Date.now()-1e3*process.uptime()),k=new Map;function l(a){try{return d.statSync(a).mtimeMs}catch{return 0}}function m(a){let b=h(a),c=l(b),e=k.get(a);if(e&&e.mtimeMs===c)return e.records;let f=function(a){let b=function(a){let b=h(a);return d.existsSync(b)?d.readFileSync(b,"utf8").split("\n").filter(Boolean).flatMap(a=>{try{return[JSON.parse(a)]}catch{return[]}}):[]}(a),c=b.filter(a=>"processing"===a.status&&a.updatedAt<j);if(c.length>0){let d=Date.now();for(let a of c)a.status="error",a.stage="error",a.error="服务重启导致任务中断,未完成",a.message=a.error,a.updatedAt=d;i(a,b)}return b}(a);return k.set(a,{mtimeMs:l(b),records:f}),f}function n(a,b){let c=Date.now(),d=m(a),e=d.findIndex(a=>a.id===b.id),f=e>=0?d[e]:void 0,g={id:b.id,type:b.type,title:b.title,stage:b.stage??f?.stage??"uploading",status:b.status??f?.status??"processing",message:b.message??f?.message??"",percent:b.percent??f?.percent??0,fileName:b.fileName??f?.fileName,filePath:b.filePath??f?.filePath,chunkCount:b.chunkCount??f?.chunkCount,textLength:b.textLength??f?.textLength,extractionMode:b.extractionMode??f?.extractionMode,error:b.status&&"error"!==b.status?void 0:b.error??f?.error,details:b.details??f?.details,createdAt:f?.createdAt??c,updatedAt:c};return e>=0?d[e]=g:d.push(g),i(a,d),g}function o(a,b=50){return m(a).sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,b)}function p(a,b){return m(a).find(a=>a.id===b)}function q(a,b){return m(a).filter(a=>!b||a.type===b).sort((a,b)=>b.updatedAt-a.updatedAt)[0]}function r(a){return m(a).filter(a=>"processing"===a.status).sort((a,b)=>b.updatedAt-a.updatedAt)}function s(a){let b=m(a),c=h(a);return d.existsSync(c)&&d.unlinkSync(c),k.delete(a),b.length}function t(a,b){let c=m(a),d=c.findIndex(a=>a.id===b);return!(d<0)&&(c.splice(d,1),i(a,c),!0)}},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m
|
|
2
|
+
`,"utf8"),d.renameSync(e,c);let g=k.get(a);g&&(g.mtimeMs=l(c))}let j=Math.round(Date.now()-1e3*process.uptime()),k=new Map;function l(a){try{return d.statSync(a).mtimeMs}catch{return 0}}function m(a){let b=h(a),c=l(b),e=k.get(a);if(e&&e.mtimeMs===c)return e.records;let f=function(a){let b=function(a){let b=h(a);return d.existsSync(b)?d.readFileSync(b,"utf8").split("\n").filter(Boolean).flatMap(a=>{try{return[JSON.parse(a)]}catch{return[]}}):[]}(a),c=b.filter(a=>"processing"===a.status&&a.updatedAt<j);if(c.length>0){let d=Date.now();for(let a of c)a.status="error",a.stage="error",a.error="服务重启导致任务中断,未完成",a.message=a.error,a.updatedAt=d;i(a,b)}return b}(a);return k.set(a,{mtimeMs:l(b),records:f}),f}function n(a,b){let c=Date.now(),d=m(a),e=d.findIndex(a=>a.id===b.id),f=e>=0?d[e]:void 0,g={id:b.id,type:b.type,title:b.title,stage:b.stage??f?.stage??"uploading",status:b.status??f?.status??"processing",message:b.message??f?.message??"",percent:b.percent??f?.percent??0,fileName:b.fileName??f?.fileName,filePath:b.filePath??f?.filePath,chunkCount:b.chunkCount??f?.chunkCount,textLength:b.textLength??f?.textLength,extractionMode:b.extractionMode??f?.extractionMode,error:b.status&&"error"!==b.status?void 0:b.error??f?.error,details:b.details??f?.details,createdAt:f?.createdAt??c,updatedAt:c};return e>=0?d[e]=g:d.push(g),i(a,d),g}function o(a,b=50){return m(a).sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,b)}function p(a,b){return m(a).find(a=>a.id===b)}function q(a,b){return m(a).filter(a=>!b||a.type===b).sort((a,b)=>b.updatedAt-a.updatedAt)[0]}function r(a){return m(a).filter(a=>"processing"===a.status).sort((a,b)=>b.updatedAt-a.updatedAt)}function s(a){let b=m(a),c=h(a);return d.existsSync(c)&&d.unlinkSync(c),k.delete(a),b.length}function t(a,b){let c=m(a),d=c.findIndex(a=>a.id===b);return!(d<0)&&(c.splice(d,1),i(a,c),!0)}},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m});var d=c(19898),e=c(33873),f=c(21820),g=c(29021);let h=null;function i(){return e.join(f.homedir(),".customize-agent")}function j(a){return(0,d.getProjectKbPath)(e.resolve(a))}function k(){return h||(h=new d.MultiProjectManager(i())),h}function l(a){let b=e.resolve(a),c=e.resolve(e.join(f.homedir(),".customize-agent"));return!(g.existsSync(e.join(b,"pnpm-workspace.yaml"))&&g.existsSync(e.join(b,"apps","server")))&&(b===c||b.includes(`${e.sep}.customize-agent${e.sep}`)||b.endsWith(`${e.sep}apps${e.sep}server`)||b.endsWith(`${e.sep}apps${e.sep}cli`))}function m(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&g.existsSync(a)&&!l(a))return e.resolve(a);let b=function(){let a=e.join(i(),"projects","registry.db");if(!g.existsSync(a))return[];let b=new((0,d.loadBetterSqlite3)())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>e.resolve(a.project_root)).filter(a=>!l(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!l(process.env.INIT_CWD)?process.env.INIT_CWD:e.resolve(process.cwd(),"../..")}function n(a,b={}){let c=new Map;for(let b of function(a){let b=e.join(f.homedir(),".customize-agent","projects",(0,d.computeProjectId)(e.resolve(a)),"kb.db");if(!g.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=j(a);if(!g.existsSync(b))return[];let c=[],d=a=>{for(let f of g.readdirSync(a,{withFileTypes:!0})){let h=e.join(a,f.name);if(f.isDirectory()){d(h);continue}if(f.name.endsWith(".source.txt"))continue;let i=g.statSync(h),j=e.relative(b,h).split(e.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:e.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:i.size,mtime:i.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 o(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=n(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
3
3
|
${a.category}
|
|
4
4
|
${a.format}
|
|
5
|
-
${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 k().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}}
|
|
5
|
+
${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 k().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")},91879:(a,b,c)=>{c.d(b,{hH:()=>p,mG:()=>s,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)}
|
|
6
6
|
`)}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(a,b,c,d=20){let e=0,f=0;return g=>{try{b(g);let h=Date.now();h-e>6e4&&(e=h,f=0),f<d&&(f+=1,c(a,g))}catch{}}}function s(){q||(q=!0,process.on("uncaughtException",r("uncaughtException",a=>n({source:"process",functionName:"uncaughtException",error:a}),(a,b)=>console.error(`[process] ${a}`,b))),process.on("unhandledRejection",r("unhandledRejection",a=>n({source:"process",functionName:"unhandledRejection",error:a}),(a,b)=>console.error(`[process] ${a}`,b))))}}};var b=require("../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=24501));module.exports=c})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=9041,a.ids=[9041],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,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m
|
|
1
|
+
"use strict";(()=>{var a={};a.id=9041,a.ids=[9041],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,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m});var d=c(19898),e=c(33873),f=c(21820),g=c(29021);let h=null;function i(){return e.join(f.homedir(),".customize-agent")}function j(a){return(0,d.getProjectKbPath)(e.resolve(a))}function k(){return h||(h=new d.MultiProjectManager(i())),h}function l(a){let b=e.resolve(a),c=e.resolve(e.join(f.homedir(),".customize-agent"));return!(g.existsSync(e.join(b,"pnpm-workspace.yaml"))&&g.existsSync(e.join(b,"apps","server")))&&(b===c||b.includes(`${e.sep}.customize-agent${e.sep}`)||b.endsWith(`${e.sep}apps${e.sep}server`)||b.endsWith(`${e.sep}apps${e.sep}cli`))}function m(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&g.existsSync(a)&&!l(a))return e.resolve(a);let b=function(){let a=e.join(i(),"projects","registry.db");if(!g.existsSync(a))return[];let b=new((0,d.loadBetterSqlite3)())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>e.resolve(a.project_root)).filter(a=>!l(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!l(process.env.INIT_CWD)?process.env.INIT_CWD:e.resolve(process.cwd(),"../..")}function n(a,b={}){let c=new Map;for(let b of function(a){let b=e.join(f.homedir(),".customize-agent","projects",(0,d.computeProjectId)(e.resolve(a)),"kb.db");if(!g.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=j(a);if(!g.existsSync(b))return[];let c=[],d=a=>{for(let f of g.readdirSync(a,{withFileTypes:!0})){let h=e.join(a,f.name);if(f.isDirectory()){d(h);continue}if(f.name.endsWith(".source.txt"))continue;let i=g.statSync(h),j=e.relative(b,h).split(e.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:e.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:i.size,mtime:i.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 o(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=n(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
2
2
|
${a.category}
|
|
3
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 k().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}}
|
|
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 k().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}}},55279:(a,b,c)=>{c.r(b),c.d(b,{config:()=>n,default:()=>m,handler:()=>p});var d={};c.r(d),c.d(d,{default:()=>j});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);async function j(a,b){if(!["GET","POST"].includes(a.method))return b.status(405).json({error:"Method not allowed"});try{let c=a.query.projectRoot||(0,i.aY)();if(!c)return b.status(200).json([]);let d=await (0,i.Qh)().getProject(c);if("POST"===a.method){let{rules:c}=a.body;return Array.isArray(c)&&c.forEach(a=>{a.trim()&&d.addIgnoreRule(a.trim())}),b.status(200).json({success:!0})}b.status(200).json(d.listIgnoreRules().map(a=>a.pattern))}catch(a){console.error("[api] kb/ignore",a),b.status(500).json({error:"Internal server error"})}}var k=c(68970),l=c(50296);let m=(0,h.M)(d,"default"),n=(0,h.M)(d,"config"),o=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/ignore",pathname:"/api/kb/ignore",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function p(a,b,c){let d=await o.prepare(a,b,{srcPage:"/api/kb/ignore"});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,k.getTracer)(),e=d.getActiveScopeSpan(),j=o.instrumentationOnRequestError.bind(o),m=async e=>o.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:o.isDev,page:"/api/kb/ignore",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")!==l.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 m(e):await d.withPropagatedContext(a.headers,()=>d.trace(l.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:k.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},m))}catch(a){if(o.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")}};var b=require("../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=55279));module.exports=c})();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";(()=>{var a={};a.id=4197,a.ids=[4197],a.modules={13743:(a,b,c)=>{c.r(b),c.d(b,{config:()=>o,default:()=>n,handler:()=>q});var d={};c.r(d),c.d(d,{default:()=>k});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533),j=c(37095);function k(a,b){try{let c=a.query.projectRoot||(0,i.aY)();if(!c)return b.status(200).json("DELETE"===a.method?{success:!0,deleted:0}:{operations:[]});if("GET"===a.method){let d=Number(a.query.limit??50);return b.status(200).json({operations:(0,j.oy)(c,Number.isFinite(d)?d:50)})}if("DELETE"===a.method){let d=a.query.id;if(d){let a=(0,j.CU)(c,d);return b.status(200).json({success:a,deleted:+!!a})}return b.status(200).json({success:!0,deleted:(0,j.H7)(c)})}return b.status(405).json({error:"Method not allowed"})}catch(a){console.error("[api] kb/operations",a),b.status(500).json({error:"Internal server error"})}}var l=c(68970),m=c(50296);let n=(0,h.M)(d,"default"),o=(0,h.M)(d,"config"),p=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/operations",pathname:"/api/kb/operations",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function q(a,b,c){let d=await p.prepare(a,b,{srcPage:"/api/kb/operations"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,l.getTracer)(),e=d.getActiveScopeSpan(),j=p.instrumentationOnRequestError.bind(p),k=async e=>p.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:p.isDev,page:"/api/kb/operations",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(m.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:l.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(p.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},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")},37095:(a,b,c)=>{c.d(b,{CU:()=>t,H7:()=>s,JB:()=>p,Qf:()=>n,kW:()=>q,oy:()=>o,sn:()=>r});var d=c(29021),e=c(21820),f=c(33873),g=c(19898);function h(a){return f.join(e.homedir(),".customize-agent","projects",(0,g.computeProjectId)(a),"kb-operations.jsonl")}function i(a,b){let c=h(a);d.mkdirSync(f.dirname(c),{recursive:!0});let e=`${c}.${process.pid}.${Date.now()}.tmp`;d.writeFileSync(e,`${b.slice(-200).map(a=>JSON.stringify(a)).join("\n")}
|
|
2
|
-
`,"utf8"),d.renameSync(e,c);let g=k.get(a);g&&(g.mtimeMs=l(c))}let j=Math.round(Date.now()-1e3*process.uptime()),k=new Map;function l(a){try{return d.statSync(a).mtimeMs}catch{return 0}}function m(a){let b=h(a),c=l(b),e=k.get(a);if(e&&e.mtimeMs===c)return e.records;let f=function(a){let b=function(a){let b=h(a);return d.existsSync(b)?d.readFileSync(b,"utf8").split("\n").filter(Boolean).flatMap(a=>{try{return[JSON.parse(a)]}catch{return[]}}):[]}(a),c=b.filter(a=>"processing"===a.status&&a.updatedAt<j);if(c.length>0){let d=Date.now();for(let a of c)a.status="error",a.stage="error",a.error="服务重启导致任务中断,未完成",a.message=a.error,a.updatedAt=d;i(a,b)}return b}(a);return k.set(a,{mtimeMs:l(b),records:f}),f}function n(a,b){let c=Date.now(),d=m(a),e=d.findIndex(a=>a.id===b.id),f=e>=0?d[e]:void 0,g={id:b.id,type:b.type,title:b.title,stage:b.stage??f?.stage??"uploading",status:b.status??f?.status??"processing",message:b.message??f?.message??"",percent:b.percent??f?.percent??0,fileName:b.fileName??f?.fileName,filePath:b.filePath??f?.filePath,chunkCount:b.chunkCount??f?.chunkCount,textLength:b.textLength??f?.textLength,extractionMode:b.extractionMode??f?.extractionMode,error:b.status&&"error"!==b.status?void 0:b.error??f?.error,details:b.details??f?.details,createdAt:f?.createdAt??c,updatedAt:c};return e>=0?d[e]=g:d.push(g),i(a,d),g}function o(a,b=50){return m(a).sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,b)}function p(a,b){return m(a).find(a=>a.id===b)}function q(a,b){return m(a).filter(a=>!b||a.type===b).sort((a,b)=>b.updatedAt-a.updatedAt)[0]}function r(a){return m(a).filter(a=>"processing"===a.status).sort((a,b)=>b.updatedAt-a.updatedAt)}function s(a){let b=m(a),c=h(a);return d.existsSync(c)&&d.unlinkSync(c),k.delete(a),b.length}function t(a,b){let c=m(a),d=c.findIndex(a=>a.id===b);return!(d<0)&&(c.splice(d,1),i(a,c),!0)}},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m
|
|
2
|
+
`,"utf8"),d.renameSync(e,c);let g=k.get(a);g&&(g.mtimeMs=l(c))}let j=Math.round(Date.now()-1e3*process.uptime()),k=new Map;function l(a){try{return d.statSync(a).mtimeMs}catch{return 0}}function m(a){let b=h(a),c=l(b),e=k.get(a);if(e&&e.mtimeMs===c)return e.records;let f=function(a){let b=function(a){let b=h(a);return d.existsSync(b)?d.readFileSync(b,"utf8").split("\n").filter(Boolean).flatMap(a=>{try{return[JSON.parse(a)]}catch{return[]}}):[]}(a),c=b.filter(a=>"processing"===a.status&&a.updatedAt<j);if(c.length>0){let d=Date.now();for(let a of c)a.status="error",a.stage="error",a.error="服务重启导致任务中断,未完成",a.message=a.error,a.updatedAt=d;i(a,b)}return b}(a);return k.set(a,{mtimeMs:l(b),records:f}),f}function n(a,b){let c=Date.now(),d=m(a),e=d.findIndex(a=>a.id===b.id),f=e>=0?d[e]:void 0,g={id:b.id,type:b.type,title:b.title,stage:b.stage??f?.stage??"uploading",status:b.status??f?.status??"processing",message:b.message??f?.message??"",percent:b.percent??f?.percent??0,fileName:b.fileName??f?.fileName,filePath:b.filePath??f?.filePath,chunkCount:b.chunkCount??f?.chunkCount,textLength:b.textLength??f?.textLength,extractionMode:b.extractionMode??f?.extractionMode,error:b.status&&"error"!==b.status?void 0:b.error??f?.error,details:b.details??f?.details,createdAt:f?.createdAt??c,updatedAt:c};return e>=0?d[e]=g:d.push(g),i(a,d),g}function o(a,b=50){return m(a).sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,b)}function p(a,b){return m(a).find(a=>a.id===b)}function q(a,b){return m(a).filter(a=>!b||a.type===b).sort((a,b)=>b.updatedAt-a.updatedAt)[0]}function r(a){return m(a).filter(a=>"processing"===a.status).sort((a,b)=>b.updatedAt-a.updatedAt)}function s(a){let b=m(a),c=h(a);return d.existsSync(c)&&d.unlinkSync(c),k.delete(a),b.length}function t(a,b){let c=m(a),d=c.findIndex(a=>a.id===b);return!(d<0)&&(c.splice(d,1),i(a,c),!0)}},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m});var d=c(19898),e=c(33873),f=c(21820),g=c(29021);let h=null;function i(){return e.join(f.homedir(),".customize-agent")}function j(a){return(0,d.getProjectKbPath)(e.resolve(a))}function k(){return h||(h=new d.MultiProjectManager(i())),h}function l(a){let b=e.resolve(a),c=e.resolve(e.join(f.homedir(),".customize-agent"));return!(g.existsSync(e.join(b,"pnpm-workspace.yaml"))&&g.existsSync(e.join(b,"apps","server")))&&(b===c||b.includes(`${e.sep}.customize-agent${e.sep}`)||b.endsWith(`${e.sep}apps${e.sep}server`)||b.endsWith(`${e.sep}apps${e.sep}cli`))}function m(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&g.existsSync(a)&&!l(a))return e.resolve(a);let b=function(){let a=e.join(i(),"projects","registry.db");if(!g.existsSync(a))return[];let b=new((0,d.loadBetterSqlite3)())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>e.resolve(a.project_root)).filter(a=>!l(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!l(process.env.INIT_CWD)?process.env.INIT_CWD:e.resolve(process.cwd(),"../..")}function n(a,b={}){let c=new Map;for(let b of function(a){let b=e.join(f.homedir(),".customize-agent","projects",(0,d.computeProjectId)(e.resolve(a)),"kb.db");if(!g.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=j(a);if(!g.existsSync(b))return[];let c=[],d=a=>{for(let f of g.readdirSync(a,{withFileTypes:!0})){let h=e.join(a,f.name);if(f.isDirectory()){d(h);continue}if(f.name.endsWith(".source.txt"))continue;let i=g.statSync(h),j=e.relative(b,h).split(e.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:e.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:i.size,mtime:i.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 o(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=n(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
3
3
|
${a.category}
|
|
4
4
|
${a.format}
|
|
5
|
-
${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 k().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}}
|
|
5
|
+
${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 k().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")}};var b=require("../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=13743));module.exports=c})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=5555,a.ids=[5555],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,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m
|
|
1
|
+
"use strict";(()=>{var a={};a.id=5555,a.ids=[5555],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,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m});var d=c(19898),e=c(33873),f=c(21820),g=c(29021);let h=null;function i(){return e.join(f.homedir(),".customize-agent")}function j(a){return(0,d.getProjectKbPath)(e.resolve(a))}function k(){return h||(h=new d.MultiProjectManager(i())),h}function l(a){let b=e.resolve(a),c=e.resolve(e.join(f.homedir(),".customize-agent"));return!(g.existsSync(e.join(b,"pnpm-workspace.yaml"))&&g.existsSync(e.join(b,"apps","server")))&&(b===c||b.includes(`${e.sep}.customize-agent${e.sep}`)||b.endsWith(`${e.sep}apps${e.sep}server`)||b.endsWith(`${e.sep}apps${e.sep}cli`))}function m(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&g.existsSync(a)&&!l(a))return e.resolve(a);let b=function(){let a=e.join(i(),"projects","registry.db");if(!g.existsSync(a))return[];let b=new((0,d.loadBetterSqlite3)())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>e.resolve(a.project_root)).filter(a=>!l(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!l(process.env.INIT_CWD)?process.env.INIT_CWD:e.resolve(process.cwd(),"../..")}function n(a,b={}){let c=new Map;for(let b of function(a){let b=e.join(f.homedir(),".customize-agent","projects",(0,d.computeProjectId)(e.resolve(a)),"kb.db");if(!g.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=j(a);if(!g.existsSync(b))return[];let c=[],d=a=>{for(let f of g.readdirSync(a,{withFileTypes:!0})){let h=e.join(a,f.name);if(f.isDirectory()){d(h);continue}if(f.name.endsWith(".source.txt"))continue;let i=g.statSync(h),j=e.relative(b,h).split(e.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:e.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:i.size,mtime:i.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 o(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=n(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
2
2
|
${a.category}
|
|
3
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 k().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}}
|
|
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 k().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")},99977:(a,b,c)=>{c.r(b),c.d(b,{config:()=>n,default:()=>m,handler:()=>p});var d={};c.r(d),c.d(d,{default:()=>j});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);async function j(a,b){if("GET"!==a.method)return b.status(405).json({error:"Method not allowed"});try{let c=a.query.q||"";if(!c.trim())return b.status(200).json({results:[],total:0});let d=a.query.projectRoot||(0,i.aY)();if(!d)return b.status(200).json({results:[],total:0});let e=parseInt(a.query.limit||"20",10),f=a=>{let b=Number(Array.isArray(a)?a[0]:a);return Number.isFinite(b)?Math.max(0,b):void 0},g={keyword:f(a.query.keywordWeight),vector:f(a.query.vectorWeight),hybridBonus:f(a.query.hybridBonus)},h=await (0,i.Qh)().search(d,c,{limit:e,weights:g});b.status(200).json({results:h.results,total:h.results.length,queryTimeMs:h.queryTimeMs,scopesSearched:h.scopesSearched,debug:h.debug})}catch(a){console.error("[api] kb/search",a),b.status(500).json({error:"Internal server error"})}}var k=c(68970),l=c(50296);let m=(0,h.M)(d,"default"),n=(0,h.M)(d,"config"),o=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/search",pathname:"/api/kb/search",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function p(a,b,c){let d=await o.prepare(a,b,{srcPage:"/api/kb/search"});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,k.getTracer)(),e=d.getActiveScopeSpan(),j=o.instrumentationOnRequestError.bind(o),m=async e=>o.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:o.isDev,page:"/api/kb/search",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")!==l.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 m(e):await d.withPropagatedContext(a.headers,()=>d.trace(l.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:k.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},m))}catch(a){if(o.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=99977));module.exports=c})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=3244,a.ids=[3244],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,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m
|
|
1
|
+
"use strict";(()=>{var a={};a.id=3244,a.ids=[3244],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,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m});var d=c(19898),e=c(33873),f=c(21820),g=c(29021);let h=null;function i(){return e.join(f.homedir(),".customize-agent")}function j(a){return(0,d.getProjectKbPath)(e.resolve(a))}function k(){return h||(h=new d.MultiProjectManager(i())),h}function l(a){let b=e.resolve(a),c=e.resolve(e.join(f.homedir(),".customize-agent"));return!(g.existsSync(e.join(b,"pnpm-workspace.yaml"))&&g.existsSync(e.join(b,"apps","server")))&&(b===c||b.includes(`${e.sep}.customize-agent${e.sep}`)||b.endsWith(`${e.sep}apps${e.sep}server`)||b.endsWith(`${e.sep}apps${e.sep}cli`))}function m(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&g.existsSync(a)&&!l(a))return e.resolve(a);let b=function(){let a=e.join(i(),"projects","registry.db");if(!g.existsSync(a))return[];let b=new((0,d.loadBetterSqlite3)())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>e.resolve(a.project_root)).filter(a=>!l(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!l(process.env.INIT_CWD)?process.env.INIT_CWD:e.resolve(process.cwd(),"../..")}function n(a,b={}){let c=new Map;for(let b of function(a){let b=e.join(f.homedir(),".customize-agent","projects",(0,d.computeProjectId)(e.resolve(a)),"kb.db");if(!g.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=j(a);if(!g.existsSync(b))return[];let c=[],d=a=>{for(let f of g.readdirSync(a,{withFileTypes:!0})){let h=e.join(a,f.name);if(f.isDirectory()){d(h);continue}if(f.name.endsWith(".source.txt"))continue;let i=g.statSync(h),j=e.relative(b,h).split(e.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:e.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:i.size,mtime:i.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 o(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=n(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
2
2
|
${a.category}
|
|
3
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 k().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}}
|
|
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 k().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}}},71328:(a,b,c)=>{c.r(b),c.d(b,{config:()=>n,default:()=>m,handler:()=>p});var d={};c.r(d),c.d(d,{default:()=>j});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);async function j(a,b){if("GET"!==a.method)return b.status(405).json({error:"Method not allowed"});try{let c=a.query.projectRoot||(0,i.aY)();if(!c)return b.status(200).json({});let d=await (0,i.Qh)().getProject(c);b.status(200).json({...d.getStats(),vectorStatus:d.getVectorStatus()})}catch(a){console.error("[api] kb/stats",a),b.status(500).json({error:"Internal server error"})}}var k=c(68970),l=c(50296);let m=(0,h.M)(d,"default"),n=(0,h.M)(d,"config"),o=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/stats",pathname:"/api/kb/stats",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function p(a,b,c){let d=await o.prepare(a,b,{srcPage:"/api/kb/stats"});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,k.getTracer)(),e=d.getActiveScopeSpan(),j=o.instrumentationOnRequestError.bind(o),m=async e=>o.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:o.isDev,page:"/api/kb/stats",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")!==l.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 m(e):await d.withPropagatedContext(a.headers,()=>d.trace(l.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:k.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},m))}catch(a){if(o.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")}};var b=require("../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=71328));module.exports=c})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=9928,a.ids=[9928],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")},40930:(a,b,c)=>{c.r(b),c.d(b,{config:()=>n,default:()=>m,handler:()=>p});var d={};c.r(d),c.d(d,{default:()=>j});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);async function j(a,b){if("GET"!==a.method)return b.status(405).json({error:"Method not allowed"});try{let c=a.query.projectRoot||(0,i.aY)();if(!c)return b.status(200).json([]);let d=(await (0,i.Qh)().getProject(c)).listTags();b.status(200).json([...new Set(d.map(a=>a.tag))])}catch(a){console.error("[api] kb/tags",a),b.status(500).json({error:"Internal server error"})}}var k=c(68970),l=c(50296);let m=(0,h.M)(d,"default"),n=(0,h.M)(d,"config"),o=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/tags",pathname:"/api/kb/tags",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function p(a,b,c){let d=await o.prepare(a,b,{srcPage:"/api/kb/tags"});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,k.getTracer)(),e=d.getActiveScopeSpan(),j=o.instrumentationOnRequestError.bind(o),m=async e=>o.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:o.isDev,page:"/api/kb/tags",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")!==l.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 m(e):await d.withPropagatedContext(a.headers,()=>d.trace(l.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:k.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},m))}catch(a){if(o.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m
|
|
1
|
+
"use strict";(()=>{var a={};a.id=9928,a.ids=[9928],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")},40930:(a,b,c)=>{c.r(b),c.d(b,{config:()=>n,default:()=>m,handler:()=>p});var d={};c.r(d),c.d(d,{default:()=>j});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(44533);async function j(a,b){if("GET"!==a.method)return b.status(405).json({error:"Method not allowed"});try{let c=a.query.projectRoot||(0,i.aY)();if(!c)return b.status(200).json([]);let d=(await (0,i.Qh)().getProject(c)).listTags();b.status(200).json([...new Set(d.map(a=>a.tag))])}catch(a){console.error("[api] kb/tags",a),b.status(500).json({error:"Internal server error"})}}var k=c(68970),l=c(50296);let m=(0,h.M)(d,"default"),n=(0,h.M)(d,"config"),o=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/tags",pathname:"/api/kb/tags",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function p(a,b,c){let d=await o.prepare(a,b,{srcPage:"/api/kb/tags"});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,k.getTracer)(),e=d.getActiveScopeSpan(),j=o.instrumentationOnRequestError.bind(o),m=async e=>o.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:o.isDev,page:"/api/kb/tags",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")!==l.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 m(e):await d.withPropagatedContext(a.headers,()=>d.trace(l.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:k.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},m))}catch(a){if(o.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m});var d=c(19898),e=c(33873),f=c(21820),g=c(29021);let h=null;function i(){return e.join(f.homedir(),".customize-agent")}function j(a){return(0,d.getProjectKbPath)(e.resolve(a))}function k(){return h||(h=new d.MultiProjectManager(i())),h}function l(a){let b=e.resolve(a),c=e.resolve(e.join(f.homedir(),".customize-agent"));return!(g.existsSync(e.join(b,"pnpm-workspace.yaml"))&&g.existsSync(e.join(b,"apps","server")))&&(b===c||b.includes(`${e.sep}.customize-agent${e.sep}`)||b.endsWith(`${e.sep}apps${e.sep}server`)||b.endsWith(`${e.sep}apps${e.sep}cli`))}function m(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&g.existsSync(a)&&!l(a))return e.resolve(a);let b=function(){let a=e.join(i(),"projects","registry.db");if(!g.existsSync(a))return[];let b=new((0,d.loadBetterSqlite3)())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>e.resolve(a.project_root)).filter(a=>!l(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!l(process.env.INIT_CWD)?process.env.INIT_CWD:e.resolve(process.cwd(),"../..")}function n(a,b={}){let c=new Map;for(let b of function(a){let b=e.join(f.homedir(),".customize-agent","projects",(0,d.computeProjectId)(e.resolve(a)),"kb.db");if(!g.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=j(a);if(!g.existsSync(b))return[];let c=[],d=a=>{for(let f of g.readdirSync(a,{withFileTypes:!0})){let h=e.join(a,f.name);if(f.isDirectory()){d(h);continue}if(f.name.endsWith(".source.txt"))continue;let i=g.statSync(h),j=e.relative(b,h).split(e.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:e.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:i.size,mtime:i.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 o(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=n(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
2
2
|
${a.category}
|
|
3
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 k().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}}
|
|
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 k().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")}};var b=require("../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=40930));module.exports=c})();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";(()=>{var a={};a.id=9438,a.ids=[9438],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")},37095:(a,b,c)=>{c.d(b,{CU:()=>t,H7:()=>s,JB:()=>p,Qf:()=>n,kW:()=>q,oy:()=>o,sn:()=>r});var d=c(29021),e=c(21820),f=c(33873),g=c(19898);function h(a){return f.join(e.homedir(),".customize-agent","projects",(0,g.computeProjectId)(a),"kb-operations.jsonl")}function i(a,b){let c=h(a);d.mkdirSync(f.dirname(c),{recursive:!0});let e=`${c}.${process.pid}.${Date.now()}.tmp`;d.writeFileSync(e,`${b.slice(-200).map(a=>JSON.stringify(a)).join("\n")}
|
|
2
|
-
`,"utf8"),d.renameSync(e,c);let g=k.get(a);g&&(g.mtimeMs=l(c))}let j=Math.round(Date.now()-1e3*process.uptime()),k=new Map;function l(a){try{return d.statSync(a).mtimeMs}catch{return 0}}function m(a){let b=h(a),c=l(b),e=k.get(a);if(e&&e.mtimeMs===c)return e.records;let f=function(a){let b=function(a){let b=h(a);return d.existsSync(b)?d.readFileSync(b,"utf8").split("\n").filter(Boolean).flatMap(a=>{try{return[JSON.parse(a)]}catch{return[]}}):[]}(a),c=b.filter(a=>"processing"===a.status&&a.updatedAt<j);if(c.length>0){let d=Date.now();for(let a of c)a.status="error",a.stage="error",a.error="服务重启导致任务中断,未完成",a.message=a.error,a.updatedAt=d;i(a,b)}return b}(a);return k.set(a,{mtimeMs:l(b),records:f}),f}function n(a,b){let c=Date.now(),d=m(a),e=d.findIndex(a=>a.id===b.id),f=e>=0?d[e]:void 0,g={id:b.id,type:b.type,title:b.title,stage:b.stage??f?.stage??"uploading",status:b.status??f?.status??"processing",message:b.message??f?.message??"",percent:b.percent??f?.percent??0,fileName:b.fileName??f?.fileName,filePath:b.filePath??f?.filePath,chunkCount:b.chunkCount??f?.chunkCount,textLength:b.textLength??f?.textLength,extractionMode:b.extractionMode??f?.extractionMode,error:b.status&&"error"!==b.status?void 0:b.error??f?.error,details:b.details??f?.details,createdAt:f?.createdAt??c,updatedAt:c};return e>=0?d[e]=g:d.push(g),i(a,d),g}function o(a,b=50){return m(a).sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,b)}function p(a,b){return m(a).find(a=>a.id===b)}function q(a,b){return m(a).filter(a=>!b||a.type===b).sort((a,b)=>b.updatedAt-a.updatedAt)[0]}function r(a){return m(a).filter(a=>"processing"===a.status).sort((a,b)=>b.updatedAt-a.updatedAt)}function s(a){let b=m(a),c=h(a);return d.existsSync(c)&&d.unlinkSync(c),k.delete(a),b.length}function t(a,b){let c=m(a),d=c.findIndex(a=>a.id===b);return!(d<0)&&(c.splice(d,1),i(a,c),!0)}},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m
|
|
2
|
+
`,"utf8"),d.renameSync(e,c);let g=k.get(a);g&&(g.mtimeMs=l(c))}let j=Math.round(Date.now()-1e3*process.uptime()),k=new Map;function l(a){try{return d.statSync(a).mtimeMs}catch{return 0}}function m(a){let b=h(a),c=l(b),e=k.get(a);if(e&&e.mtimeMs===c)return e.records;let f=function(a){let b=function(a){let b=h(a);return d.existsSync(b)?d.readFileSync(b,"utf8").split("\n").filter(Boolean).flatMap(a=>{try{return[JSON.parse(a)]}catch{return[]}}):[]}(a),c=b.filter(a=>"processing"===a.status&&a.updatedAt<j);if(c.length>0){let d=Date.now();for(let a of c)a.status="error",a.stage="error",a.error="服务重启导致任务中断,未完成",a.message=a.error,a.updatedAt=d;i(a,b)}return b}(a);return k.set(a,{mtimeMs:l(b),records:f}),f}function n(a,b){let c=Date.now(),d=m(a),e=d.findIndex(a=>a.id===b.id),f=e>=0?d[e]:void 0,g={id:b.id,type:b.type,title:b.title,stage:b.stage??f?.stage??"uploading",status:b.status??f?.status??"processing",message:b.message??f?.message??"",percent:b.percent??f?.percent??0,fileName:b.fileName??f?.fileName,filePath:b.filePath??f?.filePath,chunkCount:b.chunkCount??f?.chunkCount,textLength:b.textLength??f?.textLength,extractionMode:b.extractionMode??f?.extractionMode,error:b.status&&"error"!==b.status?void 0:b.error??f?.error,details:b.details??f?.details,createdAt:f?.createdAt??c,updatedAt:c};return e>=0?d[e]=g:d.push(g),i(a,d),g}function o(a,b=50){return m(a).sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,b)}function p(a,b){return m(a).find(a=>a.id===b)}function q(a,b){return m(a).filter(a=>!b||a.type===b).sort((a,b)=>b.updatedAt-a.updatedAt)[0]}function r(a){return m(a).filter(a=>"processing"===a.status).sort((a,b)=>b.updatedAt-a.updatedAt)}function s(a){let b=m(a),c=h(a);return d.existsSync(c)&&d.unlinkSync(c),k.delete(a),b.length}function t(a,b){let c=m(a),d=c.findIndex(a=>a.id===b);return!(d<0)&&(c.splice(d,1),i(a,c),!0)}},44533:(a,b,c)=>{c.d(b,{NW:()=>j,Qh:()=>k,VS:()=>o,Yy:()=>n,a2:()=>i,aY:()=>m});var d=c(19898),e=c(33873),f=c(21820),g=c(29021);let h=null;function i(){return e.join(f.homedir(),".customize-agent")}function j(a){return(0,d.getProjectKbPath)(e.resolve(a))}function k(){return h||(h=new d.MultiProjectManager(i())),h}function l(a){let b=e.resolve(a),c=e.resolve(e.join(f.homedir(),".customize-agent"));return!(g.existsSync(e.join(b,"pnpm-workspace.yaml"))&&g.existsSync(e.join(b,"apps","server")))&&(b===c||b.includes(`${e.sep}.customize-agent${e.sep}`)||b.endsWith(`${e.sep}apps${e.sep}server`)||b.endsWith(`${e.sep}apps${e.sep}cli`))}function m(){let a=process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD;if(a&&g.existsSync(a)&&!l(a))return e.resolve(a);let b=function(){let a=e.join(i(),"projects","registry.db");if(!g.existsSync(a))return[];let b=new((0,d.loadBetterSqlite3)())(a,{readonly:!0});try{return b.prepare("SELECT project_root FROM project_registry ORDER BY last_opened_at DESC").all().map(a=>e.resolve(a.project_root)).filter(a=>!l(a))}finally{b.close()}}();return b.length>0?b[0]:process.env.INIT_CWD&&!l(process.env.INIT_CWD)?process.env.INIT_CWD:e.resolve(process.cwd(),"../..")}function n(a,b={}){let c=new Map;for(let b of function(a){let b=e.join(f.homedir(),".customize-agent","projects",(0,d.computeProjectId)(e.resolve(a)),"kb.db");if(!g.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=j(a);if(!g.existsSync(b))return[];let c=[],d=a=>{for(let f of g.readdirSync(a,{withFileTypes:!0})){let h=e.join(a,f.name);if(f.isDirectory()){d(h);continue}if(f.name.endsWith(".source.txt"))continue;let i=g.statSync(h),j=e.relative(b,h).split(e.sep).join("/");c.push({relativePath:j,category:j.includes("表格数据/")?"spreadsheet":j.includes("图片素材/")?"image":j.includes("图纸文件/")?"cad":j.includes("文档资料/")?"document":"other",format:e.extname(j).slice(1).toLowerCase()||"text",contentHash:"",fileSize:i.size,mtime:i.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 o(a,b={}){let c=(b.query||"").trim(),d=Math.max(1,Math.min(500,b.limit??50)),e=new Map,f=n(a,{category:b.category});for(let a of f)(!c||`${a.relativePath}
|
|
3
3
|
${a.category}
|
|
4
4
|
${a.format}
|
|
5
|
-
${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 k().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}}
|
|
5
|
+
${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 k().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}}},61653:(a,b,c)=>{c.r(b),c.d(b,{config:()=>o,default:()=>n,handler:()=>q});var d={};c.r(d),c.d(d,{default:()=>k});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(37095),j=c(44533);async function k(a,b){if("GET"!==a.method)return b.status(405).json({error:"Method not allowed"});try{var c,d;let e=String(a.query.id??"");if(!e)return b.status(400).json({error:"id is required"});let f=String(a.query.projectRoot||(0,j.aY)());try{let a=(await (0,j.Qh)().getProject(f)).listIndexJobsByPrefix(e);if(a.length>0){let d=a.find(a=>"ERROR"===a.status),f=a.filter(a=>"SUCCESS"===a.status).length,g=a.find(a=>!["SUCCESS","ERROR"].includes(a.status))??d??a.at(-1),h=Math.round(a.reduce((a,b)=>a+b.percent,0)/a.length);return b.status(200).json({id:e,stage:d?"error":f===a.length?"done":(c=g.status,"PARSING"===c?"parsing":"CHUNKING"===c?"chunking":"INDEXING"===c?"vectorizing":"SUCCESS"===c?"done":"ERROR"===c?"error":"uploading"),percent:d||f===a.length?100:h,message:d?.errorMessage||g.message,jobs:a,updatedAt:g.updatedAt})}}catch{}let g=(0,i.JB)(f,e);if(g)return b.status(200).json({id:e,stage:"error"===g.status?"error":"done"===g.stage?"done":(d=g.stage,"uploading"===d||"parsing"===d||"chunking"===d||"vectorizing"===d||"done"===d?d:"uploading"),percent:g.percent,message:g.message,fileName:g.fileName,error:g.error,updatedAt:g.updatedAt});b.status(200).json({id:e,stage:"uploading",percent:0,message:"等待上传开始",updatedAt:Date.now()})}catch(a){console.error("[api] kb/upload/progress",a),b.status(500).json({error:"Internal server error"})}}var l=c(68970),m=c(50296);let n=(0,h.M)(d,"default"),o=(0,h.M)(d,"config"),p=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/kb/upload/progress",pathname:"/api/kb/upload/progress",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function q(a,b,c){let d=await p.prepare(a,b,{srcPage:"/api/kb/upload/progress"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,l.getTracer)(),e=d.getActiveScopeSpan(),j=p.instrumentationOnRequestError.bind(p),k=async e=>p.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:p.isDev,page:"/api/kb/upload/progress",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(m.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:l.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(p.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")}};var b=require("../../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=61653));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" data-next-head=""/><link rel="preload" href="/_next/static/css/5652f24cec9ea7a3.css" as="style"/><link rel="stylesheet" href="/_next/static/css/5652f24cec9ea7a3.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-4224e970a97a4a86.js" defer=""></script><script src="/_next/static/chunks/framework-161be364fd69a7ce.js" defer=""></script><script src="/_next/static/chunks/main-91fb767ebd74c9c1.js" defer=""></script><script src="/_next/static/chunks/pages/_app-24bef62eef01afe6.js" defer=""></script><script src="/_next/static/chunks/717-743b697a417dd5ee.js" defer=""></script><script src="/_next/static/chunks/883-506cbca959974997.js" defer=""></script><script src="/_next/static/chunks/69-34d57b77fd2eed20.js" defer=""></script><script src="/_next/static/chunks/700-5d29b0475311f590.js" defer=""></script><script src="/_next/static/chunks/224-0415408fff1d1c8b.js" defer=""></script><script src="/_next/static/chunks/102-881dcc464f983c89.js" defer=""></script><script src="/_next/static/chunks/289-fc1b25371e004552.js" defer=""></script><script src="/_next/static/chunks/994-241f87efc61005b8.js" defer=""></script><script src="/_next/static/chunks/pages/asset-library-f6319fc04559e43d.js" defer=""></script><script src="/_next/static/07Y_5mRHzJpxIj7CoRu6M/_buildManifest.js" defer=""></script><script src="/_next/static/07Y_5mRHzJpxIj7CoRu6M/_ssgManifest.js" defer=""></script></head><body><div id="__next"><script>((e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n)}),R(n)}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n)}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y)}catch(n){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div class="css-1pi45l5 ant-app css-var-_R_16_"><aside class="sidebar"><a href="/overview"><div class="sidebarLogo"><div class="w-8 h-8 rounded-lg bg-black dark:bg-white flex items-center justify-center shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon text-white dark:text-black"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg></div><div class="sidebarLogoTitle"><span class="logoGradient">Customize Agent</span></div></div></a><nav class="sidebarNav mt-2"><a href="/overview"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-dashboard"><rect width="7" height="9" x="3" y="3" rx="1"></rect><rect width="7" height="5" x="14" y="3" rx="1"></rect><rect width="7" height="9" x="14" y="12" rx="1"></rect><rect width="7" height="5" x="3" y="16" rx="1"></rect></svg><span class="sidebarLabel">总览</span></div></a><div><div class="sidebarItem sidebarParent"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg><span class="sidebarLabel">知识库</span><span class="sidebarChevron"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg></span></div></div><a href="/models"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cpu"><rect width="16" height="16" x="4" y="4" rx="2"></rect><rect width="6" height="6" x="9" y="9" rx="1"></rect><path d="M15 2v2"></path><path d="M15 20v2"></path><path d="M2 15h2"></path><path d="M2 9h2"></path><path d="M20 15h2"></path><path d="M20 9h2"></path><path d="M9 2v2"></path><path d="M9 20v2"></path></svg><span class="sidebarLabel">模型配置</span></div></a><a href="/prompt"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg><span class="sidebarLabel">提示词管理</span></div></a><a href="/document-roles"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span class="sidebarLabel">角色配置</span></div></a><a href="/documents"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-files"><path d="M20 7h-3a2 2 0 0 1-2-2V2"></path><path d="M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z"></path><path d="M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8"></path></svg><span class="sidebarLabel">工作流模版库</span></div></a><a href="/template-references"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-library-big"><rect width="8" height="18" x="3" y="3" rx="1"></rect><path d="M7 3v18"></path><path d="M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z"></path></svg><span class="sidebarLabel">模板参考</span></div></a><a href="/asset-library"><div class="sidebarItem sidebarItemActive"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></svg><span class="sidebarLabel">生成资源</span></div></a><a href="/system/logs"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug"><path d="m8 2 1.88 1.88"></path><path d="M14.12 3.88 16 2"></path><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"></path><path d="M12 20v-9"></path><path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path><path d="M6 13H2"></path><path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path><path d="M22 13h-4"></path><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"></path></svg><span class="sidebarLabel">系统日志</span></div></a><a href="/guide"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg><span class="sidebarLabel">指引</span></div></a><a href="/settings"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span class="sidebarLabel">设置</span></div></a></nav><div class="sidebarCollapseWrapper"><button class="sidebarCollapseBtn" aria-label="收起侧边栏"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panel-left-close"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M9 3v18"></path><path d="m16 15-3-3 3-3"></path></svg></button></div></aside><div class="mainContent"><header class="topbar"><div class="flex-1"></div><span class="ant-badge css-1pi45l5 css-var-_R_16_"><button type="button" class="ant-btn css-1pi45l5 css-var-_R_16_ ant-btn-default ant-btn-color-default ant-btn-variant-outlined topbarBtn"><span class="ant-btn-icon"><span role="img" aria-label="clock-circle" class="anticon anticon-clock-circle"><svg viewBox="64 64 896 896" focusable="false" data-icon="clock-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"></path></svg></span></span><span>后台任务</span></button></span><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg><span>深色</span></button><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg><span>English</span></button></header><main class="mainInner"><div class="space-y-5 animateFadeIn"><div class="ant-skeleton ant-skeleton-active css-1pi45l5 css-var-_R_16_"><div class="ant-skeleton-section"><h3 class="ant-skeleton-title" style="width:38%"></h3><ul class="ant-skeleton-paragraph"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li style="width:61%"></li></ul></div></div></div></main></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/asset-library","query":{},"buildId":"07Y_5mRHzJpxIj7CoRu6M","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" data-next-head=""/><link rel="preload" href="/_next/static/css/5652f24cec9ea7a3.css" as="style"/><link rel="stylesheet" href="/_next/static/css/5652f24cec9ea7a3.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-4224e970a97a4a86.js" defer=""></script><script src="/_next/static/chunks/framework-161be364fd69a7ce.js" defer=""></script><script src="/_next/static/chunks/main-91fb767ebd74c9c1.js" defer=""></script><script src="/_next/static/chunks/pages/_app-24bef62eef01afe6.js" defer=""></script><script src="/_next/static/chunks/717-743b697a417dd5ee.js" defer=""></script><script src="/_next/static/chunks/883-506cbca959974997.js" defer=""></script><script src="/_next/static/chunks/69-34d57b77fd2eed20.js" defer=""></script><script src="/_next/static/chunks/700-5d29b0475311f590.js" defer=""></script><script src="/_next/static/chunks/224-0415408fff1d1c8b.js" defer=""></script><script src="/_next/static/chunks/102-881dcc464f983c89.js" defer=""></script><script src="/_next/static/chunks/289-fc1b25371e004552.js" defer=""></script><script src="/_next/static/chunks/994-241f87efc61005b8.js" defer=""></script><script src="/_next/static/chunks/pages/asset-library-f6319fc04559e43d.js" defer=""></script><script src="/_next/static/j8fr40eY_GBXxJqTLN5qq/_buildManifest.js" defer=""></script><script src="/_next/static/j8fr40eY_GBXxJqTLN5qq/_ssgManifest.js" defer=""></script></head><body><div id="__next"><script>((e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n)}),R(n)}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n)}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y)}catch(n){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div class="css-1pi45l5 ant-app css-var-_R_16_"><aside class="sidebar"><a href="/overview"><div class="sidebarLogo"><div class="w-8 h-8 rounded-lg bg-black dark:bg-white flex items-center justify-center shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon text-white dark:text-black"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg></div><div class="sidebarLogoTitle"><span class="logoGradient">Customize Agent</span></div></div></a><nav class="sidebarNav mt-2"><a href="/overview"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-dashboard"><rect width="7" height="9" x="3" y="3" rx="1"></rect><rect width="7" height="5" x="14" y="3" rx="1"></rect><rect width="7" height="9" x="14" y="12" rx="1"></rect><rect width="7" height="5" x="3" y="16" rx="1"></rect></svg><span class="sidebarLabel">总览</span></div></a><div><div class="sidebarItem sidebarParent"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg><span class="sidebarLabel">知识库</span><span class="sidebarChevron"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg></span></div></div><a href="/models"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cpu"><rect width="16" height="16" x="4" y="4" rx="2"></rect><rect width="6" height="6" x="9" y="9" rx="1"></rect><path d="M15 2v2"></path><path d="M15 20v2"></path><path d="M2 15h2"></path><path d="M2 9h2"></path><path d="M20 15h2"></path><path d="M20 9h2"></path><path d="M9 2v2"></path><path d="M9 20v2"></path></svg><span class="sidebarLabel">模型配置</span></div></a><a href="/prompt"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg><span class="sidebarLabel">提示词管理</span></div></a><a href="/document-roles"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span class="sidebarLabel">角色配置</span></div></a><a href="/documents"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-files"><path d="M20 7h-3a2 2 0 0 1-2-2V2"></path><path d="M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z"></path><path d="M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8"></path></svg><span class="sidebarLabel">工作流模版库</span></div></a><a href="/template-references"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-library-big"><rect width="8" height="18" x="3" y="3" rx="1"></rect><path d="M7 3v18"></path><path d="M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z"></path></svg><span class="sidebarLabel">模板参考</span></div></a><a href="/asset-library"><div class="sidebarItem sidebarItemActive"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></svg><span class="sidebarLabel">生成资源</span></div></a><a href="/system/logs"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug"><path d="m8 2 1.88 1.88"></path><path d="M14.12 3.88 16 2"></path><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"></path><path d="M12 20v-9"></path><path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path><path d="M6 13H2"></path><path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path><path d="M22 13h-4"></path><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"></path></svg><span class="sidebarLabel">系统日志</span></div></a><a href="/guide"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg><span class="sidebarLabel">指引</span></div></a><a href="/settings"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span class="sidebarLabel">设置</span></div></a></nav><div class="sidebarCollapseWrapper"><button class="sidebarCollapseBtn" aria-label="收起侧边栏"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panel-left-close"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M9 3v18"></path><path d="m16 15-3-3 3-3"></path></svg></button></div></aside><div class="mainContent"><header class="topbar"><div class="flex-1"></div><span class="ant-badge css-1pi45l5 css-var-_R_16_"><button type="button" class="ant-btn css-1pi45l5 css-var-_R_16_ ant-btn-default ant-btn-color-default ant-btn-variant-outlined topbarBtn"><span class="ant-btn-icon"><span role="img" aria-label="clock-circle" class="anticon anticon-clock-circle"><svg viewBox="64 64 896 896" focusable="false" data-icon="clock-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"></path></svg></span></span><span>后台任务</span></button></span><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg><span>深色</span></button><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg><span>English</span></button></header><main class="mainInner"><div class="space-y-5 animateFadeIn"><div class="ant-skeleton ant-skeleton-active css-1pi45l5 css-var-_R_16_"><div class="ant-skeleton-section"><h3 class="ant-skeleton-title" style="width:38%"></h3><ul class="ant-skeleton-paragraph"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li style="width:61%"></li></ul></div></div></div></main></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/asset-library","query":{},"buildId":"j8fr40eY_GBXxJqTLN5qq","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|