@chunklib/agentic 1.1.0 → 1.1.1
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/README.md +16 -32
- package/bin/agentic.js +66 -64
- package/bin/cli/tui/worker.js +7 -3
- package/bin/web/assets/{LROKH5N7-Cgdi6ogL.js → LROKH5N7-CufzWEns.js} +2 -2
- package/bin/web/assets/ar-BwLzFtrk.js +8 -0
- package/bin/web/assets/ar-C3abecgF.js +2 -0
- package/bin/web/assets/az-CE5LLqzy.js +8 -0
- package/bin/web/assets/az-CTrkzoUY.js +2 -0
- package/bin/web/assets/br-C6eWgdLc.js +8 -0
- package/bin/web/assets/br-DPsjeLV1.js +2 -0
- package/bin/web/assets/bs-Bs-WieSp.js +2 -0
- package/bin/web/assets/bs-DXhZIkW2.js +8 -0
- package/bin/web/assets/da-CnHHIur0.js +8 -0
- package/bin/web/assets/da-DzYOPLp5.js +2 -0
- package/bin/web/assets/de-BJacEZDA.js +8 -0
- package/bin/web/assets/de-CAZZkD7r.js +2 -0
- package/bin/web/assets/{dialog-command-palette-v2-B41e0R0T.js → dialog-command-palette-v2-BdsfOt98.js} +2 -2
- package/bin/web/assets/dialog-connect-provider-cMnfONyq.js +2 -0
- package/bin/web/assets/{dialog-edit-project-ENsoKieS.js → dialog-edit-project-BTKo4L8c.js} +2 -2
- package/bin/web/assets/{dialog-edit-project-v2-TbsDREdW.js → dialog-edit-project-v2-BgxhNrB_.js} +2 -2
- package/bin/web/assets/{dialog-fork-CvXAqG0y.js → dialog-fork-DM2MD9h9.js} +2 -2
- package/bin/web/assets/{dialog-manage-models-Ca3CtDo1.js → dialog-manage-models-CZ-wSXas.js} +2 -2
- package/bin/web/assets/{dialog-select-directory-v2-DgRK6caR.js → dialog-select-directory-v2-BjsOiAsW.js} +2 -2
- package/bin/web/assets/{dialog-select-file-W4qjeG1v.js → dialog-select-file-DQfBi0lB.js} +3 -3
- package/bin/web/assets/{dialog-select-mcp-MpnNunKg.js → dialog-select-mcp-BAPSNwQR.js} +2 -2
- package/bin/web/assets/{dialog-settings-BWcr4izq.js → dialog-settings-DTc_Rfqx.js} +3 -3
- package/bin/web/assets/{edit-project-Br24T75k.js → edit-project-CuOMp3mF.js} +2 -2
- package/bin/web/assets/es-Bus963Aj.js +2 -0
- package/bin/web/assets/es-CoFvHMiq.js +8 -0
- package/bin/web/assets/fi-BxFpA3sy.js +2 -0
- package/bin/web/assets/fi-DNRVJEPq.js +8 -0
- package/bin/web/assets/fr-BSxYcqpM.js +2 -0
- package/bin/web/assets/fr-BUGMj6SW.js +8 -0
- package/bin/web/assets/{ghostty-web-D7Ty6Ejz.js → ghostty-web-BqSBMlIl.js} +2 -2
- package/bin/web/assets/hi-38BcxEkk.js +2 -0
- package/bin/web/assets/hi-CKPvfKWe.js +8 -0
- package/bin/web/assets/id-CIrwWmtd.js +8 -0
- package/bin/web/assets/id-CQavIbiH.js +2 -0
- package/bin/web/assets/index-B5UCYzgt.js +3 -0
- package/bin/web/assets/index-BH1J9J8E.js +1524 -0
- package/bin/web/assets/index-DoggtF0n.css +1 -0
- package/bin/web/assets/index-GGAIvKVQ.css +1 -0
- package/bin/web/assets/it-17NlHkKQ.js +8 -0
- package/bin/web/assets/it-BB46hSUz.js +2 -0
- package/bin/web/assets/ja-Cg62k4Hq.js +2 -0
- package/bin/web/assets/ja-DTzmMP0I.js +8 -0
- package/bin/web/assets/ko-BWAIIDYz.js +8 -0
- package/bin/web/assets/ko-k06DU9Nv.js +2 -0
- package/bin/web/assets/{list-Bgkj60uj.js → list-BK0ZBxm_.js} +2 -2
- package/bin/web/assets/markdown.worker-Bu_Dc9RP.js +503 -0
- package/bin/web/assets/mcp-CnUj_8Pe.js +2 -0
- package/bin/web/assets/{new-session-HkDD85pv.js → new-session-CexkpdBg.js} +3 -3
- package/bin/web/assets/nl-BWmwmMiu.js +2 -0
- package/bin/web/assets/nl-Cvn5nbPq.js +8 -0
- package/bin/web/assets/no-BxXcGy-n.js +8 -0
- package/bin/web/assets/no-DsRI2Z0y.js +2 -0
- package/bin/web/assets/pa-D7MCm8Kt.js +8 -0
- package/bin/web/assets/pa-W0ArODx2.js +2 -0
- package/bin/web/assets/pl-Bet_AQ8e.js +2 -0
- package/bin/web/assets/pl-WzVN3ybR.js +8 -0
- package/bin/web/assets/{row-DVVVLbFk.css → row-BjpwzvFU.css} +1 -1
- package/bin/web/assets/{row-cHDMR1XO.js → row-DgKhGiK9.js} +2 -2
- package/bin/web/assets/ru-CwmMfH4n.js +2 -0
- package/bin/web/assets/ru-DPS1hMlO.js +8 -0
- package/bin/web/assets/{settings-keybinds-DFbfIb2V.js → settings-keybinds-C8R--jLJ.js} +3 -3
- package/bin/web/assets/{sprite-Chb7ocDN.svg → sprite-B9ixRF_T.svg} +2 -27
- package/bin/web/assets/{status-popover-body-DNA3h-5H.js → status-popover-body-Jl0oR5U2.js} +3 -3
- package/bin/web/assets/sv-CNxtFx1x.js +2 -0
- package/bin/web/assets/sv-YsyKpECF.js +8 -0
- package/bin/web/assets/{switch-D8_cvKev.js → switch-BnUb38m8.js} +2 -2
- package/bin/web/assets/th-BM9lxrwF.js +8 -0
- package/bin/web/assets/th-VvW38onH.js +2 -0
- package/bin/web/assets/tr-BV9Bmn8X.js +2 -0
- package/bin/web/assets/tr-DBhHCAc2.js +8 -0
- package/bin/web/assets/uk-Bl62aPxY.js +8 -0
- package/bin/web/assets/uk-gpwOqShu.js +2 -0
- package/bin/web/assets/ur-BbDVKvlg.js +2 -0
- package/bin/web/assets/ur-nGv5wQGp.js +8 -0
- package/bin/web/assets/vi-DUs03mzm.js +8 -0
- package/bin/web/assets/vi-ac_kFMcG.js +2 -0
- package/bin/web/assets/zh-BDTj0-qK.js +8 -0
- package/bin/web/assets/zh-Db1rGmjT.js +2 -0
- package/bin/web/assets/zht-CTieoXNG.js +2 -0
- package/bin/web/assets/zht-CU7BHTWv.js +8 -0
- package/bin/web/index.html +2 -2
- package/docs/configuration.md +16 -32
- package/package.json +1 -1
- package/bin/web/assets/ar-C4xsRFR0.js +0 -2
- package/bin/web/assets/ar-D7_40HDV.js +0 -4
- package/bin/web/assets/br-CwfNwpqU.js +0 -4
- package/bin/web/assets/br-XyupthPW.js +0 -2
- package/bin/web/assets/bs-BW2PeAiy.js +0 -2
- package/bin/web/assets/bs-C9w8bnld.js +0 -4
- package/bin/web/assets/da-CgNNle9H.js +0 -2
- package/bin/web/assets/da-_o-yW1c-.js +0 -4
- package/bin/web/assets/de-CELw_bn8.js +0 -2
- package/bin/web/assets/de-u4ZRSSGs.js +0 -4
- package/bin/web/assets/dialog-connect-provider-B-kgBHKk.js +0 -2
- package/bin/web/assets/es-DCGlYCXN.js +0 -2
- package/bin/web/assets/es-pMkLqpGW.js +0 -4
- package/bin/web/assets/fr-Du5j-zoY.js +0 -2
- package/bin/web/assets/fr-Rs650oVj.js +0 -4
- package/bin/web/assets/index-B2L_xsSX.js +0 -1831
- package/bin/web/assets/index-CFMuAFJa.css +0 -1
- package/bin/web/assets/index-CZitxknW.css +0 -1
- package/bin/web/assets/index-D9JOa7-H.js +0 -3
- package/bin/web/assets/ja-iJh2cVB-.js +0 -2
- package/bin/web/assets/ja-mSoA7GSH.js +0 -4
- package/bin/web/assets/ko-C92hX257.js +0 -2
- package/bin/web/assets/ko-CtAd082Z.js +0 -4
- package/bin/web/assets/markdown-shiki.worker-sTYREXj-.js +0 -156
- package/bin/web/assets/mcp-C5TFvBHS.js +0 -2
- package/bin/web/assets/no-CQNbtNrq.js +0 -4
- package/bin/web/assets/no-CsX2bvW2.js +0 -2
- package/bin/web/assets/pl-BH_iOtUo.js +0 -4
- package/bin/web/assets/pl-U1SU7oID.js +0 -2
- package/bin/web/assets/ru-CkmmQ1_k.js +0 -2
- package/bin/web/assets/ru-Dj20Kckp.js +0 -4
- package/bin/web/assets/th-BWKOZ0j_.js +0 -2
- package/bin/web/assets/th-D0m3tYTd.js +0 -4
- package/bin/web/assets/tr-DFDOk0cA.js +0 -4
- package/bin/web/assets/tr-Ds4_hniB.js +0 -2
- package/bin/web/assets/uk-PaABnp9Y.js +0 -4
- package/bin/web/assets/uk-fqr0bcE9.js +0 -2
- package/bin/web/assets/zh-B268Sls8.js +0 -2
- package/bin/web/assets/zh-BSCC1HAl.js +0 -4
- package/bin/web/assets/zht-Br909_dL.js +0 -2
- package/bin/web/assets/zht-DKWnEJJ6.js +0 -4
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{bJ as Xe,bK as Ye,bd as et,b7 as t,bM as k,bW as Fe,ci as Ue,ch as je,c0 as se,aM as ne,c4 as tt,bH as ke,au as e,N as be,aa as J,u as he,aI as ve,bG as re,o as pe,B as ae,bb as xe,b as Ve,am as _e,bz as ue,cl as Ie,j as rt,f as nt,a2 as j,I as De,h as ot,d as it,bR as Ae,M as F,a5 as ie,c6 as lt,cb as Le,bm as at,aD as A,aJ as st,ax as ct,a3 as me,aq as ge,a8 as we,bx as de,L as Ce,aR as dt,aO as ze,bn as fe,ab as Se,a as Ee,aS as ut}from"./index-BH1J9J8E.js";var vt=k("<a>");function le(a){const[K,y]=Xe(a,["href","children","class","target","rel"]);return(()=>{var d=vt();return Ye(d,et({get href(){return K.href},get class(){return`text-text-strong underline ${K.class??""}`},get target(){return K.target??"_blank"},get rel(){return K.rel??"noopener noreferrer"}},y),!1,!0),t(d,()=>K.children),d})()}const pt=/^[a-z0-9][a-z0-9-_]*$/,gt="@ai-sdk/openai-compatible";function mt(a){const K=a.form.providerID.trim(),y=a.form.name.trim(),d=a.form.baseURL.trim(),c=a.form.apiKey.trim(),n=c.match(/^\{env:([^}]+)\}$/)?.[1]?.trim(),M=c&&!n?c:void 0,C=K?pt.test(K)?void 0:a.t("provider.custom.error.providerID.format"):a.t("provider.custom.error.providerID.required"),g=y?void 0:a.t("provider.custom.error.name.required"),S=d?/^https?:\/\//.test(d)?void 0:a.t("provider.custom.error.baseURL.format"):a.t("provider.custom.error.baseURL.required"),O=a.disabledProviders.includes(K),P=C?void 0:a.existingProviderIDs.has(K)&&!O?a.t("provider.custom.error.providerID.exists"):void 0,$=new Set,I=a.form.models.map(h=>{const U=h.id.trim(),q=U?$.has(U)?a.t("provider.custom.error.duplicate"):(()=>{$.add(U)})():a.t("provider.custom.error.required"),z=h.name.trim()?void 0:a.t("provider.custom.error.required");return{id:q,name:z}}),Y=I.every(h=>!h.id&&!h.name),W=Object.fromEntries(a.form.models.map(h=>[h.id.trim(),{name:h.name.trim()}])),_=new Set,i=a.form.headers.map(h=>{const U=h.key.trim(),q=h.value.trim();if(!U&&!q)return{};const z=U?_.has(U.toLowerCase())?a.t("provider.custom.error.duplicate"):(()=>{_.add(U.toLowerCase())})():a.t("provider.custom.error.required"),ee=q?void 0:a.t("provider.custom.error.required");return{key:z,value:ee}}),l=i.every(h=>!h.key&&!h.value),R=Object.fromEntries(a.form.headers.map(h=>({key:h.key.trim(),value:h.value.trim()})).filter(h=>!!h.key&&!!h.value).map(h=>[h.key,h.value])),B={providerID:C??P,name:g,baseURL:S};return!C&&!P&&!g&&!S&&Y&&l?{err:B,models:I,headers:i,result:{providerID:K,name:y,key:M,config:{npm:gt,name:y,...n?{env:[n]}:{},options:{baseURL:d,...Object.keys(R).length?{headers:R}:{}},models:W}}}:{err:B,models:I,headers:i}}let ft=0;const Ze=()=>`row-${ft++}`,Ke=()=>({row:Ze(),id:"",name:"",err:{}}),Me=()=>({row:Ze(),key:"",value:"",err:{}});var ht=k('<div class="flex flex-col gap-6 px-2.5 pb-3 overflow-y-auto max-h-[60vh]"><div class="px-2.5 flex gap-4 items-center"><div class="text-16-medium text-text-strong"></div></div><form class="px-2.5 pb-6 flex flex-col gap-6"><p class="text-14-regular text-text-base"></p><div class="flex flex-col gap-4"></div><div class="flex flex-col gap-3"><label class="text-12-medium text-text-weak"></label></div><div class="flex flex-col gap-3"><label class="text-12-medium text-text-weak">'),Re=k('<div class="flex gap-2 items-start"><div class=flex-1></div><div class=flex-1>');function Gt(a){const K=se();return e(Ve,{class:"h-full",get title(){return e(he,{tabIndex:-1,icon:"arrow-left",variant:"ghost",get onClick(){return a.onBack},get"aria-label"(){return K.t("common.goBack")}})},transition:!0,get children(){return e(He,{})}})}function He(a={}){const K=Fe(),y=Ue(),d=je(),c=se(),[n,M]=ne({providerID:"",name:"",baseURL:"",apiKey:"",models:[Ke()],headers:[Me()],err:{}}),C=()=>{M("models",ue(i=>{i.push(Ke())}))},g=i=>{n.models.length<=1||M("models",ue(l=>{l.splice(i,1)}))},S=()=>{M("headers",ue(i=>{i.push(Me())}))},O=i=>{n.headers.length<=1||M("headers",ue(l=>{l.splice(i,1)}))},P=(i,l)=>{M(i,l),i!=="apiKey"&&M("err",i,void 0)},$=(i,l,R)=>{_e(()=>{M("models",i,l,R),M("models",i,"err",l,void 0)})},I=(i,l,R)=>{_e(()=>{M("headers",i,l,R),M("headers",i,"err",l,void 0)})},Y=()=>{const i=mt({form:n,t:c.t,disabledProviders:y().data.config.disabled_providers??[],existingProviderIDs:new Set(y().data.provider.all.keys())});return _e(()=>{M("err",i.err),i.models.forEach((l,R)=>M("models",R,"err",l)),i.headers.forEach((l,R)=>M("headers",R,"err",l))}),i.result},W=tt(()=>({mutationFn:async i=>{if(await d().protocol!=="v1")throw new Error(c.t("provider.custom.unavailable"));const R=(y().data.config.disabled_providers??[]).filter(B=>B!==i.providerID);return i.key&&await d().client.auth.set({providerID:i.providerID,auth:{type:"api",key:i.key}}),await y().updateConfig({provider:{[i.providerID]:i.config},disabled_providers:R}),i},onSuccess:i=>{K.close(),ke({variant:"success",icon:"circle-check",title:c.t("provider.connect.toast.connected.title",{provider:i.name}),description:c.t("provider.connect.toast.connected.description",{provider:i.name})})},onError:i=>{const l=i instanceof Error?i.message:String(i);ke({title:c.t("common.requestFailed"),description:l})}})),_=i=>{if(i.preventDefault(),W.isPending)return;const l=Y();l&&W.mutate(l)};return(()=>{var i=ht(),l=i.firstChild,R=l.firstChild,B=l.nextSibling,L=B.firstChild,h=L.nextSibling,U=h.nextSibling,q=U.firstChild,z=U.nextSibling,ee=z.firstChild;return t(l,e(be,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),R),t(R,()=>c.t("provider.custom.title")),B.addEventListener("submit",_),t(L,()=>c.t("provider.custom.description.prefix"),null),t(L,e(le,{href:"https://opencode.ai/docs/providers/#custom-provider",tabIndex:-1,get children(){return c.t("provider.custom.description.link")}}),null),t(L,()=>c.t("provider.custom.description.suffix"),null),t(h,e(J,{get autofocus(){return a.autofocus??!0},get label(){return c.t("provider.custom.field.providerID.label")},get placeholder(){return c.t("provider.custom.field.providerID.placeholder")},get description(){return c.t("provider.custom.field.providerID.description")},get value(){return n.providerID},onChange:v=>P("providerID",v),get validationState(){return n.err.providerID?"invalid":void 0},get error(){return n.err.providerID}}),null),t(h,e(J,{get label(){return c.t("provider.custom.field.name.label")},get placeholder(){return c.t("provider.custom.field.name.placeholder")},get value(){return n.name},onChange:v=>P("name",v),get validationState(){return n.err.name?"invalid":void 0},get error(){return n.err.name}}),null),t(h,e(J,{get label(){return c.t("provider.custom.field.baseURL.label")},get placeholder(){return c.t("provider.custom.field.baseURL.placeholder")},get value(){return n.baseURL},onChange:v=>P("baseURL",v),get validationState(){return n.err.baseURL?"invalid":void 0},get error(){return n.err.baseURL}}),null),t(h,e(J,{get label(){return c.t("provider.custom.field.apiKey.label")},get placeholder(){return c.t("provider.custom.field.apiKey.placeholder")},get description(){return c.t("provider.custom.field.apiKey.description")},get value(){return n.apiKey},onChange:v=>P("apiKey",v)}),null),t(q,()=>c.t("provider.custom.models.label")),t(U,e(pe,{get each(){return n.models},children:(v,H)=>(()=>{var V=Re(),G=V.firstChild,te=G.nextSibling;return t(G,e(J,{get label(){return c.t("provider.custom.models.id.label")},hideLabel:!0,get placeholder(){return c.t("provider.custom.models.id.placeholder")},get value(){return v.id},onChange:X=>$(H(),"id",X),get validationState(){return v.err.id?"invalid":void 0},get error(){return v.err.id}})),t(te,e(J,{get label(){return c.t("provider.custom.models.name.label")},hideLabel:!0,get placeholder(){return c.t("provider.custom.models.name.placeholder")},get value(){return v.name},onChange:X=>$(H(),"name",X),get validationState(){return v.err.name?"invalid":void 0},get error(){return v.err.name}})),t(V,e(he,{type:"button",icon:"trash",variant:"ghost",class:"mt-1.5",onClick:()=>g(H()),get disabled(){return n.models.length<=1},get"aria-label"(){return c.t("provider.custom.models.remove")}}),null),ve(()=>re(V,"data-row",v.row)),V})()}),null),t(U,e(ae,{type:"button",size:"small",variant:"ghost",icon:"plus-small",onClick:C,class:"self-start",get children(){return c.t("provider.custom.models.add")}}),null),t(ee,()=>c.t("provider.custom.headers.label")),t(z,e(pe,{get each(){return n.headers},children:(v,H)=>(()=>{var V=Re(),G=V.firstChild,te=G.nextSibling;return t(G,e(J,{get label(){return c.t("provider.custom.headers.key.label")},hideLabel:!0,get placeholder(){return c.t("provider.custom.headers.key.placeholder")},get value(){return v.key},onChange:X=>I(H(),"key",X),get validationState(){return v.err.key?"invalid":void 0},get error(){return v.err.key}})),t(te,e(J,{get label(){return c.t("provider.custom.headers.value.label")},hideLabel:!0,get placeholder(){return c.t("provider.custom.headers.value.placeholder")},get value(){return v.value},onChange:X=>I(H(),"value",X),get validationState(){return v.err.value?"invalid":void 0},get error(){return v.err.value}})),t(V,e(he,{type:"button",icon:"trash",variant:"ghost",class:"mt-1.5",onClick:()=>O(H()),get disabled(){return n.headers.length<=1},get"aria-label"(){return c.t("provider.custom.headers.remove")}}),null),ve(()=>re(V,"data-row",v.row)),V})()}),null),t(z,e(ae,{type:"button",size:"small",variant:"ghost",icon:"plus-small",onClick:S,class:"self-start",get children(){return c.t("provider.custom.headers.add")}}),null),t(B,e(ae,{class:"w-auto self-start",type:"submit",size:"large",variant:"primary",get disabled(){return W.isPending},get children(){return xe(()=>!!W.isPending)()?c.t("common.saving"):c.t("common.submit")}}),null),i})()}var xt=k('<button type=button class="flex size-5 items-center justify-center rounded-sm text-v2-icon-icon-muted hover:bg-v2-overlay-simple-overlay-hover focus-visible:bg-v2-overlay-simple-overlay-hover focus-visible:outline-none">'),bt=k('<div tabindex=-1 class="flex min-h-0 flex-1 flex-col outline-none">'),Be=k('<div class="text-14-regular text-text-weak">'),yt=k('<div class="px-1.25 w-full flex items-center gap-x-3"><span>'),_t=k('<div class="flex h-24 items-center justify-center text-[13px] font-[440] text-v2-text-text-muted">'),wt=k('<div class="flex min-h-0 flex-1 flex-col gap-4"><div class="shrink-0 px-1 pt-px"></div><div class="relative min-h-0 flex-1"><div class="flex size-full min-h-0 flex-col gap-4 overflow-y-auto pb-8 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"></div><div class="pointer-events-none absolute inset-x-0 bottom-0 h-10"style="background:linear-gradient(to bottom, transparent, var(--v2-background-bg-layer-01))">'),$t=k('<section class="flex flex-col"><div class="px-3 pb-2 text-[13px] font-[440] leading-none tracking-[-0.04px] text-v2-text-text-muted">'),kt=k('<span class="min-w-0 truncate font-[440] text-v2-text-text-muted">'),qe=k('<span class="flex h-4 shrink-0 items-center rounded-xs border-[0.5px] border-v2-border-border-base bg-v2-background-bg-layer-03 px-1 text-[11px] font-[530] leading-none tracking-[0.05px] text-v2-text-text-muted">'),Ct=k('<button type=button class="flex min-h-9 w-full items-center gap-2 rounded-md px-3 py-2.5 text-left text-[13px] leading-none tracking-[-0.04px] hover:bg-v2-overlay-simple-overlay-hover focus:bg-v2-overlay-simple-overlay-hover focus:outline-none"><span class="min-w-0 truncate font-[530] text-v2-text-text-base">'),St=k('<div class="w-full flex flex-col gap-1.5"><div class="text-14-regular text-text-base"></div><div>'),It=k('<form class="flex flex-col items-start gap-4">'),Dt=k('<div class="w-full flex items-center gap-x-2"><div class="w-4 h-2 rounded-[1px] bg-input-base shadow-xs-border-base flex items-center justify-center"><div class="w-2.5 h-0.5 ml-0 bg-icon-strong-base hidden"data-slot=list-item-extra-icon></div></div><span></span><span class="text-14-regular text-text-weak">'),Lt=k('<div class="flex flex-col gap-2"><div class="px-3 text-[13px] font-[440] leading-5 tracking-[-0.04px] text-v2-text-text-muted"></div><div class="flex flex-col">'),Pt=k('<button type=button class="group flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-[13px] leading-5 tracking-[-0.04px] hover:bg-v2-overlay-simple-overlay-hover focus-visible:bg-v2-overlay-simple-overlay-hover focus-visible:outline-none"><span class="flex h-2 w-4 shrink-0 items-center justify-center rounded-[1px] bg-v2-background-bg-base shadow-[var(--v2-elevation-button-neutral)]"><span class="hidden h-0.5 w-2.5 bg-v2-icon-icon-base group-hover:block group-focus-visible:block"></span></span><span class="font-[530] text-v2-text-text-base">'),zt=k('<span class="font-[440] text-v2-text-text-muted">'),Oe=k('<div class="text-14-regular text-text-base">'),Et=k("<div>"),Kt=k('<div class="w-full flex items-center gap-x-2"><div class="w-4 h-2 rounded-[1px] bg-input-base shadow-xs-border-base flex items-center justify-center"><div class="w-2.5 h-0.5 ml-0 bg-icon-strong-base hidden"data-slot=list-item-extra-icon></div></div><span>'),Mt=k('<div class="flex flex-col gap-5"><div></div><div></div><div>'),Rt=k('<div class="flex flex-col gap-5 px-3 text-[13px] font-[440] leading-5 tracking-[-0.04px] text-v2-text-text-muted"><form class="flex flex-col items-start gap-5 self-stretch"><label class="flex w-full flex-col gap-1 font-[530] leading-4 text-v2-text-text-base">'),Te=k('<div role=alert class="-mt-4 text-xs text-v2-state-fg-danger">'),Bt=k('<div class="flex flex-col gap-4"><div class="text-14-regular text-text-base"></div><div class="text-14-regular text-text-base"></div><div class="text-14-regular text-text-base">'),qt=k('<div class="flex flex-col gap-6"><form class="flex flex-col items-start gap-4">'),Ot=k('<div class="flex flex-col gap-5 px-3 text-[13px] font-[440] leading-5 tracking-[-0.04px] text-v2-text-text-muted"><div></div><form class="flex flex-col items-start gap-5 self-stretch"><label class="flex w-full flex-col gap-1 font-[530] leading-4 text-v2-text-text-base">'),Tt=k('<div class="flex flex-col gap-6"><div class="text-14-regular text-text-base"></div><form class="flex flex-col items-start gap-4">'),Ft=k('<div class="flex flex-col gap-6"><div class="text-14-regular text-text-base"></div><div class="text-14-regular text-text-base flex items-center gap-4"><span>'),$e=k('<div class="text-14-regular text-text-base"><div class="flex items-center gap-x-2"><span>'),Ut=k("<div><div><div></div></div><div><div>");const Q="_custom";function Ge(a={}){const[K,y]=ne({selected:void 0}),d=()=>y("selected",void 0);return{selected:()=>K.selected,select:c=>y("selected",c),back:a.onBack??d}}const jt=a=>{const K=Ge(),y=a.controller??K,d=se(),n=Ie().general.newLayoutDesigns,M=y.back,C={current:M};let g;const S=()=>g?.focus({preventScroll:!0}),O=$=>{C.current=M,y.select($)};function P(){return e(ie,{get children(){return[e(F,{get when(){return y.selected()===Q},get children(){return e(He,{get autofocus(){return!n()}})}}),e(F,{get when(){return xe(()=>!!(y.selected()&&y.selected()!==Q))()?y.selected():void 0},children:$=>e(Zt,{get provider(){return $()},get directory(){return a.directory},onBack:M,setBack:I=>C.current=I})}),e(F,{when:!0,get children(){return e(Vt,{get directory(){return a.directory},onSelect:O,get onPrepare(){return n()?S:void 0}})}})]}})}return e(j,{get when(){return n()},get fallback(){return e(Ve,{class:"h-full",transition:!0,get title(){return e(j,{get when(){return y.selected()},get fallback(){return d.t("command.provider.connect")},get children(){return e(he,{tabIndex:-1,icon:"arrow-left",variant:"ghost",onClick:()=>C.current(),get"aria-label"(){return d.t("common.goBack")}})}})},get children(){return e(P,{})}})},get children(){return e(rt,{containerClass:"!h-[min(calc(100vh_-_16px),512px)] !w-[min(calc(100vw_-_16px),640px)]",class:"[font-family:var(--v2-font-family-sans)] [&_[data-slot=dialog-header]]:!px-5 [&_[data-slot=dialog-header-title]]:!text-[15px] [&_[data-slot=dialog-header-title]]:!tracking-[-0.13px]",get children(){return[e(nt,{get closeLabel(){return d.t("common.close")},get children(){return e(j,{get when(){return y.selected()},get fallback(){return e(ot,{get children(){return d.t("command.provider.connect")}})},get children(){var $=xt();return $.$$click=()=>C.current(),t($,e(De,{name:"arrow-left",size:"small"})),ve(()=>re($,"aria-label",d.t("common.goBack"))),$}})}}),e(it,{class:"min-h-0 flex-1 overflow-hidden px-2 pb-2",get children(){var $=bt(),I=g;return typeof I=="function"?Ae(I,$):g=$,t($,e(P,{})),$}})]}})}})};function Vt(a){if(Ie().general.newLayoutDesigns())return e(At,{get directory(){return a.directory},get onSelect(){return a.onSelect},get onPrepare(){return a.onPrepare}});const y=Le(()=>a.directory?.()),d=se(),c=()=>d.t("dialog.provider.group.popular"),n=()=>d.t("dialog.provider.group.other"),M=()=>d.t("settings.providers.tag.custom"),C=g=>{if(g==="anthropic")return d.t("dialog.provider.anthropic.note");if(g==="openai")return d.t("dialog.provider.openai.note");if(g.startsWith("github-copilot"))return d.t("dialog.provider.copilot.note");if(g==="opencode-go")return d.t("dialog.provider.opencodeGo.tagline")};return e(Ce,{class:"px-3",get search(){return{placeholder:d.t("dialog.provider.search.placeholder"),autofocus:!0}},get emptyMessage(){return d.t("dialog.provider.empty")},activeIcon:"plus-small",key:g=>g?.id,items:()=>(d.locale(),[{id:Q,name:M()},...y.all().values()]),filterKeys:["id","name"],groupBy:g=>de.includes(g.id)?c():n(),sortBy:(g,S)=>g.id===Q?-1:S.id===Q?1:de.includes(g.id)&&de.includes(S.id)?de.indexOf(g.id)-de.indexOf(S.id):g.name.localeCompare(S.name),sortGroupsBy:(g,S)=>{const O=c();return g.category===O&&S.category!==O?-1:S.category===O&&g.category!==O?1:0},onSelect:g=>{g&&a.onSelect(g.id)},children:g=>(()=>{var S=yt(),O=S.firstChild;return t(S,e(be,{"data-slot":"list-item-extra-icon",get id(){return g.id}}),O),t(O,()=>g.name),t(S,e(j,{get when(){return g.id==="opencode"},get children(){var P=Be();return t(P,()=>d.t("dialog.provider.opencode.tagline")),P}}),null),t(S,e(j,{get when(){return g.id===Q},get children(){return e(we,{get children(){return d.t("settings.providers.tag.custom")}})}}),null),t(S,e(j,{get when(){return g.id==="opencode"},get children(){return e(we,{get children(){return d.t("dialog.provider.tag.recommended")}})}}),null),t(S,e(j,{get when(){return C(g.id)},children:P=>(()=>{var $=Be();return t($,P),$})()}),null),t(S,e(j,{get when(){return g.id==="opencode-go"},get children(){return e(we,{get children(){return d.t("dialog.provider.tag.recommended")}})}}),null),S})()})}function At(a){const K=Le(()=>a.directory?.()),y=se(),[d,c]=ne({filter:"",active:void 0,connecting:void 0}),n=["opencode","opencode-go","anthropic","openai","google","openrouter","vercel"],M=()=>({id:Q,name:y.t("dialog.provider.custom.label")}),C=A(()=>{y.locale();const _=d.filter.trim().toLowerCase(),i=[M(),...K.all().values()];return _?i.filter(l=>`${l.id} ${l.name}`.toLowerCase().includes(_)):i}),g=A(()=>C().filter(_=>n.includes(_.id)).sort((_,i)=>n.indexOf(_.id)-n.indexOf(i.id))),S=A(()=>C().filter(_=>!n.includes(_.id)).sort((_,i)=>_.id===Q?-1:i.id===Q?1:_.name.localeCompare(i.name))),O=A(()=>[...g(),...S()]);let P,$;fe(()=>$?.focus({preventScroll:!0}));const I=_=>{a.onPrepare?.(),a.onSelect(_)},Y=(_,i)=>{const l=O();if(l.length===0)return;const R=l.findIndex(L=>L.id===d.active),B=R<0?i>0?0:l.length-1:(R+i+l.length)%l.length;c("active",l[B].id),P?.querySelector(`[data-provider-id="${CSS.escape(l[B].id)}"]`)?.focus({preventScroll:!0}),_.preventDefault()},W=_=>{if(_.key==="ArrowDown")return Y(_,1);if(_.key==="ArrowUp")return Y(_,-1);_.key!=="Enter"||!d.active||(I(d.active),_.preventDefault())};return(()=>{var _=wt(),i=_.firstChild,l=i.nextSibling,R=l.firstChild;R.nextSibling,_.$$keydown=W;var B=P;return typeof B=="function"?Ae(B,_):P=_,t(i,e(Se,{ref(L){var h=$;typeof h=="function"?h(L):$=L},type:"search",class:"!w-full [font-family:var(--v2-font-family-sans)]",get leadingIcon(){return e(De,{name:"magnifying-glass",size:"small"})},get placeholder(){return y.t("dialog.provider.search.placeholder")},get value(){return d.filter},onInput:L=>{c({filter:L.currentTarget.value,active:void 0})}})),t(R,e(pe,{get each(){return[{title:y.t("dialog.provider.group.popular"),items:g},{title:y.t("dialog.provider.group.other"),items:S}]},children:L=>e(j,{get when(){return L.items().length>0},get children(){var h=$t(),U=h.firstChild;return t(U,()=>L.title),t(h,e(pe,{get each(){return L.items()},children:q=>(()=>{var z=Ct(),ee=z.firstChild;return z.$$click=()=>I(q.id),z.addEventListener("mouseenter",()=>c("active",q.id)),t(z,e(be,{get id(){return q.id},class:"size-4 shrink-0 text-v2-icon-icon-base"}),ee),t(ee,()=>q.name),t(z,e(j,{get when(){return q.id==="opencode"||q.id==="opencode-go"},get children(){return[(()=>{var v=kt();return t(v,()=>y.t(q.id==="opencode"?"dialog.provider.opencode.tagline":"dialog.provider.opencodeGo.tagline")),v})(),(()=>{var v=qe();return t(v,()=>y.t("dialog.provider.tag.recommended")),v})()]}}),null),t(z,e(j,{get when(){return q.id===Q},get children(){var v=qe();return t(v,()=>y.t("settings.providers.tag.custom")),v}}),null),t(z,e(j,{get when(){return d.connecting===q.id},get children(){return e(me,{class:"ml-auto size-4 shrink-0 text-v2-icon-icon-muted"})}}),null),ve(v=>{var H=q.id,V=d.active===q.id,G=d.connecting!==void 0,te=d.connecting===q.id;return H!==v.e&&re(z,"data-provider-id",v.e=H),V!==v.t&&z.classList.toggle("bg-v2-overlay-simple-overlay-hover",v.t=V),G!==v.a&&(z.disabled=v.a=G),te!==v.o&&re(z,"aria-busy",v.o=te),v},{e:void 0,t:void 0,a:void 0,o:void 0}),z})()}),null),h}})}),null),t(R,e(j,{get when(){return O().length===0},get children(){var L=_t();return t(L,()=>y.t("dialog.provider.empty")),L}}),null),_})()}function Zt(a){const K=Fe(),y=Ue(),d=je(),c=lt(),n=se(),C=Ie().general.newLayoutDesigns,g=Le(()=>a.directory?.()),S=()=>a.directory?.()??dt(c.dir),O=()=>{const r=S();return r?{directory:r}:void 0},P={value:!0},$={current:void 0};at(()=>{P.value=!1,$.current!==void 0&&(clearTimeout($.current),$.current=void 0)});const I=A(()=>g.all().get(a.provider)??y().data.provider.all.get(a.provider)),Y=A(()=>[{type:"key",label:n.t("provider.connect.method.apiKey")}]),[W]=st(()=>({provider:a.provider,directory:S()}),r=>d().api.integration.get({integrationID:r.provider,location:r.directory?{directory:r.directory}:void 0}).then(o=>o.data)),_=A(()=>W.loading),i=A(()=>{const r=W.latest?.methods.filter(o=>o.type==="key"||o.type==="oauth");return r?.length?r:Y()}),[l,R]=ne({methodIndex:void 0,authorization:void 0,promptInputs:void 0,state:"pending",error:void 0});function B(r){R(ue(o=>{if(r.type==="method.select"){o.methodIndex=r.index,o.authorization=void 0,o.promptInputs=void 0,o.state=void 0,o.error=void 0;return}if(r.type==="method.reset"){o.methodIndex=void 0,o.authorization=void 0,o.promptInputs=void 0,o.state=void 0,o.error=void 0;return}if(r.type==="auth.prompt"){o.state="prompt",o.error=void 0;return}if(r.type==="auth.inputs"){o.promptInputs=r.inputs,o.state=void 0,o.error=void 0;return}if(r.type==="auth.pending"){o.state="pending",o.error=void 0;return}if(r.type==="auth.complete"){o.state="complete",o.authorization=r.authorization,o.error=void 0;return}o.state="error",o.error=r.error}))}const L=A(()=>l.methodIndex!==void 0?i().at(l.methodIndex):void 0),h=r=>r?r.type==="key"?n.t("provider.connect.method.apiKey"):r.label??"":"",U=r=>{const o=h(r),s=r?.label?.match(/\s+\((browser|headless)\)$/i),x=s?.[1];return{label:s?o.slice(0,-s[0].length):o,hint:x?.toLowerCase()==="headless"?n.t("provider.connect.method.headless"):x?.toLowerCase()==="browser"||!x&&r?.type==="key"?n.t("provider.connect.method.browser"):void 0}};function q(r,o){if(r&&typeof r=="object"&&"data"in r){const s=r.data;if(typeof s?.message=="string"&&s.message)return s.message}if(r&&typeof r=="object"&&"error"in r){const s=q(r.error,"");if(s)return s}if(r&&typeof r=="object"&&"message"in r){const s=r.message;if(typeof s=="string"&&s)return s}return r instanceof Error&&r.message?r.message:typeof r=="string"&&r?r:o}async function z(r,o){$.current!==void 0&&(clearTimeout($.current),$.current=void 0);const s=i()[r];if(B({type:"method.select",index:r}),s.type==="oauth"){if(s.prompts?.length&&!o){B({type:"auth.prompt"});return}B({type:"auth.pending"}),await d().api.integration.oauth.connect({integrationID:a.provider,methodID:s.id,inputs:o??{},location:O()}).then(x=>{P.value&&B({type:"auth.complete",authorization:x.data})}).catch(x=>{P.value&&B({type:"auth.error",error:q(x,n.t("common.requestFailed"))})})}}function ee(){const[r,o]=ne({value:{},index:0}),s=A(()=>{const b=L();return b?.type==="oauth"?b.prompts??[]:[]}),x=(b,T)=>{if(!b.when)return!0;const Z=T[b.when.key];return Z===void 0?!1:b.when.op==="eq"?Z===b.when.value:Z!==b.when.value},E=A(()=>{const b=s(),T=b.findIndex((Z,ce)=>ce>=r.index&&x(Z,r.value));if(T!==-1)return{index:T,prompt:b[T]}}),u=A(()=>{const b=E();return!b||b.prompt.type!=="text"?!1:(r.value[b.prompt.key]??"").trim().length>0});async function p(b,T){if(l.methodIndex===void 0)return;const Z=s().findIndex((ce,N)=>N>b&&x(ce,T));if(Z!==-1){o("index",Z);return}await z(l.methodIndex,T)}async function m(b){b.preventDefault();const T=E();!T||T.prompt.type!=="text"||u()&&await p(T.index,r.value)}const f=()=>E(),w=A(()=>{const b=f()?.prompt;if(!(!b||b.type!=="text"))return b}),D=A(()=>{const b=f()?.prompt;if(!(!b||b.type!=="select"))return b});return(()=>{var b=It();return b.addEventListener("submit",m),t(b,e(ie,{get children(){return[e(F,{get when(){return f()?.prompt.type==="text"},get children(){return[e(J,{type:"text",get label(){return w()?.message??""},get placeholder(){return w()?.placeholder},get value(){return xe(()=>!!w())()?r.value[w().key]??"":""},onChange:T=>{const Z=w();Z&&o("value",Z.key,T)}}),e(ae,{class:"w-auto",type:"submit",size:"large",variant:"primary",get disabled(){return!u()},get children(){return n.t("common.continue")}})]}}),e(F,{get when(){return f()?.prompt.type==="select"},get children(){var T=St(),Z=T.firstChild,ce=Z.nextSibling;return t(Z,()=>D()?.message),t(ce,e(Ce,{class:"px-3",get items(){return D()?.options??[]},key:N=>N.value,get current(){return D()?.options.find(N=>N.value===r.value[D().key])},onSelect:N=>{if(!N)return;const oe=D();if(!oe)return;const ye={...r.value,[oe.key]:N.value};o("value",oe.key,N.value),p(f().index,ye)},children:N=>(()=>{var oe=Dt(),ye=oe.firstChild,Pe=ye.nextSibling,Qe=Pe.nextSibling;return t(Pe,()=>N.label),t(Qe,()=>N.hint),oe})()})),T}})]}})),b})()}let v;function H(r){r.key==="Enter"&&r.target instanceof HTMLInputElement||r.key!=="Escape"&&v?.onKeyDown(r)}let V=!1;ct(()=>{V||_()||i().length===1&&(V=!0,z(0))});async function G(){await y().refreshProviders().catch(()=>{}),K.close(),ke({variant:"success",icon:"circle-check",title:n.t("provider.connect.toast.connected.title",{provider:I().name}),description:n.t("provider.connect.toast.connected.description",{provider:I().name})})}function te(){if(i().length>1&&l.methodIndex!==void 0){B({type:"method.reset"});return}a.onBack()}a.setBack(te);function X(){return C()?(()=>{var r=Lt(),o=r.firstChild,s=o.nextSibling;return t(o,()=>n.t("provider.connect.selectMethod",{provider:I().name})),t(s,e(pe,{get each(){return i()},children:(x,E)=>{const u=()=>U(x);return(()=>{var p=Pt(),m=p.firstChild,f=m.nextSibling;return p.$$click=()=>void z(E()),t(f,()=>u().label),t(p,e(j,{get when(){return u().hint},children:w=>(()=>{var D=zt();return t(D,w),D})()}),null),p})()}})),r})():[(()=>{var r=Oe();return t(r,()=>n.t("provider.connect.selectMethod",{provider:I().name})),r})(),(()=>{var r=Et();return t(r,e(Ce,{class:"px-3",ref:o=>{v=o},items:i,key:o=>o?.label??o?.type,onSelect:async(o,s)=>{o&&z(s)},children:o=>(()=>{var s=Kt(),x=s.firstChild,E=x.nextSibling;return t(E,()=>h(o)),s})()})),r})()]}function Ne(){let r;const o=ze(),[s,x]=ne({value:"",error:void 0});fe(()=>{C()&&r?.focus({preventScroll:!0})});async function E(u){u.preventDefault();const p=u.currentTarget,f=new FormData(p).get("apiKey");if(!f?.trim()){x("error",n.t("provider.connect.apiKey.required"));return}x("error",void 0),await d().api.integration.connect.key({integrationID:a.provider,location:O(),key:f}),await G()}return C()?(()=>{var u=Rt(),p=u.firstChild,m=p.firstChild;return t(u,e(j,{get when(){return I().id==="opencode"},get fallback(){return n.t("provider.connect.apiKey.description",{provider:I().name})},get children(){var f=Mt(),w=f.firstChild,D=w.nextSibling,b=D.nextSibling;return t(w,()=>n.t("provider.connect.opencodeZen.line1")),t(D,()=>n.t("provider.connect.opencodeZen.line2")),t(b,()=>n.t("provider.connect.opencodeZen.visit.prefix"),null),t(b,e(le,{href:"https://opencode.ai/zen",class:"text-v2-text-text-base focus-visible:rounded-xs focus-visible:outline-2 focus-visible:outline-v2-border-border-focus",get children(){return n.t("provider.connect.opencodeZen.visit.link")}}),null),t(b,()=>n.t("provider.connect.opencodeZen.visit.suffix"),null),f}}),p),p.addEventListener("submit",E),t(m,()=>n.t("provider.connect.apiKey.label",{provider:I().name}),null),t(m,e(Se,{ref(f){var w=r;typeof w=="function"?w(f):r=f},class:"!w-full",name:"apiKey","data-input":"provider-api-key",get placeholder(){return n.t("provider.connect.apiKey.placeholder")},get value(){return s.value},get invalid(){return s.error!==void 0},get"aria-describedby"(){return s.error?o:void 0},autocomplete:"off",spellcheck:!1,onInput:f=>x("value",f.currentTarget.value)}),null),t(p,e(j,{get when(){return s.error},children:f=>(()=>{var w=Te();return re(w,"id",o),t(w,f),w})()}),null),t(p,e(Ee,{type:"submit",variant:"contrast","data-action":"provider-connect-submit",get children(){return n.t("common.continue")}}),null),u})():(()=>{var u=qt(),p=u.firstChild;return t(u,e(ie,{get children(){return[e(F,{get when(){return I().id==="opencode"},get children(){var m=Bt(),f=m.firstChild,w=f.nextSibling,D=w.nextSibling;return t(f,()=>n.t("provider.connect.opencodeZen.line1")),t(w,()=>n.t("provider.connect.opencodeZen.line2")),t(D,()=>n.t("provider.connect.opencodeZen.visit.prefix"),null),t(D,e(le,{href:"https://opencode.ai/zen",tabIndex:-1,get children(){return n.t("provider.connect.opencodeZen.visit.link")}}),null),t(D,()=>n.t("provider.connect.opencodeZen.visit.suffix"),null),m}}),e(F,{when:!0,get children(){var m=Oe();return t(m,()=>n.t("provider.connect.apiKey.description",{provider:I().name})),m}})]}}),p),p.addEventListener("submit",E),t(p,e(J,{get autofocus(){return!C()},ref(m){var f=r;typeof f=="function"?f(m):r=m},type:"text",get label(){return n.t("provider.connect.apiKey.label",{provider:I().name})},get placeholder(){return n.t("provider.connect.apiKey.placeholder")},name:"apiKey",get value(){return s.value},onChange:m=>x("value",m),get validationState(){return s.error?"invalid":void 0},get error(){return s.error}}),null),t(p,e(ae,{class:"w-auto",type:"submit",size:"large",variant:"primary",get children(){return n.t("common.continue")}}),null),u})()}function Je(){let r;const o=ze(),[s,x]=ne({value:"",error:void 0});fe(()=>{C()&&r?.focus({preventScroll:!0})});async function E(u){u.preventDefault();const p=u.currentTarget,f=new FormData(p).get("code");if(!f?.trim()){x("error",n.t("provider.connect.oauth.code.required"));return}x("error",void 0);const w=await d().api.integration.oauth.complete({integrationID:a.provider,attemptID:l.authorization.attemptID,location:O(),code:f}).then(()=>({ok:!0})).catch(D=>({ok:!1,error:D}));if(w.ok){await G();return}x("error",q(w.error,n.t("provider.connect.oauth.code.invalid")))}return C()?(()=>{var u=Ot(),p=u.firstChild,m=p.nextSibling,f=m.firstChild;return t(p,()=>n.t("provider.connect.oauth.code.visit.prefix"),null),t(p,e(le,{get href(){return l.authorization.url},class:"text-v2-text-text-base",get children(){return n.t("provider.connect.oauth.code.visit.link")}}),null),t(p,()=>n.t("provider.connect.oauth.code.visit.suffix",{provider:I().name}),null),m.addEventListener("submit",E),t(f,()=>n.t("provider.connect.oauth.code.label",{method:L()?.label??""}),null),t(f,e(Se,{ref(w){var D=r;typeof D=="function"?D(w):r=w},class:"!w-full",name:"code",get placeholder(){return n.t("provider.connect.oauth.code.placeholder")},get value(){return s.value},get invalid(){return s.error!==void 0},get"aria-describedby"(){return s.error?o:void 0},autocomplete:"off",spellcheck:!1,onInput:w=>x("value",w.currentTarget.value)}),null),t(m,e(j,{get when(){return s.error},children:w=>(()=>{var D=Te();return re(D,"id",o),t(D,w),D})()}),null),t(m,e(Ee,{type:"submit",variant:"contrast",get children(){return n.t("common.continue")}}),null),u})():(()=>{var u=Tt(),p=u.firstChild,m=p.nextSibling;return t(p,()=>n.t("provider.connect.oauth.code.visit.prefix"),null),t(p,e(le,{get href(){return l.authorization.url},get children(){return n.t("provider.connect.oauth.code.visit.link")}}),null),t(p,()=>n.t("provider.connect.oauth.code.visit.suffix",{provider:I().name}),null),m.addEventListener("submit",E),t(m,e(J,{get autofocus(){return!C()},ref(f){var w=r;typeof w=="function"?w(f):r=f},type:"text",get label(){return n.t("provider.connect.oauth.code.label",{method:L()?.label??""})},get placeholder(){return n.t("provider.connect.oauth.code.placeholder")},name:"code",get value(){return s.value},onChange:f=>x("value",f),get validationState(){return s.error?"invalid":void 0},get error(){return s.error}}),null),t(m,e(ae,{class:"w-auto",type:"submit",size:"large",variant:"primary",get children(){return n.t("common.continue")}}),null),u})()}function We(){const r=A(()=>{const o=l.authorization?.instructions;return o?.includes(":")?o.split(":").pop()?.trim():o});return fe(()=>{const o=async()=>{const s=l.authorization;if(!s||!P.value)return;const x=await d().api.integration.oauth.status({integrationID:a.provider,attemptID:s.attemptID,location:O()}).then(E=>({ok:!0,status:E.data})).catch(E=>({ok:!1,error:E}));if(P.value){if(!x.ok){B({type:"auth.error",error:q(x.error,n.t("common.requestFailed"))});return}if(x.status.status==="complete"){await G();return}if(x.status.status==="failed"){B({type:"auth.error",error:x.status.message});return}if(x.status.status==="expired"){B({type:"auth.error",error:n.t("common.requestFailed")});return}$.current=setTimeout(o,1e3)}};o()}),(()=>{var o=Ft(),s=o.firstChild,x=s.nextSibling,E=x.firstChild;return t(s,()=>n.t("provider.connect.oauth.auto.visit.prefix"),null),t(s,e(le,{get href(){return l.authorization.url},get children(){return n.t("provider.connect.oauth.auto.visit.link")}}),null),t(s,()=>n.t("provider.connect.oauth.auto.visit.suffix",{provider:I().name}),null),t(o,e(J,{get label(){return n.t("provider.connect.oauth.auto.confirmationCode")},class:"font-mono",get value(){return r()},readOnly:!0,copyable:!0}),x),t(x,e(me,{}),E),t(E,()=>n.t("provider.connect.status.waiting")),o})()}return(()=>{var r=Ut(),o=r.firstChild,s=o.firstChild,x=o.nextSibling,E=x.firstChild;return t(o,e(be,{get id(){return a.provider},get class(){return C()?"mt-0.5 size-4 shrink-0 text-v2-icon-icon-base":"size-5 shrink-0 icon-strong-base"}}),s),t(s,e(ie,{get children(){return[e(F,{get when(){return xe(()=>a.provider==="anthropic")()&&L()?.label?.toLowerCase().includes("max")},get children(){return n.t("provider.connect.title.anthropicProMax")}}),e(F,{when:!0,get children(){return n.t("provider.connect.title",{provider:I().name})}})]}})),E.$$keydown=H,t(E,e(ie,{get children(){return[e(F,{get when(){return _()},get children(){var u=$e(),p=u.firstChild,m=p.firstChild;return t(p,e(me,{}),m),t(m,()=>n.t("provider.connect.status.inProgress")),u}}),e(F,{get when(){return l.methodIndex===void 0},get children(){return e(X,{})}}),e(F,{get when(){return l.state==="pending"},get children(){var u=$e(),p=u.firstChild,m=p.firstChild;return t(p,e(me,{}),m),t(m,()=>n.t("provider.connect.status.inProgress")),u}}),e(F,{get when(){return l.state==="prompt"},get children(){return e(ee,{})}}),e(F,{get when(){return l.state==="error"},get children(){var u=$e(),p=u.firstChild,m=p.firstChild;return t(p,e(De,{name:"circle-ban-sign",class:"text-icon-critical-base"}),m),t(m,()=>n.t("provider.connect.status.failed",{error:l.error??""})),u}}),e(F,{get when(){return L()?.type==="key"},get children(){return e(Ne,{})}}),e(F,{get when(){return L()?.type==="oauth"},get children(){return e(ie,{get children(){return[e(F,{get when(){return l.authorization?.mode==="code"},get children(){return e(Je,{})}}),e(F,{get when(){return l.authorization?.mode==="auto"},get children(){return e(We,{})}})]}})}})]}})),ve(u=>{var p=C()?"flex min-h-0 flex-1 flex-col":"flex flex-col gap-6 px-2.5 pb-3",m=C()?"flex h-10 shrink-0 items-start gap-2 px-3":"flex items-center gap-4 px-2.5",f=C()?"text-[15px] font-[530] leading-5 tracking-[-0.13px] text-v2-text-text-base":"text-16-medium text-text-strong",w=C()?"flex min-h-0 flex-1 flex-col":"flex flex-col gap-6 px-2.5 pb-10",D=C()?void 0:0,b=!C()&&l.methodIndex===void 0?!0:void 0;return p!==u.e&&ge(r,u.e=p),m!==u.t&&ge(o,u.t=m),f!==u.a&&ge(s,u.a=f),w!==u.o&&ge(x,u.o=w),D!==u.i&&re(E,"tabindex",u.i=D),b!==u.n&&(E.autofocus=u.n=b),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})()}ut(["click","keydown"]);const Nt=Object.freeze(Object.defineProperty({__proto__:null,DialogConnectProvider:jt,useProviderConnectController:Ge},Symbol.toStringTag,{value:"Module"}));export{jt as D,le as E,Gt as a,Nt as d,Ge as u};
|
|
2
|
+
//# sourceMappingURL=dialog-connect-provider-cMnfONyq.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=dialog-edit-project-
|
|
1
|
+
import{c0 as F,au as s,aj as u,b7 as r,aa as z,a2 as O,aI as y,bG as m,A as L,bd as A,a_ as E,b2 as M,I as H,bR as T,o as G,ap as P,B as I,bb as K,b as V,bM as g,aS as Y}from"./index-BH1J9J8E.js";import{c as q}from"./edit-project-CuOMp3mF.js";var J=g('<div class="flex flex-col gap-2"><label class="text-12-medium text-text-weak"></label><div class="flex gap-1.5">'),Q=g('<form class="flex flex-col gap-6 p-6 pt-0"><div class="flex flex-col gap-4"><div class="flex flex-col gap-2"><label class="text-12-medium text-text-weak"></label><div class="flex gap-3 items-start"><div class=relative><div class="relative size-16 rounded-md transition-colors cursor-pointer"></div><div class="absolute inset-0 size-16 bg-surface-raised-stronger-non-alpha/90 rounded-[6px] z-10 pointer-events-none flex items-center justify-center transition-opacity"></div><div class="absolute inset-0 size-16 bg-surface-raised-stronger-non-alpha/90 rounded-[6px] z-10 pointer-events-none flex items-center justify-center transition-opacity"></div></div><input id=icon-upload type=file accept=image/* class=hidden><div class="flex flex-col gap-1.5 text-12-regular text-text-weak self-center"><span></span><span></span></div></div></div></div><div class="flex justify-end gap-2">'),U=g('<div class="size-full flex items-center justify-center">'),W=g('<img class="size-full object-cover">'),X=g("<button type=button>");const Z=["pink","mint","orange","purple","cyan","lime"];function re(b){const a=F(),e=q(b);return s(V,{get title(){return a.t("dialog.project.edit.title")},class:"w-full max-w-[480px] mx-auto",get children(){var x=Q(),v=x.firstChild,w=v.firstChild,_=w.firstChild,R=_.nextSibling,f=R.firstChild,d=f.firstChild,p=d.nextSibling,h=p.nextSibling,j=f.nextSibling,N=j.nextSibling,k=N.firstChild,B=k.nextSibling,S=v.nextSibling;return u(x,"submit",e.submit),r(v,s(z,{autofocus:!0,type:"text",get label(){return a.t("dialog.project.edit.name")},get placeholder(){return e.folderName()},get value(){return e.store.name},onChange:t=>e.setStore("name",t)}),w),r(_,()=>a.t("dialog.project.edit.icon")),f.addEventListener("mouseleave",()=>e.setStore("iconHover",!1)),f.addEventListener("mouseenter",()=>e.setStore("iconHover",!0)),u(d,"click",e.iconClick,!0),u(d,"dragleave",e.dragLeave),u(d,"dragover",e.dragOver),u(d,"drop",e.drop),r(d,s(O,{get when(){return M(b.project.id,{color:e.store.color,url:b.project.icon?.url,override:e.store.iconOverride})},get fallback(){return(()=>{var t=U();return r(t,s(L,A({get fallback(){return e.store.name||e.defaultName()}},()=>E(e.store.color),{class:"size-full text-[32px]"}))),t})()},children:t=>(()=>{var c=W();return y(l=>{var o=t(),i=a.t("dialog.project.edit.icon.alt");return o!==l.e&&m(c,"src",l.e=o),i!==l.t&&m(c,"alt",l.t=i),l},{e:void 0,t:void 0}),c})()})),r(p,s(H,{name:"cloud-upload",size:"large",class:"text-icon-on-interactive-base drop-shadow-sm"})),r(h,s(H,{name:"trash",size:"large",class:"text-icon-on-interactive-base drop-shadow-sm"})),u(j,"change",e.inputChange),T(t=>{e.setIconInput(t)},j),r(k,()=>a.t("dialog.project.edit.icon.hint")),r(B,()=>a.t("dialog.project.edit.icon.recommended")),r(v,s(O,{get when(){return!e.store.iconOverride},get children(){var t=J(),c=t.firstChild,l=c.nextSibling;return r(c,()=>a.t("dialog.project.edit.color")),r(l,s(G,{each:Z,children:o=>(()=>{var i=X();return i.$$click=()=>{e.store.color===o&&!b.project.icon?.url||e.setStore("color",e.store.color===o?void 0:o)},r(i,s(L,A({get fallback(){return e.store.name||e.defaultName()}},()=>E(o),{class:"size-full rounded"}))),y(n=>{var $=a.t("dialog.project.edit.color.select",{color:o}),C=e.store.color===o,D={"flex items-center justify-center size-10 p-0.5 rounded-lg overflow-hidden transition-colors cursor-default":!0,"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover":e.store.color===o,"bg-transparent border border-transparent hover:bg-surface-base-hover hover:border-border-weak-base":e.store.color!==o};return $!==n.e&&m(i,"aria-label",n.e=$),C!==n.t&&m(i,"aria-pressed",n.t=C),n.a=P(i,D,n.a),n},{e:void 0,t:void 0,a:void 0}),i})()})),t}}),null),r(v,s(z,{multiline:!0,get label(){return a.t("dialog.project.edit.worktree.startup")},get description(){return a.t("dialog.project.edit.worktree.startup.description")},get placeholder(){return a.t("dialog.project.edit.worktree.startup.placeholder")},get value(){return e.store.startup},onChange:t=>e.setStore("startup",t),spellcheck:!1,class:"max-h-14 w-full overflow-y-auto font-mono text-xs"}),null),r(S,s(I,{type:"button",variant:"ghost",size:"large",get onClick(){return e.close},get children(){return a.t("common.cancel")}}),null),r(S,s(I,{type:"submit",variant:"primary",size:"large",get disabled(){return e.save.isPending},get children(){return K(()=>!!e.save.isPending)()?a.t("common.saving"):a.t("common.save")}}),null),y(t=>{var c={"border-text-interactive-base bg-surface-info-base/20":e.store.dragOver,"border-border-base hover:border-border-strong":!e.store.dragOver,"overflow-hidden":!!e.store.iconOverride},l=!!(e.store.iconHover&&!e.store.iconOverride),o=!(e.store.iconHover&&!e.store.iconOverride),i=!!(e.store.iconHover&&e.store.iconOverride),n=!(e.store.iconHover&&e.store.iconOverride);return t.e=P(d,c,t.e),l!==t.t&&p.classList.toggle("opacity-100",t.t=l),o!==t.a&&p.classList.toggle("opacity-0",t.a=o),i!==t.o&&h.classList.toggle("opacity-100",t.o=i),n!==t.i&&h.classList.toggle("opacity-0",t.i=n),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),x}})}Y(["click"]);export{re as DialogEditProject};
|
|
2
|
+
//# sourceMappingURL=dialog-edit-project-BTKo4L8c.js.map
|
package/bin/web/assets/{dialog-edit-project-v2-TbsDREdW.js → dialog-edit-project-v2-BgxhNrB_.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{bJ as L,aO as P,aL as H,bn as A,ax as N,au as n,bK as y,bd as j,b7 as o,bR as T,bm as D,ad as z,aI as k,bG as _,a2 as R,bM as x,av as Z,bV as q,aS as M,ap as V,
|
|
2
|
-
//# sourceMappingURL=dialog-edit-project-v2-
|
|
1
|
+
import{bJ as L,aO as P,aL as H,bn as A,ax as N,au as n,bK as y,bd as j,b7 as o,bR as T,bm as D,ad as z,aI as k,bG as _,a2 as R,bM as x,av as Z,bV as q,aS as M,ap as V,c0 as J,aj as m,f as G,h as K,k as U,d as Q,ab as W,H as E,b3 as $,b2 as X,t as Y,o as ee,P as te,e as re,a as O,bb as ae,c as le}from"./index-BH1J9J8E.js";import{c as ie}from"./edit-project-CuOMp3mF.js";var I=x("<div>"),ne=x('<svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg aria-hidden=true><path fill-rule=evenodd clip-rule=evenodd d="M13 13H3V3H13V13ZM6.46777 6.81641V7.81641H7.5791V11.3721H8.5791V6.81641H6.46777ZM7.30078 4.62891V5.62891H8.85645V4.62891H7.30078Z"fill=currentColor>'),se=x("<label><span data-slot=field-v2-label-text>"),oe=x("<button type=button data-slot=field-v2-label-info>");const B=Z();function F(){const s=q(B);if(!s)throw new Error("Field subcomponents must be used within <Field>");return s}const ce=["[data-slot='text-input-v2-input']","[data-slot='textarea-v2-textarea']","[data-slot='inline-input-v2-input']"].join(", ");function de(s){const[e,t]=L(s,["invalid","class","classList","children"]),r=`field-control-${P()}`,l=`field-label-${P()}`,c=`field-prefix-${P()}`,g=`field-suffix-${P()}`,[a,d]=H(0),[u,b]=H(0);let p;const h={controlId:r,labelId:l,prefixId:c,suffixId:g,invalid:()=>!!e.invalid,registerPrefix:()=>d(i=>i+1),unregisterPrefix:()=>d(i=>Math.max(0,i-1)),registerSuffix:()=>b(i=>i+1),unregisterSuffix:()=>b(i=>Math.max(0,i-1)),getDescribedBy:()=>{const i=[];return a()>0&&i.push(c),u()>0&&i.push(g),i.length>0?i.join(" "):void 0}},v=()=>{const i=p;if(!i)return;const f=i.querySelector(ce);if(!f)return;const w=f.closest("[data-component='text-input-v2'], [data-component='textarea-v2'], [data-component='inline-input-v2']");f.id=r,f.setAttribute("aria-labelledby",l);const C=h.getDescribedBy();C?f.setAttribute("aria-describedby",C):f.removeAttribute("aria-describedby"),h.invalid()?(f.setAttribute("aria-invalid","true"),w?.setAttribute("data-invalid","")):(f.removeAttribute("aria-invalid"),w?.removeAttribute("data-invalid"))};return A(()=>{v()}),N(()=>{a(),u(),e.invalid,v()}),n(B.Provider,{value:h,get children(){var i=I(),f=p;return typeof f=="function"?T(f,i):p=i,y(i,j(t,{"data-component":"field-v2",get"data-invalid"(){return e.invalid?"":void 0},get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),o(i,()=>e.children),i}})}function ue(){return ne()}function ve(s){const[e,t]=L(s,["class","classList","children","tooltip"]),r=F();return(()=>{var l=se(),c=l.firstChild;return y(l,j(t,{get id(){return r.labelId},get for(){return r.controlId},"data-slot":"field-v2-label",get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),o(c,()=>e.children),o(l,n(R,{get when(){return e.tooltip},children:g=>n(z,{get value(){return g()},get children(){var a=oe();return a.$$click=d=>d.stopPropagation(),o(a,n(ue,{})),k(()=>_(a,"aria-label",g())),a}})}),null),l})()}function fe(s){const[e,t]=L(s,["class","classList","children"]),r=F();return A(()=>{r.registerPrefix(),D(()=>r.unregisterPrefix())}),(()=>{var l=I();return y(l,j(t,{get id(){return r.prefixId},"data-slot":"field-v2-prefix",get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),o(l,()=>e.children),l})()}function ge(s){const[e,t]=L(s,["class","classList","children"]),r=F();return A(()=>{r.registerSuffix(),D(()=>r.unregisterSuffix())}),(()=>{var l=I();return y(l,j(t,{get id(){return r.suffixId},"data-slot":"field-v2-suffix",get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),o(l,()=>e.children),l})()}function pe(s){const[e,t]=L(s,["class","classList","children"]);return(()=>{var r=I();return y(r,j(t,{"data-slot":"field-v2-control",get classList(){return{...e.classList,[e.class??""]:!!e.class}}}),!1,!0),o(r,()=>e.children),r})()}const xe=Object.assign(de,{Label:ve,Prefix:fe,Suffix:ge,Control:pe}),S=xe;M(["click"]);var be=x("<div data-component=textarea-v2><textarea>");function he(s){const[e,t]=L(s,["class","classList","invalid","disabled","rows"]);return(()=>{var r=be(),l=r.firstChild;return y(l,j(t,{get rows(){return e.rows??3},get disabled(){return e.disabled},get"aria-invalid"(){return e.invalid?!0:void 0},"data-slot":"textarea-v2-textarea"}),!1,!1),k(c=>{var g=e.disabled?"":void 0,a=e.invalid?"":void 0,d={...e.classList,[e.class??""]:!!e.class};return g!==c.e&&_(r,"data-disabled",c.e=g),a!==c.t&&_(r,"data-invalid",c.t=a),c.a=V(r,d,c.a),c},{e:void 0,t:void 0,a:void 0}),r})()}var me=x('<div class="flex w-full flex-col gap-2"><div class="select-none text-[13px] font-[530] leading-none tracking-[-0.04px] text-v2-text-text-base"></div><div class="flex items-center gap-3"><button type=button class="relative size-16 shrink-0 cursor-pointer overflow-hidden rounded-[6px] outline outline-1 outline-transparent transition-[background-color,outline-color] focus-visible:outline-v2-border-border-focus"><span class="pointer-events-none absolute inset-0 flex items-center justify-center rounded-[6px] bg-v2-background-bg-contrast/80 text-v2-icon-icon-contrast backdrop-blur-[2px] transition-opacity"></span></button><input type=file accept=image/* class=hidden><div class="flex select-none flex-col gap-[6px] text-[11px] font-[440] leading-none tracking-[0.05px] text-v2-text-text-muted"><span></span><span>'),$e=x('<div class="flex w-full flex-col gap-2"><div class="select-none text-[13px] font-[530] leading-none tracking-[-0.04px] text-v2-text-text-base"></div><div class="-ml-1 flex gap-1.5">'),_e=x("<form class=contents>"),Le=x('<button type=button class="flex size-8 items-center justify-center rounded-[10px] p-1 outline outline-1 outline-transparent transition-[background-color,outline-color] hover:bg-v2-overlay-simple-overlay-hover focus-visible:outline-v2-border-border-focus">');function we(s){const e=J(),t=ie(s);return n(le,{fit:!0,get children(){var r=_e();return m(r,"submit",t.submit),o(r,n(G,{get children(){return n(K,{get children(){return e.t("dialog.project.edit.title")}})}}),null),o(r,n(U,{}),null),o(r,n(Q,{class:"flex max-h-[min(560px,calc(100vh-160px))] w-full flex-col gap-6 overflow-y-auto px-4 pt-4 pb-1",get children(){return[n(S,{get children(){return[n(S.Label,{get children(){return e.t("dialog.project.edit.name")}}),n(W,{autofocus:!0,appearance:"large",class:"!w-full",get value(){return t.store.name},get placeholder(){return t.folderName()},onInput:l=>t.setStore("name",l.currentTarget.value)})]}}),(()=>{var l=me(),c=l.firstChild,g=c.nextSibling,a=g.firstChild,d=a.firstChild,u=a.nextSibling,b=u.nextSibling,p=b.firstChild,h=p.nextSibling;return o(c,()=>e.t("dialog.project.edit.icon")),m(a,"click",t.iconClick,!0),m(a,"dragleave",t.dragLeave),m(a,"dragover",t.dragOver),m(a,"drop",t.drop),a.addEventListener("mouseleave",()=>t.setStore("iconHover",!1)),a.addEventListener("mouseenter",()=>t.setStore("iconHover",!0)),o(a,n(E,{get fallback(){return t.store.name||t.defaultName()},get src(){return X(s.project.id,{color:t.store.color,url:s.project.icon?.url,override:t.store.iconOverride})},get variant(){return $(t.store.color)},class:"!size-16 [&_[data-slot=project-avatar-surface]]:!rounded-[6px] [&_[data-slot=project-avatar-surface]]:!text-[32px]"}),d),o(d,n(Y,{get name(){return t.store.iconOverride?"close":"outline-share"}})),m(u,"change",t.inputChange),T(v=>{t.setIconInput(v)},u),o(p,()=>e.t("dialog.project.edit.icon.hint")),o(h,()=>e.t("dialog.project.edit.icon.recommended")),k(v=>{var i=e.t("dialog.project.edit.icon.alt"),f={"bg-v2-overlay-simple-overlay-hover outline-v2-border-border-focus":t.store.dragOver},w=!!t.store.iconHover,C=!t.store.iconHover;return i!==v.e&&_(a,"aria-label",v.e=i),v.t=V(a,f,v.t),w!==v.a&&d.classList.toggle("opacity-100",v.a=w),C!==v.o&&d.classList.toggle("opacity-0",v.o=C),v},{e:void 0,t:void 0,a:void 0,o:void 0}),l})(),n(R,{get when(){return!t.store.iconOverride},get children(){var l=$e(),c=l.firstChild,g=c.nextSibling;return o(c,()=>e.t("dialog.project.edit.color")),o(g,n(ee,{each:te,children:a=>(()=>{var d=Le();return d.$$click=()=>{$(t.store.color)===a&&!s.project.icon?.url||t.setStore("color",$(t.store.color)===a?void 0:a)},o(d,n(E,{get fallback(){return t.store.name||t.defaultName()},get variant(){return $(a)},class:"!size-6 [&_[data-slot=project-avatar-surface]]:!rounded-[6px]"})),k(u=>{var b=e.t("dialog.project.edit.color.select",{color:a}),p=$(t.store.color)===a,h={"bg-v2-overlay-simple-overlay-hover [box-shadow:inset_0_0_0_2px_var(--v2-border-border-focus)]":$(t.store.color)===a};return b!==u.e&&_(d,"aria-label",u.e=b),p!==u.t&&_(d,"aria-pressed",u.t=p),u.a=V(d,h,u.a),u},{e:void 0,t:void 0,a:void 0}),d})()})),l}}),n(S,{get children(){return[n(S.Label,{get children(){return e.t("dialog.project.edit.worktree.startup")}}),n(S.Prefix,{get children(){return e.t("dialog.project.edit.worktree.startup.description")}}),n(he,{class:"!w-full [&_[data-slot=textarea-v2-textarea]]:font-mono",rows:3,get value(){return t.store.startup},get placeholder(){return e.t("dialog.project.edit.worktree.startup.placeholder")},spellcheck:!1,onInput:l=>t.setStore("startup",l.currentTarget.value)})]}})]}}),null),o(r,n(re,{get children(){return[n(O,{type:"button",variant:"neutral",get disabled(){return t.save.isPending},get onClick(){return t.close},get children(){return e.t("common.cancel")}}),n(O,{type:"submit",variant:"contrast",get disabled(){return t.save.isPending},get children(){return ae(()=>!!t.save.isPending)()?e.t("common.saving"):e.t("common.save")}})]}}),null),r}})}M(["click"]);export{we as DialogEditProjectV2};
|
|
2
|
+
//# sourceMappingURL=dialog-edit-project-v2-BgxhNrB_.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=dialog-fork-
|
|
1
|
+
import{c6 as y,c5 as D,cn as v,cc as S,c9 as b,bW as k,c0 as _,aD as $,au as d,L as w,b7 as u,b as P,aW as L,al as F,bH as I,bM as M}from"./index-BH1J9J8E.js";var T=M('<div class="w-full flex items-center gap-2"><span class="truncate flex-1 min-w-0 text-left font-normal"></span><span class="text-text-weak shrink-0 font-normal">');function C(c){return c.toLocaleTimeString(void 0,{timeStyle:"short"})}const K=()=>{const c=y(),g=D(),i=v(),l=S(),p=b(),f=k(),o=_(),h=$(()=>{const t=c.id;if(!t)return[];const a=i().data.message[t]??[],n=[];for(const s of a){if(s.role!=="user")continue;const e=(i().data.part[s.id]??[]).find(r=>r.type==="text"&&!r.synthetic&&!r.ignored);e&&n.push({id:s.id,text:e.text.replace(/\n/g," ").slice(0,200),time:C(new Date(s.time.created))})}return n.reverse()}),x=t=>{if(!t)return;const a=c.id;if(!a)return;const n=i().data.part[t.id]??[],s=L(n,{directory:l().directory,attachmentName:o.t("common.attachment")}),m=F(l().directory);l().api.session.fork({sessionID:a,messageID:t.id}).then(e=>{f.close(),p.set(s,void 0,{dir:m,id:e.id}),g(`/${m}/session/${e.id}`)}).catch(e=>{const r=e instanceof Error?e.message:String(e);I({title:o.t("common.requestFailed"),description:r})})};return d(P,{get title(){return o.t("command.session.fork")},get children(){return d(w,{class:"flex-1 px-3 min-h-0 [&_[data-slot=list-scroll]]:flex-1 [&_[data-slot=list-scroll]]:min-h-0",get search(){return{placeholder:o.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return o.t("dialog.fork.empty")},key:t=>t.id,items:h,filterKeys:["text"],onSelect:x,children:t=>(()=>{var a=T(),n=a.firstChild,s=n.nextSibling;return u(n,()=>t.text),u(s,()=>t.time),a})()})}})};export{K as DialogFork};
|
|
2
|
+
//# sourceMappingURL=dialog-fork-DM2MD9h9.js.map
|
package/bin/web/assets/{dialog-manage-models-Ca3CtDo1.js → dialog-manage-models-CZ-wSXas.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=dialog-manage-models-
|
|
1
|
+
import{c2 as x,c0 as V,bW as S,au as l,L as R,b7 as s,ac as z,B as T,b as E,bY as G,bx as D,f as O,i as j,a as q,d as F,ab as H,a2 as h,v as K,t as N,o as C,N as W,c as Y,bM as c,aR as L,aS as A}from"./index-BH1J9J8E.js";import{S as k}from"./switch-BnUb38m8.js";import{a as w,S as J}from"./row-DgKhGiK9.js";import{D as P}from"./dialog-connect-provider-cMnfONyq.js";import{S as Q}from"./list-BK0ZBxm_.js";import"./LROKH5N7-CufzWEns.js";var U=c("<span>"),X=c('<div class="w-full flex items-center justify-between gap-x-3"><span></span><div>'),Z=c('<div class="px-4 pt-px pb-3"><div class=relative>'),ee=c('<div data-slot=manage-models-scroll class="relative min-h-0 flex-1"><div class="settings-v2-panel settings-v2-models h-full px-4 pt-4 pb-4">'),te=c("<div class=settings-v2-models-status>"),re=c("<span class=settings-v2-models-status-filter>"<!>""),ie=c("<div class=settings-v2-models-status><span>"),le=c('<div class=settings-v2-section data-component=settings-models-provider><div class="settings-v2-models-group-header justify-between"><div class="flex min-w-0 items-center gap-2"><h3 class=settings-v2-section-title></h3></div><div>'),oe=c("<div>");const ue=()=>{const o=x(),n=V(),f=S(),b=()=>L(o.slug()),y=()=>{f.show(()=>l(P,{directory:b}))},m=t=>D.indexOf(t),v=t=>o.model.list().filter(e=>e.provider.id===t),$=t=>v(t).every(e=>o.model.visible({modelID:e.id,providerID:e.provider.id})),_=(t,e)=>{v(t).forEach(r=>{o.model.setVisibility({modelID:r.id,providerID:r.provider.id},e)})};return l(E,{get title(){return n.t("dialog.model.manage")},get description(){return n.t("dialog.model.manage.description")},get action(){return l(T,{class:"h-7 -my-1 text-14-medium",icon:"plus-small",tabIndex:-1,onClick:y,get children(){return n.t("command.provider.connect")}})},get children(){return l(R,{class:"px-3",get search(){return{placeholder:n.t("dialog.model.search.placeholder"),autofocus:!0}},get emptyMessage(){return n.t("dialog.model.empty")},key:t=>`${t?.provider?.id}:${t?.id}`,get items(){return o.model.list()},filterKeys:["provider.name","name","id"],sortBy:(t,e)=>t.name.localeCompare(e.name),groupBy:t=>t.provider.id,groupHeader:t=>{const e=t.items[0].provider;return[(()=>{var r=U();return s(r,()=>e.name),r})(),l(z,{placement:"top",get value(){return n.t("dialog.model.manage.provider.toggle",{provider:e.name})},get children(){return l(k,{class:"-mr-1",get checked(){return $(e.id)},onChange:r=>_(e.id,r),hideLabel:!0,get children(){return e.name}})}})]},sortGroupsBy:(t,e)=>{const r=m(t.items[0].provider.id),i=m(e.items[0].provider.id),a=r>=0,d=i>=0;return a&&!d?-1:!a&&d?1:r-i},onSelect:t=>{if(!t)return;const e={modelID:t.id,providerID:t.provider.id};o.model.setVisibility(e,!o.model.visible(e))},children:t=>(()=>{var e=X(),r=e.firstChild,i=r.nextSibling;return s(r,()=>t.name),i.$$click=a=>a.stopPropagation(),s(i,l(k,{get checked(){return!!o.model.visible({modelID:t.id,providerID:t.provider.id})},onChange:a=>{o.model.setVisibility({modelID:t.id,providerID:t.provider.id},a)}})),e})()})}})},me=()=>{const o=x(),n=V(),f=S(),b=()=>L(o.slug()),y=()=>{f.show(()=>l(P,{directory:b}))},m=e=>o.model.list().filter(r=>r.provider.id===e),v=e=>m(e).every(r=>o.model.visible({modelID:r.id,providerID:r.provider.id})),$=(e,r)=>{m(e).forEach(i=>{o.model.setVisibility({modelID:i.id,providerID:i.provider.id},r)})},_=(e,r)=>{o.model.setVisibility({modelID:e.id,providerID:e.provider.id},r)},t=G({items:()=>o.model.list(),key:e=>`${e.provider.id}:${e.id}`,filterKeys:["provider.name","name","id"],sortBy:(e,r)=>e.name.localeCompare(r.name),groupBy:e=>e.provider.id,sortGroupsBy:(e,r)=>{const i=D.indexOf(e.category),a=D.indexOf(r.category),d=i>=0,g=a>=0;return d&&!g?-1:!d&&g?1:i-a}});return l(Y,{size:"large",variant:"settings",class:"settings-v2-manage-models-dialog",get children(){return[l(O,{hideClose:!0,get closeLabel(){return n.t("common.close")},get children(){return[l(j,{get title(){return n.t("dialog.model.manage")},get description(){return n.t("dialog.model.manage.description")}}),l(q,{variant:"neutral",icon:"plus",onClick:y,get children(){return n.t("command.provider.connect")}})]}}),l(F,{class:"flex min-h-0 flex-1 flex-col",get children(){return[(()=>{var e=Z(),r=e.firstChild;return s(r,l(H,{type:"search",appearance:"base",class:"!w-full self-stretch",get value(){return t.filter()},onInput:i=>t.onInput(i.currentTarget.value),get placeholder(){return n.t("dialog.model.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",autofocus:!0,get"aria-label"(){return n.t("dialog.model.search.placeholder")}}),null),s(r,l(h,{get when(){return t.filter()},get children(){return l(K,{type:"button",variant:"ghost-muted",size:"small",class:"settings-v2-tab-search-clear",get icon(){return l(N,{name:"close",size:"large",class:"text-v2-icon-icon-muted"})},onClick:()=>t.clear(),get"aria-label"(){return n.t("common.clear")}})}}),null),e})(),(()=>{var e=ee(),r=e.firstChild;return s(r,l(h,{get when(){return!t.grouped.loading},get fallback(){return(()=>{var i=te();return s(i,()=>n.t("common.loading"),null),s(i,()=>n.t("common.loading.ellipsis"),null),i})()},get children(){return l(h,{get when(){return t.flat().length>0},get fallback(){return(()=>{var i=ie(),a=i.firstChild;return s(a,()=>n.t("dialog.model.empty")),s(i,l(h,{get when(){return t.filter()},get children(){var d=re(),g=d.firstChild,p=g.nextSibling;return p.nextSibling,s(d,()=>t.filter(),p),d}}),null),i})()},get children(){return l(C,{get each(){return t.grouped.latest},children:i=>(()=>{var a=le(),d=a.firstChild,g=d.firstChild,p=g.firstChild,B=g.nextSibling;return s(g,l(W,{get id(){return i.category},width:16,height:16,class:"ml-4 shrink-0"}),p),s(p,()=>i.items[0].provider.name),s(B,l(w,{class:"mr-6",get checked(){return v(i.category)},onChange:u=>$(i.category,u),hideLabel:!0,get children(){return i.items[0].provider.name}})),s(a,l(Q,{get children(){return l(C,{get each(){return i.items},children:u=>l(J,{get title(){return u.name},description:"",get children(){var I=oe();return s(I,l(w,{get checked(){return o.model.visible({modelID:u.id,providerID:u.provider.id})},onChange:M=>_(u,M),hideLabel:!0,get children(){return u.name}})),I}})})}}),null),a})()})}})}})),e})()]}})]}})};A(["click"]);export{ue as DialogManageModels,me as DialogManageModelsV2};
|
|
2
|
+
//# sourceMappingURL=dialog-manage-models-CZ-wSXas.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b_ as aa,bW as ca,
|
|
1
|
+
import{b_ as aa,bW as ca,c0 as ua,bt as da,aL as at,aD as Nn,aJ as Lo,ar as mr,aV as en,bv as Fo,bs as vr,ag as Bo,aP as ha,bn as fa,bm as zo,ax as pa,au as Se,f as ga,h as ma,k as va,d as ya,b7 as Fe,ab as ba,bb as yr,a as tn,bu as Ia,a2 as br,o as wa,aI as xa,bG as Rn,bj as Sa,e as _a,bR as Ho,c as Ca,aw as ka,b1 as Pa,ak as Ea,by as Da,br as Ta,ai as Ir,bM as Lt,aF as Ma,bi as Aa,aS as Na}from"./index-BH1J9J8E.js";const On="file-tree-container",wr="data-file-tree-style",Oo="data-file-tree-unsafe-css",Ra="data-file-tree-scrollbar-measure",$o="data-file-tree-scrollbar-gutter-measured",Va="--trees-scrollbar-gutter-measured",qo="f::",Er="header",sn="context-menu",Dr="context-menu-trigger";var jo=`@layer base, theme, unsafe;
|
|
2
2
|
|
|
3
3
|
@layer base {
|
|
4
4
|
:host {
|
|
@@ -1854,4 +1854,4 @@ import{b_ as aa,bW as ca,b$ as ua,bt as da,aL as at,aD as Nn,aJ as Lo,ar as mr,a
|
|
|
1854
1854
|
scrollbar-width: thin;
|
|
1855
1855
|
}
|
|
1856
1856
|
`,onExpansionChange(N){N.expanded&&Ve(N.path,G)},onSelectionChange(N){const j=N.at(-1);g(j?s.selection(a(),j)??"":"")}}),Z&&(U.render({containerWrapper:Z}),U.getFileTreeContainer()?.classList.add("directory-picker-v2-tree"))}),pa(()=>{const _=ee();!_||a()||Pe(_)}),zo(()=>U?.cleanUp()),Se(Ca,{size:"large",class:"directory-picker-v2",get children(){return[Se(ga,{get children(){return Se(ma,{get children(){return e.title??i.t("command.project.open")}})}}),Se(va,{}),Se(ya,{class:"directory-picker-v2-body pt-4!",get children(){return[(()=>{var _=Pf(),N=_.firstChild,j=se;return typeof j=="function"?Ho(j,_):se=_,Fe(_,Se(ba,{get value(){return d()},autofocus:!0,autocomplete:"off",spellcheck:!1,class:"!w-full",onInput:B=>{f(mr(B.currentTarget.value)),g(""),v(!0),P(-1)},role:"combobox","aria-autocomplete":"list",get"aria-expanded"(){return p()},"aria-controls":"directory-picker-v2-suggestions",get"aria-activedescendant"(){return yr(()=>I()>=0)()?`directory-picker-v2-suggestion-${I()}`:void 0},onKeyDown:gt}),N),Fe(N,Se(tn,{size:"small",variant:"ghost",onClick:()=>void Pe(q()),children:"~"}),null),Fe(N,Se(tn,{size:"small",variant:"ghost",onClick:()=>void Pe(Fo(a())||a()),get children(){return i.t("dialog.directory.root")}}),null),Fe(N,Se(tn,{size:"small",variant:"ghost",onClick:()=>void Pe(Ia(a())),get children(){return i.t("dialog.directory.parent")}}),null),Fe(_,Se(br,{get when(){return yr(()=>!!p())()&&Re().length>0},get children(){var B=kf();return Fe(B,Se(wa,{get each(){return Re()},children:(O,ce)=>(()=>{var ye=Tf();return ye.$$click=()=>He(O),ye.$$pointermove=()=>P(ce()),Fe(ye,()=>en(O.absolute,d(),q()),null),Fe(ye,()=>O.type==="directory"?"/":"",null),xa(pe=>{var ue=`directory-picker-v2-suggestion-${ce()}`,mt=O.absolute,In=ce()===I(),Qe=ce()===I()?"":void 0;return ue!==pe.e&&Rn(ye,"id",pe.e=ue),mt!==pe.t&&Rn(ye,"data-directory-path",pe.t=mt),In!==pe.a&&Rn(ye,"aria-selected",pe.a=In),Qe!==pe.o&&Rn(ye,"data-active",pe.o=Qe),pe},{e:void 0,t:void 0,a:void 0,o:void 0}),ye})()})),B}}),null),_})(),(()=>{var _=Ef();_.addEventListener("wheel",j=>{const B=U?.getFileTreeContainer()?.shadowRoot?.querySelector("[data-file-tree-virtualized-scroll]");if(!B)return;const O=Sa(B.scrollTop,j.deltaY,B.scrollHeight,B.clientHeight);O!==B.scrollTop&&(j.preventDefault(),B.scrollTop=O,B.dispatchEvent(new Event("scroll")))});var N=Z;return typeof N=="function"?Ho(N,_):Z=_,Fe(_,Se(br,{get when(){return S()},get children(){var j=ss();return Fe(j,()=>i.t("common.loading")),j}}),null),Fe(_,Se(br,{get when(){return yr(()=>!S())()&&b()},get children(){var j=ss();return Fe(j,()=>i.t("dialog.directory.readError")),j}}),null),_})(),(()=>{var _=Df();return Fe(_,()=>s.result(a(),c(),C())),_})()]}}),Se(_a,{get children(){return[Se(tn,{variant:"neutral",onClick:()=>o.close(),get children(){return i.t("common.cancel")}}),Se(tn,{variant:"contrast",get disabled(){return!s.result(a(),c(),C())},onClick:xe,get children(){return l[s.action]}})]}})]}})}Na(["pointermove","click"]);export{Af as DialogSelectDirectoryV2};
|
|
1857
|
-
//# sourceMappingURL=dialog-select-directory-v2-
|
|
1857
|
+
//# sourceMappingURL=dialog-select-directory-v2-BjsOiAsW.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-select-directory-v2-
|
|
2
|
-
import{
|
|
3
|
-
//# sourceMappingURL=dialog-select-file-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-select-directory-v2-BjsOiAsW.js","assets/index-BH1J9J8E.js","assets/index-DoggtF0n.css","assets/dialog-select-directory-v2-BLfZvzPV.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c8 as b,cl as $,au as n,c0 as D,ch as S,ck as C,aD as k,aR as O,aL as E,L,a5 as P,M as y,b7 as s,a2 as h,K as M,aX as I,I as K,aI as x,n as V,b0 as j,b1 as R,b as z,b9 as q,af as T,bM as p}from"./index-BH1J9J8E.js";import{D as A,a as B,b as G,g as X,u as v,c as _}from"./dialog-command-palette-v2-BdsfOt98.js";var F=p('<span class="text-14-regular text-text-weak truncate">'),H=p('<div class="w-full flex items-center justify-between gap-4"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong whitespace-nowrap">'),J=p('<span class="text-12-regular text-text-weak whitespace-nowrap ml-2">'),N=p('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong truncate">'),Q=p('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular"><span class="text-text-weak whitespace-nowrap overflow-hidden overflow-ellipsis truncate min-w-0"></span><span class="text-text-strong whitespace-nowrap">');const U=q(()=>T(()=>import("./dialog-select-directory-v2-BjsOiAsW.js"),__vite__mapDeps([0,1,2,3])).then(a=>({default:a.DialogSelectDirectoryV2})));function te(a){const t=b(),u=$(),g=()=>a.mode==="files";return!g()&&u.general.newLayoutDesigns()?n(A,{get onOpenFile(){return a.onOpenFile}}):g()&&t.platform==="desktop"&&u.general.newLayoutDesigns()?n(W,{get onOpenFile(){return a.onOpenFile}}):n(Y,{filesOnly:g,get onOpenFile(){return a.onOpenFile}})}function W(a){const t=D(),u=S(),{params:g}=C(),m=k(()=>O(g.dir)??""),e=B(a.onOpenFile);return n(U,{get server(){return u().server},mode:"file",get start(){return m()},get title(){return t.t("session.header.searchFiles")},onSelect:r=>{typeof r=="string"&&e(r)}})}function Y(a){const t=G(a),[u,g]=E(!1),m=async e=>{const r=e.trim();if(g(r.length>0),!r&&a.filesOnly()){const d=t.file.tree.state("")?.loaded,w=d?Promise.resolve():t.file.tree.list(""),f=v([...t.recentFileEntries(),...t.rootFileEntries()]);return d||f.length>0?f:(await w,v([...t.recentFileEntries(),...t.rootFileEntries()]))}if(!r)return[...t.preferredCommandEntries(),...t.recentFileEntries()];if(a.filesOnly()){const d=await t.file.searchFiles(r),w=t.language.t("palette.group.files");return d.map(f=>_(f,w))}const[l,i]=await Promise.all([t.file.searchFiles(r),Promise.resolve(t.sessions(r))]),o=t.language.t("palette.group.files"),c=l.map(d=>_(d,o));return[...t.commandEntries(),...i,...c]};return n(z,{class:"pt-3 pb-0 !max-h-[480px]",transition:!0,get children(){return n(L,{class:"px-3",get search(){return{placeholder:a.filesOnly()?t.language.t("session.header.searchFiles"):t.language.t("palette.search.placeholder"),autofocus:!0,hideIcon:!0}},get emptyMessage(){return t.language.t("palette.empty")},get loadingMessage(){return t.language.t("common.loading")},items:m,key:e=>e.id,filterKeys:["title","description","category"],skipFilter:e=>e.type==="file",get groupBy(){return u()?e=>e.category:()=>""},onMove:e=>t.highlight(e),onSelect:e=>t.select(e),children:e=>n(P,{get fallback(){return(()=>{var r=Q(),l=r.firstChild,i=l.firstChild,o=i.firstChild,c=o.nextSibling;return s(l,n(V,{get node(){return{path:e.path??"",type:"file"}},class:"shrink-0 size-4"}),i),s(o,()=>j(e.path??"")),s(c,()=>R(e.path??"")),r})()},get children(){return[n(y,{get when(){return e.type==="command"},get children(){var r=H(),l=r.firstChild,i=l.firstChild;return s(i,()=>e.title),s(l,n(h,{get when(){return e.description},get children(){var o=F();return s(o,()=>e.description),o}}),null),s(r,n(h,{get when(){return e.keybind},get children(){return n(M,{class:"rounded-[4px]",get children(){return I(e.keybind??"",t.language.t)}})}}),null),r}}),n(y,{get when(){return e.type==="session"},get children(){var r=N(),l=r.firstChild,i=l.firstChild,o=i.firstChild;return s(l,n(K,{name:"bubble-5",size:"small",class:"shrink-0 text-icon-weak"}),i),s(o,()=>e.title),s(i,n(h,{get when(){return e.description},get children(){var c=F();return s(c,()=>e.description),x(()=>c.classList.toggle("opacity-70",!!e.archived)),c}}),null),s(r,n(h,{get when(){return e.updated},get children(){var c=J();return s(c,()=>X(new Date(e.updated).toISOString(),t.language.t)),c}}),null),x(()=>o.classList.toggle("opacity-70",!!e.archived)),r}})]}})})}})}export{te as DialogSelectFile};
|
|
3
|
+
//# sourceMappingURL=dialog-select-file-DQfBi0lB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=dialog-select-mcp-
|
|
1
|
+
import{cn as y,c0 as C,aD as d,au as c,L as S,b7 as r,a2 as b,b as k,bM as m,aS as L}from"./index-BH1J9J8E.js";import{S as M}from"./switch-BnUb38m8.js";import{u as P}from"./mcp-CnUj_8Pe.js";import"./LROKH5N7-CufzWEns.js";var D=m('<span class="text-11-regular text-text-weaker">'),j=m('<span class="text-11-regular text-text-weaker truncate">'),B=m('<div class="w-full flex items-center justify-between gap-x-3"><div class="flex flex-col gap-0.5 min-w-0"><div class="flex items-center gap-2"><span class=truncate></span></div></div><div>');const E={connected:"mcp.status.connected",failed:"mcp.status.failed",needs_auth:"mcp.status.needs_auth",needs_client_registration:"mcp.status.needs_client_registration",disabled:"mcp.status.disabled"},z=()=>{const g=y(),l=C(),o=d(()=>Object.entries(g().data.mcp??{}).map(([e,a])=>({name:e,status:a.status})).sort((e,a)=>e.name.localeCompare(a.name))),n=P(),v=d(()=>o().filter(e=>e.status==="connected").length),x=d(()=>o().length);return c(k,{get title(){return l.t("dialog.mcp.title")},get description(){return l.t("dialog.mcp.description",{enabled:v(),total:x()})},get children(){return c(S,{class:"px-3",get search(){return{placeholder:l.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return l.t("dialog.mcp.empty")},key:e=>e?.name??"",items:o,filterKeys:["name","status"],sortBy:(e,a)=>e.name.localeCompare(a.name),onSelect:e=>{!e||e.status==="pending"||n.isPending||n.mutate(e.name)},children:e=>{const a=()=>g().data.mcp[e.name],i=()=>a()?.status,p=()=>{const t=i()?E[i()]:void 0;if(t)return l.t(t)},f=()=>{const t=a();if(t?.status==="failed"||t?.status==="needs_client_registration")return t.error},$=()=>i()==="connected";return(()=>{var t=B(),u=t.firstChild,h=u.firstChild,w=h.firstChild,_=u.nextSibling;return r(w,()=>e.name),r(h,c(b,{get when(){return p()},get children(){var s=D();return r(s,p),s}}),null),r(u,c(b,{get when(){return f()},get children(){var s=j();return r(s,f),s}}),null),_.$$click=s=>s.stopPropagation(),r(_,c(M,{get checked(){return $()},get disabled(){return i()==="pending"||n.isPending&&n.variables===e.name},onChange:()=>{n.isPending||n.mutate(e.name)}})),t})()}})}})};L(["click"]);export{z as DialogSelectMcp};
|
|
2
|
+
//# sourceMappingURL=dialog-select-mcp-BAPSNwQR.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{co as Be,b$ as X,c6 as Ve,c7 as _e,bW as pe,c5 as je,ck as he,aD as I,aR as Me,ch as $e,cg as ye,aJ as ce,bn as Re,b7 as r,au as e,a2 as w,bM as d,af as Ze,a9 as Ke,B as W,T as G,bb as U,aa as se,bC as Ge,bD as qe,bf as Ue,bg as We,bN as He,bO as Qe,bd as ge,ac as Ye,I as j,bE as Je,bh as Xe,bP as et,S as tt,bw as rt,b_ as me,l as q,Y as xe,V as te,Z as be,o as J,$ as nt,a0 as st,y as it,Q as lt,cf as at,ca as ot,bx as le,N as ie,a8 as re,bH as ne,c2 as ct,bY as gt,u as dt,ce as ut,W as pt,X as ht,aL as mt,a7 as C,bL as vt,b as ft}from"./index-B2L_xsSX.js";import{S as $}from"./switch-D8_cvKev.js";import{u as xt,a as z,S as bt}from"./settings-keybinds-DFbfIb2V.js";import{E as wt,u as _t,a as $t,D as yt}from"./dialog-connect-provider-B-kgBHKk.js";import"./LROKH5N7-Cgdi6ogL.js";import"./list-Bgkj60uj.js";var St=d("<div data-action=settings-new-layout-designs>"),de=d('<div class="flex flex-col gap-1">'),Ct=d('<span class="flex items-center gap-2">'),kt=d("<div data-action=settings-auto-accept-permissions>"),Pt=d("<div data-action=settings-feed-reasoning-summaries>"),Tt=d("<div data-action=settings-feed-shell-tool-parts-expanded>"),Dt=d("<div data-action=settings-feed-edit-tool-parts-expanded>"),Et=d("<div data-action=settings-show-file-tree>"),Ft=d("<div data-action=settings-show-navigation>"),It=d("<div data-action=settings-show-search>"),zt=d("<div data-action=settings-show-status>"),At=d("<div data-action=settings-show-custom-agents>"),Q=d('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),ue=d('<div class="w-full sm:w-[220px]">'),Nt=d("<div data-action=settings-notifications-agent>"),Lt=d("<div data-action=settings-notifications-permissions>"),Ot=d("<div data-action=settings-notifications-errors>"),Bt=d("<div data-action=settings-release-notes>"),Vt=d("<div data-action=settings-pinch-zoom>"),jt=d("<div data-action=settings-wayland>"),Mt=d("<span class=text-text-weak>"),Rt=d('<div class="flex items-center gap-2"><span>'),Zt=d('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-1 pt-6 pb-8"><h2 class="text-16-medium text-text-strong"></h2></div></div><div class="flex flex-col gap-8 w-full">'),Kt=d('<div class="flex flex-wrap items-center gap-4 py-3 border-b border-border-weak-base last:border-none sm:flex-nowrap"><div class="flex min-w-0 flex-1 flex-col gap-0.5"><span class="text-14-medium text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex w-full justify-end sm:w-auto sm:shrink-0">');let M={cleanup:void 0,timeout:void 0,run:0};const Se=()=>{M.run+=1,M.cleanup&&M.cleanup(),clearTimeout(M.timeout),M.cleanup=void 0},we=i=>{if(Se(),!i)return;const t=++M.run;M.timeout=setTimeout(()=>{rt(i).then(a=>{if(M.run!==t){a?.();return}M.cleanup=a})},100)},Gt=()=>{const i=Be(),t=X(),a=Ve(),c=_e(),v=pe(),m=je(),l=he(),_=xt(),y=I(()=>c.platform==="desktop"&&c.os==="linux"),k=I(()=>Me(m.dir)),P=I(()=>{const o=k();return o?m.id?a.isAutoAccepting(m.id,o):a.isAutoAcceptingDirectory(o):!1}),T=o=>{const s=k();if(s){if(!m.id){if(a.isAutoAcceptingDirectory(s)===o)return;a.toggleAutoAcceptDirectory(s);return}if(o){a.enableAutoAccept(m.id,s);return}a.disableAutoAccept(m.id,s)}},A=I(()=>c.platform==="desktop"),N=I(()=>i.ids().map(o=>({id:o,name:i.name(o)}))),E=$e(),L=ye(),[B]=ce(async()=>{const o=L();return await o.protocol==="v1"?(await o.client.pty.shells()).data??[]:[]},{initialValue:[]}),[R,{refetch:h}]=ce(()=>!!(y()&&c.getDisplayBackend),()=>Promise.resolve(c.getDisplayBackend?.()??null).catch(()=>null),{initialValue:null}),[u,{mutate:b}]=ce(()=>!!(A()&&c.getPinchZoomEnabled),()=>Promise.resolve(c.getPinchZoomEnabled?.()??!1).catch(()=>!1),{initialValue:!1});Re(()=>{i.loadThemes()});const O={id:"auto",value:"",label:t.t("settings.general.row.shell.autoDefault")},Z=I(()=>E().data.config.shell??""),K=I(()=>{const o=B.latest,s=E().data.config.shell,n=new Map;for(const g of o)n.set(g.name,(n.get(g.name)||0)+1);const p=[O,...o.map(g=>{const ve=(n.get(g.name)||0)>1,fe=ve?g.path:g.name,Oe=g.acceptable?fe:`${fe} (${t.t("settings.general.row.shell.terminalOnly")})`;return{id:g.path,value:ve?g.path:g.name,label:Oe}})];return s&&!p.some(g=>g.value===s)&&p.push({id:s,value:s,label:s}),p}),ae=o=>{const s=c.setDisplayBackend?.(o?"wayland":"auto");s&&s.finally(()=>{h()})},Y=o=>{b(o);const s=c.setPinchZoomEnabled?.(o);s&&s.catch(()=>b(!o))},ee=I(()=>[{value:"system",label:t.t("theme.scheme.system")},{value:"light",label:t.t("theme.scheme.light")},{value:"dark",label:t.t("theme.scheme.dark")}]),x=I(()=>t.locales.map(o=>({value:o,label:t.label(o)}))),D={id:"none",label:"sound.option.none"},S=[D,...tt],F=()=>Xe(l.appearance.font()),V=()=>Je(l.appearance.uiFont()),oe=()=>et(l.appearance.terminalFont()),H=(o,s,n,p)=>({options:S,current:o()?S.find(g=>g.id===s())??D:D,value:g=>g.id,label:g=>t.t(g.label),onHighlight:g=>{g&&we(g.id==="none"?void 0:g.id)},onSelect:g=>{if(g){if(g.id==="none"){n(!1),Se();return}n(!0),p(g.id),we(g.id)}},variant:"secondary",size:"small",triggerVariant:"settings"}),Te=()=>(()=>{var o=de();return r(o,e(z,{get children(){return e(f,{get title(){return(()=>{var s=Ct();return r(s,()=>t.t("settings.general.row.newInterface.title"),null),r(s,e(Ke,{variant:"accent",get children(){return t.t("settings.general.row.newInterface.badge")}}),null),s})()},get description(){return t.t("settings.general.row.newInterface.description")},get children(){var s=St();return r(s,e($,{get checked(){return l.general.newLayoutDesigns()},onChange:n=>{l.general.setNewLayoutDesigns(n),n&&Ze(()=>import("./index-D9JOa7-H.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(p=>{v.show(()=>e(p.DialogSettings,{}))})}})),s}})}})),o})(),De=()=>(()=>{var o=de();return r(o,e(z,{get children(){return e(f,{get title(){return t.t("settings.general.row.newInterfaceNotice.title")},get description(){return t.t("settings.general.row.newInterfaceNotice.description")},get children(){return e(W,{size:"small",variant:"ghost",get onClick(){return l.general.dismissNewInterfaceNotice},get children(){return t.t("settings.general.row.newInterfaceNotice.dismiss")}})}})}})),o})(),Ee=()=>(()=>{var o=de();return r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.row.language.title")},get description(){return t.t("settings.general.row.language.description")},get children(){return e(G,{"data-action":"settings-language",get options(){return x()},get current(){return x().find(s=>s.value===t.locale())},value:s=>s.value,label:s=>s.label,onSelect:s=>s&&t.setLocale(s.value),variant:"secondary",size:"small",triggerVariant:"settings"})}}),e(f,{get title(){return t.t("command.permissions.autoaccept.enable")},get description(){return t.t("toast.permissions.autoaccept.on.description")},get children(){var s=kt();return r(s,e($,{get checked(){return P()},get disabled(){return!k()},onChange:T})),s}}),e(f,{get title(){return t.t("settings.general.row.shell.title")},get description(){return t.t("settings.general.row.shell.description")},get children(){return e(G,{"data-action":"settings-shell",get options(){return K()},get current(){return K().find(s=>s.value===Z())??O},value:s=>s.id,label:s=>s.label,onSelect:s=>{s&&s.value!==Z()&&E().updateConfig({shell:s.value})},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"180px"}})}}),e(f,{get title(){return t.t("settings.general.row.reasoningSummaries.title")},get description(){return t.t("settings.general.row.reasoningSummaries.description")},get children(){var s=Pt();return r(s,e($,{get checked(){return l.general.showReasoningSummaries()},onChange:n=>l.general.setShowReasoningSummaries(n)})),s}}),e(f,{get title(){return t.t("settings.general.row.shellToolPartsExpanded.title")},get description(){return t.t("settings.general.row.shellToolPartsExpanded.description")},get children(){var s=Tt();return r(s,e($,{get checked(){return l.general.shellToolPartsExpanded()},onChange:n=>l.general.setShellToolPartsExpanded(n)})),s}}),e(f,{get title(){return t.t("settings.general.row.editToolPartsExpanded.title")},get description(){return t.t("settings.general.row.editToolPartsExpanded.description")},get children(){var s=Dt();return r(s,e($,{get checked(){return l.general.editToolPartsExpanded()},onChange:n=>l.general.setEditToolPartsExpanded(n)})),s}})]}})),o})(),Fe=()=>(()=>{var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.advanced")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.row.showFileTree.title")},get description(){return t.t("settings.general.row.showFileTree.description")},get children(){var n=Et();return r(n,e($,{get checked(){return l.general.showFileTree()},onChange:p=>l.general.setShowFileTree(p)})),n}}),e(f,{get title(){return t.t("settings.general.row.showNavigation.title")},get description(){return t.t("settings.general.row.showNavigation.description")},get children(){var n=Ft();return r(n,e($,{get checked(){return l.general.showNavigation()},onChange:p=>l.general.setShowNavigation(p)})),n}}),e(f,{get title(){return t.t("settings.general.row.showSearch.title")},get description(){return t.t("settings.general.row.showSearch.description")},get children(){var n=It();return r(n,e($,{get checked(){return l.general.showSearch()},onChange:p=>l.general.setShowSearch(p)})),n}}),e(f,{get title(){return t.t("settings.general.row.showStatus.title")},get description(){return t.t("settings.general.row.showStatus.description")},get children(){var n=zt();return r(n,e($,{get checked(){return l.general.showStatus()},onChange:p=>l.general.setShowStatus(p)})),n}}),e(f,{get title(){return t.t("settings.general.row.showCustomAgents.title")},get description(){return t.t("settings.general.row.showCustomAgents.description")},get children(){var n=At();return r(n,e($,{get checked(){return l.general.showCustomAgents()},onChange:p=>l.general.setShowCustomAgents(p)})),n}})]}}),null),o})(),Ie=()=>(()=>{var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.appearance")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.row.colorScheme.title")},get description(){return t.t("settings.general.row.colorScheme.description")},get children(){return e(G,{"data-action":"settings-color-scheme",get options(){return ee()},get current(){return ee().find(n=>n.value===i.colorScheme())},value:n=>n.value,label:n=>n.label,onSelect:n=>n&&i.setColorScheme(n.value),variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"220px"}})}}),e(f,{get title(){return t.t("settings.general.row.theme.title")},get description(){return[U(()=>t.t("settings.general.row.theme.description"))," ",e(wt,{href:"https://opencode.ai/docs/themes/",get children(){return t.t("common.learnMore")}})]},get children(){return e(G,{"data-action":"settings-theme",get options(){return N()},get current(){return N().find(n=>n.id===i.themeId())},value:n=>n.id,label:n=>n.name,onSelect:n=>{n&&i.setTheme(n.id)},variant:"secondary",size:"small",triggerVariant:"settings"})}}),e(f,{get title(){return t.t("settings.general.row.uiFont.title")},get description(){return t.t("settings.general.row.uiFont.description")},get children(){var n=ue();return r(n,e(se,{"data-action":"settings-ui-font",get label(){return t.t("settings.general.row.uiFont.title")},hideLabel:!0,type:"text",get value(){return V()},onChange:p=>l.appearance.setUIFont(p),placeholder:Ge,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":qe(l.appearance.uiFont())}}})),n}}),e(f,{get title(){return t.t("settings.general.row.font.title")},get description(){return t.t("settings.general.row.font.description")},get children(){var n=ue();return r(n,e(se,{"data-action":"settings-code-font",get label(){return t.t("settings.general.row.font.title")},hideLabel:!0,type:"text",get value(){return F()},onChange:p=>l.appearance.setFont(p),placeholder:Ue,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":We(l.appearance.font())}}})),n}}),e(f,{get title(){return t.t("settings.general.row.terminalFont.title")},get description(){return t.t("settings.general.row.terminalFont.description")},get children(){var n=ue();return r(n,e(se,{"data-action":"settings-terminal-font",get label(){return t.t("settings.general.row.terminalFont.title")},hideLabel:!0,type:"text",get value(){return oe()},onChange:p=>l.appearance.setTerminalFont(p),placeholder:He,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":Qe(l.appearance.terminalFont())}}})),n}})]}}),null),o})(),ze=()=>(()=>{var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.notifications")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.notifications.agent.title")},get description(){return t.t("settings.general.notifications.agent.description")},get children(){var n=Nt();return r(n,e($,{get checked(){return l.notifications.agent()},onChange:p=>l.notifications.setAgent(p)})),n}}),e(f,{get title(){return t.t("settings.general.notifications.permissions.title")},get description(){return t.t("settings.general.notifications.permissions.description")},get children(){var n=Lt();return r(n,e($,{get checked(){return l.notifications.permissions()},onChange:p=>l.notifications.setPermissions(p)})),n}}),e(f,{get title(){return t.t("settings.general.notifications.errors.title")},get description(){return t.t("settings.general.notifications.errors.description")},get children(){var n=Ot();return r(n,e($,{get checked(){return l.notifications.errors()},onChange:p=>l.notifications.setErrors(p)})),n}})]}}),null),o})(),Ae=()=>(()=>{var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.sounds")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.sounds.agent.title")},get description(){return t.t("settings.general.sounds.agent.description")},get children(){return e(G,ge({"data-action":"settings-sounds-agent"},()=>H(()=>l.sounds.agentEnabled(),()=>l.sounds.agent(),n=>l.sounds.setAgentEnabled(n),n=>l.sounds.setAgent(n))))}}),e(f,{get title(){return t.t("settings.general.sounds.permissions.title")},get description(){return t.t("settings.general.sounds.permissions.description")},get children(){return e(G,ge({"data-action":"settings-sounds-permissions"},()=>H(()=>l.sounds.permissionsEnabled(),()=>l.sounds.permissions(),n=>l.sounds.setPermissionsEnabled(n),n=>l.sounds.setPermissions(n))))}}),e(f,{get title(){return t.t("settings.general.sounds.errors.title")},get description(){return t.t("settings.general.sounds.errors.description")},get children(){return e(G,ge({"data-action":"settings-sounds-errors"},()=>H(()=>l.sounds.errorsEnabled(),()=>l.sounds.errors(),n=>l.sounds.setErrorsEnabled(n),n=>l.sounds.setErrors(n))))}})]}}),null),o})(),Ne=()=>(()=>{var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.updates")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.row.releaseNotes.title")},get description(){return t.t("settings.general.row.releaseNotes.description")},get children(){var n=Bt();return r(n,e($,{get checked(){return l.general.releaseNotes()},onChange:p=>l.general.setReleaseNotes(p)})),n}}),e(f,{get title(){return t.t("settings.updates.row.check.title")},get description(){return t.t("settings.updates.row.check.description")},get children(){return e(W,{size:"small",variant:"secondary",get disabled(){return!_.action().run},get onClick(){return _.run},get children(){return t.t(_.action().label)}})}})]}}),null),o})(),Le=()=>e(w,{get when(){return A()},get children(){var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.display")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.row.pinchZoom.title")},get description(){return t.t("settings.general.row.pinchZoom.description")},get children(){var n=Vt();return r(n,e($,{get checked(){return u.latest},onChange:Y})),n}}),e(w,{get when(){return y()},get children(){return e(f,{get title(){return(()=>{var n=Rt(),p=n.firstChild;return r(p,()=>t.t("settings.general.row.wayland.title")),r(n,e(Ye,{get value(){return t.t("settings.general.row.wayland.tooltip")},placement:"top",get children(){var g=Mt();return r(g,e(j,{name:"help",size:"small"})),g}}),null),n})()},get description(){return t.t("settings.general.row.wayland.description")},get children(){var n=jt();return r(n,e($,{get checked(){return R.latest==="wayland"},onChange:ae})),n}})}})]}}),null),o}});return(()=>{var o=Zt(),s=o.firstChild,n=s.firstChild,p=n.firstChild,g=s.nextSibling;return r(p,()=>t.t("settings.tab.general")),r(g,e(w,{get when(){return l.general.layoutTransitionAvailable()},get children(){return e(Te,{})}}),null),r(g,e(w,{get when(){return l.general.newInterfaceNoticeVisible()},get children(){return e(De,{})}}),null),r(g,e(Ee,{}),null),r(g,e(Ie,{}),null),r(g,e(ze,{}),null),r(g,e(Ae,{}),null),r(g,e(Ne,{}),null),r(g,e(Le,{}),null),r(g,e(w,{get when(){return A()},get children(){return e(Fe,{})}}),null),o})()},f=i=>(()=>{var t=Kt(),a=t.firstChild,c=a.firstChild,v=c.nextSibling,m=a.nextSibling;return r(c,()=>i.title),r(v,()=>i.description),r(m,()=>i.children),t})();function Ce(i){const t=me(),a=he();return e(w,{get when(){return a.general.newLayoutDesigns()},get fallback(){return i.children},get children(){return e(w,{get when(){return t.settings.server.selected()},children:c=>e(qt,{get server(){return c()},get children(){return i.children}})})}})}function qt(i){const t=me(),a=()=>t.ensureServerCtx(i.server);return e(lt,{get client(){return a().queryClient},get children(){return e(nt,{server:()=>i.server,get children(){return e(st,{get children(){return e(it,{get children(){return i.children}})}})}})}})}function ke(){const i=me(),t=he(),a=I(()=>t.general.newLayoutDesigns()?i.settings.server.selected():void 0);return e(w,{get when(){return a()},children:c=>e(q,{gutter:4,placement:"bottom-end",get children(){return[e(q.Trigger,{as:W,variant:"secondary",size:"large",class:"h-8 max-w-[260px] gap-2 px-2 py-1.5 data-[expanded]:bg-surface-base-active",get children(){return[e(xe,{get health(){return i.servers.health[te.key(c())]}}),e(be,{get conn(){return c()},get status(){return i.servers.health[te.key(c())]},class:"flex items-center gap-2 min-w-0 flex-1",nameClass:"text-14-regular text-text-base truncate",versionClass:"hidden"}),e(j,{name:"chevron-down",size:"small",class:"text-icon-weak shrink-0"})]}}),e(q.Portal,{get children(){return e(q.Content,{class:"w-[320px] mt-1 [&_[data-slot=dropdown-menu-radio-item]]:pl-2 [&_[data-slot=dropdown-menu-radio-item]]:pr-2",get children(){return e(q.RadioGroup,{get value(){return i.settings.server.key},onChange:v=>{typeof v=="string"&&i.settings.server.set(te.Key.make(v))},get children(){return e(J,{get each(){return i.servers.list()},children:v=>{const m=te.key(v),l=()=>i.servers.health[m]?.healthy===!1;return e(q.RadioItem,{value:m,get disabled(){return l()},get children(){return[e(xe,{get health(){return i.servers.health[m]}}),e(be,{conn:v,get dimmed(){return l()},get status(){return i.servers.health[m]},class:"flex items-center gap-2 min-w-0 flex-1",nameClass:"text-14-regular text-text-base truncate",versionClass:"text-12-regular text-text-weak truncate"}),e(q.ItemIndicator,{get children(){return e(j,{name:"check-small",size:"small",class:"text-icon-weak"})}})]}})}})}})}})}})]}})})}var Ut=d('<div class="flex items-center justify-between gap-4 min-h-16 border-b border-border-weak-base last:border-none flex-wrap py-3"data-component=custom-provider-section><div class="flex flex-col min-w-0"><div class="flex flex-wrap items-center gap-x-3 gap-y-1"><span class="text-14-medium text-text-strong"></span></div><span class="text-12-regular text-text-weak pl-8">'),Wt=d('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex items-center justify-between gap-4 pt-6 pb-8 max-w-[720px]"><h2 class="text-16-medium text-text-strong"></h2></div></div><div class="flex flex-col gap-8 max-w-[720px]"><div class="flex flex-col gap-1"data-component=connected-providers-section><h3 class="text-14-medium text-text-strong pb-2"></h3></div><div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),Ht=d('<div class="py-4 text-14-regular text-text-weak">'),Qt=d('<div class="group flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"><div class="flex items-center gap-3 min-w-0"><span class="text-14-medium text-text-strong truncate">'),Yt=d('<span class="text-14-regular text-text-base opacity-0 group-hover:opacity-100 transition-opacity duration-200 pr-3 cursor-default">'),Jt=d('<div class="flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"><div class="flex flex-col min-w-0"><div class="flex items-center gap-x-3"><span class="text-14-medium text-text-strong">'),Xt=d('<span class="text-12-regular text-text-weak pl-8">');const er=[{match:i=>i==="opencode",key:"dialog.provider.opencode.note"},{match:i=>i==="opencode-go",key:"dialog.provider.opencodeGo.tagline"},{match:i=>i==="anthropic",key:"dialog.provider.anthropic.note"},{match:i=>i.startsWith("github-copilot"),key:"dialog.provider.copilot.note"},{match:i=>i==="openai",key:"dialog.provider.openai.note"},{match:i=>i==="google",key:"dialog.provider.google.note"},{match:i=>i==="openrouter",key:"dialog.provider.openrouter.note"},{match:i=>i==="vercel",key:"dialog.provider.vercel.note"}],tr=i=>e(Ce,{get children(){return e(rr,{get onBack(){return i.onBack}})}}),rr=i=>{const t=pe(),a=X(),c=ye(),v=at(),m=$e(),l=ot(()=>{}),_=_t({onBack:i.onBack}),y=h=>{_.select(h),t.show(()=>e(yt,{controller:_}))},k=I(()=>l.connected().filter(h=>h.id!=="opencode"||Object.values(h.models).find(u=>u.cost?.input))),P=I(()=>{const h=new Set(k().map(b=>b.id)),u=l.popular().filter(b=>!h.has(b.id)).slice();return u.sort((b,O)=>le.indexOf(b.id)-le.indexOf(O.id)),u}),T=h=>{if(!("source"in h))return;const u=h.source;if(u==="env"||u==="api"||u==="config"||u==="custom")return u},A=h=>{const u=T(h);return u==="env"?a.t("settings.providers.tag.environment"):u==="api"?a.t("provider.connect.method.apiKey"):u==="config"?L(h.id)?a.t("settings.providers.tag.custom"):a.t("settings.providers.tag.config"):u==="custom"?a.t("settings.providers.tag.custom"):a.t("settings.providers.tag.other")},N=h=>T(h)!=="env"&&(v()==="v1"||!L(h.id)),E=h=>er.find(u=>u.match(h))?.key,L=h=>{const u=m().data.config.provider?.[h];return!(!u||u.npm!=="@ai-sdk/openai-compatible"||!u.models||Object.keys(u.models).length===0)},B=async(h,u)=>{if(v()!=="v1")return;const b=m().data.config.disabled_providers??[],O=b.includes(h)?b:[...b,h];m().set("config","disabled_providers",O),await m().updateConfig({disabled_providers:O}).then(()=>{ne({variant:"success",icon:"circle-check",title:a.t("provider.disconnect.toast.disconnected.title",{provider:u}),description:a.t("provider.disconnect.toast.disconnected.description",{provider:u})})}).catch(Z=>{m().set("config","disabled_providers",b);const K=Z instanceof Error?Z.message:String(Z);ne({title:a.t("common.requestFailed"),description:K})})},R=async(h,u)=>{if(L(h)){await c().client.auth.remove({providerID:h}).catch(()=>{}),await B(h,u);return}await c().client.auth.remove({providerID:h}).then(async()=>{await c().client.global.dispose(),ne({variant:"success",icon:"circle-check",title:a.t("provider.disconnect.toast.disconnected.title",{provider:u}),description:a.t("provider.disconnect.toast.disconnected.description",{provider:u})})}).catch(b=>{const O=b instanceof Error?b.message:String(b);ne({title:a.t("common.requestFailed"),description:O})})};return(()=>{var h=Wt(),u=h.firstChild,b=u.firstChild,O=b.firstChild,Z=u.nextSibling,K=Z.firstChild,ae=K.firstChild,Y=K.nextSibling,ee=Y.firstChild;return r(O,()=>a.t("settings.providers.title")),r(b,e(ke,{}),null),r(ae,()=>a.t("settings.providers.section.connected")),r(K,e(z,{get children(){return e(w,{get when(){return k().length>0},get fallback(){return(()=>{var x=Ht();return r(x,()=>a.t("settings.providers.connected.empty")),x})()},get children(){return e(J,{get each(){return k()},children:x=>(()=>{var D=Qt(),S=D.firstChild,F=S.firstChild;return r(S,e(ie,{get id(){return x.id},class:"size-5 shrink-0 icon-strong-base"}),F),r(F,()=>x.name),r(S,e(re,{get children(){return A(x)}}),null),r(D,e(w,{get when(){return N(x)},get fallback(){return(()=>{var V=Yt();return r(V,()=>a.t("settings.providers.connected.environmentDescription")),V})()},get children(){return e(W,{size:"large",variant:"ghost",onClick:()=>void R(x.id,x.name),get children(){return a.t("common.disconnect")}})}}),null),D})()})}})}}),null),r(ee,()=>a.t("settings.providers.section.popular")),r(Y,e(z,{get children(){return[e(J,{get each(){return P()},children:x=>(()=>{var D=Jt(),S=D.firstChild,F=S.firstChild,V=F.firstChild;return r(F,e(ie,{get id(){return x.id},class:"size-5 shrink-0 icon-strong-base"}),V),r(V,()=>x.name),r(F,e(w,{get when(){return x.id==="opencode"},get children(){return e(re,{get children(){return a.t("dialog.provider.tag.recommended")}})}}),null),r(F,e(w,{get when(){return x.id==="opencode-go"},get children(){return e(re,{get children(){return a.t("dialog.provider.tag.recommended")}})}}),null),r(S,e(w,{get when(){return E(x.id)},children:oe=>(()=>{var H=Xt();return r(H,()=>a.t(oe())),H})()}),null),r(D,e(W,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>y(x.id),get children(){return a.t("common.connect")}}),null),D})()}),e(w,{get when(){return v()==="v1"},get children(){var x=Ut(),D=x.firstChild,S=D.firstChild,F=S.firstChild,V=S.nextSibling;return r(S,e(ie,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),F),r(F,()=>a.t("provider.custom.title")),r(S,e(re,{get children(){return a.t("settings.providers.tag.custom")}}),null),r(V,()=>a.t("settings.providers.custom.description")),r(x,e(W,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{t.show(()=>e($t,{get onBack(){return t.close}}))},get children(){return a.t("common.connect")}}),null),x}})]}}),null),r(Y,e(W,{variant:"ghost",class:"px-0 py-0 mt-5 text-14-medium text-text-interactive-base text-left justify-start hover:bg-transparent active:bg-transparent",onClick:()=>y(),get children(){return a.t("dialog.provider.viewAll")}}),null),h})()};var Pe=d('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),nr=d('<span class="text-14-regular text-text-strong mt-1">"<!>"'),sr=d('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-4 pt-6 pb-6 max-w-[720px]"><div class="flex items-center justify-between gap-4"><h2 class="text-16-medium text-text-strong"></h2></div><div class="flex items-center gap-2 px-3 h-9 rounded-lg bg-surface-base"></div></div></div><div class="flex flex-col gap-8 max-w-[720px]">'),ir=d('<div class="flex flex-col gap-1"><div class="flex items-center gap-2 pb-2"><span class="text-14-medium text-text-strong">'),lr=d('<div class="flex flex-wrap items-center justify-between gap-4 py-3 border-b border-border-weak-base last:border-none"><div class=min-w-0><span class="text-14-regular text-text-strong truncate block"></span></div><div class=flex-shrink-0>');const ar=i=>(()=>{var t=Pe(),a=t.firstChild;return r(a,()=>i.label),t})(),or=i=>(()=>{var t=Pe(),a=t.firstChild;return r(a,()=>i.message),r(t,e(w,{get when(){return i.filter},get children(){var c=nr(),v=c.firstChild,m=v.nextSibling;return m.nextSibling,r(c,()=>i.filter,m),c}}),null),t})(),cr=()=>e(Ce,{get children(){return e(gr,{})}}),gr=()=>{const i=X(),t=ct(),a=gt({items:c=>t.list(),key:c=>`${c.provider.id}:${c.id}`,filterKeys:["provider.name","name","id"],sortBy:(c,v)=>c.name.localeCompare(v.name),groupBy:c=>c.provider.id,sortGroupsBy:(c,v)=>{const m=le.indexOf(c.category),l=le.indexOf(v.category),_=m>=0,y=l>=0;if(_&&!y)return-1;if(!_&&y)return 1;if(_&&y)return m-l;const k=c.items[0].provider.name,P=v.items[0].provider.name;return k.localeCompare(P)}});return(()=>{var c=sr(),v=c.firstChild,m=v.firstChild,l=m.firstChild,_=l.firstChild,y=l.nextSibling,k=v.nextSibling;return r(_,()=>i.t("settings.models.title")),r(l,e(ke,{}),null),r(y,e(j,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(y,e(se,{variant:"ghost",type:"text",get value(){return a.filter()},get onChange(){return a.onInput},get placeholder(){return i.t("dialog.model.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(y,e(w,{get when(){return a.filter()},get children(){return e(dt,{icon:"circle-x",variant:"ghost",get onClick(){return a.clear}})}}),null),r(k,e(w,{get when(){return!a.grouped.loading},get fallback(){return e(ar,{get label(){return`${i.t("common.loading")}${i.t("common.loading.ellipsis")}`}})},get children(){return e(w,{get when(){return a.flat().length>0},get fallback(){return e(or,{get message(){return i.t("dialog.model.empty")},get filter(){return a.filter()}})},get children(){return e(J,{get each(){return a.grouped.latest},children:P=>(()=>{var T=ir(),A=T.firstChild,N=A.firstChild;return r(A,e(ie,{get id(){return P.category},class:"size-5 shrink-0 icon-strong-base"}),N),r(N,()=>P.items[0].provider.name),r(T,e(z,{get children(){return e(J,{get each(){return P.items},children:E=>{const L={providerID:E.provider.id,modelID:E.id};return(()=>{var B=lr(),R=B.firstChild,h=R.firstChild,u=R.nextSibling;return r(h,()=>E.name),r(u,e($,{get checked(){return t.visible(L)},onChange:b=>{t.setVisibility(L,b)},hideLabel:!0,get children(){return E.name}})),B})()}})}}),null),T})()})}})}})),c})()};var dr=d('<div class="flex flex-1 min-h-0 flex-col gap-4 pt-6"><div class="text-16-medium text-text-strong">'),ur=d('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="flex flex-col flex-1 min-h-0 max-w-[720px]">'),pr=d('<div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-1 pt-6 pb-8"><h2 class="text-16-medium text-text-strong">');const hr=()=>{const i=X(),t=ut();return(()=>{var a=ur(),c=a.firstChild;return r(c,e(w,{get when(){return t.isFormMode()},get fallback(){return[(()=>{var v=pr(),m=v.firstChild,l=m.firstChild;return r(l,()=>i.t("status.popover.tab.servers")),v})(),e(ht,{controller:t})]},get children(){var v=dr(),m=v.firstChild;return r(m,()=>t.formTitle()),r(v,e(pt,{controller:t}),null),v}})),a})()};var mr=d('<div class="flex flex-col justify-between h-full w-full gap-4"><div class="flex flex-col gap-3 w-full pt-3"><div class="flex flex-col gap-3"><div class="flex flex-col gap-1.5"><div class="flex flex-col gap-1.5 w-full"></div></div><div class="flex flex-col gap-1.5"><div class="flex flex-col gap-1.5 w-full"></div></div></div></div><div class="flex flex-col gap-1 pl-1 py-1 text-12-medium text-text-weak"><span></span><span class=text-11-regular>v');const vr=i=>{const t=X(),a=_e(),c=pe(),[v,m]=mt(i.defaultValue??"general"),l=()=>{c.show(()=>e(vr,{defaultValue:"providers"}))};return e(ft,{size:"x-large",transition:!0,get children(){return e(C,{orientation:"vertical",variant:"settings",get value(){return v()},onChange:_=>void vt(()=>m(_)),class:"h-full settings-dialog",get children(){return[e(C.List,{get children(){var _=mr(),y=_.firstChild,k=y.firstChild,P=k.firstChild,T=P.firstChild,A=P.nextSibling,N=A.firstChild,E=y.nextSibling,L=E.firstChild,B=L.nextSibling;return B.firstChild,r(P,e(C.SectionTitle,{get children(){return t.t("settings.section.desktop")}}),T),r(T,e(C.Trigger,{value:"general",get children(){return[e(j,{name:"sliders"}),U(()=>t.t("settings.tab.general"))]}}),null),r(T,e(C.Trigger,{value:"shortcuts",get children(){return[e(j,{name:"keyboard"}),U(()=>t.t("settings.tab.shortcuts"))]}}),null),r(T,e(C.Trigger,{value:"servers",get children(){return[e(j,{name:"server"}),U(()=>t.t("status.popover.tab.servers"))]}}),null),r(A,e(C.SectionTitle,{get children(){return t.t("settings.section.server")}}),N),r(N,e(C.Trigger,{value:"providers",get children(){return[e(j,{name:"providers"}),U(()=>t.t("settings.providers.title"))]}}),null),r(N,e(C.Trigger,{value:"models",get children(){return[e(j,{name:"models"}),U(()=>t.t("settings.models.title"))]}}),null),r(L,(()=>{var R=U(()=>a.platform==="desktop");return()=>R()?t.t("app.name.desktop"):"Agentic Web"})()),r(B,()=>a.version,null),_}}),e(C.Content,{value:"general",class:"no-scrollbar",get children(){return e(Gt,{})}}),e(C.Content,{value:"shortcuts",class:"no-scrollbar",get children(){return e(bt,{})}}),e(C.Content,{value:"servers",class:"no-scrollbar",get children(){return e(hr,{})}}),e(C.Content,{value:"providers",class:"no-scrollbar",get children(){return e(tr,{onBack:l})}}),e(C.Content,{value:"models",class:"no-scrollbar",get children(){return e(cr,{})}})]}})}})};export{vr as DialogSettings};
|
|
3
|
-
//# sourceMappingURL=dialog-settings-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B5UCYzgt.js","assets/index-BH1J9J8E.js","assets/index-DoggtF0n.css","assets/row-DgKhGiK9.js","assets/LROKH5N7-CufzWEns.js","assets/row-BjpwzvFU.css","assets/settings-keybinds-C8R--jLJ.js","assets/list-BK0ZBxm_.js","assets/dialog-connect-provider-cMnfONyq.js","assets/index-GGAIvKVQ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{cp as Be,c0 as X,c7 as Ve,c8 as _e,bW as pe,c6 as je,cl as he,aD as I,aR as Me,ci as $e,ch as ye,aJ as ce,bn as Re,b7 as r,au as e,a2 as w,bM as d,af as Ze,a9 as Ke,B as W,T as G,bb as U,aa as se,bC as Ge,bD as qe,bf as Ue,bg as We,bN as He,bO as Qe,bd as ge,ac as Ye,I as j,bE as Je,bh as Xe,bP as et,S as tt,bw as rt,b_ as me,l as q,Y as xe,V as te,Z as be,o as J,$ as nt,a0 as st,y as it,Q as lt,cg as at,cb as ot,bx as le,N as ie,a8 as re,bH as ne,c3 as ct,bY as gt,u as dt,cf as ut,W as pt,X as ht,aL as mt,a7 as C,bL as vt,b as ft}from"./index-BH1J9J8E.js";import{S as $}from"./switch-BnUb38m8.js";import{u as xt,a as z,S as bt}from"./settings-keybinds-C8R--jLJ.js";import{E as wt,u as _t,a as $t,D as yt}from"./dialog-connect-provider-cMnfONyq.js";import"./LROKH5N7-CufzWEns.js";import"./list-BK0ZBxm_.js";var St=d("<div data-action=settings-new-layout-designs>"),de=d('<div class="flex flex-col gap-1">'),Ct=d('<span class="flex items-center gap-2">'),kt=d("<div data-action=settings-auto-accept-permissions>"),Pt=d("<div data-action=settings-feed-reasoning-summaries>"),Tt=d("<div data-action=settings-feed-shell-tool-parts-expanded>"),Dt=d("<div data-action=settings-feed-edit-tool-parts-expanded>"),Et=d("<div data-action=settings-show-file-tree>"),Ft=d("<div data-action=settings-show-navigation>"),It=d("<div data-action=settings-show-search>"),zt=d("<div data-action=settings-show-status>"),At=d("<div data-action=settings-show-custom-agents>"),Q=d('<div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),ue=d('<div class="w-full sm:w-[220px]">'),Nt=d("<div data-action=settings-notifications-agent>"),Lt=d("<div data-action=settings-notifications-permissions>"),Ot=d("<div data-action=settings-notifications-errors>"),Bt=d("<div data-action=settings-release-notes>"),Vt=d("<div data-action=settings-pinch-zoom>"),jt=d("<div data-action=settings-wayland>"),Mt=d("<span class=text-text-weak>"),Rt=d('<div class="flex items-center gap-2"><span>'),Zt=d('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-1 pt-6 pb-8"><h2 class="text-16-medium text-text-strong"></h2></div></div><div class="flex flex-col gap-8 w-full">'),Kt=d('<div class="flex flex-wrap items-center gap-4 py-3 border-b border-border-weak-base last:border-none sm:flex-nowrap"><div class="flex min-w-0 flex-1 flex-col gap-0.5"><span class="text-14-medium text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex w-full justify-end sm:w-auto sm:shrink-0">');let M={cleanup:void 0,timeout:void 0,run:0};const Se=()=>{M.run+=1,M.cleanup&&M.cleanup(),clearTimeout(M.timeout),M.cleanup=void 0},we=i=>{if(Se(),!i)return;const t=++M.run;M.timeout=setTimeout(()=>{rt(i).then(a=>{if(M.run!==t){a?.();return}M.cleanup=a})},100)},Gt=()=>{const i=Be(),t=X(),a=Ve(),c=_e(),v=pe(),m=je(),l=he(),_=xt(),y=I(()=>c.platform==="desktop"&&c.os==="linux"),k=I(()=>Me(m.dir)),P=I(()=>{const o=k();return o?m.id?a.isAutoAccepting(m.id,o):a.isAutoAcceptingDirectory(o):!1}),T=o=>{const s=k();if(s){if(!m.id){if(a.isAutoAcceptingDirectory(s)===o)return;a.toggleAutoAcceptDirectory(s);return}if(o){a.enableAutoAccept(m.id,s);return}a.disableAutoAccept(m.id,s)}},A=I(()=>c.platform==="desktop"),N=I(()=>i.ids().map(o=>({id:o,name:i.name(o)}))),E=$e(),L=ye(),[B]=ce(async()=>{const o=L();return await o.protocol==="v1"?(await o.client.pty.shells()).data??[]:[]},{initialValue:[]}),[R,{refetch:h}]=ce(()=>!!(y()&&c.getDisplayBackend),()=>Promise.resolve(c.getDisplayBackend?.()??null).catch(()=>null),{initialValue:null}),[u,{mutate:b}]=ce(()=>!!(A()&&c.getPinchZoomEnabled),()=>Promise.resolve(c.getPinchZoomEnabled?.()??!1).catch(()=>!1),{initialValue:!1});Re(()=>{i.loadThemes()});const O={id:"auto",value:"",label:t.t("settings.general.row.shell.autoDefault")},Z=I(()=>E().data.config.shell??""),K=I(()=>{const o=B.latest,s=E().data.config.shell,n=new Map;for(const g of o)n.set(g.name,(n.get(g.name)||0)+1);const p=[O,...o.map(g=>{const ve=(n.get(g.name)||0)>1,fe=ve?g.path:g.name,Oe=g.acceptable?fe:`${fe} (${t.t("settings.general.row.shell.terminalOnly")})`;return{id:g.path,value:ve?g.path:g.name,label:Oe}})];return s&&!p.some(g=>g.value===s)&&p.push({id:s,value:s,label:s}),p}),ae=o=>{const s=c.setDisplayBackend?.(o?"wayland":"auto");s&&s.finally(()=>{h()})},Y=o=>{b(o);const s=c.setPinchZoomEnabled?.(o);s&&s.catch(()=>b(!o))},ee=I(()=>[{value:"system",label:t.t("theme.scheme.system")},{value:"light",label:t.t("theme.scheme.light")},{value:"dark",label:t.t("theme.scheme.dark")}]),x=I(()=>t.locales.map(o=>({value:o,label:t.label(o)}))),D={id:"none",label:"sound.option.none"},S=[D,...tt],F=()=>Xe(l.appearance.font()),V=()=>Je(l.appearance.uiFont()),oe=()=>et(l.appearance.terminalFont()),H=(o,s,n,p)=>({options:S,current:o()?S.find(g=>g.id===s())??D:D,value:g=>g.id,label:g=>t.t(g.label),onHighlight:g=>{g&&we(g.id==="none"?void 0:g.id)},onSelect:g=>{if(g){if(g.id==="none"){n(!1),Se();return}n(!0),p(g.id),we(g.id)}},variant:"secondary",size:"small",triggerVariant:"settings"}),Te=()=>(()=>{var o=de();return r(o,e(z,{get children(){return e(f,{get title(){return(()=>{var s=Ct();return r(s,()=>t.t("settings.general.row.newInterface.title"),null),r(s,e(Ke,{variant:"accent",get children(){return t.t("settings.general.row.newInterface.badge")}}),null),s})()},get description(){return t.t("settings.general.row.newInterface.description")},get children(){var s=St();return r(s,e($,{get checked(){return l.general.newLayoutDesigns()},onChange:n=>{l.general.setNewLayoutDesigns(n),n&&Ze(()=>import("./index-B5UCYzgt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(p=>{v.show(()=>e(p.DialogSettings,{}))})}})),s}})}})),o})(),De=()=>(()=>{var o=de();return r(o,e(z,{get children(){return e(f,{get title(){return t.t("settings.general.row.newInterfaceNotice.title")},get description(){return t.t("settings.general.row.newInterfaceNotice.description")},get children(){return e(W,{size:"small",variant:"ghost",get onClick(){return l.general.dismissNewInterfaceNotice},get children(){return t.t("settings.general.row.newInterfaceNotice.dismiss")}})}})}})),o})(),Ee=()=>(()=>{var o=de();return r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.row.language.title")},get description(){return t.t("settings.general.row.language.description")},get children(){return e(G,{"data-action":"settings-language",get options(){return x()},get current(){return x().find(s=>s.value===t.locale())},value:s=>s.value,label:s=>s.label,onSelect:s=>s&&t.setLocale(s.value),variant:"secondary",size:"small",triggerVariant:"settings"})}}),e(f,{get title(){return t.t("command.permissions.autoaccept.enable")},get description(){return t.t("toast.permissions.autoaccept.on.description")},get children(){var s=kt();return r(s,e($,{get checked(){return P()},get disabled(){return!k()},onChange:T})),s}}),e(f,{get title(){return t.t("settings.general.row.shell.title")},get description(){return t.t("settings.general.row.shell.description")},get children(){return e(G,{"data-action":"settings-shell",get options(){return K()},get current(){return K().find(s=>s.value===Z())??O},value:s=>s.id,label:s=>s.label,onSelect:s=>{s&&s.value!==Z()&&E().updateConfig({shell:s.value})},variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"180px"}})}}),e(f,{get title(){return t.t("settings.general.row.reasoningSummaries.title")},get description(){return t.t("settings.general.row.reasoningSummaries.description")},get children(){var s=Pt();return r(s,e($,{get checked(){return l.general.showReasoningSummaries()},onChange:n=>l.general.setShowReasoningSummaries(n)})),s}}),e(f,{get title(){return t.t("settings.general.row.shellToolPartsExpanded.title")},get description(){return t.t("settings.general.row.shellToolPartsExpanded.description")},get children(){var s=Tt();return r(s,e($,{get checked(){return l.general.shellToolPartsExpanded()},onChange:n=>l.general.setShellToolPartsExpanded(n)})),s}}),e(f,{get title(){return t.t("settings.general.row.editToolPartsExpanded.title")},get description(){return t.t("settings.general.row.editToolPartsExpanded.description")},get children(){var s=Dt();return r(s,e($,{get checked(){return l.general.editToolPartsExpanded()},onChange:n=>l.general.setEditToolPartsExpanded(n)})),s}})]}})),o})(),Fe=()=>(()=>{var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.advanced")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.row.showFileTree.title")},get description(){return t.t("settings.general.row.showFileTree.description")},get children(){var n=Et();return r(n,e($,{get checked(){return l.general.showFileTree()},onChange:p=>l.general.setShowFileTree(p)})),n}}),e(f,{get title(){return t.t("settings.general.row.showNavigation.title")},get description(){return t.t("settings.general.row.showNavigation.description")},get children(){var n=Ft();return r(n,e($,{get checked(){return l.general.showNavigation()},onChange:p=>l.general.setShowNavigation(p)})),n}}),e(f,{get title(){return t.t("settings.general.row.showSearch.title")},get description(){return t.t("settings.general.row.showSearch.description")},get children(){var n=It();return r(n,e($,{get checked(){return l.general.showSearch()},onChange:p=>l.general.setShowSearch(p)})),n}}),e(f,{get title(){return t.t("settings.general.row.showStatus.title")},get description(){return t.t("settings.general.row.showStatus.description")},get children(){var n=zt();return r(n,e($,{get checked(){return l.general.showStatus()},onChange:p=>l.general.setShowStatus(p)})),n}}),e(f,{get title(){return t.t("settings.general.row.showCustomAgents.title")},get description(){return t.t("settings.general.row.showCustomAgents.description")},get children(){var n=At();return r(n,e($,{get checked(){return l.general.showCustomAgents()},onChange:p=>l.general.setShowCustomAgents(p)})),n}})]}}),null),o})(),Ie=()=>(()=>{var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.appearance")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.row.colorScheme.title")},get description(){return t.t("settings.general.row.colorScheme.description")},get children(){return e(G,{"data-action":"settings-color-scheme",get options(){return ee()},get current(){return ee().find(n=>n.value===i.colorScheme())},value:n=>n.value,label:n=>n.label,onSelect:n=>n&&i.setColorScheme(n.value),variant:"secondary",size:"small",triggerVariant:"settings",triggerStyle:{"min-width":"220px"}})}}),e(f,{get title(){return t.t("settings.general.row.theme.title")},get description(){return[U(()=>t.t("settings.general.row.theme.description"))," ",e(wt,{href:"https://opencode.ai/docs/themes/",get children(){return t.t("common.learnMore")}})]},get children(){return e(G,{"data-action":"settings-theme",get options(){return N()},get current(){return N().find(n=>n.id===i.themeId())},value:n=>n.id,label:n=>n.name,onSelect:n=>{n&&i.setTheme(n.id)},variant:"secondary",size:"small",triggerVariant:"settings"})}}),e(f,{get title(){return t.t("settings.general.row.uiFont.title")},get description(){return t.t("settings.general.row.uiFont.description")},get children(){var n=ue();return r(n,e(se,{"data-action":"settings-ui-font",get label(){return t.t("settings.general.row.uiFont.title")},hideLabel:!0,type:"text",get value(){return V()},onChange:p=>l.appearance.setUIFont(p),placeholder:Ge,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":qe(l.appearance.uiFont())}}})),n}}),e(f,{get title(){return t.t("settings.general.row.font.title")},get description(){return t.t("settings.general.row.font.description")},get children(){var n=ue();return r(n,e(se,{"data-action":"settings-code-font",get label(){return t.t("settings.general.row.font.title")},hideLabel:!0,type:"text",get value(){return F()},onChange:p=>l.appearance.setFont(p),placeholder:Ue,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":We(l.appearance.font())}}})),n}}),e(f,{get title(){return t.t("settings.general.row.terminalFont.title")},get description(){return t.t("settings.general.row.terminalFont.description")},get children(){var n=ue();return r(n,e(se,{"data-action":"settings-terminal-font",get label(){return t.t("settings.general.row.terminalFont.title")},hideLabel:!0,type:"text",get value(){return oe()},onChange:p=>l.appearance.setTerminalFont(p),placeholder:He,spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"text-12-regular",get style(){return{"font-family":Qe(l.appearance.terminalFont())}}})),n}})]}}),null),o})(),ze=()=>(()=>{var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.notifications")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.notifications.agent.title")},get description(){return t.t("settings.general.notifications.agent.description")},get children(){var n=Nt();return r(n,e($,{get checked(){return l.notifications.agent()},onChange:p=>l.notifications.setAgent(p)})),n}}),e(f,{get title(){return t.t("settings.general.notifications.permissions.title")},get description(){return t.t("settings.general.notifications.permissions.description")},get children(){var n=Lt();return r(n,e($,{get checked(){return l.notifications.permissions()},onChange:p=>l.notifications.setPermissions(p)})),n}}),e(f,{get title(){return t.t("settings.general.notifications.errors.title")},get description(){return t.t("settings.general.notifications.errors.description")},get children(){var n=Ot();return r(n,e($,{get checked(){return l.notifications.errors()},onChange:p=>l.notifications.setErrors(p)})),n}})]}}),null),o})(),Ae=()=>(()=>{var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.sounds")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.sounds.agent.title")},get description(){return t.t("settings.general.sounds.agent.description")},get children(){return e(G,ge({"data-action":"settings-sounds-agent"},()=>H(()=>l.sounds.agentEnabled(),()=>l.sounds.agent(),n=>l.sounds.setAgentEnabled(n),n=>l.sounds.setAgent(n))))}}),e(f,{get title(){return t.t("settings.general.sounds.permissions.title")},get description(){return t.t("settings.general.sounds.permissions.description")},get children(){return e(G,ge({"data-action":"settings-sounds-permissions"},()=>H(()=>l.sounds.permissionsEnabled(),()=>l.sounds.permissions(),n=>l.sounds.setPermissionsEnabled(n),n=>l.sounds.setPermissions(n))))}}),e(f,{get title(){return t.t("settings.general.sounds.errors.title")},get description(){return t.t("settings.general.sounds.errors.description")},get children(){return e(G,ge({"data-action":"settings-sounds-errors"},()=>H(()=>l.sounds.errorsEnabled(),()=>l.sounds.errors(),n=>l.sounds.setErrorsEnabled(n),n=>l.sounds.setErrors(n))))}})]}}),null),o})(),Ne=()=>(()=>{var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.updates")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.row.releaseNotes.title")},get description(){return t.t("settings.general.row.releaseNotes.description")},get children(){var n=Bt();return r(n,e($,{get checked(){return l.general.releaseNotes()},onChange:p=>l.general.setReleaseNotes(p)})),n}}),e(f,{get title(){return t.t("settings.updates.row.check.title")},get description(){return t.t("settings.updates.row.check.description")},get children(){return e(W,{size:"small",variant:"secondary",get disabled(){return!_.action().run},get onClick(){return _.run},get children(){return t.t(_.action().label)}})}})]}}),null),o})(),Le=()=>e(w,{get when(){return A()},get children(){var o=Q(),s=o.firstChild;return r(s,()=>t.t("settings.general.section.display")),r(o,e(z,{get children(){return[e(f,{get title(){return t.t("settings.general.row.pinchZoom.title")},get description(){return t.t("settings.general.row.pinchZoom.description")},get children(){var n=Vt();return r(n,e($,{get checked(){return u.latest},onChange:Y})),n}}),e(w,{get when(){return y()},get children(){return e(f,{get title(){return(()=>{var n=Rt(),p=n.firstChild;return r(p,()=>t.t("settings.general.row.wayland.title")),r(n,e(Ye,{get value(){return t.t("settings.general.row.wayland.tooltip")},placement:"top",get children(){var g=Mt();return r(g,e(j,{name:"help",size:"small"})),g}}),null),n})()},get description(){return t.t("settings.general.row.wayland.description")},get children(){var n=jt();return r(n,e($,{get checked(){return R.latest==="wayland"},onChange:ae})),n}})}})]}}),null),o}});return(()=>{var o=Zt(),s=o.firstChild,n=s.firstChild,p=n.firstChild,g=s.nextSibling;return r(p,()=>t.t("settings.tab.general")),r(g,e(w,{get when(){return l.general.layoutTransitionAvailable()},get children(){return e(Te,{})}}),null),r(g,e(w,{get when(){return l.general.newInterfaceNoticeVisible()},get children(){return e(De,{})}}),null),r(g,e(Ee,{}),null),r(g,e(Ie,{}),null),r(g,e(ze,{}),null),r(g,e(Ae,{}),null),r(g,e(Ne,{}),null),r(g,e(Le,{}),null),r(g,e(w,{get when(){return A()},get children(){return e(Fe,{})}}),null),o})()},f=i=>(()=>{var t=Kt(),a=t.firstChild,c=a.firstChild,v=c.nextSibling,m=a.nextSibling;return r(c,()=>i.title),r(v,()=>i.description),r(m,()=>i.children),t})();function Ce(i){const t=me(),a=he();return e(w,{get when(){return a.general.newLayoutDesigns()},get fallback(){return i.children},get children(){return e(w,{get when(){return t.settings.server.selected()},children:c=>e(qt,{get server(){return c()},get children(){return i.children}})})}})}function qt(i){const t=me(),a=()=>t.ensureServerCtx(i.server);return e(lt,{get client(){return a().queryClient},get children(){return e(nt,{server:()=>i.server,get children(){return e(st,{get children(){return e(it,{get children(){return i.children}})}})}})}})}function ke(){const i=me(),t=he(),a=I(()=>t.general.newLayoutDesigns()?i.settings.server.selected():void 0);return e(w,{get when(){return a()},children:c=>e(q,{gutter:4,placement:"bottom-end",get children(){return[e(q.Trigger,{as:W,variant:"secondary",size:"large",class:"h-8 max-w-[260px] gap-2 px-2 py-1.5 data-[expanded]:bg-surface-base-active",get children(){return[e(xe,{get health(){return i.servers.health[te.key(c())]}}),e(be,{get conn(){return c()},get status(){return i.servers.health[te.key(c())]},class:"flex items-center gap-2 min-w-0 flex-1",nameClass:"text-14-regular text-text-base truncate",versionClass:"hidden"}),e(j,{name:"chevron-down",size:"small",class:"text-icon-weak shrink-0"})]}}),e(q.Portal,{get children(){return e(q.Content,{class:"w-[320px] mt-1 [&_[data-slot=dropdown-menu-radio-item]]:pl-2 [&_[data-slot=dropdown-menu-radio-item]]:pr-2",get children(){return e(q.RadioGroup,{get value(){return i.settings.server.key},onChange:v=>{typeof v=="string"&&i.settings.server.set(te.Key.make(v))},get children(){return e(J,{get each(){return i.servers.list()},children:v=>{const m=te.key(v),l=()=>i.servers.health[m]?.healthy===!1;return e(q.RadioItem,{value:m,get disabled(){return l()},get children(){return[e(xe,{get health(){return i.servers.health[m]}}),e(be,{conn:v,get dimmed(){return l()},get status(){return i.servers.health[m]},class:"flex items-center gap-2 min-w-0 flex-1",nameClass:"text-14-regular text-text-base truncate",versionClass:"text-12-regular text-text-weak truncate"}),e(q.ItemIndicator,{get children(){return e(j,{name:"check-small",size:"small",class:"text-icon-weak"})}})]}})}})}})}})}})]}})})}var Ut=d('<div class="flex items-center justify-between gap-4 min-h-16 border-b border-border-weak-base last:border-none flex-wrap py-3"data-component=custom-provider-section><div class="flex flex-col min-w-0"><div class="flex flex-wrap items-center gap-x-3 gap-y-1"><span class="text-14-medium text-text-strong"></span></div><span class="text-12-regular text-text-weak pl-8">'),Wt=d('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex items-center justify-between gap-4 pt-6 pb-8 max-w-[720px]"><h2 class="text-16-medium text-text-strong"></h2></div></div><div class="flex flex-col gap-8 max-w-[720px]"><div class="flex flex-col gap-1"data-component=connected-providers-section><h3 class="text-14-medium text-text-strong pb-2"></h3></div><div class="flex flex-col gap-1"><h3 class="text-14-medium text-text-strong pb-2">'),Ht=d('<div class="py-4 text-14-regular text-text-weak">'),Qt=d('<div class="group flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"><div class="flex items-center gap-3 min-w-0"><span class="text-14-medium text-text-strong truncate">'),Yt=d('<span class="text-14-regular text-text-base opacity-0 group-hover:opacity-100 transition-opacity duration-200 pr-3 cursor-default">'),Jt=d('<div class="flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"><div class="flex flex-col min-w-0"><div class="flex items-center gap-x-3"><span class="text-14-medium text-text-strong">'),Xt=d('<span class="text-12-regular text-text-weak pl-8">');const er=[{match:i=>i==="opencode",key:"dialog.provider.opencode.note"},{match:i=>i==="opencode-go",key:"dialog.provider.opencodeGo.tagline"},{match:i=>i==="anthropic",key:"dialog.provider.anthropic.note"},{match:i=>i.startsWith("github-copilot"),key:"dialog.provider.copilot.note"},{match:i=>i==="openai",key:"dialog.provider.openai.note"},{match:i=>i==="google",key:"dialog.provider.google.note"},{match:i=>i==="openrouter",key:"dialog.provider.openrouter.note"},{match:i=>i==="vercel",key:"dialog.provider.vercel.note"}],tr=i=>e(Ce,{get children(){return e(rr,{get onBack(){return i.onBack}})}}),rr=i=>{const t=pe(),a=X(),c=ye(),v=at(),m=$e(),l=ot(()=>{}),_=_t({onBack:i.onBack}),y=h=>{_.select(h),t.show(()=>e(yt,{controller:_}))},k=I(()=>l.connected().filter(h=>h.id!=="opencode"||Object.values(h.models).find(u=>u.cost?.input))),P=I(()=>{const h=new Set(k().map(b=>b.id)),u=l.popular().filter(b=>!h.has(b.id)).slice();return u.sort((b,O)=>le.indexOf(b.id)-le.indexOf(O.id)),u}),T=h=>{if(!("source"in h))return;const u=h.source;if(u==="env"||u==="api"||u==="config"||u==="custom")return u},A=h=>{const u=T(h);return u==="env"?a.t("settings.providers.tag.environment"):u==="api"?a.t("provider.connect.method.apiKey"):u==="config"?L(h.id)?a.t("settings.providers.tag.custom"):a.t("settings.providers.tag.config"):u==="custom"?a.t("settings.providers.tag.custom"):a.t("settings.providers.tag.other")},N=h=>T(h)!=="env"&&(v()==="v1"||!L(h.id)),E=h=>er.find(u=>u.match(h))?.key,L=h=>{const u=m().data.config.provider?.[h];return!(!u||u.npm!=="@ai-sdk/openai-compatible"||!u.models||Object.keys(u.models).length===0)},B=async(h,u)=>{if(v()!=="v1")return;const b=m().data.config.disabled_providers??[],O=b.includes(h)?b:[...b,h];m().set("config","disabled_providers",O),await m().updateConfig({disabled_providers:O}).then(()=>{ne({variant:"success",icon:"circle-check",title:a.t("provider.disconnect.toast.disconnected.title",{provider:u}),description:a.t("provider.disconnect.toast.disconnected.description",{provider:u})})}).catch(Z=>{m().set("config","disabled_providers",b);const K=Z instanceof Error?Z.message:String(Z);ne({title:a.t("common.requestFailed"),description:K})})},R=async(h,u)=>{if(L(h)){await c().client.auth.remove({providerID:h}).catch(()=>{}),await B(h,u);return}await c().client.auth.remove({providerID:h}).then(async()=>{await c().client.global.dispose(),ne({variant:"success",icon:"circle-check",title:a.t("provider.disconnect.toast.disconnected.title",{provider:u}),description:a.t("provider.disconnect.toast.disconnected.description",{provider:u})})}).catch(b=>{const O=b instanceof Error?b.message:String(b);ne({title:a.t("common.requestFailed"),description:O})})};return(()=>{var h=Wt(),u=h.firstChild,b=u.firstChild,O=b.firstChild,Z=u.nextSibling,K=Z.firstChild,ae=K.firstChild,Y=K.nextSibling,ee=Y.firstChild;return r(O,()=>a.t("settings.providers.title")),r(b,e(ke,{}),null),r(ae,()=>a.t("settings.providers.section.connected")),r(K,e(z,{get children(){return e(w,{get when(){return k().length>0},get fallback(){return(()=>{var x=Ht();return r(x,()=>a.t("settings.providers.connected.empty")),x})()},get children(){return e(J,{get each(){return k()},children:x=>(()=>{var D=Qt(),S=D.firstChild,F=S.firstChild;return r(S,e(ie,{get id(){return x.id},class:"size-5 shrink-0 icon-strong-base"}),F),r(F,()=>x.name),r(S,e(re,{get children(){return A(x)}}),null),r(D,e(w,{get when(){return N(x)},get fallback(){return(()=>{var V=Yt();return r(V,()=>a.t("settings.providers.connected.environmentDescription")),V})()},get children(){return e(W,{size:"large",variant:"ghost",onClick:()=>void R(x.id,x.name),get children(){return a.t("common.disconnect")}})}}),null),D})()})}})}}),null),r(ee,()=>a.t("settings.providers.section.popular")),r(Y,e(z,{get children(){return[e(J,{get each(){return P()},children:x=>(()=>{var D=Jt(),S=D.firstChild,F=S.firstChild,V=F.firstChild;return r(F,e(ie,{get id(){return x.id},class:"size-5 shrink-0 icon-strong-base"}),V),r(V,()=>x.name),r(F,e(w,{get when(){return x.id==="opencode"},get children(){return e(re,{get children(){return a.t("dialog.provider.tag.recommended")}})}}),null),r(F,e(w,{get when(){return x.id==="opencode-go"},get children(){return e(re,{get children(){return a.t("dialog.provider.tag.recommended")}})}}),null),r(S,e(w,{get when(){return E(x.id)},children:oe=>(()=>{var H=Xt();return r(H,()=>a.t(oe())),H})()}),null),r(D,e(W,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>y(x.id),get children(){return a.t("common.connect")}}),null),D})()}),e(w,{get when(){return v()==="v1"},get children(){var x=Ut(),D=x.firstChild,S=D.firstChild,F=S.firstChild,V=S.nextSibling;return r(S,e(ie,{id:"synthetic",class:"size-5 shrink-0 icon-strong-base"}),F),r(F,()=>a.t("provider.custom.title")),r(S,e(re,{get children(){return a.t("settings.providers.tag.custom")}}),null),r(V,()=>a.t("settings.providers.custom.description")),r(x,e(W,{size:"large",variant:"secondary",icon:"plus-small",onClick:()=>{t.show(()=>e($t,{get onBack(){return t.close}}))},get children(){return a.t("common.connect")}}),null),x}})]}}),null),r(Y,e(W,{variant:"ghost",class:"px-0 py-0 mt-5 text-14-medium text-text-interactive-base text-left justify-start hover:bg-transparent active:bg-transparent",onClick:()=>y(),get children(){return a.t("dialog.provider.viewAll")}}),null),h})()};var Pe=d('<div class="flex flex-col items-center justify-center py-12 text-center"><span class="text-14-regular text-text-weak">'),nr=d('<span class="text-14-regular text-text-strong mt-1">"<!>"'),sr=d('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-4 pt-6 pb-6 max-w-[720px]"><div class="flex items-center justify-between gap-4"><h2 class="text-16-medium text-text-strong"></h2></div><div class="flex items-center gap-2 px-3 h-9 rounded-lg bg-surface-base"></div></div></div><div class="flex flex-col gap-8 max-w-[720px]">'),ir=d('<div class="flex flex-col gap-1"><div class="flex items-center gap-2 pb-2"><span class="text-14-medium text-text-strong">'),lr=d('<div class="flex flex-wrap items-center justify-between gap-4 py-3 border-b border-border-weak-base last:border-none"><div class=min-w-0><span class="text-14-regular text-text-strong truncate block"></span></div><div class=flex-shrink-0>');const ar=i=>(()=>{var t=Pe(),a=t.firstChild;return r(a,()=>i.label),t})(),or=i=>(()=>{var t=Pe(),a=t.firstChild;return r(a,()=>i.message),r(t,e(w,{get when(){return i.filter},get children(){var c=nr(),v=c.firstChild,m=v.nextSibling;return m.nextSibling,r(c,()=>i.filter,m),c}}),null),t})(),cr=()=>e(Ce,{get children(){return e(gr,{})}}),gr=()=>{const i=X(),t=ct(),a=gt({items:c=>t.list(),key:c=>`${c.provider.id}:${c.id}`,filterKeys:["provider.name","name","id"],sortBy:(c,v)=>c.name.localeCompare(v.name),groupBy:c=>c.provider.id,sortGroupsBy:(c,v)=>{const m=le.indexOf(c.category),l=le.indexOf(v.category),_=m>=0,y=l>=0;if(_&&!y)return-1;if(!_&&y)return 1;if(_&&y)return m-l;const k=c.items[0].provider.name,P=v.items[0].provider.name;return k.localeCompare(P)}});return(()=>{var c=sr(),v=c.firstChild,m=v.firstChild,l=m.firstChild,_=l.firstChild,y=l.nextSibling,k=v.nextSibling;return r(_,()=>i.t("settings.models.title")),r(l,e(ke,{}),null),r(y,e(j,{name:"magnifying-glass",class:"text-icon-weak-base flex-shrink-0"}),null),r(y,e(se,{variant:"ghost",type:"text",get value(){return a.filter()},get onChange(){return a.onInput},get placeholder(){return i.t("dialog.model.search.placeholder")},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off",class:"flex-1"}),null),r(y,e(w,{get when(){return a.filter()},get children(){return e(dt,{icon:"circle-x",variant:"ghost",get onClick(){return a.clear}})}}),null),r(k,e(w,{get when(){return!a.grouped.loading},get fallback(){return e(ar,{get label(){return`${i.t("common.loading")}${i.t("common.loading.ellipsis")}`}})},get children(){return e(w,{get when(){return a.flat().length>0},get fallback(){return e(or,{get message(){return i.t("dialog.model.empty")},get filter(){return a.filter()}})},get children(){return e(J,{get each(){return a.grouped.latest},children:P=>(()=>{var T=ir(),A=T.firstChild,N=A.firstChild;return r(A,e(ie,{get id(){return P.category},class:"size-5 shrink-0 icon-strong-base"}),N),r(N,()=>P.items[0].provider.name),r(T,e(z,{get children(){return e(J,{get each(){return P.items},children:E=>{const L={providerID:E.provider.id,modelID:E.id};return(()=>{var B=lr(),R=B.firstChild,h=R.firstChild,u=R.nextSibling;return r(h,()=>E.name),r(u,e($,{get checked(){return t.visible(L)},onChange:b=>{t.setVisibility(L,b)},hideLabel:!0,get children(){return E.name}})),B})()}})}}),null),T})()})}})}})),c})()};var dr=d('<div class="flex flex-1 min-h-0 flex-col gap-4 pt-6"><div class="text-16-medium text-text-strong">'),ur=d('<div class="flex flex-col h-full overflow-y-auto no-scrollbar px-4 pb-10 sm:px-10 sm:pb-10"><div class="flex flex-col flex-1 min-h-0 max-w-[720px]">'),pr=d('<div class="sticky top-0 z-10 bg-[linear-gradient(to_bottom,var(--surface-stronger-non-alpha)_calc(100%_-_24px),transparent)]"><div class="flex flex-col gap-1 pt-6 pb-8"><h2 class="text-16-medium text-text-strong">');const hr=()=>{const i=X(),t=ut();return(()=>{var a=ur(),c=a.firstChild;return r(c,e(w,{get when(){return t.isFormMode()},get fallback(){return[(()=>{var v=pr(),m=v.firstChild,l=m.firstChild;return r(l,()=>i.t("status.popover.tab.servers")),v})(),e(ht,{controller:t})]},get children(){var v=dr(),m=v.firstChild;return r(m,()=>t.formTitle()),r(v,e(pt,{controller:t}),null),v}})),a})()};var mr=d('<div class="flex flex-col justify-between h-full w-full gap-4"><div class="flex flex-col gap-3 w-full pt-3"><div class="flex flex-col gap-3"><div class="flex flex-col gap-1.5"><div class="flex flex-col gap-1.5 w-full"></div></div><div class="flex flex-col gap-1.5"><div class="flex flex-col gap-1.5 w-full"></div></div></div></div><div class="flex flex-col gap-1 pl-1 py-1 text-12-medium text-text-weak"><span></span><span class=text-11-regular>v');const vr=i=>{const t=X(),a=_e(),c=pe(),[v,m]=mt(i.defaultValue??"general"),l=()=>{c.show(()=>e(vr,{defaultValue:"providers"}))};return e(ft,{size:"x-large",transition:!0,get children(){return e(C,{orientation:"vertical",variant:"settings",get value(){return v()},onChange:_=>void vt(()=>m(_)),class:"h-full settings-dialog",get children(){return[e(C.List,{get children(){var _=mr(),y=_.firstChild,k=y.firstChild,P=k.firstChild,T=P.firstChild,A=P.nextSibling,N=A.firstChild,E=y.nextSibling,L=E.firstChild,B=L.nextSibling;return B.firstChild,r(P,e(C.SectionTitle,{get children(){return t.t("settings.section.desktop")}}),T),r(T,e(C.Trigger,{value:"general",get children(){return[e(j,{name:"sliders"}),U(()=>t.t("settings.tab.general"))]}}),null),r(T,e(C.Trigger,{value:"shortcuts",get children(){return[e(j,{name:"keyboard"}),U(()=>t.t("settings.tab.shortcuts"))]}}),null),r(T,e(C.Trigger,{value:"servers",get children(){return[e(j,{name:"server"}),U(()=>t.t("status.popover.tab.servers"))]}}),null),r(A,e(C.SectionTitle,{get children(){return t.t("settings.section.server")}}),N),r(N,e(C.Trigger,{value:"providers",get children(){return[e(j,{name:"providers"}),U(()=>t.t("settings.providers.title"))]}}),null),r(N,e(C.Trigger,{value:"models",get children(){return[e(j,{name:"models"}),U(()=>t.t("settings.models.title"))]}}),null),r(L,(()=>{var R=U(()=>a.platform==="desktop");return()=>R()?t.t("app.name.desktop"):"Agentic Web"})()),r(B,()=>a.version,null),_}}),e(C.Content,{value:"general",class:"no-scrollbar",get children(){return e(Gt,{})}}),e(C.Content,{value:"shortcuts",class:"no-scrollbar",get children(){return e(bt,{})}}),e(C.Content,{value:"servers",class:"no-scrollbar",get children(){return e(hr,{})}}),e(C.Content,{value:"providers",class:"no-scrollbar",get children(){return e(tr,{onBack:l})}}),e(C.Content,{value:"models",class:"no-scrollbar",get children(){return e(cr,{})}})]}})}})};export{vr as DialogSettings};
|
|
3
|
+
//# sourceMappingURL=dialog-settings-DTc_Rfqx.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{bW as D,b_ as I,aD as u,b1 as C,aM as F,
|
|
2
|
-
//# sourceMappingURL=edit-project-
|
|
1
|
+
import{bW as D,b_ as I,aD as u,b1 as C,aM as F,c4 as M,bk as h}from"./index-BH1J9J8E.js";function H(t){const s=D(),g=I(),i=u(()=>g.ensureServerCtx(t.server)),d=u(()=>C(t.project.worktree)),f=u(()=>t.project.name||d()),[r,n]=F({name:f(),color:t.project.icon?.color,iconOverride:t.project.icon?.override,startup:t.project.commands?.start??"",dragOver:!1,iconHover:!1});let v;function m(e){if(!e.type.startsWith("image/"))return;const o=new FileReader;o.onload=a=>{const c=a.target?.result;typeof c=="string"&&(n("iconOverride",c),n("iconHover",!1))},o.readAsDataURL(e)}function O(e){e.preventDefault(),n("dragOver",!1);const o=e.dataTransfer?.files[0];o&&m(o)}function p(e){e.preventDefault(),n("dragOver",!0)}function k(){n("dragOver",!1)}function b(e){const o=e.currentTarget.files?.[0];o&&m(o)}function w(){if(r.iconOverride&&r.iconHover){n("iconOverride","");return}v?.click()}const l=M(()=>({mutationFn:async()=>{const e=r.name.trim()===d()?"":r.name.trim(),o=r.startup.trim();if(t.project.id&&t.project.id!=="global"){if(await i().sdk.protocol!=="v1")return;const a=await i().sdk.client.project.update({projectID:t.project.id,directory:t.project.worktree,name:e,icon:{color:r.color||"",override:r.iconOverride||""},commands:{start:o}}).then(c=>c.data);if(!a)return;i().sync.set("project",c=>c.map(j=>j.id===a.id?h(a):j)),i().sync.project.icon(t.project.worktree,r.iconOverride||void 0),s.close();return}i().sync.project.meta(t.project.worktree,{name:e,icon:{color:r.color||void 0,override:r.iconOverride||void 0},commands:{start:o||void 0}}),s.close()}}));function y(e){e.preventDefault(),!l.isPending&&l.mutate()}return{store:r,setStore:n,folderName:d,defaultName:f,save:l,submit:y,drop:O,dragOver:p,dragLeave:k,inputChange:b,iconClick:w,close(){s.close()},setIconInput(e){v=e}}}export{H as c};
|
|
2
|
+
//# sourceMappingURL=edit-project-CuOMp3mF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e={"ui.sessionReview.title":"Cambios de la sesión","ui.sessionReview.title.git":"Cambios de Git","ui.sessionReview.title.branch":"Cambios de la rama","ui.sessionReview.title.lastTurn":"Cambios del último turno","ui.sessionReview.diffStyle.unified":"Unificado","ui.sessionReview.diffStyle.split":"Dividido","ui.sessionReview.openFile":"Abrir archivo","ui.sessionReview.selection.line":"línea {{line}}","ui.sessionReview.selection.lines":"líneas {{start}}-{{end}}","ui.sessionReview.expandAll":"Expandir todo","ui.sessionReview.collapseAll":"Contraer todo","ui.sessionReview.change.added":"Añadido","ui.sessionReview.change.removed":"Eliminado","ui.sessionReview.change.modified":"Modificado","ui.sessionReview.image.loading":"Cargando...","ui.sessionReview.image.placeholder":"Imagen","ui.sessionReview.largeDiff.title":"Diff demasiado grande para renderizar","ui.sessionReview.largeDiff.meta":"Límite: {{limit}} líneas modificadas. Actual: {{current}} líneas modificadas.","ui.sessionReview.largeDiff.renderAnyway":"Renderizar de todos modos","ui.sessionReviewV2.expandMode":"Expandir o contraer diff","ui.sessionReviewV2.filterFiles":"Filtrar archivos","ui.sessionReviewV2.toggleSidebar":"Mostrar u ocultar árbol de archivos","ui.sessionReviewV2.showAllLines":"Mostrar todas las líneas","ui.sessionReviewV2.hideNonDiffLines":"Ocultar líneas sin cambios","ui.sessionReviewV2.unifiedDiff":"Diff unificado","ui.sessionReviewV2.splitDiff":"Diff dividido","ui.sessionReviewV2.previousFile":"Archivo anterior","ui.sessionReviewV2.nextFile":"Siguiente archivo","ui.sessionReviewV2.diffView":"Vista de diff","ui.sessionReviewV2.empty.noGit.title":"No hay cambios rastreados","ui.sessionReviewV2.empty.noGit.description":"Rastrea, revisa y deshaz cambios en este proyecto","ui.sessionReviewV2.empty.noGit.action":"Crear repositorio Git","ui.sessionReviewV2.empty.noGit.actionLoading":"Creando repositorio Git...","ui.sessionReviewV2.empty.changes.title":"Aún no hay cambios en los archivos","ui.sessionReviewV2.empty.changes.description":"Los cambios del proyecto aparecerán aquí","ui.fileMedia.kind.image":"imagen","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Archivo de {{kind}} eliminado","ui.fileMedia.state.loading":"Cargando archivo de {{kind}}","ui.fileMedia.state.error":"Error en el archivo de {{kind}}","ui.fileMedia.state.unavailable":"Archivo de {{kind}} no disponible","ui.fileMedia.binary.title":"Archivo binario","ui.fileMedia.binary.description.path":"No se puede mostrar {{path}} porque es un archivo binario.","ui.fileMedia.binary.description.default":"No se puede mostrar este archivo porque es un archivo binario.","ui.lineComment.label.prefix":"Comentar en ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Comentando en ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Añadir comentario","ui.lineComment.contextPlaceholder":"Añadir contexto para este cambio","ui.lineComment.submit":"Comentar","ui.lineComment.cancel":"Cancelar","ui.sessionTurn.steps.show":"Mostrar pasos","ui.sessionTurn.steps.hide":"Ocultar pasos","ui.sessionTurn.summary.response":"Respuesta","ui.sessionTurn.diff.showMore":"Mostrar más cambios ({{count}})","ui.sessionTurn.diffs.changed.one":"{{count}} archivo modificado","ui.sessionTurn.diffs.changed.many":"{{count}} de archivos modificados","ui.sessionTurn.diffs.changed.other":"{{count}} archivos modificados","ui.sessionTurn.diffs.showAll":"Mostrar todos","ui.sessionTurn.diffs.showLess":"Mostrar menos","ui.sessionTurn.diffs.more":"+{{count}} más","ui.sessionTurn.retry.retrying":"reintentando","ui.sessionTurn.retry.inSeconds":"en {{seconds}}s","ui.sessionTurn.retry.attempt":"intento n.º {{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - intento n.º {{attempt}}","ui.sessionTurn.retry.geminiHot":"Gemini está demasiado saturado ahora mismo","ui.sessionTurn.error.freeUsageExceeded":"Se superó el límite de uso gratuito","ui.sessionTurn.error.addCredits":"Añadir créditos","dialog.usageExceeded.freeTier.title":"Límite gratuito alcanzado","dialog.usageExceeded.freeTier.description":"Suscríbete a OpenCode Go para acceder de forma fiable a los mejores modelos de código abierto desde 5 USD al mes.","dialog.usageExceeded.freeTier.actionLabel":"Suscribirse","dialog.usageExceeded.accountRateLimit.title":"Límite de Go alcanzado","dialog.usageExceeded.accountRateLimit.description":"Límite de uso alcanzado. Para seguir usando este modelo ahora, habilita el uso desde tu saldo disponible","dialog.usageExceeded.accountRateLimit.actionLabel":"Abrir ajustes","ui.sessionTurn.status.delegating":"Delegando trabajo","ui.sessionTurn.status.planning":"Planificando siguientes pasos","ui.sessionTurn.status.gatheringContext":"Explorando","ui.sessionTurn.status.gatheredContext":"Explorado","ui.sessionTurn.status.searchingCodebase":"Buscando en la base de código","ui.sessionTurn.status.searchingWeb":"Buscando en la web","ui.sessionTurn.status.makingEdits":"Realizando ediciones","ui.sessionTurn.status.runningCommands":"Ejecutando comandos","ui.sessionTurn.status.thinking":"Pensando","ui.sessionTurn.status.thinkingWithTopic":"Pensando: {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Organizando ideas","ui.sessionTurn.status.consideringNextSteps":"Considerando siguientes pasos","ui.messagePart.questions.dismissed":"Preguntas descartadas","ui.messagePart.compaction":"Sesión compactada","ui.messagePart.context.read.one":"{{count}} lectura","ui.messagePart.context.read.many":"{{count}} de lecturas","ui.messagePart.context.read.other":"{{count}} lecturas","ui.messagePart.context.search.one":"{{count}} búsqueda","ui.messagePart.context.search.many":"{{count}} de búsquedas","ui.messagePart.context.search.other":"{{count}} búsquedas","ui.messagePart.context.list.one":"{{count}} listado","ui.messagePart.context.list.many":"{{count}} de listados","ui.messagePart.context.list.other":"{{count}} listados","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Editar","ui.messagePart.title.write":"Escribir","ui.messagePart.option.typeOwnAnswer":"Escribe tu propia respuesta","ui.messagePart.review.title":"Revisa tus respuestas","ui.list.loading":"Cargando","ui.list.empty":"Sin resultados","ui.list.clearFilter":"Borrar filtro","ui.list.emptyWithFilter.prefix":"Sin resultados para","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"Nuevo mensaje","ui.promptInput.noMatchingItems":"No hay elementos coincidentes","ui.promptInput.commands":"Comandos","ui.promptInput.dropFiles":"Suelta los archivos para adjuntarlos","ui.promptInput.removeAttachment":"Eliminar adjunto","ui.promptInput.label":"Prompt","ui.promptInput.placeholder.shell":"Introduce un comando de shell...","ui.promptInput.placeholder.normal":"Pregunta lo que quieras, {{slash}} para comandos, {{at}} para contexto...","ui.promptInput.add":"Añadir imágenes y archivos","ui.promptInput.attachments":"Imágenes y archivos","ui.promptInput.context":"Contexto","ui.promptInput.shell":"Comando de shell","ui.promptInput.chooseAgent":"Elegir agente","ui.promptInput.chooseModel":"Elegir modelo","ui.promptInput.chooseVariant":"Elegir variante del modelo","ui.promptInput.send":"Enviar","ui.promptInput.stop":"Detener","ui.tabs.close":"Cerrar pestaña","ui.textField.copyToClipboard":"Copiar al portapapeles","ui.textField.copyLink":"Copiar enlace","ui.textField.copied":"Copiado","ui.imagePreview.alt":"Vista previa de imagen","ui.scrollView.ariaLabel":"contenido desplazable","ui.tool.read":"Leer","ui.tool.loaded":"Cargado","ui.tool.list":"Listar","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Búsqueda web","ui.tool.websearch.provider":"{{provider}} Búsqueda web","ui.tool.shell":"Shell","ui.tool.patch":"Parche","ui.tool.todos":"Tareas","ui.tool.todos.read":"Leer tareas","ui.tool.questions":"Preguntas","ui.tool.questions.numbered":"Preguntas {{number}}","ui.tool.agent":"Agente {{type}}","ui.tool.agent.default":"Agente","ui.common.file.one":"archivo","ui.common.file.other":"archivos","ui.common.question.one":"pregunta","ui.common.question.other":"preguntas","ui.common.add":"Añadir","ui.common.clear":"Borrar","ui.common.file":"Archivo","ui.common.back":"Atrás","ui.common.cancel":"Cancelar","ui.common.confirm":"Confirmar","ui.common.dismiss":"Descartar","ui.common.close":"Cerrar","ui.common.next":"Siguiente","ui.common.submit":"Enviar","ui.common.showMore":"Mostrar más","ui.permission.deny":"Denegar","ui.permission.allowAlways":"Permitir siempre","ui.permission.allowOnce":"Permitir una vez","ui.message.expand":"Expandir mensaje","ui.message.collapse":"Contraer mensaje","ui.message.copy":"Copiar","ui.message.copyMessage":"Copiar mensaje","ui.message.forkMessage":"Bifurcar a nueva sesión","ui.message.revertMessage":"Restablecer a este punto","ui.message.copyResponse":"Copiar respuesta","ui.message.copied":"¡Copiado!","ui.message.interrupted":"Interrumpido","ui.message.queued":"En cola","ui.message.attachment.alt":"adjunto","ui.patch.action.deleted":"Eliminado","ui.patch.action.created":"Creado","ui.patch.action.moved":"Movido","ui.patch.action.patched":"Parcheado","ui.question.subtitle.answered":"{{count}} respondidas","ui.question.answer.none":"(sin respuesta)","ui.question.review.notAnswered":"(no respondida)","ui.question.multiHint":"Selecciona todas las que correspondan","ui.question.singleHint":"Selecciona una respuesta","ui.question.custom.placeholder":"Escribe tu respuesta...","ui.fileSearch.placeholder":"Buscar","ui.fileSearch.previousMatch":"Anterior","ui.fileSearch.nextMatch":"Siguiente","ui.fileSearch.close":"Cerrar búsqueda","ui.tool.task":"Tarea","ui.tool.skill":"Habilidad","ui.basicTool.called":"Se llamó a `{{tool}}`","ui.toolErrorCard.failed":"Falló","ui.toolErrorCard.copyError":"Copiar error","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s"};export{e as dict};
|
|
2
|
+
//# sourceMappingURL=es-Bus963Aj.js.map
|