@customize-agent/server 3.0.16 → 3.0.17
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-manifest.json +12 -12
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/chunks/3445.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/api/assets/generated/preview.js +1 -1
- package/.next/server/pages/api/assets/generated.js +1 -1
- package/.next/server/pages/api/documents/export.js +1 -1
- package/.next/server/pages/api/documents/generate.js +1 -1
- package/.next/server/pages/api/documents/generated/[id].js +1 -1
- package/.next/server/pages/api/documents/generated.js +1 -1
- package/.next/server/pages/asset-library.html +1 -1
- package/.next/server/pages/context/long-term.html +1 -1
- package/.next/server/pages/context/short-term.html +1 -1
- package/.next/server/pages/document-roles.html +1 -1
- package/.next/server/pages/document-specs.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge/search.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages-manifest.json +25 -25
- package/.next/static/chunks/pages/asset-library-82606363f9142bad.js +1 -0
- package/.next/static/chunks/pages/context/{long-term-09e23b06634b08d9.js → long-term-f2a550bc848ec1a3.js} +1 -1
- package/.next/static/chunks/pages/context/short-term-1de28da82d2b6276.js +1 -0
- package/.next/static/chunks/pages/document-roles-54a1cc04116e8c18.js +1 -0
- package/.next/static/chunks/pages/document-specs-723dee6883949a17.js +1 -0
- package/.next/static/chunks/pages/documents-c1a01ae631b42488.js +1 -0
- package/.next/static/chunks/pages/knowledge/file-detail-7a1a3d4352ecfa0a.js +1 -0
- package/.next/static/chunks/pages/knowledge/files-f0e05583bf7c57d9.js +1 -0
- package/.next/static/chunks/pages/knowledge/manage-8acff53019eb6cc1.js +1 -0
- package/.next/static/chunks/pages/knowledge/{search-3fd704d2afa1af3e.js → search-1f3bd8fcb7af3e4d.js} +1 -1
- package/.next/static/chunks/pages/models-11533caad3723009.js +1 -0
- package/.next/static/chunks/pages/overview-f80672c242d9aa32.js +1 -0
- package/.next/static/customize-agent-dashboard/_buildManifest.js +1 -1
- package/package.json +1 -1
- package/.next/static/chunks/pages/asset-library-0f607b74fa016470.js +0 -1
- package/.next/static/chunks/pages/context/short-term-2f5fd8531e87b5bd.js +0 -1
- package/.next/static/chunks/pages/document-roles-077fc7159c88e89e.js +0 -1
- package/.next/static/chunks/pages/document-specs-fb5b8a89cff6d1e3.js +0 -1
- package/.next/static/chunks/pages/documents-38320ae2fd50be35.js +0 -1
- package/.next/static/chunks/pages/knowledge/file-detail-ad1dc61c1413db0c.js +0 -1
- package/.next/static/chunks/pages/knowledge/files-896c058f2da5e907.js +0 -1
- package/.next/static/chunks/pages/knowledge/manage-6da10158f75718cf.js +0 -1
- package/.next/static/chunks/pages/models-7bdf24068811ae91.js +0 -1
- package/.next/static/chunks/pages/overview-572bba4876e617f5.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46],{69:(e,n)=>{"use strict";n.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5L255.8 713.6l-62.3-62.3a8.19 8.19 0 00-11.4 0l-39.8 39.8a8.19 8.19 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.19 8.19 0 00-11.4 0l-39.8 39.8a8.19 8.19 0 000 11.4l110.3 111.2c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.1 304.1 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112m161.2 465.2C726.2 620.3 668.9 644 608 644s-118.2-23.7-161.2-66.8C403.7 534.2 380 476.9 380 416s23.7-118.2 66.8-161.2c43-43.1 100.3-66.8 161.2-66.8s118.2 23.7 161.2 66.8c43.1 43 66.8 100.3 66.8 161.2s-23.7 118.2-66.8 161.2"}}]},name:"key",theme:"outlined"}},2256:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});let a=t(25341).A},5450:(e,n)=>{"use strict";n.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"}},6578:(e,n,t)=>{"use strict";async function a(e,n){let t=await fetch(e,n);if(!t.ok){let e=await t.text(),n=e||"HTTP ".concat(t.status);try{let t=JSON.parse(e);n=t.error||t.message||n}catch(e){}throw Error(n)}return t.json()}async function o(e){let n=e?"?projectRoot=".concat(encodeURIComponent(e)):"";return a("/api/kb/stats".concat(n))}async function s(e){var n,t;let o=new URLSearchParams;return(null==e?void 0:e.projectRoot)&&o.set("projectRoot",e.projectRoot),(null==e?void 0:e.category)&&o.set("category",e.category),(null==e?void 0:e.page)&&o.set("page",String(null!=(n=e.page)?n:1)),(null==e?void 0:e.limit)&&o.set("limit",String(null!=(t=e.limit)?t:50)),a("/api/kb/files?".concat(o))}async function i(e,n){let t=new URLSearchParams({relativePath:e});return n&&t.set("projectRoot",n),a("/api/kb/files/detail?".concat(t))}async function c(e,n){return a("/api/kb/files/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:n})})}async function l(e,n,t){return a("/api/kb/files/open",{method:"POST",body:JSON.stringify({relativePath:e,target:n,projectRoot:t})})}async function r(e){return new Promise((n,t)=>{let a=new FileReader;a.onload=()=>{let e=a.result,t=e.indexOf(",");n(t>=0?e.slice(t+1):e)},a.onerror=t,a.readAsDataURL(e)})}async function d(e,n,t){return a("/api/kb/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:await Promise.all(e.map(async e=>({fileName:e.name,fileData:await r(e),relativePath:e.webkitRelativePath||void 0}))),projectRoot:n,uploadId:t})})}async function m(e){return a("/api/kb/upload/progress?id=".concat(encodeURIComponent(e)))}async function p(e){let n=new URLSearchParams({limit:"50"});return e&&n.set("projectRoot",e),a("/api/kb/operations?".concat(n))}async function u(e){let n=new URLSearchParams;return e&&n.set("projectRoot",e),a("/api/kb/operations?".concat(n),{method:"DELETE"})}async function h(e,n){return a("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:n})})}async function y(e,n){return a("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePaths:e,projectRoot:n})})}async function f(e){return a("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,projectRoot:e})})}async function g(e){return a("/api/kb/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:e})})}async function v(){return a("/api/kb/features")}async function b(e,n){var t,o,s,i,c;let l=new URLSearchParams({q:e});return(null==n?void 0:n.projectRoot)&&l.set("projectRoot",n.projectRoot),(null==n?void 0:n.category)&&l.set("category",n.category),(null==n?void 0:n.limit)&&l.set("limit",String(null!=(c=n.limit)?c:20)),(null==n||null==(t=n.weights)?void 0:t.keyword)!=null&&l.set("keywordWeight",String(n.weights.keyword)),(null==n||null==(o=n.weights)?void 0:o.vector)!=null&&l.set("vectorWeight",String(n.weights.vector)),(null==n||null==(s=n.weights)?void 0:s.rewrite)!=null&&l.set("rewriteWeight",String(n.weights.rewrite)),(null==n||null==(i=n.weights)?void 0:i.hybridBonus)!=null&&l.set("hybridBonus",String(n.weights.hybridBonus)),a("/api/kb/search?".concat(l))}async function j(){return a("/api/prompt")}async function x(e){return a("/api/documents/roles".concat(e?"?type=".concat(e):""))}async function A(e){return a("/api/documents/roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function C(e,n){return a("/api/documents/roles?type=".concat(e,"&id=").concat(encodeURIComponent(n)),{method:"DELETE"})}async function S(e){return a("/api/documents/roles?mode=config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function w(e){return a("/api/documents/roles?mode=config&id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function O(){return a("/api/documents/specs")}async function T(e){return a("/api/documents/specs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function N(e){return a("/api/documents/specs?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function P(){return a("/api/documents/templates")}async function k(e){return a("/api/documents/templates",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function E(e){return a("/api/documents/templates?templateId=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function R(e){return a("/api/documents/templates",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateId:e})})}async function U(e){return a("/api/documents/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function _(){return a("/api/documents/generated")}async function I(e){return a("/api/documents/generated/".concat(encodeURIComponent(e)))}async function z(e,n){return a("/api/documents/generated/".concat(encodeURIComponent(e)),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}async function L(){return a("/api/assets/generated")}async function J(e){return a("/api/assets/generated?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function M(e){return a("/api/assets/generated",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"index"})})}async function D(e,n){return a("/api/assets/generated",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"open",target:n})})}async function K(e){return a("/api/documents/chapter/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function H(e,n){return a("/api/documents/drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,id:n})})}async function V(e){let n=await fetch("/api/documents/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw Error(await n.text());return n.blob()}async function B(){return a("/api/config/providers")}async function F(e,n){return a("/api/config/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,...n})})}async function G(e){return a("/api/config/providers/".concat(encodeURIComponent(e)),{method:"DELETE"})}async function W(){return a("/api/config/models")}async function X(e){return a("/api/config/models",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function Z(){return a("/api/config/embedding")}async function q(e){return a("/api/config/embedding",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function Q(){return a("/api/config/embedding/healthCheck",{method:"POST"})}async function Y(e){return a("/api/config/healthCheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})})}async function $(){return a("/api/system/stats")}async function ee(e,n){let t=n?"?type=".concat(e,"&search=").concat(encodeURIComponent(n)):"?type=".concat(e);return a("/api/context".concat(t))}async function en(e){return a("/api/context?type=".concat(e,"&stats=1"))}async function et(e){return a("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"compress",type:e})})}async function ea(e){return a("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear",type:e})})}async function eo(e){return a("/api/context?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function es(e,n){return a("/api/context",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...n})})}async function ei(e){return a("/api/config/providers/".concat(encodeURIComponent(e)))}t.d(n,{Af:()=>H,Bh:()=>ei,Dl:()=>P,E:()=>ea,EK:()=>T,ER:()=>N,FC:()=>$,FV:()=>C,H1:()=>g,H7:()=>u,HC:()=>c,HT:()=>s,II:()=>Z,JU:()=>J,NR:()=>S,OX:()=>U,PH:()=>et,QT:()=>m,Qx:()=>p,R1:()=>K,SJ:()=>y,UE:()=>V,VW:()=>v,W2:()=>b,X8:()=>f,Z3:()=>B,_m:()=>F,a6:()=>z,aP:()=>X,bV:()=>R,bZ:()=>Y,c1:()=>d,cQ:()=>_,dd:()=>q,dg:()=>A,dw:()=>w,dx:()=>j,f$:()=>L,h0:()=>E,h1:()=>G,hc:()=>o,hn:()=>ee,l2:()=>k,lv:()=>x,mx:()=>O,oS:()=>D,p:()=>en,tn:()=>l,u6:()=>Q,uc:()=>M,v7:()=>I,xC:()=>i,xq:()=>h,xw:()=>eo,zo:()=>es,zr:()=>W})},13114:(e,n,t)=>{"use strict";t.d(n,{A:()=>c});var a=t(97109),o=t(5450),s=t(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}let c=a.forwardRef((e,n)=>a.createElement(s.A,i({},e,{ref:n,icon:o.A})))},15527:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>K});var a=t(65321),o=t(97109),s=t(13014),i=t(17807),c=t(85114),l=t(68787),r=t(2256),d=t(38770),m=t(33442),p=t(26171),u=t(11702),h=t(85493),y=t(63455),f=t(57271),g=t(7576),v=t(94992),b=t(25258),j=t(56985),x=t(54746),A=t(29071),C=t(59188),S=t(4216),w=t(13114),O=t(99650),T=t(58209),N=t(69),P=t(88483);function k(){return(k=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}let E=o.forwardRef((e,n)=>o.createElement(P.A,k({},e,{ref:n,icon:N.A})));var R=t(30289);function U(){return(U=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}let _=o.forwardRef((e,n)=>o.createElement(P.A,U({},e,{ref:n,icon:R.A})));var I=t(6578),z=t(42323),L=t.n(z);let J=[{label:"OpenAI 兼容",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"Google",value:"google"},{label:"Ollama",value:"ollama"},{label:"OpenRouter",value:"openrouter"}],M=[{key:"reader",labelKey:"models.tierReader",descKey:"models.tierReaderDesc"},{key:"reasoning",labelKey:"models.tierReasoning",descKey:"models.tierReasoningDesc"},{key:"action",labelKey:"models.tierAction",descKey:"models.tierActionDesc"}],D=[{key:"imageGeneration",label:"图片生成"},{key:"imageUnderstanding",label:"图片理解"},{key:"fileUnderstanding",label:"文件理解"},{key:"audio",label:"音频能力"},{key:"video",label:"视频能力"}];function K(){let e=(0,s.Vr)(),{message:n}=i.A.useApp(),t=[{label:e("models.embeddingProviderHash"),value:"hash"},{label:e("models.embeddingProviderOpenAI"),value:"openai-compatible"}],[N,P]=(0,o.useState)(!0),[k,R]=(0,o.useState)([]),[U,z]=(0,o.useState)(null),[K,H]=(0,o.useState)({provider:"hash",dimensions:384}),[V,B]=(0,o.useState)(!1),[F,G]=(0,o.useState)(!1),[W,X]=(0,o.useState)(null),[Z,q]=(0,o.useState)(!1),[Q,Y]=(0,o.useState)(""),[$,ee]=(0,o.useState)(""),[en,et]=(0,o.useState)(""),[ea,eo]=(0,o.useState)("openai"),[es,ei]=(0,o.useState)({}),[ec,el]=(0,o.useState)(!1),[er,ed]=(0,o.useState)(!1),[em,ep]=(0,o.useState)(""),[eu,eh]=(0,o.useState)(""),[ey,ef]=(0,o.useState)(""),[eg,ev]=(0,o.useState)(""),[eb,ej]=(0,o.useState)("openai"),[ex,eA]=(0,o.useState)({}),[eC,eS]=(0,o.useState)(!1),[ew,eO]=(0,o.useState)(null),[eT,eN]=(0,o.useState)({}),eP=async()=>{P(!0);try{let[e,n,t]=await Promise.all([(0,I.Z3)().catch(()=>[]),(0,I.zr)().catch(()=>null),(0,I.II)().catch(()=>({provider:"hash",dimensions:384}))]);R(e),z(n),H(t)}catch(t){n.error(e("common.error"))}finally{P(!1)}};(0,o.useEffect)(()=>{eP()},[]);let ek=async()=>{if(Q.trim()){el(!0);try{await (0,I._m)(Q.trim(),{apiKey:$||void 0,baseUrl:en||void 0,protocol:ea,capabilities:es}),q(!1),Y(""),ee(""),et(""),eo("openai"),ei({}),await eP(),n.success(e("common.success"))}catch(t){n.error(e("common.error"))}finally{el(!1)}}},eE=async t=>{try{await (0,I.h1)(t),await eP(),n.success(e("common.success"))}catch(t){n.error(e("common.error"))}},eR=async e=>{ep(e.name),eh(e.name),ef("");try{let n=await (0,I.Bh)(e.name);ef(n.apiKey?"••••••••":""),ev(n.baseUrl||""),ej(n.protocol||n.detectedProtocol||"openai"),eA(n.capabilities||{})}catch(n){ev(e.baseUrl||""),ej(e.protocol||e.detectedProtocol||"openai"),eA(e.capabilities||{})}ed(!0)},eU=async()=>{if(eu.trim()){eS(!0);try{let t=ey.includes("•")?void 0:ey||void 0;await (0,I._m)(eu.trim(),{oldName:em,apiKey:t,baseUrl:eg||void 0,protocol:eb,capabilities:ex}),ed(!1),ep(""),eh(""),ef(""),ev(""),ej("openai"),eA({}),await eP(),n.success(e("common.success"))}catch(t){n.error(e("common.error"))}finally{eS(!1)}}},e_=async t=>{eO(t);try{let a=await (0,I.bZ)(t);eN(e=>({...e,[t]:a.success})),n[a.success?"success":"error"](a.success?e("models.connected"):e("models.connectionFailed"))}catch(e){eN(e=>({...e,[t]:!1}))}finally{eO(null)}},eI=async()=>{B(!0);try{let t=await (0,I.dd)(K);H(t),X(null),n.success(e("common.success"))}catch(t){n.error(e("common.error"))}finally{B(!1)}},ez=async()=>{G(!0);try{let t=await (0,I.u6)();X(t.success),n[t.success?"success":"error"](t.message||(t.success?e("models.connected"):e("models.connectionFailed")))}catch(t){X(!1),n.error(e("common.error"))}finally{G(!1)}},eL=async(t,a)=>{if(!U)return;let o={...U},s=o[t];if(!a){s.active="",z(o);try{await (0,I.aP)(o)}catch(t){n.error(e("common.error"))}return}let i=a.indexOf(":"),c=i>=0?a.slice(0,i):a,l=i>=0?a.slice(i+1):a;s.active=l,s.list.some(e=>e.name===l&&e.provider===c)||s.list.push({name:l,provider:c}),z(o);try{await (0,I.aP)(o)}catch(t){n.error(e("common.error"))}};return(0,a.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"pageTitle",children:e("models.title")}),(0,a.jsx)("p",{className:"pageDesc",children:e("models.description")})]}),(0,a.jsx)(c.Ay,{type:"primary",icon:(0,a.jsx)(x.A,{}),onClick:()=>q(!0),children:e("models.addModel")})]}),(0,a.jsx)(l.A,{title:e("models.modelList"),size:"small",loading:N,children:0===k.length?(0,a.jsx)("span",{className:L().cardMeta,children:e("models.noProviders")}):(0,a.jsx)(r.A,{gutter:[12,12],align:"stretch",children:k.map(n=>(0,a.jsx)(d.A,{xs:24,sm:12,lg:8,xl:6,className:L().providerGrid,children:(0,a.jsxs)(l.A,{size:"small",className:L().providerCard,children:[(0,a.jsxs)("div",{className:L().cardAction,children:[(0,a.jsxs)("div",{className:L().cardMain,children:[(0,a.jsx)("div",{className:L().cardName,title:n.name,children:n.name}),(0,a.jsxs)("div",{className:L().cardMeta,children:[(0,a.jsx)(A.A,{})," ",n.protocol||n.detectedProtocol||"openai"]})]}),(0,a.jsxs)(m.A,{size:2,wrap:!1,children:[(0,a.jsx)(c.Ay,{size:"small",type:"text",loading:ew===n.name,onClick:()=>{e_(n.name)},icon:!0===eT[n.name]?(0,a.jsx)(C.A,{className:"text-[var(--colorOk)]"}):!1===eT[n.name]?(0,a.jsx)(S.A,{className:"text-[var(--colorDanger)]"}):(0,a.jsx)(w.A,{})}),(0,a.jsx)(c.Ay,{size:"small",type:"text",icon:(0,a.jsx)(O.A,{}),onClick:()=>{eR(n)}}),(0,a.jsx)(p.A,{title:e("models.deleteProviderConfirm"),onConfirm:()=>{eE(n.name)},children:(0,a.jsx)(c.Ay,{size:"small",type:"text",danger:!0,icon:(0,a.jsx)(T.A,{})})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("span",{className:"".concat(L().cardMeta," text-xs"),children:[(0,a.jsx)(E,{})," ",n.hasApiKey?"••••••••":"—"]}),n.baseUrl&&(0,a.jsxs)("span",{className:"".concat(L().cardMeta," ").concat(L().urlLine," text-xs"),title:n.baseUrl,children:[(0,a.jsx)(_,{})," ",n.baseUrl]}),(0,a.jsx)(m.A,{size:[4,4],wrap:!0,children:D.filter(e=>{var t;return null==(t=n.capabilities)?void 0:t[e.key]}).map(e=>(0,a.jsx)(u.A,{color:"purple",children:e.label},e.key))})]})]})},n.name))})}),(0,a.jsxs)(l.A,{title:e("models.embeddingConfig"),size:"small",loading:N,children:[(0,a.jsx)(h.A,{className:"mb-4",type:"info",showIcon:!0,message:e("models.embeddingHint")}),(0,a.jsxs)(y.A,{layout:"vertical",size:"middle",children:[(0,a.jsxs)(r.A,{gutter:[12,12],children:[(0,a.jsx)(d.A,{xs:24,lg:8,children:(0,a.jsx)(y.A.Item,{label:e("models.embeddingProvider"),children:(0,a.jsx)(f.A,{value:K.provider,options:t,onChange:e=>H(n=>({...n,provider:e,dimensions:"hash"===e?384:n.dimensions||1024}))})})}),"openai-compatible"===K.provider&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{xs:24,lg:8,children:(0,a.jsx)(y.A.Item,{label:"Base URL",children:(0,a.jsx)(g.A,{value:K.baseUrl,onChange:e=>H(n=>({...n,baseUrl:e.target.value})),placeholder:"http://localhost:11434/v1"})})}),(0,a.jsx)(d.A,{xs:24,lg:8,children:(0,a.jsx)(y.A.Item,{label:e("models.model"),children:(0,a.jsx)(g.A,{value:K.model,onChange:e=>H(n=>({...n,model:e.target.value})),placeholder:"bge-m3"})})}),(0,a.jsx)(d.A,{xs:24,lg:8,children:(0,a.jsx)(y.A.Item,{label:e("models.apiKey"),help:K.hasApiKey?e("models.embeddingApiKeyHint"):void 0,children:(0,a.jsx)(g.A.Password,{value:K.apiKey,onFocus:()=>{var e;(null==(e=K.apiKey)?void 0:e.includes("•"))&&H(e=>({...e,apiKey:""}))},onChange:e=>H(n=>({...n,apiKey:e.target.value})),placeholder:e("models.optional")})})})]}),(0,a.jsx)(d.A,{xs:24,lg:8,children:(0,a.jsx)(y.A.Item,{label:e("models.dimensions"),children:(0,a.jsx)(v.A,{className:"w-full",min:1,value:K.dimensions,onChange:e=>H(n=>({...n,dimensions:Number(e||("hash"===n.provider?384:1024))}))})})}),(0,a.jsx)(d.A,{xs:24,lg:8,children:(0,a.jsx)(y.A.Item,{label:e("models.status"),children:(0,a.jsxs)(m.A,{children:[(0,a.jsx)(u.A,{color:"hash"===K.provider?"default":"blue",children:"hash"===K.provider?e("models.localHash"):e("models.openAICompatible")}),!0===W&&(0,a.jsx)(u.A,{color:"success",children:e("models.connected")}),!1===W&&(0,a.jsx)(u.A,{color:"error",children:e("models.connectionFailed")})]})})})]}),(0,a.jsxs)(m.A,{children:[(0,a.jsx)(c.Ay,{type:"primary",loading:V,onClick:()=>{eI()},children:e("models.saveEmbedding")}),(0,a.jsx)(c.Ay,{icon:(0,a.jsx)(w.A,{}),loading:F,onClick:()=>{ez()},children:e("models.testEmbedding")})]})]})]}),U&&(0,a.jsx)(l.A,{title:e("models.modelTiers"),size:"small",children:(0,a.jsx)(r.A,{gutter:[12,12],children:M.map(t=>{var o;let{key:s,labelKey:i,descKey:c}=t,r=U[s],m=r.list.map(e=>({label:"".concat(e.provider," / ").concat(e.name),value:"".concat(e.provider,":").concat(e.name)})),p=k.filter(e=>!r.list.some(n=>n.provider===e.name)).map(e=>({label:"".concat(e.name," / ").concat(e.name),value:"".concat(e.name,":").concat(e.name)}));return(0,a.jsx)(d.A,{xs:24,lg:8,children:(0,a.jsxs)(l.A,{size:"small",title:e(i),children:[(0,a.jsx)("span",{className:L().tierDesc,children:e(c)}),(0,a.jsx)(f.A,{value:r.active?"".concat((null==(o=r.list.find(e=>e.name===r.active))?void 0:o.provider)||"",":").concat(r.active):void 0,onChange:e=>{eL(s,e)},allowClear:!0,placeholder:e("models.selectModelPlaceholder"),className:"w-full",options:[...m,...p]}),r.list.length>0&&(0,a.jsx)("div",{className:L().modelTags,children:r.list.map(t=>(0,a.jsxs)(u.A,{color:t.name===r.active?"blue":void 0,closable:!0,onClose:()=>{var a,o;let i={...U},c=i[s];c.list=c.list.filter(e=>e.name!==t.name||e.provider!==t.provider),c.active===t.name&&(c.active=null!=(o=null==(a=c.list[0])?void 0:a.name)?o:""),z(i),(0,I.aP)(i).catch(()=>n.error(e("common.error")))},children:[t.provider,"/",t.name]},"".concat(t.provider,":").concat(t.name)))})]})},s)})})}),(0,a.jsx)(b.A,{maskClosable:!1,title:e("models.addModel"),open:Z,onCancel:()=>{q(!1),Y(""),ee(""),et(""),eo("openai")},onOk:()=>{ek()},confirmLoading:ec,children:(0,a.jsxs)(y.A,{layout:"vertical",size:"middle",children:[(0,a.jsx)(y.A.Item,{label:e("models.modelName"),children:(0,a.jsx)(g.A,{value:Q,onChange:e=>Y(e.target.value),placeholder:e("models.modelNamePlaceholder")})}),(0,a.jsx)(y.A.Item,{label:e("models.apiKey"),children:(0,a.jsx)(g.A.Password,{value:$,onChange:e=>ee(e.target.value),placeholder:"sk-..."})}),(0,a.jsx)(y.A.Item,{label:e("models.baseUrl"),children:(0,a.jsx)(g.A,{value:en,onChange:e=>et(e.target.value),placeholder:"https://api.openai.com/v1"})}),(0,a.jsx)(y.A.Item,{label:e("models.protocol"),children:(0,a.jsx)(f.A,{value:ea,onChange:eo,options:J})}),(0,a.jsx)(y.A.Item,{label:"多模态能力",children:(0,a.jsx)(j.A.Group,{value:D.filter(e=>es[e.key]).map(e=>e.key),options:D.map(e=>({label:e.label,value:e.key})),onChange:e=>ei(Object.fromEntries(D.map(n=>[n.key,e.includes(n.key)])))})})]})}),(0,a.jsx)(b.A,{maskClosable:!1,title:e("models.editModel"),open:er,onCancel:()=>{ed(!1),ep(""),eh(""),ef(""),ev(""),ej("openai")},onOk:()=>{eU()},confirmLoading:eC,children:(0,a.jsxs)(y.A,{layout:"vertical",size:"middle",children:[(0,a.jsx)(y.A.Item,{label:e("models.modelName"),children:(0,a.jsx)(g.A,{value:eu,onChange:e=>eh(e.target.value),placeholder:e("models.modelNamePlaceholder")})}),(0,a.jsx)(y.A.Item,{label:e("models.apiKey"),help:e("models.apiKeyEditHint"),children:(0,a.jsx)(g.A.Password,{value:ey,onFocus:()=>{ey.includes("•")&&ef("")},onCopy:e=>e.preventDefault(),onChange:e=>ef(e.target.value),placeholder:e("models.apiKeyEditPlaceholder")})}),(0,a.jsx)(y.A.Item,{label:e("models.baseUrl"),children:(0,a.jsx)(g.A,{value:eg,onChange:e=>ev(e.target.value),placeholder:"https://api.openai.com/v1"})}),(0,a.jsx)(y.A.Item,{label:e("models.protocol"),children:(0,a.jsx)(f.A,{value:eb,onChange:ej,options:J})}),(0,a.jsx)(y.A.Item,{label:"多模态能力",children:(0,a.jsx)(j.A.Group,{value:D.filter(e=>ex[e.key]).map(e=>e.key),options:D.map(e=>({label:e.label,value:e.key})),onChange:e=>eA(Object.fromEntries(D.map(n=>[n.key,e.includes(n.key)])))})})]})})]})}},29071:(e,n,t)=>{"use strict";t.d(n,{A:()=>c});var a=t(97109),o=t(78847),s=t(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}let c=a.forwardRef((e,n)=>a.createElement(s.A,i({},e,{ref:n,icon:o.A})))},30289:(e,n)=>{"use strict";n.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"}},38770:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});let a=t(51916).A},42323:e=>{e.exports={cardMeta:"style_cardMeta__6KOa3",cardName:"style_cardName__WcLAf",cardAction:"style_cardAction__XUfPD",cardMain:"style_cardMain__qI1jU",providerCard:"style_providerCard__tLKGs",providerGrid:"style_providerGrid__Gx5GR",urlLine:"style_urlLine__DuMYs",tierDesc:"style_tierDesc__wOd6p",modelTags:"style_modelTags__nmMVj"}},77305:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/models",function(){return t(15527)}])},78847:(e,n)=>{"use strict";n.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z"}}]},name:"thunderbolt",theme:"outlined"}}},e=>{e.O(0,[260,167,382,628,271,576,183,985,232,20,636,593,792],()=>e(e.s=77305)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[449],{6578:(e,n,t)=>{"use strict";async function o(e,n){let t=await fetch(e,n);if(!t.ok){let e=await t.text(),n=e||"HTTP ".concat(t.status);try{let t=JSON.parse(e);n=t.error||t.message||n}catch(e){}throw Error(n)}return t.json()}async function i(e){let n=e?"?projectRoot=".concat(encodeURIComponent(e)):"";return o("/api/kb/stats".concat(n))}async function s(e){var n,t;let i=new URLSearchParams;return(null==e?void 0:e.projectRoot)&&i.set("projectRoot",e.projectRoot),(null==e?void 0:e.category)&&i.set("category",e.category),(null==e?void 0:e.page)&&i.set("page",String(null!=(n=e.page)?n:1)),(null==e?void 0:e.limit)&&i.set("limit",String(null!=(t=e.limit)?t:50)),o("/api/kb/files?".concat(i))}async function r(e,n){let t=new URLSearchParams({relativePath:e});return n&&t.set("projectRoot",n),o("/api/kb/files/detail?".concat(t))}async function a(e,n){return o("/api/kb/files/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:n})})}async function c(e,n,t){return o("/api/kb/files/open",{method:"POST",body:JSON.stringify({relativePath:e,target:n,projectRoot:t})})}async function l(e){return new Promise((n,t)=>{let o=new FileReader;o.onload=()=>{let e=o.result,t=e.indexOf(",");n(t>=0?e.slice(t+1):e)},o.onerror=t,o.readAsDataURL(e)})}async function d(e,n,t){return o("/api/kb/upload",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:await Promise.all(e.map(async e=>({fileName:e.name,fileData:await l(e),relativePath:e.webkitRelativePath||void 0}))),projectRoot:n,uploadId:t})})}async function u(e){return o("/api/kb/upload/progress?id=".concat(encodeURIComponent(e)))}async function p(e){let n=new URLSearchParams({limit:"50"});return e&&n.set("projectRoot",e),o("/api/kb/operations?".concat(n))}async function y(e){let n=new URLSearchParams;return e&&n.set("projectRoot",e),o("/api/kb/operations?".concat(n),{method:"DELETE"})}async function m(e,n){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePath:e,projectRoot:n})})}async function h(e,n){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relativePaths:e,projectRoot:n})})}async function f(e){return o("/api/kb/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({all:!0,projectRoot:e})})}async function g(e){return o("/api/kb/reindex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:e})})}async function v(){return o("/api/kb/features")}async function x(e,n){var t,i,s,r,a;let c=new URLSearchParams({q:e});return(null==n?void 0:n.projectRoot)&&c.set("projectRoot",n.projectRoot),(null==n?void 0:n.category)&&c.set("category",n.category),(null==n?void 0:n.limit)&&c.set("limit",String(null!=(a=n.limit)?a:20)),(null==n||null==(t=n.weights)?void 0:t.keyword)!=null&&c.set("keywordWeight",String(n.weights.keyword)),(null==n||null==(i=n.weights)?void 0:i.vector)!=null&&c.set("vectorWeight",String(n.weights.vector)),(null==n||null==(s=n.weights)?void 0:s.rewrite)!=null&&c.set("rewriteWeight",String(n.weights.rewrite)),(null==n||null==(r=n.weights)?void 0:r.hybridBonus)!=null&&c.set("hybridBonus",String(n.weights.hybridBonus)),o("/api/kb/search?".concat(c))}async function j(){return o("/api/prompt")}async function T(e){return o("/api/documents/roles".concat(e?"?type=".concat(e):""))}async function S(e){return o("/api/documents/roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function w(e,n){return o("/api/documents/roles?type=".concat(e,"&id=").concat(encodeURIComponent(n)),{method:"DELETE"})}async function b(e){return o("/api/documents/roles?mode=config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function C(e){return o("/api/documents/roles?mode=config&id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function k(){return o("/api/documents/specs")}async function A(e){return o("/api/documents/specs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function O(e){return o("/api/documents/specs?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function E(){return o("/api/documents/templates")}async function P(e){return o("/api/documents/templates",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function N(e){return o("/api/documents/templates?templateId=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function R(e){return o("/api/documents/templates",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateId:e})})}async function U(e){return o("/api/documents/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function J(){return o("/api/documents/generated")}async function D(e){return o("/api/documents/generated/".concat(encodeURIComponent(e)))}async function I(e,n){return o("/api/documents/generated/".concat(encodeURIComponent(e)),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}async function L(){return o("/api/assets/generated")}async function z(e){return o("/api/assets/generated?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function _(e){return o("/api/assets/generated",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"index"})})}async function B(e,n){return o("/api/assets/generated",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"open",target:n})})}async function F(e){return o("/api/documents/chapter/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function M(e,n){return o("/api/documents/drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,id:n})})}async function H(e){let n=await fetch("/api/documents/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw Error(await n.text());return n.blob()}async function W(){return o("/api/config/providers")}async function V(e,n){return o("/api/config/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,...n})})}async function X(e){return o("/api/config/providers/".concat(encodeURIComponent(e)),{method:"DELETE"})}async function q(){return o("/api/config/models")}async function Q(e){return o("/api/config/models",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function Z(){return o("/api/config/embedding")}async function K(e){return o("/api/config/embedding",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function $(){return o("/api/config/embedding/healthCheck",{method:"POST"})}async function G(e){return o("/api/config/healthCheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})})}async function Y(){return o("/api/system/stats")}async function ee(e,n){let t=n?"?type=".concat(e,"&search=").concat(encodeURIComponent(n)):"?type=".concat(e);return o("/api/context".concat(t))}async function en(e){return o("/api/context?type=".concat(e,"&stats=1"))}async function et(e){return o("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"compress",type:e})})}async function eo(e){return o("/api/context",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear",type:e})})}async function ei(e){return o("/api/context?id=".concat(encodeURIComponent(e)),{method:"DELETE"})}async function es(e,n){return o("/api/context",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...n})})}async function er(e){return o("/api/config/providers/".concat(encodeURIComponent(e)))}t.d(n,{Af:()=>M,Bh:()=>er,Dl:()=>E,E:()=>eo,EK:()=>A,ER:()=>O,FC:()=>Y,FV:()=>w,H1:()=>g,H7:()=>y,HC:()=>a,HT:()=>s,II:()=>Z,JU:()=>z,NR:()=>b,OX:()=>U,PH:()=>et,QT:()=>u,Qx:()=>p,R1:()=>F,SJ:()=>h,UE:()=>H,VW:()=>v,W2:()=>x,X8:()=>f,Z3:()=>W,_m:()=>V,a6:()=>I,aP:()=>Q,bV:()=>R,bZ:()=>G,c1:()=>d,cQ:()=>J,dd:()=>K,dg:()=>S,dw:()=>C,dx:()=>j,f$:()=>L,h0:()=>N,h1:()=>X,hc:()=>i,hn:()=>ee,l2:()=>P,lv:()=>T,mx:()=>k,oS:()=>B,p:()=>en,tn:()=>c,u6:()=>$,uc:()=>_,v7:()=>D,xC:()=>r,xq:()=>m,xw:()=>ei,zo:()=>es,zr:()=>q})},27795:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>b});var o=t(65321),i=t(97109),s=t(13014),r=t(85114),a=t(2256),c=t(38770),l=t(68787),d=t(99605),u=t(54849),p=t(33442),y=t(11702),m=t(86109),h=t(99811),f=t(520),g=t(93314),v=t(13114),x=t(29071),j=t(26631),T=t(84742),S=t(38762),w=t(6578);function b(){var e,n,t,b,C,k,A,O,E,P,N,R;let U=(0,s.Vr)(),J=(0,m.useRouter)(),[D,I]=(0,i.useState)(null),[L,z]=(0,i.useState)(!0),[_,B]=(0,i.useState)(0),F=(0,i.useCallback)(async()=>{z(!0);try{let[e,n]=await Promise.all([(0,w.FC)(),(0,w.Z3)().catch(()=>[])]);I(e),B(Array.isArray(n)?n.length:0)}catch(e){}finally{z(!1)}},[]);(0,i.useEffect)(()=>{F();let e=setInterval(()=>{F()},1e4);return()=>clearInterval(e)},[F]);let M=(null!=(n=null==D?void 0:D.cpu.usagePercent)?n:0)>80?"var(--colorDanger)":(null!=(t=null==D?void 0:D.cpu.usagePercent)?t:0)>50?"var(--colorWarning)":"var(--colorOk)",H=(null!=(b=null==D?void 0:D.memory.usagePercent)?b:0)>80?"var(--colorDanger)":(null!=(C=null==D?void 0:D.memory.usagePercent)?C:0)>50?"var(--colorWarning)":"var(--colorOk)",W=(null==D?void 0:D.tasks.total)?Math.round(D.tasks.success/D.tasks.total*100):0,V=null==D||null==(e=D.models)?void 0:e[0];return(0,o.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"pageTitle",children:U("overview.title")}),(0,o.jsx)("p",{className:"pageDesc",children:U("overview.description")})]}),(0,o.jsx)(r.Ay,{icon:(0,o.jsx)(h.A,{spin:L}),loading:L,onClick:()=>{F()},children:U("common.retry")})]}),(0,o.jsxs)(a.A,{gutter:[16,16],children:[(0,o.jsx)(c.A,{xs:24,sm:12,children:(0,o.jsx)(l.A,{size:"small",title:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(f.A,{})," CPU"]}),children:(0,o.jsxs)("div",{style:{textAlign:"center"},children:[(0,o.jsx)(d.A,{type:"circle",percent:null!=(k=null==D?void 0:D.cpu.usagePercent)?k:0,size:120,strokeColor:M,format:e=>"".concat(null==e?void 0:e.toFixed(1),"%")}),(0,o.jsxs)("div",{className:"text-xs mt-2",style:{color:"var(--colorTextSecondary)"},children:[null!=(A=null==D?void 0:D.cpu.cores)?A:0," ",U("overview.cores")]})]})})}),(0,o.jsx)(c.A,{xs:24,sm:12,children:(0,o.jsx)(l.A,{size:"small",title:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g.A,{})," ",U("overview.memory")]}),children:(0,o.jsxs)("div",{style:{textAlign:"center"},children:[(0,o.jsx)(d.A,{type:"circle",percent:null!=(O=null==D?void 0:D.memory.usagePercent)?O:0,size:120,strokeColor:H,format:e=>"".concat(e,"%")}),(0,o.jsxs)("div",{className:"text-xs mt-2",style:{color:"var(--colorTextSecondary)"},children:[null!=(E=null==D?void 0:D.memory.processMB)?E:0," MB / ",null!=(P=null==D?void 0:D.memory.totalMB)?P:0," MB"]})]})})})]}),(0,o.jsxs)(a.A,{gutter:[16,16],children:[(0,o.jsx)(c.A,{xs:12,sm:6,children:(0,o.jsx)(l.A,{size:"small",children:(0,o.jsx)(u.A,{title:U("overview.providersCount"),value:_,prefix:(0,o.jsx)(v.A,{})})})}),(0,o.jsx)(c.A,{xs:12,sm:6,children:(0,o.jsx)(l.A,{size:"small",children:(0,o.jsx)(u.A,{title:U("overview.tokensUsed"),value:null!=(N=null==D?void 0:D.tokens.total)?N:0,prefix:(0,o.jsx)(x.A,{})})})}),(0,o.jsx)(c.A,{xs:12,sm:6,children:(0,o.jsx)(l.A,{size:"small",children:(0,o.jsx)(u.A,{title:U("overview.tasksTotal"),value:null!=(R=null==D?void 0:D.tasks.total)?R:0,prefix:(0,o.jsx)(j.A,{})})})}),(0,o.jsx)(c.A,{xs:12,sm:6,children:(0,o.jsx)(l.A,{size:"small",children:(0,o.jsx)(u.A,{title:U("overview.successRate"),value:W,suffix:"%",prefix:W>80?(0,o.jsx)(T.A,{style:{color:"var(--colorOk)"}}):(0,o.jsx)(S.A,{style:{color:"var(--colorDanger)"}})})})})]}),(0,o.jsxs)(a.A,{gutter:[16,16],children:[(0,o.jsx)(c.A,{xs:24,sm:12,children:(0,o.jsx)(l.A,{size:"small",title:U("overview.topModel"),children:V?(0,o.jsxs)("div",{className:"flex items-center gap-4",children:[(0,o.jsx)(v.A,{style:{fontSize:24,color:"var(--colorAccent)"}}),(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"font-semibold",children:V.model}),(0,o.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["@",V.provider," — ",V.count," ",U("overview.calls")]})]})]}):(0,o.jsx)("span",{style:{color:"var(--colorTextSecondary)"},children:U("common.noData")})})}),(0,o.jsx)(c.A,{xs:24,sm:12,children:(0,o.jsx)(l.A,{size:"small",title:U("overview.taskTypes"),children:(null==D?void 0:D.tasks.types)&&Object.keys(D.tasks.types).length>0?(0,o.jsx)(p.A,{wrap:!0,children:Object.entries(D.tasks.types).map(e=>{let[n,t]=e;return(0,o.jsxs)(y.A,{children:[n.slice(0,30),": ",t]},n)})}):(0,o.jsx)("span",{style:{color:"var(--colorTextSecondary)"},children:U("common.noData")})})})]}),(0,o.jsx)(l.A,{title:U("overview.quickActions"),size:"small",children:(0,o.jsxs)(p.A,{wrap:!0,children:[(0,o.jsx)(r.Ay,{onClick:()=>{J.push("/knowledge/manage")},children:U("overview.goToKnowledge")}),(0,o.jsx)(r.Ay,{onClick:()=>{J.push("/models")},children:U("overview.goToModels")}),(0,o.jsx)(r.Ay,{onClick:()=>{J.push("/settings")},children:U("overview.goToSettings")}),(0,o.jsx)(r.Ay,{onClick:()=>{J.push("/prompt")},children:U("nav.promptManagement")}),(0,o.jsx)(r.Ay,{onClick:()=>{J.push("/context/long-term")},children:U("nav.contextEngineering")})]})})]})}},53139:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/overview",function(){return t(27795)}])}},e=>{e.O(0,[260,167,15,577,224,636,593,792],()=>e(e.s=53139)),_N_E=e.O()}]);
|