filecat 7.29.1 → 7.30.0
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/build/dist/{2136.b39a58a19d4ac2a5576f.js → 2136.19a34f9f77082df382ea.js} +1 -1
- package/build/dist/{3355.3ed43013cd202cde76e1.js → 3355.fde87101c5a125b8b35f.js} +1 -1
- package/build/dist/{4598.b050a29f3e335bf45c16.js → 4598.0a8c8a04d718951d6692.js} +1 -1
- package/build/dist/{47.a9fd7eb25bf4b15f4cf3.js → 47.1990e4d7ad6e60650aa0.js} +1 -1
- package/build/dist/{6097.4ae3aedf0654494e026d.js → 6097.9ec647296d88d8025198.js} +1 -1
- package/build/dist/{6439.ea487c8a5bebd335956f.js → 6439.638b2b0a12e63ab6ee5b.js} +1 -1
- package/build/dist/7066.2ac2242ba86d6466bc2f.js +1 -0
- package/build/dist/{7678.b8bdcab698ebfd6ab8a5.js → 7678.7ad7da19e968caed935a.js} +1 -1
- package/build/dist/{9260.88b1349d93119c70c4bc.js → 9260.da294480ffc3c674bde0.js} +1 -1
- package/build/dist/{9765.da4ef6f16c56d5c13510.js → 9765.7f8eaa343038f1f21810.js} +1 -1
- package/build/dist/index.html +1 -1
- package/build/dist/main.95960d62d7d713b49e0d.js +2 -0
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/2547.f05399f9c795bedaa7aa.js +0 -1
- package/build/dist/main.1c8323266d441fe5313d.js +0 -2
- /package/build/dist/{main.1c8323266d441fe5313d.js.LICENSE.txt → main.95960d62d7d713b49e0d.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2547],{77481(e,t,n){n.d(t,{S:()=>r,X:()=>i});var s=n(96540),o=n(61443),a=n(74848);function i(e){const[t,n]=s.useState([]),i=(0,s.useRef)(-1),[r,l]=(0,s.useState)(-1),[c,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const m=()=>{i.current=-1,l(-1),d(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,n)=>{const s=!!e.filter&&(e.filter.column??0)===n;let i=t;if(s){const n=e.filter,s=n.options.find(e=>e.value===n.value);null!=n.value&&s&&(i=`${t} (${s.label})`)}return(0,a.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,a.jsx)(o.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},n)})})}),(0,a.jsx)("tbody",{children:t.map((t,n)=>{const s=!!e.onRowDrag;return(0,a.jsx)("tr",{className:s?(r===n?"row-dragging":"")+(c===n?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(i.current=n,l(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=i.current,n=c;m(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:m,children:t.map((n,s)=>{const o=s===t.length-1?"small":"";return(0,a.jsx)("td",{className:o,style:{width:e.width??"auto"},children:n},s)})},n)})})]})}function r(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},52547(e,t,n){n.r(t),n.d(t,{default:()=>N});var s=n(22022),o=n(96540),a=n(85997),i=n(4412),r=n(34843),l=n(82893),c=n(75725),d=n(77481),m=n(61443),p=n(7572),h=n(64484),u=n(14284),_=n(53459),x=n(62042),j=n(7523),v=n(78247),g=n(23430),f=n(61973),y=n(14944),w=n(92275),C=n(88815),b=n(64694),k=n(45907),A=n(12721),S=n(24659),I=n(83277),K=n(74848);function N(){const{t:e}=(0,s.Bd)(),{initUserInfo:t}=(0,o.useContext)(j.F),n=[e("编号"),e("url"),e("是否开启"),e("key"),e("默认model"),e("更多属性"),e("备注")],N=[e("编号"),e("本地目录"),e("自动加载"),e("备注")],[O,M]=(0,o.useState)([]),[P,$]=(0,o.useState)({}),[L,X]=(0,o.useState)([]),[T,D]=(0,o.useState)([]),[R,F]=(0,o.useState)(null),V=(0,o.useRef)(),Y=(0,o.useRef)(!1),q=(0,o.useRef)(!1),[E,W]=(0,o.useState)([]),[H,B]=(0,o.useState)(!1),[G,Z]=(0,o.useState)({}),[U,z]=(0,r.fp)(l.AG.prompt_card),[J,Q]=(0,r.fp)(l.AG.user_base_info),[ee,te]=(0,o.useState)(!1),ne=T.filter(e=>"http"!==(e.transport??"stdio")),se=T.filter(e=>"http"===e.transport),oe=[e("编号"),e("名称"),e("是否开启"),e("状态"),"command","args","cwd",e("tools|env"),e("备注")],ae=[e("编号"),e("名称"),e("是否开启"),e("状态"),e("endpoint"),e("tools|headers"),e("备注")],ie=[e("编号"),e("提示词"),e("LLM编辑开关"),e("llm_pmt"),e("编辑规则"),e("备注")],[re,le]=(0,o.useState)([]),[ce,de]=(0,o.useState)(!1),me=(0,h.T)(),{check_user_auth:pe}=(0,v.MH)(),[he,ue]=(0,r.fp)(l.AG.editorSetting),_e=(0,f.Zp)(),xe=(0,k.y)(),je=(0,S.K)(),ve=async()=>{const e=await u.jV.get("docs_on_get");e.code===_.m.Success&&te(e.data)};(0,o.useEffect)(()=>{(async()=>{const e=await u.XO.get("ai_agent_setting");e.code===_.m.Success&&M(e.data.models);const t=await u.XO.get("ai_agent_global_setting");t.code===_.m.Success&&$(t.data??{}),await y.ws.addMsg(w.HK.ai_load_info,e=>{F(e.context)});const n=await y.ws.sendData(w.HK.ai_load_info,{});n?.context&&F(n.context);const s=await u.XO.get("ai_docs_setting");s.code===_.m.Success&&(V.current=s.data.param,s.data.list?.length&&X(s.data.list));const o=await u.XO.get("ai_mcp_setting");o.code===_.m.Success&&D(o.data.list??[]),await ke(),ve();const a=await u.XO.get("ai_system_prompts");a.code===_.m.Success&&le(a.data??[]);const i=await u.XO.get("ai_long_term_memory_setting");i.code===_.m.Success&&de(i.data?.open??!1)})()},[]),(0,o.useEffect)(()=>{y.ws.addMsg(w.HK.mcp_status,e=>{const t=e.context??{},n={};for(const e of t.status??[])n[e.index]={state:e.state,error:e.error,tool_count:e.tool_count};Z(n),t.done&&ke()})},[]);const ge=(e="stdio")=>{const t="http"===e?{name:"",open:!1,note:"",transport:"http",endpoint:"",headers:"",stream:!1,timeout_ms:1e4}:{name:"",open:!1,command:"",args:"",cwd:"",env:"",note:"",transport:"stdio",timeout_ms:1e4};D([...T,t]),Y.current=!0},fe=e=>{const t=T.indexOf(e);t<0||(T.splice(t,1),D([...T]),Y.current=!0)},ye=e=>{D([...T,{...e,open:!1}]),Y.current=!0},we=async t=>{for(let e=0;e<O.length;e++)O[e].index=e;(await u.XO.post("ai_agent_setting/save",{models:t??O})).code===_.m.Success&&(0,x.SK)(e("保存成功"))},Ce=async t=>{(await u.XO.post("ai_agent_global_setting/save",t??P)).code===_.m.Success&&(0,x.SK)(e("保存成功"))},be=async t=>{for(let e=0;e<T.length;e++)T[e].index=e;(await u.XO.post("ai_mcp_setting/save",{list:t??T})).code===_.m.Success&&((0,x.SK)(e("保存成功")),Y.current=!1,y.ws.sendData(w.HK.mcp_reload,{}))},ke=async()=>{const e=await u.XO.get("ai_mcp_tools");return e.code===_.m.Success?(W(e.data??[]),e.data??[]):[]},Ae=async t=>{B(!0);try{const n=await u.XO.post("ai_mcp_tools/reload",{index:t});if(n.code===_.m.Success)return await ke(),(0,x.SK)(e("MCP工具加载成功")),n.data??null}finally{B(!1)}return null},Se=async(t,n,s,o)=>{const a=o??E.find(e=>e.index===n)??{index:n,key:`${n}`,name:t.name??"",note:t.note,transport:t.transport??"stdio",open:!!t.open,loaded:!1,tool_count:0,tools:[]},i=(a.tools??[]).map(t=>({id:t.runtime_name,title:t.tool_name,subtitle:t.description||e("无描述"),detail:t.display_name,meta:t.runtime_name}));z({open:!0,title:`${t.name||t.note||n} MCP工具`,context_div:(0,K.jsx)(A.O,{title:`${t.name||t.note||n} MCP工具`,subtitle:`${a.transport??"stdio"} | ${a.open?e("是"):e("否")} | ${a.loaded?"loaded":"idle"} | ${a.tool_count} tools`,pages:i,initialPageId:s,onRefresh:async()=>{const e=await Ae(n);e&&await Se(t,n,s,e)},renderPage:t=>{if(!t)return(0,K.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")});const n=a.tools?.find(e=>e.runtime_name===t.id);return n?(0,K.jsxs)("div",{className:"prompt-switch-page__detail",children:[(0,K.jsx)("div",{className:"prompt-switch-page__detail-title",children:n.display_name}),(0,K.jsx)("div",{className:"prompt-switch-page__detail-desc",children:n.description||e("无描述")}),(0,K.jsxs)("div",{className:"prompt-switch-page__detail-row",children:[(0,K.jsx)("strong",{children:"runtime:"})," ",n.runtime_name]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("strong",{children:"schema:"}),(0,K.jsx)("pre",{className:"prompt-switch-page__schema",children:JSON.stringify(n.input_schema??{},null,2)})]})]}):(0,K.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")})}}),cancel:()=>z({open:!1})})},Ie=t=>{const n=G[t];let s=n?.state,o=n?.error,a=n?.tool_count;if(!s){const e=E.find(e=>e.index===t);s=e?.state,o=e?.error,a=e?.tool_count}switch(s){case"loading":return(0,K.jsx)(p.fq,{loading:!0,text:e("加载中")});case"success":return(0,K.jsx)(p.fq,{success:!0,text:`${a??0} ${e("个工具")}`});case"failed":return(0,K.jsx)("span",{title:o??e("加载失败"),children:(0,K.jsx)(p.fq,{success:!1,text:e("加载失败")})});default:return(0,K.jsx)(p.fq,{text:e("未加载")})}},Ke=async t=>{for(let e=0;e<O.length;e++)O[e].index=e;let n={list:L,docs_update_tag:q.current};null!=t&&(n={param:t}),q.current=!1;(await u.XO.post("ai_docs_setting_save",n)).code===_.m.Success&&(0,x.SK)(e("保存成功"))},Ne=async()=>{for(let e=0;e<re.length;e++)re[e].index=e;(await u.XO.post("ai_system_prompts/save",{list:re})).code===_.m.Success&&(0,x.SK)(e("保存成功"))};return(0,K.jsxs)("div",{children:[(0,K.jsx)(i.aZ,{position:"right",children:pe(g.oV.ai_agent_setting)&&(0,K.jsx)(a.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>{_e(-1)}})}),(0,K.jsx)(c.jW,{isFull:!0,more:!0,children:(0,K.jsx)(c.NN,{children:(0,K.jsxs)(c.xh,{children:[(0,K.jsx)(c.fI,{children:(0,K.jsx)(c.VP,{widthPer:100,maxWidth:"130rem",children:(0,K.jsx)(p.uF,{self_title:(0,K.jsxs)("span",{className:" div-row ",children:[(0,K.jsx)("h2",{children:e("供应商设置")})," ",(0,K.jsx)(a.rA,{icon:"info",onClick:()=>{me('\n1. Only OpenAI-style AI APIs are supported. Fill in the FULL endpoint path (not just the domain), e.g. https://ark.cn-beijing.volces.com/api/v3/chat/completions\n2. The longer the conversation history, the more expensive the LLM token cost. Currently, there is no long-term memory simplification capability. You can set the system prompt to make the AI answer more concisely to save tokens\n3. Request parameters (temperature, thinking, etc.) are now set in the YAML "Additional Parameters" editor, under the request_param section.\n4. You can enable "stream": true in the model request parameters to improve response speed.\n5. Deep thinking currently affects output speed. It is recommended to set { "thinking" : { "type":"disabled" } } to disable it (Doubao example).\n6. To use the AI feature to query server information, the AI needs to be able to know some commands. You need to first set command permissions for the user in user settings. It is recommended to set * to allow all commands, and then set the dangerous commands that are not allowed to be executed in the settings\n7. The model type and Become Tool are now both configured in "More Attributes → Extra Parameter Settings" using request_type / tool_mode (comments are already provided in the editor).\n8. After becoming a tool, the model will be loaded as a tool, enabling different models to serve as different roles; please do not set both it and "Enabled" to true at the same time.\n')},title:"信息"})]}),rightTopCom:(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"short_text",title:e("全局prompt"),onClick:()=>{ue({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{P.sys_prompt=e,$({...P}),v.xK.set_value_temp(""),await Ce({...P,sys_prompt:e})}}),v.xK.set_value_temp(P.sys_prompt??"")}}),(0,K.jsx)(a.rA,{icon:"settings",title:e("全局")+" "+e("额外参数设置"),onClick:()=>{ue({model:"ace/mode/yaml",open:!0,fileName:"",save:async e=>{P.yaml_env=e,$({...P}),v.xK.set_value_temp(""),await Ce({...P,yaml_env:e})}}),v.xK.set_value_temp(P.yaml_env??"")}}),(0,K.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{M([...O,{note:"",open:!1,path:"",yaml_env:I.CP}])}}),(0,K.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{await we()}})]}),children:(0,K.jsx)(d.X,{headers:n,onRowDrag:(e,t)=>{M((0,b.TI)(O,e,t))},rows:O.map((t,n)=>{const s=[(0,K.jsx)("div",{children:n}),(0,K.jsx)(m.Sm,{value:I.Lv.get_label_by_v(t.url,t.show_options?.options_agent_url_list),options:t.show_options?.options_agent_url_list,handleInputChange:e=>{t.url=e},no_border:!0}),(0,K.jsx)(m.l6,{value:t.open,onChange:e=>{((e,t,n)=>{const s=[];for(let e=0;e<O.length;e++)O[e].open=e===n&&t,s.push(O[e]);M(s)})(0,e,n)},options:je,no_border:!0}),(0,K.jsx)(m.Sm,{type:I.Lv.have_label_by_v(t.token,t.show_options?.options_agent_key_list)?null:"password",value:I.Lv.get_label_by_v(t.token,t.show_options?.options_agent_key_list),options:t.show_options?.options_agent_key_list,handleInputChange:e=>{t.token=e},no_border:!0}),(0,K.jsx)(m.Sm,{value:I.Lv.get_label_by_v(t.model,t.show_options?.options_agent_model_list),options:t.show_options?.options_agent_model_list,handleInputChange:e=>{t.model=e},no_border:!0}),(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"short_text",title:"prompt",onClick:()=>{v.xK.set_value_temp(O[n].sys_prompt??""),ue({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{O[n].sys_prompt=e,M(O),v.xK.set_value_temp(""),we(O)}})}}),(0,K.jsx)(a.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{v.xK.set_value_temp(O[n].yaml_env),ue({model:"ace/mode/yaml",open:!0,fileName:"",save:async e=>{O[n].yaml_env=e,M(O),v.xK.set_value_temp(""),we(O)}})}})]}),(0,K.jsx)(m.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{O.splice(e,1),M([...O])})(n)}),(0,K.jsx)(a.rA,{icon:"copy_all",title:e("复制"),onClick:()=>(e=>{M([...O,{...O[e],open:!1}])})(n)})]})];return s}),width:"10rem"})})})}),(0,K.jsx)(c.fI,{children:(0,K.jsx)(c.VP,{widthPer:70,maxWidth:"100rem",children:(0,K.jsx)(p.uF,{self_title:(0,K.jsxs)("span",{className:" div-row ",children:[(0,K.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - stdio"]})," ",(0,K.jsx)(a.rA,{icon:"info",onClick:()=>{me("\n1. 这里配置的是 MCP Client 启动参数,当前实现的是 stdio 模式,也就是通过 command + args 启动本地 MCP Server\n2. 例如可以填 npx / uvx / python 等命令,再配合对应的 MCP server 包参数\n3. 保存后会自动重新加载 MCP 工具,agent 聊天时会把这些工具一起带给模型\n4. 建议把 cwd 配到具体项目目录,避免 server 在错误目录里运行\n")},title:"信息"})]}),rightTopCom:(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>ge("stdio")}),(0,K.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{be()}})]}),children:(0,K.jsx)(d.X,{headers:oe,onRowDrag:(e,t)=>{D((0,b.TI)(T,T.indexOf(ne[e]),T.indexOf(ne[t]))),Y.current=!0},rows:ne.map((t,n)=>{const s=T.indexOf(t);return[(0,K.jsx)("div",{children:n}),(0,K.jsx)(m.Sm,{value:t.name,handleInputChange:e=>{t.name=e,Y.current=!0},no_border:!0}),(0,K.jsx)(m.l6,{value:t.open,onChange:e=>{t.open=e,D([...T]),Y.current=!0},options:je,no_border:!0}),Ie(T.indexOf(t)),(0,K.jsx)(m.Sm,{value:t.command,handleInputChange:e=>{t.command=e,Y.current=!0},no_border:!0}),(0,K.jsx)(m.Sm,{value:t.args,handleInputChange:e=>{t.args=e,Y.current=!0},no_border:!0}),(0,K.jsx)(m.Sm,{value:t.cwd,handleInputChange:e=>{t.cwd=e,Y.current=!0},no_border:!0}),(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"visibility",title:"查看工具",onClick:()=>{Se(t,s)}}),(0,K.jsx)(a.rA,{icon:"settings",title:"env",onClick:()=>{v.xK.set_value_temp(t.env??""),ue({model:"ace/mode/yaml",open:!0,fileName:"",save:async e=>{t.env=e,D([...T]),v.xK.set_value_temp(""),Y.current=!0,be()}})}})]}),(0,K.jsx)(m.Sm,{value:t.note,handleInputChange:e=>{t.note=e,Y.current=!0},no_border:!0}),(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>fe(t)}),(0,K.jsx)(a.rA,{icon:"copy_all",title:e("复制"),onClick:()=>ye(t)})]})]}),width:"10rem"})})})}),(0,K.jsx)(c.fI,{children:(0,K.jsxs)(c.VP,{widthPer:70,maxWidth:"100rem",children:[(0,K.jsx)(p.uF,{self_title:(0,K.jsxs)("span",{className:" div-row ",children:[(0,K.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - HTTP"]})," "]}),rightTopCom:(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>ge("http")}),(0,K.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{be()}})]}),children:(0,K.jsx)(d.X,{headers:ae,onRowDrag:(e,t)=>{D((0,b.TI)(T,T.indexOf(se[e]),T.indexOf(se[t]))),Y.current=!0},rows:se.map((t,n)=>{const s=T.indexOf(t);return[(0,K.jsx)("div",{children:n}),(0,K.jsx)(m.Sm,{value:t.name,handleInputChange:e=>{t.name=e,Y.current=!0},no_border:!0}),(0,K.jsx)(m.l6,{value:t.open,onChange:e=>{t.open=e,D([...T]),Y.current=!0},options:je,no_border:!0}),Ie(T.indexOf(t)),(0,K.jsx)(m.Sm,{value:t.endpoint,handleInputChange:e=>{t.endpoint=e,Y.current=!0},no_border:!0}),(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"visibility",title:"查看工具",onClick:()=>{Se(t,s)}}),(0,K.jsx)(a.rA,{icon:"settings",title:"headers",onClick:()=>{v.xK.set_value_temp(t.headers??""),ue({model:"ace/mode/yaml",open:!0,fileName:"",save:async e=>{t.headers=e,D([...T]),v.xK.set_value_temp(""),Y.current=!0,be()}})}})]}),(0,K.jsx)(m.Sm,{value:t.note,handleInputChange:e=>{t.note=e,Y.current=!0},no_border:!0}),(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>fe(t)}),(0,K.jsx)(a.rA,{icon:"copy_all",title:e("复制"),onClick:()=>ye(t)})]})]}),width:"10rem"})}),(0,K.jsx)(p.uF,{self_title:(0,K.jsxs)("span",{className:" div-row ",children:[(0,K.jsx)("h2",{children:e("系统会话提示词")})," ",(0,K.jsx)(a.rA,{icon:"info",onClick:()=>{me('\n1. 系统会话提示词,在 AI 聊天页创建会话时可以选择,选中的提示词会自动填入聊天框作为第一条系统消息\n2. 适用于预先设定常用的会话场景模板,如"代码审查"、"翻译助手"、"运维诊断"等\n3. "LLM编辑开关":开启后,当用户选择了该系统提示词发起对话时,AI 将会获得一个"更新会话提示词"工具,允许 AI 在对话中对当前会话进行总结,并写入到本提示词的"LLM编辑提示词"字段(全局保存,供之后的新会话沿用),使 AI 能自我维护长期上下文。\n4. "LLM编辑提示词":可选。AI 编辑后写回的内容(可预填初始方向)。仅在"LLM编辑开关"开启时生效。\n5. "编辑规则":可选。给 LLM 的编辑要求,例如"总结时不要超过 300 token"、"用简洁的项目要点记录"等。仅在"LLM编辑开关"开启时生效。\n')},title:"信息"})]}),rightTopCom:(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{le([...re,{prompt:"",note:"",llm_prompt_enable:!1}])}}),(0,K.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{Ne()}})]}),children:(0,K.jsx)(d.X,{headers:ie,onRowDrag:(e,t)=>{le((0,b.TI)(re,e,t))},rows:re.map((t,n)=>{const s=[(0,K.jsx)("div",{children:n}),(0,K.jsx)("div",{children:(0,K.jsx)(a.rA,{icon:"short_text",title:e("提示词"),onClick:()=>{v.xK.set_value_temp(t.prompt??""),ue({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.prompt=e,le([...re]),v.xK.set_value_temp(""),Ne()}})}})}),(0,K.jsx)(a.Ay,{checked:!!t.llm_prompt_enable,onChange:e=>{t.llm_prompt_enable=e,le([...re])},title:e("LLM编辑开关")}),(0,K.jsx)("div",{children:(0,K.jsx)(a.rA,{icon:"edit_note",title:e("llm_pmt"),onClick:()=>{v.xK.set_value_temp(t.llm_prompt??""),ue({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.llm_prompt=e,le([...re]),v.xK.set_value_temp(""),Ne()}})}})}),(0,K.jsx)("div",{children:(0,K.jsx)(a.rA,{icon:"rule",title:e("编辑规则"),onClick:()=>{v.xK.set_value_temp(t.llm_prompt_tip??""),ue({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.llm_prompt_tip=e,le([...re]),v.xK.set_value_temp(""),Ne()}})}})}),(0,K.jsx)(m.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,K.jsx)("div",{children:(0,K.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{re.splice(e,1),le([...re])})(n)})})];return s}),width:"10rem"})}),(0,K.jsx)(p.uF,{self_title:(0,K.jsxs)("span",{className:" div-row ",children:[(0,K.jsx)("h2",{children:e("长期记忆")})," ",(0,K.jsx)(a.rA,{icon:"info",onClick:()=>{me(e("开启后跨会话保存记忆。四个固定文件:周/月/年/永久。每周结束自动压缩周→月,每月结束自动压缩月→年,每年结束自动压缩年→永久。编辑按钮可手动查看和修改。"))},title:"信息"})]}),rightTopCom:(0,K.jsx)("div",{children:(0,K.jsx)(a.Ay,{checked:ce,onChange:async t=>{de(t),await u.XO.post("ai_long_term_memory_setting/save",{open:t}),(0,x.SK)(e("长期记忆设置已保存"))},title:e("开关")})}),children:(0,K.jsx)("div",{style:{display:"flex",gap:"0.5rem",padding:"0.5rem 0",flexWrap:"wrap"},children:[{type:"week",label:e("周记忆"),tip:e("上限3000字")},{type:"month",label:e("月记忆"),tip:e("上限6000字")},{type:"year",label:e("年记忆"),tip:e("上限9000字")},{type:"forever",label:e("永久记忆"),tip:e("上限12000字")}].map(({type:t,label:n,tip:s})=>(0,K.jsx)(a.rA,{icon:"edit",title:`${e("编辑")} ${n} (${s})`,onClick:async()=>{const e=await u.XO.get(`ai_long_term_memory_bucket/${t}`),n=e.code===_.m.Success?e.data??"":"";v.xK.set_value_temp(n),ue({model:"ace/mode/text",open:!0,fileName:`long_term_memory_${t}.txt`,save:async e=>{await u.XO.post(`ai_long_term_memory_bucket/${t}/save`,{data:e}),v.xK.set_value_temp("")}})}},t))})})]})}),(0,K.jsxs)(c.fI,{children:[(0,K.jsx)(c.VP,{widthPer:50,maxWidth:"80rem",children:(0,K.jsx)(p.uF,{self_title:(0,K.jsxs)("span",{className:" div-row ",children:[(0,K.jsx)("h2",{children:e("本地知识库")})," ",(0,K.jsx)(a.rA,{icon:"info",onClick:()=>{me("\n1. 本地知识库用于为AI增强理解能力,或者分析本地文件,原理读取本地的文件,对文件在内存中建立全文索引,为AI提供额外数据(需要有模型开启才能使用)\n2. 该功能只能用于小型知识库,作为本地小型或者公司内部资料使用还是没有问题的\n3. 每次保存都会重新加载知识库中的文件,不会全部重新加载,而是检测哪些文件有变更\n")},title:"信息"})]}),rightTopCom:(0,K.jsxs)("div",{children:[(0,K.jsx)(a.Ay,{checked:ee,onChange:async e=>{await u.jV.post("docs_on_set",{status:e}),ve(),t()},title:e("知识库开关")}),(0,K.jsx)(a.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{v.xK.set_value_temp(V.current),ue({model:"ace/mode/yaml",open:!0,fileName:"",save:async e=>{V.current=e,v.xK.set_value_temp(""),Ke(V.current)}})}}),(0,K.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{X([...L,{note:"",auto_load:!1,dir:""}]),q.current=!0}}),(0,K.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{Ke()}})]}),children:(0,K.jsx)(d.X,{headers:N,onRowDrag:(e,t)=>{X((0,b.TI)(L,e,t)),q.current=!0},rows:L.map((t,n)=>{const s=[(0,K.jsx)("div",{children:n}),(0,K.jsx)(m.Sm,{value:t.dir,handleInputChange:e=>{t.dir=e,q.current=!0},no_border:!0}),(0,K.jsx)(m.l6,{value:t.auto_load,onChange:e=>{t.auto_load=e,X([...L]),q.current=!0},options:je,no_border:!0}),(0,K.jsx)(m.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,K.jsxs)("div",{children:[(0,K.jsx)(a.rA,{icon:"delete",title:e("删除记录"),onClick:()=>(e=>{L.splice(e,1),X([...L]),q.current=!0})(n)}),(0,K.jsx)(a.rA,{icon:"restore",title:e("手动加载"),onClick:()=>{xe({sub_title:"手动加载",confirm_fun:()=>{u.jV.post("docs_load_file",{param_path:t.dir}),(0,x.SK)("ok")}})}}),(0,K.jsx)(a.rA,{icon:"delete_forever",title:e("从索引删除"),onClick:()=>{xe({sub_title:"从索引删除",confirm_fun:()=>{u.jV.post("docs_del",{param_path:t.dir}),(0,x.SK)("ok")}})}})]})];return s}),width:"10rem"})})}),R&&(0,K.jsx)(c.VP,{widthPer:50,maxWidth:"80rem",children:(0,K.jsxs)(p.Zp,{title:e("知识库加载信息"),children:[(0,K.jsx)(c.Yh,{left:e("最近一次加载")+","+e("加载进度"),right:R?.progress}),(0,K.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件数量")}`,right:R?.num}),(0,K.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件字符数量")}`,right:R?.char_num}),(0,K.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件大小")}`,right:(0,C.v7)(R?.size)}),(0,K.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总耗时")}`,right:(0,C.a3)(R?.consume_time_ms_len)}),(0,K.jsx)(c.Yh,{left:`${e("总文件数量")}`,right:R?.total_num})]})})]})]})})})]})}},24659(e,t,n){var s=n(22022);n.d(t,["K",0,()=>{const{t:e}=(0,s.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
|