@customize-agent/server 4.0.6 → 4.0.8

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.
Files changed (165) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +176 -271
  3. package/.next/package.json +1 -0
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +8 -0
  6. package/.next/server/chunks/1936.js +385 -0
  7. package/.next/server/chunks/8204.js +1 -1
  8. package/.next/server/chunks/9301.js +2 -2
  9. package/.next/server/middleware-build-manifest.js +1 -1
  10. package/.next/server/pages/404.html +1 -1
  11. package/.next/server/pages/500.html +1 -1
  12. package/.next/server/pages/_app.js +1 -1
  13. package/.next/server/pages/_app.js.nft.json +1 -1
  14. package/.next/server/pages/_error.js +1 -1
  15. package/.next/server/pages/_error.js.nft.json +1 -1
  16. package/.next/server/pages/api/config/models.js +1 -1
  17. package/.next/server/pages/api/jobs/[id].js +2 -0
  18. package/.next/server/pages/api/jobs/[id].js.nft.json +1 -0
  19. package/.next/server/pages/api/jobs.js +2 -0
  20. package/.next/server/pages/api/jobs.js.nft.json +1 -0
  21. package/.next/server/pages/api/kb/files/open.js +1 -1
  22. package/.next/server/pages/api/kb/files.js +2 -2
  23. package/.next/server/pages/api/kb/operations.js +2 -2
  24. package/.next/server/pages/api/kb/reindex.js +2 -2
  25. package/.next/server/pages/api/kb/reindex.js.nft.json +1 -1
  26. package/.next/server/pages/api/kb/upload.js +2 -2
  27. package/.next/server/pages/api/kb/upload.js.nft.json +1 -1
  28. package/.next/server/pages/asset-library.html +1 -1
  29. package/.next/server/pages/asset-library.js.nft.json +1 -1
  30. package/.next/server/pages/context/long-term.html +1 -1
  31. package/.next/server/pages/context/long-term.js.nft.json +1 -1
  32. package/.next/server/pages/context/short-term.html +1 -1
  33. package/.next/server/pages/context/short-term.js.nft.json +1 -1
  34. package/.next/server/pages/document-roles.html +1 -1
  35. package/.next/server/pages/document-roles.js.nft.json +1 -1
  36. package/.next/server/pages/document-specs.html +1 -1
  37. package/.next/server/pages/document-specs.js.nft.json +1 -1
  38. package/.next/server/pages/documents.html +1 -1
  39. package/.next/server/pages/documents.js.nft.json +1 -1
  40. package/.next/server/pages/guide.html +1 -1
  41. package/.next/server/pages/guide.js.nft.json +1 -1
  42. package/.next/server/pages/index.html +1 -1
  43. package/.next/server/pages/index.js.nft.json +1 -1
  44. package/.next/server/pages/knowledge/file-detail.html +1 -1
  45. package/.next/server/pages/knowledge/file-detail.js.nft.json +1 -1
  46. package/.next/server/pages/knowledge/files.html +1 -1
  47. package/.next/server/pages/knowledge/files.js.nft.json +1 -1
  48. package/.next/server/pages/knowledge/manage.html +1 -1
  49. package/.next/server/pages/knowledge/manage.js.nft.json +1 -1
  50. package/.next/server/pages/knowledge/search.html +1 -1
  51. package/.next/server/pages/knowledge/search.js.nft.json +1 -1
  52. package/.next/server/pages/knowledge.html +1 -1
  53. package/.next/server/pages/knowledge.js.nft.json +1 -1
  54. package/.next/server/pages/models.html +1 -1
  55. package/.next/server/pages/models.js.nft.json +1 -1
  56. package/.next/server/pages/overview.html +1 -1
  57. package/.next/server/pages/overview.js.nft.json +1 -1
  58. package/.next/server/pages/prompt.html +1 -1
  59. package/.next/server/pages/prompt.js.nft.json +1 -1
  60. package/.next/server/pages/settings.html +1 -1
  61. package/.next/server/pages/settings.js.nft.json +1 -1
  62. package/.next/server/pages/system/logs.html +1 -1
  63. package/.next/server/pages/system/logs.js.nft.json +1 -1
  64. package/.next/server/pages-manifest.json +32 -30
  65. package/.next/static/chunks/131-96749f5b6e1460d1.js +1 -0
  66. package/.next/static/chunks/{7150-123ff059dd0e2eb9.js → 150-a7b953a600cbd7e0.js} +3 -3
  67. package/.next/static/chunks/195-9f2e4c67a9deff05.js +1 -0
  68. package/.next/static/chunks/20-23d24b40b69faf0f.js +8 -0
  69. package/.next/static/chunks/265-c3a46cef96364aac.js +1 -0
  70. package/.next/static/chunks/{1289-c788c44e65e9dc64.js → 289-36c210992d5009d5.js} +1 -1
  71. package/.next/static/chunks/412-b9c854c6a76db67d.js +1 -0
  72. package/.next/static/chunks/433-ef3d7675b81826a9.js +1 -0
  73. package/.next/static/chunks/447-772df02993a8609b.js +1 -0
  74. package/.next/static/chunks/455-9e1e1c7e96845347.js +6 -0
  75. package/.next/static/chunks/506-b97aadd3e451b379.js +1 -0
  76. package/.next/static/chunks/512-e2813c7e9454d53c.js +1 -0
  77. package/.next/static/chunks/576-679ab6348b33b960.js +1 -0
  78. package/.next/static/chunks/698-625f34d5d0052e87.js +1 -0
  79. package/.next/static/chunks/749-dcb0cd85d1455f34.js +1 -0
  80. package/.next/static/chunks/{8787-c8bea0f25cbd3cf0.js → 787-196a2bed7b11745a.js} +1 -1
  81. package/.next/static/chunks/788-f74cda5d27cf4390.js +1 -0
  82. package/.next/static/chunks/932-823e1ae10dd43b8b.js +1 -0
  83. package/.next/static/chunks/938-0063785681203bb5.js +1 -0
  84. package/.next/static/chunks/985-da0b1f68e59d1e76.js +4 -0
  85. package/.next/static/chunks/framework-161be364fd69a7ce.js +1 -0
  86. package/.next/static/chunks/main-91fb767ebd74c9c1.js +1 -0
  87. package/.next/static/chunks/pages/_app-e38deed037bfbced.js +212 -0
  88. package/.next/static/chunks/pages/_error-282257fbdcc167b4.js +1 -0
  89. package/.next/static/chunks/pages/asset-library-e9ddfe1cbaac42d9.js +1 -0
  90. package/.next/static/chunks/pages/context/{long-term-820cba5f1ae3a6cd.js → long-term-2e6a30a8f879df47.js} +1 -1
  91. package/.next/static/chunks/pages/context/short-term-730211234fa3add6.js +1 -0
  92. package/.next/static/chunks/pages/document-roles-7197641736843503.js +1 -0
  93. package/.next/static/chunks/pages/document-specs-033d848b03b54df3.js +1 -0
  94. package/.next/static/chunks/pages/documents-3b2f23e2d6b27f1b.js +1 -0
  95. package/.next/static/chunks/pages/guide-cdf68a096918c979.js +1 -0
  96. package/.next/static/chunks/pages/index-c5e0758e6b31deee.js +1 -0
  97. package/.next/static/chunks/pages/knowledge/file-detail-0a5e267f77f4e8b3.js +1 -0
  98. package/.next/static/chunks/pages/knowledge/files-4d2754cc303c2a70.js +1 -0
  99. package/.next/static/chunks/pages/knowledge/manage-25eb1a993b155450.js +1 -0
  100. package/.next/static/chunks/pages/knowledge/search-2cee4e8b8792170c.js +1 -0
  101. package/.next/static/chunks/pages/knowledge-905248d8dcb15453.js +1 -0
  102. package/.next/static/chunks/pages/models-b5f68c4c70257495.js +1 -0
  103. package/.next/static/chunks/pages/overview-380088496f0dae68.js +1 -0
  104. package/.next/static/chunks/pages/prompt-4cf07545f8388d85.js +1 -0
  105. package/.next/static/chunks/pages/settings-fa9d6a56898ba678.js +1 -0
  106. package/.next/static/chunks/pages/system/logs-f4e222140dc7b30c.js +1 -0
  107. package/.next/static/chunks/{webpack-689755a4ff6d1f93.js → webpack-77d10b4726f13aa5.js} +1 -1
  108. package/.next/static/e3Tj4PCt-LpKFkNO9YWjs/_buildManifest.js +1 -0
  109. package/package.json +13 -13
  110. package/scripts/kb-index-worker.cjs +128 -0
  111. package/.next/server/chunks/1547.js +0 -385
  112. package/.next/server/chunks/550.js +0 -1
  113. package/.next/server/chunks/9270.js +0 -1
  114. package/.next/static/JXFgoYPwWCEiyRggKTXQU/_buildManifest.js +0 -1
  115. package/.next/static/chunks/1515-051d4383493143c9.js +0 -1
  116. package/.next/static/chunks/2073-244191fe7cc6e330.js +0 -4
  117. package/.next/static/chunks/2225-a90b5cc9338c63fa.js +0 -1
  118. package/.next/static/chunks/261-8a5ce39d74fc746e.js +0 -1
  119. package/.next/static/chunks/2884-b2944538a4a0d9b2.js +0 -1
  120. package/.next/static/chunks/3057-9eda004e07594513.js +0 -1
  121. package/.next/static/chunks/3455-c73ce4738620db20.js +0 -6
  122. package/.next/static/chunks/347-62c74776c299477d.js +0 -4
  123. package/.next/static/chunks/4052-9caaaa494d67a7e0.js +0 -1
  124. package/.next/static/chunks/4277-ba039fcf8f4e9cdc.js +0 -1
  125. package/.next/static/chunks/4427-302c5267a1f8493e.js +0 -1
  126. package/.next/static/chunks/4833-bf56f1203e2daffa.js +0 -28
  127. package/.next/static/chunks/5292-e65eab4f54b9f7ff.js +0 -16
  128. package/.next/static/chunks/5938-da5d441b981ec422.js +0 -1
  129. package/.next/static/chunks/6506-9d3cdc1ea816d7c4.js +0 -1
  130. package/.next/static/chunks/6578-6422ce4e29eb07d4.js +0 -1
  131. package/.next/static/chunks/6985-29200efa04920cb3.js +0 -4
  132. package/.next/static/chunks/7223-58376fd8a1d62df4.js +0 -1
  133. package/.next/static/chunks/7271-587c30b66ea4e619.js +0 -16
  134. package/.next/static/chunks/7576-b34ccf53f6efc388.js +0 -1
  135. package/.next/static/chunks/7889-8531b79751a71e39.js +0 -1
  136. package/.next/static/chunks/8326-b79c7555af5866e7.js +0 -8
  137. package/.next/static/chunks/861-dd60ef688592115e.js +0 -1
  138. package/.next/static/chunks/8676-5982391f15ea1190.js +0 -1
  139. package/.next/static/chunks/8732-69ffc27ed6c68f6f.js +0 -4
  140. package/.next/static/chunks/8932-e1bb3137986c259a.js +0 -1
  141. package/.next/static/chunks/9144-51689069a3d341e5.js +0 -1
  142. package/.next/static/chunks/9189-03f286defdb92816.js +0 -10
  143. package/.next/static/chunks/9773-53116cd0bf4b961a.js +0 -1
  144. package/.next/static/chunks/framework-fbc6f575b16f07d7.js +0 -1
  145. package/.next/static/chunks/main-105db6ecf7f64ff3.js +0 -1
  146. package/.next/static/chunks/pages/_app-03f3204a695aa8bc.js +0 -140
  147. package/.next/static/chunks/pages/_error-c01b6fb772028676.js +0 -1
  148. package/.next/static/chunks/pages/asset-library-634d18652eb7507d.js +0 -1
  149. package/.next/static/chunks/pages/context/short-term-3332ffb90b3b58a9.js +0 -1
  150. package/.next/static/chunks/pages/document-roles-ab6dfead3fd99a2c.js +0 -1
  151. package/.next/static/chunks/pages/document-specs-565cf77237fce3d5.js +0 -1
  152. package/.next/static/chunks/pages/documents-471786ecea050f17.js +0 -1
  153. package/.next/static/chunks/pages/guide-2a3ec07403e02e1f.js +0 -1
  154. package/.next/static/chunks/pages/index-cc55686ed0309a22.js +0 -1
  155. package/.next/static/chunks/pages/knowledge/file-detail-f5e8f9bc35ebb92d.js +0 -1
  156. package/.next/static/chunks/pages/knowledge/files-88aba3534bd722f9.js +0 -1
  157. package/.next/static/chunks/pages/knowledge/manage-5629ccce14402b99.js +0 -1
  158. package/.next/static/chunks/pages/knowledge/search-ad678d4bc8137cb5.js +0 -1
  159. package/.next/static/chunks/pages/knowledge-55e4c53985e79449.js +0 -1
  160. package/.next/static/chunks/pages/models-1788b9741155e3ce.js +0 -1
  161. package/.next/static/chunks/pages/overview-5235c02260509635.js +0 -1
  162. package/.next/static/chunks/pages/prompt-0184d79af09db7e1.js +0 -1
  163. package/.next/static/chunks/pages/settings-fd31c9ef833cf0af.js +0 -1
  164. package/.next/static/chunks/pages/system/logs-8040fb1e0c814a0c.js +0 -1
  165. /package/.next/static/{JXFgoYPwWCEiyRggKTXQU → e3Tj4PCt-LpKFkNO9YWjs}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4046],{22708:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>U});var o=s(65321),a=s(97109),r=s(32620),i=s(17807),t=s(88762),n=s(68787),c=s(85114),d=s(2256),m=s(38770),h=s(33442),p=s(26171),x=s(11702),y=s(85493),v=s(57271),u=s(7576),j=s(48318),g=s(34052),A=s(63455),f=s(56985),b=s(54746),S=s(29071),w=s(59188),z=s(4216),k=s(13114),C=s(99650),B=s(58209),I=s(76981),T=s(61825),K=s(6578);let P=[{label:"OpenAI 兼容",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"Google",value:"google"},{label:"Ollama",value:"ollama"},{label:"OpenRouter",value:"openrouter"}],E=[{key:"reader",labelKey:"models.tierReader",descKey:"models.tierReaderDesc"},{key:"reasoning",labelKey:"models.tierReasoning",descKey:"models.tierReasoningDesc"},{key:"action",labelKey:"models.tierAction",descKey:"models.tierActionDesc"}],N=[{key:"imageGeneration",label:"图片生成"},{key:"imageUnderstanding",label:"图片理解"},{key:"fileUnderstanding",label:"文件理解"},{key:"audio",label:"音频能力"},{key:"video",label:"视频能力"}];function U(){let e=(0,r.Vr)(),{message:l}=i.A.useApp(),[s,U]=(0,a.useState)(!0),[_,O]=(0,a.useState)([]),[R,F]=(0,a.useState)(null),[H,D]=(0,a.useState)({provider:"transformers-local",model:"BAAI/bge-small-zh-v1.5",dimensions:512}),[W,M]=(0,a.useState)(!1),[G,L]=(0,a.useState)(!1),[X,Z]=(0,a.useState)(null),[V,q]=(0,a.useState)(null),[J,Q]=(0,a.useState)({}),[Y,$]=(0,a.useState)(!1),[ee,el]=(0,a.useState)(!1),[es,eo]=(0,a.useState)(""),[ea,er]=(0,a.useState)(""),[ei,et]=(0,a.useState)(""),[en,ec]=(0,a.useState)(""),[ed,em]=(0,a.useState)("openai"),[eh,ep]=(0,a.useState)(!1),[ex,ey]=(0,a.useState)({}),[ev,eu]=(0,a.useState)(!1),ej=async()=>{U(!0);try{let[e,l,s]=await Promise.all([(0,K.Z3)().catch(()=>[]),(0,K.zr)().catch(()=>null),(0,K.II)().catch(()=>({provider:"transformers-local",model:"BAAI/bge-small-zh-v1.5",dimensions:512}))]);O(e),F(l),D(s)}catch(s){l.error(e("common.error"))}finally{U(!1)}};(0,a.useEffect)(()=>{ej()},[]);let eg=async e=>{el(!0),eo(e.name),er(e.name),et(""),ec(e.baseUrl||""),em(e.protocol||e.detectedProtocol||"openai"),ey(e.capabilities||{});try{let l=await (0,K.Bh)(e.name);et(l.apiKey?"••••••••":""),ec(l.baseUrl||""),ey(l.capabilities||{})}catch(e){}$(!0)},eA=async()=>{if(ea.trim()){eu(!0);try{let s=ee&&ei.includes("•")?void 0:ei||void 0;await (0,K._m)(ea.trim(),{oldName:ee?es:void 0,apiKey:s,baseUrl:en||void 0,protocol:ed,directEndpoint:eh,capabilities:ex}),$(!1),await ej(),l.success(e("common.success"))}catch(s){l.error(e("common.error"))}finally{eu(!1)}}},ef=async s=>{try{await (0,K.h1)(s),await ej(),l.success(e("common.success"))}catch(s){l.error(e("common.error"))}},eb=async s=>{q(s);try{let o=await (0,K.bZ)(s);Q(e=>({...e,[s]:o.success})),l[o.success?"success":"error"](o.success?e("models.connected"):e("models.connectionFailed"))}catch(e){Q(e=>({...e,[s]:!1}))}finally{q(null)}},eS=async(s,o)=>{if(!R)return;let a={...R},r=a[s];if(!o){r.active="",F(a);try{await (0,K.aP)(a)}catch(s){l.error(e("common.error"))}return}let[i,t]=o.includes(":")?o.split(":"):[o,o];r.active=t,r.list.some(e=>e.name===t&&e.provider===i)||r.list.push({name:t,provider:i}),F(a);try{await (0,K.aP)(a)}catch(s){l.error(e("common.error"))}},ew=async()=>{M(!0);try{let s=await (0,K.dd)(H);D(s),Z(null),l.success(e("common.success"))}catch(s){l.error(e("common.error"))}finally{M(!1)}},ez=async()=>{L(!0);try{let s=await (0,K.u6)();Z(s.success),l[s.success?"success":"error"](s.message||(s.success?e("models.connected"):e("models.connectionFailed")))}catch(e){Z(!1)}finally{L(!1)}};return s?(0,o.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,o.jsx)(t.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,o.jsx)(n.A,{size:"small",children:(0,o.jsx)(t.A,{active:!0,paragraph:{rows:6}})}),(0,o.jsx)(n.A,{size:"small",children:(0,o.jsx)(t.A,{active:!0,paragraph:{rows:4}})}),(0,o.jsx)(n.A,{size:"small",children:(0,o.jsx)(t.A,{active:!0,paragraph:{rows:3}})})]}):(0,o.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"pageTitle",children:e("models.title")}),(0,o.jsx)("p",{className:"pageDesc",children:e("models.description")})]}),(0,o.jsx)(c.Ay,{type:"primary",icon:(0,o.jsx)(b.A,{}),onClick:()=>{el(!1),eo(""),er(""),et(""),ec(""),em("openai"),ep(!1),ey({}),$(!0)},children:e("models.addModel")})]}),(0,o.jsx)(n.A,{size:"small",title:"".concat(e("models.modelList")," (").concat(_.length,")"),children:0===_.length?(0,o.jsx)("span",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:e("models.noProviders")}):(0,o.jsx)(d.A,{gutter:[12,12],children:_.map((l,s)=>(0,o.jsx)(m.A,{xs:24,sm:12,lg:8,xl:6,children:(0,o.jsxs)(n.A,{size:"small",hoverable:!0,style:{height:"100%"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,marginBottom:8,minWidth:0},children:[(0,o.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,o.jsx)("div",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.name}),(0,o.jsxs)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:[(0,o.jsx)(S.A,{})," ",l.protocol||l.detectedProtocol||"openai"]})]}),(0,o.jsxs)(h.A,{size:2,children:[(0,o.jsx)(c.Ay,{size:"small",loading:V===l.name,onClick:()=>{eb(l.name)},icon:!0===J[l.name]?(0,o.jsx)(w.A,{style:{color:"var(--colorOk)"}}):!1===J[l.name]?(0,o.jsx)(z.A,{style:{color:"var(--colorDanger)"}}):(0,o.jsx)(k.A,{})}),(0,o.jsx)(c.Ay,{size:"small",icon:(0,o.jsx)(C.A,{}),onClick:()=>{eg(l)}}),(0,o.jsx)(p.A,{title:e("models.deleteProviderConfirm"),onConfirm:()=>{ef(l.name)},children:(0,o.jsx)(c.Ay,{size:"small",danger:!0,icon:(0,o.jsx)(B.A,{})})})]})]}),(0,o.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,o.jsxs)("span",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:[(0,o.jsx)(I.A,{})," ",l.hasApiKey?"••••••••":"—"]}),l.baseUrl&&(0,o.jsxs)("span",{style:{fontSize:12,color:"var(--colorTextSecondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:l.baseUrl,children:[(0,o.jsx)(T.A,{})," ",l.baseUrl]}),(0,o.jsx)(h.A,{size:4,wrap:!0,children:N.filter(e=>{var s;return null==(s=l.capabilities)?void 0:s[e.key]}).map(e=>(0,o.jsx)(x.A,{color:"purple",style:{margin:0,fontSize:10,lineHeight:"16px"},children:e.label},e.key))})]})]})},l.name))})}),(0,o.jsxs)(n.A,{size:"small",title:e("models.embeddingConfig"),children:[(0,o.jsx)(y.A,{type:"info",showIcon:!0,message:e("models.embeddingHint"),style:{marginBottom:16}}),(0,o.jsxs)(d.A,{gutter:[12,12],children:[(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.embeddingProvider")}),(0,o.jsx)(v.A,{value:H.provider,style:{width:"100%"},options:[{label:"本地语义模型(推荐)",value:"transformers-local"},{label:"外部 Embedding(高级)",value:"openai-compatible"}],onChange:e=>D(l=>({...l,provider:e,model:"transformers-local"===e?l.model||"BAAI/bge-small-zh-v1.5":l.model,dimensions:"transformers-local"===e?512:l.dimensions||1024}))})]}),"openai-compatible"===H.provider&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:"Base URL"}),(0,o.jsx)(u.A,{value:H.baseUrl,onChange:e=>D(l=>({...l,baseUrl:e.target.value})),placeholder:"http://localhost:11434/v1"})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.model")}),(0,o.jsx)(u.A,{value:H.model,onChange:e=>D(l=>({...l,model:e.target.value})),placeholder:"bge-m3"})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.apiKey")}),(0,o.jsx)(u.A.Password,{value:H.apiKey,onFocus:()=>{var e;(null==(e=H.apiKey)?void 0:e.includes("•"))&&D(e=>({...e,apiKey:""}))},onChange:e=>D(l=>({...l,apiKey:e.target.value})),placeholder:e("models.optional")}),H.hasApiKey&&(0,o.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginTop:4},children:e("models.embeddingApiKeyHint")})]})]}),"transformers-local"===H.provider&&(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.model")}),(0,o.jsx)(u.A,{value:H.model,onChange:e=>D(l=>({...l,model:e.target.value})),placeholder:"BAAI/bge-small-zh-v1.5"})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.dimensions")}),(0,o.jsx)(j.A,{style:{width:"100%"},min:1,value:H.dimensions,onChange:e=>D(l=>({...l,dimensions:Number(e||("transformers-local"===l.provider?512:1024))}))})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.status")}),(0,o.jsxs)(h.A,{children:[(0,o.jsx)(x.A,{color:"blue",children:"transformers-local"===H.provider?"本地语义模型":e("models.openAICompatible")}),!0===X&&(0,o.jsx)(x.A,{color:"success",children:e("models.connected")}),!1===X&&(0,o.jsx)(x.A,{color:"error",children:e("models.connectionFailed")})]})]})]}),(0,o.jsxs)(h.A,{style:{marginTop:16},children:[(0,o.jsx)(c.Ay,{type:"primary",loading:W,onClick:()=>{ew()},children:e("models.saveEmbedding")}),(0,o.jsx)(c.Ay,{loading:G,onClick:()=>{ez()},children:e("models.testEmbedding")})]})]}),R&&(0,o.jsx)(n.A,{size:"small",title:e("models.modelTiers"),children:(0,o.jsx)(d.A,{gutter:[12,12],children:E.map(l=>{let{key:s,labelKey:a,descKey:r}=l,i=R[s],t=i.list.map(e=>({label:"".concat(e.provider," / ").concat(e.name),value:"".concat(e.provider,":").concat(e.name)})),c=_.filter(e=>!i.list.some(l=>l.provider===e.name)).map(e=>({label:e.name,value:"".concat(e.name,":").concat(e.name)})),d=i.active?i.list.find(e=>e.name===i.active):null;return(0,o.jsx)(m.A,{xs:24,lg:8,children:(0,o.jsxs)(n.A,{size:"small",title:(0,o.jsx)("span",{style:{fontSize:14},children:e(a)}),style:{height:"100%"},children:[(0,o.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)",marginBottom:8,lineHeight:1.5},children:e(r)}),(0,o.jsx)(v.A,{value:i.active?"".concat((null==d?void 0:d.provider)||"",":").concat(i.active):void 0,onChange:e=>{eS(s,e)},allowClear:!0,placeholder:e("models.selectModelPlaceholder"),style:{width:"100%"},options:[...t,...c]}),d&&(()=>{let e=_.find(e=>e.name===d.provider);return(0,o.jsxs)("div",{style:{marginTop:12,padding:"8px 12px",background:"var(--colorBgElevated)",borderRadius:6,border:"1px solid var(--colorBorderSecondary)",display:"flex",alignItems:"center",gap:8},children:[(0,o.jsx)(k.A,{style:{color:"var(--colorAccent)",fontSize:14,flexShrink:0}}),(0,o.jsx)("span",{style:{fontSize:12,fontWeight:500,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.provider}),(null==e?void 0:e.capabilities)&&N.filter(l=>e.capabilities[l.key]).length>0&&(0,o.jsx)(h.A,{size:4,wrap:!0,style:{flexShrink:0},children:N.filter(l=>e.capabilities[l.key]).slice(0,2).map(e=>(0,o.jsx)(x.A,{color:"purple",style:{margin:0,fontSize:10,lineHeight:"16px"},children:e.label},e.key))}),(0,o.jsx)(x.A,{color:"blue",style:{margin:0,fontSize:10,lineHeight:"18px",flexShrink:0},children:"激活"})]})})()]})},s)})})}),(0,o.jsx)(g.A,{title:ee?e("models.editModel"):e("models.addModel"),open:Y,onClose:()=>$(!1),width:800,maskClosable:!1,style:{borderRadius:"12px 0 0 12px"},styles:{body:{padding:"16px 24px"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,o.jsx)(c.Ay,{type:"primary",loading:ev,onClick:()=>{eA()},children:e("common.save")}),children:(0,o.jsxs)(A.A,{layout:"vertical",children:[(0,o.jsx)(A.A.Item,{label:e("models.modelName"),children:(0,o.jsx)(u.A,{value:ea,onChange:e=>er(e.target.value),placeholder:e("models.modelNamePlaceholder")})}),(0,o.jsx)(A.A.Item,{label:e("models.apiKey"),help:ee?e("models.apiKeyEditHint"):void 0,children:(0,o.jsx)(u.A.Password,{value:ei,onFocus:()=>{ee&&ei.includes("•")&&et("")},onChange:e=>et(e.target.value),placeholder:ee?e("models.apiKeyEditPlaceholder"):"sk-..."})}),(0,o.jsx)(A.A.Item,{label:e("models.baseUrl"),children:(0,o.jsx)(u.A,{value:en,onChange:e=>ec(e.target.value),placeholder:"https://api.openai.com/v1"})}),(0,o.jsx)(A.A.Item,{label:e("models.protocol"),children:(0,o.jsx)(v.A,{value:ed,onChange:em,options:P})}),(0,o.jsx)(A.A.Item,{label:"直连端点",children:(0,o.jsx)(f.A,{checked:eh,onChange:e=>ep(e.target.checked),children:"Base URL 是完整接口地址"})}),(0,o.jsx)(A.A.Item,{label:"多模态能力",children:(0,o.jsx)(f.A.Group,{value:N.filter(e=>ex[e.key]).map(e=>e.key),options:N.map(e=>({label:e.label,value:e.key})),onChange:e=>ey(Object.fromEntries(N.map(l=>[l.key,e.includes(l.key)])))})})]})})]})}},77305:(e,l,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/models",function(){return s(22708)}])}},e=>{e.O(0,[347,8787,4277,7889,4833,7271,7576,9144,6985,3455,4052,5938,9773,6578,636,6593,8792],()=>e(e.s=77305)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5449],{27795:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>T});var t=s(65321),r=s(97109),i=s(32620),c=s(85114),o=s(2256),n=s(38770),a=s(68787),x=s(99605),d=s(54849),h=s(33442),v=s(11702),m=s(99811),u=s(520),j=s(93314),A=s(13114),y=s(29071),p=s(26631),g=s(84742),f=s(38762),w=s(8579),k=s(9020),z=s(32632),S=s(95118),N=s(24810),_=s(6578);function T(){var e,l,s,T,P,b,O,C,D,E,M,F;let I=(0,i.Vr)(),[B,W]=(0,r.useState)(null),[U,X]=(0,r.useState)(!0),[R,V]=(0,r.useState)(0),[Z,q]=(0,r.useState)(0),[G,H]=(0,r.useState)(0),[J,K]=(0,r.useState)(0),[L,Q]=(0,r.useState)(0),[Y,$]=(0,r.useState)(null),ee=(0,r.useCallback)(async()=>{X(!0);try{let[e,l,s,t,r,i]=await Promise.all([(0,_.FC)(),(0,_.Z3)().catch(()=>[]),(0,_.lv)().catch(()=>({roles:[],configs:[]})),(0,_.mx)().catch(()=>({specs:[]})),(0,_.Dl)().catch(()=>({templates:[]})),(0,_.II)().catch(()=>null)]);W(e),V(Array.isArray(l)?l.length:0);let c=Array.isArray(s.roles)?s.roles:[];q(c.filter(e=>"file"===e.type).length),H(c.filter(e=>"prompt"===e.type).length),K(Array.isArray(t.specs)?t.specs.length:0),Q(Array.isArray(r.templates)?r.templates.length:0),$(i)}catch(e){}finally{X(!1)}},[]);(0,r.useEffect)(()=>{ee();let e=setInterval(()=>{ee()},1e4);return()=>clearInterval(e)},[ee]);let el=(null!=(l=null==B?void 0:B.cpu.usagePercent)?l:0)>80?"var(--colorDanger)":(null!=(s=null==B?void 0:B.cpu.usagePercent)?s:0)>50?"var(--colorWarning)":"var(--colorOk)",es=(null!=(T=null==B?void 0:B.memory.usagePercent)?T:0)>80?"var(--colorDanger)":(null!=(P=null==B?void 0:B.memory.usagePercent)?P:0)>50?"var(--colorWarning)":"var(--colorOk)",et=(null==B?void 0:B.tasks.total)?Math.round(B.tasks.success/B.tasks.total*100):0,er=null==B||null==(e=B.models)?void 0:e[0];return(0,t.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"pageTitle",children:I("overview.title")}),(0,t.jsx)("p",{className:"pageDesc",children:I("overview.description")})]}),(0,t.jsx)(c.Ay,{icon:(0,t.jsx)(m.A,{spin:U}),loading:U,onClick:()=>{ee()},children:I("common.retry")})]}),(0,t.jsxs)(o.A,{gutter:[16,16],children:[(0,t.jsx)(n.A,{xs:24,sm:12,children:(0,t.jsx)(a.A,{size:"small",title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.A,{})," CPU"]}),children:(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsx)(x.A,{type:"circle",percent:null!=(b=null==B?void 0:B.cpu.usagePercent)?b:0,size:120,strokeColor:el,format:e=>"".concat(null==e?void 0:e.toFixed(1),"%")}),(0,t.jsxs)("div",{className:"text-xs mt-2",style:{color:"var(--colorTextSecondary)"},children:[null!=(O=null==B?void 0:B.cpu.cores)?O:0," ",I("overview.cores")]})]})})}),(0,t.jsx)(n.A,{xs:24,sm:12,children:(0,t.jsx)(a.A,{size:"small",title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.A,{})," ",I("overview.memory")]}),children:(0,t.jsxs)("div",{style:{textAlign:"center"},children:[(0,t.jsx)(x.A,{type:"circle",percent:null!=(C=null==B?void 0:B.memory.usagePercent)?C:0,size:120,strokeColor:es,format:e=>"".concat(e,"%")}),(0,t.jsxs)("div",{className:"text-xs mt-2",style:{color:"var(--colorTextSecondary)"},children:[null!=(D=null==B?void 0:B.memory.processMB)?D:0," MB / ",null!=(E=null==B?void 0:B.memory.totalMB)?E:0," MB"]})]})})})]}),(0,t.jsxs)(o.A,{gutter:[16,16],children:[(0,t.jsx)(n.A,{xs:12,sm:6,children:(0,t.jsx)(a.A,{size:"small",children:(0,t.jsx)(d.A,{title:"运行时间",value:B?Math.floor(B.uptime/3600):0,suffix:"小时",prefix:(0,t.jsx)(A.A,{})})})}),(0,t.jsx)(n.A,{xs:12,sm:6,children:(0,t.jsx)(a.A,{size:"small",children:(0,t.jsx)(d.A,{title:I("overview.tokensUsed"),value:null!=(M=null==B?void 0:B.tokens.total)?M:0,prefix:(0,t.jsx)(y.A,{})})})}),(0,t.jsx)(n.A,{xs:12,sm:6,children:(0,t.jsx)(a.A,{size:"small",children:(0,t.jsx)(d.A,{title:I("overview.tasksTotal"),value:null!=(F=null==B?void 0:B.tasks.total)?F:0,prefix:(0,t.jsx)(p.A,{})})})}),(0,t.jsx)(n.A,{xs:12,sm:6,children:(0,t.jsx)(a.A,{size:"small",children:(0,t.jsx)(d.A,{title:I("overview.successRate"),value:et,suffix:"%",prefix:et>80?(0,t.jsx)(g.A,{style:{color:"var(--colorOk)"}}):(0,t.jsx)(f.A,{style:{color:"var(--colorDanger)"}})})})})]}),(0,t.jsx)(a.A,{size:"small",title:"资源概览",children:(0,t.jsxs)(o.A,{gutter:[16,16],children:[(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(a.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(d.A,{title:"文件角色",value:Z,prefix:(0,t.jsx)(p.A,{style:{color:"var(--colorAccent)"}})})})}),(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(a.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(d.A,{title:"提示词角色",value:G,prefix:(0,t.jsx)(w.A,{style:{color:"var(--colorWarning)"}})})})}),(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(a.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(d.A,{title:"文档规范包",value:J,prefix:(0,t.jsx)(k.A,{style:{color:"var(--colorOk)"}})})})}),(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(a.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(d.A,{title:"模板",value:L,prefix:(0,t.jsx)(z.A,{style:{color:"var(--colorDanger)"}})})})}),(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsxs)(a.A,{size:"small",style:{height:"100%",overflow:"hidden"},children:[(0,t.jsx)(d.A,{title:"语义模型",value:(null==Y?void 0:Y.provider)==="openai-compatible"?"外部 Embedding":Y?"本地语义模型":"—",prefix:(0,t.jsx)(S.A,{style:{color:"var(--colorAccent)"}}),valueStyle:{fontSize:18,whiteSpace:"nowrap"}}),(null==Y?void 0:Y.model)&&(0,t.jsxs)("div",{className:"text-xs mt-1",style:{color:"var(--colorTextSecondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:"".concat(Y.model).concat(Y.dimensions?" \xb7 ".concat(Y.dimensions,"维"):""),children:[Y.model,Y.dimensions?" \xb7 ".concat(Y.dimensions,"维"):""]})]})}),(0,t.jsx)(n.A,{xs:24,sm:12,md:8,lg:4,children:(0,t.jsx)(a.A,{size:"small",style:{height:"100%"},children:(0,t.jsx)(d.A,{title:"模型供应商",value:R,prefix:(0,t.jsx)(N.A,{style:{color:"var(--colorAccent)"}})})})})]})}),(0,t.jsxs)(o.A,{gutter:[16,16],children:[(0,t.jsx)(n.A,{xs:24,sm:12,children:(0,t.jsx)(a.A,{size:"small",title:I("overview.topModel"),style:{height:"100%"},children:er?(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(A.A,{style:{fontSize:24,color:"var(--colorAccent)"}}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-semibold",children:er.model}),(0,t.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["@",er.provider," — ",er.count," ",I("overview.calls")]})]})]}):(0,t.jsx)("span",{style:{color:"var(--colorTextSecondary)"},children:I("common.noData")})})}),(0,t.jsx)(n.A,{xs:24,sm:12,children:(0,t.jsx)(a.A,{size:"small",title:I("overview.taskTypes"),style:{height:"100%"},children:(null==B?void 0:B.tasks.types)&&Object.keys(B.tasks.types).length>0?(0,t.jsx)(h.A,{wrap:!0,children:Object.entries(B.tasks.types).map(e=>{let[l,s]=e;return(0,t.jsxs)(v.A,{children:[l.slice(0,30),": ",s]},l)})}):(0,t.jsx)("span",{style:{color:"var(--colorTextSecondary)"},children:I("common.noData")})})})]})]})}},53139:(e,l,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/overview",function(){return s(27795)}])}},e=>{e.O(0,[347,8787,4277,8732,261,6578,636,6593,8792],()=>e(e.s=53139)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1026],{12887:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"}},23830:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"}},26631:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var o=r(97109),i=r(12887),n=r(88483);function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}let l=o.forwardRef((e,t)=>o.createElement(n.A,a({},e,{ref:t,icon:i.A})))},27549:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/prompt",function(){return r(34508)}])},29606:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var o=r(97109),i=r(23830),n=r(88483);function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}let l=o.forwardRef((e,t)=>o.createElement(n.A,a({},e,{ref:t,icon:i.A})))},34508:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>H});var o=r(65321),i=r(97109),n=r(32620),a=r(17807),l=r(88762),s=r(68787),c=r(33442),d=r(11702),p=r(57271),h=r(85114),m=r(84253),u=r(56985),f=r(26171),y=r(34052),x=r(7576),g=r(29606),j=r(54746),v=r(26631),w=r(99650),A=r(58209);async function S(){let e=await fetch("/api/prompt");if(!e.ok)throw Error("Failed");return e.json()}async function b(e,t,r){let o=await fetch("/api/prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:e,content:t,name:r})});if(!o.ok)throw Error("Failed");return o.json()}async function z(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create",projectRoot:e,content:"# CUSTOMIZE\n"})});if(!t.ok)throw Error("Failed");return t.json()}async function C(e,t){let r=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"createCustom",name:e,content:t})});if(!r.ok)throw Error("Failed");return r.json()}async function T(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"select",selectedIds:e})});if(!t.ok)throw Error("Failed");return t.json()}function O(e){return e.id.startsWith("builtin:")}function k(e){return e.id.startsWith("custom:")}function H(){let e=(0,n.Vr)(),{message:t}=a.A.useApp(),[r,H]=(0,i.useState)(!0),[N,E]=(0,i.useState)([]),[F,P]=(0,i.useState)(!1),[R,_]=(0,i.useState)(null),[B,M]=(0,i.useState)(""),[I,V]=(0,i.useState)(""),[W,J]=(0,i.useState)(!1),[L,D]=(0,i.useState)(!1),[U,X]=(0,i.useState)("custom"),Z=async()=>{H(!0);try{E(await S())}catch(r){t.error(e("common.error"))}finally{H(!1)}};(0,i.useEffect)(()=>{Z()},[]);let $=r=>{if(null==r?void 0:r.projectRoot)return void z(r.projectRoot).then(()=>{t.success(e("common.success")),Z()}).catch(()=>t.error(e("common.error")));_(null),D(!0),V(""),M(""),P(!0)},q=async()=>{if(!I.trim())return void t.error("请输入名称");J(!0);try{R?await b(R.customizePath,B,k(R)?I.trim():void 0):await C(I.trim(),B||"# ".concat(I.trim(),"\n")),t.success(e("common.success")),P(!1),await Z()}catch(r){t.error(e("common.error"))}finally{J(!1)}},G=async(r,o)=>{let i=o?Array.from(new Set([...N.filter(e=>e.selected).map(e=>e.id),r.id])):N.filter(e=>e.selected&&e.id!==r.id).map(e=>e.id);try{await T(i),E(e=>e.map(e=>({...e,selected:i.includes(e.id)})))}catch(r){t.error(e("common.error"))}},K=async r=>{try{if(!(await fetch("/api/prompt",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:r.projectId,filePath:r.customizePath})})).ok)throw Error("Failed");t.success(e("common.success")),await Z()}catch(r){t.error(e("common.error"))}},Q=N.find(e=>e.isCurrent),Y=N.filter(O),ee=N.filter(k),et=N.filter(e=>!O(e)&&!k(e)),er="all"===U?N:"builtin"===U?Y:"custom"===U?ee:et;return r?(0,o.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,o.jsx)(l.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,o.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:12},children:Array.from({length:4}).map((e,t)=>(0,o.jsx)(s.A,{size:"small",children:(0,o.jsx)(l.A,{active:!0,paragraph:{rows:4}})},t))})]}):(0,o.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"pageTitle",children:e("nav.promptManagement")}),(0,o.jsx)("p",{className:"pageDesc",children:e("prompt.description")})]}),(0,o.jsxs)(c.A,{children:[Q&&(0,o.jsxs)(d.A,{color:"green",style:{lineHeight:"22px"},children:[(0,o.jsx)(g.A,{})," ",Q.projectRoot]}),(0,o.jsx)(p.A,{value:U,onChange:X,style:{width:160},options:[{label:"全部 (".concat(N.length,")"),value:"all"},{label:"我的提示词 (".concat(ee.length,")"),value:"custom"},{label:"项目提示词 (".concat(et.length,")"),value:"project"},{label:"内置示例 (".concat(Y.length,")"),value:"builtin"}]}),(0,o.jsx)(h.Ay,{type:"primary",icon:(0,o.jsx)(j.A,{}),onClick:()=>$(),children:"创建提示词"})]})]}),0===er.length?(0,o.jsx)(m.A,{description:e("prompt.noProjects")}):(0,o.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:12},children:er.map(e=>{let r=e.hasFile&&e.content?e.content.replace(/^#.*$/gm,"").replace(/\n{3,}/g,"\n\n").trim():"";return(0,o.jsxs)(s.A,{size:"small",hoverable:!0,styles:{body:{display:"flex",flexDirection:"column",height:"100%"}},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:8},children:[(0,o.jsx)(v.A,{style:{color:e.isCurrent?"var(--colorOk)":"var(--colorAccent)",fontSize:14,flexShrink:0}}),(0,o.jsx)("span",{style:{fontWeight:600,fontSize:13,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:e.projectName}),!e.hasFile&&e.projectRoot&&(0,o.jsx)(h.Ay,{size:"small",icon:(0,o.jsx)(j.A,{}),onClick:()=>$(e)})]}),e.projectRoot&&(0,o.jsxs)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:6,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(0,o.jsx)(g.A,{style:{marginRight:4}}),e.projectRoot]}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:8},children:[e.isCurrent&&(0,o.jsx)(d.A,{color:"green",style:{margin:0,fontSize:10,lineHeight:"16px"},children:"当前项目"}),O(e)&&(0,o.jsx)(d.A,{color:"gold",style:{margin:0,fontSize:10,lineHeight:"16px"},children:"内置示例"}),k(e)&&(0,o.jsx)(d.A,{color:"cyan",style:{margin:0,fontSize:10,lineHeight:"16px"},children:"我的提示词"}),!O(e)&&!k(e)&&(0,o.jsx)(d.A,{color:"blue",style:{margin:0,fontSize:10,lineHeight:"16px"},children:"项目提示词"}),e.selected&&(0,o.jsx)(d.A,{color:"purple",style:{margin:0,fontSize:10,lineHeight:"16px"},children:"已选中"}),e.hasFile?(0,o.jsx)(d.A,{color:"blue",style:{margin:0,fontSize:10,lineHeight:"16px"},children:"有文件"}):(0,o.jsx)(d.A,{color:"default",style:{margin:0,fontSize:10,lineHeight:"16px"},children:"无文件"})]}),r&&(0,o.jsxs)("div",{style:{padding:8,background:"var(--colorFillAlter)",borderRadius:6,fontSize:11,maxHeight:80,overflow:"hidden",color:"var(--colorTextSecondary)",whiteSpace:"pre-wrap",fontFamily:"monospace",marginBottom:8,lineHeight:1.5},children:[r.slice(0,180),r.length>180?"...":""]}),(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,paddingTop:8,borderTop:"1px solid var(--colorBorderSecondary)",marginTop:"auto"},children:[e.hasFile?(0,o.jsx)(u.A,{checked:e.selected,onChange:t=>{G(e,t.target.checked)},style:{fontSize:12},children:"选中"}):(0,o.jsx)("span",{}),(0,o.jsx)("div",{style:{flex:1}}),e.hasFile&&(0,o.jsx)(h.Ay,{size:"small",icon:(0,o.jsx)(w.A,{}),onClick:()=>(e=>{if(O(e)){_(null),D(!0),V(e.projectName.replace(/^内置|/,"")+" Copy"),M(e.content||""),P(!0),t.info("内置提示词不可直接编辑,已为你创建副本");return}_(e),D(!1),V(e.projectName),M(e.content||""),P(!0)})(e),children:O(e)?"复制":"编辑"}),(0,o.jsx)(f.A,{title:O(e)?"删除内置提示词?":k(e)?"删除自定义提示词?":"删除项目记录及文件?",disabled:O(e),onConfirm:()=>{K(e)},children:(0,o.jsx)(h.Ay,{size:"small",danger:!0,icon:(0,o.jsx)(A.A,{}),disabled:O(e)})})]})]},e.id)})}),(0,o.jsxs)(y.A,{title:L?"创建提示词":R&&k(R)?"编辑我的提示词 — ".concat(I||R.projectName):"编辑项目提示词 — ".concat((null==R?void 0:R.projectName)||""),open:F,onClose:()=>P(!1),width:800,maskClosable:!1,style:{borderRadius:"12px 0 0 12px"},styles:{body:{padding:"16px 24px"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,o.jsxs)(c.A,{children:[(0,o.jsx)(h.Ay,{onClick:()=>P(!1),children:e("common.cancel")}),(0,o.jsx)(h.Ay,{type:"primary",loading:W,onClick:()=>{q()},children:e("common.save")})]}),children:[(0,o.jsx)("div",{style:{marginBottom:12},children:L||R&&k(R)?(0,o.jsxs)(c.A,{direction:"vertical",size:6,style:{width:"100%"},children:[(0,o.jsx)(x.A,{placeholder:"提示词名称",value:I,onChange:e=>V(e.target.value),style:{maxWidth:400}}),!L&&(0,o.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:null==R?void 0:R.customizePath})]}):(0,o.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:null==R?void 0:R.customizePath})}),(0,o.jsx)(x.A.TextArea,{value:B,onChange:e=>M(e.target.value),rows:25,style:{fontFamily:"SF Mono, Monaco, Consolas, monospace",fontSize:13}})]})]})}}},e=>{e.O(0,[347,8787,4277,7889,4833,7271,7576,9144,6985,4052,636,6593,8792],()=>e(e.s=27549)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[199],{2256:(e,l,t)=>{"use strict";t.d(l,{A:()=>s});let s=t(25341).A},7368:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>$});var s=t(65321),r=t(97109),i=t(32620),n=t(49759),o=t(88762),d=t(2256),a=t(38770),c=t(68787),x=t(11702),h=t(73340),u=t(1278);let y=(0,u.A)("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var f=t(56733),p=t(38300);let v=(0,u.A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var g=t(87824);let m=(0,u.A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var j=t(6578);let A=(e,l,t)=>(0,s.jsx)("div",{style:{width:32,height:32,borderRadius:8,background:l,display:"flex",alignItems:"center",justifyContent:"center",color:t,flexShrink:0},children:e});function $(){var e,l;let t=(0,i.Vr)("settings"),{theme:u,resolvedTheme:$,setTheme:b}=(0,n.D)(),{locale:S,setLocale:z}=(0,i.x_)(),[k,w]=(0,r.useState)(null),[E,C]=(0,r.useState)(null),[T,N]=(0,r.useState)(null),[M,B]=(0,r.useState)(!0);(0,r.useEffect)(()=>{B(!0),Promise.all([(0,j.FC)().catch(()=>null),(0,j.le)().catch(()=>null),(0,j.II)().catch(()=>null)]).then(e=>{let[l,t,s]=e;w(l),C(t),N(s)}).finally(()=>B(!1))},[]);let R="system"===u?"system":$,F=e=>"applePill".concat(e?" applePillActive":"");return M?(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)(o.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,s.jsxs)(d.A,{gutter:[16,16],children:[Array.from({length:4}).map((e,l)=>(0,s.jsx)(a.A,{xs:24,md:12,children:(0,s.jsx)(c.A,{size:"small",children:(0,s.jsx)(o.A,{active:!0,paragraph:{rows:2}})})},l)),(0,s.jsx)(a.A,{xs:24,children:(0,s.jsx)(c.A,{size:"small",children:(0,s.jsx)(o.A,{active:!0,paragraph:{rows:4}})})})]})]}):(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"pageTitle",children:t("title")}),(0,s.jsx)("p",{className:"pageDesc",children:t("description")})]}),(0,s.jsxs)(d.A,{gutter:[16,16],children:[(0,s.jsx)(a.A,{xs:24,md:12,style:{display:"flex"},children:(0,s.jsxs)(c.A,{size:"small",style:{flex:1},styles:{body:{padding:"14px 18px"}},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[A((0,s.jsx)(h.A,{size:16}),"rgba(88,86,214,0.1)","#5856d6"),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontWeight:600,fontSize:14},children:t("language")}),(0,s.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:t("languageDesc")})]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,s.jsx)("button",{className:F("zh-CN"===S),onClick:()=>z("zh-CN"),children:"中文"}),(0,s.jsx)("button",{className:F("en-US"===S),onClick:()=>z("en-US"),children:"English"})]})]})}),(0,s.jsx)(a.A,{xs:24,md:12,style:{display:"flex"},children:(0,s.jsxs)(c.A,{size:"small",style:{flex:1},styles:{body:{padding:"14px 18px"}},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[A((0,s.jsx)(y,{size:16}),"rgba(250,140,22,0.1)","#fa8c16"),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontWeight:600,fontSize:14},children:t("theme")}),(0,s.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:t("themeDesc")})]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,s.jsxs)("button",{className:F("light"===R),onClick:()=>b("light"),children:[(0,s.jsx)(f.A,{size:14}),t("light")]}),(0,s.jsxs)("button",{className:F("dark"===R),onClick:()=>b("dark"),children:[(0,s.jsx)(p.A,{size:14}),t("dark")]}),(0,s.jsxs)("button",{className:F("system"===R),onClick:()=>b("system"),children:[(0,s.jsx)(y,{size:14}),t("system")]})]})]})}),(0,s.jsx)(a.A,{xs:24,md:12,style:{display:"flex"},children:(0,s.jsxs)(c.A,{size:"small",style:{flex:1},styles:{body:{padding:"14px 18px"}},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[A((0,s.jsx)(v,{size:16}),"rgba(22,119,255,0.1)","#1677ff"),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontWeight:600,fontSize:14},children:"服务运行状态"}),(0,s.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:"查看当前服务是否正常,以及本机资源占用情况。"})]})]}),(0,s.jsxs)(d.A,{gutter:[12,12],children:[(0,s.jsx)(a.A,{span:12,children:(0,s.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,s.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"状态"}),(0,s.jsx)(x.A,{color:(null==E?void 0:E.status)==="ok"?"success":"error",style:{margin:0},children:(null==E?void 0:E.status)==="ok"?"运行中":"—"})]})}),(0,s.jsx)(a.A,{span:12,children:(0,s.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,s.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"运行时间"}),(0,s.jsx)("div",{style:{fontSize:14,fontWeight:600},children:E?(e=>{let l=Math.floor(e/86400),t=Math.floor(e%86400/3600),s=Math.floor(e%3600/60);return l>0?"".concat(l," 天 ").concat(t," 小时"):t>0?"".concat(t," 小时 ").concat(s," 分"):"".concat(s," 分")})(E.uptime):"—"})]})}),(0,s.jsx)(a.A,{span:12,children:(0,s.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,s.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"CPU"}),(0,s.jsx)("div",{style:{fontSize:14,fontWeight:600},children:k?"".concat(k.cpu.usagePercent.toFixed(1),"%"):"—"}),(0,s.jsxs)("div",{style:{fontSize:10,color:"var(--colorTextSecondary)"},children:[null!=(e=null==k?void 0:k.cpu.cores)?e:0," 核"]})]})}),(0,s.jsx)(a.A,{span:12,children:(0,s.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,s.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"内存"}),(0,s.jsx)("div",{style:{fontSize:14,fontWeight:600},children:k?"".concat(k.memory.processMB," MB"):"—"}),(0,s.jsxs)("div",{style:{fontSize:10,color:"var(--colorTextSecondary)"},children:["/ ",null!=(l=null==k?void 0:k.memory.totalMB)?l:0," MB"]})]})})]})]})}),(0,s.jsx)(a.A,{xs:24,md:12,style:{display:"flex"},children:(0,s.jsxs)(c.A,{size:"small",style:{flex:1},styles:{body:{padding:"14px 18px"}},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[A((0,s.jsx)(g.A,{size:16}),"rgba(82,196,26,0.1)","#52c41a"),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontWeight:600,fontSize:14},children:"知识库向量配置"}),(0,s.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:"用于知识库检索。修改模型或维度后,建议重新索引知识库。"})]})]}),(0,s.jsxs)(d.A,{gutter:[12,12],children:[(0,s.jsx)(a.A,{span:12,children:(0,s.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,s.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"供应商"}),(0,s.jsx)(x.A,{color:"blue",style:{margin:0},children:(null==T?void 0:T.provider)||"—"})]})}),(0,s.jsx)(a.A,{span:12,children:(0,s.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,s.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"密钥状态"}),(null==T?void 0:T.hasApiKey)?(0,s.jsx)(x.A,{color:"success",style:{margin:0},children:"已配置"}):(0,s.jsx)(x.A,{color:"default",style:{margin:0},children:"未配置"})]})}),(0,s.jsx)(a.A,{span:12,children:(0,s.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,s.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"模型"}),(0,s.jsx)("div",{style:{fontSize:12,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(null==T?void 0:T.model)||"—"})]})}),(0,s.jsx)(a.A,{span:12,children:(0,s.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,s.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"维度"}),(0,s.jsx)("div",{style:{fontSize:14,fontWeight:600},children:(null==T?void 0:T.dimensions)?"".concat(T.dimensions):"—"})]})})]})]})}),(0,s.jsx)(a.A,{xs:24,children:(0,s.jsxs)(c.A,{size:"small",styles:{body:{padding:"14px 18px"}},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[A((0,s.jsx)(m,{size:16}),"rgba(114,46,209,0.1)","#722ed1"),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{style:{fontWeight:600,fontSize:14},children:"本地数据与使用概况"}),(0,s.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:"用户数据保存在本机,包含知识库、提示词、角色配置、规范包、生成记录和日志。"})]})]}),(0,s.jsx)(d.A,{gutter:[8,8],children:[{label:"用户数据目录",value:"~/.customize-agent/",mono:!0},{label:"知识库数据",value:"本地索引与向量库"},{label:"生成记录",value:"草稿、导出和资源"},{label:"配置数据",value:"提示词、角色、规范包"},{label:"累计任务",value:k?k.tasks.total.toLocaleString():"—"},{label:"Token 用量",value:k?k.tokens.total.toLocaleString():"—"},{label:"日志",value:"本地运行日志"},{label:"数据范围",value:"仅保存在本机"}].map(e=>(0,s.jsx)(a.A,{xs:12,sm:6,children:(0,s.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"8px 12px"},children:[(0,s.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:2},children:e.label}),(0,s.jsx)("div",{style:{fontSize:13,fontWeight:600,fontFamily:e.mono?"monospace":void 0},children:e.value})]})},e.label))})]})})]})]})}},15033:(e,l,t)=>{"use strict";t.d(l,{A:()=>s});let s=(0,t(97109).createContext)({})},19013:(e,l,t)=>{"use strict";t.d(l,{C:()=>r});var s=t(97109);let r=()=>s.useReducer(e=>e+1,0)},19135:(e,l,t)=>{"use strict";t.d(l,{Ay:()=>a,Gl:()=>o,ko:()=>d,ye:()=>n});var s=t(97109),r=t(7709),i=t(26047);let n=["xxxl","xxl","xl","lg","md","sm","xs"],o=[].concat(n).reverse(),d=(e,l)=>{if(l){for(let t of n)if(e[t]&&l?.[t]!==void 0)return l[t]}},a=()=>{let[,e]=(0,r.Ay)(),l=(e=>({xs:`(max-width: ${e.screenXSMax}px)`,sm:`(min-width: ${e.screenSM}px)`,md:`(min-width: ${e.screenMD}px)`,lg:`(min-width: ${e.screenLG}px)`,xl:`(min-width: ${e.screenXL}px)`,xxl:`(min-width: ${e.screenXXL}px)`,xxxl:`(min-width: ${e.screenXXXL}px)`}))((e=>{let l=[].concat(n).reverse();return l.forEach((t,s)=>{let r=t.toUpperCase(),i=`screen${r}Min`,n=`screen${r}`;if(!(e[i]<=e[n]))throw Error(`${i}<=${n} fails : !(${e[i]}<=${e[n]})`);if(s<l.length-1){let t=`screen${r}Max`;if(!(e[n]<=e[t]))throw Error(`${n}<=${t} fails : !(${e[n]}<=${e[t]})`);let i=l[s+1].toUpperCase(),o=`screen${i}Min`;if(!(e[t]<=e[o]))throw Error(`${t}<=${o} fails : !(${e[t]}<=${e[o]})`)}}),e})(e));return s.useMemo(()=>{let e=new Map,t=-1,s={};return{responsiveMap:l,matchHandlers:{},dispatch:l=>(s=l,e.forEach(e=>{e(s)}),e.size>=1),subscribe(l){return e.size||this.register(),t+=1,e.set(t,l),l(s),t},unsubscribe(l){e.delete(l),e.size||this.unregister()},register(){Object.entries(l).forEach(([e,l])=>{let t=({matches:l})=>{this.dispatch({...s,[e]:l})},r=window.matchMedia(l);(0,i.Tn)(r.addEventListener)&&r.addEventListener("change",t),this.matchHandlers[l]={mql:r,listener:t},t(r)})},unregister(){Object.values(l).forEach(e=>{let l=this.matchHandlers[e];(0,i.Tn)(l?.mql.removeEventListener)&&l.mql.removeEventListener("change",l?.listener)}),e.clear()}}},[l])}},25341:(e,l,t)=>{"use strict";t.d(l,{A:()=>h});var s=t(97109),r=t(3638),i=t(26047),n=t(19135),o=t(74567),d=t(59609),a=t(15033),c=t(84060);let x=(e,l)=>{let[t,r]=s.useState(()=>(0,i.Kg)(e)?e:"");return s.useEffect(()=>{(()=>{if((0,i.Kg)(e)&&r(e),(0,i.Qd)(e))for(let t=0;t<n.ye.length;t++){let s=n.ye[t];if(!l||!l[s])continue;let i=e[s];if(void 0!==i)return void r(i)}})()},[JSON.stringify(e),l]),t},h=s.forwardRef((e,l)=>{let{prefixCls:t,justify:h,align:u,className:y,style:f,children:p,gutter:v=0,wrap:g,...m}=e,{getPrefixCls:j,direction:A}=s.useContext(o.QO),$=(0,d.A)(!0,null),b=x(u,$),S=x(h,$),z=j("row",t),[k,w]=(0,c.L3)(z),E=function(e,l){let t=[void 0,void 0],s=Array.isArray(e)?e:[e,void 0],r=l||{xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0,xxxl:!0};return s.forEach((e,l)=>{if((0,i.Qd)(e))for(let s=0;s<n.ye.length;s++){let i=n.ye[s];if(r[i]&&void 0!==e[i]){t[l]=e[i];break}}else t[l]=e}),t}(v,$),C=(0,r.$)(z,{[`${z}-no-wrap`]:!1===g,[`${z}-${S}`]:S,[`${z}-${b}`]:b,[`${z}-rtl`]:"rtl"===A},y,k,w),T={};E?.[0]&&(T.marginInline=(0,i.Et)(E[0])?`${-(E[0]/2)}px`:`calc(${E[0]} / -2)`);let[N,M]=E;T.rowGap=M;let B=s.useMemo(()=>({gutter:[N,M],wrap:g}),[N,M,g]);return s.createElement(a.A.Provider,{value:B},s.createElement("div",{...m,className:C,style:{...T,...f},ref:l},p))})},38770:(e,l,t)=>{"use strict";t.d(l,{A:()=>s});let s=t(51916).A},51916:(e,l,t)=>{"use strict";t.d(l,{A:()=>h});var s=t(97109),r=t(3638),i=t(26047),n=t(19135),o=t(74567),d=t(10540),a=t(15033),c=t(84060);function x(e){return"auto"===e?"1 1 auto":(0,i.Et)(e)?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}let h=s.forwardRef((e,l)=>{let{getPrefixCls:t,direction:h}=s.useContext(o.QO),{gutter:u,wrap:y}=s.useContext(a.A),{prefixCls:f,span:p,order:v,offset:g,push:m,pull:j,className:A,children:$,flex:b,style:S,...z}=e,k=t("col",f),w=t(),[E,C]=(0,c.xV)(k),[T]=(0,d.PN)(w,"col"),N={},M={};n.Gl.forEach(l=>{let t={},s=e[l];(0,i.Et)(s)?t.span=s:(0,i.Qd)(s)&&(t=s||{}),delete z[l],M={...M,[`${k}-${l}-${t.span}`]:(0,i.R)(t.span),[`${k}-${l}-order-${t.order}`]:t.order||0===t.order,[`${k}-${l}-offset-${t.offset}`]:t.offset||0===t.offset,[`${k}-${l}-push-${t.push}`]:t.push||0===t.push,[`${k}-${l}-pull-${t.pull}`]:t.pull||0===t.pull,[`${k}-rtl`]:"rtl"===h},t.flex&&(M[`${k}-${l}-flex`]=!0,N[T(`${l}-flex`)]=x(t.flex))});let B=(0,r.$)(k,{[`${k}-${p}`]:void 0!==p,[`${k}-order-${v}`]:v,[`${k}-offset-${g}`]:g,[`${k}-push-${m}`]:m,[`${k}-pull-${j}`]:j},A,M,E,C),R={};return u?.[0]&&(R.paddingInline=(0,i.Et)(u[0])?`${u[0]/2}px`:`calc(${u[0]} / 2)`),b&&(R.flex=x(b),!1!==y||R.minWidth||(R.minWidth=0)),s.createElement("div",{...z,style:{...R,...S,...N},className:B,ref:l},$)})},58451:(e,l,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return t(7368)}])},59609:(e,l,t)=>{"use strict";t.d(l,{A:()=>o});var s=t(97109),r=t(82813),i=t(19013),n=t(19135);let o=function(e=!0,l={}){let t=(0,s.useRef)(l),[,o]=(0,i.C)(),d=(0,n.Ay)();return(0,r.Nf)(()=>{let l=d.subscribe(l=>{t.current=l,e&&o()});return()=>d.unsubscribe(l)},[]),t.current}}},e=>{e.O(0,[347,8787,6578,636,6593,8792],()=>e(e.s=58451)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3979],{14995:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"}},39214:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/system/logs",function(){return r(91698)}])},91698:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>k});var a=r(65321),s=r(97109),i=r(35292),n=r(9137),l=r(11702),o=r(88762),c=r(33442),d=r(85114),h=r(26171),p=r(85493),g=r(7576),u=r(21289),x=r(84253),f=r(99811),y=r(58209),m=r(96651),w=r(60470),j=r(32620),v=r(6578);let{Text:A,Paragraph:b}=i.A;function k(){let e=(0,j.Vr)(),[t,r]=(0,s.useState)([]),[i,k]=(0,s.useState)(!0),[S,z]=(0,s.useState)(""),[I,C]=(0,s.useState)(!1),N=async()=>{k(!0);try{r((await (0,v.oH)(500)).logs)}catch(e){n.Ay.error(e instanceof Error?e.message:"加载日志失败")}finally{k(!1)}};(0,s.useEffect)(()=>{N()},[]);let B=(0,s.useMemo)(()=>{let e=S.trim().toLowerCase();return e?t.filter(t=>[t.id,t.level,t.source,t.functionName,t.message,t.stack].filter(Boolean).some(t=>String(t).toLowerCase().includes(e))):t},[S,t]),O=[{title:"序号",key:"index",width:70,render:(e,t,r)=>r+1},{title:"时间",dataIndex:"createdAt",width:170,render:e=>new Date(e).toLocaleString()},{title:"级别",dataIndex:"level",width:80,render:e=>(0,a.jsx)(l.A,{color:"error"===e?"error":"warn"===e?"warning":"blue",style:{margin:0},children:e})},{title:"来源",dataIndex:"source",width:200,render:e=>(0,a.jsx)(A,{code:!0,style:{fontSize:12},children:e})},{title:"函数",dataIndex:"functionName",width:160,render:e=>e?(0,a.jsx)(A,{code:!0,style:{fontSize:12},children:e}):(0,a.jsx)(A,{type:"secondary",children:"-"})},{title:"错误信息",dataIndex:"message",render:e=>(0,a.jsx)(b,{style:{maxWidth:480,overflowWrap:"anywhere",wordBreak:"break-all",marginBottom:0,fontSize:12},ellipsis:{rows:2,expandable:!0,symbol:"展开"},children:e})},{title:"Request ID",dataIndex:"id",width:200,render:e=>(0,a.jsx)(A,{copyable:!0,code:!0,style:{fontSize:12},children:e.slice(0,8)})}];return i&&0===t.length?(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)(o.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,a.jsx)(o.A,{active:!0,paragraph:{rows:12}})]}):(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"pageTitle",children:e("nav.systemLogs")}),(0,a.jsx)("p",{className:"pageDesc",children:"查看 API 异常、模型健康检查失败、PDF 降级等运行时问题。"})]}),(0,a.jsxs)(c.A,{children:[(0,a.jsx)(d.Ay,{icon:(0,a.jsx)(f.A,{}),loading:i,onClick:()=>void N(),children:"刷新"}),(0,a.jsx)(h.A,{title:"确认清空所有错误日志?",onConfirm:()=>{(async()=>{await (0,v.hH)(),n.Ay.success("已清空"),await N()})()},children:(0,a.jsx)(d.Ay,{danger:!0,icon:(0,a.jsx)(y.A,{}),children:"清空日志"})})]})]}),(0,a.jsx)(p.A,{type:"info",showIcon:!0,message:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"日志保存在本机 ~/.customize-agent/logs/errors.jsonl,最多读取最近 500 条。"}),(0,a.jsx)(d.Ay,{type:"link",size:"small",icon:I?(0,a.jsx)(m.A,{}):(0,a.jsx)(w.A,{}),onClick:()=>C(!I),style:{padding:"0 4px"},children:I?"收起":"展开"})]}),description:I?"系统自动记录未捕获的异常、API 错误、模型健康检查失败等运行时问题。日志文件超过 2MB 会自动轮转。":void 0}),(0,a.jsx)(g.A.Search,{allowClear:!0,placeholder:"搜索 requestId / source / function / message / stack",value:S,onChange:e=>z(e.target.value),style:{maxWidth:480}}),(0,a.jsx)(u.A,{rowKey:"id",loading:i,dataSource:B,columns:O,size:"middle",locale:{emptyText:(0,a.jsx)(x.A,{description:"暂无错误日志"})},pagination:{pageSize:20,showSizeChanger:!0,showTotal:e=>"共 ".concat(e," 条")},expandable:{expandedRowRender:e=>(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"8px 0"},children:[e.request&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Request"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5},children:JSON.stringify(e.request,null,2)})]}),void 0!==e.meta&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Meta"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5},children:JSON.stringify(e.meta,null,2)})]}),e.stack&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Stack"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5,maxHeight:300,overflow:"auto"},children:e.stack})]})]})}})]})}},92123:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"}},96651:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(97109),s=r(92123),i=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,n({},e,{ref:t,icon:s.A})))},99811:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(97109),s=r(14995),i=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,n({},e,{ref:t,icon:s.A})))}},e=>{e.O(0,[347,4277,7889,4833,7271,7576,2884,9144,9189,6985,7150,5292,1289,861,6578,636,6593,8792],()=>e(e.s=39214)),_N_E=e.O()}]);