@agent-spaces/server 0.2.3 → 0.2.5
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/dist/package.json +1 -1
- package/dist/web/404.html +1 -1
- package/dist/web/__next.__PAGE__.txt +4 -4
- package/dist/web/__next._full.txt +16 -16
- package/dist/web/__next._head.txt +4 -4
- package/dist/web/__next._index.txt +9 -9
- package/dist/web/__next._tree.txt +2 -2
- package/dist/web/_next/static/chunks/{0-245kun-watp.js → 0an2wvcgfh4yg.js} +2 -2
- package/dist/web/_next/static/chunks/0dpsi68hqjuon.js +1 -0
- package/dist/web/_next/static/chunks/0j282o9qw3fnz.css +1 -0
- package/dist/web/_next/static/chunks/0lgk.w8y-3ppq.js +1 -0
- package/dist/web/_next/static/chunks/{0amzlgoqe50tv.js → 0v4atb3hml5fn.js} +1 -1
- package/dist/web/_next/static/chunks/{0q_scqkk9.t53.js → 0vwzzneidqvbo.js} +2 -2
- package/dist/web/_next/static/chunks/18bgtswajrg9e.js +179 -0
- package/dist/web/_not-found/__next._full.txt +15 -15
- package/dist/web/_not-found/__next._head.txt +4 -4
- package/dist/web/_not-found/__next._index.txt +9 -9
- package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/dist/web/_not-found/__next._not-found.txt +3 -3
- package/dist/web/_not-found/__next._tree.txt +2 -2
- package/dist/web/_not-found.html +1 -1
- package/dist/web/_not-found.txt +15 -15
- package/dist/web/index.html +1 -1
- package/dist/web/index.txt +16 -16
- package/dist/web/login/__next._full.txt +17 -17
- package/dist/web/login/__next._head.txt +4 -4
- package/dist/web/login/__next._index.txt +9 -9
- package/dist/web/login/__next._tree.txt +2 -2
- package/dist/web/login/__next.login.__PAGE__.txt +4 -4
- package/dist/web/login/__next.login.txt +3 -3
- package/dist/web/login.html +1 -1
- package/dist/web/login.txt +17 -17
- package/dist/web/settings/__next._full.txt +19 -19
- package/dist/web/settings/__next._head.txt +4 -4
- package/dist/web/settings/__next._index.txt +9 -9
- package/dist/web/settings/__next._tree.txt +2 -2
- package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
- package/dist/web/settings/__next.settings.txt +5 -5
- package/dist/web/settings/agents/__next._full.txt +19 -19
- package/dist/web/settings/agents/__next._head.txt +4 -4
- package/dist/web/settings/agents/__next._index.txt +9 -9
- package/dist/web/settings/agents/__next._tree.txt +2 -2
- package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
- package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
- package/dist/web/settings/agents/__next.settings.txt +5 -5
- package/dist/web/settings/agents.html +1 -1
- package/dist/web/settings/agents.txt +19 -19
- package/dist/web/settings/mcps/__next._full.txt +19 -19
- package/dist/web/settings/mcps/__next._head.txt +4 -4
- package/dist/web/settings/mcps/__next._index.txt +9 -9
- package/dist/web/settings/mcps/__next._tree.txt +2 -2
- package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
- package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
- package/dist/web/settings/mcps/__next.settings.txt +5 -5
- package/dist/web/settings/mcps.html +1 -1
- package/dist/web/settings/mcps.txt +19 -19
- package/dist/web/settings/models/__next._full.txt +19 -19
- package/dist/web/settings/models/__next._head.txt +4 -4
- package/dist/web/settings/models/__next._index.txt +9 -9
- package/dist/web/settings/models/__next._tree.txt +2 -2
- package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
- package/dist/web/settings/models/__next.settings.models.txt +3 -3
- package/dist/web/settings/models/__next.settings.txt +5 -5
- package/dist/web/settings/models.html +1 -1
- package/dist/web/settings/models.txt +19 -19
- package/dist/web/settings/providers/__next._full.txt +19 -19
- package/dist/web/settings/providers/__next._head.txt +4 -4
- package/dist/web/settings/providers/__next._index.txt +9 -9
- package/dist/web/settings/providers/__next._tree.txt +2 -2
- package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
- package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
- package/dist/web/settings/providers/__next.settings.txt +5 -5
- package/dist/web/settings/providers.html +1 -1
- package/dist/web/settings/providers.txt +19 -19
- package/dist/web/settings/skills/__next._full.txt +19 -19
- package/dist/web/settings/skills/__next._head.txt +4 -4
- package/dist/web/settings/skills/__next._index.txt +9 -9
- package/dist/web/settings/skills/__next._tree.txt +2 -2
- package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
- package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
- package/dist/web/settings/skills/__next.settings.txt +5 -5
- package/dist/web/settings/skills.html +1 -1
- package/dist/web/settings/skills.txt +19 -19
- package/dist/web/settings.html +1 -1
- package/dist/web/settings.txt +19 -19
- package/dist/web/workflows/__next._full.txt +17 -17
- package/dist/web/workflows/__next._head.txt +4 -4
- package/dist/web/workflows/__next._index.txt +9 -9
- package/dist/web/workflows/__next._tree.txt +2 -2
- package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
- package/dist/web/workflows/__next.workflows.txt +3 -3
- package/dist/web/workflows.html +1 -1
- package/dist/web/workflows.txt +17 -17
- package/dist/web/workspace/_/__next._full.txt +16 -16
- package/dist/web/workspace/_/__next._head.txt +4 -4
- package/dist/web/workspace/_/__next._index.txt +9 -9
- package/dist/web/workspace/_/__next._tree.txt +2 -2
- package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -3
- package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
- package/dist/web/workspace/_/__next.workspace.txt +3 -3
- package/dist/web/workspace/_.html +1 -1
- package/dist/web/workspace/_.txt +16 -16
- package/dist/web/workspaces/__next._full.txt +17 -17
- package/dist/web/workspaces/__next._head.txt +4 -4
- package/dist/web/workspaces/__next._index.txt +9 -9
- package/dist/web/workspaces/__next._tree.txt +2 -2
- package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
- package/dist/web/workspaces/__next.workspaces.txt +3 -3
- package/dist/web/workspaces.html +1 -1
- package/dist/web/workspaces.txt +17 -17
- package/dist/ws/agent-prompt.js +39 -5
- package/package.json +10 -11
- package/dist/web/_next/static/chunks/088q-5_51dsrw.js +0 -1
- package/dist/web/_next/static/chunks/09_ki3dc5cfwv.css +0 -1
- package/dist/web/_next/static/chunks/0car_w834cbb6.js +0 -1
- package/dist/web/_next/static/chunks/0g_b4t~000.o~.js +0 -179
- /package/dist/web/_next/static/{7UtFGbIZvN_2yiatRc2g3 → CW6M37hm3VxkelXPKGgw3}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{7UtFGbIZvN_2yiatRc2g3 → CW6M37hm3VxkelXPKGgw3}/_clientMiddlewareManifest.js +0 -0
- /package/dist/web/_next/static/{7UtFGbIZvN_2yiatRc2g3 → CW6M37hm3VxkelXPKGgw3}/_ssgManifest.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,562918,928542,e=>{"use strict";var a=e.i(370383),t=e.i(969490);function s(e){return(0,t.useRenderElement)(e.defaultTagName??"div",e,e)}e.s(["useRender",0,s],928542);var i=e.i(294237),r=e.i(465458);let n=(0,i.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:t="default",render:i,...l}){return s({defaultTagName:"span",props:(0,a.mergeProps)({className:(0,r.cn)(n({variant:t}),e)},l),render:i,state:{slot:"badge",variant:t}})}],562918)},368942,e=>{"use strict";let a=(0,e.i(816709).create)((e,a)=>({models:[],providers:[],loaded:!1,ensure:async()=>{if(!a().loaded)try{let[a,t]=await Promise.all([fetch("/api/models").then(e=>e.json()),fetch("/api/providers").then(e=>e.json())]);e({models:a,providers:t,loaded:!0})}catch{}},addModel:a=>e(e=>({models:[...e.models,a]})),updateModel:a=>e(e=>({models:e.models.map(e=>e.id===a.id?a:e)})),removeModel:a=>e(e=>({models:e.models.filter(e=>e.id!==a)})),addProvider:a=>e(e=>({providers:[...e.providers,a]})),updateProvider:a=>e(e=>({providers:e.providers.map(e=>e.id===a.id?a:e)})),removeProvider:a=>e(e=>({providers:e.providers.filter(e=>e.id!==a)}))}));e.s(["useLLMStore",0,a])},226624,e=>{"use strict";var a,t=e.i(344180);e.s([],916562),e.i(916562),e.i(8890);var s=e.i(764556),i=e.i(535270),r=e.i(29905),n=e.i(204133),l=e.i(277642),d=e.i(236706),o=e.i(863728),c=e.i(969490),u=e.i(370383),p=e.i(139236),m=e.i(931709),h=e.i(267805);let g=s.createContext(void 0);var x=e.i(438904);let v=((a={}).checked="data-checked",a.unchecked="data-unchecked",a.disabled="data-disabled",a.readonly="data-readonly",a.required="data-required",a.valid="data-valid",a.invalid="data-invalid",a.touched="data-touched",a.dirty="data-dirty",a.filled="data-filled",a.focused="data-focused",a),f={...x.fieldValidityMapping,checked:e=>e?{[v.checked]:""}:{[v.unchecked]:""}};var b=e.i(125231),y=e.i(975698),k=e.i(380414),j=e.i(443124),N=e.i(575665),w=e.i(602453),C=e.i(742665),S=e.i(638144);let P=s.forwardRef(function(e,a){let{checked:h,className:x,defaultChecked:v,"aria-labelledby":P,form:T,id:I,inputRef:A,name:M,nativeButton:z=!1,onCheckedChange:O,readOnly:B=!1,required:E=!1,disabled:K=!1,render:D,uncheckedValue:R,value:L,style:F,...U}=e,{clearErrors:_}=(0,k.useFormContext)(),{state:q,setTouched:G,setDirty:V,validityData:$,setFilled:J,setFocused:W,shouldValidateOnChange:H,validationMode:Q,disabled:Z,name:X,validation:Y}=(0,b.useFieldRootContext)(),{labelId:ee}=(0,j.useLabelableContext)(),ea=Z||K,et=X??M,es=(0,r.useStableCallback)(O),ei=s.useRef(null),er=(0,n.useMergedRefs)(ei,A,Y.inputRef),en=s.useRef(null),el=(0,p.useBaseUiId)(),ed=(0,N.useLabelableId)({id:I,implicit:!1,controlRef:en}),eo=z?void 0:ed,[ec,eu]=(0,i.useControlled)({controlled:h,default:!!v,name:"Switch",state:"checked"});(0,y.useRegisterFieldControl)(en,{id:el,value:ec}),(0,l.useIsoLayoutEffect)(()=>{ei.current&&J(ei.current.checked)},[ei,J]),(0,S.useValueChanged)(ec,()=>{_(et),V(ec!==$.initialValue),J(ec),H()?Y.commit(ec):Y.commit(ec,!0)});let{getButtonProps:ep,buttonRef:em}=(0,m.useButton)({disabled:ea,native:z}),eh=function(e,a,t,i=!0,r){let[n,d]=s.useState(),o=(0,p.useBaseUiId)(r?`${r}-label`:void 0),c=e??a??n;return(0,l.useIsoLayoutEffect)(()=>{let s=e||a||!i?void 0:function(e,a){let t=function(e){if(!e)return;let a=e.parentElement;if(a&&"LABEL"===a.tagName)return a;let t=e.id;if(t){let a=e.nextElementSibling;if(a&&a.htmlFor===t)return a}let s=e.labels;return s&&s[0]}(e);if(t)return!t.id&&a&&(t.id=a),t.id||void 0}(t.current,o);n!==s&&d(s)}),c}(P,ee,ei,!z,eo),eg=s.useMemo(()=>(0,u.mergeProps)({checked:ec,disabled:ea,form:T,id:eo,name:et,required:E,style:et?d.visuallyHiddenInput:d.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:er,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(B)return void e.preventDefault();let a=e.currentTarget.checked,t=(0,w.createChangeEventDetails)(C.REASONS.none,e.nativeEvent);es?.(a,t),t.isCanceled||eu(a)},onFocus(){en.current?.focus()}},Y.getInputValidationProps,void 0!==L?{value:L}:o.EMPTY_OBJECT),[ec,ea,T,er,eo,et,es,B,E,eu,Y,L]),ex=s.useMemo(()=>({...q,checked:ec,disabled:ea,readOnly:B,required:E}),[q,ec,ea,B,E]),ev=(0,c.useRenderElement)("span",e,{state:ex,ref:[a,en,em],props:[{id:z?ed:el,role:"switch","aria-checked":ec,"aria-readonly":B||void 0,"aria-required":E||void 0,"aria-labelledby":eh,onFocus(){ea||W(!0)},onBlur(){let e=ei.current;e&&!ea&&(G(!0),W(!1),"onBlur"===Q&&Y.commit(e.checked))},onClick(e){B||ea||(e.preventDefault(),ei.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},Y.getValidationProps,U,ep],stateAttributesMapping:f});return(0,t.jsxs)(g.Provider,{value:ex,children:[ev,!ec&&et&&void 0!==R&&(0,t.jsx)("input",{type:"hidden",form:T,name:et,value:R}),(0,t.jsx)("input",{...eg,suppressHydrationWarning:!0})]})}),T=s.forwardRef(function(e,a){let{render:t,className:i,style:r,...n}=e,{state:l}=(0,b.useFieldRootContext)(),d=function(){let e=s.useContext(g);if(void 0===e)throw Error((0,h.default)(63));return e}(),o={...l,...d};return(0,c.useRenderElement)("span",e,{state:o,ref:a,stateAttributesMapping:f,props:n})});e.s(["Root",0,P,"Thumb",0,T],695728);var I=e.i(695728),I=I,A=e.i(465458);e.s(["Switch",0,function({className:e,size:a="default",...s}){return(0,t.jsx)(I.Root,{"data-slot":"switch","data-size":a,className:(0,A.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...s,children:(0,t.jsx)(I.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}],226624)},673478,e=>{"use strict";let a=(0,e.i(433721).default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);e.s(["Cpu",0,a],673478)},788010,e=>{"use strict";var a=e.i(344180),t=e.i(465458);e.s(["Textarea",0,function({className:e,...s}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,t.cn)("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...s})}])},325443,946899,e=>{"use strict";let a=(0,e.i(433721).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["default",0,a],946899),e.s(["Bot",0,a],325443)},415360,e=>{"use strict";let a=(0,e.i(433721).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,a],415360)},444433,e=>{"use strict";e.s(["BUILT_IN_AGENT_TOOLS",0,[{name:"CreateCurrentChannelIssue",label:"Create Current Issue",description:"Create and bind an issue for the current channel."},{name:"ViewCurrentChannelIssue",label:"View Current Issue",description:"View the issue and comments bound to the current channel."},{name:"AddCurrentChannelComment",label:"Add Current Comment",description:"Add a comment to the issue bound to the current channel."},{name:"ListQuickCommands",label:"List Quick Commands",description:"List all quick commands for a workspace with their running status."},{name:"RunQuickCommand",label:"Run Quick Command",description:"Start a quick command by its ID. Returns the terminal session ID."},{name:"StopQuickCommand",label:"Stop Quick Command",description:"Stop a running quick command by its ID."}]])},282180,330044,92929,119211,e=>{"use strict";var a=e.i(344180),t=e.i(444433);let s=(t.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name),i=new Set(["openai-responses-to-anthropic-messages","openai-chat-completions-to-anthropic-messages"]);function r(e){return{mcpServers:Object.fromEntries(e.map(e=>[e,{}]))}}function n(e){return e.map(e=>({name:`${e}.md`,content:`# ${e}
|
|
2
|
-
`}))}let l={agent:{name:"Agent",role:"agent",description:"通用 Agent,可在 workflow 中承担任意执行节点",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:r([]),skills:n(["coding","debugging","testing"]),tools:s,systemPrompt:"你是通用 Agent。根据 issue 和当前任务上下文完成被分配的工作,遵循项目规范,必要时修改代码、运行验证,并清晰汇报结果。",temperature:.3,maxTokens:8192,enabled:!0},scheduler:{name:"Scheduler",role:"scheduler",description:"任务调度者,负责任务分发和协调",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:r([]),skills:n(["planning","task-split"]),tools:s,systemPrompt:"你是调度者 Agent。负责接收用户任务,分析任务类型,分发给合适的执行者。你需要跟踪任务状态,确保所有子任务按时完成。",temperature:.3,maxTokens:4096,enabled:!0},task_creator:{name:"Task Creator",role:"task_creator",description:"任务创建者,负责把 issue 拆成可执行任务",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:r([]),skills:n(["planning","task-split"]),tools:s,systemPrompt:"你是任务创建者 Agent。负责读取 issue 上下文,把需求拆分为少量可执行任务,并用系统工具写入任务列表。只创建真正需要独立执行的任务,避免把细碎步骤拆成任务。",temperature:.3,maxTokens:4096,enabled:!0},bot:{name:"Bot Agent",role:"bot",description:"消息机器人,负责处理外部聊天平台中的用户消息",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:{},skills:[],tools:s,systemPrompt:"你是 Agent Spaces 的消息机器人。你会简洁回答来自外部聊天平台的用户消息。不要执行危险操作;需要用户提供更多信息时直接询问。",temperature:.3,maxTokens:4096,enabled:!0}};e.s(["FieldGroup",0,function({label:e,children:t}){return(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-xs text-muted-foreground",children:e}),t]})},"PROVIDER_OPTIONS",0,[{value:"anthropic-messages",labelKey:"anthropicMessages"},{value:"openai-chat-completions",labelKey:"openaiChatCompletions"},{value:"openai-responses",labelKey:"openaiResponses"},{value:"openai-responses-to-anthropic-messages",labelKey:"openaiResponsesToAnthropic"},{value:"openai-chat-completions-to-anthropic-messages",labelKey:"openaiChatToAnthropic"},{value:"gemini-generate-content",labelKey:"geminiGenerateContent"}],"ROLE_COLORS",0,{agent:"bg-gray-500/10 text-gray-600 border-gray-200",scheduler:"bg-blue-500/10 text-blue-600 border-blue-200",task_creator:"bg-green-500/10 text-green-600 border-green-200",bot:"bg-cyan-500/10 text-cyan-600 border-cyan-200"},"ROLE_OPTIONS",0,["agent","scheduler","task_creator","bot"],"RUNTIME_OPTIONS",0,[{value:"claude-code",labelKey:"claudeCode"},{value:"open-agent-sdk",labelKey:"openAgentSdk"},{value:"codex",labelKey:"codex"}],"Section",0,function({icon:e,title:t,children:s}){return(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:[e,t]}),s]})},"isAnthropicBridgeProvider",0,function(e){return!!(e&&i.has(e))},"isDraftAgent",0,function(e){return e.id.startsWith("draft-")},"newAgentDraft",0,function(e){return{id:`draft-${e}-${Date.now()}`,...l[e],mcps:structuredClone(l[e].mcps),skills:l[e].skills.map(e=>({...e})),tools:[...l[e].tools]}},"newEmptyAgent",0,function(){return{id:`draft-empty-${Date.now()}`,name:"",role:"agent",description:"",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"",modelId:"",apiBase:"",apiKey:"",workingDir:"",mcps:{},skills:[],tools:s,systemPrompt:"",temperature:.3,maxTokens:4096,enabled:!0}},"normalizeAgent",0,function(e){var a,i;return{...e,name:e.name||"New Agent",description:e.description||"",avatarUrl:e.avatarUrl||"",runtimeKind:e.runtimeKind||"open-agent-sdk",modelProvider:e.modelProvider||"",modelId:e.modelId||"claude-sonnet-4-6",apiBase:e.apiBase||"",apiKey:e.apiKey||"",workingDir:e.workingDir||"",mcps:(a=e.mcps)||{},skills:Array.isArray(i=e.skills)?i.map(e=>"string"==typeof e?{name:e.endsWith(".md")?e:`${e}.md`}:e):[],tools:function(e){if(!Array.isArray(e))return s;let a=new Set((t.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name));return e.filter(e=>a.has(e))}(e.tools),systemPrompt:e.systemPrompt||"",temperature:e.temperature??.3,maxTokens:e.maxTokens??4096,enabled:e.enabled??!0}},"serializeAgent",0,function(e){let{id:a,...t}=e;return{...t,modelProvider:t.modelProvider||void 0}}],282180);var d=e.i(244073),o=e.i(611176),c=e.i(260218),u=e.i(562918),p=e.i(226624),m=e.i(325443),h=e.i(137340),g=e.i(465458);e.s(["AgentList",0,function({agents:e,onSelect:t,onDelete:s,onToggleEnabled:i}){let r=(0,d.useTranslations)("agent");return(0,a.jsxs)("div",{className:"flex flex-col p-2",children:[e.map(e=>(0,a.jsxs)("div",{className:(0,g.cn)("group flex items-center gap-3 rounded-lg px-3 py-2.5 hover:bg-muted/50 cursor-pointer transition-colors",!e.enabled&&"opacity-50"),onClick:()=>t(e),children:[(0,a.jsx)(o.AgentIcon,{name:e.name,avatarUrl:e.avatarUrl,apiBase:e.apiBase,className:"size-8"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,a.jsx)(u.Badge,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:e.role})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.description||r("list.noDescription")})]}),(0,a.jsx)("span",{className:"text-[10px] text-muted-foreground font-mono",children:e.modelId.split("-").slice(0,2).join("-")}),(0,a.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,a.jsx)(p.Switch,{size:"sm",checked:e.enabled,onCheckedChange:()=>i?.(e.id)})}),(0,a.jsx)(c.Button,{variant:"ghost",size:"icon-xs",className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:a=>{a.stopPropagation(),s(e.id)},children:(0,a.jsx)(h.Trash2,{className:"size-3 text-destructive"})})]},e.id)),0===e.length&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,a.jsx)(m.Bot,{className:"size-10 mb-2 opacity-30"}),(0,a.jsx)("p",{className:"text-sm",children:r("list.empty")})]})]})}],330044);var x=e.i(433721);let v=(0,x.default)("plug-zap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]);e.s(["PlugZap",0,v],92929);let f=(0,x.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["Wrench",0,f],119211)},426022,e=>{"use strict";let a=(0,e.i(433721).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,a],426022)},588591,e=>{"use strict";var a=e.i(344180),t=e.i(764556),s=e.i(244073),i=e.i(355819),r=e.i(209988),n=e.i(260218),l=e.i(917955),d=e.i(465458),o=e.i(767467),c=e.i(325443),u=e.i(650654),p=e.i(953700),m=e.i(282180),h=e.i(330044),g=e.i(368942),x=e.i(444433),v=e.i(611176),f=e.i(681622),b=e.i(788010),y=e.i(188815),k=e.i(972846),j=e.i(673478),N=e.i(92929),w=e.i(451534),C=e.i(119211),S=e.i(415360),P=e.i(426022);let T=(0,e.i(433721).default)("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]);var I=e.i(129981);function A({agent:e,roleOptions:i,testing:r,testResult:l,onChange:o,onMcpChange:c,onAddSkillFiles:u,onRemoveSkill:p,onTestConnection:h}){let M=(0,s.useTranslations)("agent"),[z,O]=(0,t.useState)(()=>JSON.stringify(e.mcps,null,2)),[B,E]=(0,t.useState)(null),[K,D]=(0,t.useState)([]),{models:R,providers:L,ensure:F}=(0,g.useLLMStore)(),U=R.filter(e=>!e.embedding);(0,t.useEffect)(()=>{F()},[F]);let _=(0,t.useCallback)(e=>{o("apiBase",e.apiBase),o("apiKey",e.apiKey);let a=U.filter(a=>a.provider===e.name).map(e=>({value:e.modelId,label:e.name}));D(a),a.length>0&&o("modelId",a[0].value)},[U,o]),q=async e=>{if(!e?.length)return;let a=Array.from(e).filter(e=>e.name.toLowerCase().endsWith(".md"));u(await Promise.all(a.map(async e=>({name:e.name,content:await e.text()}))))};return(0,a.jsxs)("div",{className:"flex flex-col gap-5 p-5",children:[(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(P.MessageSquare,{className:"size-3.5"}),title:M("detail.basic"),children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1.5",children:[(0,a.jsx)(v.AgentIcon,{name:e.name,avatarUrl:e.avatarUrl,apiBase:e.apiBase,className:"size-16 rounded-xl border border-input"}),(0,a.jsxs)("label",{className:"text-[10px] text-primary cursor-pointer hover:underline",children:[M("detail.uploadAvatar"),(0,a.jsx)("input",{type:"file",accept:"image/*",className:"hidden",onChange:async e=>{let a=e.target.files?.[0];if(!a)return;let t=new FileReader;t.onload=async()=>{try{let e=await fetch("/api/upload/avatar",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUrl:t.result,filename:a.name})}),s=await e.json();s.url&&o("avatarUrl",s.url)}catch{}},t.readAsDataURL(a),e.target.value=""}})]}),e.avatarUrl&&(0,a.jsx)("button",{type:"button",className:"text-[10px] text-destructive hover:underline",onClick:()=>o("avatarUrl",""),children:M("detail.removeAvatar")})]}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-2.5",children:[(0,a.jsx)(m.FieldGroup,{label:M("detail.name"),children:(0,a.jsx)(f.Input,{value:e.name,onChange:e=>o("name",e.target.value)})}),(0,a.jsx)(m.FieldGroup,{label:M("detail.role"),children:(0,a.jsx)("select",{value:e.role,onChange:e=>o("role",e.target.value),className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none focus-visible:border-ring dark:bg-input/30",children:i.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})})]})]}),(0,a.jsx)(m.FieldGroup,{label:M("detail.description"),children:(0,a.jsx)(f.Input,{value:e.description,onChange:e=>o("description",e.target.value)})}),(0,a.jsx)(m.FieldGroup,{label:M("detail.agentRuntime"),children:(0,a.jsx)(y.SearchSelect,{value:e.runtimeKind??"",onChange:e=>o("runtimeKind",e),options:m.RUNTIME_OPTIONS.map(e=>({value:e.value,label:M(`runtime.${e.labelKey}`)})),placeholder:M("detail.runtimePlaceholder"),searchPlaceholder:M("detail.runtimeSearchPlaceholder"),allowCustom:!1})})]}),(0,a.jsx)(m.Section,{icon:(0,a.jsx)(w.FolderOpen,{className:"size-3.5"}),title:M("detail.workingDirectory"),children:(0,a.jsx)(f.Input,{value:e.workingDir,onChange:e=>o("workingDir",e.target.value),placeholder:M("detail.workingDirPlaceholder")})}),(0,a.jsx)(m.Section,{icon:(0,a.jsx)(S.Sparkles,{className:"size-3.5"}),title:M("detail.systemPrompt"),children:(0,a.jsx)(b.Textarea,{value:e.systemPrompt,onChange:e=>o("systemPrompt",e.target.value),placeholder:M("detail.systemPromptPlaceholder"),className:"min-h-24 text-xs"})}),(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(C.Wrench,{className:"size-3.5"}),title:M("detail.mcpServers"),children:[(0,a.jsx)(b.Textarea,{value:z,onChange:e=>(e=>{O(e);try{let a=JSON.parse(e);if(!a||"object"!=typeof a||Array.isArray(a))throw Error("MCP config must be a JSON object");E(null),c(a)}catch(e){E(e instanceof Error?e.message:"Invalid JSON")}})(e.target.value),placeholder:'{\n "mcpServers": {}\n}',className:"min-h-28 font-mono text-xs"}),B&&(0,a.jsx)("div",{className:"text-xs text-destructive",children:B})]}),(0,a.jsx)(m.Section,{icon:(0,a.jsx)(C.Wrench,{className:"size-3.5"}),title:M("detail.tools"),children:(0,a.jsx)("div",{className:"grid gap-2",children:(x.BUILT_IN_AGENT_TOOLS??[]).map(t=>(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 rounded-lg border border-input px-3 py-2 hover:bg-muted/50",children:[(0,a.jsx)("input",{type:"checkbox",checked:e.tools.includes(t.name),onChange:()=>{var a;let s;return a=t.name,void((s=new Set(e.tools)).has(a)?s.delete(a):s.add(a),o("tools",(x.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name).filter(e=>s.has(e))))},className:"mt-0.5 size-3.5"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-xs font-medium",children:t.label}),(0,a.jsx)("span",{className:"block text-[11px] text-muted-foreground",children:t.description})]})]},t.name))})}),(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(j.Cpu,{className:"size-3.5"}),title:M("detail.skills"),children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:e.skills.map((e,t)=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground",children:[e.name,(0,a.jsx)("button",{type:"button",onClick:()=>p(t),className:"hover:text-destructive",children:(0,a.jsx)(k.X,{className:"size-2.5"})})]},t))}),(0,a.jsxs)("label",{className:"flex h-8 cursor-pointer items-center justify-center gap-2 rounded-lg border border-dashed border-input text-xs text-muted-foreground hover:bg-muted/50",children:[(0,a.jsx)(I.Upload,{className:"size-3.5"}),M("detail.uploadSkills"),(0,a.jsx)("input",{type:"file",accept:".md,text/markdown",multiple:!0,className:"hidden",onChange:e=>{q(e.target.files),e.target.value=""}})]})]}),(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(T,{className:"size-3.5"}),title:M("detail.model"),children:[(0,a.jsxs)("div",{className:"space-y-2.5",children:[(0,a.jsx)(m.FieldGroup,{label:M("detail.provider"),children:(0,a.jsx)(y.SearchSelect,{value:L.find(a=>a.apiBase===e.apiBase&&a.apiKey===e.apiKey)?.name||"",onChange:e=>{let a=L.find(a=>a.name===e);a&&_(a)},options:L.map(e=>({value:e.name,label:e.name})),placeholder:M("detail.providerPlaceholder"),searchPlaceholder:M("detail.providerSearchPlaceholder"),allowCustom:!1})}),(0,a.jsx)(m.FieldGroup,{label:M("detail.modelField"),children:(0,a.jsx)(y.SearchSelect,{value:e.modelId,onChange:e=>o("modelId",e),options:K.length>0?K:[{value:e.modelId||"",label:e.modelId||M("detail.selectProviderFirst")}],placeholder:M("detail.modelPlaceholder"),searchPlaceholder:M("detail.modelSearchPlaceholder")})}),(0,a.jsx)(m.FieldGroup,{label:M("detail.apiMessageType"),children:(0,a.jsx)(y.SearchSelect,{value:e.modelProvider||"",onChange:e=>o("modelProvider",e),options:m.PROVIDER_OPTIONS.map(e=>({value:e.value,label:M(`provider.${e.labelKey}`)})),placeholder:M("detail.apiMessageTypePlaceholder"),searchPlaceholder:M("detail.apiMessageTypeSearchPlaceholder"),allowCustom:!1})}),(0,a.jsx)(m.FieldGroup,{label:M("detail.apiBase"),children:(0,a.jsx)(f.Input,{value:e.apiBase,onChange:e=>o("apiBase",e.target.value),placeholder:M("detail.apiBasePlaceholder"),className:"h-7 text-xs"})}),(0,a.jsx)(m.FieldGroup,{label:M("detail.apiKey"),children:(0,a.jsx)(f.Input,{type:"password",value:e.apiKey,onChange:e=>o("apiKey",e.target.value),placeholder:M("detail.apiKeyPlaceholder"),className:"h-7 text-xs"})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:M("detail.validateHelper")}),(0,a.jsxs)(n.Button,{type:"button",variant:"outline",size:"sm",onClick:h,disabled:r||!e.apiBase||!e.apiKey||!e.modelId,children:[(0,a.jsx)(N.PlugZap,{className:"size-3.5"}),r?M("detail.testing"):M("detail.test")]})]}),l&&(0,a.jsxs)("div",{className:(0,d.cn)("rounded-md border px-3 py-2 text-xs",l.success?"border-green-500/30 bg-green-500/10 text-green-700":"border-destructive/30 bg-destructive/10 text-destructive"),children:[l.message,l.debug&&(0,a.jsxs)("div",{className:"mt-2 space-y-1 font-mono text-[10px] opacity-80",children:[l.debug.status&&(0,a.jsxs)("div",{children:[M("debug.status")," ",l.debug.status]}),l.debug.provider&&(0,a.jsxs)("div",{children:[M("debug.provider")," ",l.debug.provider]}),l.debug.requestUrl&&(0,a.jsxs)("div",{children:[M("debug.url")," ",l.debug.requestUrl]}),l.debug.model&&(0,a.jsxs)("div",{children:[M("debug.model")," ",l.debug.model]}),l.debug.responseBody&&(0,a.jsxs)("div",{className:"max-h-20 overflow-auto whitespace-pre-wrap",children:[M("debug.body")," ",l.debug.responseBody]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,a.jsx)(m.FieldGroup,{label:M("detail.temperature"),children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"range",min:0,max:2,step:.1,value:e.temperature,onChange:e=>o("temperature",parseFloat(e.target.value)),className:"flex-1"}),(0,a.jsx)("span",{className:"text-xs font-mono w-8 text-right",children:e.temperature})]})}),(0,a.jsx)(m.FieldGroup,{label:M("detail.maxTokens"),children:(0,a.jsx)(f.Input,{type:"number",value:e.maxTokens,onChange:e=>o("maxTokens",parseInt(e.target.value)||0),className:"h-7 text-xs"})})]})]})]})}e.s(["AgentDialog",0,function({open:e,onOpenChange:g,roleFilter:x,initialAgentId:v,standalone:f}){let b=(0,s.useTranslations)("agent"),y=(0,s.useTranslations)("common"),[k,j]=(0,t.useState)([]),[N,w]=(0,t.useState)(null),[C,S]=(0,t.useState)(null),[P,T]=(0,t.useState)(!1),[I,M]=(0,t.useState)(!1),[z,O]=(0,t.useState)(!1),[B,E]=(0,t.useState)(null),[K,D]=(0,t.useState)(null),R=x?new Set(Array.isArray(x)?x:[x]):null,L=R?k.filter(e=>R.has(e.role)):k,F=R?m.ROLE_OPTIONS.filter(e=>R.has(e)):m.ROLE_OPTIONS;(0,t.useEffect)(()=>{if(!e)return;let a=new AbortController;return queueMicrotask(()=>{T(!0),D(null)}),fetch("/api/agents/presets",{signal:a.signal}).then(async e=>{if(!e.ok)throw Error(await e.text());return e.json()}).then(e=>{let a=e.map(m.normalizeAgent);if(j(a),v){let e=a.find(e=>e.id===v);e&&(w(e),S({...e}))}}).catch(e=>{"AbortError"!==e.name&&D(b("error.loadFailed"))}).finally(()=>T(!1)),()=>a.abort()},[e,v,b]);let U=()=>{w(null),S(null),E(null)},_=async()=>{if(C){M(!0),D(null);try{let e=(0,m.isDraftAgent)(C),a=(0,m.serializeAgent)(C),t=await fetch(e?"/api/agents/presets":`/api/agents/presets/${C.id}`,{method:e?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?a:C)});if(!t.ok)throw Error(await t.text());let s=await t.json(),r=(0,m.normalizeAgent)(s);j(a=>e?[...a,r]:a.map(e=>e.id===r.id?r:e)),i.useAgentStore.setState(a=>({agents:e?[...a.agents,s]:a.agents.map(e=>e.id===s.id?s:e)})),w(null),S(null)}catch{D(b("error.saveFailed"))}finally{M(!1)}}},q=async()=>{if(C){O(!0),E(null),D(null);try{let e=await fetch("/api/agents/presets/test-connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)}),a=await e.json();E({success:!!a.success,message:a.message||a.error||b("error.connectionTestFailed"),debug:a.debug?{...a.debug,status:e.status}:{status:e.status}})}catch(e){E({success:!1,message:e instanceof Error?e.message:b("error.connectionTestFailed")})}finally{O(!1)}}},G=e=>{let a="empty"===e?(0,m.newEmptyAgent)():(0,m.newAgentDraft)(e);D(null),w(a),S({...a})},V=async e=>{j(a=>a.map(a=>a.id===e?{...a,enabled:!a.enabled}:a)),await i.useAgentStore.getState().toggleEnabled(e)},$=async e=>{if(e.startsWith("draft-")){w(null),S(null);return}M(!0),D(null);try{let a=await fetch(`/api/agents/presets/${e}`,{method:"DELETE"});if(!a.ok)throw Error(await a.text());j(a=>a.filter(a=>a.id!==e)),i.useAgentStore.setState(a=>({agents:a.agents.filter(a=>a.id!==e)})),N?.id===e&&(w(null),S(null))}catch{D(b("error.deleteFailed"))}finally{M(!1)}},J=(0,a.jsxs)(a.Fragment,{children:[!f&&(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b px-5 pr-12 py-4",children:[N?(0,a.jsx)(n.Button,{variant:"ghost",size:"icon-sm",onClick:U,children:(0,a.jsx)(o.ArrowLeft,{className:"size-4"})}):(0,a.jsx)("div",{className:"flex size-7 items-center justify-center rounded-lg bg-primary/10",children:(0,a.jsx)(c.Bot,{className:"size-4 text-primary"})}),(0,a.jsxs)(r.DialogHeader,{className:"flex-1 space-y-0",children:[(0,a.jsx)(r.DialogTitle,{className:"text-base",children:N?C?.name??"":b("dialog.title")}),(0,a.jsx)(r.DialogDescription,{className:"text-xs",children:N?b("dialog.editDescription"):b("dialog.listDescription")})]}),!N&&(0,a.jsxs)(l.DropdownMenu,{children:[(0,a.jsx)(l.DropdownMenuTrigger,{render:(0,a.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:I,children:[(0,a.jsx)(p.Plus,{className:"size-3.5"}),b("dialog.add"),(0,a.jsx)(u.ChevronDown,{className:"size-3.5"})]})}),(0,a.jsx)(l.DropdownMenuContent,{side:"bottom",align:"end",className:"w-44",children:(0,a.jsxs)(l.DropdownMenuGroup,{children:[!R&&(0,a.jsxs)(l.DropdownMenuItem,{className:"gap-2",onClick:()=>G("empty"),children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-muted"}),(0,a.jsx)("span",{children:b("dialog.addEmpty")})]}),m.ROLE_OPTIONS.map(e=>(0,a.jsxs)(l.DropdownMenuItem,{className:"gap-2",onClick:()=>G(e),children:[(0,a.jsx)("span",{className:(0,d.cn)("size-2 rounded-full",m.ROLE_COLORS[e].split(" ")[0])}),(0,a.jsx)("span",{className:"capitalize",children:b(`role.${e}.name`)})]},e))]})})]})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[K&&(0,a.jsx)("div",{className:"mx-5 mt-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:K}),P?(0,a.jsx)("div",{className:"py-12 text-center text-sm text-muted-foreground",children:b("dialog.loading")}):N?C?(0,a.jsx)(A,{agent:C,roleOptions:F,testing:z,testResult:B,onChange:(e,a)=>{S(t=>t?"modelProvider"===e?{...t,modelProvider:a,runtimeKind:(0,m.isAnthropicBridgeProvider)(a)?"claude-code":t.runtimeKind}:"runtimeKind"===e?{...t,runtimeKind:a}:{...t,[e]:a}:t)},onMcpChange:e=>{S(a=>a?{...a,mcps:e}:a)},onAddSkillFiles:e=>{if(!C)return;let a=new Set(C.skills.map(e=>e.name));S(t=>t?{...t,skills:[...t.skills.filter(a=>!e.some(e=>e.name===a.name)),...e.filter(e=>e.name&&!a.has(e.name)),...e.filter(e=>a.has(e.name))]}:t)},onRemoveSkill:e=>{C&&S(a=>a?{...a,skills:a.skills.filter((a,t)=>t!==e)}:a)},onTestConnection:q},C.id):null:(0,a.jsx)(h.AgentList,{agents:L,onSelect:e=>{w(e),S({...e})},onDelete:$,onToggleEnabled:V})]}),N&&(0,a.jsxs)("div",{className:"flex justify-end gap-2 border-t px-5 py-3",children:[(0,a.jsx)(n.Button,{variant:"outline",size:"sm",onClick:U,disabled:I,children:y("cancel")}),(0,a.jsx)(n.Button,{size:"sm",onClick:_,disabled:I,children:y(I?"saving":"save")})]})]});return f?(0,a.jsx)("div",{className:"h-full flex flex-col",children:J}):(0,a.jsx)(r.Dialog,{open:e,onOpenChange:e=>{e||U(),g(e)},children:(0,a.jsx)(r.DialogContent,{className:"sm:max-w-2xl max-h-[85vh] flex flex-col p-0 gap-0",children:J})})}],588591)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,562918,928542,e=>{"use strict";var a=e.i(370383),t=e.i(969490);function s(e){return(0,t.useRenderElement)(e.defaultTagName??"div",e,e)}e.s(["useRender",0,s],928542);var i=e.i(294237),r=e.i(465458);let n=(0,i.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:t="default",render:i,...l}){return s({defaultTagName:"span",props:(0,a.mergeProps)({className:(0,r.cn)(n({variant:t}),e)},l),render:i,state:{slot:"badge",variant:t}})}],562918)},368942,e=>{"use strict";let a=(0,e.i(816709).create)((e,a)=>({models:[],providers:[],loaded:!1,ensure:async()=>{if(!a().loaded)try{let[a,t]=await Promise.all([fetch("/api/models").then(e=>e.json()),fetch("/api/providers").then(e=>e.json())]);e({models:a,providers:t,loaded:!0})}catch{}},addModel:a=>e(e=>({models:[...e.models,a]})),updateModel:a=>e(e=>({models:e.models.map(e=>e.id===a.id?a:e)})),removeModel:a=>e(e=>({models:e.models.filter(e=>e.id!==a)})),addProvider:a=>e(e=>({providers:[...e.providers,a]})),updateProvider:a=>e(e=>({providers:e.providers.map(e=>e.id===a.id?a:e)})),removeProvider:a=>e(e=>({providers:e.providers.filter(e=>e.id!==a)}))}));e.s(["useLLMStore",0,a])},226624,e=>{"use strict";var a,t=e.i(344180);e.s([],916562),e.i(916562),e.i(8890);var s=e.i(764556),i=e.i(535270),r=e.i(29905),n=e.i(204133),l=e.i(277642),d=e.i(236706),o=e.i(863728),c=e.i(969490),u=e.i(370383),p=e.i(139236),m=e.i(931709),h=e.i(267805);let g=s.createContext(void 0);var x=e.i(438904);let v=((a={}).checked="data-checked",a.unchecked="data-unchecked",a.disabled="data-disabled",a.readonly="data-readonly",a.required="data-required",a.valid="data-valid",a.invalid="data-invalid",a.touched="data-touched",a.dirty="data-dirty",a.filled="data-filled",a.focused="data-focused",a),f={...x.fieldValidityMapping,checked:e=>e?{[v.checked]:""}:{[v.unchecked]:""}};var b=e.i(125231),y=e.i(975698),j=e.i(380414),k=e.i(443124),N=e.i(575665),w=e.i(602453),C=e.i(742665),S=e.i(638144);let P=s.forwardRef(function(e,a){let{checked:h,className:x,defaultChecked:v,"aria-labelledby":P,form:T,id:M,inputRef:I,name:z,nativeButton:A=!1,onCheckedChange:O,readOnly:D=!1,required:E=!1,disabled:B=!1,render:K,uncheckedValue:R,value:L,style:_,...F}=e,{clearErrors:U}=(0,j.useFormContext)(),{state:G,setTouched:q,setDirty:V,validityData:$,setFilled:J,setFocused:W,shouldValidateOnChange:H,validationMode:Q,disabled:Z,name:X,validation:Y}=(0,b.useFieldRootContext)(),{labelId:ee}=(0,k.useLabelableContext)(),ea=Z||B,et=X??z,es=(0,r.useStableCallback)(O),ei=s.useRef(null),er=(0,n.useMergedRefs)(ei,I,Y.inputRef),en=s.useRef(null),el=(0,p.useBaseUiId)(),ed=(0,N.useLabelableId)({id:M,implicit:!1,controlRef:en}),eo=A?void 0:ed,[ec,eu]=(0,i.useControlled)({controlled:h,default:!!v,name:"Switch",state:"checked"});(0,y.useRegisterFieldControl)(en,{id:el,value:ec}),(0,l.useIsoLayoutEffect)(()=>{ei.current&&J(ei.current.checked)},[ei,J]),(0,S.useValueChanged)(ec,()=>{U(et),V(ec!==$.initialValue),J(ec),H()?Y.commit(ec):Y.commit(ec,!0)});let{getButtonProps:ep,buttonRef:em}=(0,m.useButton)({disabled:ea,native:A}),eh=function(e,a,t,i=!0,r){let[n,d]=s.useState(),o=(0,p.useBaseUiId)(r?`${r}-label`:void 0),c=e??a??n;return(0,l.useIsoLayoutEffect)(()=>{let s=e||a||!i?void 0:function(e,a){let t=function(e){if(!e)return;let a=e.parentElement;if(a&&"LABEL"===a.tagName)return a;let t=e.id;if(t){let a=e.nextElementSibling;if(a&&a.htmlFor===t)return a}let s=e.labels;return s&&s[0]}(e);if(t)return!t.id&&a&&(t.id=a),t.id||void 0}(t.current,o);n!==s&&d(s)}),c}(P,ee,ei,!A,eo),eg=s.useMemo(()=>(0,u.mergeProps)({checked:ec,disabled:ea,form:T,id:eo,name:et,required:E,style:et?d.visuallyHiddenInput:d.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:er,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(D)return void e.preventDefault();let a=e.currentTarget.checked,t=(0,w.createChangeEventDetails)(C.REASONS.none,e.nativeEvent);es?.(a,t),t.isCanceled||eu(a)},onFocus(){en.current?.focus()}},Y.getInputValidationProps,void 0!==L?{value:L}:o.EMPTY_OBJECT),[ec,ea,T,er,eo,et,es,D,E,eu,Y,L]),ex=s.useMemo(()=>({...G,checked:ec,disabled:ea,readOnly:D,required:E}),[G,ec,ea,D,E]),ev=(0,c.useRenderElement)("span",e,{state:ex,ref:[a,en,em],props:[{id:A?ed:el,role:"switch","aria-checked":ec,"aria-readonly":D||void 0,"aria-required":E||void 0,"aria-labelledby":eh,onFocus(){ea||W(!0)},onBlur(){let e=ei.current;e&&!ea&&(q(!0),W(!1),"onBlur"===Q&&Y.commit(e.checked))},onClick(e){D||ea||(e.preventDefault(),ei.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},Y.getValidationProps,F,ep],stateAttributesMapping:f});return(0,t.jsxs)(g.Provider,{value:ex,children:[ev,!ec&&et&&void 0!==R&&(0,t.jsx)("input",{type:"hidden",form:T,name:et,value:R}),(0,t.jsx)("input",{...eg,suppressHydrationWarning:!0})]})}),T=s.forwardRef(function(e,a){let{render:t,className:i,style:r,...n}=e,{state:l}=(0,b.useFieldRootContext)(),d=function(){let e=s.useContext(g);if(void 0===e)throw Error((0,h.default)(63));return e}(),o={...l,...d};return(0,c.useRenderElement)("span",e,{state:o,ref:a,stateAttributesMapping:f,props:n})});e.s(["Root",0,P,"Thumb",0,T],695728);var M=e.i(695728),M=M,I=e.i(465458);e.s(["Switch",0,function({className:e,size:a="default",...s}){return(0,t.jsx)(M.Root,{"data-slot":"switch","data-size":a,className:(0,I.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...s,children:(0,t.jsx)(M.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}],226624)},673478,e=>{"use strict";let a=(0,e.i(433721).default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);e.s(["Cpu",0,a],673478)},788010,e=>{"use strict";var a=e.i(344180),t=e.i(465458);e.s(["Textarea",0,function({className:e,...s}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,t.cn)("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...s})}])},325443,946899,e=>{"use strict";let a=(0,e.i(433721).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["default",0,a],946899),e.s(["Bot",0,a],325443)},415360,e=>{"use strict";let a=(0,e.i(433721).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,a],415360)},444433,e=>{"use strict";e.s(["BUILT_IN_AGENT_TOOLS",0,[{name:"CreateCurrentChannelIssue",label:"Create Current Issue",description:"Create and bind an issue for the current channel."},{name:"ViewCurrentChannelIssue",label:"View Current Issue",description:"View the issue and comments bound to the current channel."},{name:"AddCurrentChannelComment",label:"Add Current Comment",description:"Add a comment to the issue bound to the current channel."},{name:"ListQuickCommands",label:"List Quick Commands",description:"List all quick commands for a workspace with their running status."},{name:"RunQuickCommand",label:"Run Quick Command",description:"Start a quick command by its ID. Returns the terminal session ID."},{name:"StopQuickCommand",label:"Stop Quick Command",description:"Stop a running quick command by its ID."}]])},282180,330044,92929,119211,e=>{"use strict";var a=e.i(344180),t=e.i(444433);let s=(t.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name),i=new Set(["openai-responses-to-anthropic-messages","openai-chat-completions-to-anthropic-messages"]);function r(e){return{mcpServers:Object.fromEntries(e.map(e=>[e,{}]))}}function n(e){return e.map(e=>({name:`${e}.md`,content:`# ${e}
|
|
2
|
+
`}))}let l={agent:{name:"Agent",role:"agent",description:"通用 Agent,可在 workflow 中承担任意执行节点",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:r([]),skills:n(["coding","debugging","testing"]),tools:s,systemPrompt:"你是通用 Agent。根据 issue 和当前任务上下文完成被分配的工作,遵循项目规范,必要时修改代码、运行验证,并清晰汇报结果。",temperature:.3,maxTokens:8192,enabled:!0},scheduler:{name:"Scheduler",role:"scheduler",description:"任务调度者,负责任务分发和协调",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:r([]),skills:n(["planning","task-split"]),tools:s,systemPrompt:"你是调度者 Agent。负责接收用户任务,分析任务类型,分发给合适的执行者。你需要跟踪任务状态,确保所有子任务按时完成。",temperature:.3,maxTokens:4096,enabled:!0},task_creator:{name:"Task Creator",role:"task_creator",description:"任务创建者,负责把 issue 拆成可执行任务",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:r([]),skills:n(["planning","task-split"]),tools:s,systemPrompt:"你是任务创建者 Agent。负责读取 issue 上下文,把需求拆分为少量可执行任务,并用系统工具写入任务列表。只创建真正需要独立执行的任务,避免把细碎步骤拆成任务。",temperature:.3,maxTokens:4096,enabled:!0},bot:{name:"Bot Agent",role:"bot",description:"消息机器人,负责处理外部聊天平台中的用户消息",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:{},skills:[],tools:s,systemPrompt:"你是 Agent Spaces 的消息机器人。你会简洁回答来自外部聊天平台的用户消息。不要执行危险操作;需要用户提供更多信息时直接询问。",temperature:.3,maxTokens:4096,enabled:!0}};e.s(["FieldGroup",0,function({label:e,children:t}){return(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("label",{className:"text-xs text-muted-foreground",children:e}),t]})},"PROVIDER_OPTIONS",0,[{value:"anthropic-messages",labelKey:"anthropicMessages"},{value:"openai-chat-completions",labelKey:"openaiChatCompletions"},{value:"openai-responses",labelKey:"openaiResponses"},{value:"openai-responses-to-anthropic-messages",labelKey:"openaiResponsesToAnthropic"},{value:"openai-chat-completions-to-anthropic-messages",labelKey:"openaiChatToAnthropic"},{value:"gemini-generate-content",labelKey:"geminiGenerateContent"}],"ROLE_COLORS",0,{agent:"bg-gray-500/10 text-gray-600 border-gray-200",scheduler:"bg-blue-500/10 text-blue-600 border-blue-200",task_creator:"bg-green-500/10 text-green-600 border-green-200",bot:"bg-cyan-500/10 text-cyan-600 border-cyan-200"},"ROLE_OPTIONS",0,["agent","scheduler","task_creator","bot"],"RUNTIME_OPTIONS",0,[{value:"claude-code",labelKey:"claudeCode"},{value:"open-agent-sdk",labelKey:"openAgentSdk"},{value:"codex",labelKey:"codex"}],"Section",0,function({icon:e,title:t,children:s}){return(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:[e,t]}),s]})},"isAnthropicBridgeProvider",0,function(e){return!!(e&&i.has(e))},"isDraftAgent",0,function(e){return e.id.startsWith("draft-")},"newAgentDraft",0,function(e){return{id:`draft-${e}-${Date.now()}`,...l[e],mcps:structuredClone(l[e].mcps),skills:l[e].skills.map(e=>({...e})),tools:[...l[e].tools]}},"newEmptyAgent",0,function(){return{id:`draft-empty-${Date.now()}`,name:"",role:"agent",description:"",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"",modelId:"",apiBase:"",apiKey:"",workingDir:"",mcps:{},skills:[],tools:s,systemPrompt:"",temperature:.3,maxTokens:4096,enabled:!0}},"normalizeAgent",0,function(e){var a,i;return{...e,name:e.name||"New Agent",description:e.description||"",avatarUrl:e.avatarUrl||"",runtimeKind:e.runtimeKind||"open-agent-sdk",modelProvider:e.modelProvider||"",modelId:e.modelId||"claude-sonnet-4-6",apiBase:e.apiBase||"",apiKey:e.apiKey||"",workingDir:e.workingDir||"",mcps:(a=e.mcps)||{},skills:Array.isArray(i=e.skills)?i.map(e=>"string"==typeof e?{name:e.endsWith(".md")?e:`${e}.md`}:e):[],tools:function(e){if(!Array.isArray(e))return s;let a=new Set((t.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name));return e.filter(e=>a.has(e))}(e.tools),systemPrompt:e.systemPrompt||"",temperature:e.temperature??.3,maxTokens:e.maxTokens??4096,enabled:e.enabled??!0}},"serializeAgent",0,function(e){let{id:a,...t}=e;return{...t,modelProvider:t.modelProvider||void 0}}],282180);var d=e.i(244073),o=e.i(611176),c=e.i(260218),u=e.i(562918),p=e.i(226624),m=e.i(325443),h=e.i(137340),g=e.i(465458);e.s(["AgentList",0,function({agents:e,onSelect:t,onDelete:s,onToggleEnabled:i}){let r=(0,d.useTranslations)("agent");return(0,a.jsxs)("div",{className:"flex flex-col p-2",children:[e.map(e=>(0,a.jsxs)("div",{className:(0,g.cn)("group flex items-center gap-3 rounded-lg px-3 py-2.5 hover:bg-muted/50 cursor-pointer transition-colors",!e.enabled&&"opacity-50"),onClick:()=>t(e),children:[(0,a.jsx)(o.AgentIcon,{name:e.name,avatarUrl:e.avatarUrl,apiBase:e.apiBase,className:"size-8"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,a.jsx)(u.Badge,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:e.role})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.description||r("list.noDescription")})]}),(0,a.jsx)("span",{className:"text-[10px] text-muted-foreground font-mono",children:e.modelId.split("-").slice(0,2).join("-")}),(0,a.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,a.jsx)(p.Switch,{size:"sm",checked:e.enabled,onCheckedChange:()=>i?.(e.id)})}),(0,a.jsx)(c.Button,{variant:"ghost",size:"icon-xs",className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:a=>{a.stopPropagation(),s(e.id)},children:(0,a.jsx)(h.Trash2,{className:"size-3 text-destructive"})})]},e.id)),0===e.length&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,a.jsx)(m.Bot,{className:"size-10 mb-2 opacity-30"}),(0,a.jsx)("p",{className:"text-sm",children:r("list.empty")})]})]})}],330044);var x=e.i(433721);let v=(0,x.default)("plug-zap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]);e.s(["PlugZap",0,v],92929);let f=(0,x.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["Wrench",0,f],119211)},426022,e=>{"use strict";let a=(0,e.i(433721).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,a],426022)},588591,e=>{"use strict";var a=e.i(344180),t=e.i(764556),s=e.i(244073),i=e.i(355819),r=e.i(209988),n=e.i(260218),l=e.i(917955),d=e.i(465458),o=e.i(767467),c=e.i(325443),u=e.i(650654),p=e.i(953700),m=e.i(282180),h=e.i(330044),g=e.i(368942),x=e.i(444433),v=e.i(611176),f=e.i(681622),b=e.i(788010),y=e.i(188815),j=e.i(972846),k=e.i(673478),N=e.i(92929),w=e.i(451534),C=e.i(119211),S=e.i(415360),P=e.i(426022);let T=(0,e.i(433721).default)("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]);var M=e.i(129981);function I({agent:e,roleOptions:i,testing:r,testResult:l,onChange:o,onMcpChange:c,onAddSkillFiles:u,onRemoveSkill:p,onTestConnection:h}){let z=(0,s.useTranslations)("agent"),[A,O]=(0,t.useState)(()=>JSON.stringify(e.mcps,null,2)),[D,E]=(0,t.useState)(null),[B,K]=(0,t.useState)([]),{models:R,providers:L,ensure:_}=(0,g.useLLMStore)(),F=R.filter(e=>!e.embedding);(0,t.useEffect)(()=>{_()},[_]);let U=(0,t.useCallback)(e=>{o("apiBase",e.apiBase),o("apiKey",e.apiKey);let a=F.filter(a=>a.provider===e.name).map(e=>({value:e.modelId,label:e.name}));K(a),a.length>0&&o("modelId",a[0].value)},[F,o]),G=async e=>{if(!e?.length)return;let a=Array.from(e).filter(e=>e.name.toLowerCase().endsWith(".md"));u(await Promise.all(a.map(async e=>({name:e.name,content:await e.text()}))))};return(0,a.jsxs)("div",{className:"flex flex-col gap-5 p-5",children:[(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(P.MessageSquare,{className:"size-3.5"}),title:z("detail.basic"),children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1.5",children:[(0,a.jsx)(v.AgentIcon,{name:e.name,avatarUrl:e.avatarUrl,apiBase:e.apiBase,className:"size-16 rounded-xl border border-input"}),(0,a.jsxs)("label",{className:"text-[10px] text-primary cursor-pointer hover:underline",children:[z("detail.uploadAvatar"),(0,a.jsx)("input",{type:"file",accept:"image/*",className:"hidden",onChange:async e=>{let a=e.target.files?.[0];if(!a)return;let t=new FileReader;t.onload=async()=>{try{let e=await fetch("/api/upload/avatar",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUrl:t.result,filename:a.name})}),s=await e.json();s.url&&o("avatarUrl",s.url)}catch{}},t.readAsDataURL(a),e.target.value=""}})]}),e.avatarUrl&&(0,a.jsx)("button",{type:"button",className:"text-[10px] text-destructive hover:underline",onClick:()=>o("avatarUrl",""),children:z("detail.removeAvatar")})]}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col gap-2.5",children:[(0,a.jsx)(m.FieldGroup,{label:z("detail.name"),children:(0,a.jsx)(f.Input,{value:e.name,onChange:e=>o("name",e.target.value)})}),(0,a.jsx)(m.FieldGroup,{label:z("detail.role"),children:(0,a.jsx)("select",{value:e.role,onChange:e=>o("role",e.target.value),className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none focus-visible:border-ring dark:bg-input/30",children:i.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})})]})]}),(0,a.jsx)(m.FieldGroup,{label:z("detail.description"),children:(0,a.jsx)(f.Input,{value:e.description,onChange:e=>o("description",e.target.value)})}),(0,a.jsx)(m.FieldGroup,{label:z("detail.agentRuntime"),children:(0,a.jsx)(y.SearchSelect,{value:e.runtimeKind??"",onChange:e=>o("runtimeKind",e),options:m.RUNTIME_OPTIONS.map(e=>({value:e.value,label:z(`runtime.${e.labelKey}`)})),placeholder:z("detail.runtimePlaceholder"),searchPlaceholder:z("detail.runtimeSearchPlaceholder"),allowCustom:!1})})]}),(0,a.jsx)(m.Section,{icon:(0,a.jsx)(w.FolderOpen,{className:"size-3.5"}),title:z("detail.workingDirectory"),children:(0,a.jsx)(f.Input,{value:e.workingDir,onChange:e=>o("workingDir",e.target.value),placeholder:z("detail.workingDirPlaceholder")})}),(0,a.jsx)(m.Section,{icon:(0,a.jsx)(S.Sparkles,{className:"size-3.5"}),title:z("detail.systemPrompt"),children:(0,a.jsx)(b.Textarea,{value:e.systemPrompt,onChange:e=>o("systemPrompt",e.target.value),placeholder:z("detail.systemPromptPlaceholder"),className:"min-h-24 text-xs"})}),(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(C.Wrench,{className:"size-3.5"}),title:z("detail.mcpServers"),children:[(0,a.jsx)(b.Textarea,{value:A,onChange:e=>(e=>{O(e);try{let a=JSON.parse(e);if(!a||"object"!=typeof a||Array.isArray(a))throw Error("MCP config must be a JSON object");E(null),c(a)}catch(e){E(e instanceof Error?e.message:"Invalid JSON")}})(e.target.value),placeholder:'{\n "mcpServers": {}\n}',className:"min-h-28 font-mono text-xs"}),D&&(0,a.jsx)("div",{className:"text-xs text-destructive",children:D})]}),(0,a.jsx)(m.Section,{icon:(0,a.jsx)(C.Wrench,{className:"size-3.5"}),title:z("detail.tools"),children:(0,a.jsx)("div",{className:"grid gap-2",children:(x.BUILT_IN_AGENT_TOOLS??[]).map(t=>(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 rounded-lg border border-input px-3 py-2 hover:bg-muted/50",children:[(0,a.jsx)("input",{type:"checkbox",checked:e.tools.includes(t.name),onChange:()=>{var a;let s;return a=t.name,void((s=new Set(e.tools)).has(a)?s.delete(a):s.add(a),o("tools",(x.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name).filter(e=>s.has(e))))},className:"mt-0.5 size-3.5"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-xs font-medium",children:t.label}),(0,a.jsx)("span",{className:"block text-[11px] text-muted-foreground",children:t.description})]})]},t.name))})}),(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(k.Cpu,{className:"size-3.5"}),title:z("detail.skills"),children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:e.skills.map((e,t)=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground",children:[e.name,(0,a.jsx)("button",{type:"button",onClick:()=>p(t),className:"hover:text-destructive",children:(0,a.jsx)(j.X,{className:"size-2.5"})})]},t))}),(0,a.jsxs)("label",{className:"flex h-8 cursor-pointer items-center justify-center gap-2 rounded-lg border border-dashed border-input text-xs text-muted-foreground hover:bg-muted/50",children:[(0,a.jsx)(M.Upload,{className:"size-3.5"}),z("detail.uploadSkills"),(0,a.jsx)("input",{type:"file",accept:".md,text/markdown",multiple:!0,className:"hidden",onChange:e=>{G(e.target.files),e.target.value=""}})]})]}),(0,a.jsxs)(m.Section,{icon:(0,a.jsx)(T,{className:"size-3.5"}),title:z("detail.model"),children:[(0,a.jsxs)("div",{className:"space-y-2.5",children:[(0,a.jsx)(m.FieldGroup,{label:z("detail.provider"),children:(0,a.jsx)(y.SearchSelect,{value:L.find(a=>a.apiBase===e.apiBase&&a.apiKey===e.apiKey)?.name||"",onChange:e=>{let a=L.find(a=>a.name===e);a&&U(a)},options:L.map(e=>({value:e.name,label:e.name})),placeholder:z("detail.providerPlaceholder"),searchPlaceholder:z("detail.providerSearchPlaceholder"),allowCustom:!1})}),(0,a.jsx)(m.FieldGroup,{label:z("detail.modelField"),children:(0,a.jsx)(y.SearchSelect,{value:e.modelId,onChange:e=>o("modelId",e),options:B.length>0?B:[{value:e.modelId||"",label:e.modelId||z("detail.selectProviderFirst")}],placeholder:z("detail.modelPlaceholder"),searchPlaceholder:z("detail.modelSearchPlaceholder")})}),(0,a.jsx)(m.FieldGroup,{label:z("detail.apiMessageType"),children:(0,a.jsx)(y.SearchSelect,{value:e.modelProvider||"",onChange:e=>o("modelProvider",e),options:m.PROVIDER_OPTIONS.map(e=>({value:e.value,label:z(`provider.${e.labelKey}`)})),placeholder:z("detail.apiMessageTypePlaceholder"),searchPlaceholder:z("detail.apiMessageTypeSearchPlaceholder"),allowCustom:!1})}),(0,a.jsx)(m.FieldGroup,{label:z("detail.apiBase"),children:(0,a.jsx)(f.Input,{value:e.apiBase,onChange:e=>o("apiBase",e.target.value),placeholder:z("detail.apiBasePlaceholder"),className:"h-7 text-xs"})}),(0,a.jsx)(m.FieldGroup,{label:z("detail.apiKey"),children:(0,a.jsx)(f.Input,{type:"password",value:e.apiKey,onChange:e=>o("apiKey",e.target.value),placeholder:z("detail.apiKeyPlaceholder"),className:"h-7 text-xs"})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:z("detail.validateHelper")}),(0,a.jsxs)(n.Button,{type:"button",variant:"outline",size:"sm",onClick:h,disabled:r||!e.apiBase||!e.apiKey||!e.modelId,children:[(0,a.jsx)(N.PlugZap,{className:"size-3.5"}),r?z("detail.testing"):z("detail.test")]})]}),l&&(0,a.jsxs)("div",{className:(0,d.cn)("rounded-md border px-3 py-2 text-xs",l.success?"border-green-500/30 bg-green-500/10 text-green-700":"border-destructive/30 bg-destructive/10 text-destructive"),children:[l.message,l.debug&&(0,a.jsxs)("div",{className:"mt-2 space-y-1 font-mono text-[10px] opacity-80",children:[l.debug.status&&(0,a.jsxs)("div",{children:[z("debug.status")," ",l.debug.status]}),l.debug.provider&&(0,a.jsxs)("div",{children:[z("debug.provider")," ",l.debug.provider]}),l.debug.requestUrl&&(0,a.jsxs)("div",{children:[z("debug.url")," ",l.debug.requestUrl]}),l.debug.model&&(0,a.jsxs)("div",{children:[z("debug.model")," ",l.debug.model]}),l.debug.responseBody&&(0,a.jsxs)("div",{className:"max-h-20 overflow-auto whitespace-pre-wrap",children:[z("debug.body")," ",l.debug.responseBody]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,a.jsx)(m.FieldGroup,{label:z("detail.temperature"),children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"range",min:0,max:2,step:.1,value:e.temperature,onChange:e=>o("temperature",parseFloat(e.target.value)),className:"flex-1"}),(0,a.jsx)("span",{className:"text-xs font-mono w-8 text-right",children:e.temperature})]})}),(0,a.jsx)(m.FieldGroup,{label:z("detail.maxTokens"),children:(0,a.jsx)(f.Input,{type:"number",value:e.maxTokens,onChange:e=>o("maxTokens",parseInt(e.target.value)||0),className:"h-7 text-xs"})})]})]})]})}e.s(["AgentDialog",0,function({open:e,onOpenChange:g,roleFilter:x,initialAgentId:v,standalone:f}){let b=(0,s.useTranslations)("agent"),y=(0,s.useTranslations)("common"),[j,k]=(0,t.useState)([]),[N,w]=(0,t.useState)(null),[C,S]=(0,t.useState)(null),[P,T]=(0,t.useState)(!1),[M,z]=(0,t.useState)(!1),[A,O]=(0,t.useState)(!1),[D,E]=(0,t.useState)(null),[B,K]=(0,t.useState)(null),R=x?new Set(Array.isArray(x)?x:[x]):null,L=R?j.filter(e=>R.has(e.role)):j,_=R?m.ROLE_OPTIONS.filter(e=>R.has(e)):m.ROLE_OPTIONS;(0,t.useEffect)(()=>{if(!e)return;let a=new AbortController;return queueMicrotask(()=>{T(!0),K(null)}),fetch("/api/agents/presets",{signal:a.signal}).then(async e=>{if(!e.ok)throw Error(await e.text());return e.json()}).then(e=>{let a=e.map(m.normalizeAgent);if(k(a),v){let e=a.find(e=>e.id===v);e&&(w(e),S({...e}))}}).catch(e=>{"AbortError"!==e.name&&K(b("error.loadFailed"))}).finally(()=>T(!1)),()=>a.abort()},[e,v,b]);let F=()=>{w(null),S(null),E(null)},U=async()=>{if(C){z(!0),K(null);try{let e=(0,m.isDraftAgent)(C),a=(0,m.serializeAgent)(C),t=await fetch(e?"/api/agents/presets":`/api/agents/presets/${C.id}`,{method:e?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?a:C)});if(!t.ok)throw Error(await t.text());let s=await t.json(),r=(0,m.normalizeAgent)(s);k(a=>e?[...a,r]:a.map(e=>e.id===r.id?r:e)),i.useAgentStore.setState(a=>({agents:e?[...a.agents,s]:a.agents.map(e=>e.id===s.id?s:e)})),w(null),S(null)}catch{K(b("error.saveFailed"))}finally{z(!1)}}},G=async()=>{if(C){O(!0),E(null),K(null);try{let e=await fetch("/api/agents/presets/test-connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)}),a=await e.json();E({success:!!a.success,message:a.message||a.error||b("error.connectionTestFailed"),debug:a.debug?{...a.debug,status:e.status}:{status:e.status}})}catch(e){E({success:!1,message:e instanceof Error?e.message:b("error.connectionTestFailed")})}finally{O(!1)}}},q=e=>{let a="empty"===e?(0,m.newEmptyAgent)():(0,m.newAgentDraft)(e);K(null),w(a),S({...a})},V=async e=>{k(a=>a.map(a=>a.id===e?{...a,enabled:!a.enabled}:a)),await i.useAgentStore.getState().toggleEnabled(e)},$=async e=>{if(e.startsWith("draft-")){w(null),S(null);return}z(!0),K(null);try{let a=await fetch(`/api/agents/presets/${e}`,{method:"DELETE"});if(!a.ok)throw Error(await a.text());k(a=>a.filter(a=>a.id!==e)),i.useAgentStore.setState(a=>({agents:a.agents.filter(a=>a.id!==e)})),N?.id===e&&(w(null),S(null))}catch{K(b("error.deleteFailed"))}finally{z(!1)}},J=(0,a.jsxs)(a.Fragment,{children:[!f&&(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b px-5 pr-12 py-4",children:[N?(0,a.jsx)(n.Button,{variant:"ghost",size:"icon-sm",onClick:F,children:(0,a.jsx)(o.ArrowLeft,{className:"size-4"})}):(0,a.jsx)("div",{className:"flex size-7 items-center justify-center rounded-lg bg-primary/10",children:(0,a.jsx)(c.Bot,{className:"size-4 text-primary"})}),(0,a.jsxs)(r.DialogHeader,{className:"flex-1 space-y-0",children:[(0,a.jsx)(r.DialogTitle,{className:"text-base",children:N?C?.name??"":b("dialog.title")}),(0,a.jsx)(r.DialogDescription,{className:"text-xs",children:N?b("dialog.editDescription"):b("dialog.listDescription")})]}),!N&&(0,a.jsxs)(l.DropdownMenu,{children:[(0,a.jsx)(l.DropdownMenuTrigger,{render:(0,a.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:M,children:[(0,a.jsx)(p.Plus,{className:"size-3.5"}),b("dialog.add"),(0,a.jsx)(u.ChevronDown,{className:"size-3.5"})]})}),(0,a.jsx)(l.DropdownMenuContent,{side:"bottom",align:"end",className:"w-44",children:(0,a.jsxs)(l.DropdownMenuGroup,{children:[!R&&(0,a.jsxs)(l.DropdownMenuItem,{className:"gap-2",onClick:()=>q("empty"),children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-muted"}),(0,a.jsx)("span",{children:b("dialog.addEmpty")})]}),m.ROLE_OPTIONS.map(e=>(0,a.jsxs)(l.DropdownMenuItem,{className:"gap-2",onClick:()=>q(e),children:[(0,a.jsx)("span",{className:(0,d.cn)("size-2 rounded-full",m.ROLE_COLORS[e].split(" ")[0])}),(0,a.jsx)("span",{className:"capitalize",children:b(`role.${e}.name`)})]},e))]})})]})]}),f&&!N&&(0,a.jsx)("div",{className:"flex items-center justify-end px-5 py-3 border-b",children:(0,a.jsxs)(l.DropdownMenu,{children:[(0,a.jsx)(l.DropdownMenuTrigger,{render:(0,a.jsxs)(n.Button,{variant:"outline",size:"sm",disabled:M,children:[(0,a.jsx)(p.Plus,{className:"size-3.5"}),b("dialog.add"),(0,a.jsx)(u.ChevronDown,{className:"size-3.5"})]})}),(0,a.jsx)(l.DropdownMenuContent,{side:"bottom",align:"end",className:"w-44",children:(0,a.jsxs)(l.DropdownMenuGroup,{children:[!R&&(0,a.jsxs)(l.DropdownMenuItem,{className:"gap-2",onClick:()=>q("empty"),children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-muted"}),(0,a.jsx)("span",{children:b("dialog.addEmpty")})]}),m.ROLE_OPTIONS.map(e=>(0,a.jsxs)(l.DropdownMenuItem,{className:"gap-2",onClick:()=>q(e),children:[(0,a.jsx)("span",{className:(0,d.cn)("size-2 rounded-full",m.ROLE_COLORS[e].split(" ")[0])}),(0,a.jsx)("span",{className:"capitalize",children:b(`role.${e}.name`)})]},e))]})})]})}),f&&N&&(0,a.jsxs)("div",{className:"flex items-center gap-3 px-5 py-3 border-b",children:[(0,a.jsx)(n.Button,{variant:"ghost",size:"icon-sm",onClick:F,children:(0,a.jsx)(o.ArrowLeft,{className:"size-4"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h2",{className:"text-base font-medium truncate",children:C?.name??""}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:b("dialog.editDescription")})]})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[B&&(0,a.jsx)("div",{className:"mx-5 mt-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:B}),P?(0,a.jsx)("div",{className:"py-12 text-center text-sm text-muted-foreground",children:b("dialog.loading")}):N?C?(0,a.jsx)(I,{agent:C,roleOptions:_,testing:A,testResult:D,onChange:(e,a)=>{S(t=>t?"modelProvider"===e?{...t,modelProvider:a,runtimeKind:(0,m.isAnthropicBridgeProvider)(a)?"claude-code":t.runtimeKind}:"runtimeKind"===e?{...t,runtimeKind:a}:{...t,[e]:a}:t)},onMcpChange:e=>{S(a=>a?{...a,mcps:e}:a)},onAddSkillFiles:e=>{if(!C)return;let a=new Set(C.skills.map(e=>e.name));S(t=>t?{...t,skills:[...t.skills.filter(a=>!e.some(e=>e.name===a.name)),...e.filter(e=>e.name&&!a.has(e.name)),...e.filter(e=>a.has(e.name))]}:t)},onRemoveSkill:e=>{C&&S(a=>a?{...a,skills:a.skills.filter((a,t)=>t!==e)}:a)},onTestConnection:G},C.id):null:(0,a.jsx)(h.AgentList,{agents:L,onSelect:e=>{w(e),S({...e})},onDelete:$,onToggleEnabled:V})]}),N&&(0,a.jsxs)("div",{className:"flex justify-end gap-2 border-t px-5 py-3",children:[(0,a.jsx)(n.Button,{variant:"outline",size:"sm",onClick:F,disabled:M,children:y("cancel")}),(0,a.jsx)(n.Button,{size:"sm",onClick:U,disabled:M,children:y(M?"saving":"save")})]})]});return f?(0,a.jsx)("div",{className:"h-full flex flex-col",children:J}):(0,a.jsx)(r.Dialog,{open:e,onOpenChange:e=>{e||F(),g(e)},children:(0,a.jsx)(r.DialogContent,{className:"sm:max-w-2xl max-h-[85vh] flex flex-col p-0 gap-0",children:J})})}],588591)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,171167,(e,t,o)=>{t.exports=JSON.parse('{"common":{"save":"Save","saved":"Saved","cancel":"Cancel","delete":"Delete","confirm":"Confirm","search":"Search","loading":"Loading...","noData":"No data","upload":"Upload","remove":"Remove","add":"Add","edit":"Edit","open":"Open","close":"Close","back":"Back","next":"Next","retry":"Retry","error":"Error","success":"Success","manage":"Manage","active":"Active","name":"Name","description":"Description","status":"Status","actions":"Actions","copy":"Copy","copied":"Copied","create":"Create","saving":"Saving...","you":"You","user":"User","refresh":"Refresh","new":"New"},"settings":{"title":"Settings","description":"Customize your workspace appearance","userAvatar":"User Avatar","theme":"Theme","themeLight":"Light","themeDark":"Dark","themeSystem":"System","language":"Language","languageZh":"中文","languageEn":"English","security":"Security","newSecretPlaceholder":"New secret key (leave empty to remove)","redirecting":"Redirecting to login..."},"login":{"subtitle":"Enter your secret key to continue","secretPlaceholder":"Secret key (leave empty if not set)","verifying":"Verifying...","login":"Login","loginFailed":"Login failed","networkError":"Network error","manageServers":"Manage Servers"},"workspaces":{"title":"Workspaces","newWorkspace":"New Workspace","emptyMessage":"No workspaces yet. Create one to get started."},"workspace":{"dialog":{"editTitle":"Edit Workspace","newTitle":"New Workspace","editDescription":"Update workspace settings.","newDescription":"Create a new workspace bound to a local directory.","namePlaceholder":"Workspace name"},"agents":"Agents","addAgent":"Add Agent","noAgents":"No agents in this workspace","clone":{"createFromGit":"Create from Git","fromGitTooltip":"Clone from a Git repository","selectFolderFirst":"Please select a target folder first","title":"Create from Git","description":"Enter a Git repository URL to clone into the selected folder.","cloneTo":"Will clone to: ","objects":"objects","cloning":"Cloning...","clone":"Clone","cloneFailed":"Clone failed","noResponseBody":"No response body","phase":{"counting":"Counting objects...","compressing":"Compressing...","receiving":"Receiving data...","resolving":"Resolving...","done":"Done","error":"Failed"}}},"sidebar":{"nav":{"home":"Home","workspaces":"Workspaces","addWorkspace":"Add Workspace","settings":"Settings","general":"General","agents":"Agents","skills":"Skills","mcps":"MCP Servers","models":"Models","providers":"Providers"},"notifications":{"openAriaLabel":"Open notifications","title":"Notifications","viewAll":"View all notifications","sample1":"New order received.","sample2":"Server upgrade completed.","sample3":"New user signed up.","sample1Time":"10m ago","sample2Time":"1h ago","sample3Time":"2h ago"},"server":{"servers":"Servers","addServer":"Add Server","manageServers":"Manage Servers","editServer":"Edit Server","editDescription":"Update server connection details.","addDescription":"Add an API server to connect to.","manageDescription":"Add, edit, or remove API server connections.","url":"URL","secret":"Secret","secretPlaceholder":"Optional API secret","secretOptionalPlaceholder":"Secret (optional)","newServer":"New Server","switch":"Switch"}},"agent":{"provider":{"anthropicMessages":"Anthropic Messages","openaiChatCompletions":"OpenAI Chat Completions","openaiResponses":"OpenAI Responses API","openaiResponsesToAnthropic":"OpenAI Responses To Anthropic Messages","openaiChatToAnthropic":"OpenAI Chat Completions To Anthropic Messages","geminiGenerateContent":"Gemini Native generateContent"},"runtime":{"openAgentSdk":"Open Agent SDK","claudeCode":"Claude Code","codex":"Codex"},"role":{"agent":{"name":"Agent"},"scheduler":{"name":"Scheduler"},"task_creator":{"name":"Task Creator"},"bot":{"name":"Bot Agent"}},"defaultName":"New Agent","error":{"loadFailed":"Failed to load agent presets","saveFailed":"Failed to save agent preset","connectionTestFailed":"Connection test failed","noWorkspace":"Open a workspace before adding agent presets","deleteFailed":"Failed to delete agent preset"},"dialog":{"title":"Agent Presets","editDescription":"Configure agent behavior, tools, and model settings","listDescription":"Manage agent presets for workspace automation","add":"Add","addEmpty":"Empty","noWorkspace":"No workspace selected","loading":"Loading agent presets..."},"list":{"noDescription":"No description","empty":"No agent presets yet"},"detail":{"uploadAvatar":"Upload","removeAvatar":"Remove","name":"Name","role":"Role","description":"Description","agentRuntime":"Agent Runtime","runtimePlaceholder":"Select agent runtime...","runtimeSearchPlaceholder":"Search agent runtime...","workingDirectory":"Working Directory","workingDirPlaceholder":"/workspace","systemPrompt":"System Prompt","systemPromptPlaceholder":"Enter system prompt...","mcpServers":"MCP Servers","tools":"Tools","skills":"Skills","uploadSkills":"Upload Markdown skills","model":"Model","provider":"Provider","providerPlaceholder":"Select provider...","providerSearchPlaceholder":"Search provider...","modelField":"Model","selectProviderFirst":"Select a provider first...","modelPlaceholder":"Select model...","modelSearchPlaceholder":"Search or type custom model...","apiMessageType":"API Message Type","apiMessageTypePlaceholder":"Select API message type...","apiMessageTypeSearchPlaceholder":"Search API message type...","apiBase":"API Base","apiBasePlaceholder":"https://api.example.com/v1","apiKey":"API Key","apiKeyPlaceholder":"sk-...","validateHelper":"Validate provider credentials before saving.","testing":"Testing...","test":"Test","temperature":"Temperature","maxTokens":"Max Tokens","basic":"Basic"},"debug":{"status":"status:","provider":"provider:","url":"url:","model":"model:","body":"body:"}},"models":{"capability":{"vision":"Vision","reasoning":"Reasoning","embedding":"Embedding"},"error":{"saveFailed":"Failed to save model","deleteFailed":"Failed to delete model"},"confirm":{"delete":"Delete this model?"},"dialog":{"editTitle":"Edit Model","addTitle":"Add Model","title":"Models","editDescription":"Configure model properties and capabilities","listDescription":"Manage available LLM models","add":"Add","loading":"Loading models..."},"list":{"contextAbbr":"ctx","empty":"No models yet"},"form":{"details":"Details","modelId":"Model ID","modelIdPlaceholder":"e.g. gpt-4o","displayName":"Display Name","displayNamePlaceholder":"e.g. GPT-4o","provider":"Provider","context":"Context","maxContextTokens":"Max context tokens","customContextPlaceholder":"128000","thinking":"Thinking","enableThinking":"Enable thinking","enableThinkingHelper":"Send reasoning/thinking options with model requests.","effort":"Effort","cost":"Cost","inputPerMillion":"Input / 1M tokens","outputPerMillion":"Output / 1M tokens","costPlaceholder":"0.00","capabilities":"Capabilities"}},"providers":{"error":{"saveFailed":"Failed to save provider","deleteFailed":"Failed to delete provider"},"confirm":{"delete":"Delete this provider?"},"dialog":{"editTitle":"Edit Provider","addTitle":"Add Provider","title":"Providers","editDescription":"Configure provider connection settings","listDescription":"Manage LLM API providers","add":"Add","loading":"Loading providers..."},"list":{"noApiBase":"No API base configured","modelsCount":"models","addModel":"Add model","empty":"No providers yet"},"form":{"connection":"Connection","name":"Name","namePlaceholder":"e.g. Anthropic","apiBase":"API Base","apiBasePlaceholder":"https://api.anthropic.com","apiKey":"API Key","apiKeyPlaceholder":"sk-..."}},"chat":{"channel":{"general":"General","issue":"Issue","agent":"Agent","edit":"Edit Channel","create":"Create Channel","selectType":"Select type","addMember":"Add Member","info":"Channel Info","members":"Members","type":"Type:","channelId":"Channel ID","memberCount":"Member count","createdAt":"Created","noMembers":"No members yet","delete":"Delete Channel","deleteConfirm":"Are you sure you want to delete this channel? This action cannot be undone.","namePlaceholder":"Channel name"},"channelType":{"general":"General","issue":"Issue","agent":"Agent"},"emptyState":"Select a channel to start chatting","status":{"idle":"Idle","waitingForUser":"Waiting for confirmation","running":"Running","success":"Success","error":"Failed"},"viewRelatedIssue":"View related issue","deleteMessage":{"title":"Delete Message","description":"Are you sure you want to delete this message? This action cannot be undone."},"clearMessages":{"title":"Clear Channel Messages","description":"Are you sure you want to clear all messages in #{channel}? This action cannot be undone.","confirm":"Clear"},"pendingQuestion":{"placeholder":"Type your answer..."},"untitledTodo":"Untitled todo","input":{"placeholder":"Message #{channel}... Use @ to mention agents, / for commands","attachFiles":"Attach Files","autoMode":"Auto","unpinAgent":"Unpin Agent","pinAgent":"Pin Agent","mcp":"MCP","noMcp":"No MCP configured","skill":"Skill","noSkills":"No skills configured","tools":"Tools","noTools":"No tools configured","todos":"Todos","uploadFailed":"Upload failed: {name}"},"messageParts":{"agentProcessing":"Agent is processing...","agentThinking":"Agent is thinking","aiIntermediateOutput":"AI intermediate output","streamingResponse":"Streaming response","intermediateMessage":"Intermediate message","chainSteps":"{count, plural, one {# chain step} other {# chain steps}}","reject":"Reject","approve":"Approve","result":"Result","aiMessage":"AI message","failedToLoadDetails":"Failed to load details.","loadingDetails":"Loading details...","noDetails":"No details available.","raw":"Raw","input":"Input","output":"Output"},"chainOfThought":{"defaultHeader":"Chain of Thought"},"commit":{"clipboardUnavailable":"Clipboard API not available"},"subagent":{"instructions":"Instructions","tools":"Tools","noDescription":"No description","outputSchema":"Output Schema"},"terminal":{"title":"Terminal","running":"Running...","clipboardUnavailable":"Clipboard API not available"},"context":{"totalCost":"Total cost","input":"Input","output":"Output","reasoning":"Reasoning","cache":"Cache"},"attachments":{"source":"Source","image":"Image","attachment":"Attachment","imageAlt":"Image","remove":"Remove","noAttachments":"No attachments"},"askUser":{"placeholder":"Type an answer..."},"readonlyCodeBlock":{"loading":"Loading code..."}},"issue":{"status":{"draft":"Draft","planned":"Planned","in_progress":"In Progress","review_pending":"Review Pending","changes_requested":"Changes Requested","approved":"Approved","completed":"Completed","archived":"Archived","error":"Error"},"list":{"title":"Issues","emptyTitle":"No issues yet","emptyDescription":"Create an issue to start collaborating","addIssue":"Add Issue","taskCount":"{count, plural, one {# task} other {# tasks}}"},"detail":{"selectIssue":"Select an issue to view details","commentPlaceholder":"Write a comment... Use @ to mention agents, / for commands","openChatChannel":"Open chat channel","memberCount":"{count, plural, one {# member} other {# members}}","created":"Created","updated":"Updated","pr":"PR:","start":"Start","resumeFailed":"Resume failed tasks","retryPaused":"Automatic retry paused after {failed}/{total} attempts.","tasks":"Tasks ({count})","editTask":"Edit Task","addTask":"Add Task","taskTitlePlaceholder":"Task title","taskDescriptionPlaceholder":"Description (optional)","noTasks":"No tasks yet","noAgent":"No agent assigned","comments":"Comments ({count})","author":"Author","commented":"commented","comment":"Comment","tabInfo":"Info","tabMembers":"Members","infoStatus":"Status","infoIssueId":"Issue ID","infoTaskCount":"Tasks","infoMemberCount":"Members","infoCreatedAt":"Created","infoUpdatedAt":"Updated","infoBranch":"Branch","infoPr":"PR","infoDescription":"Description","addMember":"Add member","deleteIssue":"Delete Issue"},"message":{"task":"task {taskId}","openMessage":"Open message","expandMore":"Show more","collapse":"Collapse"},"edit":{"title":"Edit Issue","description":"Modify issue info, status and members","titlePlaceholder":"Title","descriptionPlaceholder":"Description","statusLabel":"Status","membersLabel":"Members","searchAgent":"Search Agent...","noAgents":"No agents available"},"create":{"title":"Create Issue","description":"Create a new issue and assign members","titlePlaceholder":"Title","descriptionPlaceholder":"Description (optional)","membersLabel":"Members","searchAgent":"Search Agent...","noAgents":"No agents available","submit":"Create"}},"task":{"status":{"pending":"Pending","running":"Running","reviewing":"Reviewing","waiting_review":"Waiting Review","retrying":"Retrying","done":"Done","failed":"Failed","cancelled":"Cancelled"}},"home":{"table":{"agent":"Agent","model":"Model","modelUnknown":"unknown","summary":"Summary","cost":"Cost","total":"Total:","cacheHit":"Cache hit:","tokensIn":"in","tokensOut":"out","status":"Status","duration":"Duration","time":"Time","emptyMessage":"Usage appears here after an agent run completes.","noResults":"No results."},"period":{"today":"Today","7d":"7 days","30d":"30 days","1y":"1 year","custom":"Custom"},"title":"Agent Usage","metric":{"agentRuns":"Agent Runs","agentRunsHelper":"completed runs","tokensUsed":"Tokens Used","tokensIn":"in","totalCost":"Total Cost","totalCostHelper":"estimated spend","avgDuration":"Avg Duration","avgDurationHelper":"per run"},"chart":{"dailyTokenUsage":"Daily Token Usage","input":"Input","output":"Output","costByModel":"Cost by Model","noUsageRecords":"No completed usage records yet.","tokenDistribution":"Token Distribution","costDistribution":"Cost Distribution","tokens":"tokens","totalCost":"total cost","noCostData":"No cost data yet.","noTokenData":"No token data"},"pagination":{"showing":"Showing","to":"to","of":"of","entries":"entries","prevAriaLabel":"Go to previous page","previous":"Previous","nextAriaLabel":"Go to next page","next":"Next"},"time":{"justNow":"just now","minutesAgo":"{n}m ago","hoursAgo":"{n}h ago","daysAgo":"{n}d ago"},"subscription":{"planTitle":"Subscription Plans","addPlatform":"Subscriptions","title":"Manage Subscriptions","empty":"No subscriptions yet. Click below to add one.","add":"Add Platform","cancel":"Cancel","save":"Save","platform":"Platform","label":"Label","labelPlaceholder":"Optional name for this config","loading":"Loading...","resetAt":"Resets at","headers":"Extra Headers","addHeader":"Add","noHeaders":"No headers","cookiePlaceholder":"Paste browser Cookie","editTitle":"Edit Subscription"}},"editor":{"explorer":"EXPLORER","noFiles":"No files found","revealInFinder":"Reveal in Finder","loadingEditor":"Loading editor...","openFileToEdit":"Open a file to start editing"},"terminal":{"newTerminal":"New Terminal","noSession":"No terminal session","selectWorkingDirectory":"Select Working Directory","selectWorkingDirectoryDescription":"This workspace has multiple bound directories. Select which one to use for this terminal.","virtualKeyboard":"Keyboard","sendCtrlC":"Quit","clearScreen":"Clear"},"git":{"changes":{"title":"Changes","staged":"Staged","unstaged":"Unstaged","commitMessagePlaceholder":"Commit message (⌘+Enter)","commit":"Commit","committing":"Committing...","syncChanges":"Sync Changes","syncing":"Syncing...","discardAll":"Discard all changes","refresh":"Refresh","editGitignore":"Edit .gitignore","noChanges":"No changes","noBranches":"No branches","selectFileDiff":"Select a file to view diff","noChangesToShow":"No changes to show","ignoreThisFile":"Ignore this file","ignoreFilePath":"Ignore {path}","syncedSuccessfully":"Synced successfully","syncFailed":"Sync failed","failedCommitMessage":"Failed to generate commit message","committedSuccessfully":"Committed successfully","commitFailed":"Commit failed","discardedSuccessfully":"Changes discarded","discardFailed":"Discard failed"},"commits":{"title":"Commits","titleWithCount":"Commits ({count})","pushNCommits":"Push {count} commits","pullNCommits":"Pull {count} commits","noCommits":"No commits","remoteTrackingBranch":"Remote tracking branch","pushedSuccessfully":"Pushed successfully","pushFailed":"Push failed","pulledSuccessfully":"Pulled successfully","pullFailed":"Pull failed","remoteAdded":"Remote added"},"graph":{"title":"Graph"},"remote":{"bindTitle":"Bind Remote Repository","nameLabel":"Remote name","namePlaceholder":"origin","urlLabel":"Remote URL","urlPlaceholder":"https://github.com/user/repo.git","adding":"Adding...","addRemote":"Add Remote"},"notInitialized":{"message":"Not a Git repository","initializing":"Initializing...","initialize":"Initialize Git Repository"}},"projectSettings":{"title":"Project Settings","loading":"Loading...","workspaceNotFound":"Workspace not found","info":{"title":"Info","path":"Path","channels":"Channels","issues":"Issues"},"automation":{"title":"Automation","autoProcess":"Auto Process Issues","autoProcessDescription":"Scheduler will automatically plan and execute open issues"},"notifications":{"title":"Notifications","messageNotifications":"Message Notifications","messageNotificationsDescription":"Push issue progress and final task results to external chat platforms","lark":"Feishu","wechat":"WeChat","appId":"app_id","appSecret":"app_secret","stopService":"Stop Service","startService":"Start Service","testSend":"Test Send","saveSuccess":"Notification settings saved","saveFailed":"Failed to save notification settings","startSuccess":"Notification service started","startFailed":"Failed to start notification service","stopSuccess":"Notification service stopped","stopFailed":"Failed to stop notification service","testSuccess":"Test notification sent","testFailed":"Failed to send test notification","native":"System","nativeDescription":"Push issue progress and task results via native OS notifications","nativePermissionGranted":"Granted","nativePermissionDenied":"Denied","nativePermissionDefault":"Not granted","nativePermissionUnsupported":"Unsupported","nativeRequestPermission":"Grant Permission","nativeTestSuccess":"System notification sent","nativeTestFailed":"Failed to send system notification","nativePermissionGrantedToast":"Notification permission granted","nativePermissionDeniedToast":"Notification permission denied"},"wechat":{"robot":"WeChat iLink Robot","connected":"Connected: {accountId}","scanned":"Scanned. Confirm login on your phone.","expired":"QR code expired. Refresh to get a new one.","scanQr":"Scan the QR code with WeChat to authorize the robot.","refreshLogin":"Refresh Login","getQr":"Get QR","status":"Status: {status}","loginUrl":"Login URL: {url}","connectedToast":"WeChat robot connected","pollFailed":"Failed to poll WeChat QR status","getQrFailed":"Failed to get WeChat QR code"},"botAgent":{"title":"Bot Agent","selectAgent":"No agent selected","manage":"Manage"},"events":{"title":"Notification Events","issueStarted":"Issue Started","issueCompleted":"Issue Completed","taskCompleted":"Task Completed"},"prompt":{"title":"Prompt","workspacePrompt":"Workspace Prompt","description":"Applied to every agent run in this workspace","savePrompt":"Save Prompt","saveSuccess":"Workspace prompt saved","saveFailed":"Failed to save workspace prompt"}},"composer":{"openDialog":"Open Dialog","newContent":"New Content","placeholder":"Type content, use @ to mention, / to open commands","heading":"Heading","quote":"Quote","divider":"Divider","addFile":"Add File","dropzoneHint":"Tip: drag files here, or click \\"Add File\\"","send":"Send","sending":"Sending...","uploadFailed":"Upload failed: {name}","noMatch":"No matches","selectOption":"Select an option"},"folderPicker":{"newFolder":"New Folder","folderNamePlaceholder":"Folder name","select":"Select","selectDirectory":"Select a directory to check permissions"},"commands":{"title":"Commands","addCommand":"Add Command","editCommand":"Edit Command","name":"Name","command":"Command","workingDirectory":"Working Directory","shell":"Shell","environmentVariables":"Environment Variables","autoRestart":"Auto Restart","run":"Run","stop":"Stop","save":"Save","cancel":"Cancel","delete":"Delete","noCommands":"No commands","searchPlaceholder":"Search commands...","import":"Import","importTitle":"Import Commands from package.json","importDescription":"Select a project directory to parse scripts from package.json","selectProject":"Select project directory","parsedScripts":"Parsed Scripts","noScripts":"No scripts found","addSelected":"Add Selected","customCommands":"Custom Commands","folder":"Folder"},"skills":{"title":"Skills Management","description":"Manage and import skills, bind to agents","import":"Import","importTitle":"Import Skill Files","importPlaceholder":"Drag .md files here, or click to select","importConfirm":"Confirm Import","filterAll":"All Skills","filterFavorites":"Favorites","filterByAgent":"Filter by Agent","search":"Search skills...","empty":"No skills found","manageAgents":"Manage","apply":"Apply","delete":"Delete","editTitle":"Edit Skill - {name}","editDescription":"Edit skill Markdown content","bindTitle":"Bind Agents - {name}","bindDescription":"Select agents to bind this skill to","searchAgents":"Search agents...","syncToAgents":"Sync to Agents","syncTitle":"Sync Skills to Agents","syncDescription":"The following agent skill files are outdated. Select items to update.","syncEmpty":"All agent skills are up to date","syncConfirm":"Confirm Update","syncSuccess":"Updated {count} skill files"},"mcps":{"title":"MCP Servers","description":"Manage and import MCP server configs, bind to agents","import":"Import","importTitle":"Import MCP Config","importConfirm":"Confirm Import","importInvalidJson":"Invalid JSON format","importFailed":"Import failed","filterAll":"All","filterFavorites":"Favorites","filterByAgent":"Filter by Agent","search":"Search MCP servers...","empty":"No MCP servers configured","apply":"Apply","delete":"Delete","editTitle":"Edit MCP - {name}","editDescription":"Edit MCP server config (JSON)","bindTitle":"Bind Agents - {name}","bindDescription":"Select agents to bind this MCP server to"}}')},367640,(e,t,o)=>{t.exports=JSON.parse('{"common":{"save":"保存","saved":"已保存","cancel":"取消","delete":"删除","confirm":"确认","search":"搜索","loading":"加载中...","noData":"暂无数据","upload":"上传","remove":"移除","add":"添加","edit":"编辑","open":"打开","close":"关闭","back":"返回","next":"下一步","retry":"重试","error":"错误","success":"成功","manage":"管理","active":"活跃","name":"名称","description":"描述","status":"状态","actions":"操作","copy":"复制","copied":"已复制","create":"创建","saving":"保存中...","you":"你","user":"用户","refresh":"刷新","new":"新建"},"settings":{"title":"设置","description":"自定义工作空间外观","userAvatar":"用户头像","theme":"主题","themeLight":"浅色","themeDark":"深色","themeSystem":"跟随系统","language":"语言","languageZh":"中文","languageEn":"English","security":"安全","newSecretPlaceholder":"新的密钥(留空则移除)","redirecting":"正在跳转到登录页..."},"login":{"subtitle":"输入密钥以继续","secretPlaceholder":"密钥(如未设置可留空)","verifying":"验证中...","login":"登录","loginFailed":"登录失败","networkError":"网络错误","manageServers":"管理服务器"},"workspaces":{"title":"工作空间","newWorkspace":"新建工作空间","emptyMessage":"暂无工作空间。创建一个以开始使用。"},"workspace":{"dialog":{"editTitle":"编辑工作空间","newTitle":"新建工作空间","editDescription":"更新工作空间设置。","newDescription":"创建新的工作空间并绑定到本地目录。","namePlaceholder":"工作空间名称"},"agents":"智能体","addAgent":"添加智能体","noAgents":"此工作空间暂无智能体","clone":{"createFromGit":"从 Git 创建","fromGitTooltip":"从 Git 仓库克隆","selectFolderFirst":"请先选择目标文件夹","title":"从 Git 创建","description":"输入 Git 仓库地址,克隆到选定的文件夹中。","cloneTo":"将克隆到: ","objects":"个对象","cloning":"克隆中...","clone":"克隆","cloneFailed":"克隆失败","noResponseBody":"无响应内容","phase":{"counting":"计算对象中...","compressing":"压缩中...","receiving":"接收数据中...","resolving":"解析中...","done":"完成","error":"失败"}}},"sidebar":{"nav":{"home":"首页","workspaces":"工作空间","addWorkspace":"添加工作空间","settings":"设置","general":"通用","agents":"智能体","skills":"技能管理","mcps":"MCP 服务器","models":"模型","providers":"供应商","workflows":"工作流"},"notifications":{"openAriaLabel":"打开通知","title":"通知","viewAll":"查看所有通知","sample1":"收到新订单。","sample2":"服务器升级完成。","sample3":"新用户注册。","sample1Time":"10分钟前","sample2Time":"1小时前","sample3Time":"2小时前"},"server":{"servers":"服务器","addServer":"添加服务器","manageServers":"管理服务器","editServer":"编辑服务器","editDescription":"更新服务器连接信息。","addDescription":"添加 API 服务器连接。","manageDescription":"添加、编辑或移除 API 服务器连接。","url":"URL","secret":"密钥","secretPlaceholder":"可选 API 密钥","secretOptionalPlaceholder":"密钥(可选)","newServer":"新服务器","switch":"切换"}},"agent":{"provider":{"anthropicMessages":"Anthropic Messages","openaiChatCompletions":"OpenAI Chat Completions","openaiResponses":"OpenAI Responses API","openaiResponsesToAnthropic":"OpenAI Responses To Anthropic Messages","openaiChatToAnthropic":"OpenAI Chat Completions To Anthropic Messages","geminiGenerateContent":"Gemini Native generateContent"},"runtime":{"openAgentSdk":"Open Agent SDK","claudeCode":"Claude Code","codex":"Codex"},"role":{"agent":{"name":"Agent"},"scheduler":{"name":"调度者"},"task_creator":{"name":"任务创建者"},"bot":{"name":"Bot Agent"}},"defaultName":"新 Agent","error":{"loadFailed":"加载 Agent 预设失败","saveFailed":"保存 Agent 预设失败","connectionTestFailed":"连接测试失败","noWorkspace":"请先打开工作空间再添加 Agent 预设","deleteFailed":"删除 Agent 预设失败"},"dialog":{"title":"Agent 预设","editDescription":"配置 Agent 行为、工具和模型设置","listDescription":"管理工作空间的 Agent 预设","add":"添加","addEmpty":"空白","noWorkspace":"未选择工作空间","loading":"加载 Agent 预设中..."},"list":{"noDescription":"无描述","empty":"暂无 Agent 预设"},"detail":{"uploadAvatar":"上传","removeAvatar":"移除","name":"名称","role":"角色","description":"描述","agentRuntime":"Agent 运行时","runtimePlaceholder":"选择 Agent 运行时...","runtimeSearchPlaceholder":"搜索 Agent 运行时...","workingDirectory":"工作目录","workingDirPlaceholder":"/workspace","systemPrompt":"系统提示","systemPromptPlaceholder":"输入系统提示...","mcpServers":"MCP 服务器","tools":"工具","skills":"技能","uploadSkills":"上传 Markdown 技能","model":"模型","provider":"供应商","providerPlaceholder":"选择供应商...","providerSearchPlaceholder":"搜索供应商...","modelField":"模型","selectProviderFirst":"请先选择供应商...","modelPlaceholder":"选择模型...","modelSearchPlaceholder":"搜索或输入自定义模型...","apiMessageType":"API 消息类型","apiMessageTypePlaceholder":"选择 API 消息类型...","apiMessageTypeSearchPlaceholder":"搜索 API 消息类型...","apiBase":"API 地址","apiBasePlaceholder":"https://api.example.com/v1","apiKey":"API 密钥","apiKeyPlaceholder":"sk-...","validateHelper":"保存前验证供应商凭据。","testing":"测试中...","test":"测试","temperature":"温度","maxTokens":"最大 Token 数","basic":"基本信息"},"debug":{"status":"状态:","provider":"供应商:","url":"URL:","model":"模型:","body":"请求体:"}},"models":{"capability":{"vision":"视觉","reasoning":"推理","embedding":"嵌入"},"error":{"saveFailed":"保存模型失败","deleteFailed":"删除模型失败"},"confirm":{"delete":"删除此模型?"},"dialog":{"editTitle":"编辑模型","addTitle":"添加模型","title":"模型","editDescription":"配置模型属性和能力","listDescription":"管理可用的 LLM 模型","add":"添加","loading":"加载模型中..."},"list":{"contextAbbr":"上下文","empty":"暂无模型"},"form":{"details":"详情","modelId":"模型 ID","modelIdPlaceholder":"例如 gpt-4o","displayName":"显示名称","displayNamePlaceholder":"例如 GPT-4o","provider":"供应商","context":"上下文","maxContextTokens":"最大上下文 Token","customContextPlaceholder":"128000","thinking":"思考","enableThinking":"启用思考","enableThinkingHelper":"随模型请求发送推理/思考选项。","effort":"投入度","cost":"费用","inputPerMillion":"输入 / 百万 Token","outputPerMillion":"输出 / 百万 Token","costPlaceholder":"0.00","capabilities":"能力"}},"providers":{"error":{"saveFailed":"保存供应商失败","deleteFailed":"删除供应商失败"},"confirm":{"delete":"删除此供应商?"},"dialog":{"editTitle":"编辑供应商","addTitle":"添加供应商","title":"供应商","editDescription":"配置供应商连接设置","listDescription":"管理 LLM API 供应商","add":"添加","loading":"加载供应商中..."},"list":{"noApiBase":"未配置 API 地址","modelsCount":"个模型","addModel":"添加模型","empty":"暂无供应商"},"form":{"connection":"连接","name":"名称","namePlaceholder":"例如 Anthropic","apiBase":"API 地址","apiBasePlaceholder":"https://api.anthropic.com","apiKey":"API 密钥","apiKeyPlaceholder":"sk-..."}},"chat":{"channel":{"general":"通用","issue":"议题","agent":"Agent","edit":"编辑频道","create":"创建频道","selectType":"选择类型","addMember":"添加成员","info":"频道信息","members":"成员","type":"类型:","channelId":"频道 ID","memberCount":"成员数","createdAt":"创建时间","noMembers":"暂无成员","noAgents":"未找到 Agent","delete":"删除频道","deleteConfirm":"确认删除此频道?此操作不可撤销。","namePlaceholder":"频道名称"},"channelType":{"general":"通用","issue":"议题","agent":"Agent"},"emptyState":"选择一个频道开始对话","status":{"idle":"空闲中","waitingForUser":"等待用户确认","running":"运行中","success":"成功","error":"失败"},"viewRelatedIssue":"查看关联议题","deleteMessage":{"title":"删除消息","description":"确认删除这条消息?此操作不可撤销。"},"clearMessages":{"title":"清空频道消息","description":"确认清空 #{channel} 的所有消息?此操作不可撤销。","confirm":"清空"},"pendingQuestion":{"placeholder":"输入回答..."},"untitledTodo":"未命名待办","input":{"placeholder":"发送消息到 #{channel}... 使用 @ 提及 Agent,输入 / 打开命令","attachFiles":"附件","autoMode":"自动","unpinAgent":"取消固定","pinAgent":"固定此 Agent","mcp":"MCP","noMcp":"未配置 MCP","skill":"技能","noSkills":"未配置技能","tools":"工具","noTools":"未配置工具","todos":"待办","uploadFailed":"上传失败:{name}"},"messageParts":{"agentProcessing":"Agent 正在处理...","agentThinking":"Agent 正在思考","aiIntermediateOutput":"AI 中间输出","streamingResponse":"流式响应","intermediateMessage":"中间消息","chainSteps":"{count} 个链式步骤","reject":"拒绝","approve":"批准","result":"结果","aiMessage":"AI 消息","failedToLoadDetails":"加载详情失败。","loadingDetails":"加载详情中...","noDetails":"无可用详情。","raw":"原始数据","input":"输入","output":"输出"},"chainOfThought":{"defaultHeader":"思维链"},"commit":{"clipboardUnavailable":"剪贴板不可用"},"subagent":{"instructions":"指令","tools":"工具","noDescription":"无描述","outputSchema":"输出模式"},"terminal":{"title":"终端","running":"运行中...","clipboardUnavailable":"剪贴板不可用"},"context":{"totalCost":"总费用","input":"输入","output":"输出","reasoning":"推理","cache":"缓存"},"attachments":{"source":"来源","image":"图片","attachment":"附件","imageAlt":"图片","remove":"移除","noAttachments":"无附件"},"askUser":{"placeholder":"输入回答..."},"readonlyCodeBlock":{"loading":"加载代码中..."}},"issue":{"status":{"draft":"草稿","planned":"已规划","in_progress":"进行中","review_pending":"待审核","changes_requested":"需修改","approved":"已批准","completed":"已完成","archived":"已归档","error":"错误"},"list":{"title":"议题","emptyTitle":"暂无议题","emptyDescription":"创建一个议题开始协作","addIssue":"添加议题","taskCount":"{count} 个任务"},"detail":{"selectIssue":"选择一个议题查看详情","commentPlaceholder":"写评论... 使用 @ 提及 Agent,输入 / 打开命令","openChatChannel":"打开聊天频道","memberCount":"{count} 位成员","created":"创建于","updated":"更新于","pr":"PR:","start":"开始","resumeFailed":"重试失败任务","retryPaused":"自动重试已在 {failed}/{total} 次尝试后暂停。","tasks":"任务 ({count})","editTask":"编辑任务","addTask":"添加任务","taskTitlePlaceholder":"任务标题","taskDescriptionPlaceholder":"描述(可选)","noTasks":"暂无任务","noAgent":"未分配 Agent","comments":"评论 ({count})","author":"作者","commented":"评论了","comment":"评论","tabInfo":"信息","tabMembers":"成员","infoStatus":"状态","infoIssueId":"议题 ID","infoTaskCount":"任务数","infoMemberCount":"成员数","infoCreatedAt":"创建时间","infoUpdatedAt":"更新时间","infoBranch":"分支","infoPr":"PR","infoDescription":"描述","addMember":"添加成员","deleteIssue":"删除议题"},"message":{"task":"任务 {taskId}","openMessage":"打开消息","expandMore":"展开更多","collapse":"收起"},"edit":{"title":"编辑议题","description":"修改议题信息、状态和成员","titlePlaceholder":"标题","descriptionPlaceholder":"描述","statusLabel":"状态","membersLabel":"成员","searchAgent":"搜索 Agent...","noAgents":"无可用 Agent"},"create":{"title":"创建议题","description":"创建一个新的议题并指定成员","titlePlaceholder":"标题","descriptionPlaceholder":"描述(可选)","membersLabel":"成员","searchAgent":"搜索 Agent...","noAgents":"无可用 Agent","submit":"创建"}},"task":{"status":{"pending":"待处理","running":"运行中","reviewing":"审核中","waiting_review":"等待审核","retrying":"重试中","done":"完成","failed":"失败","cancelled":"已取消"}},"home":{"table":{"agent":"Agent","model":"模型","modelUnknown":"未知","summary":"摘要","cost":"费用","total":"总计:","cacheHit":"缓存命中:","tokensIn":"输入","tokensOut":"输出","status":"状态","duration":"耗时","time":"时间","emptyMessage":"Agent 运行完成后,使用记录将显示在此处。","noResults":"暂无结果。"},"period":{"today":"今日","7d":"7 天","30d":"30 天","1y":"1 年","custom":"自定义"},"title":"Agent 用量","metric":{"agentRuns":"Agent 运行次数","agentRunsHelper":"已完成运行","tokensUsed":"Token 用量","tokensIn":"输入","totalCost":"总费用","totalCostHelper":"预估花费","avgDuration":"平均耗时","avgDurationHelper":"每次运行"},"chart":{"dailyTokenUsage":"每日 Token 用量","input":"输入","output":"输出","costByModel":"按模型费用","noUsageRecords":"暂无已完成的用量记录。","tokenDistribution":"Token 分布","costDistribution":"费用分布","tokens":"tokens","totalCost":"总费用","noCostData":"暂无费用数据。","noTokenData":"暂无 Token 数据"},"pagination":{"showing":"显示","to":"至","of":"共","entries":"条","prevAriaLabel":"上一页","previous":"上一页","nextAriaLabel":"下一页","next":"下一页"},"time":{"justNow":"刚刚","minutesAgo":"{n} 分钟前","hoursAgo":"{n} 小时前","daysAgo":"{n} 天前"},"subscription":{"planTitle":"订阅计划","addPlatform":"订阅计划","title":"管理订阅平台","empty":"暂无订阅平台,点击下方按钮添加","add":"添加平台","cancel":"取消","save":"保存","platform":"平台","label":"名称","labelPlaceholder":"给这个配置取个名字(可选)","loading":"加载中...","resetAt":"重置于","headers":"请求头 (Headers)","addHeader":"添加","noHeaders":"暂无请求头","cookiePlaceholder":"粘贴浏览器 Cookie","editTitle":"编辑订阅平台"}},"editor":{"explorer":"资源管理器","noFiles":"未找到文件","revealInFinder":"在 Finder 中显示","loadingEditor":"编辑器加载中...","openFileToEdit":"打开文件开始编辑"},"terminal":{"newTerminal":"新建终端","noSession":"无终端会话","selectWorkingDirectory":"选择工作目录","selectWorkingDirectoryDescription":"此工作空间绑定了多个目录。请选择用于此终端的目录。","virtualKeyboard":"键盘","sendCtrlC":"退出","clearScreen":"清屏"},"git":{"changes":{"title":"更改","staged":"已暂存","unstaged":"未暂存","commitMessagePlaceholder":"提交信息 (⌘+Enter)","commit":"提交","committing":"提交中...","syncChanges":"同步更改","syncing":"同步中...","discardAll":"丢弃所有更改","refresh":"刷新","editGitignore":"编辑 .gitignore","noChanges":"暂无更改","noBranches":"暂无分支","selectFileDiff":"选择文件查看差异","noChangesToShow":"没有可显示的更改","ignoreThisFile":"忽略此文件","ignoreFilePath":"忽略 {path}","syncedSuccessfully":"同步成功","syncFailed":"同步失败","failedCommitMessage":"生成提交信息失败","committedSuccessfully":"提交成功","commitFailed":"提交失败","discardedSuccessfully":"已丢弃更改","discardFailed":"丢弃失败"},"commits":{"title":"提交","titleWithCount":"提交 ({count})","pushNCommits":"推送 {count} 个提交","pullNCommits":"拉取 {count} 个提交","noCommits":"暂无提交","remoteTrackingBranch":"远程跟踪分支","pushedSuccessfully":"推送成功","pushFailed":"推送失败","pulledSuccessfully":"拉取成功","pullFailed":"拉取失败","remoteAdded":"远程仓库已添加"},"graph":{"title":"图谱"},"remote":{"bindTitle":"绑定远程仓库","nameLabel":"远程名称","namePlaceholder":"origin","urlLabel":"远程 URL","urlPlaceholder":"https://github.com/user/repo.git","adding":"添加中...","addRemote":"添加远程仓库"},"notInitialized":{"message":"不是 Git 仓库","initializing":"初始化中...","initialize":"初始化 Git 仓库"}},"projectSettings":{"title":"项目设置","loading":"加载中...","workspaceNotFound":"未找到工作空间","info":{"title":"信息","path":"路径","channels":"频道","issues":"议题"},"automation":{"title":"自动化","autoProcess":"自动处理议题","autoProcessDescription":"调度者将自动规划和执行开放议题"},"notifications":{"title":"通知","messageNotifications":"消息通知","messageNotificationsDescription":"将议题进度和最终任务结果推送到外部聊天平台","lark":"飞书","wechat":"微信","appId":"app_id","appSecret":"app_secret","stopService":"停止服务","startService":"启动服务","testSend":"测试发送","saveSuccess":"通知设置已保存","saveFailed":"保存通知设置失败","startSuccess":"通知服务已启动","startFailed":"启动通知服务失败","stopSuccess":"通知服务已停止","stopFailed":"停止通知服务失败","testSuccess":"测试通知已发送","testFailed":"发送测试通知失败","native":"系统通知","nativeDescription":"通过操作系统原生通知在本地推送议题进度和任务结果","nativePermissionGranted":"已授权","nativePermissionDenied":"已拒绝","nativePermissionDefault":"未授权","nativePermissionUnsupported":"不支持","nativeRequestPermission":"授权通知","nativeTestSuccess":"系统通知已发送","nativeTestFailed":"发送系统通知失败","nativePermissionGrantedToast":"通知权限已授权","nativePermissionDeniedToast":"通知权限被拒绝"},"wechat":{"robot":"微信 iLink 机器人","connected":"已连接:{accountId}","scanned":"已扫码,请在手机上确认登录。","expired":"二维码已过期,请刷新获取新的。","scanQr":"使用微信扫描二维码以授权机器人。","refreshLogin":"刷新登录","getQr":"获取二维码","status":"状态:{status}","loginUrl":"登录 URL:{url}","connectedToast":"微信机器人已连接","pollFailed":"轮询微信二维码状态失败","getQrFailed":"获取微信二维码失败"},"botAgent":{"title":"Bot Agent","selectAgent":"未选择 Agent","manage":"管理"},"events":{"title":"通知事件","issueStarted":"议题开始","issueCompleted":"议题完成","taskCompleted":"任务完成"},"prompt":{"title":"Prompt","workspacePrompt":"工作空间 Prompt","description":"应用于此工作空间中的每次 Agent 运行","savePrompt":"保存 Prompt","saveSuccess":"工作空间 Prompt 已保存","saveFailed":"保存工作空间 Prompt 失败"}},"composer":{"openDialog":"打开对话框","newContent":"新建内容","placeholder":"输入内容,支持 @ 艾特人,输入 / 打开命令面板","heading":"标题","quote":"引用","divider":"分割线","addFile":"添加文件","dropzoneHint":"提示:拖拽文件到这里,或点击「添加文件」","send":"发送","sending":"发送中...","uploadFailed":"上传失败: {name}","noMatch":"无匹配结果","selectOption":"选择一个选项"},"folderPicker":{"newFolder":"新建文件夹","folderNamePlaceholder":"文件夹名称","select":"选择","selectDirectory":"选择一个目录以检查权限"},"commands":{"title":"命令","addCommand":"添加命令","editCommand":"编辑命令","name":"名称","command":"命令","workingDirectory":"工作目录","shell":"Shell","environmentVariables":"环境变量","autoRestart":"自动重启","run":"运行","stop":"停止","save":"保存","cancel":"取消","delete":"删除","noCommands":"暂无命令","searchPlaceholder":"搜索命令...","import":"导入","importTitle":"从 package.json 导入命令","importDescription":"选择项目目录,解析 package.json 中的 scripts 字段","selectProject":"选择项目目录","parsedScripts":"解析的脚本","noScripts":"未找到 scripts","addSelected":"添加选中命令","customCommands":"自定义命令","folder":"分组"},"skills":{"title":"技能管理","description":"管理和导入技能文件,绑定到智能体","import":"导入","importTitle":"导入技能文件","importPlaceholder":"拖拽 .md 文件到此处,或点击选择","importConfirm":"确认导入","filterAll":"全部技能","filterFavorites":"收藏","filterByAgent":"按智能体过滤","search":"搜索技能...","empty":"暂无技能","manageAgents":"管理","apply":"应用","delete":"删除","editTitle":"编辑技能 - {name}","editDescription":"编辑技能 Markdown 内容","bindTitle":"绑定智能体 - {name}","bindDescription":"选择要绑定此技能的智能体","searchAgents":"搜索智能体...","syncToAgents":"更新到智能体","syncTitle":"同步技能到智能体","syncDescription":"以下智能体的技能文件已过时,勾选需要更新的项目","syncEmpty":"所有智能体的技能已是最新","syncConfirm":"确认更新","syncSuccess":"已更新 {count} 个技能文件"},"mcps":{"title":"MCP 服务器管理","description":"管理和导入 MCP 服务器配置,绑定到智能体","import":"导入","importTitle":"导入 MCP 配置","importConfirm":"确认导入","importInvalidJson":"JSON 格式无效","importFailed":"导入失败","filterAll":"全部","filterFavorites":"收藏","filterByAgent":"按智能体过滤","search":"搜索 MCP 服务器...","empty":"暂无 MCP 服务器配置","apply":"应用","delete":"删除","editTitle":"编辑 MCP - {name}","editDescription":"编辑 MCP 服务器配置(JSON)","bindTitle":"绑定智能体 - {name}","bindDescription":"选择要绑定此 MCP 服务器的智能体"}}')},556106,e=>{"use strict";var t=e.i(344180),o=e.i(764556),i=e.i(799543),a=e.i(972725);function s({locale:e,...o}){if(!e)throw Error(void 0);return(0,t.jsx)(a.IntlProvider,{locale:e,...o})}var n=e.i(171167),r=e.i(367640);let l="agent-spaces-locale",d={en:n.default,zh:r.default},c=(0,o.createContext)({locale:"zh",setLocale:()=>{}});function p(e){return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}function m(){let e=localStorage.getItem(l);return"en"===e||"zh"===e?e:"zh"}function g(){return"zh"}e.s(["LocaleProvider",0,function({children:e}){(0,i.useServerInsertedHTML)(()=>(0,t.jsx)("script",{dangerouslySetInnerHTML:{__html:`(function(){try{var l=localStorage.getItem('${l}');document.documentElement.lang=(l==='en')?'en':'zh-CN'}catch(e){}})()`}},"locale-init"));let a=(0,o.useSyncExternalStore)(p,m,g),n=(0,o.useCallback)(e=>{localStorage.setItem(l,e),document.documentElement.lang="zh"===e?"zh-CN":"en",window.dispatchEvent(new StorageEvent("storage",{key:l}))},[]);return(0,t.jsx)(c.Provider,{value:{locale:a,setLocale:n},children:(0,t.jsx)(s,{locale:a,messages:d[a],children:e})})},"useLocale",0,function(){return(0,o.useContext)(c)}],556106)},324216,e=>{"use strict";var t=e.i(344180),o=e.i(764556),i=e.i(465458),a=e.i(799773);let s={sm:"size-8 [&>svg]:size-3",md:"size-10 [&>svg]:size-4",lg:"size-12 [&>svg]:size-5"};e.s(["UserIcon",0,function({size:e="lg",className:n}){let[r,l]=(0,o.useState)(null);return(0,o.useEffect)(()=>{l(localStorage.getItem("userAvatarUrl"));let e=e=>{"userAvatarUrl"===e.key&&l(e.newValue)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[]),(0,t.jsx)("div",{className:(0,i.cn)("rounded-full overflow-hidden border border-input flex items-center justify-center shrink-0",s[e],r?"":"bg-muted",n),children:r?(0,t.jsx)("img",{src:r,alt:"User",className:"size-full object-cover"}):(0,t.jsx)(a.User,{className:"text-muted-foreground"})})}])},240455,858583,955886,e=>{"use strict";var t=e.i(433721);let o=(0,t.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,o],240455);let i=(0,t.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,i],858583);let a=(0,t.default)("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);e.s(["Languages",0,a],955886)},238300,e=>{"use strict";var t=e.i(344180),o=e.i(764556),i=e.i(799543),a=e.i(244073),s=e.i(233297),n=e.i(950396),r=e.i(556106),l=e.i(209988),d=e.i(260218),c=e.i(681622),p=e.i(465458),m=e.i(240455),g=e.i(858583),u=e.i(92457),h=e.i(955886),v=e.i(324216),f=e.i(437122);e.s(["SettingsDialog",0,function({open:e,onOpenChange:y,standalone:k}){let{theme:A,setTheme:C}=(0,n.useTheme)(),P=(0,a.useTranslations)("settings"),S=(0,a.useTranslations)("common"),{locale:b,setLocale:T}=(0,r.useLocale)(),w=(0,i.useRouter)(),[D,M]=(0,o.useState)(null),[x,I]=(0,o.useState)(""),[N,F]=(0,o.useState)(!1),R=[{value:"light",label:P("themeLight"),icon:m.Sun},{value:"dark",label:P("themeDark"),icon:g.Moon},{value:"system",label:P("themeSystem"),icon:u.Monitor}];(0,o.useEffect)(()=>{M(localStorage.getItem("userAvatarUrl"))},[e]);let j=async e=>{let t=e.target.files?.[0];if(!t)return;let o=new FileReader;o.onload=async()=>{try{let e=await fetch("/api/upload/avatar",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUrl:o.result,filename:"user.jpg"})}),t=await e.json();t.url&&(localStorage.setItem("userAvatarUrl",t.url),M(t.url))}catch{}},o.readAsDataURL(t),e.target.value=""},L=async()=>{let e=(0,f.getToken)();try{(await fetch("/api/auth/change-secret",{method:"POST",headers:{"Content-Type":"application/json",...null!==e?{Authorization:`Bearer ${e}`}:{}},body:JSON.stringify({newSecret:x,currentToken:e})})).ok&&(F(!0),(0,f.removeToken)(),setTimeout(()=>(0,s.tauriNavigate)(w,"/login"),800))}catch{}},U=(0,t.jsxs)("div",{className:"p-5 flex flex-col gap-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2.5 block",children:P("userAvatar")}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(v.UserIcon,{size:"lg"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("label",{className:"text-xs text-primary cursor-pointer hover:underline",children:[S("upload"),(0,t.jsx)("input",{type:"file",accept:"image/*",className:"hidden",onChange:j})]}),D&&(0,t.jsx)("button",{type:"button",className:"text-xs text-destructive hover:underline",onClick:()=>{localStorage.removeItem("userAvatarUrl"),M(null)},children:S("remove")})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2.5 block",children:P("theme")}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",children:R.map(({value:e,label:o,icon:i})=>(0,t.jsxs)("button",{type:"button",onClick:()=>C(e),className:(0,p.cn)("flex flex-col items-center gap-1.5 rounded-lg border p-3 text-sm transition-colors hover:bg-muted/50",A===e&&"border-primary bg-primary/5 text-primary"),children:[(0,t.jsx)(i,{className:"size-5"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:o})]},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2.5 block",children:P("language")}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[{value:"zh",label:P("languageZh")},{value:"en",label:P("languageEn")}].map(({value:e,label:o})=>(0,t.jsxs)("button",{type:"button",onClick:()=>T(e),className:(0,p.cn)("flex items-center justify-center gap-1.5 rounded-lg border p-3 text-sm transition-colors hover:bg-muted/50",b===e&&"border-primary bg-primary/5 text-primary"),children:[(0,t.jsx)(h.Languages,{className:"size-4"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:o})]},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2.5 block",children:P("security")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{type:"password",className:"h-8 text-sm flex-1",placeholder:P("newSecretPlaceholder"),value:x,onChange:e=>{I(e.target.value),F(!1)},onKeyDown:e=>"Enter"===e.key&&e.preventDefault()}),(0,t.jsx)(d.Button,{size:"sm",onClick:L,disabled:N,children:S(N?"saved":"save")})]}),N&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:P("redirecting")})]})]});return k?U:(0,t.jsx)(l.Dialog,{open:e,onOpenChange:y,children:(0,t.jsxs)(l.DialogContent,{className:"sm:max-w-md p-0 gap-0",children:[(0,t.jsxs)(l.DialogHeader,{className:"px-5 py-4 border-b",children:[(0,t.jsx)(l.DialogTitle,{className:"text-base",children:P("title")}),(0,t.jsx)(l.DialogDescription,{className:"text-xs",children:P("description")})]}),U]})})}])}]);
|