tarsk 0.5.37 → 0.5.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3612 -297
- package/dist/public/assets/{account-view-Cn4P1srV.js → account-view-BT90zNSx.js} +1 -1
- package/dist/public/assets/{browser-tab-DeoHDVON.js → browser-tab-Bp486a9f.js} +1 -1
- package/dist/public/assets/{commit-dialog-CWb_KVrD.js → commit-dialog-90PGbqs8.js} +1 -1
- package/dist/public/assets/{create-repo-dialog-BCPrWkIv.js → create-repo-dialog-BkUdww3q.js} +1 -1
- package/dist/public/assets/{diff-view-DL3hFREY.js → diff-view-B4G8vqZa.js} +1 -1
- package/dist/public/assets/{explorer-tab-view-DAs4rpHu.js → explorer-tab-view-DEQFid8r.js} +2 -2
- package/dist/public/assets/{explorer-tree-BV1LcznV.js → explorer-tree-CPHGgahA.js} +1 -1
- package/dist/public/assets/{explorer-view-BGSxs_-F.js → explorer-view-BTvhSMDQ.js} +1 -1
- package/dist/public/assets/{git-ops-button-DZzOCOr8.js → git-ops-button-BnVMlOO3.js} +2 -2
- package/dist/public/assets/index-DjD2SPNZ.js +65 -0
- package/dist/public/assets/{project-settings-view-B7RBOfiB.js → project-settings-view-ZJjQbFbQ.js} +1 -1
- package/dist/public/assets/providers-list-view-BH13AB_H.js +1 -0
- package/dist/public/assets/{pull-request-dialog-BIRSLJAA.js → pull-request-dialog-ZzVXh6M9.js} +1 -1
- package/dist/public/assets/{settings-general-view-CH-51vI0.js → settings-general-view-C8muiP_K.js} +1 -1
- package/dist/public/assets/{settings-instructions-view-D9HZldUk.js → settings-instructions-view-CV7lRPuw.js} +1 -1
- package/dist/public/assets/{settings-mcp-servers-view-o2gqb0qo.js → settings-mcp-servers-view-3gN9ly3z.js} +1 -1
- package/dist/public/assets/{settings-models-view-m-MDG6JH.js → settings-models-view-CAMouMhE.js} +1 -1
- package/dist/public/assets/{settings-rules-view-tG9JJQzK.js → settings-rules-view-BnazfbJb.js} +1 -1
- package/dist/public/assets/{settings-skills-view-DLyWp1pq.js → settings-skills-view-DpzKFcpf.js} +1 -1
- package/dist/public/assets/{settings-slash-commands-view-B7OCA_J1.js → settings-slash-commands-view-Drje2Dl4.js} +1 -1
- package/dist/public/assets/{settings-subagents-view-CSkVwd-J.js → settings-subagents-view-D05kHO1W.js} +1 -1
- package/dist/public/assets/{settings-system-prompt-view-Br6r4RXb.js → settings-system-prompt-view-DQmSdSnp.js} +1 -1
- package/dist/public/assets/settings-view-B6e0GfSv.js +2 -0
- package/dist/public/assets/{terminal-panel-D3Ru16FT.js → terminal-panel-BzCO142Q.js} +1 -1
- package/dist/public/index.html +1 -1
- package/package.json +8 -7
- package/dist/public/assets/index-CbJ3v0Sr.js +0 -65
- package/dist/public/assets/providers-list-view-BQFttbEU.js +0 -1
- package/dist/public/assets/settings-view-rUCFRiPR.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$t as t,B as n,Ct as r,Ea as i,Er as a,H as o,Ja as s,Ji as c,Ka as l,Pa as u,Q as d,Qa as f,Tt as p,U as m,V as h,W as g,Xa as _,aa as v,ci as y,cn as b,co as x,di as S,fo as C,fr as w,hr as T,ji as ee,ka as te,la as ne,mi as E,mr as D,pr as O,qa as re,ra as ie,sn as ae,ui as k,vi as oe,vo as se,wi as A,wt as ce,xo as j,yo as M,z as le}from"./dialogs-config-DZKtVbNK.js";import{ct as ue,lt as de}from"./react-vendor-Ba8DSNiO.js";import{a as fe,i as pe,n as me,r as he,s as ge}from"./onboarding-CxtzQldG.js";import{C as N,D as _e,E as ve,S as ye,T as be,a as xe,b as Se,i as Ce,n as P,o as we,r as F,x as I}from"./history-view-jX3PPID6.js";import{c as Te,l as Ee,o as De,s as Oe}from"./index-CbJ3v0Sr.js";import{t as L}from"./skeleton-qzmFgKhS.js";var R=M(),z=e(j(),1),B=ee(),ke=E(k(A.compact,`inline-flex items-center rounded-full border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`),{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function V(e){let t=(0,R.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=k(ke({variant:i}),n),t[4]=n,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==a?(o=(0,B.jsx)(`div`,{className:a,...r}),t[7]=r,t[8]=a,t[9]=o):o=t[9],o}function Ae(e,t,n){return n?e.find(e=>e.slug===n)??null:t?e.find(e=>e.name===t)??null:null}function H({selectedProviderName:e=null,selectedProviderSlug:s=null,providerData:u,onBack:d,className:f}){let[C,ee]=(0,z.useState)(null),[E,ce]=(0,z.useState)(``),[j,M]=(0,z.useState)(!1),[ue,de]=(0,z.useState)(null),[xe,Ce]=(0,z.useState)(``),[P,we]=(0,z.useState)([]),[F,L]=(0,z.useState)(new Set),[R,ke]=(0,z.useState)(new Set),[V,H]=(0,z.useState)(new Map),[U,W]=(0,z.useState)(``),[G,K]=(0,z.useState)(`alphabetical`),[je,Me]=(0,z.useState)(`all`),[Ne,Pe]=(0,z.useState)(!1),[q,J]=(0,z.useState)(``),[Fe,Y]=(0,z.useState)(``),[Ie,Le]=(0,z.useState)(``),[Re,ze]=(0,z.useState)(`coding`),[X,Be]=(0,z.useState)([]),[Ve,He]=(0,z.useState)(new Set),[Ue,We]=(0,z.useState)(new Set),[Ge,Z]=(0,z.useState)(new Map),[Ke,qe]=(0,z.useState)({}),Q=e=>ge(e.id);(0,z.useEffect)(()=>{(async()=>{if(Ce(``),u&&(s&&u.slug===s||e&&u.name===e)){ee(u),Le(u.apiKey??``),ce(u.apiKey??``),qe(u.envValues??{}),Ze(u.slug),Je(u.slug);return}try{let t=Ae(await p(),e,s);ee(t),Le(t?.apiKey??``),ce(t?.apiKey??``),qe(t?.envValues??{}),t&&(Ze(t.slug),Je(t.slug))}catch(e){Ce(e instanceof Error?e.message:`Failed to load providers`)}})()},[e,s,u]);let Je=async e=>{de(null);try{let t=await r(e);t.status===`success`&&de(t.balance)}catch(t){console.error(`Failed to load balance for ${e}:`,t)}};function Ye(){we([]),Be([]),L(new Set),ke(new Set),He(new Set),We(new Set),H(new Map),Z(new Map)}function Xe(e){return e instanceof Error?e.message:`Failed to load models from local API`}let Ze=async e=>{M(!0),Y(``),W(``),K(`alphabetical`),Me(`all`),ze(`coding`);try{let[t,n]=await Promise.all([g(e),m(e)]);we(t.models),Be(n.models);let r=new Set(t.enabledModelIds);L(r),ke(r);let i=new Set(n.enabledModelIds);He(i),We(i),H(new Map),Z(new Map)}catch(t){console.error(`Failed to load models for ${e}:`,t),Ye(),Y(Xe(t))}finally{M(!1)}};async function Qe(e){M(!0),Y(``);try{await t(e),await Ze(e)}catch(t){console.error(`Failed to refresh models for ${e}:`,t),Ye(),Y(Xe(t)),M(!1)}}let $e=(e,t)=>{C?.name===e&&(ce(t),tt(t))},et=(e,t)=>{qe(n=>({...n,[e]:t})),C&&(async()=>{try{await ae({[e]:t}),J(`${pe(e)} saved successfully`),setTimeout(()=>J(``),3e3)}catch(e){J(e instanceof Error?e.message:`Failed to save provider settings`);return}oe(C.slug)&&e===`LOCAL_API_URL`&&t.trim()&&await Qe(C.slug)})()},tt=async e=>{if(!(!C||e===Ie))try{await b(C.slug,e),Le(e),J(`API key saved successfully`),setTimeout(()=>J(``),3e3)}catch(e){J(e instanceof Error?e.message:`Failed to save API key`)}},nt=(e,t)=>{t===`image`?Z(t=>{let n=new Map(t),r=Ve.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),rt(e,(n.has(e)?n.get(e):r)??!1,`image`),n}):H(t=>{let n=new Map(t),r=F.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),rt(e,(n.has(e)?n.get(e):r)??!1,`coding`),n})},rt=async(e,t,r=`coding`)=>{if(C)try{r===`image`?(t?(await h(C.slug,e),He(t=>new Set([...t,e]))):(await le(C.slug,e),He(t=>{let n=new Set(t);return n.delete(e),n})),Z(t=>{let n=new Map(t);return n.delete(e),n})):(t?(await o(C.slug,e),L(t=>new Set([...t,e]))):(await n(C.slug,e),L(t=>{let n=new Set(t);return n.delete(e),n})),H(t=>{let n=new Map(t);return n.delete(e),n})),J(`Model preferences saved successfully`),setTimeout(()=>J(``),3e3)}catch(e){J(e instanceof Error?e.message:`Failed to save model changes`)}};async function it(e,t=`coding`){let n=t===`image`?X:P,r=t===`image`?Ve:F;(t===`image`?Z:H)(t=>{let i=new Map(t);for(let t of n)r.has(t.id)===e?i.delete(t.id):i.set(t.id,e);return i});for(let i of n)r.has(i.id)!==e&&await rt(i.id,e,t)}let $=E!==void 0&&E.trim().length>0,at=e=>e.pricing?((e.pricing.prompt??0)+(e.pricing.completion??0))/2:null,ot=e=>e?e<20?1:e<30?2:e<40?3:e<50?4:5:0,st=({codingIndex:e,modelName:t})=>{let n=ot(e);return n===0?null:(0,B.jsx)(D,{children:(0,B.jsxs)(w,{children:[(0,B.jsx)(T,{asChild:!0,children:(0,B.jsx)(`div`,{className:`flex items-center gap-0.5`,children:[1,2,3,4,5].map(e=>(0,B.jsx)(c,{className:`h-3 w-3 ${e<=n?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},e))})}),(0,B.jsx)(O,{children:(0,B.jsxs)(`p`,{className:A.body,children:[t,` was indexed `,e,` for coding intelligence`]})})]})})},ct=P.filter(e=>{let t=U.toLowerCase(),n=Q(e),r=e.name.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||n.toLowerCase().includes(t);if(je===`free`){let t=e.pricing?.prompt===0&&e.pricing?.completion===0;return r&&t}return r}).sort((e,t)=>{let n=(e.provider??``).toLowerCase(),r=(t.provider??``).toLowerCase();if(n!==r)return n.localeCompare(r);let i=+!R.has(e.id),a=+!R.has(t.id);if(i!==a)return i-a;if(G===`price-low`){let n=!!e.pricing;return n===!!t.pricing?!e.pricing||!t.pricing?0:((e.pricing.prompt??0)+(e.pricing.completion??0))/2-((t.pricing.prompt??0)+(t.pricing.completion??0))/2:n?-1:1}if(G===`price-high`){let n=!!e.pricing;if(n!==!!t.pricing)return n?-1:1;if(!e.pricing||!t.pricing)return 0;let r=((e.pricing.prompt??0)+(e.pricing.completion??0))/2;return((t.pricing.prompt??0)+(t.pricing.completion??0))/2-r}if(G===`coding-index`){let n=e.coding_index!==void 0&&e.coding_index!==null;return n===(t.coding_index!==void 0&&t.coding_index!==null)?!e.coding_index||!t.coding_index?0:t.coding_index-e.coding_index:n?-1:1}if(G===`intelligence-by-price`){let n=ot(e.coding_index),r=ot(t.coding_index),i=n>0;if(i!==r>0)return i?-1:1;if(r!==n)return r-n;let a=at(e),o=at(t),s=a!==null;return s===(o!==null)?a===null||o===null?0:a-o:s?-1:1}return Q(e).localeCompare(Q(t))}),lt=X.filter(e=>{let t=U.toLowerCase(),n=Q(e),r=e.name.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||n.toLowerCase().includes(t);if(je===`free`){let t=e.pricing?.prompt===0&&e.pricing?.completion===0;return r&&t}return r}).sort((e,t)=>{let n=(e.provider??``).toLowerCase(),r=(t.provider??``).toLowerCase();if(n!==r)return n.localeCompare(r);let i=+!Ue.has(e.id),a=+!Ue.has(t.id);if(i!==a)return i-a;if(G===`price-low`){let n=!!e.pricing;return n===!!t.pricing?!e.pricing||!t.pricing?0:((e.pricing.prompt??0)+(e.pricing.completion??0))/2-((t.pricing.prompt??0)+(t.pricing.completion??0))/2:n?-1:1}if(G===`price-high`){let n=!!e.pricing;return n===!!t.pricing?!e.pricing||!t.pricing?0:((t.pricing.prompt??0)+(t.pricing.completion??0))/2-((e.pricing.prompt??0)+(e.pricing.completion??0))/2:n?-1:1}return Q(e).localeCompare(Q(t))});return xe?(0,B.jsxs)(`div`,{className:k(`flex flex-1 flex-col items-center justify-center gap-4 p-6`,f),children:[(0,B.jsx)(I,{variant:`error`,className:`mb-0`,children:xe}),(0,B.jsx)(y,{variant:`outline`,size:`sm`,onClick:()=>window.location.reload(),children:`Retry`})]}):C?(0,B.jsx)(_e,{className:f,children:(0,B.jsxs)(ve,{children:[(0,B.jsx)(ye,{title:C.name,description:`Configure API keys and models for this provider.`}),(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,B.jsxs)(`div`,{className:`flex items-center justify-between min-h-[20px]`,children:[(0,B.jsx)(`div`,{className:`flex items-center gap-2`,children:ue===null?(0,B.jsx)(`div`,{className:`h-[20px] w-[1px]`}):(0,B.jsxs)(`span`,{className:k(A.compact,`font-medium text-green-600 bg-green-50 px-2.5 py-1 rounded-full border border-green-100 flex items-center gap-1.5`),children:[(0,B.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-green-500`}),`$`,S(ue),` `,`balance`]})}),C.url?(0,B.jsx)(he,{url:C.url,className:k(A.compact,`p-3`)}):(0,B.jsx)(`div`,{className:`h-[20px] w-[1px]`})]})}),(0,B.jsx)(Se,{title:`API Key`,description:`Your API key is stored locally and never shared.`,children:C.authType===`APIKey`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(te,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,B.jsx)(a,{type:Ne?`text`:`password`,placeholder:C.keyName||`Enter API Key`,className:`pl-10 pr-10`,value:E,onChange:e=>{$e(C.name,e.target.value)}}),(0,B.jsx)(y,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:()=>Pe(!Ne),disabled:!E,children:Ne?(0,B.jsx)(re,{className:`h-4 w-4 text-muted-foreground`}):(0,B.jsx)(l,{className:`h-4 w-4 text-muted-foreground`})})]}),(0,B.jsx)(`div`,{className:`space-y-4 mt-4`,children:fe(C).map(e=>(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(D,{children:(0,B.jsxs)(w,{children:[(0,B.jsx)(T,{asChild:!0,children:(0,B.jsx)(`span`,{className:k(A.label,`cursor-help`),children:pe(e)})}),(0,B.jsx)(O,{children:e})]})}),oe(C.slug)&&e===`LOCAL_API_URL`?(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(a,{id:e,value:Ke[e]??``,onChange:t=>et(e,t.target.value),placeholder:C.api,className:`pr-10`,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`}),(0,B.jsx)(D,{children:(0,B.jsxs)(w,{children:[(0,B.jsx)(T,{asChild:!0,children:(0,B.jsx)(y,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:()=>{Qe(C.slug)},disabled:j,children:j?(0,B.jsx)(i,{className:`h-4 w-4 animate-spin text-muted-foreground`}):(0,B.jsx)(ne,{className:`h-4 w-4 text-muted-foreground`})})}),(0,B.jsx)(O,{children:`Refresh models`})]})})]}):(0,B.jsx)(a,{id:e,value:Ke[e]??``,onChange:t=>et(e,t.target.value),placeholder:e,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`})]},e))})]}):(0,B.jsxs)(`div`,{className:`space-y-2 text-center`,children:[(0,B.jsx)(I,{className:`mb-0`,children:`This provider uses OAuth for authentication.`}),(0,B.jsxs)(y,{variant:`outline`,size:`sm`,disabled:!0,children:[`Sign in with `,C.name]})]})}),(0,B.jsx)(N,{title:`Models`}),Fe?(0,B.jsx)(I,{variant:`error`,className:`mb-4`,children:Fe}):null,(0,B.jsxs)(De,{value:Re,onValueChange:e=>{ze(e),W(``),K(`alphabetical`)},children:[(0,B.jsxs)(Te,{className:`mb-4`,children:[(0,B.jsx)(Ee,{value:`coding`,children:`Coding`}),C?.name.toLowerCase()===`openrouter`&&(0,B.jsx)(Ee,{value:`image`,children:`Image`})]}),(0,B.jsx)(Oe,{value:`coding`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[!j&&P.length>0&&(0,B.jsxs)(`div`,{className:k(`flex flex-col gap-3 md:flex-row md:items-center md:justify-between`,!$&&`opacity-25`),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,B.jsx)(me,{id:`select-all-models`,disabled:!$,checked:P.every(e=>{let t=V.has(e.id),n=V.get(e.id);return t?n:F.has(e.id)}),onCheckedChange:e=>{it(e===!0,`coding`)}}),(0,B.jsx)(`label`,{htmlFor:`select-all-models`,className:k(A.body,`whitespace-nowrap`,$?`cursor-pointer`:`cursor-not-allowed`),children:`Select all models`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:flex-1 md:min-w-0 md:justify-end`,children:[(0,B.jsxs)(`div`,{className:`relative w-full md:w-52 flex-shrink-0`,children:[(0,B.jsx)(ie,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,B.jsx)(a,{placeholder:`Search models...`,className:`pl-10 h-8`,value:U,onChange:e=>W(e.target.value),disabled:!$})]}),(0,B.jsx)(D,{children:(0,B.jsxs)(`div`,{className:`flex items-center self-end rounded-md border border-border p-0.5 flex-shrink-0 md:self-auto`,children:[(0,B.jsxs)(w,{children:[(0,B.jsx)(T,{asChild:!0,children:(0,B.jsx)(y,{type:`button`,variant:G===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`alphabetical`),children:(0,B.jsx)(se,{className:`h-4 w-4`})})}),(0,B.jsx)(O,{children:`Sort A–Z`})]}),(0,B.jsxs)(w,{children:[(0,B.jsx)(T,{asChild:!0,children:(0,B.jsx)(y,{type:`button`,variant:G===`price-low`||G===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`price-low`),children:(0,B.jsx)(_,{className:`h-4 w-4`})})}),(0,B.jsx)(O,{children:`Sort by price`})]}),(0,B.jsxs)(w,{children:[(0,B.jsx)(T,{asChild:!0,children:(0,B.jsx)(y,{type:`button`,variant:G===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`coding-index`),children:(0,B.jsx)(c,{className:`h-4 w-4`})})}),(0,B.jsx)(O,{children:`Sort by coding intelligence`})]}),(0,B.jsxs)(w,{children:[(0,B.jsx)(T,{asChild:!0,children:(0,B.jsx)(y,{type:`button`,variant:G===`intelligence-by-price`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`intelligence-by-price`),children:(0,B.jsx)(v,{className:`h-4 w-4`})})}),(0,B.jsx)(O,{children:`Sort by price/intelligence`})]})]})})]})]}),j?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,B.jsx)(i,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):P.length===0?(0,B.jsx)(`div`,{className:`text-center py-8`,children:(0,B.jsx)(`p`,{className:A.bodyMuted,children:Fe?`No models loaded.`:`No models available for this provider.`})}):(0,B.jsx)(D,{children:(0,B.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:ct.length===0?(0,B.jsx)(`div`,{className:`text-center py-8`,children:(0,B.jsx)(`p`,{className:A.bodyMuted,children:`No models matching your filters.`})}):ct.map(e=>{let t=F.has(e.id),n=V.has(e.id),r=V.get(e.id),i=n?r:t,a=e.pricing;return(0,B.jsxs)(`div`,{className:`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0 ${$?``:`opacity-25`}`,children:[(0,B.jsx)(me,{id:e.id,disabled:!$,checked:i??!1,onCheckedChange:()=>nt(e.id,`coding`),className:`mt-0`}),(0,B.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,B.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,B.jsx)(`label`,{htmlFor:e.id,className:k(A.body,`leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:Q(e)})}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(G===`coding-index`||G===`intelligence-by-price`)&&(0,B.jsx)(st,{codingIndex:e.coding_index,modelName:Q(e)}),a&&(0,B.jsx)(`span`,{className:k(A.caption,`whitespace-nowrap`),children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${S(a.prompt??0)} in | $${S(a.completion??0)} out`})]})]})]},e.id)})})})]})}),(0,B.jsx)(Oe,{value:`image`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[!j&&X.length>0&&(0,B.jsxs)(`div`,{className:k(`flex flex-col gap-3 md:flex-row md:items-center md:justify-between`,!$&&`opacity-25`),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,B.jsx)(me,{id:`select-all-image-models`,disabled:!$,checked:X.every(e=>{let t=Ge.has(e.id),n=Ge.get(e.id);return t?n:Ve.has(e.id)}),onCheckedChange:e=>{it(e===!0,`image`)}}),(0,B.jsx)(`label`,{htmlFor:`select-all-image-models`,className:k(A.body,`whitespace-nowrap`,$?`cursor-pointer`:`cursor-not-allowed`),children:`Select all models`})]}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:flex-1 md:min-w-0 md:justify-end`,children:[(0,B.jsxs)(`div`,{className:`relative w-full md:w-52 flex-shrink-0`,children:[(0,B.jsx)(ie,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,B.jsx)(a,{placeholder:`Search models...`,className:`pl-10 h-8`,value:U,onChange:e=>W(e.target.value),disabled:!$})]}),(0,B.jsx)(D,{children:(0,B.jsxs)(`div`,{className:`flex items-center self-end rounded-md border border-border p-0.5 flex-shrink-0 md:self-auto`,children:[(0,B.jsxs)(w,{children:[(0,B.jsx)(T,{asChild:!0,children:(0,B.jsx)(y,{type:`button`,variant:G===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`alphabetical`),children:(0,B.jsx)(se,{className:`h-4 w-4`})})}),(0,B.jsx)(O,{children:`Sort A–Z`})]}),(0,B.jsxs)(w,{children:[(0,B.jsx)(T,{asChild:!0,children:(0,B.jsx)(y,{type:`button`,variant:G===`price-low`||G===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>K(`price-low`),children:(0,B.jsx)(_,{className:`h-4 w-4`})})}),(0,B.jsx)(O,{children:`Sort by price`})]})]})})]})]}),j?(0,B.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,B.jsx)(i,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):X.length===0?(0,B.jsx)(`div`,{className:`text-center py-8`,children:(0,B.jsx)(`p`,{className:A.bodyMuted,children:`No image models available for this provider.`})}):(0,B.jsx)(D,{children:(0,B.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:lt.length===0?(0,B.jsx)(`div`,{className:`text-center py-8`,children:(0,B.jsx)(`p`,{className:A.bodyMuted,children:`No models matching your filters.`})}):lt.map(e=>{let t=Ve.has(e.id),n=Ge.has(e.id),r=Ge.get(e.id),i=n?r:t,a=e.pricing;return(0,B.jsxs)(`div`,{className:`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0 ${$?``:`opacity-25`}`,children:[(0,B.jsx)(me,{id:`image-${e.id}`,disabled:!$,checked:i??!1,onCheckedChange:()=>nt(e.id,`image`),className:`mt-0`}),(0,B.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,B.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,B.jsx)(`label`,{htmlFor:`image-${e.id}`,className:k(A.label,`leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:Q(e)})}),a&&(0,B.jsx)(`span`,{className:k(A.caption,`whitespace-nowrap flex-shrink-0`),children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${S(a.prompt??0)} in | $${S(a.completion??0)} out`})]})]},e.id)})})})]})})]}),q?(0,B.jsx)(I,{variant:q.includes(`error`)||q.includes(`Failed`)?`error`:`success`,children:q}):null]})]})}):(0,B.jsx)(`div`,{className:k(`flex flex-1 items-center justify-center`,f),children:(0,B.jsx)(be,{title:e||s?`Provider not found`:`Select a Provider`,action:d?(0,B.jsxs)(y,{variant:`outline`,size:`sm`,onClick:d,children:[(0,B.jsx)(x,{className:`h-4 w-4 mr-1`}),`Back to Providers`]}):void 0,children:d?`This provider could not be found.`:`Choose a provider from the list to configure its settings.`})})}function U(e){return`providers:list:${e}`}async function W(){let[e,t]=await Promise.all([p(),d().catch(()=>({}))]),n={};for(let[e,r]of Object.entries(t))n[e]=r.length;return{providers:e,enabledModelCounts:n}}function G(){let e=(0,R.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsx)(ye,{title:`Providers`,description:`Manage your AI provider connections and API keys.`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,B.jsx)(N,{title:`Connected Providers`}),e[1]=n):n=e[1];let r,i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,B.jsxs)(`div`,{children:[n,(0,B.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,B.jsx)(L,{className:`h-24 rounded-lg`}),(0,B.jsx)(L,{className:`h-24 rounded-lg`})]})]}),i=(0,B.jsx)(N,{title:`Available Providers`}),e[2]=r,e[3]=i):(r=e[2],i=e[3]);let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,B.jsx)(_e,{children:(0,B.jsxs)(ve,{children:[t,(0,B.jsxs)(`div`,{className:`space-y-8`,children:[r,(0,B.jsxs)(`div`,{children:[i,(0,B.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,B.jsx)(L,{className:`h-24 rounded-lg`}),(0,B.jsx)(L,{className:`h-24 rounded-lg`}),(0,B.jsx)(L,{className:`h-24 rounded-lg`}),(0,B.jsx)(L,{className:`h-24 rounded-lg`})]})]})]})]})}),e[4]=a):a=e[4],a}function K(e){let t=(0,R.c)(40),{loadVersion:n,onProviderClick:r}=e,[i,o]=(0,z.useState)(``),s;t[0]===n?s=t[1]:(s=U(n),t[0]=n,t[1]=s);let{providers:c,enabledModelCounts:l}=xe(s,W),u,d,f,p,m,h,g;if(t[2]!==l||t[3]!==r||t[4]!==c||t[5]!==i){let e;t[13]===i?e=t[14]:(e=e=>{let t=i.toLowerCase();return e.name.toLowerCase().includes(t)},t[13]=i,t[14]=e);let n;t[15]===l?n=t[16]:(n=(e,t)=>{let n=(l[e.slug]??0)>0,r=(l[t.slug]??0)>0;return n&&!r?-1:!n&&r?1:e.name.localeCompare(t.name)},t[15]=l,t[16]=n);let s=c.filter(Ne).filter(e).sort(n),_;t[17]===i?_=t[18]:(_=e=>{let t=i.toLowerCase();return e.name.toLowerCase().includes(t)},t[17]=i,t[18]=_);let v=c.filter(Me).filter(_).sort(je);d=_e,u=ve,t[19]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,B.jsx)(ye,{title:`Providers`,description:`Manage your AI provider connections and API keys.`}),t[19]=m):m=t[19];let y;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,B.jsx)(ie,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),t[20]=y):y=t[20];let b;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>o(e.target.value),t[21]=b):b=t[21],t[22]===i?h=t[23]:(h=(0,B.jsx)(`div`,{className:`mb-6`,children:(0,B.jsxs)(`div`,{className:`relative`,children:[y,(0,B.jsx)(a,{placeholder:`Search providers...`,className:`pl-10`,value:i,onChange:b})]})}),t[22]=i,t[23]=h),f=`space-y-8`;let x;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,B.jsx)(N,{title:`Connected Providers`}),t[24]=x):x=t[24];let S=s.length===0?(0,B.jsx)(`p`,{className:k(A.bodyMuted,`py-4`),children:i?`No connected providers match your search.`:`No providers connected yet. Add an API key to get started.`}):(0,B.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:s.map(e=>(0,B.jsx)(Ie,{provider:e,isConnected:!0,modelCount:l[e.slug]??0,onClick:r},e.name))});t[25]===S?p=t[26]:(p=(0,B.jsxs)(`section`,{children:[x,S]}),t[25]=S,t[26]=p);let C;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,B.jsx)(N,{title:`Available Providers`}),t[27]=C):C=t[27],g=(0,B.jsxs)(`section`,{children:[C,v.length===0?(0,B.jsx)(`p`,{className:k(A.bodyMuted,`py-4`),children:i?`No available providers match your search.`:`All providers are connected.`}):(0,B.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:v.map(e=>(0,B.jsx)(Ie,{provider:e,modelCount:l[e.slug]??0,onClick:r},e.name))})]}),t[2]=l,t[3]=r,t[4]=c,t[5]=i,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=m,t[11]=h,t[12]=g}else u=t[6],d=t[7],f=t[8],p=t[9],m=t[10],h=t[11],g=t[12];let _;t[28]!==f||t[29]!==p||t[30]!==g?(_=(0,B.jsxs)(`div`,{className:f,children:[p,g]}),t[28]=f,t[29]=p,t[30]=g,t[31]=_):_=t[31];let v;t[32]!==u||t[33]!==m||t[34]!==h||t[35]!==_?(v=(0,B.jsxs)(u,{children:[m,h,_]}),t[32]=u,t[33]=m,t[34]=h,t[35]=_,t[36]=v):v=t[36];let y;return t[37]!==d||t[38]!==v?(y=(0,B.jsx)(d,{children:v}),t[37]=d,t[38]=v,t[39]=y):y=t[39],y}function je(e,t){return e.name.localeCompare(t.name)}function Me(e){return!e.apiKey}function Ne(e){return e.apiKey}function Pe(){let e=(0,R.c)(21),t=ue(),{providerSlug:n}=de(),[r,i]=(0,z.useState)(0),a=(0,z.useRef)(n),o,s;e[0]!==r||e[1]!==n?(o=()=>{a.current&&!n&&(we(U(r)),i(Y)),a.current=n},s=[n,r],e[0]=r,e[1]=n,e[2]=o,e[3]=s):(o=e[2],s=e[3]),(0,z.useEffect)(o,s);let c;e[4]===t?c=e[5]:(c=e=>{t(`/settings/providers/${encodeURIComponent(e.slug)}`)},e[4]=t,e[5]=c);let l=c,u;e[6]!==r||e[7]!==t?(u=()=>{t(`/settings/providers`),we(U(r)),i(Fe)},e[6]=r,e[7]=t,e[8]=u):u=e[8];let d=u,f;e[9]===r?f=e[10]:(f=function(){we(U(r)),i(J)},e[9]=r,e[10]=f);let p=f;if(n){let t=decodeURIComponent(n),r;return e[11]!==d||e[12]!==t?(r=(0,B.jsx)(H,{selectedProviderSlug:t,onBack:d}),e[11]=d,e[12]=t,e[13]=r):r=e[13],r}let m;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,B.jsx)(G,{}),e[14]=m):m=e[14];let h;e[15]!==l||e[16]!==r?(h=(0,B.jsx)(z.Suspense,{fallback:m,children:(0,B.jsx)(K,{loadVersion:r,onProviderClick:l},r)}),e[15]=l,e[16]=r,e[17]=h):h=e[17];let g;return e[18]!==p||e[19]!==h?(g=(0,B.jsx)(P,{fallbackTitle:`Failed to load providers`,onRetry:p,renderFallback:q,children:h}),e[18]=p,e[19]=h,e[20]=g):g=e[20],g}function q(e,t){return(0,B.jsx)(_e,{children:(0,B.jsxs)(ve,{children:[(0,B.jsx)(ye,{title:`Providers`,description:`Manage your AI provider connections and API keys.`}),(0,B.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-16`,children:(0,B.jsxs)(`div`,{className:`text-center max-w-md`,children:[(0,B.jsx)(I,{variant:`error`,className:`mb-4`,children:e.message}),(0,B.jsx)(y,{variant:`outline`,size:`sm`,onClick:t,children:`Retry`})]})})]})})}function J(e){return e+1}function Fe(e){return e+1}function Y(e){return e+1}function Ie(e){let t=(0,R.c)(28),{provider:n,isConnected:r,modelCount:i,onClick:a}=e,o=r===void 0?!1:r,c=i===void 0?0:i,[l,d]=(0,z.useState)(!1),p;t[0]!==a||t[1]!==n?(p=()=>a(n),t[0]=a,t[1]=n,t[2]=p):p=t[2];let m;t[3]!==l||t[4]!==n.name||t[5]!==n.slug?(m=(0,B.jsx)(`div`,{className:`flex-shrink-0 h-10 w-10 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:l?(0,B.jsx)(f,{className:`h-5 w-5 text-muted-foreground`}):(0,B.jsx)(`img`,{src:ce(n.slug),alt:`${n.name} logo`,className:`h-6 w-6 dark:invert`,onError:()=>d(!0)})}),t[3]=l,t[4]=n.name,t[5]=n.slug,t[6]=m):m=t[6];let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=k(A.label,`truncate`),t[7]=h):h=t[7];let g;t[8]===n.name?g=t[9]:(g=(0,B.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,B.jsx)(`span`,{className:h,children:n.name})}),t[8]=n.name,t[9]=g);let _;t[10]===o?_=t[11]:(_=!o&&(0,B.jsxs)(`div`,{className:k(A.compact,`flex items-center gap-1 text-muted-foreground mt-0.5`),children:[(0,B.jsx)(s,{className:`h-3 w-3`}),(0,B.jsx)(`span`,{children:`Click to configure`})]}),t[10]=o,t[11]=_);let v;t[12]!==g||t[13]!==_?(v=(0,B.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[g,_]}),t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]!==m||t[16]!==v?(y=(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m,v]}),t[15]=m,t[16]=v,t[17]=y):y=t[17];let b;t[18]!==o||t[19]!==c||t[20]!==n.isEnv?(b=o&&(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[n.isEnv?(0,B.jsxs)(V,{variant:`secondary`,className:k(A.compact,`gap-1 px-2 py-0.5`),children:[(0,B.jsx)(u,{className:`h-3 w-3`}),`Environment`]}):(0,B.jsxs)(V,{variant:`secondary`,className:k(A.compact,`gap-1 px-2 py-0.5`),children:[(0,B.jsx)(te,{className:`h-3 w-3`}),`API Key`]}),c>0&&(0,B.jsxs)(V,{variant:`default`,className:k(A.compact,`gap-1 px-2 py-0.5`),children:[(0,B.jsx)(C,{className:`h-3 w-3`}),c,` `,c===1?`Model`:`Models`]})]}),t[18]=o,t[19]=c,t[20]=n.isEnv,t[21]=b):b=t[21];let x;t[22]!==b||t[23]!==y?(x=(0,B.jsxs)(Ce,{className:`p-4 flex flex-col gap-3`,children:[y,b]}),t[22]=b,t[23]=y,t[24]=x):x=t[24];let S;return t[25]!==x||t[26]!==p?(S=(0,B.jsx)(F,{className:`cursor-pointer transition-all hover:border-primary/50 hover:shadow-md`,onClick:p,children:x}),t[25]=x,t[26]=p,t[27]=S):S=t[27],S}export{Pe as ProvidersListView,Pe as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-general-view-CH-51vI0.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-CbJ3v0Sr.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-jX3PPID6.js","assets/dialogs-config-DZKtVbNK.js","assets/onboarding-CxtzQldG.js","assets/whisper-wasm-EGutPGND.js","assets/react-vendor-Ba8DSNiO.js","assets/utils-BlXPFbY9.js","assets/index-jIBJk8xl.css","assets/project-settings-view-B7RBOfiB.js","assets/radio-group-Bd8YbtFD.js","assets/providers-list-view-BQFttbEU.js","assets/skeleton-qzmFgKhS.js","assets/settings-models-view-m-MDG6JH.js","assets/settings-models-skeleton-l966LEN8.js","assets/settings-list-CKPEGohm.js","assets/settings-mcp-servers-view-o2gqb0qo.js","assets/mcp-server-card-CTCrhFIS.js","assets/settings-skills-view-DLyWp1pq.js","assets/settings-rules-view-tG9JJQzK.js","assets/settings-slash-commands-view-B7OCA_J1.js","assets/settings-subagents-view-CSkVwd-J.js","assets/settings-instructions-view-D9HZldUk.js","assets/settings-system-prompt-view-Br6r4RXb.js","assets/account-view-Cn4P1srV.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$i as t,Ba as n,Gi as r,Kt as i,Li as a,Qa as o,Ri as s,St as c,Xi as l,ci as u,co as d,do as f,en as p,ha as m,ia as h,ja as g,ji as _,po as v,ta as y,ui as b,wi as x,xo as S,yo as ee,zi as C}from"./dialogs-config-DZKtVbNK.js";import{ct as te,lt as ne,st as re}from"./react-vendor-Ba8DSNiO.js";import{r as w}from"./monaco-CZnIWXyV.js";import{c as T,o as E}from"./onboarding-CxtzQldG.js";import{D,E as O,T as k}from"./history-view-jX3PPID6.js";import{A,T as j,a as M,i as N,j as P,k as F,n as I,p as L,r as R}from"./index-CbJ3v0Sr.js";import{t as z}from"./settings-models-skeleton-l966LEN8.js";var B=ee(),V=e(S(),1),H=_(),ie=(0,V.forwardRef)(function(e,t){let n=(0,B.c)(28),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:u,className:d,onCollapse:f,onExpand:p,isMobile:m,mobileShowSidebar:h}=e,g=a===void 0?25:a,_=o===void 0?20:o,v=s===void 0?30:s,y=c===void 0?40:c,x=l===void 0?!1:l,S=u===void 0?0:u,ee=d===void 0?``:d,C=m===void 0?!1:m,te=h===void 0?!0:h,ne=C&&!te,re=C&&te,w=`h-full ${ee}`,T=C?100:g,E=C?50:_,D=C?100:v,O=ne&&`hidden`,k;n[0]===O?k=n[1]:(k=b(`border-r border-transparent`,O),n[0]=O,n[1]=k);let A;n[2]!==S||n[3]!==x||n[4]!==f||n[5]!==p||n[6]!==t||n[7]!==r||n[8]!==T||n[9]!==E||n[10]!==D||n[11]!==k?(A=(0,H.jsx)(R,{ref:t,defaultSize:T,minSize:E,maxSize:D,collapsible:x,collapsedSize:S,onCollapse:f,onExpand:p,className:k,children:r}),n[2]=S,n[3]=x,n[4]=f,n[5]=p,n[6]=t,n[7]=r,n[8]=T,n[9]=E,n[10]=D,n[11]=k,n[12]=A):A=n[12];let j;n[13]===C?j=n[14]:(j=!C&&(0,H.jsx)(I,{withHandle:!0,className:`ml-[-40px]`}),n[13]=C,n[14]=j);let M=re&&`hidden`,P;n[15]===M?P=n[16]:(P=b(`overflow-hidden`,M),n[15]=M,n[16]=P);let F;n[17]!==i||n[18]!==y||n[19]!==P?(F=(0,H.jsx)(R,{minSize:y,className:P,children:i}),n[17]=i,n[18]=y,n[19]=P,n[20]=F):F=n[20];let L;n[21]!==A||n[22]!==j||n[23]!==F?(L=(0,H.jsxs)(N,{direction:`horizontal`,className:`h-full`,children:[A,j,F]}),n[21]=A,n[22]=j,n[23]=F,n[24]=L):L=n[24];let z;return n[25]!==w||n[26]!==L?(z=(0,H.jsx)(`div`,{className:w,children:L}),n[25]=w,n[26]=L,n[27]=z):z=n[27],z}),ae=[{id:`providers`,label:`Providers`,icon:(0,H.jsx)(o,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,H.jsx)(f,{className:`h-4 w-4`}),route:`/settings/models`},{id:`skills`,label:`Skills`,icon:(0,H.jsx)(a,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,H.jsx)(h,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,H.jsx)(r,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,H.jsx)(s,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,H.jsx)(v,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`system-prompt`,label:`System Prompt`,icon:(0,H.jsx)(l,{className:`h-4 w-4`}),route:`/settings/system-prompt`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,H.jsx)(y,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`general`,label:`General`,icon:(0,H.jsx)(t,{className:`h-4 w-4`}),route:`/settings/general`},{id:`history`,label:`History`,icon:(0,H.jsx)(g,{className:`h-4 w-4`}),route:`/settings/history`},{id:`account`,label:`Account`,icon:(0,H.jsx)(C,{className:`h-4 w-4`}),route:`/settings/account`}];function U(e){let t=[...ae];if(!e)return t;let r=t.findIndex(e=>e.id===`skills`);return t.splice(r,0,{id:`project`,label:`Project`,icon:(0,H.jsx)(n,{className:`h-4 w-4`}),route:`/settings/project/${e}`}),t}function oe(e){let t=(0,B.c)(13),{className:n,selectedProjectId:r,onResetOnboarding:i,onNavItemSelect:a}=e,o=te(),s=re(),c=(0,V.useRef)(0),l=(0,V.useRef)(null),u,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>()=>{l.current&&clearTimeout(l.current)},d=[],t[0]=u,t[1]=d):(u=t[0],d=t[1]),(0,V.useEffect)(u,d);let f,p;if(t[2]!==n||t[3]!==s.pathname||t[4]!==o||t[5]!==a||t[6]!==i||t[7]!==r){let e=U(r),u=function(){let t=s.pathname;if(t.startsWith(`/settings/project/`))return`project`;for(let n of e)if(t.startsWith(n.route))return n.id;return`general`}(),d=function(e){e.id===`general`&&i&&(l.current&&clearTimeout(l.current),c.current+=1,c.current>=3?(c.current=0,i()):l.current=setTimeout(()=>{c.current=0},1500)),a?.(),o(e.route)};f=`space-y-1${n?` ${n}`:``}`,p=e.map((t,n)=>(0,H.jsxs)(V.Fragment,{children:[(0,H.jsx)(T,{selected:u===t.id,asChild:!0,children:(0,H.jsx)(`button`,{className:`justify-start`,onClick:()=>d(t),children:(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[t.icon,(0,H.jsx)(`span`,{children:t.label})]})})}),(t.id===`models`||t.id===`mcp-servers`||n===e.length-1)&&(0,H.jsx)(E,{className:`my-2 bg-sidebar-border`})]},t.id)),t[2]=n,t[3]=s.pathname,t[4]=o,t[5]=a,t[6]=i,t[7]=r,t[8]=f,t[9]=p}else f=t[8],p=t[9];let m;return t[10]!==f||t[11]!==p?(m=(0,H.jsx)(`div`,{className:f,children:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12],m}var se=(0,V.lazy)(()=>w(()=>import(`./settings-general-view-CH-51vI0.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),ce=(0,V.lazy)(()=>w(()=>import(`./project-settings-view-B7RBOfiB.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11,13]))),le=(0,V.lazy)(()=>w(()=>import(`./providers-list-view-BQFttbEU.js`),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,15]))),ue=(0,V.lazy)(()=>w(()=>import(`./settings-models-view-m-MDG6JH.js`),__vite__mapDeps([16,1,2,3,4,5,6,7,8,9,10,11,17,15,18]))),de=(0,V.lazy)(()=>w(()=>import(`./settings-mcp-servers-view-o2gqb0qo.js`),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),fe=(0,V.lazy)(()=>w(()=>import(`./settings-skills-view-DLyWp1pq.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),pe=(0,V.lazy)(()=>w(()=>import(`./settings-rules-view-tG9JJQzK.js`),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),me=(0,V.lazy)(()=>w(()=>import(`./settings-slash-commands-view-B7OCA_J1.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,10,11,20,13,18,15]))),he=(0,V.lazy)(()=>w(()=>import(`./settings-subagents-view-CSkVwd-J.js`),__vite__mapDeps([24,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),ge=(0,V.lazy)(()=>w(()=>import(`./settings-instructions-view-D9HZldUk.js`),__vite__mapDeps([25,1,2,3,4,5,6,7,8,9,10,11]))),_e=(0,V.lazy)(()=>w(()=>import(`./settings-system-prompt-view-Br6r4RXb.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11]))),ve=(0,V.lazy)(()=>w(()=>import(`./account-view-Cn4P1srV.js`),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,15]))),ye=(0,V.lazy)(()=>w(()=>import(`./history-view-jX3PPID6.js`).then(e=>e.t),__vite__mapDeps([5,1,6]))),be=[`general`,`providers`,`models`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`system-prompt`,`mcp-servers`,`history`,`account`];function W(e){let t=(0,B.c)(2),{title:n}=e,r;return t[0]===n?r=t[1]:(r=(0,H.jsx)(k,{title:n,children:`Content coming soon...`}),t[0]=n,t[1]=r),r}function xe(){let e=(0,B.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,H.jsxs)(`div`,{className:`mb-6`,children:[(0,H.jsx)(`div`,{className:`h-8 w-32 bg-muted rounded animate-pulse mb-2`}),(0,H.jsx)(`div`,{className:`h-4 w-64 bg-muted rounded animate-pulse`})]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,H.jsx)(`div`,{className:`mb-6`,children:(0,H.jsx)(`div`,{className:`h-10 w-full bg-muted rounded animate-pulse`})}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,H.jsx)(`div`,{className:`h-4 w-36 bg-muted rounded animate-pulse mb-3`}),e[2]=r):r=e[2];let i,a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,H.jsxs)(`div`,{children:[r,(0,H.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,H.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,H.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`})]})]}),a=(0,H.jsx)(`div`,{className:`h-4 w-40 bg-muted rounded animate-pulse mb-3`}),e[3]=i,e[4]=a):(i=e[3],a=e[4]);let o;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,H.jsx)(D,{children:(0,H.jsxs)(O,{children:[t,n,(0,H.jsxs)(`div`,{className:`space-y-8`,children:[i,(0,H.jsxs)(`div`,{children:[a,(0,H.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,H.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,H.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,H.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,H.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`})]})]})]})]})}),e[5]=o):o=e[5],o}function Se(e){return e.startsWith(`/settings/general`)?`general`:e.startsWith(`/settings/providers`)?`providers`:e.startsWith(`/settings/models`)?`models`:e.startsWith(`/settings/skills`)?`skills`:e.startsWith(`/settings/rules`)?`rules`:e.startsWith(`/settings/slash-commands`)?`slash-commands`:e.startsWith(`/settings/subagents`)?`subagents`:e.startsWith(`/settings/instructions`)?`instructions`:e.startsWith(`/settings/system-prompt`)?`system-prompt`:e.startsWith(`/settings/mcp-servers`)?`mcp-servers`:e.startsWith(`/settings/history`)?`history`:e.startsWith(`/settings/account`)?`account`:`general`}function Ce(e){let t=e.match(/^\/settings\/providers\/([^/]+)$/);return t?decodeURIComponent(t[1]):null}function G(){let e=(0,B.c)(68),{tab:t,projectId:n}=ne(),r=te(),a=re(),o=A(),s=P(Ee),l=P(Te),f;e[0]!==a.pathname||e[1]!==n?(f=!!n&&a.pathname.startsWith(`/settings/project/`),e[0]=a.pathname,e[1]=n,e[2]=f):f=e[2];let h=f,g;e[3]===a.pathname?g=e[4]:(g=Ce(a.pathname),e[3]=a.pathname,e[4]=g);let _=g!==null,v;if(e[5]!==a.pathname||e[6]!==a.search||e[7]!==t){let n=new URLSearchParams(a.search).get(`tab`);v=n&&be.includes(n)?n:t&&be.includes(t)?t:Se(a.pathname),e[5]=a.pathname,e[6]=a.search,e[7]=t,e[8]=v}else v=e[8];let y=v,S=L(),[ee,C]=(0,V.useState)(!1),[w,T]=(0,V.useState)(!0),[E,D]=(0,V.useState)(0),O=(0,V.useRef)(null),k;bb0:{if(h){k=`Project`;break bb0}let t;e[9]===y?t=e[10]:(t=ae.find(e=>e.id===y)?.label??`Settings`,e[9]=y,e[10]=t),k=t}let N=k,I;e[11]===r?I=e[12]:(I=()=>{r(`/settings/providers`)},e[11]=r,e[12]=I);let R=I,U;e[13]===S?U=e[14]:(U=()=>{S&&T(!1)},e[13]=S,e[14]=U);let G=U,K;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>{T(!0)},e[15]=K):K=e[15];let De=K,q;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(q=async()=>{try{await p(),D(we)}catch(e){console.error(`Failed to reset onboarding:`,e)}},e[16]=q):q=e[16];let Oe=q,ke;e[17]===r?ke=e[18]:(ke=()=>{r(`/`)},e[17]=r,e[18]=ke);let Ae=ke,je;e[19]===s?je=e[20]:(je=s?{type:`project`,id:s}:void 0,e[19]=s,e[20]=je);let Me=je,Ne;e[21]===r?Ne=e[22]:(Ne=()=>{r(`/settings/general`)},e[21]=r,e[22]=Ne);let Pe=Ne,Fe;e[23]!==o||e[24]!==n?(Fe=async()=>{i(n);try{let e=await c();o({type:F.SetProjects,projects:e.projects})}catch(e){let t=e;throw console.error(`Failed to refresh projects after settings update:`,t),t}},e[23]=o,e[24]=n,e[25]=Fe):Fe=e[25];let Ie=Fe,Le,Re;e[26]!==a.pathname||e[27]!==r?(Le=()=>{(a.pathname===`/settings`||a.pathname===`/settings/project`||[`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(e=>a.pathname.startsWith(e)))&&r(`/settings/general`,{replace:!0})},Re=[a.pathname,r],e[26]=a.pathname,e[27]=r,e[28]=Le,e[29]=Re):(Le=e[28],Re=e[29]),(0,V.useEffect)(Le,Re);let ze;e[30]!==Ae||e[31]!==G||e[32]!==s?(ze=()=>(0,H.jsx)(j,{onTitleClose:Ae,subtitle:`Settings`,children:(0,H.jsx)(`div`,{className:`px-2 py-2`,children:(0,H.jsx)(oe,{selectedProjectId:s,onResetOnboarding:Oe,onNavItemSelect:G})})}),e[30]=Ae,e[31]=G,e[32]=s,e[33]=ze):ze=e[33];let Be=ze,Ve;e[34]!==y||e[35]!==Pe||e[36]!==Ie||e[37]!==Me||e[38]!==h||e[39]!==E||e[40]!==n||e[41]!==l?(Ve=()=>{if(h&&n)return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`Project Settings`}),children:(0,H.jsx)(ce,{projectId:n,onProjectUpdated:Ie})});switch(y){case`general`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`General`}),children:(0,H.jsx)(se,{onboardingResetSignal:E})});case`providers`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(xe,{}),children:(0,H.jsx)(le,{})});case`models`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(z,{}),children:(0,H.jsx)(ue,{})});case`skills`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`Skills`}),children:(0,H.jsx)(fe,{})});case`rules`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`Rules`}),children:(0,H.jsx)(pe,{})});case`slash-commands`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`Slash Commands`}),children:(0,H.jsx)(me,{})});case`subagents`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`Subagents`}),children:(0,H.jsx)(he,{})});case`instructions`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`Instructions`}),children:(0,H.jsx)(ge,{})});case`system-prompt`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`System Prompt`}),children:(0,H.jsx)(_e,{})});case`mcp-servers`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`MCP Servers`}),children:(0,H.jsx)(de,{})});case`history`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`History`}),children:(0,H.jsx)(ye,{isOpen:!0,onClose:Pe,initialFilter:Me,projects:l,inline:!0})});case`account`:return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(W,{title:`Account`}),children:(0,H.jsx)(ve,{})});default:return(0,H.jsx)(W,{title:`Settings`})}},e[34]=y,e[35]=Pe,e[36]=Ie,e[37]=Me,e[38]=h,e[39]=E,e[40]=n,e[41]=l,e[42]=Ve):Ve=e[42];let He=Ve,Ue,We;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=()=>C(!0),We=()=>C(!1),e[43]=Ue,e[44]=We):(Ue=e[43],We=e[44]);let J;e[45]===Be?J=e[46]:(J=Be(),e[45]=Be,e[46]=J);let Y;e[47]!==N||e[48]!==R||e[49]!==S||e[50]!==_||e[51]!==w?(Y=_?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,H.jsxs)(u,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:R,children:[(0,H.jsx)(d,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Back to providers`})]}),(0,H.jsx)(`button`,{type:`button`,className:b(x.sectionTitle,`truncate text-foreground min-w-0 flex-1 text-left bg-transparent p-0 border-0 cursor-pointer electrobun-webkit-app-region-no-drag focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm`),onClick:R,children:N})]}):S&&!w&&(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,H.jsxs)(u,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:De,children:[(0,H.jsx)(m,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Show settings menu`})]}),(0,H.jsx)(`span`,{className:b(x.sectionTitle,`truncate text-foreground`),children:N})]}),e[47]=N,e[48]=R,e[49]=S,e[50]=_,e[51]=w,e[52]=Y):Y=e[52];let X;e[53]===Y?X=e[54]:(X=(0,H.jsx)(M,{className:`pt-8 md:min-h-[103px]`,children:Y}),e[53]=Y,e[54]=X);let Ge=`flex-1 overflow-auto ${ee&&!S?`ml-[40px]`:``}`,Z;e[55]===He?Z=e[56]:(Z=He(),e[55]=He,e[56]=Z);let Q;e[57]!==Ge||e[58]!==Z?(Q=(0,H.jsx)(`div`,{className:Ge,children:Z}),e[57]=Ge,e[58]=Z,e[59]=Q):Q=e[59];let $;e[60]!==X||e[61]!==Q?($=(0,H.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[X,Q]}),e[60]=X,e[61]=Q,e[62]=$):$=e[62];let Ke;return e[63]!==S||e[64]!==w||e[65]!==J||e[66]!==$?(Ke=(0,H.jsx)(ie,{ref:O,collapsible:!0,isMobile:S,mobileShowSidebar:w,onCollapse:Ue,onExpand:We,sidebar:J,children:$}),e[63]=S,e[64]=w,e[65]=J,e[66]=$,e[67]=Ke):Ke=e[67],Ke}function we(e){return e+1}function Te(e){return e.projects}function Ee(e){return e.selectedProjectId}export{G as default};
|