PageSourceSearch

https://qoomezhu-q2docker.hf.space/assets/index-XKemQeKU.js

js qoomezhu-q2docker.hf.space collected 2026-10-04 17:15:34 UTC 7,791 bytes, 1 lines download raw bytes

1import{r as d,j as e}from"./react-vendor-Dc5dhXQW.js";import{t as w,p as B}from"./index-BPuL8_6t.js";import{useTools as P}from"./useTools-CtBKS8G8.js";import{u as D}from"./i18n-vendor-CyU1p4Oa.js";import{f as E,E as q,C as R,B as j,cA as $,cB as H,aA as M,D as O,S as T,n as V,a9 as Y,k as y,j as S,g as z}from"./ui-vendor-CMEWXEKx.js";import"./utils-vendor-yxdTRm6O.js";import"./markdown-vendor-elH94dlU.js";import"./dnd-vendor-zA92mhJ9.js";const L="index-module__toolsPage__dAu2I",X="index-module__toolsContainer__jKjge",Q="index-module__headerAction__IH3iC",K="index-module__loading__80ZQj",W="index-module__toolsGrid__QXrkS",Z="index-module__panelSection__VX7bV",U="index-module__panelSectionDashed__jHz-W",J="index-module__panelTitle__upuMn",ee="index-module__panelDotGreen__2efbA",ae="index-module__panelDotGray__XCpYr",ne="index-module__panelCount__Nexd8",se="index-module__emptyEnabled__nfk4K",oe="index-module__availableGrid__Dj9o8",le="index-module__availableItem__-Lo81",te="index-module__availableItemName__2-kn3",ie="index-module__availableItemAction__EkGwY",ce="index-module__toolCard__A42oY",de="index-module__enabledCard__XbTY4",re="index-module__statusDot__iggPR",me="index-module__statusText__c0dYi",ue="index-module__cardHeader__0pAND",_e="index-module__toolName__tX4vj",xe="index-module__toolNameText__E-qkZ",pe="index-module__toolIconFallback__ahz3F",he="index-module__statusContainer__zdACW",ge="index-module__toolDescription__8ry1B",be="index-module__configStatus__CyIRz",fe="index-module__configured__EtPBT",je="index-module__notConfigured__OrvT7",ve="index-module__cardFooter__cQYv9",Ce="index-module__toggleButton__ngTmx",n={toolsPage:L,toolsContainer:X,headerAction:Q,loading:K,toolsGrid:W,panelSection:Z,panelSectionDashed:U,panelTitle:J,panelDotGreen:ee,panelDotGray:ae,panelCount:ne,emptyEnabled:se,availableGrid:oe,availableItem:le,availableItemName:te,availableItemAction:ie,toolCard:ce,enabledCard:de,statusDot:re,statusText:me,cardHeader:ue,toolName:_e,toolNameText:xe,toolIconFallback:pe,statusContainer:he,toolDescription:ge,configStatus:be,configured:fe,notConfigured:je,cardFooter:ve,toggleButton:Ce},k=["#f56a00","#7265e6","#ffbf00","#00a2ae","#87d068","#1890ff","#eb2f96","#722ed1"];function Ne(s,l){let t=0;for(let i=0;i<s.length;i++)t=t*31+s.charCodeAt(i)|0;return Math.abs(t)%l}function A({icon:s,name:l}){if(s)return e.jsx("span",{children:s});const t=l.charAt(0).toUpperCase(),i=k[Ne(l,k.length)];return e.jsx("span",{className:n.toolIconFallback,style:{backgroundColor:i},children:t})}function Te({tool:s,visible:l,onClose:t,onSave:i}){var u;const[c]=T.useForm(),[v,h]=d.useState(!1),[r,g]=d.useState(!1),{t:m}=D();d.useEffect(()=>{if(!l||!s)return;c.resetFields(),g(!0);let o=!1;return B.getToolConfig(s.name).then(_=>{o||c.setFieldsValue(_||{})}).catch(()=>{}).finally(()=>{o||g(!1)}),()=>{o=!0}},[l,s.name,c]);const C=async()=>{try{const o=await c.validateFields();h(!0),await i(o),t()}catch(o){console.error("Failed to save config:",o)}finally{h(!1)}};return e.jsx(V,{title:`${m("tools.configure")} - ${s.name}`,open:l,onCancel:t,onOk:C,confirmLoading:v||r,okButtonProps:{disabled:r},okText:m("common.save"),cancelText:m("common.cancel"),children:e.jsx(Y,{spinning:r,children:e.jsx(T,{form:c,layout:"vertical",children:(u=s.config_fields)==null?void 0:u.map(o=>{const _=()=>{var x;switch(o.type){case"password":return e.jsx(y.Password,{placeholder:o.placeholder,autoComplete:"off"});case"number":return e.jsx(z,{placeholder:o.placeholder,min:o.min,max:o.max,style:{width:"100%"}});case"boolean":return e.jsx(E,{});case"select":return e.jsx(S,{placeholder:o.placeholder,children:(x=o.options)==null?void 0:x.map(p=>e.jsx(S.Option,{value:p,children:p},p))});case"textarea":return e.jsx(y.TextArea,{placeholder:o.placeholder,rows:4,autoSize:{minRows:2,maxRows:8}});case"text":default:return e.jsx(y,{placeholder:o.placeholder})}};return e.jsx(T.Item,{name:o.name,label:o.label,rules:[{required:o.required,message:`${o.label} is required`}],help:o.help,valuePropName:o.type==="boolean"?"checked":"value",children:_()},o.name)})})})})}function Fe(){const{t:s}=D(),{tools:l,loading:t,batchLoading:i,toggleEnabled:c,toggleAsyncExecution:v,enableAll:h,disableAll:r,loadTools:g,saveToolConfig:m}=P(),[C,u]=d.useState(!1),[o,_]=d.useState(null),x=a=>{_(a),u(!0)},p=async a=>{o&&(await m(o.name,a),await g())},{enabledTools:b,disabledTools:f}=d.useMemo(()=>{const a=l.filter(N=>N.enabled),F=l.filter(N=>!N.enabled);return{enabledTools:a,disabledTools:F}},[l]),I=a=>!a.requires_config||a.config_values&&Object.keys(a.config_values).length>0,G=a=>{a.requires_config&&!I(a)?x(a):c(a)};return e.jsxs("div",{className:n.toolsPage,children:[e.jsx(w,{items:[{title:s("nav.agent")},{title:s("tools.title")}],extra:e.jsx("div",{className:n.headerAction,children:e.jsx(E,{checked:b.length>0&&f.length===0,onChange:()=>f.length>0?h():r(),disabled:i||t,checkedChildren:s("tools.enableAll"),unCheckedChildren:s("tools.disableAll")})})}),e.jsx("div",{className:n.toolsContainer,children:t?e.jsx("div",{className:n.loading,children:e.jsx("p",{children:s("common.loading")})}):l.length===0?e.jsx(q,{description:s("tools.emptyState")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:n.panelSection,children:[e.jsxs("div",{className:n.panelTitle,children:[e.jsx("span",{className:n.panelDotGreen}),s("common.enabled"),e.jsxs("span",{className:n.panelCount,children:[b.length," ",s("tools.active")]})]}),b.length>0?e.jsx("div",{className:n.toolsGrid,children:b.map(a=>e.jsxs(R,{className:`${n.toolCard} ${n.enabledCard}`,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsxs("h3",{className:n.toolName,title:a.name,children:[e.jsx(A,{icon:a.icon,name:a.name})," ",e.jsx("span",{className:n.toolNameText,children:a.name})]}),e.jsxs("div",{className:n.statusContainer,children:[e.jsx("span",{className:n.statusDot}),e.jsx("span",{className:n.statusText,children:s("common.enabled")})]})]}),e.jsx("p",{className:n.toolDescription,children:a.description}),a.requires_config&&e.jsx("div",{className:n.configStatus,children:a.config_values&&Object.keys(a.config_values).length>0?e.jsxs("span",{className:n.configured,children:["✓ ",s("tools.configured")]}):e.jsxs("span",{className:n.notConfigured,children:["⚠ ",s("tools.requiresConfig")]})}),e.jsxs("div",{className:n.cardFooter,children:[["execute_shell_command","delegate_external_agent"].includes(a.name)&&e.jsx(j,{className:n.toggleButton,onClick:()=>v(a),disabled:!a.enabled,icon:a.async_execution?e.jsx($,{}):e.jsx(H,{}),children:a.async_execution?s("tools.asyncExecutionEnabled"):s("tools.asyncExecutionDisabled")}),a.requires_config&&e.jsx(j,{className:n.toggleButton,onClick:()=>x(a),icon:e.jsx(M,{}),children:s("tools.configure")}),e.jsx(j,{className:n.toggleButton,onClick:()=>c(a),icon:e.jsx(O,{}),children:s("common.disable")})]})]},a.name))}):e.jsxs("div",{className:n.emptyEnabled,children:[e.jsx("p",{children:s("tools.noEnabled")}),e.jsx(j,{type:"primary",onClick:()=>{var a;(a=document.getElementById("available-tools"))==null||a.scrollIntoView({behavior:"smooth"})},children:s("tools.goEnableBtn")})]})]}),f.length>0&&e.jsxs("div",{id:"available-tools",className:n.panelSectionDashed,children:[e.jsxs("div",{className:n.panelTitle,children:[e.jsx("span",{className:n.panelDotGray}),s("tools.available")]}),e.jsx("div",{className:n.availableGrid,children:f.map(a=>e.jsxs("div",{className:n.availableItem,onClick:()=>G(a),children:[e.jsx(A,{icon:a.icon,name:a.name}),e.jsx("span",{className:n.availableItemName,title:a.name,children:a.name}),e.jsx("span",{className:n.availableItemAction,children:a.requires_config&&!I(a)?s("tools.configureAction"):s("tools.enableAction")})]},a.name))})]})]})}),o&&e.jsx(Te,{tool:o,visible:C,onClose:()=>u(!1),onSave:p},o.name)]})}export{Fe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.