agentstudio 0.1.14 → 0.1.16
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/backend/dist/bin/agentstudio.js +1 -1
- package/backend/dist/frontend/assets/AgentsPage-Dqb_aqAA.js +1 -0
- package/backend/dist/frontend/assets/ChatPage-BvQmXfcP.css +1 -0
- package/backend/dist/frontend/assets/ChatPage-L8Paywyc.js +91 -0
- package/backend/dist/frontend/assets/CommandForm-DLl7EIMS.js +7 -0
- package/backend/dist/frontend/assets/CommandsPage-Bzavq0Ec.js +1 -0
- package/backend/dist/frontend/assets/DashboardPage-B3o4AYFT.js +15 -0
- package/backend/dist/frontend/assets/FileBrowser-DL3ayaqb.js +1 -0
- package/backend/dist/frontend/assets/GeneralSettingsPage-CBN_de-V.js +1 -0
- package/backend/dist/frontend/assets/LandingPage-Dl4ioKos.js +1 -0
- package/backend/dist/frontend/assets/LoginPage-4QqRdiSi.js +12 -0
- package/backend/dist/frontend/assets/McpPage-CY3tYiqj.js +39 -0
- package/backend/dist/frontend/assets/MemorySettingsPage-DGxrok5K.js +1 -0
- package/backend/dist/frontend/assets/ProjectSelector-hgmGYVFh.js +1 -0
- package/backend/dist/frontend/assets/ProjectsPage-D399IM0c.js +14 -0
- package/backend/dist/frontend/assets/SettingsLayout-CL_K-lzJ.js +1 -0
- package/backend/dist/frontend/assets/SubagentForm-DXtTTIKg.js +7 -0
- package/backend/dist/frontend/assets/SubagentsPage-Chbhj8p2.js +1 -0
- package/backend/dist/frontend/assets/ToastTestPage-DT4wuN5C.js +1 -0
- package/backend/dist/frontend/assets/UnifiedToolSelector-CsM9qBvs.js +1 -0
- package/backend/dist/frontend/assets/VersionSettingsPage-74Q-LVgA.js +5 -0
- package/backend/dist/frontend/assets/agents-ClAzIJTw.js +1 -0
- package/backend/dist/frontend/assets/agents-DwCY2K8p.css +1 -0
- package/backend/dist/frontend/assets/authFetch-BATQyPG5.js +1 -0
- package/backend/dist/frontend/assets/data-structures-DLJedtzx.js +27 -0
- package/backend/dist/frontend/assets/dateFormat-CXa8VnEC.js +1 -0
- package/backend/dist/frontend/assets/index-B9YHa7XT.css +1 -0
- package/backend/dist/frontend/assets/index-B_CTNvca.js +268 -0
- package/backend/dist/frontend/assets/monaco-editor-C7Z4sOhS.js +19 -0
- package/backend/dist/frontend/assets/syntax-highlighting-YWvMU4Hm.js +24 -0
- package/backend/dist/frontend/assets/tabManager-DV8urRBM.js +30 -0
- package/backend/dist/frontend/assets/table-D6q1rytw.js +1 -0
- package/backend/dist/frontend/assets/tools-C4EPanYi.js +1 -0
- package/backend/dist/frontend/assets/ui-components-Cw21Epuw.js +481 -0
- package/backend/dist/frontend/assets/useAgents-DwnOE1_k.js +2 -0
- package/backend/dist/frontend/assets/useClaudeVersions-CQdGnCqv.js +1 -0
- package/backend/dist/frontend/assets/useCommands-CCVaurbt.js +1 -0
- package/backend/dist/frontend/cc-studio.png +0 -0
- package/backend/dist/frontend/index.html +70 -0
- package/backend/dist/frontend/vite.svg +1 -0
- package/backend/dist/index.d.ts.map +1 -1
- package/backend/dist/index.js +17 -1
- package/backend/dist/index.js.map +1 -1
- package/package.json +6 -5
|
@@ -39,7 +39,7 @@ program
|
|
|
39
39
|
console.log(`✅ Backend running on http://${options.host}:${options.port}`);
|
|
40
40
|
});
|
|
41
41
|
// Serve frontend static files
|
|
42
|
-
console.log(`✅ Frontend
|
|
42
|
+
console.log(`✅ Frontend + Backend running at http://${options.host}:${options.port}`);
|
|
43
43
|
console.log('📖 Open your browser to start using AgentStudio');
|
|
44
44
|
}
|
|
45
45
|
catch (error) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./data-structures-DLJedtzx.js";import{r as n}from"./monaco-editor-C7Z4sOhS.js";import{T as ee,a as se,b as _,c as x,d as ae,e as m}from"./table-D6q1rytw.js";import{u as re,a as te,b as le,c as ne}from"./useAgents-DwnOE1_k.js";import{e as de}from"./agents-ClAzIJTw.js";import{P as ie}from"./ProjectSelector-hgmGYVFh.js";import{U as oe}from"./UnifiedToolSelector-CsM9qBvs.js";import{b as ce,s as P}from"./index-B_CTNvca.js";import{u as xe}from"./tools-C4EPanYi.js";import{f as me,o as ue,a2 as U,a3 as B,t as ge,a4 as pe,a5 as he,E as be,a6 as ye,u as fe,r as je,X as ve}from"./ui-components-Cw21Epuw.js";import"./syntax-highlighting-YWvMU4Hm.js";import"./authFetch-BATQyPG5.js";import"./FileBrowser-DL3ayaqb.js";const Le=()=>{const{t:r}=xe("pages"),{isMobile:M}=ce(),{data:O,isLoading:W}=re(),w=te(),z=le(),$=ne(),T=de(),[u,p]=n.useState(null),[a,d]=n.useState({}),[h,b]=n.useState(!1),[K,y]=n.useState(!1),[F,o]=n.useState(null),[f,j]=n.useState(null),[c,H]=n.useState(""),[v,X]=n.useState("all"),[D,L]=n.useState(!1),[N,S]=n.useState([]),[g,C]=n.useState([]),[R,A]=n.useState(!1),k=O?.agents||[],E=k.filter(s=>{const t=s.name.toLowerCase().includes(c.toLowerCase())||s.description.toLowerCase().includes(c.toLowerCase()),l=v==="all"||v==="enabled"&&s.enabled||v==="disabled"&&!s.enabled;return t&&l}),G=s=>{if(f){const t=new URLSearchParams;t.set("project",s);const l=`/chat/${f.id}?${t.toString()}`;window.open(l,"_blank")}y(!1),j(null)},J=async s=>{try{await w.mutateAsync({agentId:s.id,data:{enabled:!s.enabled}}),T.invalidateQueries({queryKey:["agents"]})}catch(t){console.error("Failed to toggle agent:",t),P(r("agents.errors.toggleFailed"))}},q=s=>{p(s),d(s),b(!1);const t=s.allowedTools?.filter(i=>i.enabled).map(i=>i.name)||[],l=t.filter(i=>!i.startsWith("mcp__")),Q=t.filter(i=>i.startsWith("mcp__"));S(l),C(Q),A(Q.length>0)},I=()=>{const s={name:"",description:"",version:"1.0.0",systemPrompt:"",maxTurns:void 0,permissionMode:"default",allowedTools:[{name:"Read",enabled:!0},{name:"Write",enabled:!0},{name:"Edit",enabled:!0}],ui:{icon:"🤖",headerTitle:"",headerDescription:"",componentType:"chat"},author:"User",tags:["custom"],enabled:!0};p(null),d(s),b(!0);const t=s.allowedTools?.filter(l=>l.enabled).map(l=>l.name)||[];S(t),C([]),A(!1)},V=()=>{const s=[...N];return R&&s.push(...g),s.map(l=>({name:l,enabled:!0}))},Y=async()=>{if(!a||!a.name?.trim()){o(r("agents.form.nameRequired"));return}if(a.maxTurns!==void 0&&(a.maxTurns<1||a.maxTurns>100)){o(r("agents.form.maxTurnsError"));return}o(null);try{const s=V();if(h){const t={...a,allowedTools:s,maxTurns:a.maxTurns,id:`custom-${Date.now()}`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),ui:{...a.ui,headerTitle:a.ui?.headerTitle||a.name,headerDescription:a.ui?.headerDescription||a.description}};await $.mutateAsync(t)}else{if(!u)return;const t={...a,allowedTools:s,maxTurns:a.maxTurns,enabled:u.enabled};await w.mutateAsync({agentId:u.id,data:t})}p(null),d({}),b(!1),o(null),T.invalidateQueries({queryKey:["agents"]})}catch(s){console.error("Failed to save agent:",s);let t=r(h?"agents.errors.createFailed":"agents.errors.saveFailed");if(s?.response?.data?.details?.issues?.length>0){const l=s.response.data.details.issues[0];l.path.includes("maxTurns")&&l.code==="too_big"?t=r("agents.form.maxTurnsExceeded",{maximum:l.maximum}):t=l.message||t}else s?.response?.data?.error?t=s.response.data.error:s?.message&&(t=s.message);o(t)}},Z=async s=>{if(s.id==="ppt-editor"||s.id==="code-assistant"||s.id==="document-writer"){P(r("agents.errors.builtinCannotDelete"));return}if(window.confirm(r("agents.confirmDelete",{name:s.name})))try{await z.mutateAsync(s.id),T.invalidateQueries({queryKey:["agents"]})}catch(l){console.error("Failed to delete agent:",l),P(r("agents.errors.deleteFailed"))}};return W?e.jsx("div",{className:"p-8 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),e.jsx("div",{className:"text-gray-600 dark:text-gray-400",children:r("agents.loading")})]})}):e.jsxs("div",{className:"p-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:"flex items-center justify-between mb-6",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:r("agents.title")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-2",children:r("agents.subtitle")})]})}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("div",{className:"flex-1 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4",children:e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(me,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),e.jsx("input",{type:"text",placeholder:r("agents.searchPlaceholder"),value:c,onChange:s=>H(s.target.value),className:"pl-10 pr-4 py-2 w-full border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent dark:bg-gray-700 dark:text-white"})]}),e.jsx("div",{className:"flex space-x-1 bg-gray-100 dark:bg-gray-700 rounded-lg p-1",children:[{key:"all",label:r("agents.filter.all"),count:k.length},{key:"enabled",label:r("agents.filter.enabled"),count:k.filter(s=>s.enabled).length},{key:"disabled",label:r("agents.filter.disabled"),count:k.filter(s=>!s.enabled).length}].map(s=>e.jsxs("button",{onClick:()=>X(s.key),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${v===s.key?"bg-white dark:bg-gray-600 text-blue-700 dark:text-blue-400 shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200"}`,children:[s.label," (",s.count,")"]},s.key))})]})}),e.jsxs("button",{onClick:I,className:"flex items-center space-x-2 px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors whitespace-nowrap",children:[e.jsx(ue,{className:"w-5 h-5"}),e.jsx("span",{children:r("agents.createButton")})]})]})]}),E.length===0?e.jsxs("div",{className:"text-center py-16 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700",children:[e.jsx("div",{className:"text-6xl mb-4",children:"🤖"}),e.jsx("h3",{className:"text-xl font-medium text-gray-900 dark:text-white mb-2",children:r(c?"agents.noAgentsSearch":"agents.noAgents")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:r(c?"agents.adjustSearch":"agents.createFirst")}),!c&&e.jsx("button",{onClick:I,className:"px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:r("agents.createButton")})]}):e.jsxs(e.Fragment,{children:[M&&e.jsx("div",{className:"space-y-4",children:E.map(s=>e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4",children:[e.jsxs("div",{className:"flex items-start space-x-3 mb-4",children:[e.jsx("div",{className:`text-2xl ${s.enabled?"":"opacity-50"}`,children:s.ui.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:`text-base font-medium ${s.enabled?"text-gray-900 dark:text-white":"text-gray-600 dark:text-gray-400"} truncate`,children:s.name}),e.jsx("p",{className:`text-sm ${s.enabled?"text-gray-500 dark:text-gray-400":"text-gray-400 dark:text-gray-500"} truncate mt-1`,children:s.description})]})]}),e.jsxs("div",{className:"space-y-2 text-sm mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"类型:"}),e.jsx("span",{className:`px-2 py-1 text-xs rounded-full ${s.ui.componentType==="slides"?"bg-blue-100 text-blue-800":s.ui.componentType==="code"?"bg-green-100 text-green-800":s.ui.componentType==="documents"?"bg-purple-100 text-purple-800":"bg-gray-100 text-gray-800"}`,children:s.ui.componentType})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"工具:"}),e.jsxs("span",{className:"text-gray-900 dark:text-white",children:[s.allowedTools?.length||0," 个"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"状态:"}),e.jsx("span",{className:`px-2 py-1 text-xs rounded-full ${s.enabled?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:s.enabled?"已启用":"已禁用"})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 dark:border-gray-700 pt-3",children:[s.enabled&&e.jsxs("button",{onClick:()=>{j(s),y(!0)},className:"flex items-center space-x-1 px-3 py-1 text-xs text-primary-foreground bg-primary rounded-md",children:[e.jsx(U,{className:"w-3 h-3"}),e.jsx("span",{children:"使用"})]}),e.jsx("button",{onClick:()=>q(s),className:"p-1 text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/50 rounded",title:"编辑助手",children:e.jsx(B,{className:"w-4 h-4"})})]})]},s.id))}),!M&&e.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:e.jsxs(ee,{children:[e.jsx(se,{children:e.jsxs(_,{children:[e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:r("agents.table.agent")}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:r("agents.table.type")}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:r("agents.table.config")}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:"工具"}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:r("agents.table.status")}),e.jsx(x,{className:"px-6 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider",children:r("agents.table.actions")})]})}),e.jsx(ae,{children:E.map(s=>e.jsxs(_,{className:"hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:[e.jsx(m,{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:`text-2xl mr-4 ${s.enabled?"":"opacity-50"}`,children:s.ui.icon}),e.jsxs("div",{children:[e.jsx("div",{className:`text-sm font-medium ${s.enabled?"text-gray-900 dark:text-white":"text-gray-600 dark:text-gray-400"}`,children:s.name}),e.jsx("div",{className:`text-sm ${s.enabled?"text-gray-500 dark:text-gray-400":"text-gray-400 dark:text-gray-500"}`,children:s.description})]})]})}),e.jsx(m,{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${s.ui.componentType==="slides"?"bg-blue-100 text-blue-800":s.ui.componentType==="code"?"bg-green-100 text-green-800":s.ui.componentType==="documents"?"bg-purple-100 text-purple-800":"bg-gray-100 text-gray-800"}`,children:s.ui.componentType})}),e.jsx(m,{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-white",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(ge,{className:"w-3 h-3 mr-1 text-gray-400"}),e.jsxs("span",{children:["最大轮次: ",s.maxTurns!==void 0?s.maxTurns:"不限制"]})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(pe,{className:"w-3 h-3 mr-1 text-gray-400"}),e.jsxs("span",{children:["权限: ",s.permissionMode==="default"?"默认":s.permissionMode==="acceptEdits"?"自动接受编辑":s.permissionMode==="bypassPermissions"?"绕过权限":s.permissionMode==="plan"?"规划模式":"默认"]})]})]})}),e.jsx(m,{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-white",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(he,{className:"w-3 h-3 mr-1 text-gray-400"}),e.jsxs("span",{children:[s.allowedTools?.length||0," 个工具"]})]})}),e.jsx(m,{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${s.enabled?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:s.enabled?"已启用":"已禁用"})}),e.jsx(m,{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[s.enabled&&e.jsxs("button",{onClick:()=>{j(s),y(!0)},className:"flex items-center space-x-1 px-3 py-1 text-xs text-primary-foreground bg-primary rounded-md transition-colors hover:opacity-90",title:"开始使用助手",children:[e.jsx(U,{className:"w-3 h-3"}),e.jsx("span",{children:"使用"})]}),e.jsx("button",{onClick:()=>J(s),className:`p-1 rounded transition-colors ${s.enabled?"text-green-600 hover:bg-green-50 dark:hover:bg-green-900/50":"text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700"}`,title:s.enabled?"禁用助手":"启用助手",children:s.enabled?e.jsx(be,{className:"w-4 h-4"}):e.jsx(ye,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>q(s),className:"p-1 text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/50 rounded transition-colors",title:"编辑助手",children:e.jsx(B,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>Z(s),className:"p-1 text-red-600 hover:bg-red-50 dark:hover:bg-red-900/50 rounded transition-colors",title:"删除助手",disabled:s.id==="ppt-editor"||s.id==="code-assistant"||s.id==="document-writer",children:e.jsx(fe,{className:"w-4 h-4"})})]})})]},s.id))})]})})]}),(u||h)&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg max-w-4xl w-full max-h-[90vh] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:h?"创建助手":`编辑助手:${u?.name}`}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs("button",{onClick:Y,disabled:w.isPending||$.isPending,className:"flex items-center space-x-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50",children:[e.jsx(je,{className:"w-4 h-4"}),e.jsx("span",{children:"保存"})]}),e.jsxs("button",{onClick:()=>{p(null),d({}),b(!1),o(null)},className:"flex items-center space-x-2 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700",children:[e.jsx(ve,{className:"w-4 h-4"}),e.jsx("span",{children:"取消"})]})]})]}),F&&e.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-900/50 border-b border-red-200 dark:border-red-800",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),e.jsx("div",{className:"ml-3",children:e.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:F})})]})}),e.jsx("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-80px)]",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"名称"}),e.jsx("input",{type:"text",value:a.name||"",onChange:s=>d({...a,name:s.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"描述"}),e.jsx("textarea",{value:a.description||"",onChange:s=>d({...a,description:s.target.value}),rows:6,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"最大轮次"}),e.jsx("input",{type:"number",min:"1",max:"100",value:a.maxTurns!==void 0?a.maxTurns:"",placeholder:"不限制",onChange:s=>{const t=s.target.value;if(t==="")d({...a,maxTurns:void 0});else{const l=parseInt(t);isNaN(l)||d({...a,maxTurns:l})}},className:`w-full px-3 py-2 border rounded-lg focus:outline-none focus:ring-2 dark:bg-gray-700 dark:text-white ${a.maxTurns!==void 0&&(a.maxTurns<1||a.maxTurns>100)?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500"}`}),a.maxTurns!==void 0&&(a.maxTurns<1||a.maxTurns>100)&&e.jsx("p",{className:"text-red-500 dark:text-red-400 text-sm mt-1",children:"最大轮次必须在1-100之间"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"权限模式"}),e.jsxs("select",{value:a.permissionMode||"default",onChange:s=>d({...a,permissionMode:s.target.value}),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white",children:[e.jsx("option",{value:"default",children:"默认"}),e.jsx("option",{value:"acceptEdits",children:"自动接受编辑"}),e.jsx("option",{value:"bypassPermissions",children:"绕过权限检查"}),e.jsx("option",{value:"plan",children:"规划模式"})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"图标"}),e.jsx("input",{type:"text",value:a.ui?.icon||"",onChange:s=>d({...a,ui:{...a.ui,icon:s.target.value}}),placeholder:"🤖",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white"})]})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"启用的工具"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{type:"button",onClick:()=>L(!D),className:"px-3 py-2 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 rounded-lg transition-colors text-sm",children:"选择工具"}),(N.length>0||g.length>0)&&e.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:["常规工具 ",N.length," 个",g.length>0&&`, MCP工具 ${g.length} 个`]}),e.jsx(oe,{isOpen:D,onClose:()=>L(!1),selectedRegularTools:N,onRegularToolsChange:S,selectedMcpTools:g,onMcpToolsChange:C,mcpToolsEnabled:R,onMcpEnabledChange:A})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"系统提示词"}),e.jsx("textarea",{value:a.systemPrompt||"",onChange:s=>d({...a,systemPrompt:s.target.value}),rows:8,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm dark:bg-gray-700 dark:text-white",placeholder:"输入助手的系统提示词..."})]})]})})]})}),K&&f&&e.jsx(ie,{agent:f,onProjectSelect:G,onClose:()=>{y(!1),j(null)}})]})};export{Le as AgentsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.diff-container{font-family:monospace;white-space:pre;text-align:left;border:1px solid #ccc;border-radius:4px;padding:10px;background-color:#fff;font-size:14px;line-height:1.4;overflow-x:auto;color:#333}.diff-hunk{margin-top:20px;border-top:1px solid #ddd;padding-top:20px}.diff-hunk:first-child{margin-top:0;border-top:none;padding-top:0}.hunk-header{background-color:#f1f8ff;color:#555;padding:5px 0}.diff-line{display:flex;width:100%}.diff-added{background-color:#e6ffed}.diff-removed{background-color:#ffeef0}.line-gutter{display:inline-block;width:80px;text-align:right;padding-right:15px;color:#888;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0}.line-prefix{display:inline-block;width:15px;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0}.line-content{flex-grow:1;padding-left:10px}.diff-added .line-content{color:#22863a}.diff-removed .line-content{color:#b31d28}
|