pikiclaw 0.3.37 → 0.3.38
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/dashboard/dist/assets/AgentTab-BkZnuKaS.js +1 -0
- package/dashboard/dist/assets/{BrandIcon-DuvssI5P.js → BrandIcon-AD156ArP.js} +1 -1
- package/dashboard/dist/assets/{DirBrowser-CfaNqvEe.js → DirBrowser-BwzrHjjR.js} +1 -1
- package/dashboard/dist/assets/{ExtensionsTab-BXEctSc6.js → ExtensionsTab-BwH0CaMy.js} +1 -1
- package/dashboard/dist/assets/{IMAccessTab-DM1rsj-u.js → IMAccessTab-_0gPo7VO.js} +1 -1
- package/dashboard/dist/assets/{Modal-DHVhz66H.js → Modal-CdInMPb1.js} +1 -1
- package/dashboard/dist/assets/{Modals-Dhxu3hSi.js → Modals-DbI2X4wo.js} +1 -1
- package/dashboard/dist/assets/{Select-lWGnI7Cq.js → Select-BE8Z-HNs.js} +1 -1
- package/dashboard/dist/assets/SessionPanel-DUq59l08.js +1 -0
- package/dashboard/dist/assets/SystemTab-Bfw4XWnc.js +1 -0
- package/dashboard/dist/assets/index-5bbMY2wM.js +16 -0
- package/dashboard/dist/assets/index-BP_D94Yk.css +1 -0
- package/dashboard/dist/assets/index-C2q8FWKH.js +5 -0
- package/dashboard/dist/assets/router-Cav8lq-m.js +3 -0
- package/dashboard/dist/assets/{shared-DKIT06du.js → shared-DFRcspIO.js} +1 -1
- package/dashboard/dist/index.html +3 -3
- package/dist/agent/drivers/claude.js +11 -15
- package/dist/agent/drivers/gemini.js +3 -3
- package/dist/agent/index.js +1 -1
- package/dist/agent/mcp/bridge.js +195 -9
- package/dist/agent/mcp/session-server.js +9 -5
- package/dist/agent/mcp/tools/ask-user.js +113 -0
- package/dist/agent/session.js +13 -0
- package/dist/agent/stream.js +28 -8
- package/dist/agent/utils.js +24 -0
- package/dist/bot/bot.js +114 -36
- package/dist/browser-profile.js +42 -0
- package/dist/browser-supervisor.js +79 -11
- package/dist/catalog/local-models.js +112 -0
- package/dist/channels/weixin/bot.js +413 -79
- package/dist/cli/autostart.js +226 -0
- package/dist/cli/main.js +19 -1
- package/dist/core/platform.js +9 -4
- package/dist/dashboard/routes/local-models.js +276 -0
- package/dist/dashboard/routes/sessions.js +18 -1
- package/dist/dashboard/server.js +2 -0
- package/dist/dashboard/session-control.js +14 -0
- package/package.json +1 -1
- package/dashboard/dist/assets/AgentTab-B0k6567P.js +0 -1
- package/dashboard/dist/assets/PermissionsTab-B-KiKU8D.js +0 -1
- package/dashboard/dist/assets/SessionPanel-DL2E4VnO.js +0 -1
- package/dashboard/dist/assets/SystemTab-B6NbPTbB.js +0 -1
- package/dashboard/dist/assets/index-BWqrPOhO.js +0 -16
- package/dashboard/dist/assets/index-CmjPBA1x.js +0 -3
- package/dashboard/dist/assets/index-DgLQyCkc.css +0 -1
- package/dashboard/dist/assets/router-emLofBBH.js +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,j as e,b as Ae}from"./react-vendor-DTcmqLiz.js";import{c as W,u as G,k as F,g as ee,a as Y,B as K,S as J,b as ye,E as me}from"./index-C2q8FWKH.js";import{B as ne}from"./BrandIcon-AD156ArP.js";import{M as je,a as we,L as B,I as X}from"./Modal-CdInMPb1.js";import{S as se}from"./Select-BE8Z-HNs.js";import{A as Ie,S as pe}from"./shared-DFRcspIO.js";import"./router-Cav8lq-m.js";function he(t,a){return!!(t&&a instanceof Node&&t.contains(a))}function Ee(t,a){if(a.length===0)return!0;const l=`${t.label} ${t.description||""} ${t.meta||""}`.toLowerCase();return a.every(n=>l.includes(n))}function Le({value:t,options:a,onChange:l,className:n,placeholder:i="—",disabled:f=!1,searchPlaceholder:u="Search models...",noMatchesText:j="No matches",currentLabel:o="Current"}){const d=a.find(N=>N.value===t),x=a.length<=1,[v,M]=s.useState(!1),[E,k]=s.useState(""),[I,A]=s.useState(null),R=s.useRef(null),m=s.useRef(null),r=s.useRef(null);s.useEffect(()=>{if(!v)return;const N=c=>{he(R.current,c.target)||he(m.current,c.target)||M(!1)},P=c=>{c.key==="Escape"&&M(!1)};return document.addEventListener("mousedown",N),document.addEventListener("keydown",P),()=>{document.removeEventListener("mousedown",N),document.removeEventListener("keydown",P)}},[v]),s.useEffect(()=>{v||k("")},[v]),s.useEffect(()=>{if(v){const N=window.setTimeout(()=>r.current?.focus(),0);return()=>window.clearTimeout(N)}},[v]),s.useLayoutEffect(()=>{if(!v)return;const N=()=>{const P=R.current;if(!P)return;const c=P.getBoundingClientRect(),L=window.innerHeight-c.bottom-12,O=c.top-12,S=L<280&&O>L,H=Math.max(220,Math.min(360,S?O:L));A({left:c.left,top:S?Math.max(12,c.top-H-8):c.bottom+8,width:c.width,maxHeight:H})};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[v]);const y=s.useMemo(()=>E.trim().toLowerCase().split(/\s+/).filter(Boolean),[E]),C=s.useMemo(()=>a.filter(N=>N.value!==t&&Ee(N,y)),[a,t,y]);if(x)return e.jsx("div",{className:W("flex h-9 w-full items-center rounded-md border border-edge bg-panel-alt px-3 text-[13px] text-fg-5 shadow-none",f&&"cursor-not-allowed",n),children:e.jsx("span",{className:W("truncate",!d&&"text-fg-6"),children:d?.label||i})});const T=N=>{f||(l(N),M(!1))},_=(N,P)=>e.jsxs("button",{type:"button",role:"option","aria-selected":P,onClick:()=>T(N.value),className:W("flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left text-[13px] transition-colors duration-200",P?"bg-panel text-fg shadow-[inset_0_1px_0_rgba(255,255,255,0.03)]":"text-fg-3 hover:bg-panel-alt hover:text-fg-2"),children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:N.label}),N.meta&&e.jsx("span",{className:"shrink-0 font-mono text-[10px] text-fg-5",children:N.meta})]})}),P&&e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"mt-0.5 shrink-0 text-fg-4",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})]},N.value),V=v&&I?Ae.createPortal(e.jsxs("div",{ref:m,role:"listbox",className:"fixed z-[220] flex flex-col overflow-hidden rounded-xl border border-edge-h bg-[var(--th-dropdown)] p-1.5 shadow-[0_24px_64px_rgba(2,6,23,0.22)] backdrop-blur-xl",style:{left:I.left,top:I.top,width:I.width,maxHeight:I.maxHeight},children:[e.jsxs("div",{className:"relative px-1.5 pt-1 pb-2",children:[e.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-3.5 flex items-center text-fg-5",children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),e.jsx("input",{ref:r,type:"text",value:E,onChange:N=>k(N.target.value),placeholder:u,spellCheck:!1,autoComplete:"off",className:W("h-8 w-full rounded-md border border-control-border bg-control pl-7 pr-2 text-[12px] text-fg shadow-sm","transition-[border-color,box-shadow,background] duration-200 outline-none","placeholder:text-fg-5","focus:border-control-border-h focus:bg-control-h focus:shadow-[0_0_0_4px_var(--th-glow-a)]")})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[d&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-5",children:o}),_(d,!0),e.jsx("div",{className:"my-1.5 border-t border-edge"})]}),C.length>0?C.map(N=>_(N,!1)):e.jsx("div",{className:"px-3 py-3 text-center text-[12px] text-fg-5",children:j})]})]}),document.body):null;return e.jsxs("div",{ref:R,className:W("relative",n),children:[e.jsxs("button",{type:"button",disabled:f,"aria-haspopup":"listbox","aria-expanded":v,onClick:()=>M(N=>!N),className:W("flex h-9 w-full items-center rounded-md border border-control-border bg-control px-3 pr-8 text-left text-[13px] text-fg shadow-sm","transition-[border-color,box-shadow,background] duration-200 outline-none","hover:border-control-border-h hover:bg-control-h","focus-visible:border-control-border-h focus-visible:shadow-[0_0_0_4px_var(--th-glow-a)]","disabled:cursor-not-allowed disabled:bg-panel-alt disabled:border-edge disabled:text-fg-5","disabled:shadow-none disabled:hover:border-edge disabled:hover:bg-panel-alt",v&&"border-control-border-h bg-control-h shadow-[0_0_0_4px_var(--th-glow-a)]"),children:[e.jsx("span",{className:W("min-w-0 flex-1 truncate",!d&&"text-fg-5"),children:d?.label||i}),e.jsx("span",{className:W("pointer-events-none absolute inset-y-0 right-3 flex items-center text-fg-4 transition-transform duration-200",v&&"rotate-180"),children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),V]})}const re=[{id:"openrouter",kind:"openai-compatible",name:{zh:"OpenRouter",en:"OpenRouter"},blurb:{zh:"一个 key 通行 300+ 模型",en:"One key, 300+ models"},baseURL:"https://openrouter.ai/api/v1",envVar:"OPENROUTER_API_KEY",defaultModel:"anthropic/claude-sonnet-4"},{id:"qwen",kind:"openai-compatible",name:{zh:"通义千问 Qwen",en:"Alibaba Qwen"},blurb:{zh:"阿里云 DashScope",en:"Alibaba DashScope"},baseURL:"https://dashscope.aliyuncs.com/compatible-mode/v1",envVar:"DASHSCOPE_API_KEY",defaultModel:"qwen3-max"},{id:"doubao",kind:"openai-compatible",name:{zh:"豆包 Seed",en:"Doubao Seed"},blurb:{zh:"字节跳动 · 火山方舟",en:"ByteDance Volcengine Ark"},baseURL:"https://ark.cn-beijing.volces.com/api/v3",envVar:"ARK_API_KEY",defaultModel:"doubao-seed-1-6-250615"},{id:"glm",kind:"openai-compatible",name:{zh:"智谱 GLM",en:"Zhipu GLM"},blurb:{zh:"GLM-4.6 / Z.AI",en:"GLM-4.6 / Z.AI"},baseURL:"https://open.bigmodel.cn/api/paas/v4",envVar:"ZAI_API_KEY",defaultModel:"glm-4.6"},{id:"minimax",kind:"openai-compatible",name:{zh:"MiniMax",en:"MiniMax"},blurb:{zh:"M2 / abab",en:"M2 / abab"},baseURL:"https://api.minimax.chat/v1",envVar:"MINIMAX_API_KEY",defaultModel:"MiniMax-M2"},{id:"deepseek",kind:"openai-compatible",name:{zh:"DeepSeek",en:"DeepSeek"},blurb:{zh:"深度求索官方 API",en:"DeepSeek official API"},baseURL:"https://api.deepseek.com",envVar:"DEEPSEEK_API_KEY",defaultModel:"deepseek-chat"},{id:"anthropic",kind:"anthropic",name:{zh:"Anthropic 直连",en:"Anthropic Direct"},blurb:{zh:"Claude 官方 API",en:"Official Claude API"},baseURL:"https://api.anthropic.com",envVar:"ANTHROPIC_API_KEY",defaultModel:"claude-sonnet-4-5"},{id:"google",kind:"google",name:{zh:"Google AI Studio",en:"Google AI Studio"},blurb:{zh:"Gemini 官方 API",en:"Official Gemini API"},baseURL:"https://generativelanguage.googleapis.com/v1beta",envVar:"GEMINI_API_KEY",defaultModel:"gemini-2.5-pro"},{id:"openai",kind:"openai",name:{zh:"OpenAI 直连",en:"OpenAI Direct"},blurb:{zh:"gpt-5 / o-系列",en:"gpt-5 / o-series"},baseURL:"https://api.openai.com/v1",envVar:"OPENAI_API_KEY",defaultModel:"gpt-5"},{id:"custom",kind:"openai-compatible",name:{zh:"自定义端点",en:"Custom"},blurb:{zh:"其他 OpenAI 兼容端点",en:"Other OpenAI-compatible endpoint"},baseURL:"",envVar:""}];function Se(t){return t==="zh-CN"?{sectionTitle:"模型供应商",sectionHint:"连接你自己的模型供应商,凭据加密存入系统 Keychain,可绑定到任意一个智能体。",addLabel:"接入新供应商",validate:"校验",validating:"校验中",edit:"编辑",remove:"删除",removeConfirm:"删除该供应商?已绑定的智能体会自动恢复为官方 Auth。",unbound:"尚未被任何智能体使用",modalAddTitle:"接入模型供应商",modalAddHint:a=>a?`已套用 ${a} 模板,仅需粘贴 API Key。`:"填入端点和凭据,保存后即可在智能体卡片上选用。",modalEditTitle:"编辑供应商配置",modalEditHint:"修改端点、凭据或模型参数。修改凭据会清空已校验状态。",fieldName:"配置名称",fieldNamePlaceholder:"例如:OpenRouter · 个人",fieldKind:"API 类型",fieldBaseURL:"Base URL",fieldCredentialSource:"凭据来源",fieldApiKey:"API Key",fieldApiKeyHint:"通过 @napi-rs/keyring 写入系统 Keychain,setting.json 仅保存引用。",fieldEnvVar:"环境变量名",fieldCommand:"获取命令(执行结果作为 key)",fieldModelId:"模型 ID",fieldEffort:"推理强度",fieldEffortHelp:"可用范围由模型决定,留空表示沿用模型默认值。",effortHermesNote:"Hermes 当前从 ~/.hermes/config.yaml 读取推理强度,Profile 上的 effort 暂仅做记录。",credPaste:"粘贴 API Key(推荐,写入系统 Keychain)",credEnv:"从环境变量读取",credCommand:"运行命令获取(1Password / pass / gh 等)",effortDefault:"(沿用默认)",cancel:"取消",save:"保存",saving:"保存中",validationReady:"已就绪",validationInvalid:"凭据无效",validationError:"网络/服务错误",validationUnvalidated:"未校验",providerOnlyHint:"保存后回到智能体卡片,点击「BYOK」选择具体的模型与推理强度。",credentialLabel:"凭据",modelsAvailable:a=>`可用 ${a} 个模型`}:{sectionTitle:"Model Providers",sectionHint:"Connect your own model providers. Keys are encrypted in the OS keychain and can be bound to any agent.",addLabel:"Add provider",validate:"Validate",validating:"Validating",edit:"Edit",remove:"Remove",removeConfirm:"Remove this provider? Bound agents will fall back to native auth.",unbound:"Not used by any agent yet",modalAddTitle:"Connect Model Provider",modalAddHint:a=>a?`Pre-filled from the ${a} template — just paste your API key.`:"Enter endpoint and credential. After saving, choose models on the agent cards above.",modalEditTitle:"Edit Provider",modalEditHint:"Update the endpoint, credential, or model. Changing the credential clears the validated state.",fieldName:"Display name",fieldNamePlaceholder:"e.g. OpenRouter · Personal",fieldKind:"API kind",fieldBaseURL:"Base URL",fieldCredentialSource:"Credential source",fieldApiKey:"API key",fieldApiKeyHint:"Stored in the OS keychain via @napi-rs/keyring; setting.json keeps only a reference.",fieldEnvVar:"Environment variable name",fieldCommand:"Command (stdout becomes the key)",fieldModelId:"Model ID",fieldEffort:"Reasoning effort",fieldEffortHelp:"Available values depend on the chosen model; leave blank to use the default.",effortHermesNote:"Hermes currently reads reasoning_effort from ~/.hermes/config.yaml; Profile.effort is recorded only for now.",credPaste:"Paste API key (recommended — stored in OS keychain)",credEnv:"Read from environment variable",credCommand:"Run a command (1Password / pass / gh, …)",effortDefault:"(default)",cancel:"Cancel",save:"Save",saving:"Saving",validationReady:"Ready",validationInvalid:"Invalid",validationError:"Error",validationUnvalidated:"Not validated",providerOnlyHint:'After saving, head back to an agent card and click "BYOK" to choose the model and effort.',credentialLabel:"Credential",modelsAvailable:a=>`${a} models available`}}const de={anthropic:{zh:"Anthropic 原生",en:"Anthropic native"},openai:{zh:"OpenAI 原生",en:"OpenAI native"},"openai-compatible":{zh:"OpenAI 兼容",en:"OpenAI-compatible"},google:{zh:"Google AI Studio",en:"Google AI Studio"}};function xe(t,a){return a==="zh-CN"?de[t].zh:de[t].en}async function oe(t){return(await fetch(t)).json()}async function ae(t,a,l){return(await fetch(a,{method:t,headers:{"Content-Type":"application/json"},body:l?JSON.stringify(l):void 0})).json()}function Ne(t){const a=(()=>{try{return new URL(t.baseURL).host.toLowerCase()}catch{return""}})();return a.includes("openrouter")?"openrouter":a.includes("anthropic")?"anthropic":a.includes("deepseek")?"deepseek":a.includes("googleapis")||a.includes("vertex")?"google":a.includes("openai.com")?"openai":a.includes("dashscope")||a.includes("qwen")||a.includes("aliyun")?"qwen":a.includes("volces")||a.includes("volcengine")||a.includes("doubao")?"doubao":a.includes("bigmodel")||a.includes("zhipu")||a.includes("z.ai")?"glm":a.includes("minimax")?"minimax":t.kind==="anthropic"?"anthropic":t.kind==="google"?"google":t.kind==="openai"?"openai":"custom"}function Pe({v:t,copy:a}){if(!t||t.state==="unknown")return e.jsx(F,{variant:"muted",children:a.validationUnvalidated});if(t.state==="ready"){const l=t.modelCount?` · ${a.modelsAvailable(t.modelCount)}`:"";return e.jsxs(F,{variant:"ok",children:[a.validationReady,l]})}return t.state==="invalid"?e.jsx(F,{variant:"err",children:a.validationInvalid}):e.jsx(F,{variant:"warn",children:a.validationError})}function Re({template:t,locale:a,onPick:l}){const n=a==="zh-CN"?t.name.zh:t.name.en,i=a==="zh-CN"?t.blurb.zh:t.blurb.en;return e.jsxs("button",{type:"button",onClick:()=>l(t),className:"group relative flex flex-col items-start gap-2 rounded-md border border-edge bg-panel-alt px-3.5 py-3 text-left transition hover:border-edge-strong hover:bg-panel",children:[e.jsx(ne,{brand:t.id,size:28}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[13px] font-semibold tracking-tight text-fg group-hover:text-fg",children:n}),e.jsx("div",{className:"mt-0.5 text-[11px] leading-relaxed text-fg-5 line-clamp-2",children:i})]})]})}function ce(t,a){return{name:a==="zh-CN"?`${t.name.zh}`:`${t.name.en}`,kind:t.kind,baseURL:t.baseURL,credMode:"paste",apiKey:"",envVar:t.envVar||"API_KEY",cmdLine:"op read op://Personal/Provider/key"}}function Te({open:t,copy:a,locale:l,initial:n,initialTemplateName:i,existingProvider:f,onClose:u,onSaved:j}){const[o,d]=s.useState(()=>n||ce(re[0],l)),[x,v]=s.useState(!1),[M,E]=s.useState(null);s.useEffect(()=>{t&&(d(n||ce(re[0],l)),E(null))},[t,n,l]);const k=!!f,I=!!i||k,A=s.useCallback(async()=>{E(null),v(!0);try{const m=o.credMode==="env"?{source:"env",varName:o.envVar.trim()}:o.credMode==="command"?{source:"command",argv:o.cmdLine.trim().split(/\s+/).filter(Boolean)}:null;let r;if(k&&f){const C={name:o.name.trim()||f.name,baseURL:o.baseURL.trim()};o.credMode==="paste"&&o.apiKey?C.apiKey=o.apiKey:m&&(C.credentialRef=m);const T=await ae("PATCH",`/api/models/providers/${f.id}`,C);if(!T.ok){E(T.error||"Failed to update provider");return}r=f.id}else{const C={kind:o.kind,name:o.name.trim()||`${xe(o.kind,l)}`,baseURL:o.baseURL.trim()};o.credMode==="paste"?C.apiKey=o.apiKey:m&&(C.credentialRef=m);const T=await ae("POST","/api/models/providers",C);if(!T.ok||!T.provider){E(T.error||"Failed to create provider");return}r=T.provider.id}const y=await ae("POST",`/api/models/providers/${r}/validate`);if(j(),y.validation&&y.validation.state!=="ready"){E(`${a.validationInvalid}: ${y.validation.detail}`);return}u()}catch(m){E(m?.message||String(m))}finally{v(!1)}},[o,k,f,l,j,u,a.validationInvalid]),R=!x&&o.name.trim().length>0&&o.baseURL.trim().length>0&&(o.credMode!=="paste"||(k?!0:o.apiKey.length>0))&&(o.credMode!=="env"||o.envVar.trim().length>0)&&(o.credMode!=="command"||o.cmdLine.trim().length>0);return e.jsxs(je,{open:t,onClose:u,children:[e.jsx(we,{title:k?a.modalEditTitle:a.modalAddTitle,description:k?a.modalEditHint:a.modalAddHint(i||null),onClose:u}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(B,{children:a.fieldName}),e.jsx(X,{value:o.name,onChange:m=>d(r=>({...r,name:m.target.value})),placeholder:a.fieldNamePlaceholder})]}),I?e.jsxs("div",{children:[e.jsx(B,{children:a.fieldBaseURL}),e.jsx(X,{value:o.baseURL,onChange:m=>d(r=>({...r,baseURL:m.target.value})),placeholder:"https://…"})]}):e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(B,{children:a.fieldKind}),e.jsx(se,{value:o.kind,options:Object.keys(de).map(m=>({value:m,label:xe(m,l)})),onChange:m=>d(r=>({...r,kind:m}))})]}),e.jsxs("div",{children:[e.jsx(B,{children:a.fieldBaseURL}),e.jsx(X,{value:o.baseURL,onChange:m=>d(r=>({...r,baseURL:m.target.value})),placeholder:"https://…"})]})]}),e.jsxs("div",{children:[e.jsx(B,{children:a.fieldCredentialSource}),e.jsx(se,{value:o.credMode,options:[{value:"paste",label:a.credPaste},{value:"env",label:a.credEnv},{value:"command",label:a.credCommand}],onChange:m=>d(r=>({...r,credMode:m}))})]}),o.credMode==="paste"&&e.jsxs("div",{children:[e.jsx(B,{children:a.fieldApiKey}),e.jsx(X,{type:"password",value:o.apiKey,onChange:m=>d(r=>({...r,apiKey:m.target.value})),placeholder:k?"••••••••":"sk-…"}),e.jsx("div",{className:"mt-1 text-[11px] leading-relaxed text-fg-5",children:a.fieldApiKeyHint})]}),o.credMode==="env"&&e.jsxs("div",{children:[e.jsx(B,{children:a.fieldEnvVar}),e.jsx(X,{value:o.envVar,onChange:m=>d(r=>({...r,envVar:m.target.value})),placeholder:"OPENROUTER_API_KEY"})]}),o.credMode==="command"&&e.jsxs("div",{children:[e.jsx(B,{children:a.fieldCommand}),e.jsx(X,{value:o.cmdLine,onChange:m=>d(r=>({...r,cmdLine:m.target.value})),placeholder:"op read op://Personal/OpenRouter/key"})]}),M&&e.jsx("div",{className:"rounded-md border border-rose-700/40 bg-rose-900/20 px-3 py-2 text-xs text-rose-200",children:M})]}),e.jsx("div",{className:"mt-6 border-t border-edge pt-4",children:e.jsx(Ie,{primary:{label:x?a.saving:a.save,onClick:A,disabled:!R},secondary:{label:a.cancel,onClick:u}})})]})}function ke(){const[t,a]=s.useState([]),[l,n]=s.useState([]),[i,f]=s.useState({}),u=s.useCallback(async()=>{const[o,d,x]=await Promise.all([oe("/api/models/providers"),oe("/api/models/profiles"),oe("/api/models/agents")]);a(o.providers||[]),n(d.profiles||[]);const v={};for(const M of x.bindings||[])v[M.agent]=M.activeProfileId;f(v)},[]),j=s.useCallback(async(o,d)=>{await ae("POST",`/api/models/agents/${o}/active`,{profileId:d}),await u()},[u]);return s.useEffect(()=>{u()},[u]),{providers:t,profiles:l,bindings:i,reload:u,setActiveProfile:j}}function Oe({provider:t,copy:a,boundAgents:l,onEdit:n,onRemove:i}){const f=Ne(t);return e.jsx("div",{className:"glass rounded-md border border-edge px-4 py-3 shadow-[0_1px_0_rgba(255,255,255,0.02),0_4px_12px_rgba(15,23,42,0.05)]",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-edge bg-panel-alt",children:e.jsx(ne,{brand:f,size:22})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-[15px] font-semibold tracking-tight text-fg",children:t.name}),e.jsx(Pe,{v:t.validation,copy:a})]}),e.jsx("div",{className:"mt-1 truncate text-[11px] font-mono text-fg-5",title:t.baseURL,children:t.baseURL}),t.validation?.detail&&t.validation.state!=="ready"&&e.jsx("div",{className:"mt-1 text-[11px] leading-relaxed text-fg-4",children:t.validation.detail}),l.length>0?e.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:l.map(u=>{const j=ee(u);return e.jsxs("span",{className:"inline-flex h-5 items-center gap-1 rounded-full border border-edge bg-panel-alt px-2 text-[11px] text-fg-3",children:[e.jsx(ne,{brand:u,size:11}),e.jsx("span",{children:j.shortLabel})]},u)})}):e.jsx("div",{className:"mt-2 text-[11px] text-fg-5",children:a.unbound})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-3 self-start text-[12px]",children:[e.jsx("button",{type:"button",onClick:n,className:"text-fg-4 transition hover:text-fg-2",children:a.edit}),e.jsx("span",{className:"text-fg-6","aria-hidden":"true",children:"·"}),e.jsx("button",{type:"button",onClick:i,className:"text-fg-4 transition hover:text-[var(--th-err)]",children:a.remove})]})]})})}function De({snapshot:t}={}){const a=ke(),l=t??a,{providers:n,profiles:i,bindings:f,reload:u}=l,j=G(r=>r.locale),o=s.useMemo(()=>Se(j),[j]);G(r=>r.toast);const[d,x]=s.useState(null),v=s.useMemo(()=>{const r=new Map,y=new Map(i.map(C=>[C.id,C]));for(const[C,T]of Object.entries(f)){if(!T)continue;const _=y.get(T);_&&(r.has(_.providerId)||r.set(_.providerId,[]),r.get(_.providerId).push(C))}return r},[f,i]),M=s.useCallback(async r=>{confirm(o.removeConfirm)&&(await ae("DELETE",`/api/models/providers/${r.id}`),await u())},[o,u]),E=s.useMemo(()=>{if(!d||d.kind!=="edit")return null;const{provider:r}=d;return{name:r.name,kind:r.kind,baseURL:r.baseURL,credMode:"paste",apiKey:"",envVar:re.find(y=>y.kind===r.kind)?.envVar||"API_KEY",cmdLine:"op read op://Personal/Provider/key"}},[d]),k=s.useMemo(()=>!d||d.kind!=="add"?null:ce(d.template,j),[d,j]),I=d&&d.kind==="add"&&d.template.id!=="custom"?j==="zh-CN"?d.template.name.zh:d.template.name.en:null,A=s.useMemo(()=>{const r=new Map;for(const y of n){const C=Ne(y);r.has(C)||r.set(C,y)}return r},[n]),R=s.useCallback(r=>{if(r.id!=="custom"){const y=A.get(r.id);if(y){x({kind:"edit",provider:y});return}}x({kind:"add",template:r})},[A]),m=s.useMemo(()=>re.filter(r=>r.id==="custom"||!A.has(r.id)),[A]);return e.jsxs("div",{className:"space-y-3",children:[n.length>0&&e.jsx("div",{className:"space-y-2",children:n.map(r=>e.jsx(Oe,{provider:r,copy:o,locale:j,boundAgents:v.get(r.id)||[],onEdit:()=>x({kind:"edit",provider:r}),onRemove:()=>M(r)},r.id))}),m.length>0&&e.jsxs("div",{className:"space-y-1.5 pt-1",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.18em] text-fg-5",children:o.addLabel}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-5",children:m.map(r=>e.jsx(Re,{template:r,locale:j,onPick:R},r.id))})]}),d&&e.jsx(Te,{open:!0,copy:o,locale:j,initial:d.kind==="edit"?E:k,initialTemplateName:I,existingProvider:d.kind==="edit"?d.provider:void 0,onClose:()=>x(null),onSaved:u})]})}const _e=4;function Fe(t){return t==="zh-CN"?{sectionTitle:"本地模型",sectionHint:"在本机检测 Ollama / LM Studio,并按你的内存推荐合适的开源模型。已接入的本地服务会作为一个供应商,自动出现在上方智能体卡片的「供应商」下拉里。",hostLabel:"本机",hostUnknown:"检测中…",backendsLabel:"本地推理后端",detected:"已运行",notDetected:"未检测到",version:"版本",installedModels:a=>`已下载 ${a} 个模型`,connect:"接入到智能体",connecting:"接入中…",connected:"已接入",installPrompt:"未在本机检测到此后端,安装后启动即可使用。",installCta:"安装",homepageCta:"官网",catalogLabel:"为本机推荐的模型",fitOk:"推荐",fitTight:"勉强可跑",fitNoGo:"内存不足",installedBadge:"已安装",pullCta:"一键下载",pullCancel:"取消",pullStatusManifest:"获取清单…",pullStatusVerifying:"校验中…",pullStatusWriting:"写入中…",pullStatusDone:"下载完成",pullFailed:"下载失败",needsOllamaHint:"先启动 Ollama 即可一键下载",needsBackendForLmHint:a=>`LM Studio 没有 HTTP 拉取接口,请在终端执行 \`${a}\``,copyPullCmd:"复制命令",copied:"已复制",refresh:"刷新",refreshing:"刷新中…",loadFailed:"加载失败",toastConnected:"已接入,可在智能体卡片选择该供应商",toastAlreadyConnected:"此后端已接入",toastConnectFailed:"接入失败",toastPulled:"模型已下载到 Ollama"}:{sectionTitle:"Local Models",sectionHint:"Detect Ollama / LM Studio on this machine and surface coding models that fit your RAM. Connected backends appear as a regular provider in the agent cards above.",hostLabel:"This Mac",hostUnknown:"Detecting…",backendsLabel:"Local backends",detected:"Running",notDetected:"Not detected",version:"Version",installedModels:a=>`${a} models pulled`,connect:"Connect to agents",connecting:"Connecting…",connected:"Connected",installPrompt:"Not detected on this machine. Install and launch it to enable local models.",installCta:"Install",homepageCta:"Homepage",catalogLabel:"Recommended for your machine",fitOk:"Recommended",fitTight:"Tight fit",fitNoGo:"Not enough RAM",installedBadge:"Installed",pullCta:"Download",pullCancel:"Cancel",pullStatusManifest:"Fetching manifest…",pullStatusVerifying:"Verifying…",pullStatusWriting:"Writing manifest…",pullStatusDone:"Download complete",pullFailed:"Download failed",needsOllamaHint:"Start Ollama to enable one-click download",needsBackendForLmHint:a=>`LM Studio has no HTTP pull API; run \`${a}\` in a terminal instead`,copyPullCmd:"Copy command",copied:"Copied",refresh:"Refresh",refreshing:"Refreshing…",loadFailed:"Failed to load local backends",toastConnected:"Connected — pick it in any agent's Provider dropdown",toastAlreadyConnected:"Backend is already connected",toastConnectFailed:"Connect failed",toastPulled:"Model downloaded to Ollama"}}function Ce(t,a){return t===null?"tight":t>=a+_e?"ok":t>=a?"tight":"no-go"}function Ue(t,a){return a.lmstudioId?`lms get ${a.lmstudioId}`:null}function He(t){return!t||!Number.isFinite(t)?"—":`${(t/1024**3).toFixed(0)} GB`}const ge={status:"idle",fraction:null,phase:"",error:null};function ze(t,a){if(t.error)return{phase:t.error,fraction:null};const l=(t.status||"").toLowerCase();return l.startsWith("pulling manifest")?{phase:a.pullStatusManifest,fraction:null}:l.startsWith("verifying")?{phase:a.pullStatusVerifying,fraction:null}:l.startsWith("writing")?{phase:a.pullStatusWriting,fraction:null}:l==="success"?{phase:a.pullStatusDone,fraction:1}:l.startsWith("downloading")&&typeof t.total=="number"&&typeof t.completed=="number"&&t.total>0?{phase:`${Math.round(t.completed/t.total*100)}%`,fraction:t.completed/t.total}:{phase:t.status||"",fraction:null}}function $e({backend:t,copy:a,busy:l,onConnect:n}){const i=!!t.existingProviderId;return e.jsx("div",{className:"glass rounded-md border border-edge px-4 py-3 shadow-[0_1px_0_rgba(255,255,255,0.02),0_4px_12px_rgba(15,23,42,0.05)]",children:e.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-edge bg-panel-alt",children:e.jsx(ne,{brand:t.id,size:22})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-[15px] font-semibold text-fg",children:t.label}),t.detected?e.jsx(F,{variant:"ok",children:a.detected}):e.jsx(F,{variant:"muted",children:a.notDetected}),i&&e.jsx(F,{variant:"accent",children:a.connected})]}),e.jsx("div",{className:"mt-1 text-[12px] leading-relaxed text-fg-5",children:t.detected?e.jsxs(e.Fragment,{children:[t.version&&e.jsxs(e.Fragment,{children:[a.version," ",t.version," · "]}),a.installedModels(t.models.length)," · ",e.jsx("span",{className:"font-mono",children:t.baseURL})]}):e.jsx("span",{children:a.installPrompt})})]})]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1.5",children:[t.detected&&!i&&e.jsx(K,{variant:"primary",size:"sm",disabled:l,onClick:()=>n(t),children:l?a.connecting:a.connect}),!t.detected&&e.jsxs("div",{className:"flex items-center gap-2",children:[t.installHint.brewFormula&&e.jsxs("code",{className:"rounded-md border border-edge bg-panel-alt px-2 py-1 text-[11px] text-fg-3",children:["brew install ",t.installHint.brewFormula]}),e.jsx("a",{href:t.installHint.homepage,target:"_blank",rel:"noreferrer",className:"text-[12px] text-accent underline-offset-2 hover:underline",children:t.installHint.brewFormula?a.homepageCta:a.installCta})]})]})]})})}function Be({entry:t,totalRamGb:a,detectedBackends:l,pull:n,copy:i,locale:f,onStartPull:u,onCancelPull:j,onCopyHint:o}){const d=Ce(a,t.minRamGb),x=l.some(I=>I.id==="ollama"&&I.detected),v=l.some(I=>I.id==="lmstudio"&&I.detected),M=t.lmstudioId?Ue("lmstudio",t):null,E=f==="zh-CN"?t.descriptionZh:t.description;let k="none";return!t.installed&&d!=="no-go"&&(x&&t.ollamaTag?k="pull":v&&M?k="lm-copy":!x&&!v&&(t.ollamaTag||M)&&(k="wait")),e.jsx("div",{className:"rounded-md border border-edge bg-panel-alt px-3.5 py-3",children:e.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-[13px] font-semibold text-fg",children:t.name}),e.jsx("span",{className:"text-[11px] text-fg-5",children:t.publisher}),d==="ok"&&e.jsx(F,{variant:"ok",children:i.fitOk}),d==="tight"&&e.jsx(F,{variant:"warn",children:i.fitTight}),d==="no-go"&&e.jsx(F,{variant:"err",children:i.fitNoGo}),t.installed&&e.jsx(F,{variant:"accent",children:i.installedBadge})]}),e.jsx("div",{className:"mt-1 text-[12px] leading-relaxed text-fg-4",children:E}),e.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-x-3 gap-y-0.5 text-[11px] text-fg-5",children:[e.jsxs("span",{children:[t.paramsB,"B params"]}),e.jsxs("span",{children:[t.sizeGb," GB on disk"]}),e.jsxs("span",{children:["≥ ",t.minRamGb," GB RAM"]}),t.homepage&&e.jsx("a",{href:t.homepage,target:"_blank",rel:"noreferrer",className:"text-accent underline-offset-2 hover:underline",children:f==="zh-CN"?"模型主页":"Model card"})]}),(n.status==="running"||n.status==="error")&&e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-fg-4",children:[e.jsx("span",{children:n.status==="error"?`${i.pullFailed}: ${n.error}`:n.phase}),n.status==="running"&&e.jsx("button",{type:"button",onClick:()=>j(t),className:"text-[11px] text-fg-5 underline-offset-2 hover:text-fg-3 hover:underline",children:i.pullCancel})]}),e.jsx("div",{className:"mt-1 h-1 w-full overflow-hidden rounded-full bg-panel",children:e.jsx("div",{className:n.status==="error"?"h-full bg-rose-500/70":"h-full bg-accent",style:{width:n.fraction!==null?`${Math.max(2,Math.round(n.fraction*100))}%`:"12%",transition:"width 200ms linear",animation:n.fraction===null&&n.status==="running"?"pulse 1.6s ease-in-out infinite":void 0}})})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2 self-start",children:[k==="pull"&&e.jsx(K,{variant:"primary",size:"sm",disabled:n.status==="running",onClick:()=>u(t),children:n.status==="running"?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-3 w-3"})," ",n.phase||i.pullCta]}):i.pullCta}),k==="lm-copy"&&M&&e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"rounded-md border border-edge bg-panel px-2 py-1 font-mono text-[11px] text-fg-3",children:M}),e.jsx("button",{type:"button",onClick:()=>o(M),className:"text-[12px] text-accent underline-offset-2 hover:underline",children:i.copyPullCmd})]}),k==="wait"&&e.jsx("span",{className:"text-[11px] text-fg-5",children:i.needsOllamaHint})]})]})})}function Ke({onConnected:t}){const a=G(c=>c.locale),l=G(c=>c.toast),n=G(c=>c.host),i=s.useMemo(()=>Fe(a),[a]),[f,u]=s.useState([]),[j,o]=s.useState([]),[d,x]=s.useState(!0),[v,M]=s.useState(null),[E,k]=s.useState(null),[I,A]=s.useState({}),R=s.useRef({}),m=s.useCallback(async()=>{x(!0),M(null);try{const c=await Y.probeLocalModels();if(!c.ok)throw new Error(c.error||i.loadFailed);u(c.backends||[]),o(c.catalog||[])}catch(c){M(c?.message||String(c))}finally{x(!1)}},[i.loadFailed]);s.useEffect(()=>{m()},[m]);const r=s.useCallback(async c=>{k(c.id);try{const w=await Y.connectLocalBackend(c.id);if(!w.ok)throw new Error(w.error||i.toastConnectFailed);l(w.alreadyConnected?i.toastAlreadyConnected:i.toastConnected),await m(),t&&await t()}catch(w){l(`${i.toastConnectFailed}: ${w?.message||String(w)}`,!1)}finally{k(null)}},[i,t,m,l]),y=s.useCallback(c=>{navigator.clipboard?.writeText(c),l(i.copied)},[i.copied,l]),C=s.useCallback((c,w)=>{A(L=>({...L,[c]:{...L[c]??ge,...w}}))},[]),T=s.useCallback(async c=>{if(!c.ollamaTag)return;const w=c.id;C(w,{status:"running",fraction:null,phase:i.pullStatusManifest,error:null});const L=Y.pullLocalModel("ollama",c.ollamaTag);R.current[w]=L.cancel;let O=!1;try{for await(const S of L.events){if(S.error)throw new Error(S.error);const{phase:H,fraction:g}=ze(S,i);C(w,{phase:H,fraction:g??null}),S.status==="success"&&(O=!0)}if(O){C(w,{status:"done",fraction:1,phase:i.pullStatusDone,error:null}),l(i.toastPulled),await m();const S=f.find(H=>H.id==="ollama");if(S&&!S.existingProviderId)try{await Y.connectLocalBackend("ollama"),await m()}catch{}t&&await t()}else C(w,{status:"error",error:i.pullFailed,fraction:null})}catch(S){const H=S?.name==="AbortError"?i.pullCancel:S?.message||String(S);C(w,{status:"error",error:H,fraction:null})}finally{delete R.current[w]}},[f,i,t,m,l,C]),_=s.useCallback(c=>{const w=R.current[c.id];w&&w()},[]);s.useEffect(()=>()=>{for(const c of Object.values(R.current))try{c()}catch{}},[]);const V=n?.totalMem?n.totalMem/1024**3:null,N=n?`${n.cpuModel||n.arch} · ${He(n.totalMem)} RAM`:i.hostUnknown,P=s.useMemo(()=>{const c=L=>{const O=Ce(V,L.minRamGb);return O==="ok"?0:O==="tight"?1:2},w=L=>L.installed?0:1;return[...j].sort((L,O)=>{const S=c(L),H=c(O);return S!==H?S-H:w(L)-w(O)})},[j,V]);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"text-[12px] text-fg-5",children:[e.jsx("span",{className:"font-semibold uppercase tracking-[0.14em] text-fg-5",children:i.hostLabel}),e.jsx("span",{className:"mx-2 text-fg-6",children:"·"}),e.jsx("span",{className:"text-fg-3",children:N})]}),e.jsx(K,{variant:"ghost",size:"sm",onClick:()=>{m()},disabled:d,children:d?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-3 w-3"})," ",i.refreshing]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",children:"↻"})," ",i.refresh]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.18em] text-fg-5",children:i.backendsLabel}),d&&f.length===0?e.jsxs("div",{className:"rounded-md border border-edge bg-panel-alt px-4 py-6 text-center text-[12px] text-fg-5",children:[e.jsx(J,{className:"mr-2 inline-block h-3 w-3"}),i.refreshing]}):f.map(c=>e.jsx($e,{backend:c,copy:i,busy:E===c.id,onConnect:r},c.id)),v&&e.jsx("div",{className:"rounded-md border border-rose-700/40 bg-rose-900/20 px-3 py-2 text-xs text-rose-200",children:v})]}),P.length>0&&e.jsxs("div",{className:"space-y-2 pt-1",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.18em] text-fg-5",children:i.catalogLabel}),P.map(c=>e.jsx(Be,{entry:c,totalRamGb:V,detectedBackends:f,pull:I[c.id]??ge,copy:i,locale:a,onStartPull:T,onCancelPull:_,onCopyHint:y},c.id))]})]})}const ie="__native__",Ve=["claude","codex","gemini","hermes"];function ve(t){return t===void 0||!Number.isFinite(t)?null:t===0?"$0":t<.01?`$${t.toFixed(4)}`:t<1?`$${t.toFixed(3)}`:t<10?`$${t.toFixed(2)}`:`$${t.toFixed(1)}`}function Ge(t){return!t||!Number.isFinite(t)?null:t>=1e6?`${Math.round(t/1e5)/10}M ctx`:t>=1e3?`${Math.round(t/1e3)}K ctx`:`${t} ctx`}function Ye(t){if(!t||!Number.isFinite(t))return null;const a=t>32e9?t:t*1e3,l=new Date(a);return Number.isNaN(l.getTime())?null:l.toLocaleDateString(void 0,{year:"numeric",month:"short"})}function We(t){const a=t.id,l=[],n=t.name?.trim();n&&n.toLowerCase()!==t.id.toLowerCase()&&l.push(n);const i=ve(t.pricePromptUsd),f=ve(t.priceCompletionUsd);i&&f?l.push(`${i} / ${f} per 1M`):i&&l.push(`${i} prompt / 1M`);const u=Ge(t.contextLength);u&&l.push(u);const j=Ye(t.created);return j&&l.push(j),{label:a,description:l.length?l.join(" · "):void 0}}function qe(t){return t==="hermes"}function Ze(t){const a=(()=>{try{return new URL(t.baseURL).host.toLowerCase()}catch{return""}})();return a.includes("openrouter")?"openrouter":a.includes("anthropic")?"anthropic":a.includes("deepseek")?"deepseek":a.includes("googleapis")||a.includes("vertex")?"google":a.includes("openai.com")?"openai":a.includes("dashscope")||a.includes("qwen")||a.includes("aliyun")?"qwen":a.includes("volces")||a.includes("volcengine")||a.includes("doubao")?"doubao":a.includes("bigmodel")||a.includes("zhipu")||a.includes("z.ai")?"glm":a.includes("minimax")?"minimax":t.kind==="anthropic"?"anthropic":t.kind==="google"?"google":t.kind==="openai"?"openai":"custom"}function Qe(t,a){const l=t.bindings[a];if(!l)return null;const n=t.profiles.find(f=>f.id===l);if(!n)return null;const i=t.providers.find(f=>f.id===n.providerId);return i?{profileId:n.id,providerId:i.id,providerName:i.name,providerBrand:Ze(i),modelId:n.modelId,effort:n.effort||null}:null}function Je(t){return t==="zh-CN"?{defaultsTitle:"新会话默认值",defaultsHint:"决定新建对话默认走哪个智能体。具体模型与推理强度由该智能体卡片下的「供应商 / 模型 / 推理强度」决定。",defaultsEditTitle:"修改默认智能体",defaultsEditHint:"选择新建对话默认走哪个智能体。",defaultsSaved:"默认智能体已更新",editDefaults:"修改默认",agentsTitle:"可用智能体",defaultAgent:"默认智能体",installLabel:"安装状态",versionLabel:"版本",defaultBadge:"默认",installed:"已安装",notInstalled:"未安装",notInstalledHint:"安装该智能体的本地 CLI 后即可在此配置供应商与模型。",noModel:"未设置",noVersion:"版本未知",loadFailed:"无法加载智能体状态",updateAvailable:"有新版本",updateSkipped:"自动更新已跳过",updateFailed:"自动更新失败",update:"升级",updating:"升级中…",checkUpdate:"检查更新",checking:"检查中…",upToDate:"已是最新",install:"安装",installing:"安装中…",modelsTitle:"模型供应商",modelsHint:"接入 BYOK 供应商;接入后可在上方任一智能体卡片的「供应商」下拉中选用。",localTitle:"本地模型",localHint:"在本机检测 Ollama / LM Studio 并按内存推荐合适的开源模型;接入后会作为一个供应商出现在智能体卡片中。",rowProvider:"供应商",rowModel:"模型",rowEffort:"推理强度",providerNative:"官方(CLI 内置认证)",providerNativeFromAgent:"智能体自身配置",effortDefault:"默认",modelLoading:"正在拉取模型列表…",modelEmpty:"该供应商未返回模型列表,请使用自定义输入。",modelCustomToggle:"改为自定义输入",modelListToggle:"从列表选择",modelCustomPlaceholder:"anthropic/claude-sonnet-4",modelSearchPlaceholder:"搜索模型",modelSearchEmpty:"没有匹配的模型",modelCurrentLabel:"当前",saveChanges:"保存",saving:"保存中…",cancel:"撤销",saved:"已保存",configError:"保存失败",externalNativeNote:a=>`Hermes 当前从 ${a||"~/.hermes/config.yaml"} 读取这些值;切换为某个 BYOK 供应商可由 pikiclaw 接管。`}:{defaultsTitle:"New Session Defaults",defaultsHint:"Pick which agent new sessions use by default. Provider / Model / Effort live on each agent card below.",defaultsEditTitle:"Change Default Agent",defaultsEditHint:"Which agent should new sessions use by default?",defaultsSaved:"Default agent updated",editDefaults:"Change default",agentsTitle:"Available Agents",defaultAgent:"Default Agent",installLabel:"Install",versionLabel:"Version",defaultBadge:"Default",installed:"Installed",notInstalled:"Not installed",notInstalledHint:"Install the local CLI for this agent to configure its provider and model.",noModel:"Not set",noVersion:"Version unavailable",loadFailed:"Failed to load agent status",updateAvailable:"Update available",updateSkipped:"Auto-update skipped",updateFailed:"Auto-update failed",update:"Update",updating:"Updating…",checkUpdate:"Check update",checking:"Checking…",upToDate:"Up to date",install:"Install",installing:"Installing…",modelsTitle:"Model Providers",modelsHint:"Connect BYOK providers; pick one in any agent card above.",localTitle:"Local Models",localHint:"Detect Ollama / LM Studio on this machine and surface coding models that fit your RAM. Connected backends show up as a provider on the agent cards.",rowProvider:"Provider",rowModel:"Model",rowEffort:"Effort",providerNative:"Native (CLI auth)",providerNativeFromAgent:"agent's own config",effortDefault:"default",modelLoading:"Loading model list…",modelEmpty:"Provider returned no model list — use custom input.",modelCustomToggle:"Use custom input",modelListToggle:"Pick from list",modelCustomPlaceholder:"anthropic/claude-sonnet-4",modelSearchPlaceholder:"Search models",modelSearchEmpty:"No matching models",modelCurrentLabel:"Current",saveChanges:"Save",saving:"Saving…",cancel:"Reset",saved:"Saved",configError:"Save failed",externalNativeNote:a=>`Hermes reads these values from ${a||"~/.hermes/config.yaml"}; pick a BYOK provider to let pikiclaw take over.`}}function Xe(t,a){const l=t.filter(i=>i.installed);return(l.length?l:t).map(i=>({value:i.agent,label:`${ee(i.agent).label} · ${i.installed?i.version||a.installed:a.notInstalled}`}))}function et(t){return t.nativeSelectedModel?t.nativeSelectedModel:t.nativeConfig?.model?t.nativeConfig.model:t.models.length?t.models[0].id:""}function be(t,a){t({defaultAgent:a.defaultAgent,agents:a.agents})}function tt(t,a,l){if(l)return{providerId:l.providerId,modelId:l.modelId,effort:l.effort||"",modelMode:"list"};const n=a?.nativeConfig||null;return{providerId:ie,modelId:n?.model||a?.selectedModel||"",effort:n?.effort||a?.selectedEffort||"",modelMode:"list"}}function at(t,a){return t.providerId===a.providerId&&t.modelId.trim()===a.modelId.trim()&&(t.effort||"")===(a.effort||"")}function nt({agentId:t,agentStatus:a,boundInfo:l,copy:n,layer:i,toast:f,onSaved:u}){const j=qe(t),o=a.nativeConfig||null,d=s.useMemo(()=>tt(t,a,l),[t,a,l]),[x,v]=s.useState(d),[M,E]=s.useState(!1),[k,I]=s.useState(null);s.useEffect(()=>{v(d),I(null)},[d]);const A=x.providerId===ie,R=A&&j,[m,r]=s.useState([]),[y,C]=s.useState(!1),[T,_]=s.useState(null);s.useEffect(()=>{if(A){r([]),_(null),C(!1);return}let g=!1;return C(!0),_(null),fetch(`/api/models/providers/${x.providerId}/models`).then(p=>p.json()).then(p=>{g||(p.ok?p.modelInfos&&p.modelInfos.length?r(p.modelInfos):r((p.models||[]).map(D=>({id:D}))):(_(p.error||"Failed to load models"),r([])))}).catch(p=>{g||(_(p?.message||String(p)),r([]))}).finally(()=>{g||C(!1)}),()=>{g=!0}},[x.providerId,A]);const V=s.useMemo(()=>m.map(g=>g.id),[m]),N=s.useMemo(()=>a.models.map(g=>g.id),[a]),P=A?N:V;s.useEffect(()=>{if(!y){if(A){x.modelMode==="custom"&&v(g=>({...g,modelMode:"list"}));return}P.length===0&&x.modelMode==="list"&&v(g=>({...g,modelMode:"custom"}))}},[P,y,x.modelMode,A]);const c=s.useMemo(()=>{const g=j?`${n.providerNativeFromAgent}${o?.provider?` · ${o.provider}`:""}`:n.providerNative,p=[{value:ie,label:g}];for(const D of i.providers)p.push({value:D.id,label:D.name});return p},[j,o,i.providers,n.providerNative,n.providerNativeFromAgent]),w=s.useMemo(()=>{const g=me[t]||me.claude;return[{value:"",label:n.effortDefault},...g.map(p=>({value:p,label:p}))]},[t,n.effortDefault]),L=s.useMemo(()=>{let g;return A?g=a.models.map(p=>{const D=p.alias?.toLowerCase().replace(/[\s_-]/g,""),q=p.id.toLowerCase().replace(/[\s_-]/g,""),z=p.alias&&D!==q;return{value:p.id,label:p.id,description:z?p.alias:void 0}}):g=m.map(p=>({value:p.id,...We(p)})),x.modelMode==="list"&&x.modelId&&!g.some(p=>p.value===x.modelId)&&g.unshift({value:x.modelId,label:x.modelId}),g},[A,a.models,m,x.modelMode,x.modelId]),O=!at(x,d),S=!M&&O&&(R||!!x.modelId.trim()),H=s.useCallback(async()=>{I(null),E(!0);try{const g=x.effort||null,p=x.modelId.trim();if(A){const D=i.bindings[t],q=D?i.profiles.find(z=>z.id===D):null;if(D&&await i.setActiveProfile(t,null),q&&await fetch(`/api/models/profiles/${q.id}`,{method:"DELETE"}),!j){const z={agent:t};if(p&&p!==(a.selectedModel||"")&&(z.model=p),g!==(a.selectedEffort||null)&&(z.effort=g),Object.keys(z).length>1){const Z=await Y.updateRuntimeAgent(z);if(!Z.ok)throw new Error(Z.error||"Failed to update agent")}}}else{const D=i.providers.find($=>$.id===x.providerId);if(!D)throw new Error("Provider not found");const q=ee(t),z=i.bindings[t],Z=z?i.profiles.find($=>$.id===z):null,le={providerId:D.id,modelId:p,effort:g,name:`${q.label} · ${D.name}`};let Q=Z?.id;if(Z){const $=await fetch(`/api/models/profiles/${Z.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(le)}).then(te=>te.json());if(!$.ok)throw new Error($.error||"Failed to update profile")}else{const $=await fetch("/api/models/profiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(le)}).then(te=>te.json());if(!$.ok)throw new Error($.error||"Failed to create profile");Q=$.profile?.id}Q&&await i.setActiveProfile(t,Q)}await Promise.resolve(u()),f(n.saved)}catch(g){const p=g?.message||String(g);I(p),f(`${n.configError}: ${p}`,!1)}finally{E(!1)}},[t,a,n,x,j,A,i,u,f]);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{children:[e.jsx(B,{className:"!mb-1 text-[11px]",children:n.rowProvider}),e.jsx(se,{value:x.providerId,options:c,onChange:g=>v(p=>{if(g===p.providerId)return p;const D={...p,providerId:g,modelId:"",modelMode:"list"};return g===ie&&(D.modelId=et(a),D.effort=a.nativeSelectedEffort||a.nativeConfig?.effort||""),D})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-2",children:[e.jsx(B,{className:"!mb-0 text-[11px]",children:n.rowModel}),!R&&!A&&e.jsx("button",{type:"button",onClick:()=>v(g=>({...g,modelMode:g.modelMode==="list"?"custom":"list"})),className:"text-[10px] text-fg-5 underline-offset-2 transition hover:text-fg-3 hover:underline",children:x.modelMode==="list"?n.modelCustomToggle:n.modelListToggle})]}),R?e.jsx("div",{className:"flex h-9 items-center rounded-md border border-control-border bg-control px-3 text-[13px] text-fg-3",children:e.jsx("span",{className:"truncate font-mono",children:o?.model||n.noModel})}):x.modelMode==="list"?y&&!A?e.jsxs("div",{className:"flex h-9 items-center gap-2 rounded-md border border-control-border bg-control px-3 text-[13px] text-fg-5",children:[e.jsx(J,{className:"h-3.5 w-3.5"}),n.modelLoading]}):e.jsx(Le,{value:x.modelId,options:L,onChange:g=>v(p=>({...p,modelId:g})),placeholder:P.length?"—":n.modelEmpty,searchPlaceholder:n.modelSearchPlaceholder,noMatchesText:n.modelSearchEmpty,currentLabel:n.modelCurrentLabel}):e.jsx(X,{value:x.modelId,onChange:g=>v(p=>({...p,modelId:g.target.value})),placeholder:n.modelCustomPlaceholder})]}),e.jsxs("div",{children:[e.jsx(B,{className:"!mb-1 text-[11px]",children:n.rowEffort}),R?e.jsx("div",{className:"flex h-9 items-center rounded-md border border-control-border bg-control px-3 text-[13px] text-fg-3",children:e.jsx("span",{className:"font-mono",children:o?.effort||n.effortDefault})}):e.jsx(se,{value:x.effort,options:w,onChange:g=>v(p=>({...p,effort:g}))})]})]}),R&&e.jsx("div",{className:"text-[11px] leading-relaxed text-fg-5",children:n.externalNativeNote(o?.configPath||"")}),(k||T)&&e.jsx("div",{className:"rounded-md border border-rose-700/40 bg-rose-900/20 px-3 py-2 text-xs text-rose-200",children:k||T}),O&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(K,{variant:"ghost",size:"sm",onClick:()=>v(d),disabled:M,children:n.cancel}),e.jsx(K,{variant:"primary",size:"sm",disabled:!S,onClick:()=>{H()},children:M?n.saving:n.saveChanges})]})]})}function st({agent:t,copy:a,t:l,installing:n,onInstall:i,updatingAgent:f,checkingAgent:u,onUpdate:j,onCheckUpdate:o,loading:d=!1,layer:x,boundInfo:v,toast:M,onConfigSaved:E}){const k=ee(t.agent),I=t.version||a.noVersion,A=k.advantageKey?l(k.advantageKey):"";return e.jsxs("div",{className:"glass rounded-md border border-edge px-4 py-3 shadow-[0_1px_0_rgba(255,255,255,0.02),0_4px_12px_rgba(15,23,42,0.05)]",children:[e.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-edge bg-panel-alt",children:e.jsx(ne,{brand:t.agent,size:22})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-[15px] font-semibold text-fg",children:k.label}),t.isDefault&&e.jsx(F,{variant:"accent",children:a.defaultBadge}),d?e.jsxs(F,{variant:"muted",children:[e.jsx(J,{className:"h-3 w-3"})," ",l("status.loading")]}):t.installed?e.jsx(F,{variant:"ok",children:a.installed}):e.jsx(F,{variant:"warn",children:a.notInstalled}),t.installed&&t.updateAvailable&&e.jsx(F,{variant:"warn",children:a.updateAvailable})]}),e.jsxs("div",{className:"mt-1 text-[12px] leading-relaxed text-fg-5",children:[a.versionLabel,": ",I,t.latestVersion&&t.updateAvailable&&e.jsxs("span",{className:"ml-1.5 text-amber-400",children:["→ ",t.latestVersion]}),t.latestVersion&&!t.updateAvailable&&t.installed&&e.jsx("span",{className:"ml-1.5 text-emerald-400",children:"✓"})]})]})]}),e.jsxs("div",{className:W("flex shrink-0 flex-col items-end gap-1.5"),children:[d&&e.jsxs("div",{className:"inline-flex h-7 items-center gap-2 rounded-md border border-edge bg-transparent px-2.5 text-[11px] text-fg-5",children:[e.jsx(J,{className:"h-3 w-3"}),l("status.loading")]}),!d&&!t.installed&&e.jsx(K,{variant:"primary",size:"sm",disabled:n,onClick:()=>i(t),children:n?a.installing:a.install}),!d&&t.installed&&t.updateAvailable&&e.jsx(K,{variant:"outline",size:"sm",disabled:f,onClick:()=>j(t),children:f?a.updating:a.update}),!d&&t.installed&&!t.updateAvailable&&e.jsx(K,{variant:"ghost",size:"sm",disabled:u,onClick:()=>o(t),className:"gap-1.5 text-[11px]",children:u?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-3 w-3"})," ",a.checking]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",children:"↻"})," ",a.checkUpdate]})})]})]}),A&&e.jsx("div",{className:"mt-2 text-[12px] leading-relaxed text-fg-4",children:A}),!d&&!t.installed&&e.jsx("div",{className:"mt-3 rounded-md border border-dashed border-edge bg-panel-alt px-3 py-2.5 text-[12px] leading-relaxed text-fg-4",children:a.notInstalledHint}),!d&&t.installed&&e.jsx("div",{className:"mt-3 border-t border-edge pt-3",children:e.jsx(nt,{agentId:t.agent,agentStatus:t,boundInfo:v,copy:a,layer:x,toast:M,onSaved:E})}),!d&&t.installed&&t.updateAvailable&&t.updateStatus==="skipped"&&t.updateDetail&&e.jsxs("div",{className:"mt-2 text-[11px] leading-relaxed",style:{color:"var(--th-badge-warn-text)"},children:[a.updateSkipped,": ",t.updateDetail]}),!d&&t.installed&&t.updateStatus==="failed"&&t.updateDetail&&e.jsxs("div",{className:"mt-2 text-[11px] leading-relaxed",style:{color:"var(--th-badge-err-text)"},children:[a.updateFailed,": ",t.updateDetail]})]})}function lt({label:t,value:a,hint:l,loading:n=!1}){return e.jsxs("div",{className:"rounded-lg border border-edge bg-panel-alt px-3.5 py-2.5",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.14em] text-fg-5",children:t}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 text-[13px] font-semibold text-fg-2",children:[n&&e.jsx(J,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:a})]}),l&&e.jsx("div",{className:"mt-0.5 text-[10px] leading-relaxed text-fg-5",children:l})]})}function mt(){const t=G(h=>h.locale),a=G(h=>h.toast),l=G(h=>h.agentStatus),n=G(h=>h.setAgentStatus),i=G(h=>h.refreshAgentStatus),f=s.useMemo(()=>ye(t),[t]),u=s.useMemo(()=>Je(t),[t]),j=ke(),[o,d]=s.useState(l?{defaultAgent:l.defaultAgent,agents:l.agents}:null),[x,v]=s.useState(!l),[M,E]=s.useState(null),[k,I]=s.useState(!1),[A,R]=s.useState(null),[m,r]=s.useState(!1),[y,C]=s.useState("codex"),[T,_]=s.useState(null),[V,N]=s.useState(null),P=s.useRef(!!l);s.useEffect(()=>{l&&(be(d,l),P.current||(P.current=!0,v(!1)))},[l]);const c=s.useCallback(h=>{be(d,h),n(h)},[n]),w=s.useCallback(async()=>{P.current||v(!0);try{const h=await Y.getAgentStatus();return c(h),E(null),P.current=!0,h}catch(h){const b=h instanceof Error?h.message:u.loadFailed;return E(b),P.current||a(b,!1),null}finally{v(!1)}},[c,u.loadFailed,a]);s.useEffect(()=>{l?i():w()},[]);const L=s.useMemo(()=>{const h=o?.agents||[],b=new Map(h.map(U=>[U.agent,U]));return Ve.map(U=>{const fe=b.get(U);if(fe)return fe;const Me=ee(U);return{agent:U,label:Me.label,installed:!1,version:void 0,installCommand:void 0,selectedModel:null,selectedEffort:null,isDefault:o?.defaultAgent===U,models:[],usage:null}})},[o]),O=o?.defaultAgent||"codex",S=L.find(h=>h.agent===O)||null,g=L.filter(h=>h.installed).length>0,p=Xe(L,u),D=s.useCallback(async h=>{I(!0);try{const b=await Y.updateRuntimeAgent(h);if(!b.ok)throw new Error(b.error||f("config.applyFailed"));return c(b),b}catch(b){const U=b instanceof Error?b.message:f("config.applyFailed");return a(U,!1),w(),null}finally{I(!1)}},[c,w,f,a]);s.useEffect(()=>{m&&C(O)},[O,m]);const q=s.useCallback(async()=>{if(y===O){r(!1);return}await D({defaultAgent:y})&&(a(u.defaultsSaved),r(!1))},[u.defaultsSaved,O,y,a,D]),z=s.useCallback(async h=>{if(!A){R(h.agent);try{const b=await Y.installAgent(h.agent);if(!b.ok)throw new Error(b.error||f("config.agentInstallFailed"));c(b),a(f("config.agentInstalled"))}catch(b){const U=b instanceof Error?b.message:f("config.agentInstallFailed");a(U,!1),w()}finally{R(b=>b===h.agent?null:b)}}},[c,A,w,f,a]),Z=s.useCallback(async h=>{if(!T){_(h.agent);try{const b=await Y.updateAgent(h.agent);if(!b.ok)throw new Error(b.error||f("config.agentInstallFailed"));c(b),a(u.upToDate)}catch(b){const U=b instanceof Error?b.message:u.updateFailed;a(U,!1),w()}finally{_(b=>b===h.agent?null:b)}}},[c,u.updateFailed,u.upToDate,w,f,a,T]),le=s.useCallback(async h=>{if(!V){N(h.agent);try{const b=await Y.checkAgentUpdate(h.agent);if(!b.ok)throw new Error(b.error||u.loadFailed);c(b)}catch(b){const U=b instanceof Error?b.message:u.loadFailed;a(U,!1),w()}finally{N(b=>b===h.agent?null:b)}}},[c,V,u.loadFailed,w,a]),Q=x&&!o,$=Q?f("status.loading"):S?ee(S.agent).label:u.notInstalled,te=Q?f("status.loading"):S?.installed?u.installed:u.notInstalled,ue=s.useCallback(async()=>{await j.reload(),await w()},[j,w]);return e.jsxs("div",{className:"animate-in space-y-4",children:[e.jsx("section",{className:"space-y-3",children:e.jsxs(pe,{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-semibold tracking-tight text-fg",children:u.defaultsTitle}),e.jsx("div",{className:"mt-0.5 text-[13px] leading-relaxed text-fg-4",children:u.defaultsHint})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(K,{variant:"secondary",onClick:()=>r(!0),disabled:k||!g,children:u.editDefaults})})]}),e.jsx(lt,{label:u.defaultAgent,value:$,hint:te,loading:Q})]})}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-fg-5",children:u.agentsTitle}),e.jsx("div",{className:"space-y-3",children:L.map(h=>e.jsx(st,{agent:h,copy:u,t:f,installing:A===h.agent,loading:Q,onInstall:z,updatingAgent:T===h.agent,checkingAgent:V===h.agent,onUpdate:Z,onCheckUpdate:le,layer:j,boundInfo:Qe(j,h.agent),toast:a,onConfigSaved:ue},h.agent))})]}),M&&e.jsx(pe,{className:"border-amber-500/20 bg-amber-500/5",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"text-[13px] text-fg-2",children:M}),e.jsx(K,{variant:"outline",size:"sm",onClick:()=>{w()},children:f("sessions.retry")})]})}),e.jsxs("section",{className:"space-y-3 pt-4",children:[e.jsx("div",{className:"flex items-baseline justify-between border-t border-edge pt-4",children:e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-semibold tracking-tight text-fg",children:u.modelsTitle}),e.jsx("div",{className:"mt-0.5 text-[13px] leading-relaxed text-fg-4",children:u.modelsHint})]})}),e.jsx(De,{snapshot:j})]}),e.jsxs("section",{className:"space-y-3 pt-4",children:[e.jsx("div",{className:"flex items-baseline justify-between border-t border-edge pt-4",children:e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-semibold tracking-tight text-fg",children:u.localTitle}),e.jsx("div",{className:"mt-0.5 text-[13px] leading-relaxed text-fg-4",children:u.localHint})]})}),e.jsx(Ke,{onConnected:ue})]}),e.jsxs(je,{open:m,onClose:()=>r(!1),children:[e.jsx(we,{title:u.defaultsEditTitle,description:u.defaultsEditHint,onClose:()=>r(!1)}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(B,{children:u.defaultAgent}),e.jsx(se,{value:y,options:p,onChange:h=>C(h),disabled:k||!g,placeholder:u.notInstalled})]})}),e.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[e.jsx(K,{variant:"ghost",onClick:()=>r(!1),children:f("modal.cancel")}),e.jsx(K,{variant:"primary",disabled:k||y===O,onClick:()=>{q()},children:f(k?"config.validating":"modal.save")})]})]})]})}export{mt as AgentTab,mt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./react-vendor-DTcmqLiz.js";import{c as g}from"./index-CmjPBA1x.js";const a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAF+0lEQVRYha2XbXBUZxXHf+e5u4SkCZjg0NIWnQLJLgRF5UWnL75MP9gMjqPT2eyC0qlMiYxOUAR206LOyhiSTVscp52O0xamWgu7WTp0qLUz6kht6Qed1L7M5GUTsAoDTRSIJJos2b33+GFfWMJuNqmcT/c595z/+d3nOc+9zxXKWE9Li7tm0fjyqmT6H0t/Fp8sFz9XM+UCauouH8Rx+ifmWWdP7Q0sLRbT98g3lySC/mcSQd+GGwrQt2vzx1G2ZEa6KJ3S1mJxlpOKIDyEmEM3FGCk5vw5YCw3FmFbb9hXfV2gcm/26vINBfhS+LU0qgcKXB9xT1hbr6kdDhtgcYaDxHSNwVBg92Ao0DMY8n97zgAAZnK8U2AoX1D0++rzWfkC44k6wAVghP7C3EQo8Iiijyq61oEDiV2bPjojwKk234pEsPnh/lDgzpyv/olXrwi6qyDsjsQy2ZQXmJdefPWWvp0v3uZ/CLQ9NxZINpxJj84IYDvmOUT2G/T1DD0CUB/pflnhd1eT5Mcnwl90Adi23JzPl9TbAEN7fF9AeapQW5AOicftGQFEOJ+9tEDbB9v8x99r21wLYBlnJ5AGUKhfklz8QEbY3J71nVnZcezi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YmZWqE1ue8nbFggjbgDoH/VOxY3vZXdDT0uKuqR37I+jdIH9JV9r3NIbjU717fLe4jPkASDVEYhW5730i2PwqIvdlZkK3eCPdv06E/GuAbmCBJxJbUnIGill13b8fyxRnRG070BiOTwG4MeuyszBSeNiw3KZFYDTzdPLzU7u3LPZEYu+qTq5Tlev+K2YESAQD94rKjqzgl72Pxd/P3VNLsgAyXJizoj161kG3Z4d1aZP6HIC36/i4tyt6dE4AasQNDIhxNnoisXevvZndJcLw9DxvpLsb5XGE9yzD2ZlqzPpVPN0SIf854FaUZz1dsW0fVqdsD5Q05Qhgg7z+oTX+Xyv2pzNX+x+eTlGviPgh3AAAAABJRU5ErkJggg==",h="/assets/codex-DYadqqp0.png",n="/assets/feishu-C4OMrjCW.ico",r="/assets/gemini-BYkEpiWr.svg",A="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3clinearGradient%20x1='50%25'%20y1='0%25'%20x2='50%25'%20y2='100%25'%20id='linearGradient-1'%3e%3cstop%20stop-color='%2338AEEB'%20offset='0%25'%3e%3c/stop%3e%3cstop%20stop-color='%23279AD1'%20offset='100%25'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='Artboard'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3ccircle%20id='Oval'%20fill='url(%23linearGradient-1)'%20cx='8'%20cy='8'%20r='8'%3e%3c/circle%3e%3cpath%20d='M3.17026167,7.83635602%20C5.78750201,6.74265999%207.53273882,6.02162863%208.40597211,5.67326193%20C10.8992306,4.67860423%2011.2454541,4.53439191%2011.5831299,4.52864956%20C11.6573986,4.52743168%2011.8385417,4.55776042%2011.9798438,4.67645833%20C12.1211458,4.79515625%2012.1635786,4.87206678%2012.1755371,4.93908691%20C12.1874957,5.00610705%2012.1862759,5.21456762%2012.1744385,5.3338623%20C12.0393279,6.69547283%2011.5259342,9.83829771%2011.2285121,11.3633248%20C11.1026617,12.008621%2010.8548582,12.2249854%2010.6149558,12.2461596%20C10.0935924,12.2921758%209.69769267,11.9156852%209.19272668,11.5981993%20C8.40255458,11.1013965%208.13911734,10.9180161%207.3721185,10.4332283%20C6.48571864,9.87297217%206.85080034,9.6784879%207.35595703,9.17524981%20C7.48815894,9.04355001%209.67825076,7.04590073%209.71077046,6.86250183%20C9.7391276,6.70257812%209.7494847,6.68189389%209.67664063,6.60973958%20C9.60379655,6.53758527%209.51674192,6.54658941%209.46083149,6.55876051%20C9.38158015,6.57601267%208.17521836,7.33962686%205.84174612,8.84960308%20C5.48344358,9.08558775%205.15890428,9.20056741%204.86812819,9.19454205%20C4.54757089,9.18789957%203.93094724,9.02070014%203.47255094,8.87778221%20C2.91030922,8.70248755%202.46345069,8.609808%202.50236203,8.31210343%20C2.52262946,8.15704047%202.74526267,7.998458%203.17026167,7.83635602%20Z'%20id='Path-3'%20fill='%23FFFFFF'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",w="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%2307C160'/%3e%3cpath%20d='M42%2033c-16.569%200-30%2011.64-30%2026%200%208.084%204.283%2015.306%2011.008%2020.073L18%2095l20.832-8.102A37.33%2037.33%200%200%200%2042%2087c16.569%200%2030-11.64%2030-26S58.569%2033%2042%2033Z'%20fill='%23fff'/%3e%3cpath%20d='M85%2048c-13.807%200-25%209.402-25%2021%200%2011.598%2011.193%2021%2025%2021%202.545%200%205-.319%207.29-.91L109%2095l-4.772-12.27C109.078%2079.05%20112%2074.232%20112%2069c0-11.598-12.193-21-27-21Z'%20fill='%23fff'%20opacity='.95'/%3e%3ccircle%20cx='33'%20cy='56'%20r='4.5'%20fill='%2307C160'/%3e%3ccircle%20cx='50'%20cy='56'%20r='4.5'%20fill='%2307C160'/%3e%3ccircle%20cx='77'%20cy='66'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='92'%20cy='66'%20r='4'%20fill='%2307C160'/%3e%3c/svg%3e",x="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%234A154B'/%3e%3crect%20x='50'%20y='14'%20width='28'%20height='44'%20rx='14'%20fill='%232EB67D'/%3e%3crect%20x='70'%20y='50'%20width='44'%20height='28'%20rx='14'%20fill='%23ECB22E'/%3e%3crect%20x='50'%20y='70'%20width='28'%20height='44'%20rx='14'%20fill='%23E01E5A'/%3e%3crect%20x='14'%20y='50'%20width='44'%20height='28'%20rx='14'%20fill='%2336C5F0'/%3e%3c/svg%3e",d="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%235865F2'/%3e%3cpath%20fill='%23fff'%20d='M89.4%2036.9c-5.6-2.6-11.6-4.4-17.9-5.5l-.8%201.6c5.9%201%2011.2%202.6%2016.1%205-6-3-12.7-5-19.8-6-1.5-.2-2.9-.3-4.4-.4-.5%200-1%200-1.5%200s-1%200-1.5%200c-1.5%200-2.9.2-4.4.4-7.1%201-13.8%203-19.8%206%204.9-2.4%2010.2-4%2016.1-5l-.8-1.6C44.2%2032.5%2038.2%2034.3%2032.6%2036.9%2022%2053%2019%2068.7%2020.5%2084.3c8.1%206%2016%209.6%2023.7%2012%201.5-2.1%202.9-4.3%204.1-6.6-2.4-.9-4.6-2-6.8-3.3.6-.4%201.1-.9%201.7-1.3%2013.5%206.3%2028%206.3%2041.4%200%20.6.4%201.1.9%201.7%201.3-2.1%201.3-4.4%202.4-6.8%203.3%201.2%202.3%202.6%204.5%204.1%206.6%207.7-2.4%2015.6-6%2023.7-12%201.7-18.1-2.9-33.7-12.9-47.4ZM52.3%2074.8c-4.4%200-8-4.1-8-9.1s3.5-9.1%208-9.1c4.4%200%208%204.1%208%209.1s-3.6%209.1-8%209.1Zm23.5%200c-4.4%200-8-4.1-8-9.1s3.5-9.1%208-9.1c4.4%200%208%204.1%208%209.1s-3.5%209.1-8%209.1Z'/%3e%3c/svg%3e",f="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%231989FA'/%3e%3cpath%20fill='%23fff'%20d='M64.6%2026.5c-21%200-38%2017-38%2038%200%2021%2017%2038%2038%2038%206%200%2011.7-1.4%2016.7-3.9l21.3%204.6-7.6-19c4.6-5.7%207.4-12.9%207.4-20.7%200-21-17.1-37.9-37.8-37.9Zm-1.2%2053.8%205.5-13.6c-3.8.2-7.5.4-11.3.5L70.4%2049c-3.4%200-6.5.1-9.4.3l3.9-13.5h11.7l-3.8%2013.4c2.4-.1%204.6-.3%206.7-.5l-9.8%2017.6c4.6-.1%208.8-.3%2012.5-.6L63.4%2080.3Z'/%3e%3c/svg%3e",v="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%2307C160'/%3e%3cpath%20fill='%23fff'%20d='M32%2030h36c8%200%2014%206%2014%2014v18c0%208-6%2014-14%2014H56l-14%2012%204-12h-14c-8%200-14-6-14-14V44c0-8%206-14%2014-14Z'/%3e%3cpath%20fill='%23fff'%20opacity='.55'%20d='M56%2054h32c8%200%2014%206%2014%2014v18c0%208-6%2014-14%2014H80l-14%2012%204-12h-14c-8%200-14-6-14-14V68c0-8%206-14%2014-14Z'/%3e%3ccircle%20cx='44'%20cy='52'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='60'%20cy='52'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='72'%20cy='80'%20r='3.5'%20fill='%23fff'/%3e%3ccircle%20cx='86'%20cy='80'%20r='3.5'%20fill='%23fff'/%3e%3c/svg%3e",m="/assets/playwright-BldPFZgC.ico",C="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M23.15%202.587L18.21.21a1.494%201.494%200%200%200-1.705.29l-9.46%208.63-4.12-3.128a.999.999%200%200%200-1.276.057L.327%207.261A1%201%200%200%200%20.326%208.74L3.899%2012%20.326%2015.26a1%201%200%200%200%20.001%201.479L1.65%2017.94a.999.999%200%200%200%201.276.057l4.12-3.128%209.46%208.63a1.492%201.492%200%200%200%201.704.29l4.942-2.377A1.5%201.5%200%200%200%2024%2020.06V3.939a1.5%201.5%200%200%200-.85-1.352zm-5.146%2014.861L10.826%2012l7.178-5.448v10.896z'%20fill='%23007ACC'/%3e%3c/svg%3e",L="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%2319191C'/%3e%3cpath%20d='M7%205l10%207-4.5%201.5L15.5%2019l-2.2.8-3-5.5L7%2017z'%20fill='%23fff'/%3e%3c/svg%3e",p="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%230BA48A'/%3e%3cpath%20d='M8%2018l2-12h2.5l-1.2%205h4.2L10%2018H8zm3.5-3.5l3-7.5'%20fill='%23fff'%20fill-rule='evenodd'/%3e%3c/svg%3e",B="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%234A90D9'/%3e%3crect%20x='5'%20y='5'%20width='14'%20height='12'%20rx='1.5'%20fill='%236DB3F2'/%3e%3crect%20x='5'%20y='5'%20width='14'%20height='3.5'%20rx='1.5'%20fill='%233D7ABF'/%3e%3ccircle%20cx='8.5'%20cy='6.8'%20r='.8'%20fill='%23FF5F57'/%3e%3ccircle%20cx='11'%20cy='6.8'%20r='.8'%20fill='%23FEBC2E'/%3e%3ccircle%20cx='13.5'%20cy='6.8'%20r='.8'%20fill='%2328C840'/%3e%3crect%20x='7'%20y='10.5'%20width='10'%20height='1'%20rx='.5'%20fill='%23fff'%20opacity='.7'/%3e%3crect%20x='7'%20y='13'%20width='7'%20height='1'%20rx='.5'%20fill='%23fff'%20opacity='.5'/%3e%3c/svg%3e",y="/assets/hermes-BAarh-tH.png",u="/assets/openrouter-CsJ_bD5Q.ico",D="/assets/anthropic-BAdojD7P.ico",E="/assets/deepseek-BeYNZEk0.ico",F="/assets/qwen-xykkX0_y.png",b="/assets/doubao-DloFDuFR.png",z="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAg+SURBVHgB3VtrbFRFFD673XbbuoBY1EJCUy2gP2hK9YcJJTwSCaYEef0AKxGqhGCaqJAISgImYoz1BxETkOADIabKD+WVkvhIpE1LjIm0DcQUgXStQZCIgta+drvrfHf20nt3Z2bn3n2Vfsnkbne7j+87Z86cOWeuhzQQjUYXsstyNnAtZ+NeGpu4xUZnbJzweDxnKBUw4hvY6InevehhY4OKo0dCvJxdjrExh8YHgmwsYh4RjH/BG/8EI7+eXTpo/JAHytnoYNxWxL9g84DYPxyj8Y0NzBMOm3/cESDm9rB81gPc7b5obPDHkwIeNojKSr2UASBQVpvTwSpAD3FXyShAsK1zhNq7Ruj8lQidvxwxnpOhcobXEKKmKo+W1uSlS5ROJkA1HhgCxCLlIcoQQLDp6zCdbg8b5FMBBNm8uoDqlvgoRdQzET41BciI9UH2wFcham4LU7oBT9i+PiUhgkyAhzxRnuR8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rS24kZvmADcBEMnQIECU8SM9qISG6o1IGieDywtyVjv0bA+HoyJm6ayDNtNU3e2cbEnttD4R731BkrbPhZzgl1WEldpvAGcQP649UnVrbNYGstpfAA3U6/UunUWwD/GgkQ98ftu71YEiVu9WkQe0Cr0x5Il3FaL+4uwUozl2+eDbLSwcVzn9vn/AWPIqLtnLYy9AAAAAElFTkSuQmCC",J="/assets/minimax-PuEGTfrF.ico",k="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%20aria-label='OpenAI'%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.677l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v3l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e",I={claude:a,codex:h,gemini:r,telegram:A,feishu:n,weixin:w,slack:x,discord:d,dingtalk:f,wecom:v,playwright:m,vscode:C,cursor:L,windsurf:p,finder:B,hermes:y,openrouter:u,anthropic:D,deepseek:E,google:r,qwen:F,doubao:b,glm:z,minimax:J,openai:k},Q={custom:{letter:"+",color:"#94a3b8",bg:"rgba(148,163,184,0.12)"}};function S({brand:t,size:e=18,className:i}){const l=I[t];if(l)return s.jsx("img",{src:l,alt:"","aria-hidden":"true",draggable:!1,className:g("shrink-0 object-contain select-none",i),style:{width:e,height:e}});const c=Q[t];if(!c)return null;const o=c.letter.length>1;return s.jsx("span",{"aria-hidden":"true",className:g("inline-flex shrink-0 items-center justify-center rounded-md font-semibold tracking-tight select-none",i),style:{width:e,height:e,background:c.bg,color:c.color,fontSize:Math.round(e*(o?.42:.55)),lineHeight:1,letterSpacing:o?"-0.02em":"normal"},children:c.letter})}export{S as B};
|
|
1
|
+
import{j as g}from"./react-vendor-DTcmqLiz.js";import{c as s}from"./index-C2q8FWKH.js";const a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAF+0lEQVRYha2XbXBUZxXHf+e5u4SkCZjg0NIWnQLJLgRF5UWnL75MP9gMjqPT2eyC0qlMiYxOUAR206LOyhiSTVscp52O0xamWgu7WTp0qLUz6kht6Qed1L7M5GUTsAoDTRSIJJos2b33+GFfWMJuNqmcT/c595z/+d3nOc+9zxXKWE9Li7tm0fjyqmT6H0t/Fp8sFz9XM+UCauouH8Rx+if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qeJYeS1dqwJq4UoG56S5w7hb4PMp6YH426LJR1+qSAOrzWYPLZCvIPuAWAIHXxGGXY3geWAV6DOTrJRR+r5q8P9dskNtJ1etBVl4R19FPdh4eLQowEPR5RKxfgebOeGMqGvLMX/V0YrK/W+B+4ATCYZRnEJ5E+Q5gFM4AFwQ+I8hbLks2Ltt/ZKTUg163Rwfamrcj5q/54spvLZes9nZ2/yIx0b8jW/wCLmeLOLoCAEdeAjmYnaWPGXga9Jiia1O28+bAbt8dswJQEFF5IrO2chGVBzxdsY0r2qNnBx5uvkuELkAFedDTHj+nIl4AIzJsjL2XTAOisB+XtqryKLBcLHNyKLSpsSyAgKrKJoRtbksaPV3R5yFz7BaHOOBGOdAQib6SRV4L4KQZqe+I/wvYmZWqE1ue8nbFggjbgDoH/VOxY3vZXdDT0uKuqR37I+jdIH9JV9r3NIbjU717fLe4jPkASDVEYhW5730i2PwqIvdlZkK3eCPdv06E/GuAbmCBJxJbUnIGill13b8fyxRnRG070BiOTwG4MeuyszBSeNiw3KZFYDTzdPLzU7u3LPZEYu+qTq5Tlev+K2YESAQD94rKjqzgl72Pxd/P3VNLsgAyXJizoj161kG3Z4d1aZP6HIC36/i4tyt6dE4AasQNDIhxNnoisXevvZndJcLw9DxvpLsb5XGE9yzD2ZlqzPpVPN0SIf854FaUZz1dsW0fVqdsD5Q05Qhgg7z+oTX+Xyv2pzNX+x+eTlGviPgh3AAAAABJRU5ErkJggg==",h="/assets/codex-DYadqqp0.png",n="/assets/feishu-C4OMrjCW.ico",r="/assets/gemini-BYkEpiWr.svg",A="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs%3e%3clinearGradient%20x1='50%25'%20y1='0%25'%20x2='50%25'%20y2='100%25'%20id='linearGradient-1'%3e%3cstop%20stop-color='%2338AEEB'%20offset='0%25'%3e%3c/stop%3e%3cstop%20stop-color='%23279AD1'%20offset='100%25'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='Artboard'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3ccircle%20id='Oval'%20fill='url(%23linearGradient-1)'%20cx='8'%20cy='8'%20r='8'%3e%3c/circle%3e%3cpath%20d='M3.17026167,7.83635602%20C5.78750201,6.74265999%207.53273882,6.02162863%208.40597211,5.67326193%20C10.8992306,4.67860423%2011.2454541,4.53439191%2011.5831299,4.52864956%20C11.6573986,4.52743168%2011.8385417,4.55776042%2011.9798438,4.67645833%20C12.1211458,4.79515625%2012.1635786,4.87206678%2012.1755371,4.93908691%20C12.1874957,5.00610705%2012.1862759,5.21456762%2012.1744385,5.3338623%20C12.0393279,6.69547283%2011.5259342,9.83829771%2011.2285121,11.3633248%20C11.1026617,12.008621%2010.8548582,12.2249854%2010.6149558,12.2461596%20C10.0935924,12.2921758%209.69769267,11.9156852%209.19272668,11.5981993%20C8.40255458,11.1013965%208.13911734,10.9180161%207.3721185,10.4332283%20C6.48571864,9.87297217%206.85080034,9.6784879%207.35595703,9.17524981%20C7.48815894,9.04355001%209.67825076,7.04590073%209.71077046,6.86250183%20C9.7391276,6.70257812%209.7494847,6.68189389%209.67664063,6.60973958%20C9.60379655,6.53758527%209.51674192,6.54658941%209.46083149,6.55876051%20C9.38158015,6.57601267%208.17521836,7.33962686%205.84174612,8.84960308%20C5.48344358,9.08558775%205.15890428,9.20056741%204.86812819,9.19454205%20C4.54757089,9.18789957%203.93094724,9.02070014%203.47255094,8.87778221%20C2.91030922,8.70248755%202.46345069,8.609808%202.50236203,8.31210343%20C2.52262946,8.15704047%202.74526267,7.998458%203.17026167,7.83635602%20Z'%20id='Path-3'%20fill='%23FFFFFF'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",w="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%2307C160'/%3e%3cpath%20d='M42%2033c-16.569%200-30%2011.64-30%2026%200%208.084%204.283%2015.306%2011.008%2020.073L18%2095l20.832-8.102A37.33%2037.33%200%200%200%2042%2087c16.569%200%2030-11.64%2030-26S58.569%2033%2042%2033Z'%20fill='%23fff'/%3e%3cpath%20d='M85%2048c-13.807%200-25%209.402-25%2021%200%2011.598%2011.193%2021%2025%2021%202.545%200%205-.319%207.29-.91L109%2095l-4.772-12.27C109.078%2079.05%20112%2074.232%20112%2069c0-11.598-12.193-21-27-21Z'%20fill='%23fff'%20opacity='.95'/%3e%3ccircle%20cx='33'%20cy='56'%20r='4.5'%20fill='%2307C160'/%3e%3ccircle%20cx='50'%20cy='56'%20r='4.5'%20fill='%2307C160'/%3e%3ccircle%20cx='77'%20cy='66'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='92'%20cy='66'%20r='4'%20fill='%2307C160'/%3e%3c/svg%3e",x="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%234A154B'/%3e%3crect%20x='50'%20y='14'%20width='28'%20height='44'%20rx='14'%20fill='%232EB67D'/%3e%3crect%20x='70'%20y='50'%20width='44'%20height='28'%20rx='14'%20fill='%23ECB22E'/%3e%3crect%20x='50'%20y='70'%20width='28'%20height='44'%20rx='14'%20fill='%23E01E5A'/%3e%3crect%20x='14'%20y='50'%20width='44'%20height='28'%20rx='14'%20fill='%2336C5F0'/%3e%3c/svg%3e",d="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%235865F2'/%3e%3cpath%20fill='%23fff'%20d='M89.4%2036.9c-5.6-2.6-11.6-4.4-17.9-5.5l-.8%201.6c5.9%201%2011.2%202.6%2016.1%205-6-3-12.7-5-19.8-6-1.5-.2-2.9-.3-4.4-.4-.5%200-1%200-1.5%200s-1%200-1.5%200c-1.5%200-2.9.2-4.4.4-7.1%201-13.8%203-19.8%206%204.9-2.4%2010.2-4%2016.1-5l-.8-1.6C44.2%2032.5%2038.2%2034.3%2032.6%2036.9%2022%2053%2019%2068.7%2020.5%2084.3c8.1%206%2016%209.6%2023.7%2012%201.5-2.1%202.9-4.3%204.1-6.6-2.4-.9-4.6-2-6.8-3.3.6-.4%201.1-.9%201.7-1.3%2013.5%206.3%2028%206.3%2041.4%200%20.6.4%201.1.9%201.7%201.3-2.1%201.3-4.4%202.4-6.8%203.3%201.2%202.3%202.6%204.5%204.1%206.6%207.7-2.4%2015.6-6%2023.7-12%201.7-18.1-2.9-33.7-12.9-47.4ZM52.3%2074.8c-4.4%200-8-4.1-8-9.1s3.5-9.1%208-9.1c4.4%200%208%204.1%208%209.1s-3.6%209.1-8%209.1Zm23.5%200c-4.4%200-8-4.1-8-9.1s3.5-9.1%208-9.1c4.4%200%208%204.1%208%209.1s-3.5%209.1-8%209.1Z'/%3e%3c/svg%3e",f="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%231989FA'/%3e%3cpath%20fill='%23fff'%20d='M64.6%2026.5c-21%200-38%2017-38%2038%200%2021%2017%2038%2038%2038%206%200%2011.7-1.4%2016.7-3.9l21.3%204.6-7.6-19c4.6-5.7%207.4-12.9%207.4-20.7%200-21-17.1-37.9-37.8-37.9Zm-1.2%2053.8%205.5-13.6c-3.8.2-7.5.4-11.3.5L70.4%2049c-3.4%200-6.5.1-9.4.3l3.9-13.5h11.7l-3.8%2013.4c2.4-.1%204.6-.3%206.7-.5l-9.8%2017.6c4.6-.1%208.8-.3%2012.5-.6L63.4%2080.3Z'/%3e%3c/svg%3e",v="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='128'%20height='128'%20rx='28'%20fill='%2307C160'/%3e%3cpath%20fill='%23fff'%20d='M32%2030h36c8%200%2014%206%2014%2014v18c0%208-6%2014-14%2014H56l-14%2012%204-12h-14c-8%200-14-6-14-14V44c0-8%206-14%2014-14Z'/%3e%3cpath%20fill='%23fff'%20opacity='.55'%20d='M56%2054h32c8%200%2014%206%2014%2014v18c0%208-6%2014-14%2014H80l-14%2012%204-12h-14c-8%200-14-6-14-14V68c0-8%206-14%2014-14Z'/%3e%3ccircle%20cx='44'%20cy='52'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='60'%20cy='52'%20r='4'%20fill='%2307C160'/%3e%3ccircle%20cx='72'%20cy='80'%20r='3.5'%20fill='%23fff'/%3e%3ccircle%20cx='86'%20cy='80'%20r='3.5'%20fill='%23fff'/%3e%3c/svg%3e",m="/assets/playwright-BldPFZgC.ico",C="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M23.15%202.587L18.21.21a1.494%201.494%200%200%200-1.705.29l-9.46%208.63-4.12-3.128a.999.999%200%200%200-1.276.057L.327%207.261A1%201%200%200%200%20.326%208.74L3.899%2012%20.326%2015.26a1%201%200%200%200%20.001%201.479L1.65%2017.94a.999.999%200%200%200%201.276.057l4.12-3.128%209.46%208.63a1.492%201.492%200%200%200%201.704.29l4.942-2.377A1.5%201.5%200%200%200%2024%2020.06V3.939a1.5%201.5%200%200%200-.85-1.352zm-5.146%2014.861L10.826%2012l7.178-5.448v10.896z'%20fill='%23007ACC'/%3e%3c/svg%3e",L="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%2319191C'/%3e%3cpath%20d='M7%205l10%207-4.5%201.5L15.5%2019l-2.2.8-3-5.5L7%2017z'%20fill='%23fff'/%3e%3c/svg%3e",p="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%230BA48A'/%3e%3cpath%20d='M8%2018l2-12h2.5l-1.2%205h4.2L10%2018H8zm3.5-3.5l3-7.5'%20fill='%23fff'%20fill-rule='evenodd'/%3e%3c/svg%3e",B="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='24'%20height='24'%20rx='5.5'%20fill='%234A90D9'/%3e%3crect%20x='5'%20y='5'%20width='14'%20height='12'%20rx='1.5'%20fill='%236DB3F2'/%3e%3crect%20x='5'%20y='5'%20width='14'%20height='3.5'%20rx='1.5'%20fill='%233D7ABF'/%3e%3ccircle%20cx='8.5'%20cy='6.8'%20r='.8'%20fill='%23FF5F57'/%3e%3ccircle%20cx='11'%20cy='6.8'%20r='.8'%20fill='%23FEBC2E'/%3e%3ccircle%20cx='13.5'%20cy='6.8'%20r='.8'%20fill='%2328C840'/%3e%3crect%20x='7'%20y='10.5'%20width='10'%20height='1'%20rx='.5'%20fill='%23fff'%20opacity='.7'/%3e%3crect%20x='7'%20y='13'%20width='7'%20height='1'%20rx='.5'%20fill='%23fff'%20opacity='.5'/%3e%3c/svg%3e",y="/assets/hermes-BAarh-tH.png",u="/assets/openrouter-CsJ_bD5Q.ico",D="/assets/anthropic-BAdojD7P.ico",b="/assets/deepseek-BeYNZEk0.ico",E="/assets/qwen-xykkX0_y.png",F="/assets/doubao-DloFDuFR.png",z="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAg+SURBVHgB3VtrbFRFFD673XbbuoBY1EJCUy2gP2hK9YcJJTwSCaYEef0AKxGqhGCaqJA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ONfNyl2H1EkPXH//q/JUXqs36PIAkmvA2ohDMqtf6uXu3tKh/hyU61CzVO1jtLrDIL9mxzB1B9N/4NEKFXGjSRIjrtN9Bvn923hrXQXt8wFws2d3henC5WFpLd4NzORr86rEM0RmSQsD1RzdTDSZ21vh6Jgc9tgfMgscPBamf/pC1D/g7kwg6gvoMcws89GmFTzvAFkQxOkR8zSJm9QbyQ4Cnub23Tgm5/jmCKSacMWrN6KsLj9CA2xgx4hscSQy2qszu7b5rKKE4S/IY8NeXk8X4PIvsGr12icdve2M66OysFjzWb4E5Rpo0KBe6aJHsTflw9Jm8VFUcMwkzO7z2sUpVasWpfW4vNm5zeQZIcxxHJiqrUm5K8WPy+NRum+YQPDqYCL81M2vqRx0gHXNrvD86rS24kZvmADcBEMnQIECU8SM9qISG6o1IGieDywtyVjv0bA+HoyJm6ayDNtNU3e2cbEnttD4R731BkrbPhZzgl1WEldpvAGcQP649UnVrbNYGstpfAA3U6/UunUWwD/GgkQ98ftu71YEiVu9WkQe0Cr0x5Il3FaL+4uwUozl2+eDbLSwcVzn9vn/AWPIqLtnLYy9AAAAAElFTkSuQmCC",J="/assets/minimax-PuEGTfrF.ico",k="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%20aria-label='OpenAI'%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.677l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v3l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e",I={claude:a,codex:h,gemini:r,telegram:A,feishu:n,weixin:w,slack:x,discord:d,dingtalk:f,wecom:v,playwright:m,vscode:C,cursor:L,windsurf:p,finder:B,hermes:y,openrouter:u,anthropic:D,deepseek:b,google:r,qwen:E,doubao:F,glm:z,minimax:J,openai:k},Q={custom:{letter:"+",color:"#94a3b8",bg:"rgba(148,163,184,0.12)"},ollama:{letter:"O",color:"#e2e8f0",bg:"rgba(15,23,42,0.65)"},lmstudio:{letter:"LM",color:"#a5b4fc",bg:"rgba(99,102,241,0.14)"}};function S({brand:t,size:e=18,className:l}){const i=I[t];if(i)return g.jsx("img",{src:i,alt:"","aria-hidden":"true",draggable:!1,className:s("shrink-0 object-contain select-none",l),style:{width:e,height:e}});const c=Q[t];if(!c)return null;const o=c.letter.length>1;return g.jsx("span",{"aria-hidden":"true",className:s("inline-flex shrink-0 items-center justify-center rounded-md font-semibold tracking-tight select-none",l),style:{width:e,height:e,background:c.bg,color:c.color,fontSize:Math.round(e*(o?.42:.55)),lineHeight:1,letterSpacing:o?"-0.02em":"normal"},children:c.letter})}export{S as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as e}from"./react-vendor-DTcmqLiz.js";import{a as I,k as P,S as z}from"./index-
|
|
1
|
+
import{r,j as e}from"./react-vendor-DTcmqLiz.js";import{a as I,k as P,S as z}from"./index-C2q8FWKH.js";function W({initialPath:x,maxHeight:j=420,minHeight:N=200,onSelect:p,compact:l,t:o}){const[y,k]=r.useState(""),[h,m]=r.useState(""),[g,w]=r.useState([]),[i,S]=r.useState(""),[C,$]=r.useState(!1),[D,B]=r.useState([]),[E,c]=r.useState(!1),[u,d]=r.useState(""),a=r.useCallback(async t=>{c(!0),d("");try{const s=await I.lsDir(t);if(!s.ok){d(s.error||o("modal.cannotRead")),c(!1);return}k(s.path),m(s.path),w(s.dirs),S(s.parent),$(s.isGit);const G=s.path.split("/").filter(Boolean);let v="";B(G.map(b=>(v+="/"+b,{label:b,path:v}))),p?.(s.path,s.isGit)}catch{d(o("modal.loadFailed"))}finally{c(!1)}},[o,p]);r.useEffect(()=>{x!==void 0&&a(x||void 0)},[]);const n=l?"text-[11px]":"text-xs",f=l?"py-[5px]":"py-[7px]";return e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-1 ${l?"text-[10px]":"text-[11px]"} font-mono text-fg-4 mb-2 flex-wrap`,children:[e.jsx("span",{className:"cursor-pointer hover:text-fg-2 transition-colors",onClick:()=>a("/"),children:"~"}),D.map((t,s)=>e.jsxs("span",{children:[e.jsx("span",{className:"text-fg-6",children:"/"}),e.jsx("span",{className:"cursor-pointer hover:text-fg-2 transition-colors",onClick:()=>a(t.path),children:t.label})]},s)),C&&e.jsx(P,{variant:"accent",className:"ml-1 !text-[9px] !py-0 !px-1.5",children:"git"})]}),e.jsxs("div",{className:"relative",children:[!l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-10 h-5 rounded-t-lg",style:{background:"linear-gradient(to bottom, var(--th-panel-alt), rgba(0, 0, 0, 0))"}}),e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 h-5 rounded-b-lg",style:{background:"linear-gradient(to top, var(--th-panel-alt), rgba(0, 0, 0, 0))"}})]}),e.jsx("div",{className:"border border-edge rounded-lg overflow-y-auto overscroll-contain scroll-smooth bg-panel-alt",style:{maxHeight:j,minHeight:N,scrollbarGutter:"stable"},children:E?e.jsx("div",{className:`${n} text-fg-5 p-4 text-center flex items-center justify-center gap-2`,children:e.jsx(z,{className:"h-3 w-3 text-fg-5"})}):u?e.jsx("div",{className:`${n} text-red-500/70 p-4`,children:u}):e.jsxs(e.Fragment,{children:[i&&i!==y&&e.jsxs("div",{className:`flex items-center gap-2 px-3 ${f} cursor-pointer hover:bg-panel transition-colors border-b border-edge`,onClick:()=>a(i),children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",className:"text-fg-5 shrink-0",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})}),e.jsx("span",{className:`${n} text-fg-4`,children:".."})]}),g.length===0&&!i&&e.jsx("div",{className:`${n} text-fg-5 p-4 text-center`,children:o("modal.emptyDir")}),g.map(t=>e.jsxs("div",{className:`flex items-center gap-2 px-3 ${f} cursor-pointer hover:bg-panel transition-colors`,onClick:()=>a(t.path),children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:t.name===".git"?"var(--th-primary)":"currentColor",strokeWidth:"1.8",className:"text-fg-5 shrink-0",children:e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),e.jsx("span",{className:`${n} text-fg-3`,children:t.name})]},t.path))]})})]}),e.jsx("div",{className:"mt-2",children:e.jsx("input",{className:`w-full rounded-lg border border-edge bg-inset px-2.5 py-1.5 ${n} font-mono text-fg outline-none placeholder:text-fg-5 focus:border-edge-h transition-colors`,placeholder:o("modal.manualInput"),value:h,onChange:t=>m(t.target.value),onKeyDown:t=>{t.key==="Enter"&&a(h)}})})]})}export{W as D};
|