tarsk 0.5.35 → 0.5.37
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 +28 -15
- package/dist/public/assets/{account-view-k5jIArY-.js → account-view-Cn4P1srV.js} +1 -1
- package/dist/public/assets/api-DWU0D34A.js +1 -0
- package/dist/public/assets/{browser-tab-C9kJT-C5.js → browser-tab-DeoHDVON.js} +1 -1
- package/dist/public/assets/commit-dialog-CWb_KVrD.js +1 -0
- package/dist/public/assets/context-menu-C7FTMa2c.js +1 -0
- package/dist/public/assets/create-repo-dialog-BCPrWkIv.js +1 -0
- package/dist/public/assets/{dialogs-config-B4TDFSrS.js → dialogs-config-DZKtVbNK.js} +14 -14
- package/dist/public/assets/diff-view-DL3hFREY.js +3 -0
- package/dist/public/assets/explorer-tab-view-DAs4rpHu.js +2 -0
- package/dist/public/assets/{explorer-tree-uXbr6cCI.js → explorer-tree-BV1LcznV.js} +1 -1
- package/dist/public/assets/explorer-view-BGSxs_-F.js +1 -0
- package/dist/public/assets/git-history-dialog-Bqv0bD41.js +1 -0
- package/dist/public/assets/git-ops-button-DZzOCOr8.js +2 -0
- package/dist/public/assets/history-view-jX3PPID6.js +9 -0
- package/dist/public/assets/index-CbJ3v0Sr.js +65 -0
- package/dist/public/assets/index-jIBJk8xl.css +1 -0
- package/dist/public/assets/mcp-server-card-CTCrhFIS.js +1 -0
- package/dist/public/assets/merged-pr-dialog-B2qqrQ1g.js +1 -0
- package/dist/public/assets/onboarding-CxtzQldG.js +1 -0
- package/dist/public/assets/project-settings-view-B7RBOfiB.js +1 -0
- package/dist/public/assets/providers-list-view-BQFttbEU.js +1 -0
- package/dist/public/assets/pull-request-dialog-BIRSLJAA.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-LUgd2a4S.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-CFmgu9H_.js +1 -0
- package/dist/public/assets/radio-group-Bd8YbtFD.js +1 -0
- package/dist/public/assets/{react-vendor-unlDVFpU.js → react-vendor-Ba8DSNiO.js} +5 -5
- package/dist/public/assets/settings-general-view-CH-51vI0.js +1 -0
- package/dist/public/assets/settings-instructions-view-D9HZldUk.js +1 -0
- package/dist/public/assets/settings-list-CKPEGohm.js +1 -0
- package/dist/public/assets/settings-mcp-servers-view-o2gqb0qo.js +5 -0
- package/dist/public/assets/{settings-models-skeleton-B_56ozbA.js → settings-models-skeleton-l966LEN8.js} +1 -1
- package/dist/public/assets/{settings-models-view-ms828HDa.js → settings-models-view-m-MDG6JH.js} +1 -1
- package/dist/public/assets/settings-rules-view-tG9JJQzK.js +8 -0
- package/dist/public/assets/settings-skills-view-DLyWp1pq.js +2 -0
- package/dist/public/assets/settings-slash-commands-view-B7OCA_J1.js +1 -0
- package/dist/public/assets/settings-subagents-view-CSkVwd-J.js +2 -0
- package/dist/public/assets/settings-system-prompt-view-Br6r4RXb.js +1 -0
- package/dist/public/assets/settings-view-rUCFRiPR.js +2 -0
- package/dist/public/assets/skeleton-qzmFgKhS.js +1 -0
- package/dist/public/assets/{terminal-panel-Bm5ECpK_.js → terminal-panel-D3Ru16FT.js} +2 -2
- package/dist/public/assets/{ui-components-BZYnvMGc.js → ui-components-f8jJJzEo.js} +1 -1
- package/dist/public/assets/{utils-umVhs9to.js → utils-BlXPFbY9.js} +1 -1
- package/dist/public/assets/{whisper-wasm-Cq5Ofwpd.js → whisper-wasm-EGutPGND.js} +2 -2
- package/dist/public/index.html +12 -9
- package/package.json +1 -1
- package/dist/public/assets/api-OCjPhv01.js +0 -1
- package/dist/public/assets/commit-dialog-8Ce6d3H8.js +0 -1
- package/dist/public/assets/context-menu-CMsWrzLD.js +0 -1
- package/dist/public/assets/create-repo-dialog-CVUtteNS.js +0 -1
- package/dist/public/assets/diff-view-DGfmGlB_.js +0 -3
- package/dist/public/assets/explorer-tab-view-CCXVTkVu.js +0 -2
- package/dist/public/assets/explorer-view-CupxzDId.js +0 -1
- package/dist/public/assets/git-history-dialog-BCGOZ6ua.js +0 -1
- package/dist/public/assets/git-ops-button-BV9X3fo-.js +0 -2
- package/dist/public/assets/history-view-Ds_0e_bx.js +0 -7
- package/dist/public/assets/index-C0lTt0ZK.css +0 -1
- package/dist/public/assets/index-DOsSr4dl.js +0 -65
- package/dist/public/assets/mcp-server-card-DrUUKNXv.js +0 -1
- package/dist/public/assets/merged-pr-dialog-DqWSFdCH.js +0 -1
- package/dist/public/assets/onboarding-DfL8a0LZ.js +0 -1
- package/dist/public/assets/project-settings-view-Cd_l3Lfy.js +0 -1
- package/dist/public/assets/providers-list-view-VXhgM3vp.js +0 -1
- package/dist/public/assets/pull-request-dialog-DZXTHHuh.js +0 -1
- package/dist/public/assets/pull-with-changes-dialog-CYQrwzcw.js +0 -1
- package/dist/public/assets/push-before-pr-dialog-D-ZnRpJi.js +0 -1
- package/dist/public/assets/radio-group-c0sU992r.js +0 -1
- package/dist/public/assets/settings-general-view-DI-lvP0L.js +0 -1
- package/dist/public/assets/settings-instructions-view-kUG32_dT.js +0 -1
- package/dist/public/assets/settings-list-CUbZrggr.js +0 -1
- package/dist/public/assets/settings-mcp-servers-view-DmxUO42I.js +0 -5
- package/dist/public/assets/settings-rules-view-Xx0ymfnQ.js +0 -8
- package/dist/public/assets/settings-skills-view-DvPPdsi_.js +0 -2
- package/dist/public/assets/settings-slash-commands-view-BULIAW2o.js +0 -1
- package/dist/public/assets/settings-subagents-view-B7FcLaZT.js +0 -2
- package/dist/public/assets/settings-system-prompt-view-66zf0gRc.js +0 -1
- package/dist/public/assets/settings-view-B4CMq7it.js +0 -2
- package/dist/public/assets/skeleton-BvSNJL9q.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Li as e,Ti as t,Va as n,ar as r,fo as i,ii as a,ir as o,ni as s,or as c,ro as l,rr as u,vi as d}from"./dialogs-config-B4TDFSrS.js";var f=i(),p=t();function m(t){let i=(0,f.c)(26),{name:m,description:h,installed:g,onClick:_,onOpen:v,onUninstall:y,showInstalledControls:b}=t,x=b===void 0?!0:b,S=`flex flex-col gap-2 p-2.5 rounded-lg border border-border bg-card text-left transition-colors w-full ${g?``:`hover:bg-accent/50 cursor-pointer`}`,C=g?void 0:_,w=g?void 0:`button`,T;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=a(d.label,`truncate`),i[0]=T):T=i[0];let E;i[1]===m?E=i[2]:(E=(0,p.jsx)(`span`,{className:T,children:m}),i[1]=m,i[2]=E);let D;i[3]!==g||i[4]!==x?(D=g&&x&&(0,p.jsx)(r,{delayDuration:300,children:(0,p.jsxs)(u,{children:[(0,p.jsx)(c,{asChild:!0,children:(0,p.jsx)(`span`,{className:`flex-shrink-0 h-4 w-4 rounded-full bg-green-500/15 flex items-center justify-center`,children:(0,p.jsx)(l,{className:`h-2.5 w-2.5 text-green-600 dark:text-green-400`})})}),(0,p.jsx)(o,{children:`Installed`})]})}),i[3]=g,i[4]=x,i[5]=D):D=i[5];let O;i[6]!==E||i[7]!==D?(O=(0,p.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[E,D]}),i[6]=E,i[7]=D,i[8]=O):O=i[8];let k;i[9]!==g||i[10]!==v||i[11]!==y||i[12]!==x?(k=g&&x&&(0,p.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[v&&(0,p.jsx)(r,{delayDuration:300,children:(0,p.jsxs)(u,{children:[(0,p.jsx)(c,{asChild:!0,children:(0,p.jsx)(s,{variant:`ghost`,size:`icon-sm`,onClick:e=>{e.stopPropagation(),v()},children:(0,p.jsx)(n,{className:`h-3.5 w-3.5`})})}),(0,p.jsx)(o,{children:`Open in Explorer`})]})}),y&&(0,p.jsx)(r,{delayDuration:300,children:(0,p.jsxs)(u,{children:[(0,p.jsx)(c,{asChild:!0,children:(0,p.jsx)(s,{variant:`ghost`,size:`icon-sm`,onClick:e=>{e.stopPropagation(),y()},className:`text-destructive hover:text-destructive`,children:(0,p.jsx)(e,{className:`h-3.5 w-3.5`})})}),(0,p.jsx)(o,{children:`Remove`})]})})]}),i[9]=g,i[10]=v,i[11]=y,i[12]=x,i[13]=k):k=i[13];let A;i[14]!==O||i[15]!==k?(A=(0,p.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[O,k]}),i[14]=O,i[15]=k,i[16]=A):A=i[16];let j;i[17]===Symbol.for(`react.memo_cache_sentinel`)?(j=a(d.caption,`line-clamp-3`),i[17]=j):j=i[17];let M;i[18]===h?M=i[19]:(M=(0,p.jsx)(`p`,{className:j,children:h}),i[18]=h,i[19]=M);let N;return i[20]!==A||i[21]!==M||i[22]!==S||i[23]!==C||i[24]!==w?(N=(0,p.jsxs)(`div`,{className:S,onClick:C,role:w,children:[A,M]}),i[20]=A,i[21]=M,i[22]=S,i[23]=C,i[24]=w,i[25]=N):N=i[25],N}export{m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Cr as e,Er as t,Sr as n,Ti as r,Tr as i,fo as a,ni as o,wr as s,xr as c}from"./dialogs-config-B4TDFSrS.js";var l=a(),u=r();function d(r){let a=(0,l.c)(14),{open:d,onOpenChange:f,onNewBranch:p,onJustOpen:m,isLoading:h}=r,g=h===void 0?!1:h,_;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,u.jsxs)(i,{children:[(0,u.jsx)(t,{children:`Pull Request Merged`}),(0,u.jsx)(e,{children:`As the pull request has been merged, a new branch will be created from the current checkout.`})]}),a[0]=_):_=a[0];let v;a[1]!==g||a[2]!==m?(v=(0,u.jsx)(o,{variant:`ghost`,onClick:m,disabled:g,children:`Just Open`}),a[1]=g,a[2]=m,a[3]=v):v=a[3];let y;a[4]!==g||a[5]!==p?(y=(0,u.jsx)(o,{onClick:p,disabled:g,children:`New Branch`}),a[4]=g,a[5]=p,a[6]=y):y=a[6];let b;a[7]!==v||a[8]!==y?(b=(0,u.jsxs)(n,{children:[_,(0,u.jsxs)(s,{children:[v,y]})]}),a[7]=v,a[8]=y,a[9]=b):b=a[9];let x;return a[10]!==f||a[11]!==d||a[12]!==b?(x=(0,u.jsx)(c,{open:d,onOpenChange:f,children:b}),a[10]=f,a[11]=d,a[12]=b,a[13]=x):x=a[13],x}export{d as MergedPRDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{Ba as n,Br as r,Cr as i,Ct as a,Di as o,Er as s,Ga as c,Gt as l,Qa as u,Sa as d,Sr as f,St as p,Ti as m,Tr as h,Ua as g,V as _,Va as v,Zi as y,Zr as b,ai as x,ar as S,br as C,do as w,ei as T,f as E,fi as D,fo as O,g as k,hr as ee,ii as A,in as te,ir as j,lo as M,mo as N,mr as P,n as F,ni as I,or as ne,pi as L,qr as R,r as z,rn as re,ro as B,rr as V,ti as ie,vi as H,vr as U,wi as ae,wr as oe,xr as se,xt as ce,ya as W,yr as le,z as ue,za as de}from"./dialogs-config-B4TDFSrS.js";import{_ as fe,d as pe,f as me,h as he,m as ge,p as _e,x as G}from"./history-view-Ds_0e_bx.js";var K=O(),q=e(N(),1),J=m(),ve=q.forwardRef((e,t)=>{let n=(0,K.c)(23),r,i,a,o,s,c,l,u,d;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7],u=n[8],d=n[9]):({className:i,selected:c,noBackground:o,level:a,basePadding:r,indentSize:u,asChild:d,style:l,...s}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l,n[8]=u,n[9]=d);let f=u===void 0?20:u,p=d===void 0?!1:d,m=a===void 0?void 0:(r??12)+a*f,h=p?ae:`div`,g;n[10]!==i||n[11]!==o||n[12]!==c?(g=A(A(H.body,`flex items-center gap-2 w-full min-w-0 justify-start px-3 py-2 cursor-pointer rounded-full transition-colors group overflow-hidden`),`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,c&&!o&&`bg-sidebar-accent text-sidebar-accent-foreground font-medium`,c&&o&&`font-bold text-foreground`,i),n[10]=i,n[11]=o,n[12]=c,n[13]=g):g=n[13];let _=m===void 0?void 0:`${m}px`,v;n[14]!==l||n[15]!==_?(v={paddingLeft:_,...l},n[14]=l,n[15]=_,n[16]=v):v=n[16];let y;return n[17]!==h||n[18]!==s||n[19]!==t||n[20]!==g||n[21]!==v?(y=(0,J.jsx)(h,{ref:t,className:g,style:v,...s}),n[17]=h,n[18]=s,n[19]=t,n[20]=g,n[21]=v,n[22]=y):y=n[22],y});ve.displayName=`StandardListItem`;function ye(e){if(!e)return`Unknown Model`;let t=(e.split(`/`).filter(Boolean).pop()??e).replace(/[-_]+/g,` `).trim();return t?t.split(/\s+/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):e}var be=`Separator`,xe=`horizontal`,Se=[`horizontal`,`vertical`],Ce=q.forwardRef((e,t)=>{let{decorative:n,orientation:r=xe,...i}=e,a=we(r)?r:xe,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,J.jsx)(le.div,{"data-orientation":a,...o,...i,ref:t})});Ce.displayName=be;function we(e){return Se.includes(e)}var Te=Ce,Ee=q.forwardRef((e,t)=>{let n=(0,K.c)(14),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:r,orientation:a,decorative:o,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=a===void 0?`horizontal`:a,c=o===void 0?!0:o,l=s===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,u;n[5]!==r||n[6]!==l?(u=A(`shrink-0 bg-border`,l,r),n[5]=r,n[6]=l,n[7]=u):u=n[7];let d;return n[8]!==c||n[9]!==s||n[10]!==i||n[11]!==t||n[12]!==u?(d=(0,J.jsx)(Te,{ref:t,decorative:c,orientation:s,className:u,...i}),n[8]=c,n[9]=s,n[10]=i,n[11]=t,n[12]=u,n[13]=d):d=n[13],d});Ee.displayName=Te.displayName;function De(e){return`${e.slug.toUpperCase().replace(/-/g,`_`)}_API_URL`}function Oe(e){let t=e.env??[];return t.find(e=>/resource_name$/i.test(e))??t[0]??``}function ke(e){if(e.apiKeyEnv)return e.apiKeyEnv;if(e.keyName)return e.keyName;let t=e.env??[];return t.find(e=>/api_key$/i.test(e))??t[t.length-1]??``}function Ae(e){let t=ke(e);return(e.env??[]).filter(e=>e!==t)}function je(e){return e===`LOCAL_API_URL`?`URL`:e.replace(/^AZURE_/,``).replace(/_/g,` `).toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}function Me(e,t){let n=De(e),r=t[n]??e.envValues?.[n]??``;if(r)return r;if(e.slug===`azure`){let n=Oe(e),r=t[n]??e.envValues?.[n]??``;if(r)return`https://${r}.openai.azure.com/openai/v1`}return D(e.slug)?L({...e.envValues,...t}):e.api.replace(/\$\{([A-Z0-9_]+)\}/gi,(n,r)=>t[r]??e.envValues?.[r]??``)}function Ne(e){return e.slug.toLowerCase()===`openrouter`||e.name.toLowerCase()===`openrouter`}function Pe(e){return{recommended:e.find(Ne)??null,others:e.filter(e=>!Ne(e)).sort((e,t)=>e.name.localeCompare(t.name))}}function Fe(e){let{recommended:t,others:n}=Pe(e);return t??n[0]??null}function Ie(e){try{let t=new URL(e),n=t.hostname.split(`.`),r=n.length<=2?t.hostname:n.slice(-2).join(`.`);return`${t.protocol}//${r}`}catch{return e}}function Le(e){let t=(0,K.c)(17),{url:n,className:r,children:i,showIcon:a,variant:o}=e,s=a===void 0?!0:a,c=o===void 0?`link`:o,u;t[0]===n?u=t[1]:(u=Ie(n),t[0]=n,t[1]=u);let d=u,f;t[2]===d?f=t[3]:(f=async function(e){e.preventDefault(),e.stopPropagation();try{await l(d)}catch(e){console.error(`Failed to open provider website:`,e)}},t[2]=d,t[3]=f);let p=f,m=c===`link`&&H.caption,h=c===`link`&&`text-brand hover:underline inline-flex items-center gap-1`,g=c===`inline`&&`inline hover:underline`,_;t[4]!==r||t[5]!==m||t[6]!==h||t[7]!==g?(_=A(m,h,g,r),t[4]=r,t[5]=m,t[6]=h,t[7]=g,t[8]=_):_=t[8];let y;t[9]!==i||t[10]!==s?(y=i??(0,J.jsxs)(J.Fragment,{children:[`Visit provider website`,s&&(0,J.jsx)(v,{className:`h-3.5 w-3.5`})]}),t[9]=i,t[10]=s,t[11]=y):y=t[11];let b;return t[12]!==p||t[13]!==d||t[14]!==_||t[15]!==y?(b=(0,J.jsx)(`a`,{href:d,onClick:p,className:_,children:y}),t[12]=p,t[13]=d,t[14]=_,t[15]=y,t[16]=b):b=t[16],b}function Re(e){let t=(0,K.c)(10),{provider:n,size:r}=e,i=r===void 0?`md`:r,[a,o]=(0,q.useState)(!1),s=i===`sm`?`h-6 w-6`:`h-8 w-8`,l=i===`sm`?`h-4 w-4`:`h-5 w-5`,u=i===`sm`?`h-4 w-4`:`h-5 w-5`,d;t[0]===s?d=t[1]:(d=A(`flex-shrink-0 rounded-full bg-muted flex items-center justify-center overflow-hidden`,s),t[0]=s,t[1]=d);let f;t[2]!==u||t[3]!==l||t[4]!==a||t[5]!==n?(f=a?(0,J.jsx)(c,{className:A(u,`text-muted-foreground`)}):(0,J.jsx)(`img`,{src:ce(n.slug),alt:`${n.name} logo`,className:A(l,`dark:invert`),onError:()=>o(!0)}),t[2]=u,t[3]=l,t[4]=a,t[5]=n,t[6]=f):f=t[6];let p;return t[7]!==d||t[8]!==f?(p=(0,J.jsx)(`div`,{className:d,children:f}),t[7]=d,t[8]=f,t[9]=p):p=t[9],p}function ze(e){let t=(0,K.c)(10),{provider:n,recommended:r}=e,i=r===void 0?!1:r,a;t[0]===n?a=t[1]:(a=(0,J.jsx)(Re,{provider:n,size:`sm`}),t[0]=n,t[1]=a);let o;t[2]===n.name?o=t[3]:(o=(0,J.jsx)(`span`,{className:`truncate`,children:n.name}),t[2]=n.name,t[3]=o);let s;t[4]===i?s=t[5]:(s=i&&(0,J.jsx)(`span`,{className:A(H.caption,`text-muted-foreground flex-shrink-0`),children:`(Recommended)`}),t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,J.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Be(e){let t=(0,K.c)(8),{providers:n}=e,r,i,a;if(t[0]!==n){let{recommended:e,others:o}=Pe(n);r=e&&(0,J.jsx)(_e,{value:e.name,children:(0,J.jsx)(ze,{provider:e,recommended:!0})},e.name),i=e&&o.length>0&&(0,J.jsx)(ge,{}),a=o.map(Ve),t[0]=n,t[1]=r,t[2]=i,t[3]=a}else r=t[1],i=t[2],a=t[3];let o;return t[4]!==r||t[5]!==i||t[6]!==a?(o=(0,J.jsxs)(J.Fragment,{children:[r,i,a]}),t[4]=r,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function Ve(e){return(0,J.jsx)(_e,{value:e.name,children:(0,J.jsx)(ze,{provider:e})},e.name)}function He(e){let t=(0,K.c)(17),{providers:n,selectedProvider:r,onProviderChange:i}=e,a,o,s,c;if(t[0]!==i||t[1]!==n||t[2]!==r?.name){let{recommended:e,others:l}=Pe(n),u;t[7]!==i||t[8]!==r?.name?(u=function(e,t){let n=t===void 0?!1:t;return(0,J.jsx)(ve,{selected:r?.name===e.name,asChild:!0,children:(0,J.jsxs)(`button`,{type:`button`,className:`justify-start w-full`,onClick:()=>i(e),children:[(0,J.jsx)(Re,{provider:e}),(0,J.jsx)(`span`,{className:`truncate`,children:e.name}),n&&(0,J.jsx)(`span`,{className:A(H.caption,`text-muted-foreground flex-shrink-0`),children:`(Recommended)`})]})},e.name)},t[7]=i,t[8]=r?.name,t[9]=u):u=t[9];let d=u;a=`space-y-1`,o=e&&d(e,!0),s=e&&l.length>0&&(0,J.jsx)(Ee,{className:`my-2`});let f;t[10]===d?f=t[11]:(f=e=>d(e),t[10]=d,t[11]=f),c=l.map(f),t[0]=i,t[1]=n,t[2]=r?.name,t[3]=a,t[4]=o,t[5]=s,t[6]=c}else a=t[3],o=t[4],s=t[5],c=t[6];let l;return t[12]!==a||t[13]!==o||t[14]!==s||t[15]!==c?(l=(0,J.jsxs)(`div`,{className:a,children:[o,s,c]}),t[12]=a,t[13]=o,t[14]=s,t[15]=c,t[16]=l):l=t[16],l}function Ue({selectedProvider:e,onProviderChange:t,showApiKeyInput:n=!0,apiKey:r,onApiKeyChange:i,isLoading:a,error:o,variant:s=`dropdown`}){let[c,l]=(0,q.useState)([]),[u,d]=(0,q.useState)(!1);if((0,q.useEffect)(()=>{(async()=>{d(!0);try{let n=await p();if(l(n),n.length>0&&!e){let e=Fe(n);e&&t(e)}}catch(e){console.error(`Failed to load providers:`,e)}finally{d(!1)}})()},[e,t]),u)return(0,J.jsx)(`div`,{className:`flex items-center justify-center py-4`,children:(0,J.jsx)(W,{className:`h-4 w-4 animate-spin text-muted-foreground`})});let f=(0,J.jsxs)(J.Fragment,{children:[e?.url&&(0,J.jsx)(Le,{url:e.url}),n&&e&&(0,J.jsx)(We,{provider:e,value:r??e.apiKey??``,onChange:i,isLoading:a})]});return s===`list`?(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o&&(0,J.jsx)(`p`,{className:H.error,children:o}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(U,{children:`AI Provider`}),(0,J.jsx)(He,{providers:c,selectedProvider:e,onProviderChange:t})]}),f]}):(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o&&(0,J.jsx)(`p`,{className:H.error,children:o}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(U,{children:`AI Provider`}),(0,J.jsxs)(pe,{value:e?.name??``,onValueChange:e=>{let n=c.find(t=>t.name===e);n&&t(n)},children:[(0,J.jsx)(he,{children:e?(0,J.jsx)(ze,{provider:e}):`Select a provider`}),(0,J.jsx)(me,{children:(0,J.jsx)(Be,{providers:c})})]})]}),f]})}function We(e){let t=(0,K.c)(24),{provider:r,value:i,onChange:a,isLoading:o}=e,[s,c]=(0,q.useState)(!1);if(r.authType!==`APIKey`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(G,{className:`mb-0`,children:`This provider uses OAuth for authentication.`}),t[0]=e):e=t[0];let n;return t[1]===r.name?n=t[2]:(n=(0,J.jsxs)(`div`,{className:`space-y-2 text-center`,children:[e,(0,J.jsxs)(I,{variant:`outline`,size:`sm`,disabled:!0,children:[`Sign in with `,r.name]})]}),t[1]=r.name,t[2]=n),n}let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,J.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,J.jsx)(S,{children:(0,J.jsxs)(V,{children:[(0,J.jsx)(ne,{asChild:!0,children:(0,J.jsx)(U,{htmlFor:`api-key`,className:`cursor-help`,children:`API Key`})}),(0,J.jsx)(j,{children:`Your API key is stored locally and never shared.`})]})})}),t[3]=l):l=t[3];let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(d,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),t[4]=u):u=t[4];let f=s?`text`:`password`,p=r.keyName??`Enter API Key`,m;t[5]===a?m=t[6]:(m=e=>a?.(e.target.value),t[5]=a,t[6]=m);let h;t[7]!==o||t[8]!==f||t[9]!==p||t[10]!==m||t[11]!==i?(h=(0,J.jsx)(C,{id:`api-key`,type:f,placeholder:p,className:`pl-10 pr-10`,value:i,onChange:m,disabled:o}),t[7]=o,t[8]=f,t[9]=p,t[10]=m,t[11]=i,t[12]=h):h=t[12];let g;t[13]===s?g=t[14]:(g=()=>c(!s),t[13]=s,t[14]=g);let _=(o??!1)||!i,v;t[15]===s?v=t[16]:(v=s?(0,J.jsx)(n,{className:`h-4 w-4 text-muted-foreground`}):(0,J.jsx)(de,{className:`h-4 w-4 text-muted-foreground`}),t[15]=s,t[16]=v);let y;t[17]!==g||t[18]!==_||t[19]!==v?(y=(0,J.jsx)(I,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:g,disabled:_,children:v}),t[17]=g,t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;return t[21]!==y||t[22]!==h?(b=(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[l,(0,J.jsxs)(`div`,{className:`relative`,children:[u,h,y]})]}),t[21]=y,t[22]=h,t[23]=b):b=t[23],b}var Y=`Checkbox`,[Ge,Ke]=T(Y),[qe,X]=Ge(Y);function Je(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=b({prop:n,defaultProp:i??!1,onChange:c,caller:Y}),[m,h]=q.useState(null),[g,_]=q.useState(null),v=q.useRef(!1),y=m?!!o||!!m.closest(`form`):!0,x={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,required:l,defaultChecked:Q(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:_};return(0,J.jsx)(qe,{scope:t,...x,children:tt(d)?d(x):r})}var Ye=`CheckboxTrigger`,Xe=q.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:s,disabled:c,checked:l,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:h}=X(Ye,e),g=o(i,d),_=q.useRef(l);return q.useEffect(()=>{let e=a?.form;if(e){let t=()=>f(_.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,f]),(0,J.jsx)(R.button,{type:`button`,role:`checkbox`,"aria-checked":Q(l)?`mixed`:l,"aria-required":u,"data-state":nt(l),"data-disabled":c?``:void 0,disabled:c,value:s,...r,ref:g,onKeyDown:ie(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:ie(n,e=>{f(e=>Q(e)?!0:!e),h&&m&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});Xe.displayName=Ye;var Z=q.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,J.jsx)(Je,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Xe,{...d,ref:t,__scopeCheckbox:n}),e&&(0,J.jsx)(et,{__scopeCheckbox:n})]})})});Z.displayName=Y;var Ze=`CheckboxIndicator`,Qe=q.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:i,...a}=e,o=X(Ze,n);return(0,J.jsx)(r,{present:i||Q(o.checked)||o.checked===!0,children:(0,J.jsx)(R.span,{"data-state":nt(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:t,style:{pointerEvents:`none`,...e.style}})})});Qe.displayName=Ze;var $e=`CheckboxBubbleInput`,et=q.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=X($e,e),h=o(n,m),g=fe(a),_=P(r);q.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(g!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=Q(a),n.call(e,Q(a)?!1:a),e.dispatchEvent(t)}},[p,g,a,i]);let v=q.useRef(Q(a)?!1:a);return(0,J.jsx)(R.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??v.current,required:c,disabled:l,name:u,value:d,form:f,...t,tabIndex:-1,ref:h,style:{...t.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});et.displayName=$e;function tt(e){return typeof e==`function`}function Q(e){return e===`indeterminate`}function nt(e){return Q(e)?`indeterminate`:e?`checked`:`unchecked`}var $=q.forwardRef((e,t)=>{let n=(0,K.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=A(`peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,J.jsx)(Qe,{className:A(`flex items-center justify-center text-current`),children:(0,J.jsx)(B,{className:`h-4 w-4`})}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,J.jsx)(Z,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});$.displayName=Z.displayName;function rt(e){let t=/^[^:]+:\s+(.+)$/.exec(e);return(t?t[1]:e).trim()}function it(e){return[ye(e.id),e.name,rt(e.name)]}function at(e,t){let n=new Set(t.map(e=>e.toLowerCase()));return it(e).some(e=>n.has(e.toLowerCase()))}function ot(e,t){return e.filter(e=>at(e,t)).map(e=>e.id)}var st=`rounded-full border-0 px-3 data-[state=on]:bg-foreground data-[state=on]:text-background data-[state=on]:shadow-sm dark:data-[state=on]:bg-background dark:data-[state=on]:text-foreground`;function ct({provider:e,onModelsChange:t,isLoading:n,disabled:r,displayMode:i=`grid`,autoSelectRecommended:o=!1}){let[s,c]=(0,q.useState)([]),[l,u]=(0,q.useState)(new Set),[d,f]=(0,q.useState)(new Set),[p,m]=(0,q.useState)(new Map),[h,v]=(0,q.useState)(!1),[b,T]=(0,q.useState)(``),[E,D]=(0,q.useState)(`alphabetical`);(0,q.useEffect)(()=>{O()},[e]);let O=async()=>{v(!0),T(``),D(`alphabetical`);try{let t=await _(e);c(t.models);let n=new Set(t.enabledModelIds);u(n);let r=new Map,i=new Set;if(o)try{let{models:e}=await a();i=new Set(ot(t.models,e)),r=new Map([...i].filter(e=>!n.has(e)).map(e=>[e,!0]))}catch(e){console.error(`Failed to load recommended models:`,e)}f(i),m(r),k(n,r,t.models)}catch(t){console.error(`Failed to load models for ${e}:`,t),c([]),u(new Set),f(new Set)}finally{v(!1)}},k=(e,n,r=s)=>{let i=new Set(e);r.forEach(e=>{n.has(e.id)&&(n.get(e.id)?i.add(e.id):i.delete(e.id))}),t?.(i)},ee=e=>{m(t=>{let n=new Map(t),r=l.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),k(l,n),n})},te=e=>{m(t=>{let n=new Map(t);return s.forEach(t=>{let r=l.has(t.id);e?r?n.delete(t.id):n.set(t.id,!0):r?n.set(t.id,!1):n.delete(t.id)}),k(l,n),n})},M=e=>ye(e.id);function N(e,t=p){let n=t.has(e),r=t.get(e);return n?!!r:l.has(e)}let P=s.filter(e=>{let t=b.toLowerCase(),n=M(e);return e.name.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||n.toLowerCase().includes(t)}).sort((e,t)=>{let n=+!N(e.id),r=+!N(t.id);if(n!==r)return n-r;if(E===`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(E===`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}return M(e).localeCompare(M(t))}),I=E===`alphabetical`?`alphabetical`:`price`;function L(e){if(e===`alphabetical`){D(`alphabetical`);return}e===`price`&&D(`price-low`)}function R(){E!==`alphabetical`&&D(e=>e===`price-low`?`price-high`:`price-low`)}return h||n?(0,J.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,J.jsx)(W,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):s.length===0?(0,J.jsx)(`div`,{className:`text-center py-8`,children:(0,J.jsx)(`p`,{className:H.bodyMuted,children:`No models available for this provider.`})}):i===`compact`?(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,J.jsxs)(`div`,{className:A(`flex items-center justify-between gap-3`,r&&`opacity-25`),children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,J.jsx)($,{id:`select-all-models`,disabled:r,checked:s.every(e=>N(e.id)),onCheckedChange:e=>te(e===!0)}),(0,J.jsx)(`label`,{htmlFor:`select-all-models`,className:A(H.body,`cursor-pointer`),children:`Select all models`})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,J.jsxs)(`div`,{className:`relative w-44 sm:w-52`,children:[(0,J.jsx)(y,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,J.jsx)(C,{placeholder:`Search models...`,value:b,onChange:e=>T(e.target.value),disabled:r,className:`pl-8 h-9`})]}),(0,J.jsxs)(F,{type:`single`,value:I,onValueChange:L,"aria-label":`Sort models`,variant:`outline`,className:`inline-flex rounded-full border bg-muted/40 p-1`,children:[(0,J.jsx)(z,{value:`alphabetical`,"aria-label":`Sort A–Z`,disabled:r,className:st,children:(0,J.jsx)(w,{className:`h-4 w-4`})}),(0,J.jsx)(z,{value:`price`,"aria-label":`Sort by price`,disabled:r,className:st,onClick:R,children:(0,J.jsx)(g,{className:`h-4 w-4`})})]})]})]}),(0,J.jsx)(S,{children:(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:P.length===0?(0,J.jsx)(`div`,{className:`text-center py-4`,children:(0,J.jsx)(`p`,{className:H.bodyMuted,children:b?`No models match your search.`:`No models available.`})}):P.map(e=>{let t=N(e.id),n=e.pricing,i=t&&d.has(e.id);return(0,J.jsxs)(V,{children:[(0,J.jsx)(ne,{asChild:!0,children:(0,J.jsxs)(`div`,{className:A(`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0`,r&&`opacity-25`),children:[(0,J.jsx)($,{id:e.id,disabled:r,checked:t??!1,onCheckedChange:()=>ee(e.id),className:`mt-0`}),(0,J.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,J.jsxs)(`label`,{htmlFor:e.id,className:A(H.body,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate flex-1 w-0`),children:[M(e),i&&(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:` (Recommended)`})]}),n&&(0,J.jsx)(`span`,{className:A(H.compact,`text-muted-foreground whitespace-nowrap flex-shrink-0`),children:(n.prompt??0)<=0&&(n.completion??0)<=0?`Free`:`${x(n.prompt??0)} in | ${x(n.completion??0)} out`})]})]})}),e.description&&(0,J.jsx)(j,{side:`top`,className:`max-w-xs`,children:(0,J.jsx)(`p`,{className:H.body,children:e.description})})]},e.id)})})})]}):null}var lt=t({OnboardingDialog:()=>ut,default:()=>ut});function ut({open:e,onOpenChange:t,onComplete:n}){let[r,a]=(0,q.useState)(`git-check`),[o,c]=(0,q.useState)(null),[l,d]=(0,q.useState)(!1),[m,g]=(0,q.useState)([]),[y,b]=(0,q.useState)(null),[x,S]=(0,q.useState)(``),[C,w]=(0,q.useState)({}),[T,O]=(0,q.useState)(!1),[j,N]=(0,q.useState)(``),[P,F]=(0,q.useState)(new Set),[ne,L]=(0,q.useState)(!1),[R,z]=(0,q.useState)(!1);(0,q.useEffect)(()=>{e&&r===`git-check`&&V()},[e,r]),(0,q.useEffect)(()=>{e&&r===`provider-selection`&&m.length===0&&ie()},[e,r,m.length]),(0,q.useEffect)(()=>{e&&r===`model-selection`&&y&&ae()},[e,r,y]);let V=async()=>{d(!0);try{let e=await E();c(e.gitInstalled),e.gitInstalled&&a(`provider-selection`)}catch(e){console.error(`Failed to check git installation:`,e),c(!1)}finally{d(!1)}},ie=async()=>{try{let e=await p();if(g(e),e.length>0&&!y){let t=Fe(e);t&&(b(t),S(t.apiKey??``),w(t.envValues??{}))}}catch(e){console.error(`Failed to load providers:`,e)}},ae=async()=>{if(y){L(!0);try{await _(y.name),F(new Set)}catch(e){console.error(`Failed to load models:`,e)}finally{L(!1)}}},ce=async()=>{if(!y||!x.trim()){N(`Please enter an API key`);return}let e=Ae(y),t=e.find(e=>!C[e]?.trim());if(t){N(`Please enter ${je(t)}`);return}O(!0),N(``);try{e.length>0&&await re(Object.fromEntries(e.map(e=>[e,C[e].trim()]))),await te(y.slug,x),a(`model-selection`)}catch(e){N(e instanceof Error?e.message:`Failed to validate API key`)}finally{O(!1)}},le=async()=>{if(y){z(!0);try{for(let e of P)await ue(y.slug,e);await k(),n?.(),t(!1)}catch(e){console.error(`Failed to complete onboarding:`,e)}finally{z(!1)}}},de=async()=>{z(!0);try{await k(),n?.(),t(!1)}catch(e){console.error(`Failed to skip onboarding:`,e)}finally{z(!1)}},fe=e=>{b(e),S(e.apiKey??``),w(e.envValues??{}),N(``)},pe=(e,t)=>{w(n=>({...n,[e]:t}))};return(0,J.jsx)(se,{open:e,onOpenChange:t,children:(0,J.jsxs)(f,{className:`max-w-2xl h-[min(42rem,90dvh)] flex flex-col p-0 overflow-hidden`,children:[(0,J.jsxs)(`div`,{className:`px-6 pt-6 pb-2`,children:[(0,J.jsxs)(`div`,{className:`w-1/2 mx-auto flex items-center gap-2 mb-6`,children:[(0,J.jsx)(`div`,{className:A(`flex items-center justify-center h-8 w-8 rounded-full`,H.label,r===`git-check`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`1`}),(0,J.jsx)(`div`,{className:A(`h-0.5 flex-1`,r===`provider-selection`||r===`model-selection`?`bg-primary`:`bg-muted`)}),(0,J.jsx)(`div`,{className:A(`flex items-center justify-center h-8 w-8 rounded-full`,H.label,r===`provider-selection`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`2`}),(0,J.jsx)(`div`,{className:A(`h-0.5 flex-1`,r===`model-selection`?`bg-primary`:`bg-muted`)}),(0,J.jsx)(`div`,{className:A(`flex items-center justify-center h-8 w-8 rounded-full`,H.label,r===`model-selection`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`3`})]}),(0,J.jsxs)(h,{children:[r===`git-check`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(s,{children:`Let's get started`}),(0,J.jsx)(i,{children:`First, we need to check that Git is installed on your system.`})]}),r===`provider-selection`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(s,{children:`Select an AI Provider`}),(0,J.jsx)(i,{children:`Choose your preferred AI provider and enter your API key.`})]}),r===`model-selection`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(s,{children:`Select Models`}),(0,J.jsx)(i,{children:`Choose which models you want to use with this provider.`})]})]})]}),(0,J.jsx)(ee,{className:`flex-1 min-h-0 overflow-hidden`,children:(0,J.jsxs)(`div`,{className:`px-6 py-4`,children:[r===`git-check`&&(0,J.jsx)(`div`,{className:`space-y-4`,children:l?(0,J.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,J.jsx)(W,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):o?(0,J.jsxs)(G,{variant:`success`,className:`mb-0 flex items-start gap-3`,children:[(0,J.jsx)(B,{className:`h-5 w-5 text-green-600 flex-shrink-0 mt-0.5`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:A(H.label,`text-green-900`),children:`Git is installed`}),(0,J.jsx)(`p`,{className:H.bodyMuted,children:`You're all set to use Git features in Tarsk.`})]})]}):(0,J.jsxs)(G,{variant:`hint`,className:`mb-0 flex items-start gap-3`,children:[(0,J.jsx)(u,{className:`h-5 w-5 text-yellow-600 flex-shrink-0 mt-0.5`}),(0,J.jsxs)(`div`,{className:`flex-1`,children:[(0,J.jsx)(`p`,{className:H.label,children:`Git is not installed`}),(0,J.jsx)(`p`,{className:H.bodyMuted,children:`Git is required for some features in Tarsk. You can continue without it, but we recommend installing it.`}),(0,J.jsxs)(`a`,{href:`https://git-scm.com/downloads`,target:`_blank`,rel:`noreferrer`,className:A(H.caption,`text-brand hover:underline mt-2 inline-flex items-center gap-1`),children:[`Download Git `,(0,J.jsx)(v,{className:`h-3 w-3`})]})]})]})}),r===`provider-selection`&&(0,J.jsxs)(`div`,{className:`space-y-4`,children:[(0,J.jsx)(Ue,{selectedProvider:y,onProviderChange:fe,showApiKeyInput:!0,apiKey:x,onApiKeyChange:S,variant:`dropdown`,isLoading:T}),y&&Ae(y).map(e=>(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(U,{htmlFor:e,children:je(e)}),(0,J.jsx)(`input`,{id:e,value:C[e]??``,onChange:t=>pe(e,t.target.value),className:`h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base`,placeholder:D(y.slug)&&e===`LOCAL_API_URL`?y.api:e,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`}),y.slug===`azure`&&e===Oe(y)||D(y.slug)&&e===`LOCAL_API_URL`?(0,J.jsx)(`p`,{className:A(H.bodyMuted,`break-all`),children:Me(y,C)||y.api}):null]},e)),j&&(0,J.jsx)(G,{variant:`error`,className:`mb-0`,children:j})]}),r===`model-selection`&&y&&(0,J.jsx)(`div`,{className:`space-y-4`,children:(0,J.jsx)(ct,{provider:y.slug,isLoading:ne,displayMode:`compact`,disabled:!1,autoSelectRecommended:!0,onModelsChange:F})})]})}),(0,J.jsx)(`div`,{className:`px-6 py-4 border-t border-border bg-muted/10`,children:(0,J.jsxs)(oe,{className:`flex items-center justify-between`,children:[(0,J.jsx)(`div`,{children:r===`provider-selection`&&(0,J.jsx)(I,{variant:`ghost`,onClick:()=>de(),disabled:R,children:`Skip for now`})}),(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[r!==`git-check`&&(0,J.jsx)(I,{variant:`outline`,onClick:()=>{r===`provider-selection`?a(`git-check`):r===`model-selection`&&a(`provider-selection`)},disabled:R,children:`Back`}),r===`git-check`&&(0,J.jsxs)(I,{onClick:()=>{a(`provider-selection`)},disabled:l,className:`gap-2`,children:[`Continue `,(0,J.jsx)(M,{className:`h-4 w-4`})]}),r===`provider-selection`&&(0,J.jsx)(I,{onClick:ce,disabled:T||!x.trim()||!y,className:`gap-2`,children:T?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(W,{className:`h-4 w-4 animate-spin`}),`Validating...`]}):(0,J.jsxs)(J.Fragment,{children:[`Next `,(0,J.jsx)(M,{className:`h-4 w-4`})]})}),r===`model-selection`&&(0,J.jsx)(I,{onClick:le,disabled:R,className:`gap-2`,children:R?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(W,{className:`h-4 w-4 animate-spin`}),`Finishing...`]}):(0,J.jsxs)(J.Fragment,{children:[`Finish `,(0,J.jsx)(B,{className:`h-4 w-4`})]})})]})]})})]})})}export{Ae as a,Ee as c,je as i,ye as l,$ as n,Oe as o,Le as r,Me as s,lt as t,ve as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ai as t,Ci as n,Cn as r,Ti as i,_n as a,bn as o,br as s,gt as ee,ii as c,ki as l,mo as u,mt as te,ni as d,ra as ne,vi as f,vn as re,vr as p,wn as ie,xn as ae,ya as m}from"./dialogs-config-B4TDFSrS.js";import{ct as oe}from"./react-vendor-unlDVFpU.js";import{n as se}from"./onboarding-DfL8a0LZ.js";import{D as ce,E as le,S as ue,T as de,b as h}from"./history-view-Ds_0e_bx.js";import{E as g,O as _}from"./index-DOsSr4dl.js";import{n as v,t as fe}from"./radio-group-c0sU992r.js";var y=e(u(),1),b=i();function x({projectId:e,onProjectUpdated:i}){let u=oe(),[x,S]=(0,y.useState)(``),[C,w]=(0,y.useState)(``),[T,E]=(0,y.useState)(``),[D,O]=(0,y.useState)(n.PullRequest),[k,A]=(0,y.useState)(``),[j,M]=(0,y.useState)(!1),[N,P]=(0,y.useState)(!1),[F,I]=(0,y.useState)(!1),[L,R]=(0,y.useState)(``),[pe,z]=(0,y.useState)(``),[me,B]=(0,y.useState)(``),[he,V]=(0,y.useState)(``),[ge,H]=(0,y.useState)(n.PullRequest),[U,W]=(0,y.useState)(!0),[G,K]=(0,y.useState)([]),[_e,q]=(0,y.useState)(!0),[ve,J]=(0,y.useState)([]),[Y,X]=(0,y.useState)([]),[Z,Q]=(0,y.useState)([]),$=(0,y.useCallback)(async()=>{if(e){I(!0);try{let t=await te(e),r=await ee(e),i=t.name??``,a=t.setupScript??``,o=t.validationScript??``,s=t.runCommand??``,c=t.commitMethod??n.PullRequest,l=t.allowAllCommands!==!1,u=t.allowedCommandPatterns??[],d=r.vars.map(e=>({name:e.name,value:``,hasExistingValue:e.hasValue}));S(i),w(a),A(o),E(s),O(c),W(l),K(u),X(d),R(i),z(a),B(o),V(s),H(c),q(l),J(u),Q(d)}catch(e){g({title:`Error`,description:e instanceof Error?e.message:`Failed to load project settings`,variant:`destructive`})}finally{I(!1)}}},[e]);(0,y.useEffect)(()=>{$()},[$]);function ye(){X(e=>[...e,{name:``,value:``,hasExistingValue:!1}])}function be(e,t){X(n=>n.map((n,r)=>r===e?{...n,name:t.toUpperCase()}:n))}function xe(e,t){X(n=>n.map((n,r)=>r===e?{...n,value:t}:n))}function Se(e){X(t=>t.filter((t,n)=>n!==e))}function Ce(){if(Y.length!==Z.length)return!0;for(let e=0;e<Y.length;e+=1){let t=Y[e],n=Z[e];if(!n||t.name!==n.name||t.value!==n.value||t.hasExistingValue!==n.hasExistingValue)return!0}return!1}return e?(0,b.jsx)(ce,{children:(0,b.jsxs)(le,{children:[(0,b.jsx)(ue,{title:`Project Settings`,description:`Configure settings for your project.`,action:(0,b.jsx)(d,{onClick:async()=>{if(e){M(!0);try{if(x!==L&&await ae(e,x),C!==pe&&await r(e,C.trim()||null,!1),k!==me&&await o(e,{validationScript:k.trim()||null}),T!==he&&await ie(e,T.trim()||null),D!==ge&&await o(e,{commitMethod:D}),(U!==_e||JSON.stringify(G)!==JSON.stringify(ve))&&await o(e,{allowAllCommands:U,allowedCommandPatterns:G}),Ce()){let t=Y.map(e=>({name:e.name.trim(),value:e.value,hasExistingValue:e.hasExistingValue})).filter(e=>e.name.length>0),n=t.find((e,n)=>t.findIndex(t=>t.name===e.name)!==n);if(n)throw Error(`Duplicate environment variable name: ${n.name}`);let r=t.find(e=>!e.hasExistingValue&&!e.value.trim());if(r)throw Error(`Value is required for environment variable: ${r.name}`);await re(e,t.map(e=>({name:e.name,value:e.value.trim()||void 0})))}R(x),z(C),B(k),V(T),H(D),q(U),J(G),Q(Y.map(e=>({...e,value:``}))),i&&await i(),await $(),g({title:`Success`,description:`Project settings saved`}),u(`/`)}catch(e){g({title:`Error`,description:e instanceof Error?e.message:`Failed to save settings`,variant:`destructive`})}finally{M(!1)}}},disabled:j||F,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(m,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):F?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(m,{className:`mr-2 h-4 w-4 animate-spin`}),`Loading...`]}):`Save`})}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(h,{title:`Project Name`,children:(0,b.jsx)(s,{id:`projectName`,value:x,onChange:e=>S(e.target.value),placeholder:`Enter project name`,disabled:F})}),(0,b.jsx)(h,{title:`Setup Script`,description:`This script runs automatically after cloning the repo for new threads.`,children:(0,b.jsx)(_,{id:`setupScript`,value:C,onChange:e=>w(e.target.value),placeholder:`e.g. npm install`,className:`font-mono min-h-[80px] resize-none`,disabled:F})}),(0,b.jsx)(h,{title:`Validation Script`,description:`This script runs after each chat response. If it fails, Tarsk will try to fix issues automatically up to the retry limit.`,children:(0,b.jsx)(_,{id:`validationScript`,value:k,onChange:e=>A(e.target.value),placeholder:`e.g. npm run lint && npm test`,className:`font-mono min-h-[80px] resize-none`,disabled:F})}),(0,b.jsx)(h,{title:`Run Command`,description:`The command to start the dev server. Leave empty to disable run functionality.`,action:(0,b.jsx)(d,{variant:`ghost`,size:`sm`,onClick:async()=>{if(e){P(!0);try{let t=await a(e);t.runCommand?(E(t.runCommand),g({title:`Success`,description:`Suggested: ${t.runCommand}`})):g({title:`No command found`,description:`Could not detect a dev script in package.json`})}catch(e){g({title:`Error`,description:e instanceof Error?e.message:`Failed to suggest command`,variant:`destructive`})}finally{P(!1)}}},disabled:N||F,children:N?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(m,{className:`h-3 w-3 animate-spin`}),`Suggesting...`]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l,{className:`h-3 w-3`}),`Suggest`]})}),children:(0,b.jsx)(s,{id:`runCommand`,value:T,onChange:e=>E(e.target.value),placeholder:`e.g. npm run dev`,className:`font-mono`,disabled:F})}),(0,b.jsx)(h,{title:`Commit Method`,description:D===n.PullRequest?`Feature branches are created and pull requests can be created.`:`Commits are made directly to the main branch without feature branches.`,children:(0,b.jsxs)(fe,{value:D,onValueChange:e=>O(e),className:`flex gap-4`,disabled:F,children:[(0,b.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,b.jsx)(v,{value:n.PullRequest,id:`commit-pr`}),(0,b.jsx)(p,{htmlFor:`commit-pr`,className:c(f.labelNormal,`cursor-pointer`),children:`Pull Requests`})]}),(0,b.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,b.jsx)(v,{value:n.Direct,id:`commit-direct`}),(0,b.jsx)(p,{htmlFor:`commit-direct`,className:c(f.labelNormal,`cursor-pointer`),children:`Direct Commits`})]})]})}),(0,b.jsxs)(h,{title:`Confirm Commands`,description:`When checked, the agent asks for approval before running bash commands, skill scripts, and browser shell calls.`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(se,{id:`confirmCommands`,checked:!U,onCheckedChange:e=>W(e!==!0),disabled:F}),(0,b.jsx)(p,{htmlFor:`confirmCommands`,className:f.labelNormal,children:`Require approval for bash commands, skill scripts, and browser shell calls`})]}),!U&&G.length>0&&(0,b.jsxs)(`div`,{className:`space-y-2 mt-3`,children:[(0,b.jsx)(p,{children:`Allowed command patterns`}),(0,b.jsx)(`ul`,{className:`space-y-1`,children:G.map(e=>(0,b.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-border px-3 py-2`,children:[(0,b.jsx)(`code`,{className:c(f.mono,f.bodyMuted),children:e}),(0,b.jsx)(d,{type:`button`,variant:`ghost`,size:`sm`,disabled:F||j,onClick:()=>K(t=>t.filter(t=>t!==e)),children:`Remove`})]},e))})]})]}),(0,b.jsx)(h,{title:`Environment Variables`,description:`Stored encrypted in the Tarsk database and injected when the agent runs bash commands or MCP tools.`,action:(0,b.jsxs)(d,{variant:`ghost`,size:`sm`,onClick:ye,disabled:F,children:[(0,b.jsx)(ne,{className:`h-3 w-3 mr-1`}),`Add variable`]}),children:Y.length===0?(0,b.jsx)(`p`,{className:f.caption,children:`No environment variables configured`}):(0,b.jsx)(`div`,{className:`flex flex-col gap-2`,children:Y.map((e,n)=>(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(s,{placeholder:`API_KEY`,value:e.name,onChange:e=>be(n,e.target.value),className:`font-mono w-[35%]`,disabled:F}),(0,b.jsx)(s,{type:`password`,placeholder:e.hasExistingValue?`••••••••`:`value`,value:e.value,onChange:e=>xe(n,e.target.value),className:`font-mono flex-1`,disabled:F}),(0,b.jsx)(d,{variant:`ghost`,size:`icon`,onClick:()=>Se(n),className:`h-9 w-9 flex-shrink-0`,disabled:F||j,children:(0,b.jsx)(t,{className:`h-3.5 w-3.5`})})]},n))})})]})]})}):(0,b.jsx)(de,{title:`No project selected`,children:`Please select a project from the sidebar to view its settings.`})}export{x as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$i as t,B as n,Ba as r,Cr as i,Da as a,Er as o,Ga as s,Hi as c,I as l,L as u,R as d,Sa as f,Sr as p,St as m,Ti as h,Ua as g,V as _,Va as v,Y as y,Zi as b,ai as x,ao as S,ar as C,br as w,bt as ee,ci as te,do as ne,fi as re,fo as ie,hr as ae,ii as T,in as oe,ir as E,mo as se,ni as D,or as O,rn as ce,rr as k,vi as A,xr as j,xt as le,ya as ue,z as de,za as fe}from"./dialogs-config-B4TDFSrS.js";import{a as pe,i as me,l as he,n as M,o as ge,r as _e,s as ve}from"./onboarding-DfL8a0LZ.js";import{C as N,D as P,E as F,S as ye,T as be,a as xe,b as Se,i as Ce,n as I,o as L,r as R,x as z,y as we}from"./history-view-Ds_0e_bx.js";import{c as Te,l as Ee,s as De,u as Oe}from"./index-DOsSr4dl.js";import{t as B}from"./skeleton-BvSNJL9q.js";var V=ie(),H=e(se(),1),U=h(),W=te(T(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 G(e){let t=(0,V.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=T(W({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,U.jsx)(`div`,{className:a,...r}),t[7]=r,t[8]=a,t[9]=o):o=t[9],o}function ke({selectedProviderName:e,providerData:i,className:a}){let[o,s]=(0,H.useState)(null),[p,h]=(0,H.useState)(``),[v,y]=(0,H.useState)(!1),[S,te]=(0,H.useState)(null),[ie,se]=(0,H.useState)(``),[j,le]=(0,H.useState)([]),[P,F]=(0,H.useState)(new Set),[xe,Ce]=(0,H.useState)(new Set),[I,L]=(0,H.useState)(new Map),[R,B]=(0,H.useState)(``),[V,W]=(0,H.useState)(`alphabetical`),[G,ke]=(0,H.useState)(`all`),[K,Ae]=(0,H.useState)(!1),[q,J]=(0,H.useState)(``),[je,Me]=(0,H.useState)(``),[Ne,Pe]=(0,H.useState)(`coding`),[Y,Fe]=(0,H.useState)([]),[X,Z]=(0,H.useState)(new Set),[Ie,Le]=(0,H.useState)(new Set),[Re,ze]=(0,H.useState)(new Map),[Be,Ve]=(0,H.useState)({}),Q=e=>he(e.id);(0,H.useEffect)(()=>{(async()=>{if(se(``),i&&i.name===e){s(i),Me(i.apiKey??``),h(i.apiKey??``),Ve(i.envValues??{}),Ue(i.slug),He(i.slug);return}try{let t=await m();if(e){let n=t.find(t=>t.name===e);s(n??null),Me(n?.apiKey??``),h(n?.apiKey??``),Ve(n?.envValues??{}),n&&(Ue(n.slug),He(n.slug))}}catch(e){se(e instanceof Error?e.message:`Failed to load providers`)}})()},[e,i]);let He=async e=>{te(null);try{let t=await ee(e);t.status===`success`&&te(t.balance)}catch(t){console.error(`Failed to load balance for ${e}:`,t)}},Ue=async e=>{y(!0),B(``),W(`alphabetical`),ke(`all`),Pe(`coding`);try{let[t,r]=await Promise.all([_(e),n(e)]);le(t.models),Fe(r.models);let i=new Set(t.enabledModelIds);F(i),Ce(i);let a=new Set(r.enabledModelIds);Z(a),Le(a),L(new Map),ze(new Map)}catch(t){console.error(`Failed to load models for ${e}:`,t),le([]),Fe([]),F(new Set),Ce(new Set),Z(new Set),Le(new Set)}finally{y(!1)}},We=(e,t)=>{o?.name===e&&(h(t),Ke(t))},Ge=(e,t)=>{Ve(n=>({...n,[e]:t})),o&&(async()=>{try{await ce({[e]:t}),J(`${me(e)} saved successfully`),setTimeout(()=>J(``),3e3)}catch(e){J(e instanceof Error?e.message:`Failed to save provider settings`)}})()},Ke=async e=>{if(!(!o||e===je))try{await oe(o.slug,e),Me(e),J(`API key saved successfully`),setTimeout(()=>J(``),3e3)}catch(e){J(e instanceof Error?e.message:`Failed to save API key`)}},qe=(e,t)=>{t===`image`?ze(t=>{let n=new Map(t),r=X.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),Je(e,(n.has(e)?n.get(e):r)??!1,`image`),n}):L(t=>{let n=new Map(t),r=P.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),Je(e,(n.has(e)?n.get(e):r)??!1,`coding`),n})},Je=async(e,t,n=`coding`)=>{if(o)try{n===`image`?(t?(await d(o.slug,e),Z(t=>new Set([...t,e]))):(await l(o.slug,e),Z(t=>{let n=new Set(t);return n.delete(e),n})),ze(t=>{let n=new Map(t);return n.delete(e),n})):(t?(await de(o.slug,e),F(t=>new Set([...t,e]))):(await u(o.slug,e),F(t=>{let n=new Set(t);return n.delete(e),n})),L(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 Ye(e,t=`coding`){let n=t===`image`?Y:j,r=t===`image`?X:P;(t===`image`?ze:L)(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 Je(i.id,e,t)}let $=p!==void 0&&p.trim().length>0,Xe=e=>e.pricing?((e.pricing.prompt??0)+(e.pricing.completion??0))/2:null,Ze=e=>e?e<20?1:e<30?2:e<40?3:e<50?4:5:0,Qe=({codingIndex:e,modelName:t})=>{let n=Ze(e);return n===0?null:(0,U.jsx)(C,{children:(0,U.jsxs)(k,{children:[(0,U.jsx)(O,{asChild:!0,children:(0,U.jsx)(`div`,{className:`flex items-center gap-0.5`,children:[1,2,3,4,5].map(e=>(0,U.jsx)(c,{className:`h-3 w-3 ${e<=n?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},e))})}),(0,U.jsx)(E,{children:(0,U.jsxs)(`p`,{className:A.body,children:[t,` was indexed `,e,` for coding intelligence`]})})]})})},$e=j.filter(e=>{let t=R.toLowerCase(),n=Q(e),r=e.name.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||n.toLowerCase().includes(t);if(G===`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=+!xe.has(e.id),a=+!xe.has(t.id);if(i!==a)return i-a;if(V===`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(V===`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(V===`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(V===`intelligence-by-price`){let n=Ze(e.coding_index),r=Ze(t.coding_index),i=n>0;if(i!==r>0)return i?-1:1;if(r!==n)return r-n;let a=Xe(e),o=Xe(t),s=a!==null;return s===(o!==null)?a===null||o===null?0:a-o:s?-1:1}return Q(e).localeCompare(Q(t))}),et=Y.filter(e=>{let t=R.toLowerCase(),n=Q(e),r=e.name.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||n.toLowerCase().includes(t);if(G===`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=+!Ie.has(e.id),a=+!Ie.has(t.id);if(i!==a)return i-a;if(V===`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(V===`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 ie?(0,U.jsxs)(`div`,{className:T(`flex flex-1 flex-col items-center justify-center gap-4 p-6`,a),children:[(0,U.jsx)(z,{variant:`error`,className:`mb-0`,children:ie}),(0,U.jsx)(D,{variant:`outline`,size:`sm`,onClick:()=>window.location.reload(),children:`Retry`})]}):o?(0,U.jsx)(ae,{className:T(`flex-1`,a),children:(0,U.jsxs)(we,{children:[(0,U.jsx)(ye,{title:`${o.name} Settings`,description:`Configure API keys and models for this provider.`}),(0,U.jsxs)(`div`,{className:`space-y-6`,children:[(0,U.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,U.jsxs)(`div`,{className:`flex items-center justify-between min-h-[20px]`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:S===null?(0,U.jsx)(`div`,{className:`h-[20px] w-[1px]`}):(0,U.jsxs)(`span`,{className:T(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,U.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-green-500`}),`$`,x(S),` `,`balance`]})}),o.url?(0,U.jsx)(_e,{url:o.url,className:T(A.compact,`p-3`)}):(0,U.jsx)(`div`,{className:`h-[20px] w-[1px]`})]})}),(0,U.jsx)(Se,{title:`API Key`,description:`Your API key is stored locally and never shared.`,children:o.authType===`APIKey`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(f,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,U.jsx)(w,{type:K?`text`:`password`,placeholder:o.keyName||`Enter API Key`,className:`pl-10 pr-10`,value:p,onChange:e=>{We(o.name,e.target.value)}}),(0,U.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:()=>Ae(!K),disabled:!p,children:K?(0,U.jsx)(r,{className:`h-4 w-4 text-muted-foreground`}):(0,U.jsx)(fe,{className:`h-4 w-4 text-muted-foreground`})})]}),(0,U.jsx)(`div`,{className:`space-y-4 mt-4`,children:pe(o).map(e=>(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(C,{children:(0,U.jsxs)(k,{children:[(0,U.jsx)(O,{asChild:!0,children:(0,U.jsx)(`span`,{className:T(A.label,`cursor-help`),children:me(e)})}),(0,U.jsx)(E,{children:e})]})}),(0,U.jsx)(w,{id:e,value:Be[e]??``,onChange:t=>Ge(e,t.target.value),placeholder:re(o.slug)&&e===`LOCAL_API_URL`?o.api:e,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`}),o.slug===`azure`&&e===ge(o)||re(o.slug)&&e===`LOCAL_API_URL`?(0,U.jsx)(`p`,{className:T(A.caption,`break-all`),children:ve(o,Be)||o.api}):null]},e))})]}):(0,U.jsxs)(`div`,{className:`space-y-2 text-center`,children:[(0,U.jsx)(z,{className:`mb-0`,children:`This provider uses OAuth for authentication.`}),(0,U.jsxs)(D,{variant:`outline`,size:`sm`,disabled:!0,children:[`Sign in with `,o.name]})]})}),(0,U.jsx)(N,{title:`Models`}),(0,U.jsxs)(De,{value:Ne,onValueChange:e=>{Pe(e),B(``),W(`alphabetical`)},children:[(0,U.jsxs)(Ee,{className:`mb-4`,children:[(0,U.jsx)(Oe,{value:`coding`,children:`Coding`}),o?.name.toLowerCase()===`openrouter`&&(0,U.jsx)(Oe,{value:`image`,children:`Image`})]}),(0,U.jsx)(Te,{value:`coding`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[!v&&j.length>0&&(0,U.jsxs)(`div`,{className:T(`flex items-center justify-between gap-3`,!$&&`opacity-25`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,U.jsx)(M,{id:`select-all-models`,disabled:!$,checked:j.every(e=>{let t=I.has(e.id),n=I.get(e.id);return t?n:P.has(e.id)}),onCheckedChange:e=>{Ye(e===!0,`coding`)}}),(0,U.jsx)(`label`,{htmlFor:`select-all-models`,className:T(A.body,`whitespace-nowrap`,$?`cursor-pointer`:`cursor-not-allowed`),children:`Select all models`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 justify-end`,children:[(0,U.jsxs)(`div`,{className:`relative w-44 sm:w-52 flex-shrink-0`,children:[(0,U.jsx)(b,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,U.jsx)(w,{placeholder:`Search models...`,className:`pl-10 h-8`,value:R,onChange:e=>B(e.target.value),disabled:!$})]}),(0,U.jsx)(C,{children:(0,U.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5 flex-shrink-0`,children:[(0,U.jsxs)(k,{children:[(0,U.jsx)(O,{asChild:!0,children:(0,U.jsx)(D,{type:`button`,variant:V===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>W(`alphabetical`),children:(0,U.jsx)(ne,{className:`h-4 w-4`})})}),(0,U.jsx)(E,{children:`Sort A–Z`})]}),(0,U.jsxs)(k,{children:[(0,U.jsx)(O,{asChild:!0,children:(0,U.jsx)(D,{type:`button`,variant:V===`price-low`||V===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>W(`price-low`),children:(0,U.jsx)(g,{className:`h-4 w-4`})})}),(0,U.jsx)(E,{children:`Sort by price`})]}),(0,U.jsxs)(k,{children:[(0,U.jsx)(O,{asChild:!0,children:(0,U.jsx)(D,{type:`button`,variant:V===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>W(`coding-index`),children:(0,U.jsx)(c,{className:`h-4 w-4`})})}),(0,U.jsx)(E,{children:`Sort by coding intelligence`})]}),(0,U.jsxs)(k,{children:[(0,U.jsx)(O,{asChild:!0,children:(0,U.jsx)(D,{type:`button`,variant:V===`intelligence-by-price`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>W(`intelligence-by-price`),children:(0,U.jsx)(t,{className:`h-4 w-4`})})}),(0,U.jsx)(E,{children:`Sort by Price/Intelligence`})]})]})})]})]}),v?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,U.jsx)(ue,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):j.length===0?(0,U.jsx)(`div`,{className:`text-center py-8`,children:(0,U.jsx)(`p`,{className:A.bodyMuted,children:`No models available for this provider.`})}):(0,U.jsx)(C,{children:(0,U.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:$e.length===0?(0,U.jsx)(`div`,{className:`text-center py-8`,children:(0,U.jsx)(`p`,{className:A.bodyMuted,children:`No models matching your filters.`})}):$e.map(e=>{let t=P.has(e.id),n=I.has(e.id),r=I.get(e.id),i=n?r:t,a=e.pricing;return(0,U.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,U.jsx)(M,{id:e.id,disabled:!$,checked:i??!1,onCheckedChange:()=>qe(e.id,`coding`),className:`mt-0`}),(0,U.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,U.jsx)(`label`,{htmlFor:e.id,className:T(A.body,`leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:Q(e)})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(V===`coding-index`||V===`intelligence-by-price`)&&(0,U.jsx)(Qe,{codingIndex:e.coding_index,modelName:Q(e)}),a&&(0,U.jsx)(`span`,{className:T(A.caption,`whitespace-nowrap`),children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${x(a.prompt??0)} in | $${x(a.completion??0)} out`})]})]})]},e.id)})})})]})}),(0,U.jsx)(Te,{value:`image`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[!v&&Y.length>0&&(0,U.jsxs)(`div`,{className:T(`flex items-center justify-between gap-3`,!$&&`opacity-25`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,U.jsx)(M,{id:`select-all-image-models`,disabled:!$,checked:Y.every(e=>{let t=Re.has(e.id),n=Re.get(e.id);return t?n:X.has(e.id)}),onCheckedChange:e=>{Ye(e===!0,`image`)}}),(0,U.jsx)(`label`,{htmlFor:`select-all-image-models`,className:T(A.body,`whitespace-nowrap`,$?`cursor-pointer`:`cursor-not-allowed`),children:`Select all models`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 justify-end`,children:[(0,U.jsxs)(`div`,{className:`relative w-44 sm:w-52 flex-shrink-0`,children:[(0,U.jsx)(b,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,U.jsx)(w,{placeholder:`Search models...`,className:`pl-10 h-8`,value:R,onChange:e=>B(e.target.value),disabled:!$})]}),(0,U.jsx)(C,{children:(0,U.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5 flex-shrink-0`,children:[(0,U.jsxs)(k,{children:[(0,U.jsx)(O,{asChild:!0,children:(0,U.jsx)(D,{type:`button`,variant:V===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>W(`alphabetical`),children:(0,U.jsx)(ne,{className:`h-4 w-4`})})}),(0,U.jsx)(E,{children:`Sort A–Z`})]}),(0,U.jsxs)(k,{children:[(0,U.jsx)(O,{asChild:!0,children:(0,U.jsx)(D,{type:`button`,variant:V===`price-low`||V===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>W(`price-low`),children:(0,U.jsx)(g,{className:`h-4 w-4`})})}),(0,U.jsx)(E,{children:`Sort by price`})]})]})})]})]}),v?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,U.jsx)(ue,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):Y.length===0?(0,U.jsx)(`div`,{className:`text-center py-8`,children:(0,U.jsx)(`p`,{className:A.bodyMuted,children:`No image models available for this provider.`})}):(0,U.jsx)(C,{children:(0,U.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:et.length===0?(0,U.jsx)(`div`,{className:`text-center py-8`,children:(0,U.jsx)(`p`,{className:A.bodyMuted,children:`No models matching your filters.`})}):et.map(e=>{let t=X.has(e.id),n=Re.has(e.id),r=Re.get(e.id),i=n?r:t,a=e.pricing;return(0,U.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,U.jsx)(M,{id:`image-${e.id}`,disabled:!$,checked:i??!1,onCheckedChange:()=>qe(e.id,`image`),className:`mt-0`}),(0,U.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,U.jsx)(`label`,{htmlFor:`image-${e.id}`,className:T(A.label,`leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:Q(e)})}),a&&(0,U.jsx)(`span`,{className:T(A.caption,`whitespace-nowrap flex-shrink-0`),children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${x(a.prompt??0)} in | $${x(a.completion??0)} out`})]})]},e.id)})})})]})})]}),q?(0,U.jsx)(z,{variant:q.includes(`error`)||q.includes(`Failed`)?`error`:`success`,children:q}):null]})]})}):(0,U.jsx)(`div`,{className:T(`flex flex-1 items-center justify-center h-screen`,a),children:(0,U.jsx)(be,{title:`Select a Provider`,children:`Choose a provider from the sidebar to configure its settings.`})})}function K(e){let t=(0,V.c)(13),{providerName:n,provider:r,onClose:a}=e,s=n!==null,c;t[0]===a?c=t[1]:(c=e=>{e||a()},t[0]=a,t[1]=c);let l,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,U.jsx)(o,{className:`sr-only`,children:`Provider Setup`}),u=(0,U.jsx)(i,{className:`sr-only`,children:`Configure API keys and models for this provider.`}),t[2]=l,t[3]=u):(l=t[2],u=t[3]);let d;t[4]!==r||t[5]!==n?(d=n&&(0,U.jsx)(ke,{selectedProviderName:n,providerData:r,className:`h-full`}),t[4]=r,t[5]=n,t[6]=d):d=t[6];let f;t[7]===d?f=t[8]:(f=(0,U.jsxs)(p,{className:`max-w-2xl h-[85vh] overflow-hidden p-0`,children:[l,u,d]}),t[7]=d,t[8]=f);let m;return t[9]!==s||t[10]!==c||t[11]!==f?(m=(0,U.jsx)(j,{open:s,onOpenChange:c,children:f}),t[9]=s,t[10]=c,t[11]=f,t[12]=m):m=t[12],m}function Ae(e){return`providers:list:${e}`}async function q(){let[e,t]=await Promise.all([m(),y().catch(()=>({}))]),n={};for(let[e,r]of Object.entries(t))n[e]=r.length;return{providers:e,enabledModelCounts:n}}function J(){let e=(0,V.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.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,U.jsx)(N,{title:`Connected Providers`}),e[1]=n):n=e[1];let r,i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,U.jsxs)(`div`,{children:[n,(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,U.jsx)(B,{className:`h-24 rounded-lg`}),(0,U.jsx)(B,{className:`h-24 rounded-lg`})]})]}),i=(0,U.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,U.jsx)(P,{children:(0,U.jsxs)(F,{children:[t,(0,U.jsxs)(`div`,{className:`space-y-8`,children:[r,(0,U.jsxs)(`div`,{children:[i,(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,U.jsx)(B,{className:`h-24 rounded-lg`}),(0,U.jsx)(B,{className:`h-24 rounded-lg`}),(0,U.jsx)(B,{className:`h-24 rounded-lg`}),(0,U.jsx)(B,{className:`h-24 rounded-lg`})]})]})]})]})}),e[4]=a):a=e[4],a}function je(e){let t=(0,V.c)(40),{loadVersion:n,onProviderClick:r}=e,[i,a]=(0,H.useState)(``),o;t[0]===n?o=t[1]:(o=Ae(n),t[0]=n,t[1]=o);let{providers:s,enabledModelCounts:c}=xe(o,q),l,u,d,f,p,m,h;if(t[2]!==c||t[3]!==r||t[4]!==s||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]===c?n=t[16]:(n=(e,t)=>{let n=(c[e.slug]??0)>0,r=(c[t.slug]??0)>0;return n&&!r?-1:!n&&r?1:e.name.localeCompare(t.name)},t[15]=c,t[16]=n);let o=s.filter(Pe).filter(e).sort(n),g;t[17]===i?g=t[18]:(g=e=>{let t=i.toLowerCase();return e.name.toLowerCase().includes(t)},t[17]=i,t[18]=g);let _=s.filter(Ne).filter(g).sort(Me);u=P,l=F,t[19]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,U.jsx)(ye,{title:`Providers`,description:`Manage your AI provider connections and API keys.`}),t[19]=p):p=t[19];let v;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,U.jsx)(b,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),t[20]=v):v=t[20];let y;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>a(e.target.value),t[21]=y):y=t[21],t[22]===i?m=t[23]:(m=(0,U.jsx)(`div`,{className:`mb-6`,children:(0,U.jsxs)(`div`,{className:`relative`,children:[v,(0,U.jsx)(w,{placeholder:`Search providers...`,className:`pl-10`,value:i,onChange:y})]})}),t[22]=i,t[23]=m),d=`space-y-8`;let x;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,U.jsx)(N,{title:`Connected Providers`}),t[24]=x):x=t[24];let S=o.length===0?(0,U.jsx)(`p`,{className:T(A.bodyMuted,`py-4`),children:i?`No connected providers match your search.`:`No providers connected yet. Add an API key to get started.`}):(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:o.map(e=>(0,U.jsx)(Ie,{provider:e,isConnected:!0,modelCount:c[e.slug]??0,onClick:r},e.name))});t[25]===S?f=t[26]:(f=(0,U.jsxs)(`section`,{children:[x,S]}),t[25]=S,t[26]=f);let C;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,U.jsx)(N,{title:`Available Providers`}),t[27]=C):C=t[27],h=(0,U.jsxs)(`section`,{children:[C,_.length===0?(0,U.jsx)(`p`,{className:T(A.bodyMuted,`py-4`),children:i?`No available providers match your search.`:`All providers are connected.`}):(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:_.map(e=>(0,U.jsx)(Ie,{provider:e,modelCount:c[e.slug]??0,onClick:r},e.name))})]}),t[2]=c,t[3]=r,t[4]=s,t[5]=i,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h}else l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12];let g;t[28]!==d||t[29]!==f||t[30]!==h?(g=(0,U.jsxs)(`div`,{className:d,children:[f,h]}),t[28]=d,t[29]=f,t[30]=h,t[31]=g):g=t[31];let _;t[32]!==l||t[33]!==p||t[34]!==m||t[35]!==g?(_=(0,U.jsxs)(l,{children:[p,m,g]}),t[32]=l,t[33]=p,t[34]=m,t[35]=g,t[36]=_):_=t[36];let v;return t[37]!==u||t[38]!==_?(v=(0,U.jsx)(u,{children:_}),t[37]=u,t[38]=_,t[39]=v):v=t[39],v}function Me(e,t){return e.name.localeCompare(t.name)}function Ne(e){return!e.apiKey}function Pe(e){return e.apiKey}function Y(){let e=(0,V.c)(18),[t,n]=(0,H.useState)(null),[r,i]=(0,H.useState)(0),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{n(e)},e[0]=a):a=e[0];let o=a,s;e[1]===r?s=e[2]:(s=()=>{n(null),L(Ae(r)),i(Z)},e[1]=r,e[2]=s);let c=s,l;e[3]===r?l=e[4]:(l=function(){L(Ae(r)),i(X)},e[3]=r,e[4]=l);let u=l,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,U.jsx)(J,{}),e[5]=d):d=e[5];let f;e[6]===r?f=e[7]:(f=(0,U.jsx)(H.Suspense,{fallback:d,children:(0,U.jsx)(je,{loadVersion:r,onProviderClick:o},r)}),e[6]=r,e[7]=f);let p;e[8]!==u||e[9]!==f?(p=(0,U.jsx)(I,{fallbackTitle:`Failed to load providers`,onRetry:u,renderFallback:Fe,children:f}),e[8]=u,e[9]=f,e[10]=p):p=e[10];let m=t?.name??null,h=t??void 0,g;e[11]!==c||e[12]!==m||e[13]!==h?(g=(0,U.jsx)(K,{providerName:m,provider:h,onClose:c}),e[11]=c,e[12]=m,e[13]=h,e[14]=g):g=e[14];let _;return e[15]!==p||e[16]!==g?(_=(0,U.jsxs)(U.Fragment,{children:[p,g]}),e[15]=p,e[16]=g,e[17]=_):_=e[17],_}function Fe(e,t){return(0,U.jsx)(P,{children:(0,U.jsxs)(F,{children:[(0,U.jsx)(ye,{title:`Providers`,description:`Manage your AI provider connections and API keys.`}),(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-16`,children:(0,U.jsxs)(`div`,{className:`text-center max-w-md`,children:[(0,U.jsx)(z,{variant:`error`,className:`mb-4`,children:e.message}),(0,U.jsx)(D,{variant:`outline`,size:`sm`,onClick:t,children:`Retry`})]})})]})})}function X(e){return e+1}function Z(e){return e+1}function Ie(e){let t=(0,V.c)(28),{provider:n,isConnected:r,modelCount:i,onClick:o}=e,c=r===void 0?!1:r,l=i===void 0?0:i,[u,d]=(0,H.useState)(!1),p;t[0]!==o||t[1]!==n?(p=()=>o(n),t[0]=o,t[1]=n,t[2]=p):p=t[2];let m;t[3]!==u||t[4]!==n.name||t[5]!==n.slug?(m=(0,U.jsx)(`div`,{className:`flex-shrink-0 h-10 w-10 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:u?(0,U.jsx)(s,{className:`h-5 w-5 text-muted-foreground`}):(0,U.jsx)(`img`,{src:le(n.slug),alt:`${n.name} logo`,className:`h-6 w-6 dark:invert`,onError:()=>d(!0)})}),t[3]=u,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=T(A.label,`truncate`),t[7]=h):h=t[7];let g;t[8]===n.name?g=t[9]:(g=(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,U.jsx)(`span`,{className:h,children:n.name})}),t[8]=n.name,t[9]=g);let _;t[10]===c?_=t[11]:(_=!c&&(0,U.jsxs)(`div`,{className:T(A.compact,`flex items-center gap-1 text-muted-foreground mt-0.5`),children:[(0,U.jsx)(v,{className:`h-3 w-3`}),(0,U.jsx)(`span`,{children:`Click to configure`})]}),t[10]=c,t[11]=_);let y;t[12]!==g||t[13]!==_?(y=(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[g,_]}),t[12]=g,t[13]=_,t[14]=y):y=t[14];let b;t[15]!==m||t[16]!==y?(b=(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m,y]}),t[15]=m,t[16]=y,t[17]=b):b=t[17];let x;t[18]!==c||t[19]!==l||t[20]!==n.isEnv?(x=c&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[n.isEnv?(0,U.jsxs)(G,{variant:`secondary`,className:T(A.compact,`gap-1 px-2 py-0.5`),children:[(0,U.jsx)(a,{className:`h-3 w-3`}),`Environment`]}):(0,U.jsxs)(G,{variant:`secondary`,className:T(A.compact,`gap-1 px-2 py-0.5`),children:[(0,U.jsx)(f,{className:`h-3 w-3`}),`API Key`]}),l>0&&(0,U.jsxs)(G,{variant:`default`,className:T(A.compact,`gap-1 px-2 py-0.5`),children:[(0,U.jsx)(S,{className:`h-3 w-3`}),l,` `,l===1?`Model`:`Models`]})]}),t[18]=c,t[19]=l,t[20]=n.isEnv,t[21]=x):x=t[21];let C;t[22]!==x||t[23]!==b?(C=(0,U.jsxs)(Ce,{className:`p-4 flex flex-col gap-3`,children:[b,x]}),t[22]=x,t[23]=b,t[24]=C):C=t[24];let w;return t[25]!==C||t[26]!==p?(w=(0,U.jsx)(R,{className:`cursor-pointer transition-all hover:border-primary/50 hover:shadow-md`,onClick:p,children:C}),t[25]=C,t[26]=p,t[27]=w):w=t[27],w}export{Y as ProvidersListView,Y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Cr as e,Er as ee,Sr as t,Ti as n,Tr as te,Wi as r,ar as ne,br as re,fo as i,ir as a,ni as o,or as ie,rr as ae,vi as s,vr as c,wr as l,xr as u,ya as d}from"./dialogs-config-B4TDFSrS.js";import{n as oe}from"./onboarding-DfL8a0LZ.js";import{O as se}from"./index-DOsSr4dl.js";var ce=i(),f=n();function p(n){let i=(0,ce.c)(62),{open:p,onOpenChange:m,prTitle:h,onPrTitleChange:g,prDescription:_,onPrDescriptionChange:v,isGeneratingPRInfo:y,isLoading:b,onGeneratePRInfo:x,onCreatePR:S,currentBranch:C,autoGeneratePRInfo:w,onAutoGeneratePRInfoChange:T}=n,E;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,f.jsx)(ee,{children:`Create Pull Request`}),i[0]=E):E=i[0];let D;i[1]===C?D=i[2]:(D=(0,f.jsxs)(te,{children:[E,(0,f.jsxs)(e,{children:[`Create a pull request for branch `,C]})]}),i[1]=C,i[2]=D);let O;i[3]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,f.jsx)(c,{htmlFor:`pr-title`,children:`Title (optional)`}),i[3]=O):O=i[3];let k=C||`Enter PR title...`,A;i[4]===g?A=i[5]:(A=e=>g(e.target.value),i[4]=g,i[5]=A);let j;i[6]!==h||i[7]!==k||i[8]!==A?(j=(0,f.jsxs)(`div`,{className:`grid gap-2`,children:[O,(0,f.jsx)(re,{id:`pr-title`,placeholder:k,value:h,onChange:A})]}),i[6]=h,i[7]=k,i[8]=A,i[9]=j):j=i[9];let M;i[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,f.jsx)(c,{htmlFor:`pr-description`,children:`Description (optional)`}),i[10]=M):M=i[10];let N;i[11]===v?N=i[12]:(N=e=>v(e.target.value),i[11]=v,i[12]=N);let P;i[13]!==_||i[14]!==N?(P=(0,f.jsx)(se,{id:`pr-description`,placeholder:`Enter PR description...`,value:_,onChange:N,rows:4,className:`pr-10`}),i[13]=_,i[14]=N,i[15]=P):P=i[15];let F=y||b,I;i[16]===y?I=i[17]:(I=y?(0,f.jsx)(d,{className:`h-3.5 w-3.5 animate-spin`}):(0,f.jsx)(r,{className:`h-3.5 w-3.5`}),i[16]=y,i[17]=I);let L;i[18]!==x||i[19]!==F||i[20]!==I?(L=(0,f.jsx)(ie,{asChild:!0,children:(0,f.jsx)(o,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute top-2 right-2 h-6 w-6`,onClick:x,disabled:F,children:I})}),i[18]=x,i[19]=F,i[20]=I,i[21]=L):L=i[21];let R=y?`Generating PR description...`:`Generate PR title and description with AI`,z;i[22]===R?z=i[23]:(z=(0,f.jsx)(a,{children:R}),i[22]=R,i[23]=z);let B;i[24]!==L||i[25]!==z?(B=(0,f.jsx)(ne,{children:(0,f.jsxs)(ae,{children:[L,z]})}),i[24]=L,i[25]=z,i[26]=B):B=i[26];let V;i[27]!==B||i[28]!==P?(V=(0,f.jsxs)(`div`,{className:`grid gap-2`,children:[M,(0,f.jsxs)(`div`,{className:`relative`,children:[P,B]})]}),i[27]=B,i[28]=P,i[29]=V):V=i[29];let H;i[30]===T?H=i[31]:(H=e=>T(e===!0),i[30]=T,i[31]=H);let U;i[32]!==w||i[33]!==H?(U=(0,f.jsx)(oe,{id:`auto-generate-pr`,checked:w,onCheckedChange:H}),i[32]=w,i[33]=H,i[34]=U):U=i[34];let W;i[35]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,f.jsx)(c,{htmlFor:`auto-generate-pr`,className:s.labelNormal,children:`Auto generate PR title and description`}),i[35]=W):W=i[35];let G;i[36]===U?G=i[37]:(G=(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[U,W]}),i[36]=U,i[37]=G);let K;i[38]!==V||i[39]!==G||i[40]!==j?(K=(0,f.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[j,V,G]}),i[38]=V,i[39]=G,i[40]=j,i[41]=K):K=i[41];let q;i[42]===m?q=i[43]:(q=()=>m(!1),i[42]=m,i[43]=q);let J;i[44]!==b||i[45]!==q?(J=(0,f.jsx)(o,{variant:`outline`,onClick:q,disabled:b,children:`Cancel`}),i[44]=b,i[45]=q,i[46]=J):J=i[46];let Y=b?`Creating...`:`Create PR`,X;i[47]!==b||i[48]!==S||i[49]!==Y?(X=(0,f.jsx)(o,{onClick:S,disabled:b,children:Y}),i[47]=b,i[48]=S,i[49]=Y,i[50]=X):X=i[50];let Z;i[51]!==J||i[52]!==X?(Z=(0,f.jsxs)(l,{children:[J,X]}),i[51]=J,i[52]=X,i[53]=Z):Z=i[53];let Q;i[54]!==D||i[55]!==K||i[56]!==Z?(Q=(0,f.jsxs)(t,{children:[D,K,Z]}),i[54]=D,i[55]=K,i[56]=Z,i[57]=Q):Q=i[57];let $;return i[58]!==m||i[59]!==p||i[60]!==Q?($=(0,f.jsx)(u,{open:p,onOpenChange:m,children:Q}),i[58]=m,i[59]=p,i[60]=Q,i[61]=$):$=i[61],$}export{p as PullRequestDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Cr as e,Er as t,Fi as n,Sr as r,Ti as i,Tr as a,fo as o,ja as s,ni as c,ua as l,vi as u,wr as d,xr as f}from"./dialogs-config-B4TDFSrS.js";import{x as p}from"./history-view-Ds_0e_bx.js";var m=o(),h=i();function g(i){let o=(0,m.c)(27),{open:g,onOpenChange:_,onCommitFirst:v,onStashAndPull:y,onCancel:b,isLoading:x}=i,S=x===void 0?!1:x,C;o[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,h.jsxs)(a,{children:[(0,h.jsxs)(t,{className:`flex items-center gap-2`,children:[(0,h.jsx)(n,{className:`h-5 w-5 text-amber-500`}),`Uncommitted Changes Detected`]}),(0,h.jsx)(e,{children:`You have uncommitted changes. You need to handle them before pulling from the remote branch.`})]}),o[0]=C):C=o[0];let w;o[1]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,h.jsx)(`div`,{className:u.bodyMuted,children:`Choose how you want to proceed:`}),o[1]=w):w=o[1];let T;o[2]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,h.jsx)(s,{className:`h-4 w-4 mr-2`}),o[2]=T):T=o[2];let E;o[3]!==S||o[4]!==v?(E=(0,h.jsxs)(c,{onClick:v,disabled:S,className:`w-full justify-start`,variant:`outline`,children:[T,`Commit changes first, then pull`]}),o[3]=S,o[4]=v,o[5]=E):E=o[5];let D;o[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,h.jsx)(l,{className:`h-4 w-4 mr-2`}),o[6]=D):D=o[6];let O;o[7]!==S||o[8]!==y?(O=(0,h.jsxs)(c,{onClick:y,disabled:S,className:`w-full justify-start`,variant:`outline`,children:[D,`Stash changes → Pull → Restore changes`]}),o[7]=S,o[8]=y,o[9]=O):O=o[9];let k;o[10]!==E||o[11]!==O?(k=(0,h.jsxs)(`div`,{className:`space-y-2`,children:[E,O]}),o[10]=E,o[11]=O,o[12]=k):k=o[12];let A;o[13]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,h.jsx)(`strong`,{children:`Commit first:`}),o[13]=A):A=o[13];let j;o[14]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,h.jsxs)(p,{variant:`hint`,className:`mt-4 mb-0`,children:[A,` Safe option, preserves changes in your commit history.`,(0,h.jsx)(`br`,{}),(0,h.jsx)(`strong`,{children:`Stash and pull:`}),` Temporary option, changes will be restored after pulling.`]}),o[14]=j):j=o[14];let M;o[15]===k?M=o[16]:(M=(0,h.jsx)(`div`,{className:`py-4`,children:(0,h.jsxs)(`div`,{className:`space-y-3`,children:[w,k,j]})}),o[15]=k,o[16]=M);let N;o[17]!==S||o[18]!==b?(N=(0,h.jsx)(d,{children:(0,h.jsx)(c,{variant:`ghost`,onClick:b,disabled:S,children:`Cancel`})}),o[17]=S,o[18]=b,o[19]=N):N=o[19];let P;o[20]!==M||o[21]!==N?(P=(0,h.jsxs)(r,{className:`sm:max-w-[425px]`,children:[C,M,N]}),o[20]=M,o[21]=N,o[22]=P):P=o[22];let F;return o[23]!==_||o[24]!==g||o[25]!==P?(F=(0,h.jsx)(f,{open:g,onOpenChange:_,children:P}),o[23]=_,o[24]=g,o[25]=P,o[26]=F):F=o[26],F}export{g as PullWithChangesDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Cr as e,Er as t,Sr as n,Ti as r,Tr as i,fo as a,ni as o,wr as s,xr as c}from"./dialogs-config-B4TDFSrS.js";var l=a(),u=r();function d(r){let a=(0,l.c)(15),{open:d,onOpenChange:f,isLoading:p,onPushAndCreatePR:m,onCancel:h}=r,g;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,u.jsxs)(i,{children:[(0,u.jsx)(t,{children:`Push Branch First`}),(0,u.jsx)(e,{children:`Your branch needs to be pushed to the remote before creating a pull request. Would you like to push it now?`})]}),a[0]=g):g=a[0];let _;a[1]!==p||a[2]!==h?(_=(0,u.jsx)(o,{variant:`outline`,onClick:h,disabled:p,children:`Cancel`}),a[1]=p,a[2]=h,a[3]=_):_=a[3];let v=p?`Pushing...`:`Push & Create PR`,y;a[4]!==p||a[5]!==m||a[6]!==v?(y=(0,u.jsx)(o,{onClick:m,disabled:p,children:v}),a[4]=p,a[5]=m,a[6]=v,a[7]=y):y=a[7];let b;a[8]!==_||a[9]!==y?(b=(0,u.jsxs)(n,{children:[g,(0,u.jsxs)(s,{children:[_,y]})]}),a[8]=_,a[9]=y,a[10]=b):b=a[10];let x;return a[11]!==f||a[12]!==d||a[13]!==b?(x=(0,u.jsx)(c,{open:d,onOpenChange:f,children:b}),a[11]=f,a[12]=d,a[13]=b,a[14]=x):x=a[14],x}export{d as PushBeforePRDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ti as t,Ya as n,fo as r,ii as i,mo as a}from"./dialogs-config-B4TDFSrS.js";import{c as o,l as s,s as c}from"./react-vendor-unlDVFpU.js";var l=r(),u=e(a(),1),d=t(),f=u.forwardRef((e,t)=>{let n=(0,l.c)(9),r,a;n[0]===e?(r=n[1],a=n[2]):({className:r,...a}=e,n[0]=e,n[1]=r,n[2]=a);let o;n[3]===r?o=n[4]:(o=i(`grid gap-2`,r),n[3]=r,n[4]=o);let c;return n[5]!==a||n[6]!==t||n[7]!==o?(c=(0,d.jsx)(s,{className:o,...a,ref:t}),n[5]=a,n[6]=t,n[7]=o,n[8]=c):c=n[8],c});f.displayName=s.displayName;var p=u.forwardRef((e,t)=>{let r=(0,l.c)(10),a,s;r[0]===e?(a=r[1],s=r[2]):({className:a,...s}=e,r[0]=e,r[1]=a,r[2]=s);let u;r[3]===a?u=r[4]:(u=i(`aspect-square h-4 w-4 rounded-full border border-brand text-brand ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,a),r[3]=a,r[4]=u);let f;r[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,d.jsx)(c,{className:`flex items-center justify-center`,children:(0,d.jsx)(n,{className:`h-2.5 w-2.5 fill-current text-current`})}),r[5]=f):f=r[5];let p;return r[6]!==s||r[7]!==t||r[8]!==u?(p=(0,d.jsx)(o,{ref:t,className:u,...s,children:f}),r[6]=s,r[7]=t,r[8]=u,r[9]=p):p=r[9],p});p.displayName=o.displayName;export{p as n,f as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Jn as t,Ti as n,br as r,fo as i,ii as a,mo as o,n as s,ni as c,nr as l,q as u,r as d,ta as ee,vi as f,yn as p}from"./dialogs-config-B4TDFSrS.js";import{a as m,i as h,o as g,r as _}from"./react-vendor-unlDVFpU.js";import{D as te,E as ne,S as re,b as v}from"./history-view-Ds_0e_bx.js";import{t as ie}from"./index-DOsSr4dl.js";var ae=i(),y=e(o(),1),b=n(),oe=y.forwardRef((e,t)=>{let n=(0,ae.c)(11),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=a(`relative flex w-full touch-none select-none items-center`,r),n[3]=r,n[4]=o);let s,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,b.jsx)(g,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,b.jsx)(_,{className:`absolute h-full bg-primary`})}),c=(0,b.jsx)(m,{className:`block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`}),n[5]=s,n[6]=c):(s=n[5],c=n[6]);let l;return n[7]!==i||n[8]!==t||n[9]!==o?(l=(0,b.jsxs)(h,{ref:t,className:o,...i,children:[s,c]}),n[7]=i,n[8]=t,n[9]=o,n[10]=l):l=n[10],l});oe.displayName=h.displayName;var x=50;function se(){let[e,t]=(0,y.useState)(x),[n,r]=(0,y.useState)(x.toString()),[i,a]=(0,y.useState)(!0),[o,s]=(0,y.useState)(!1);(0,y.useEffect)(()=>{let e=!1;async function n(){try{let n=await u();e||(t(n.maximumTurnCount),r(n.maximumTurnCount.toString()))}catch(e){console.error(`Failed to load maximum turn count:`,e)}finally{e||a(!1)}}return n(),()=>{e=!0}},[]);function c(e){r(e)}async function l(e){s(!0);try{let n=await p({maximumTurnCount:e});t(n.maximumTurnCount),r(n.maximumTurnCount.toString())}catch(e){throw console.error(`Failed to update maximum turn count:`,e),e}finally{s(!1)}}function d(){r(e.toString())}return{defaultMaximumTurnCount:x,draftMaximumTurnCount:n,isLoading:i,isSaving:o,maximumTurnCount:e,resetDraftMaximumTurnCount:d,setDraftMaximumTurnCount:c,updateMaximumTurnCount:l}}var ce=`local`;function le(){let[e,t]=(0,y.useState)(ce),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)([]),[o,s]=(0,y.useState)(!0),[c,l]=(0,y.useState)(!1);(0,y.useEffect)(()=>{let e=!1;async function n(){try{let n=await u();e||(t(n.serverBindMode),r(n.serverBindMode),a(n.networkAddresses))}catch(e){console.error(`Failed to load server bind mode:`,e)}finally{e||s(!1)}}return n(),()=>{e=!0}},[]);async function d(e){l(!0);try{let n=await p({serverBindMode:e});t(n.serverBindMode),a(n.networkAddresses)}catch(e){throw console.error(`Failed to update server bind mode:`,e),e}finally{l(!1)}}return{defaultServerBindMode:ce,hasServerBindModeChanged:n!==null&&e!==n,isLoading:o,isSaving:c,networkAddresses:i,serverBindMode:e,updateServerBindMode:d}}var ue=`default`;function de(){let e=(0,ae.c)(3),[t,n]=(0,y.useState)(fe),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=e=>{n(e),l(e)},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a={voiceModel:t,updateVoiceModel:i,defaultVoiceModel:ue},e[1]=t,e[2]=a),a}function fe(){return t(ue)}var pe=[{value:`default`,label:`Standard`},{value:`tiny`,label:`Tiny`}],me=[{value:`local`,label:`Local`},{value:`network`,label:`Network`}],he=[`462`,`8100`].includes(typeof document<`u`?document.location.port:``)?`462`:`641`,ge=600;function _e(e){let t=(0,ae.c)(94),{onboardingResetSignal:n}=e,i=n===void 0?0:n,[o,l]=(0,y.useState)(!1),{scale:u,updateScale:d,resetScale:p,min:m,max:h,default:g}=ie(),{defaultMaximumTurnCount:_,draftMaximumTurnCount:x,isLoading:ce,isSaving:ue,resetDraftMaximumTurnCount:fe,setDraftMaximumTurnCount:_e,updateMaximumTurnCount:xe}=se(),{voiceModel:Se,updateVoiceModel:Ce}=de(),{hasServerBindModeChanged:we,isLoading:Te,isSaving:Ee,networkAddresses:S,serverBindMode:C,updateServerBindMode:De}=le(),w,T;t[0]===i?(w=t[1],T=t[2]):(w=()=>{if(i===0)return;l(!0);let e=setTimeout(()=>{l(!1)},ge);return()=>{clearTimeout(e)}},T=[i],t[0]=i,t[1]=w,t[2]=T),(0,y.useEffect)(w,T);let E;t[3]===_e?E=t[4]:(E=function(e){_e(e.target.value)},t[3]=_e,t[4]=E);let Oe=E,D;t[5]!==_||t[6]!==x||t[7]!==fe||t[8]!==xe?(D=async function(){let e=Number.parseInt(x,10),t=Number.isFinite(e)&&e>0?e:_;try{await xe(t)}catch{fe()}},t[5]=_,t[6]=x,t[7]=fe,t[8]=xe,t[9]=D):D=t[9];let ke=D,Ae;t[10]===d?Ae=t[11]:(Ae=function(e){e.length>0&&d(e[0])},t[10]=d,t[11]=Ae);let je=Ae,Me=o&&`animate-headline-reset`,O;t[12]===Me?O=t[13]:(O=a(Me),t[12]=Me,t[13]=O);let k;t[14]===O?k=t[15]:(k=(0,b.jsx)(re,{title:`General`,description:`Customize the appearance and behavior of Tarsk.`,titleClassName:O}),t[14]=O,t[15]=k);let Ne,Pe;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,b.jsx)(ee,{className:`h-3.5 w-3.5`}),Pe=(0,b.jsx)(`span`,{className:`sr-only`,children:`Reset font size to default`}),t[16]=Ne,t[17]=Pe):(Ne=t[16],Pe=t[17]);let A;t[18]===p?A=t[19]:(A=(0,b.jsxs)(c,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:p,children:[Ne,Pe]}),t[18]=p,t[19]=A);let j;t[20]===u?j=t[21]:(j=(0,b.jsxs)(`span`,{className:`${f.mono} tabular-nums w-12 text-right`,children:[u,`%`]}),t[20]=u,t[21]=j);let M;t[22]!==A||t[23]!==j?(M=(0,b.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[A,j]}),t[22]=A,t[23]=j,t[24]=M):M=t[24];let N;t[25]===m?N=t[26]:(N=(0,b.jsxs)(`span`,{className:`${f.bodyMuted} w-8 text-right`,children:[m,`%`]}),t[25]=m,t[26]=N);let P;t[27]===u?P=t[28]:(P=[u],t[27]=u,t[28]=P);let F;t[29]!==je||t[30]!==h||t[31]!==m||t[32]!==P?(F=(0,b.jsx)(oe,{value:P,min:m,max:h,step:5,onValueChange:je,"aria-label":`Font size`}),t[29]=je,t[30]=h,t[31]=m,t[32]=P,t[33]=F):F=t[33];let I;t[34]===h?I=t[35]:(I=(0,b.jsxs)(`span`,{className:`${f.bodyMuted} w-9`,children:[h,`%`]}),t[34]=h,t[35]=I);let L;t[36]!==N||t[37]!==F||t[38]!==I?(L=(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[N,F,I]}),t[36]=N,t[37]=F,t[38]=I,t[39]=L):L=t[39];let R;t[40]!==g||t[41]!==u?(R=u!==g&&(0,b.jsxs)(`p`,{className:`${f.bodyMuted} mt-2`,children:[`Font size has been changed from the default (`,g,`%).`]}),t[40]=g,t[41]=u,t[42]=R):R=t[42];let z;t[43]!==M||t[44]!==L||t[45]!==R?(z=(0,b.jsxs)(v,{title:`Font Size`,description:`Adjust the text size across the entire application.`,action:M,children:[L,R]}),t[43]=M,t[44]=L,t[45]=R,t[46]=z):z=t[46];let B;t[47]===ke?B=t[48]:(B=()=>{ke()},t[47]=ke,t[48]=B);let Fe=ce||ue,V;t[49]!==x||t[50]!==Oe||t[51]!==B||t[52]!==Fe?(V=(0,b.jsx)(r,{type:`number`,min:1,step:1,value:x,onChange:Oe,onBlur:B,disabled:Fe,"aria-label":`Maximum turn count`,className:`w-28 text-right font-mono tabular-nums flex-shrink-0`}),t[49]=x,t[50]=Oe,t[51]=B,t[52]=Fe,t[53]=V):V=t[53];let H;t[54]===_?H=t[55]:(H=(0,b.jsxs)(`p`,{className:f.bodyMuted,children:[`Default: `,_,` turns.`]}),t[54]=_,t[55]=H);let U;t[56]!==V||t[57]!==H?(U=(0,b.jsx)(v,{title:`Maximum Turn Count`,description:`Set how many turns a long-running agent chat can take before Tarsk asks whether to continue.`,action:V,children:H}),t[56]=V,t[57]=H,t[58]=U):U=t[58];let W;t[59]===Ce?W=t[60]:(W=e=>{(e==="default"||e===`tiny`)&&Ce(e)},t[59]=Ce,t[60]=W);let G;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(G=pe.map(be),t[61]=G):G=t[61];let K;t[62]!==W||t[63]!==Se?(K=(0,b.jsx)(v,{title:`Voice Model`,description:`Choose which voice-to-text model Tarsk downloads and caches for speech input.`,children:(0,b.jsx)(s,{type:`single`,value:Se,onValueChange:W,"aria-label":`Voice model`,variant:`outline`,className:`inline-flex rounded-full border bg-muted/40 p-1`,children:G})}),t[62]=W,t[63]=Se,t[64]=K):K=t[64];let Ie=C===`network`?`Tarsk accepts connections from other devices on your network such as the Tarsk mobile app.`:`Tarsk only accepts connections from this computer at http://localhost:${he}.`,Le=Te||Ee,q;t[65]===De?q=t[66]:(q=e=>{(e===`local`||e===`network`)&&De(e)},t[65]=De,t[66]=q);let Re;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Re=me.map(ye),t[67]=Re):Re=t[67];let J;t[68]!==C||t[69]!==Le||t[70]!==q?(J=(0,b.jsx)(s,{type:`single`,value:C,disabled:Le,onValueChange:q,"aria-label":`Server bind mode`,variant:`outline`,className:`inline-flex rounded-full border bg-muted/40 p-1`,children:Re}),t[68]=C,t[69]=Le,t[70]=q,t[71]=J):J=t[71];let Y;t[72]!==S||t[73]!==C?(Y=C===`network`&&S.length>0&&(0,b.jsxs)(`div`,{className:`mt-3 space-y-1`,children:[(0,b.jsx)(`p`,{className:f.bodyMuted,children:`Available on your network:`}),(0,b.jsx)(`ul`,{className:`${f.mono} space-y-1`,children:S.map(ve)})]}),t[72]=S,t[73]=C,t[74]=Y):Y=t[74];let X;t[75]!==S||t[76]!==C?(X=C===`network`&&S.length===0&&(0,b.jsx)(`p`,{className:`${f.bodyMuted} mt-3`,children:`No network IP addresses were detected on this computer.`}),t[75]=S,t[76]=C,t[77]=X):X=t[77];let Z;t[78]===we?Z=t[79]:(Z=we&&(0,b.jsx)(`p`,{className:`${f.bodyMuted} mt-3`,children:`Restart Tarsk for this change to take effect.`}),t[78]=we,t[79]=Z);let Q;t[80]!==Ie||t[81]!==J||t[82]!==Y||t[83]!==X||t[84]!==Z?(Q=(0,b.jsxs)(v,{title:`Local`,description:Ie,children:[J,Y,X,Z]}),t[80]=Ie,t[81]=J,t[82]=Y,t[83]=X,t[84]=Z,t[85]=Q):Q=t[85];let $;t[86]!==z||t[87]!==U||t[88]!==K||t[89]!==Q?($=(0,b.jsxs)(`div`,{className:`space-y-8`,children:[z,U,K,Q]}),t[86]=z,t[87]=U,t[88]=K,t[89]=Q,t[90]=$):$=t[90];let ze;return t[91]!==$||t[92]!==k?(ze=(0,b.jsx)(te,{children:(0,b.jsxs)(ne,{children:[k,$]})}),t[91]=$,t[92]=k,t[93]=ze):ze=t[93],ze}function ve(e){return(0,b.jsxs)(`li`,{children:[`http://`,e,`:`,he]},e)}function ye(e){return(0,b.jsx)(d,{value:e.value,"aria-label":e.label,className:`rounded-full border-0 px-4 data-[state=on]:bg-foreground data-[state=on]:text-background data-[state=on]:shadow-sm dark:data-[state=on]:bg-background dark:data-[state=on]:text-foreground`,children:e.label},e.value)}function be(e){return(0,b.jsx)(d,{value:e.value,"aria-label":e.label,className:`rounded-full border-0 px-4 data-[state=on]:bg-foreground data-[state=on]:text-background data-[state=on]:shadow-sm dark:data-[state=on]:bg-background dark:data-[state=on]:text-foreground`,children:e.label},e.value)}export{_e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Dt as t,Ti as n,an as r,ii as i,mo as a,ni as o,vi as s,ya as c}from"./dialogs-config-B4TDFSrS.js";import{E as l,S as u,T as d,w as f}from"./history-view-Ds_0e_bx.js";import{E as p,O as m,j as h}from"./index-DOsSr4dl.js";var g=e(a(),1),_=n();function v(){let e=h(e=>e.selectedThreadId),[n,a]=(0,g.useState)(``),[v,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(!1);(0,g.useEffect)(()=>{e&&(y(!0),t(e,`AGENTS.md`).then(e=>a(e.content)).catch(()=>a(``)).finally(()=>y(!1)))},[e]);async function S(){if(e){x(!0);try{await r(e,`AGENTS.md`,n),p({title:`Instructions saved`})}catch(e){p({title:`Error`,description:e instanceof Error?e.message:`Failed to save instructions`,variant:`destructive`})}finally{x(!1)}}}return e?(0,_.jsx)(f,{children:(0,_.jsxs)(l,{className:`w-full flex-1 flex flex-col min-h-0`,children:[(0,_.jsx)(u,{title:`Instructions`,description:`Add context like coding guidelines and expectations. Stored in AGENTS.md file.`,action:(0,_.jsx)(o,{onClick:S,disabled:v||b,children:b?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`})}),v?(0,_.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,_.jsx)(c,{className:`h-8 w-8 animate-spin text-muted-foreground`})}):(0,_.jsx)(m,{value:n,onChange:e=>a(e.target.value),className:i(s.mono,`flex-1 min-h-0 resize-none`),placeholder:`Add instructions for your agent in AGENTS.md...`,disabled:b})]})}):(0,_.jsx)(d,{children:`Select a thread to edit instructions.`})}export{v as SettingsInstructionsView,v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-aKtaBQYM.js";import{Ti as e,Zi as t,ar as n,br as r,fo as i,ii as a,ir as o,mo as s,ni as c,or as l,rr as u,vi as d}from"./dialogs-config-B4TDFSrS.js";import{i as f,r as p}from"./history-view-Ds_0e_bx.js";var m=i();s();var h=e();function g(e){let t=(0,m.c)(16),{title:n,subtitle:r,subtitleMono:i,badge:o,actions:s}=e,c=i===void 0?!1:i,l;t[0]===n?l=t[1]:(l=typeof n==`string`?(0,h.jsx)(`h3`,{className:a(d.label,`truncate`),children:n}):n,t[0]=n,t[1]=l);let u;t[2]!==o||t[3]!==l?(u=(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l,o]}),t[2]=o,t[3]=l,t[4]=u):u=t[4];let g;t[5]!==r||t[6]!==c?(g=r?(0,h.jsx)(`p`,{className:a(d.bodyMuted,`mt-1 truncate`,c&&d.mono),children:r}):null,t[5]=r,t[6]=c,t[7]=g):g=t[7];let v;t[8]!==u||t[9]!==g?(v=(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,g]}),t[8]=u,t[9]=g,t[10]=v):v=t[10];let y;t[11]===s?y=t[12]:(y=(0,h.jsx)(_,{actions:s}),t[11]=s,t[12]=y);let b;return t[13]!==v||t[14]!==y?(b=(0,h.jsx)(p,{children:(0,h.jsxs)(f,{className:`flex items-center justify-between p-4`,children:[v,y]})}),t[13]=v,t[14]=y,t[15]=b):b=t[15],b}function _(e){let t=(0,m.c)(4),{actions:r}=e,i;t[0]===r?i=t[1]:(i=r.map(v),t[0]=r,t[1]=i);let a;return t[2]===i?a=t[3]:(a=(0,h.jsx)(n,{delayDuration:300,children:(0,h.jsx)(`div`,{className:`flex items-center gap-1 ml-4 flex-shrink-0`,children:i})}),t[2]=i,t[3]=a),a}function v(e){return(0,h.jsxs)(u,{children:[(0,h.jsx)(l,{asChild:!0,children:(0,h.jsx)(c,{variant:`ghost`,size:`icon-sm`,onClick:e.onClick,children:(0,h.jsx)(`span`,{className:e.destructive?`text-destructive`:void 0,children:e.icon})})}),(0,h.jsx)(o,{children:e.label})]},e.label)}function y(e){let t=(0,m.c)(12),{icon:n,title:r,description:i}=e,o;t[0]===n?o=t[1]:(o=(0,h.jsx)(n,{className:`mx-auto h-10 w-10 text-muted-foreground/50 mb-3`}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=a(d.emptyStateTitle,`mb-1`),t[2]=s):s=t[2];let c;t[3]===r?c=t[4]:(c=(0,h.jsx)(`h3`,{className:s,children:r}),t[3]=r,t[4]=c);let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=a(d.bodyMuted,`mb-3`),t[5]=l):l=t[5];let u;t[6]===i?u=t[7]:(u=(0,h.jsx)(`p`,{className:l,children:i}),t[6]=i,t[7]=u);let f;return t[8]!==o||t[9]!==c||t[10]!==u?(f=(0,h.jsxs)(`div`,{className:`text-center py-12 border border-dashed rounded-lg mb-8`,children:[o,c,u]}),t[8]=o,t[9]=c,t[10]=u,t[11]=f):f=t[11],f}function b(e){let n=(0,m.c)(7),{placeholder:i,value:a,onChange:o}=e,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,h.jsx)(t,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),n[0]=s):s=n[0];let c;n[1]===o?c=n[2]:(c=e=>o(e.target.value),n[1]=o,n[2]=c);let l;return n[3]!==i||n[4]!==c||n[5]!==a?(l=(0,h.jsxs)(`div`,{className:`relative mb-4`,children:[s,(0,h.jsx)(r,{placeholder:i,value:a,onChange:c,className:`pl-8`})]}),n[3]=i,n[4]=c,n[5]=a,n[6]=l):l=n[6],l}function x(e){let t=(0,m.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,h.jsx)(`div`,{className:`grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(min(220px,100%),1fr))]`,children:n}),t[0]=n,t[1]=r),r}function S(e){let t=(0,m.c)(3),{searchQuery:n,emptyLabel:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=a(d.bodyMuted,`text-center py-8`),t[0]=i):i=t[0];let o=n.trim()?`No results for "${n}"`:r,s;return t[1]===o?s=t[2]:(s=(0,h.jsx)(`p`,{className:i,children:o}),t[1]=o,t[2]=s),s}function C(e){let t=(0,m.c)(3),{message:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=a(d.bodyMuted,`text-center py-8`),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,h.jsx)(`p`,{className:r,children:n}),t[1]=n,t[2]=i),i}export{b as a,S as i,g as n,C as o,x as r,y as t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ai as t,La as n,Li as r,Sr as i,Ti as a,Yi as o,aa as s,at as c,br as l,fo as u,k as d,lt as f,mo as p,ni as m,nn as h,ra as g,vi as _,xr as v}from"./dialogs-config-B4TDFSrS.js";import{A as y,C as b,D as ee,E as x,F as S,M as C,N as w,O as T,P as E,S as te,T as D,b as O,d as k,f as A,g as j,h as M,j as N,k as P,p as F,y as I}from"./history-view-Ds_0e_bx.js";import{C as L,E as R,O as z,c as B,j as V,l as ne,s as re,u as H}from"./index-DOsSr4dl.js";import{t as U}from"./skeleton-BvSNJL9q.js";import{a as W,i as ie,n as G,r as K,t as ae}from"./settings-list-CUbZrggr.js";import{t as oe}from"./mcp-server-card-DrUUKNXv.js";var q=u(),J=e(p(),1);function se(e){let[t,n]=(0,J.useState)([]),[r,i]=(0,J.useState)(!1),a=(0,J.useCallback)(async()=>{if(e){i(!0);try{let t=await c(e);n(Object.entries(t.servers??{}).map(([e,t])=>({name:e,config:t})))}catch{n([])}finally{i(!1)}}},[e]);return(0,J.useEffect)(()=>{a()},[a]),{installedServers:t,loadingConfig:r,loadInstalledServers:a}}function Y(){let e=(0,q.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,J.useState)(t),i,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{f().then(r).catch(()=>r([]))},a=[],e[1]=i,e[2]=a):(i=e[1],a=e[2]),(0,J.useEffect)(i,a);let o;return e[3]===n?o=e[4]:(o={popularServers:n},e[3]=n,e[4]=o),o}async function X(e,t,n){await h(e,t,n)}async function ce(e,t){await d(e,t)}var Z=a();function le(e){return e?.url?`remote`:`local`}function ue(e){return Object.entries(e??{}).map(([e,t])=>({key:e,value:t}))}function Q({projectPath:e,serverName:n,initialName:r,initialConfig:i,onBack:a}){let{installedServers:o}=se(e),s=!!n,[c,u]=(0,J.useState)(`local`),[d,f]=(0,J.useState)(``),[p,h]=(0,J.useState)(``),[v,y]=(0,J.useState)(``),[b,x]=(0,J.useState)(``),[S,C]=(0,J.useState)(`sse`),[w,T]=(0,J.useState)([]),[E,D]=(0,J.useState)([]),[N,P]=(0,J.useState)(!1),[L,V]=(0,J.useState)(!1),[U,W]=(0,J.useState)(null),[ie,G]=(0,J.useState)(s),[K,ae]=(0,J.useState)(``),[oe,q]=(0,J.useState)(``);function Y(e,t){let n=le(t);u(n),f(e),h(t.command??``),y((t.args??[]).join(`
|
|
2
|
-
`)),x(t.url??``),C(t.transport??`sse`),T(ue(t.env)),D(ue(t.headers)),ae(e),q(JSON.stringify({name:e,type:n,config:t}))}(0,J.useEffect)(()=>{if(s&&n){let e=o.find(e=>e.name===n);e&&(Y(e.name,e.config),G(!1))}else i&&Y(r??``,i),G(!1)},[o,n,s,i,r]);let Q=(0,J.useCallback)(()=>{T(e=>[...e,{key:``,value:``}])},[]),$=(0,J.useCallback)(e=>{T(t=>t.filter((t,n)=>n!==e))},[]),de=(0,J.useCallback)((e,t)=>{T(n=>n.map((n,r)=>r===e?{...n,key:t}:n))},[]),fe=(0,J.useCallback)((e,t)=>{T(n=>n.map((n,r)=>r===e?{...n,value:t}:n))},[]),pe=(0,J.useCallback)(()=>{D(e=>[...e,{key:``,value:``}])},[]),me=(0,J.useCallback)(e=>{D(t=>t.filter((t,n)=>n!==e))},[]),he=(0,J.useCallback)((e,t)=>{D(n=>n.map((n,r)=>r===e?{...n,key:t}:n))},[]),ge=(0,J.useCallback)((e,t)=>{D(n=>n.map((n,r)=>r===e?{...n,value:t}:n))},[]);function _e(e){let t={};for(let{key:n,value:r}of e)n.trim()&&(t[n.trim()]=r);return Object.keys(t).length>0?t:void 0}function ve(){let e=_e(w);if(c===`remote`){let t=_e(E);return{url:b.trim(),transport:S,...t?{headers:t}:{},...e?{env:e}:{}}}let t=v.split(`
|
|
3
|
-
`).map(e=>e.trim()).filter(Boolean);return{command:p.trim(),args:t,...e?{env:e}:{}}}let ye=JSON.stringify({name:d.trim(),type:c,config:ve()}),be=async()=>{W(null);let t=d.trim();if(!t){W(`Server name is required`);return}if(c===`remote`){if(!b.trim()){W(`Server URL is required`);return}try{new URL(b.trim())}catch{W(`Server URL must be a valid URL`);return}}else if(!p.trim()){W(`Command is required`);return}P(!0);try{if(!e)throw Error(`No project path`);await X(e,K||t,ve()),R({title:`Success`,description:s?`MCP server configuration saved`:`MCP server added`}),a()}catch(e){W(e instanceof Error?e.message:`Failed to save server`)}finally{P(!1)}},xe=async()=>{if(e){V(!0);try{await ce(e,K),R({title:`Success`,description:`MCP server removed`}),a()}catch(e){W(e instanceof Error?e.message:`Failed to delete server`)}finally{V(!1)}}},Se=s?ye!==oe:d.trim()!==``||p.trim()!==``||v.trim()!==``||b.trim()!==``||w.length>0||E.length>0;return ie?(0,Z.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,Z.jsx)(`p`,{className:_.bodyMuted,children:`Loading server configuration...`})}):(0,Z.jsx)(ee,{children:(0,Z.jsxs)(I,{children:[(0,Z.jsx)(te,{title:s?d:`Add MCP Server`,description:s?`Edit MCP Server configuration.`:`Configure a new MCP Server.`}),(0,Z.jsxs)(`div`,{className:`space-y-6`,children:[(0,Z.jsx)(O,{title:`Server name`,description:s?`Server name cannot be changed`:void 0,children:(0,Z.jsx)(l,{id:`server-name`,placeholder:`e.g. filesystem`,value:d,onChange:e=>f(e.target.value),disabled:s})}),(0,Z.jsxs)(re,{value:c,onValueChange:e=>u(e),className:`w-full`,children:[(0,Z.jsxs)(ne,{className:`grid w-full grid-cols-2`,children:[(0,Z.jsx)(H,{value:`local`,children:`Local (stdio)`}),(0,Z.jsx)(H,{value:`remote`,children:`Remote (HTTP/SSE)`})]}),(0,Z.jsxs)(B,{value:`local`,className:`space-y-6 mt-6`,children:[(0,Z.jsx)(O,{title:`Command`,children:(0,Z.jsx)(l,{id:`server-command`,placeholder:`e.g. npx`,value:p,onChange:e=>h(e.target.value)})}),(0,Z.jsx)(O,{title:`Arguments`,description:`One argument per line`,children:(0,Z.jsx)(z,{id:`server-args`,placeholder:`-y
|
|
4
|
-
@modelcontextprotocol/server-filesystem
|
|
5
|
-
/path/to/dir`,value:v,onChange:e=>y(e.target.value),className:`font-mono min-h-[80px] resize-none`})})]}),(0,Z.jsxs)(B,{value:`remote`,className:`space-y-6 mt-6`,children:[(0,Z.jsx)(O,{title:`Server URL`,description:`Paste the MCP endpoint URL from your provider.`,children:(0,Z.jsx)(l,{id:`server-url`,placeholder:`https://example.com/mcp`,value:b,onChange:e=>x(e.target.value),className:`font-mono`})}),(0,Z.jsx)(O,{title:`Transport`,children:(0,Z.jsxs)(k,{value:S,onValueChange:e=>C(e),children:[(0,Z.jsx)(M,{children:(0,Z.jsx)(j,{})}),(0,Z.jsxs)(A,{children:[(0,Z.jsx)(F,{value:`sse`,children:`SSE (Server-Sent Events)`}),(0,Z.jsx)(F,{value:`streamableHttp`,children:`Streamable HTTP`})]})]})}),(0,Z.jsx)(O,{title:`HTTP headers`,description:`Optional headers for authentication.`,action:(0,Z.jsxs)(m,{variant:`ghost`,size:`sm`,onClick:pe,children:[(0,Z.jsx)(g,{className:`h-3 w-3 mr-1`}),`Add header`]}),children:E.length===0?(0,Z.jsx)(`p`,{className:_.caption,children:`No headers configured`}):(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:E.map((e,n)=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(l,{placeholder:`Authorization`,value:e.key,onChange:e=>he(n,e.target.value),className:`font-mono w-[35%]`}),(0,Z.jsx)(l,{placeholder:`Bearer ...`,value:e.value,onChange:e=>ge(n,e.target.value),className:`font-mono flex-1`}),(0,Z.jsx)(m,{variant:`ghost`,size:`icon`,onClick:()=>me(n),className:`h-9 w-9 flex-shrink-0`,children:(0,Z.jsx)(t,{className:`h-3.5 w-3.5`})})]},n))})})]})]}),(0,Z.jsx)(O,{title:`Environment variables`,description:c===`remote`?`Optional metadata for local tooling.`:void 0,action:(0,Z.jsxs)(m,{variant:`ghost`,size:`sm`,onClick:Q,children:[(0,Z.jsx)(g,{className:`h-3 w-3 mr-1`}),`Add variable`]}),children:w.length===0?(0,Z.jsx)(`p`,{className:_.caption,children:`No environment variables configured`}):(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:w.map((e,n)=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(l,{placeholder:`KEY`,value:e.key,onChange:e=>de(n,e.target.value),className:`font-mono w-[35%]`}),(0,Z.jsx)(l,{placeholder:`value`,value:e.value,onChange:e=>fe(n,e.target.value),className:`font-mono flex-1`}),(0,Z.jsx)(m,{variant:`ghost`,size:`icon`,onClick:()=>$(n),className:`h-9 w-9 flex-shrink-0`,children:(0,Z.jsx)(t,{className:`h-3.5 w-3.5`})})]},n))})}),U&&(0,Z.jsx)(`p`,{className:_.error,children:U}),(0,Z.jsxs)(`div`,{className:`border-t pt-4 flex items-center justify-between`,children:[s&&(0,Z.jsx)(m,{variant:`destructive`,onClick:xe,disabled:L||N,children:L?`Removing...`:`Remove`}),!s&&(0,Z.jsx)(`div`,{}),(0,Z.jsx)(m,{onClick:be,disabled:N||L||!Se,children:N?s?`Saving...`:`Adding...`:s?`Save`:`Add`})]})]})]})})}function $(e){return e.name.toLowerCase().replace(/\s+/g,`-`)}function de(e){return e.url?e.url:`${e.command??``} ${e.args?.join(` `)??``}`.trim()}function fe(){let e=V(e=>e.selectedProjectId),t=V(e=>e.projects).find(t=>t.projectId===e)?.projectPath,{installedServers:a,loadingConfig:c,loadInstalledServers:l}=se(t),{popularServers:u}=Y(),{setActiveMainTab:d,setPendingExplorerPath:f,triggerExplorerRefresh:p}=L(),[h,g]=(0,J.useState)(!1),[_,O]=(0,J.useState)(null),[k,A]=(0,J.useState)(null),[j,M]=(0,J.useState)(null),[F,I]=(0,J.useState)(!1),[z,B]=(0,J.useState)(``),ne=(0,J.useCallback)(async e=>{if(t){I(!0);try{await ce(t,e),await l(),p(),R({title:`MCP server removed`,description:e}),M(null)}catch(e){R({title:`Error`,description:e instanceof Error?e.message:`Failed to remove server`,variant:`destructive`})}finally{I(!1)}}},[t,l,p]),re=(0,J.useCallback)(()=>{f(`.agents/mcp.json`),d(`explorer`)},[f,d]),H=(0,J.useCallback)(async e=>{if(!t)return;let n=$(e);if(!a.some(t=>t.name===n||t.name===e.id)){if(e.url!==void 0){if(!e.url.trim()){O({name:n,config:{url:``,transport:e.transport??`sse`,...Object.keys(e.env??{}).length>0?{env:e.env}:{}}}),g(!0);return}try{await X(t,n,{url:e.url,transport:e.transport??`sse`,...Object.keys(e.env??{}).length>0?{env:e.env}:{}}),await l(),p(),R({title:`MCP server installed`,description:e.name})}catch(e){R({title:`Error`,description:e instanceof Error?e.message:`Failed to install server`,variant:`destructive`})}return}if(!e.command){R({title:`Error`,description:`This server is missing install configuration.`,variant:`destructive`});return}try{await X(t,n,{command:e.command,args:e.args??[],...Object.keys(e.env??{}).length>0?{env:e.env}:{}}),await l(),p(),R({title:`MCP server installed`,description:e.name})}catch(e){R({title:`Error`,description:e instanceof Error?e.message:`Failed to install server`,variant:`destructive`})}}},[t,a,l,p]),q=z.trim()?u.filter(e=>e.name.toLowerCase().includes(z.toLowerCase())||e.description.toLowerCase().includes(z.toLowerCase())):u;return e?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ee,{children:(0,Z.jsxs)(x,{children:[(0,Z.jsx)(te,{title:`MCP Servers`,description:`Manage Model Context Protocol servers for your project.`,action:(0,Z.jsx)(m,{onClick:()=>g(!0),children:`Add Server`})}),(0,Z.jsx)(b,{title:`Installed`}),c?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(U,{className:`h-20 w-full`}),(0,Z.jsx)(U,{className:`h-20 w-full`})]}):a.length===0?(0,Z.jsx)(ae,{icon:o,title:`No MCP servers installed`,description:`Add an MCP server to extend agent capabilities.`}):(0,Z.jsx)(`div`,{className:`space-y-3 mb-8`,children:a.map(e=>(0,Z.jsx)(G,{title:e.name,subtitle:de(e.config),subtitleMono:!0,actions:[{label:`View config file`,icon:(0,Z.jsx)(n,{className:`h-4 w-4`}),onClick:re},{label:`Edit server`,icon:(0,Z.jsx)(s,{className:`h-4 w-4`}),onClick:()=>A(e.name)},{label:`Delete server`,icon:(0,Z.jsx)(r,{className:`h-4 w-4`}),onClick:()=>M(e.name),destructive:!0}]},e.name))}),(0,Z.jsx)(b,{title:`Available`,className:`mb-0`}),(0,Z.jsx)(W,{placeholder:`Search available servers...`,value:z,onChange:B}),u.length===0?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(U,{className:`h-20 w-full`}),(0,Z.jsx)(U,{className:`h-20 w-full`})]}):q.length===0?(0,Z.jsx)(ie,{searchQuery:z,emptyLabel:`No available servers found.`}):(0,Z.jsx)(K,{children:q.map(e=>{let t=$(e),n=a.some(n=>n.name===t||n.name===e.id);return(0,Z.jsx)(oe,{name:e.name,description:e.description,installed:n,onClick:()=>{n||H(e)},showInstalledControls:!1},e.id)})})]})}),(0,Z.jsx)(v,{open:h,onOpenChange:e=>{g(e),e||O(null)},children:(0,Z.jsx)(i,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,Z.jsx)(Q,{projectPath:t,initialName:_?.name,initialConfig:_?.config,onBack:()=>{g(!1),O(null),l(),p()}})})}),(0,Z.jsx)(v,{open:k!==null,onOpenChange:e=>{e||A(null)},children:(0,Z.jsx)(i,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,Z.jsx)(Q,{projectPath:t,serverName:k??void 0,onBack:()=>{A(null),l(),p()}})})}),(0,Z.jsx)(T,{open:j!==null,onOpenChange:e=>!e&&M(null),children:(0,Z.jsxs)(N,{children:[(0,Z.jsxs)(E,{children:[(0,Z.jsx)(S,{children:`Delete MCP Server`}),(0,Z.jsxs)(C,{children:[`Are you sure you want to delete the server "`,j,`"? This action cannot be undone.`]})]}),(0,Z.jsxs)(w,{children:[(0,Z.jsx)(y,{children:`Cancel`}),(0,Z.jsx)(P,{onClick:()=>j&&void ne(j),disabled:F,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:F?`Deleting...`:`Delete`})]})]})})]}):(0,Z.jsx)(D,{children:`Select a project to manage MCP servers.`})}export{fe as SettingsMCPServersView,fe as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ht as t,La as n,Li as r,Ot as i,P as a,Qi as o,Sr as s,Ti as c,an as l,br as u,eo as d,fo as f,ht as p,ii as m,j as h,mo as g,ni as _,ut as v,vi as y,xr as ee,ya as b}from"./dialogs-config-B4TDFSrS.js";import{n as x,t as S}from"./react-vendor-unlDVFpU.js";import{A as te,C,D as w,E as ne,F as T,M as E,N as re,O as ie,P as ae,S as D,T as O,b as k,j as A,k as oe,x as se,y as j}from"./history-view-Ds_0e_bx.js";import{C as ce,E as M,O as N,j as P}from"./index-DOsSr4dl.js";import{t as F}from"./skeleton-BvSNJL9q.js";import{a as I,i as L,n as R,r as z,t as B}from"./settings-list-CUbZrggr.js";import{t as V}from"./mcp-server-card-DrUUKNXv.js";var H=f(),U=e(g(),1),W=c(),G=U.forwardRef((e,t)=>{let n=(0,H.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=m(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsx)(x,{className:m(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,W.jsx)(S,{className:a,...i,ref:t,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});G.displayName=S.displayName;function le({threadId:e,onRuleCreated:t}){let[n,r]=(0,U.useState)(``),[i,a]=(0,U.useState)(``),[o,s]=(0,U.useState)(!1),[c,f]=(0,U.useState)(!1),p=n.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),h=p.length>0&&p.length<=64;return e?(0,W.jsx)(w,{children:(0,W.jsxs)(j,{children:[(0,W.jsx)(D,{title:`Add Rule`,description:`Create a new agent rule. The rule will be saved as a .md file in the .agents/rules folder.`}),(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsxs)(k,{title:`Rule Name`,children:[(0,W.jsx)(u,{id:`ruleName`,value:n,onChange:e=>r(e.target.value),placeholder:`e.g. Code Style Guide`,disabled:c}),n?(0,W.jsxs)(`p`,{className:m(y.caption,`mt-2`),children:[`File name: `,(0,W.jsxs)(`span`,{className:`font-mono`,children:[p||`...`,`.md`]})]}):null]}),(0,W.jsx)(k,{title:`Description`,children:(0,W.jsx)(N,{id:`ruleDescription`,value:i,onChange:e=>a(e.target.value),placeholder:`Describe when Tarsk should apply this rule...`,className:`resize-none min-h-[120px]`,disabled:c})}),(0,W.jsx)(k,{title:`Always Apply`,description:o?`This rule will be automatically added to context for all conversations.`:`Only the rule description will be added to context, allowing the agent to read the rule file when needed.`,action:(0,W.jsx)(G,{id:`alwaysApply`,checked:o,onCheckedChange:s,disabled:c})}),(0,W.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,W.jsx)(_,{onClick:async()=>{if(!(!h||!e)){f(!0);try{let n=`---
|
|
2
|
-
description: ${i.trim()}
|
|
3
|
-
alwaysApply: ${o}
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Place your rule instructions here as markdown.
|
|
7
|
-
`;await l(e,`.agents/rules/${p}.md`,n),M({title:`Rule created`,description:`Rule '${p}' was created successfully.`}),r(``),a(``),s(!1),t?.(p)}catch(e){M({title:`Error`,description:e instanceof Error?e.message:`Failed to create rule`,variant:`destructive`})}finally{f(!1)}}},disabled:!h||!i.trim()||c,children:c?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(b,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,W.jsxs)(W.Fragment,{children:[`Continue`,(0,W.jsx)(d,{className:`ml-2 h-4 w-4`})]})})})]})]})}):(0,W.jsx)(O,{title:`No thread selected`,children:`Please select a thread to add a rule.`})}function K(e){let t=[];for(let n of e)n.type===`file`&&n.path.startsWith(`.agents/rules/`)&&t.push(n),n.children&&n.children.length>0&&t.push(...K(n.children));return t}function q(){let e=P(e=>e.selectedProjectId),c=P(e=>e.selectedThreadId),{setActiveMainTab:u,setPendingExplorerPath:d,triggerExplorerRefresh:f,setExplorerClearPath:m}=ce(),[g,y]=(0,U.useState)([]),[b,x]=(0,U.useState)(!1),[S,k]=(0,U.useState)(!1),[j,N]=(0,U.useState)(null),[H,G]=(0,U.useState)(!1),[q,J]=(0,U.useState)([]),[Y,X]=(0,U.useState)(new Set),[Z,ue]=(0,U.useState)(``),Q=(0,U.useCallback)(async()=>{if(e){x(!0);try{let t=K(await p(e));if(c)try{let e=K(await i(c)),n=new Set(t.map(e=>e.path));for(let r of e)n.has(r.path)||t.push(r)}catch{}y(t),X(new Set(t.map(e=>e.path)))}catch{y([]),X(new Set)}finally{x(!1)}}},[e,c]);(0,U.useEffect)(()=>{Q()},[Q]),(0,U.useEffect)(()=>{v().then(J).catch(()=>J([]))},[]);let de=(0,U.useCallback)(async t=>{if(!e)return;let n=t.name,r=t.path;G(!0);try{try{await h(e,r)}catch{if(c)await a(c,r);else throw Error(`No thread selected to delete from`)}m(r),f(),X(e=>{let t=new Set(e);return t.delete(r),t}),M({title:`Rule removed`,description:n}),N(null),await Q()}catch(e){M({title:`Error`,description:e instanceof Error?e.message:`Failed to remove rule`,variant:`destructive`})}finally{G(!1)}},[e,c,Q,f,m]),fe=(0,U.useCallback)(e=>{d(e),u(`explorer`)},[d,u]),pe=(0,U.useCallback)(async e=>{let n=`.agents/rules/${e.name}.md`;if(!(!c||Y.has(n)))try{e.gitHubRepo&&e.gitHubFolder?await t(c,e.gitHubRepo,e.gitHubFolder,`.agents/rules`):await l(c,n,[`---`,`description: ${e.description}`,`alwaysApply: ${e.alwaysApply??!1}`,`---`,``,e.content].join(`
|
|
8
|
-
`)),X(e=>new Set(e).add(n)),f(),Q(),M({title:`Rule installed`,description:e.name})}catch(e){M({title:`Error`,description:e instanceof Error?e.message:`Failed to install rule`,variant:`destructive`})}},[c,Y,f,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(w,{children:(0,W.jsxs)(ne,{children:[(0,W.jsx)(D,{title:`Rules`,description:`Manage agent rules. Rules define coding standards and project-wide guidelines.`,action:(0,W.jsx)(_,{onClick:()=>k(!0),disabled:!c,children:`Add Rule`})}),!c&&(0,W.jsx)(se,{children:`Select a thread to add or install rules.`}),(0,W.jsx)(C,{title:`Installed`}),b?(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(F,{className:`h-20 w-full`}),(0,W.jsx)(F,{className:`h-20 w-full`})]}):g.length===0?(0,W.jsx)(B,{icon:o,title:`No rules installed`,description:`Add rules to enforce coding standards and project conventions.`}):(0,W.jsx)(`div`,{className:`space-y-3 mb-8`,children:g.map(e=>(0,W.jsx)(R,{title:e.name,subtitle:e.path,subtitleMono:!0,actions:[{label:`View in explorer`,icon:(0,W.jsx)(n,{className:`h-4 w-4`}),onClick:()=>fe(e.path)},{label:`Delete rule`,icon:(0,W.jsx)(r,{className:`h-4 w-4`}),onClick:()=>N(e),destructive:!0}]},e.id))}),(0,W.jsx)(C,{title:`Available`,className:`mb-0`}),(0,W.jsx)(I,{placeholder:`Search available rules...`,value:Z,onChange:ue}),q.length===0?(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(F,{className:`h-20 w-full`}),(0,W.jsx)(F,{className:`h-20 w-full`})]}):$.length===0?(0,W.jsx)(L,{searchQuery:Z,emptyLabel:`No available rules found.`}):(0,W.jsx)(z,{children:$.map(e=>{let t=`.agents/rules/${e.name}.md`,n=Y.has(t);return(0,W.jsx)(V,{name:e.name,description:e.description,installed:n,onClick:()=>{n||pe(e)},showInstalledControls:!1},e.id)})})]})}),(0,W.jsx)(ee,{open:S,onOpenChange:k,children:(0,W.jsx)(s,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,W.jsx)(le,{threadId:c,onRuleCreated:()=>{k(!1),Q(),f()}})})}),(0,W.jsx)(ie,{open:j!==null,onOpenChange:e=>!e&&N(null),children:(0,W.jsxs)(A,{children:[(0,W.jsxs)(ae,{children:[(0,W.jsx)(T,{children:`Delete Rule`}),(0,W.jsxs)(E,{children:[`Are you sure you want to delete the rule "`,j?.name,`"? This action cannot be undone.`]})]}),(0,W.jsxs)(re,{children:[(0,W.jsx)(te,{children:`Cancel`}),(0,W.jsx)(oe,{onClick:()=>j&&void de(j),disabled:H,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:H?`Deleting...`:`Delete`})]})]})})]}):(0,W.jsx)(O,{children:`Select a project to manage rules.`})}export{q as SettingsRulesView,q as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{E as t,Ht as n,La as r,Li as i,Ot as a,P as o,Sr as s,Ti as c,an as l,br as u,dt as d,eo as f,ht as p,ii as m,j as ee,ji as te,mo as h,ni as g,vi as _,xr as ne,ya as v}from"./dialogs-config-B4TDFSrS.js";import{A as y,C as b,D as x,E as S,F as C,M as w,N as re,O as ie,P as ae,S as T,T as E,b as D,j as oe,k as se,x as ce,y as O}from"./history-view-Ds_0e_bx.js";import{C as le,E as k,O as A,j}from"./index-DOsSr4dl.js";import{t as M}from"./skeleton-BvSNJL9q.js";import{a as N,i as P,n as F,r as I,t as L}from"./settings-list-CUbZrggr.js";import{t as R}from"./mcp-server-card-DrUUKNXv.js";var z=e(h(),1),B=c();function V({threadId:e,onSkillCreated:n}){let[r,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(``),[s,c]=(0,z.useState)(!1),l=r.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),d=l.length>0&&l.length<=64;return e?(0,B.jsx)(x,{children:(0,B.jsxs)(O,{children:[(0,B.jsx)(T,{title:`Add Skill`,description:`Create a new agent skill. The skill will be saved as a SKILL.md file in the .agents/skills folder.`}),(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(D,{title:`Skill Name`,children:[(0,B.jsx)(u,{id:`skillName`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. Code Review`,disabled:s}),r?(0,B.jsxs)(`p`,{className:m(_.caption,`mt-2`),children:[`Folder name: `,(0,B.jsx)(`span`,{className:`font-mono`,children:l||`...`})]}):null]}),(0,B.jsx)(D,{title:`Description`,children:(0,B.jsx)(A,{id:`skillDescription`,value:a,onChange:e=>o(e.target.value),placeholder:`Describe when Tarsk should apply this skill`,className:`resize-none min-h-[120px]`,disabled:s})}),(0,B.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,B.jsx)(g,{onClick:async()=>{if(!(!d||!a.trim()||!e)){c(!0);try{let r=await t(e,l,a.trim());k({title:`Skill created`,description:`Skill '${l}' was created successfully.`}),i(``),o(``),n?.(r.path,`SKILL.md`)}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{c(!1)}}},disabled:!d||!a.trim()||s,children:s?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(v,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,B.jsxs)(B.Fragment,{children:[`Continue`,(0,B.jsx)(f,{className:`ml-2 h-4 w-4`})]})})})]})]})}):(0,B.jsx)(E,{title:`No thread selected`,children:`Please select a thread to add a skill.`})}function H(e){let t=[];for(let n of e){if(n.path===`.agents/skills`&&n.type===`folder`&&n.children)for(let e of n.children)e.type===`folder`&&t.push(e);n.children&&n.children.length>0&&t.push(...H(n.children))}return t}function U(){let e=j(e=>e.selectedProjectId),t=j(e=>e.selectedThreadId),{setActiveMainTab:c,setPendingExplorerPath:u,triggerExplorerRefresh:f,setExplorerClearPath:m}=le(),[h,_]=(0,z.useState)([]),[v,D]=(0,z.useState)(!1),[O,A]=(0,z.useState)(!1),[U,W]=(0,z.useState)(null),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)([]),[Y,X]=(0,z.useState)(new Set),[Z,ue]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(e){D(!0);try{let n=H(await p(e));if(t)try{let e=H(await a(t)),r=new Set(n.map(e=>e.path));for(let t of e)r.has(t.path)||n.push(t)}catch{}_(n),X(new Set(n.map(e=>`${e.path}/SKILL.md`)))}catch{_([]),X(new Set)}finally{D(!1)}}},[e,t]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{d().then(J).catch(()=>J([]))},[]);let de=(0,z.useCallback)(async n=>{if(!e)return;let r=n.name,i=n.path;K(!0);try{try{await ee(e,i)}catch{if(t)await o(t,i);else throw Error(`No thread selected to delete from`)}m(i),f(),X(e=>{let t=new Set(e);return t.delete(`${i}/SKILL.md`),t}),k({title:`Skill removed`,description:r}),W(null),await Q()}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to remove skill`,variant:`destructive`})}finally{K(!1)}},[e,t,Q,f,m]),fe=(0,z.useCallback)(e=>{u(`${e}/SKILL.md`),c(`explorer`)},[u,c]),pe=(0,z.useCallback)(async e=>{let r=`.agents/skills/${e.id}/SKILL.md`;if(!(!t||Y.has(r)))try{if(e.gitHubRepo&&e.gitHubFolder)await n(t,e.gitHubRepo,e.gitHubFolder,`.agents/skills/${e.id}`);else{let n=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.allowedTools&&n.push(`allowed-tools: ${e.allowedTools}`),e.license&&n.push(`license: ${e.license}`),n.push(`---`,``,e.instructions),await l(t,r,n.join(`
|
|
2
|
-
`))}X(e=>new Set(e).add(r)),f(),Q(),k({title:`Skill installed`,description:e.name})}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to install skill`,variant:`destructive`})}},[t,Y,f,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(x,{children:(0,B.jsxs)(S,{children:[(0,B.jsx)(T,{title:`Skills`,description:`Manage agent skills. Skills are reusable instruction sets that guide agent behavior.`,action:(0,B.jsx)(g,{onClick:()=>A(!0),disabled:!t,children:`Add Skill`})}),!t&&(0,B.jsx)(ce,{children:`Select a thread to add or install skills.`}),(0,B.jsx)(b,{title:`Installed`}),v?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(M,{className:`h-20 w-full`}),(0,B.jsx)(M,{className:`h-20 w-full`})]}):h.length===0?(0,B.jsx)(L,{icon:te,title:`No skills installed`,description:`Add skills to extend agent capabilities with reusable instructions.`}):(0,B.jsx)(`div`,{className:`space-y-3 mb-8`,children:h.map(e=>(0,B.jsx)(F,{title:e.name,subtitle:e.path,subtitleMono:!0,actions:[{label:`View in explorer`,icon:(0,B.jsx)(r,{className:`h-4 w-4`}),onClick:()=>fe(e.path)},{label:`Delete skill`,icon:(0,B.jsx)(i,{className:`h-4 w-4`}),onClick:()=>W(e),destructive:!0}]},e.id))}),(0,B.jsx)(b,{title:`Available`,className:`mb-0`}),(0,B.jsx)(N,{placeholder:`Search available skills...`,value:Z,onChange:ue}),q.length===0?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(M,{className:`h-20 w-full`}),(0,B.jsx)(M,{className:`h-20 w-full`})]}):$.length===0?(0,B.jsx)(P,{searchQuery:Z,emptyLabel:`No available skills found.`}):(0,B.jsx)(I,{children:$.map(e=>{let t=`.agents/skills/${e.id}/SKILL.md`,n=Y.has(t);return(0,B.jsx)(R,{name:e.name,description:e.description,installed:n,onClick:()=>{n||pe(e)},showInstalledControls:!1},e.id)})})]})}),(0,B.jsx)(ne,{open:O,onOpenChange:A,children:(0,B.jsx)(s,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,B.jsx)(V,{threadId:t,onSkillCreated:()=>{A(!1),Q(),f()}})})}),(0,B.jsx)(ie,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,B.jsxs)(oe,{children:[(0,B.jsxs)(ae,{children:[(0,B.jsx)(C,{children:`Delete Skill`}),(0,B.jsxs)(w,{children:[`Are you sure you want to delete the skill "`,U?.name,`"? This action cannot be undone.`]})]}),(0,B.jsxs)(re,{children:[(0,B.jsx)(y,{children:`Cancel`}),(0,B.jsx)(se,{onClick:()=>U&&void de(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,B.jsx)(E,{children:`Select a project to manage skills.`})}export{U as SettingsSkillsView,U as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{C as t,Ht as n,La as r,Li as i,M as a,Sr as o,Ti as s,br as c,eo as l,ft as u,ii as d,mo as f,ni as p,vi as m,vr as h,wt as g,xr as _,ya as v,zi as y}from"./dialogs-config-B4TDFSrS.js";import{A as b,C as x,D as S,E as C,F as ee,M as te,N as w,O as T,P as ne,S as E,T as D,b as O,j as k,k as A,x as j,y as M}from"./history-view-Ds_0e_bx.js";import{C as re,E as N,j as P}from"./index-DOsSr4dl.js";import{t as F}from"./skeleton-BvSNJL9q.js";import{n as I,t as L}from"./radio-group-c0sU992r.js";import{a as ie,i as ae,n as oe,r as R,t as se}from"./settings-list-CUbZrggr.js";import{t as ce}from"./mcp-server-card-DrUUKNXv.js";var z=e(f(),1),B=s();function V({projectId:e,threadId:n,onCommandCreated:r}){let[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(``),[u,f]=(0,z.useState)(``),[g,_]=(0,z.useState)(`default`),[y,b]=(0,z.useState)(!1),x=i.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),C=x.length>0&&x.length<=64;return e?(0,B.jsx)(S,{children:(0,B.jsxs)(M,{children:[(0,B.jsx)(E,{title:`Add Slash Command`,description:`Create a new slash command. The command will be saved as a .md file in the ~/.agents/commands folder.`}),(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(O,{title:`Command Name`,children:[(0,B.jsx)(c,{id:`commandName`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g. review`,disabled:y}),i?(0,B.jsxs)(`p`,{className:d(m.caption,`mt-2`),children:[`Command: `,(0,B.jsxs)(`span`,{className:`font-mono`,children:[`/`,x||`...`]})]}):null]}),(0,B.jsx)(O,{title:`Description`,children:(0,B.jsx)(c,{id:`commandDescription`,value:o,onChange:e=>s(e.target.value),placeholder:`Brief description shown in autocomplete`,disabled:y})}),(0,B.jsx)(O,{title:`Argument Hint`,description:`Shows after the command name to guide users what to type`,children:(0,B.jsx)(c,{id:`argumentHint`,value:u,onChange:e=>f(e.target.value),placeholder:`e.g. <focus-area> or <branch-name>`,disabled:y})}),(0,B.jsx)(O,{title:`Mode`,description:g==="default"?`Standard chat mode`:`Activates plan mode when this command is used`,children:(0,B.jsxs)(L,{value:g,onValueChange:e=>_(e),className:`flex gap-4`,disabled:y,children:[(0,B.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,B.jsx)(I,{value:`default`,id:`mode-default`}),(0,B.jsx)(h,{htmlFor:`mode-default`,className:d(m.labelNormal,`cursor-pointer`),children:`Default`})]}),(0,B.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,B.jsx)(I,{value:`plan`,id:`mode-plan`}),(0,B.jsx)(h,{htmlFor:`mode-plan`,className:d(m.labelNormal,`cursor-pointer`),children:`Plan`})]})]})}),(0,B.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,B.jsx)(p,{onClick:async()=>{if(!(!C||!e)){b(!0);try{await t(x,``,{description:o.trim()||void 0,argumentHint:u.trim()||void 0,mode:g===`plan`?`plan`:void 0},`project`,n??void 0),N({title:`Command created`,description:`Command '/${x}' was created successfully.`}),a(``),s(``),f(``),_(`default`),r?.(x)}catch(e){N({title:`Error`,description:e instanceof Error?e.message:`Failed to create command`,variant:`destructive`})}finally{b(!1)}}},disabled:!C||y,children:y?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(v,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,B.jsxs)(B.Fragment,{children:[`Continue`,(0,B.jsx)(l,{className:`ml-2 h-4 w-4`})]})})})]})]})}):(0,B.jsx)(D,{title:`No project selected`,children:`Please select a project to add a slash command.`})}function H(){let e=P(e=>e.selectedProjectId),s=P(e=>e.selectedThreadId),{setActiveMainTab:c,setPendingExplorerPath:l,triggerExplorerRefresh:f,setExplorerClearPath:h}=re(),[v,O]=(0,z.useState)([]),[M,I]=(0,z.useState)(!1),[L,H]=(0,z.useState)(!1),[U,W]=(0,z.useState)(null),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)([]),[Y,X]=(0,z.useState)(new Map),[Z,le]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(s){I(!0);try{let e=await g(s);O(e.filter(e=>!e.isBuiltIn)),X(new Map(e.map(e=>[e.name,e.filePath])))}catch{O([]),X(new Map)}finally{I(!1)}}},[s]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{u().then(J).catch(()=>J([]))},[]);let ue=(0,z.useCallback)(async e=>{K(!0);try{await a(e.filePath),h(e.filePath),f(),X(t=>{let n=new Map(t);return n.delete(e.name),n}),N({title:`Command removed`,description:`/${e.name}`}),W(null),await Q()}catch(e){N({title:`Error`,description:e instanceof Error?e.message:`Failed to remove command`,variant:`destructive`})}finally{K(!1)}},[Q,f,h]),de=(0,z.useCallback)(e=>{l(e),c(`explorer`)},[l,c]),fe=(0,z.useCallback)(async e=>{if(!(!s||Y.has(e.name)))try{if(e.gitHubRepo&&e.gitHubFolder){let t=`.agents/commands`;await n(s,e.gitHubRepo,e.gitHubFolder,t);let r=`${t}/${e.name}.md`;X(t=>new Map(t).set(e.name,r))}else{let n=await t(e.name,e.content,{description:e.description,argumentHint:e.argumentHint},`project`,s);X(t=>new Map(t).set(e.name,n.filePath))}f(),Q(),N({title:`Command installed`,description:`/${e.name}`})}catch(e){N({title:`Error`,description:e instanceof Error?e.message:`Failed to install command`,variant:`destructive`})}},[s,Y,f,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{children:(0,B.jsxs)(C,{children:[(0,B.jsx)(E,{title:`Slash Commands`,description:`Manage slash commands. Commands are quick actions available via / in chat.`,action:(0,B.jsx)(p,{onClick:()=>H(!0),disabled:!s,children:`Add Command`})}),!s&&(0,B.jsx)(j,{children:`Select a thread to add or install slash commands.`}),(0,B.jsx)(x,{title:`Installed`}),M?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(F,{className:`h-20 w-full`}),(0,B.jsx)(F,{className:`h-20 w-full`})]}):v.length===0?(0,B.jsx)(se,{icon:y,title:`No slash commands installed`,description:`Add slash commands to create quick actions in chat.`}):(0,B.jsx)(`div`,{className:`space-y-3 mb-8`,children:v.map(e=>(0,B.jsx)(oe,{title:`/${e.name}`,subtitle:e.metadata?.description||`No description`,badge:e.metadata?.mode?(0,B.jsx)(`span`,{className:d(m.compact,`bg-muted px-1.5 py-0.5 rounded flex-shrink-0`),children:e.metadata.mode}):void 0,actions:[{label:`View in explorer`,icon:(0,B.jsx)(r,{className:`h-4 w-4`}),onClick:()=>de(e.filePath)},{label:`Delete command`,icon:(0,B.jsx)(i,{className:`h-4 w-4`}),onClick:()=>W(e),destructive:!0}]},e.filePath))}),(0,B.jsx)(x,{title:`Available`,className:`mb-0`}),(0,B.jsx)(ie,{placeholder:`Search available commands...`,value:Z,onChange:le}),q.length===0?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(F,{className:`h-20 w-full`}),(0,B.jsx)(F,{className:`h-20 w-full`})]}):$.length===0?(0,B.jsx)(ae,{searchQuery:Z,emptyLabel:`No available commands found.`}):(0,B.jsx)(R,{children:$.map(e=>{let t=Y.has(e.name);return(0,B.jsx)(ce,{name:`/${e.name}`,description:e.description,installed:t,onClick:()=>{t||fe(e)},showInstalledControls:!1},e.id)})})]})}),(0,B.jsx)(_,{open:L,onOpenChange:H,children:(0,B.jsx)(o,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,B.jsx)(V,{projectId:e,threadId:s,onCommandCreated:()=>{H(!1),Q(),f()}})})}),(0,B.jsx)(T,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,B.jsxs)(k,{children:[(0,B.jsxs)(ne,{children:[(0,B.jsx)(ee,{children:`Delete Slash Command`}),(0,B.jsxs)(te,{children:[`Are you sure you want to delete "/`,U?.name,`"? This action cannot be undone.`]})]}),(0,B.jsxs)(w,{children:[(0,B.jsx)(b,{children:`Cancel`}),(0,B.jsx)(A,{onClick:()=>U&&void ue(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,B.jsx)(D,{children:`Select a project to manage slash commands.`})}export{H as SettingsSlashCommandsView,H as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ht as t,La as n,Li as r,Mi as i,Ot as a,P as o,Sr as s,T as c,Ti as l,an as u,br as d,ct as f,eo as p,ht as m,ii as h,j as ee,mo as g,ni as _,vi as v,xr as te,ya as y}from"./dialogs-config-B4TDFSrS.js";import{A as b,C as x,D as S,E as ne,F as C,M as w,N as T,O as re,P as ie,S as E,T as D,b as O,j as k,k as ae,x as oe,y as A}from"./history-view-Ds_0e_bx.js";import{C as se,E as j,O as M,j as N}from"./index-DOsSr4dl.js";import{t as P}from"./skeleton-BvSNJL9q.js";import{a as ce,i as le,n as F,r as I,t as L}from"./settings-list-CUbZrggr.js";import{t as R}from"./mcp-server-card-DrUUKNXv.js";var z=e(g(),1),B=l();function V({threadId:e,onAgentCreated:t}){let[n,r]=(0,z.useState)(``),[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(``),[l,u]=(0,z.useState)(!1),f=n.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),m=f.length>0&&f.length<=64;return e?(0,B.jsx)(S,{children:(0,B.jsxs)(A,{children:[(0,B.jsx)(E,{title:`Add Agent`,description:`Create a new subagent. The agent will be saved as an AGENT.md file in the .agents/agents folder.`}),(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(O,{title:`Agent Name`,children:[(0,B.jsx)(d,{id:`agentName`,value:n,onChange:e=>r(e.target.value),placeholder:`e.g. Security Reviewer`,disabled:l}),n?(0,B.jsxs)(`p`,{className:h(v.caption,`mt-2`),children:[`Folder name: `,(0,B.jsx)(`span`,{className:`font-mono`,children:f||`...`})]}):null]}),(0,B.jsx)(O,{title:`Description`,children:(0,B.jsx)(M,{id:`agentDescription`,value:i,onChange:e=>a(e.target.value),placeholder:`Describe what this agent does and when it should be invoked`,className:`resize-none min-h-[120px]`,disabled:l})}),(0,B.jsx)(O,{title:`Allowed Tools`,description:`Space-separated list of tools this agent can use. Leave empty to allow all coding tools.`,children:(0,B.jsx)(d,{id:`agentTools`,value:o,onChange:e=>s(e.target.value),placeholder:`e.g. read grep glob`,disabled:l})}),(0,B.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,B.jsx)(_,{onClick:async()=>{if(!(!m||!i.trim()||!e)){u(!0);try{let n=await c(e,f,i.trim(),o.trim()||void 0);j({title:`Agent created`,description:`Agent '${f}' was created successfully.`}),r(``),a(``),s(``),t?.(n.path,`AGENT.md`)}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to create agent`,variant:`destructive`})}finally{u(!1)}}},disabled:!m||!i.trim()||l,children:l?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(y,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,B.jsxs)(B.Fragment,{children:[`Continue`,(0,B.jsx)(p,{className:`ml-2 h-4 w-4`})]})})})]})]})}):(0,B.jsx)(D,{title:`No thread selected`,children:`Please select a thread to add an agent.`})}function H(e){let t=[];for(let n of e)n.path.startsWith(`.agents/agents/`)&&n.type===`folder`&&t.push(n),n.children&&n.children.length>0&&t.push(...H(n.children));return t}function U(){let e=N(e=>e.selectedProjectId),c=N(e=>e.selectedThreadId),{setActiveMainTab:l,setPendingExplorerPath:d,triggerExplorerRefresh:p,setExplorerClearPath:h}=se(),[g,v]=(0,z.useState)([]),[y,O]=(0,z.useState)(!1),[A,M]=(0,z.useState)(!1),[U,W]=(0,z.useState)(null),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)([]),[Y,X]=(0,z.useState)(new Set),[Z,ue]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(e){O(!0);try{let t=H(await m(e));if(c)try{let e=H(await a(c)),n=new Set(t.map(e=>e.path));for(let r of e)n.has(r.path)||t.push(r)}catch{}v(t),X(new Set(t.map(e=>`${e.path}/AGENT.md`)))}catch{v([]),X(new Set)}finally{O(!1)}}},[e,c]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{f().then(J).catch(()=>J([]))},[]);let de=(0,z.useCallback)(async t=>{if(!e)return;let n=t.name,r=t.path;K(!0);try{try{await ee(e,r)}catch{if(c)await o(c,r);else throw Error(`No thread selected to delete from`)}h(r),p(),X(e=>{let t=new Set(e);return t.delete(`${r}/AGENT.md`),t}),j({title:`Agent removed`,description:n}),W(null),await Q()}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to remove agent`,variant:`destructive`})}finally{K(!1)}},[e,c,Q,p,h]),fe=(0,z.useCallback)(e=>{d(`${e}/AGENT.md`),l(`explorer`)},[d,l]),pe=(0,z.useCallback)(async e=>{let n=`.agents/agents/${e.id}/AGENT.md`;if(!(!c||Y.has(n)))try{if(e.gitHubRepo&&e.gitHubFolder)await t(c,e.gitHubRepo,e.gitHubFolder,`.agents/agents/${e.id}`);else{let t=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.tools&&t.push(`tools: ${e.tools}`),t.push(`---`,``,e.systemPrompt),await u(c,n,t.join(`
|
|
2
|
-
`))}X(e=>new Set(e).add(n)),p(),Q(),j({title:`Agent installed`,description:e.name})}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to install agent`,variant:`destructive`})}},[c,Y,p,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{children:(0,B.jsxs)(ne,{children:[(0,B.jsx)(E,{title:`Subagents`,description:`Manage subagents. Subagents are specialized agents for focused tasks.`,action:(0,B.jsx)(_,{onClick:()=>M(!0),disabled:!c,children:`Add Subagent`})}),!c&&(0,B.jsx)(oe,{children:`Select a thread to add or install subagents.`}),(0,B.jsx)(x,{title:`Installed`}),y?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(P,{className:`h-20 w-full`}),(0,B.jsx)(P,{className:`h-20 w-full`})]}):g.length===0?(0,B.jsx)(L,{icon:i,title:`No subagents installed`,description:`Add subagents for specialized, focused tasks.`}):(0,B.jsx)(`div`,{className:`space-y-3 mb-8`,children:g.map(e=>(0,B.jsx)(F,{title:e.name,subtitle:e.path,subtitleMono:!0,actions:[{label:`View in explorer`,icon:(0,B.jsx)(n,{className:`h-4 w-4`}),onClick:()=>fe(e.path)},{label:`Delete agent`,icon:(0,B.jsx)(r,{className:`h-4 w-4`}),onClick:()=>W(e),destructive:!0}]},e.id))}),(0,B.jsx)(x,{title:`Available`,className:`mb-0`}),(0,B.jsx)(ce,{placeholder:`Search available subagents...`,value:Z,onChange:ue}),q.length===0?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(P,{className:`h-20 w-full`}),(0,B.jsx)(P,{className:`h-20 w-full`})]}):$.length===0?(0,B.jsx)(le,{searchQuery:Z,emptyLabel:`No available subagents found.`}):(0,B.jsx)(I,{children:$.map(e=>{let t=`.agents/agents/${e.id}/AGENT.md`,n=Y.has(t);return(0,B.jsx)(R,{name:e.name,description:e.description,installed:n,onClick:()=>{n||pe(e)},showInstalledControls:!1},e.id)})})]})}),(0,B.jsx)(te,{open:A,onOpenChange:M,children:(0,B.jsx)(s,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,B.jsx)(V,{threadId:c,onAgentCreated:()=>{M(!1),Q(),p()}})})}),(0,B.jsx)(re,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,B.jsxs)(k,{children:[(0,B.jsxs)(ie,{children:[(0,B.jsx)(C,{children:`Delete Subagent`}),(0,B.jsxs)(w,{children:[`Are you sure you want to delete the subagent "`,U?.name,`"? This action cannot be undone.`]})]}),(0,B.jsxs)(T,{children:[(0,B.jsx)(b,{children:`Cancel`}),(0,B.jsx)(ae,{onClick:()=>U&&void de(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,B.jsx)(D,{children:`Select a project to manage subagents.`})}export{U as SettingsSubagentsView,U as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ti as t,Ut as n,bn as r,ii as i,mo as a,ni as o,vi as s,vr as c,vt as l,ya as u}from"./dialogs-config-B4TDFSrS.js";import{n as d}from"./onboarding-DfL8a0LZ.js";import{A as f,E as p,F as m,M as h,N as g,O as _,P as v,S as y,T as b,j as x,k as S,w as C}from"./history-view-Ds_0e_bx.js";import{E as w,O as T,j as E}from"./index-DOsSr4dl.js";var D=e(a(),1),O=t();function k(){let e=E(e=>e.selectedProjectId),[t,a]=(0,D.useState)(``),[k,A]=(0,D.useState)(``),[j,M]=(0,D.useState)(!0),[N,P]=(0,D.useState)(!1),[F,I]=(0,D.useState)(``),[L,R]=(0,D.useState)(!1),[z,B]=(0,D.useState)(!1),[V,H]=(0,D.useState)(!1);(0,D.useEffect)(()=>{e&&(R(!0),l(e).then(e=>{let t=e.useCustomSystemPrompt;a(e.generatedPrompt),P(t),I(e.customSystemPrompt),M(!t),A(t?e.customSystemPrompt:e.generatedPrompt)}).catch(()=>{a(``),A(``),M(!0),P(!1),I(``)}).finally(()=>R(!1)))},[e]);function U(){return j?N:k.trim()!==F.trim()}function W(e){A(e),j&&M(!1)}function G(){A(t),M(!0)}function K(e){if(!e){M(!1);return}if(k===t){G();return}H(!0)}function q(){G(),H(!1)}function J(){H(!1)}async function Y(){if(e){if(!j&&!k.trim()){w({title:`System prompt required`,description:`Enter a system prompt or enable Generated.`,variant:`destructive`});return}B(!0);try{await r(e,{customSystemPrompt:j?null:k.trim(),useCustomSystemPrompt:!j}),n(),P(!j),I(j?``:k.trim()),w({title:`System prompt settings saved`})}catch(e){w({title:`Error`,description:e instanceof Error?e.message:`Failed to save system prompt settings`,variant:`destructive`})}finally{B(!1)}}}return e?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(C,{children:(0,O.jsxs)(p,{className:`w-full flex-1 flex flex-col min-h-0`,children:[(0,O.jsx)(y,{title:`System Prompt`,description:`View the default system prompt or override it for this project. Instructions, rules, and other context are added separately at runtime.`,action:(0,O.jsx)(o,{onClick:Y,disabled:L||z||!U(),children:z?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(u,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`})}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,O.jsx)(d,{id:`use-generated-prompt`,checked:j,onCheckedChange:e=>K(e===!0),disabled:L||z}),(0,O.jsx)(c,{htmlFor:`use-generated-prompt`,className:i(s.labelNormal,`cursor-pointer`),children:`Generated`})]}),L?(0,O.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,O.jsx)(u,{className:`h-8 w-8 animate-spin text-muted-foreground`})}):(0,O.jsx)(T,{value:k,onChange:e=>W(e.target.value),className:i(s.mono,`flex-1 min-h-0 resize-none`),placeholder:`System prompt will appear here...`,disabled:z})]})}),(0,O.jsx)(_,{open:V,onOpenChange:H,children:(0,O.jsxs)(x,{children:[(0,O.jsxs)(v,{children:[(0,O.jsx)(m,{children:`Overwrite custom system prompt?`}),(0,O.jsx)(h,{children:`This will replace your custom system prompt with the generated default. You can save the change after confirming.`})]}),(0,O.jsxs)(g,{children:[(0,O.jsx)(f,{onClick:J,children:`No`}),(0,O.jsx)(S,{onClick:q,children:`Yes`})]})]})})]}):(0,O.jsx)(b,{children:`Select a project to edit the system prompt.`})}export{k as SettingsSystemPromptView,k as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-general-view-DI-lvP0L.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-DOsSr4dl.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-Ds_0e_bx.js","assets/dialogs-config-B4TDFSrS.js","assets/onboarding-DfL8a0LZ.js","assets/whisper-wasm-Cq5Ofwpd.js","assets/react-vendor-unlDVFpU.js","assets/utils-umVhs9to.js","assets/index-C0lTt0ZK.css","assets/project-settings-view-Cd_l3Lfy.js","assets/radio-group-c0sU992r.js","assets/providers-list-view-VXhgM3vp.js","assets/skeleton-BvSNJL9q.js","assets/settings-models-view-ms828HDa.js","assets/settings-models-skeleton-B_56ozbA.js","assets/settings-list-CUbZrggr.js","assets/settings-mcp-servers-view-DmxUO42I.js","assets/mcp-server-card-DrUUKNXv.js","assets/settings-skills-view-DvPPdsi_.js","assets/settings-rules-view-Xx0ymfnQ.js","assets/settings-slash-commands-view-BULIAW2o.js","assets/settings-subagents-view-B7FcLaZT.js","assets/settings-instructions-view-kUG32_dT.js","assets/settings-system-prompt-view-66zf0gRc.js","assets/account-view-k5jIArY-.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ga as t,Mi as n,Na as r,Ni as i,Qi as a,Ti as o,Ut as s,Wi as c,Xt as l,Yi as u,ca as d,fo as f,ii as p,io as m,ji as h,mo as g,ni as ee,oo as te,qi as ne,vi as _,wa as v,yt as y,zi as b}from"./dialogs-config-B4TDFSrS.js";import{ct as x,lt as re,st as ie}from"./react-vendor-unlDVFpU.js";import{r as S}from"./monaco-CZnIWXyV.js";import{c as C,u as w}from"./onboarding-DfL8a0LZ.js";import{D as T,E,T as D}from"./history-view-Ds_0e_bx.js";import{A as O,T as k,a as ae,i as A,j,k as oe,n as M,o as N,r as se}from"./index-DOsSr4dl.js";import{t as P}from"./settings-models-skeleton-B_56ozbA.js";var F=f(),I=e(g(),1),L=o(),ce=(0,I.forwardRef)(function(e,t){let n=(0,F.c)(28),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:u,className:d,onCollapse:f,onExpand:m,isMobile:h,mobileShowSidebar:g}=e,ee=a===void 0?25:a,te=o===void 0?20:o,ne=s===void 0?30:s,_=c===void 0?40:c,v=l===void 0?!1:l,y=u===void 0?0:u,b=d===void 0?``:d,x=h===void 0?!1:h,re=g===void 0?!0:g,ie=x&&!re,S=x&&re,C=`h-full ${b}`,w=x?100:ee,T=x?50:te,E=x?100:ne,D=ie&&`hidden`,O;n[0]===D?O=n[1]:(O=p(`border-r border-transparent`,D),n[0]=D,n[1]=O);let k;n[2]!==y||n[3]!==v||n[4]!==f||n[5]!==m||n[6]!==t||n[7]!==r||n[8]!==w||n[9]!==T||n[10]!==E||n[11]!==O?(k=(0,L.jsx)(A,{ref:t,defaultSize:w,minSize:T,maxSize:E,collapsible:v,collapsedSize:y,onCollapse:f,onExpand:m,className:O,children:r}),n[2]=y,n[3]=v,n[4]=f,n[5]=m,n[6]=t,n[7]=r,n[8]=w,n[9]=T,n[10]=E,n[11]=O,n[12]=k):k=n[12];let j;n[13]===x?j=n[14]:(j=!x&&(0,L.jsx)(se,{withHandle:!0,className:`ml-[-40px]`}),n[13]=x,n[14]=j);let oe=S&&`hidden`,M;n[15]===oe?M=n[16]:(M=p(`overflow-hidden`,oe),n[15]=oe,n[16]=M);let N;n[17]!==i||n[18]!==_||n[19]!==M?(N=(0,L.jsx)(A,{minSize:_,className:M,children:i}),n[17]=i,n[18]=_,n[19]=M,n[20]=N):N=n[20];let P;n[21]!==k||n[22]!==j||n[23]!==N?(P=(0,L.jsxs)(ae,{direction:`horizontal`,className:`h-full`,children:[k,j,N]}),n[21]=k,n[22]=j,n[23]=N,n[24]=P):P=n[24];let I;return n[25]!==C||n[26]!==P?(I=(0,L.jsx)(`div`,{className:C,children:P}),n[25]=C,n[26]=P,n[27]=I):I=n[27],I}),le=[{id:`providers`,label:`Providers`,icon:(0,L.jsx)(t,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,L.jsx)(m,{className:`h-4 w-4`}),route:`/settings/models`},{id:`skills`,label:`Skills`,icon:(0,L.jsx)(h,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,L.jsx)(a,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,L.jsx)(b,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,L.jsx)(n,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,L.jsx)(te,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`system-prompt`,label:`System Prompt`,icon:(0,L.jsx)(c,{className:`h-4 w-4`}),route:`/settings/system-prompt`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,L.jsx)(u,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`general`,label:`General`,icon:(0,L.jsx)(ne,{className:`h-4 w-4`}),route:`/settings/general`},{id:`history`,label:`History`,icon:(0,L.jsx)(v,{className:`h-4 w-4`}),route:`/settings/history`},{id:`account`,label:`Account`,icon:(0,L.jsx)(i,{className:`h-4 w-4`}),route:`/settings/account`}];function R(e){let t=[...le];if(!e)return t;let n=t.findIndex(e=>e.id===`skills`);return t.splice(n,0,{id:`project`,label:`Project`,icon:(0,L.jsx)(r,{className:`h-4 w-4`}),route:`/settings/project/${e}`}),t}function ue(e){let t=(0,F.c)(13),{className:n,selectedProjectId:r,onResetOnboarding:i,onNavItemSelect:a}=e,o=x(),s=ie(),c=(0,I.useRef)(0),l=(0,I.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,I.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=R(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,L.jsxs)(I.Fragment,{children:[(0,L.jsx)(w,{selected:u===t.id,asChild:!0,children:(0,L.jsx)(`button`,{className:`justify-start`,onClick:()=>d(t),children:(0,L.jsxs)(`span`,{className:`flex items-center gap-2`,children:[t.icon,(0,L.jsx)(`span`,{children:t.label})]})})}),(t.id===`models`||t.id===`mcp-servers`||n===e.length-1)&&(0,L.jsx)(C,{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,L.jsx)(`div`,{className:f,children:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12],m}var de=(0,I.lazy)(()=>S(()=>import(`./settings-general-view-DI-lvP0L.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),fe=(0,I.lazy)(()=>S(()=>import(`./project-settings-view-Cd_l3Lfy.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11,13]))),pe=(0,I.lazy)(()=>S(()=>import(`./providers-list-view-VXhgM3vp.js`),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,15]))),me=(0,I.lazy)(()=>S(()=>import(`./settings-models-view-ms828HDa.js`),__vite__mapDeps([16,1,2,3,4,5,6,7,8,9,10,11,17,15,18]))),he=(0,I.lazy)(()=>S(()=>import(`./settings-mcp-servers-view-DmxUO42I.js`),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),ge=(0,I.lazy)(()=>S(()=>import(`./settings-skills-view-DvPPdsi_.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),_e=(0,I.lazy)(()=>S(()=>import(`./settings-rules-view-Xx0ymfnQ.js`),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),ve=(0,I.lazy)(()=>S(()=>import(`./settings-slash-commands-view-BULIAW2o.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,10,11,20,13,18,15]))),ye=(0,I.lazy)(()=>S(()=>import(`./settings-subagents-view-B7FcLaZT.js`),__vite__mapDeps([24,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),be=(0,I.lazy)(()=>S(()=>import(`./settings-instructions-view-kUG32_dT.js`),__vite__mapDeps([25,1,2,3,4,5,6,7,8,9,10,11]))),xe=(0,I.lazy)(()=>S(()=>import(`./settings-system-prompt-view-66zf0gRc.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11]))),Se=(0,I.lazy)(()=>S(()=>import(`./account-view-k5jIArY-.js`),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,15]))),Ce=(0,I.lazy)(()=>S(()=>import(`./history-view-Ds_0e_bx.js`).then(e=>e.t),__vite__mapDeps([5,1,6]))),we=[`general`,`providers`,`models`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`system-prompt`,`mcp-servers`,`history`,`account`];function z(e){let t=(0,F.c)(2),{title:n}=e,r;return t[0]===n?r=t[1]:(r=(0,L.jsx)(D,{title:n,children:`Content coming soon...`}),t[0]=n,t[1]=r),r}function Te(){let e=(0,F.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,L.jsxs)(`div`,{className:`mb-6`,children:[(0,L.jsx)(`div`,{className:`h-8 w-32 bg-muted rounded animate-pulse mb-2`}),(0,L.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,L.jsx)(`div`,{className:`mb-6`,children:(0,L.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,L.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,L.jsxs)(`div`,{children:[r,(0,L.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,L.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,L.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`})]})]}),a=(0,L.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,L.jsx)(T,{children:(0,L.jsxs)(E,{children:[t,n,(0,L.jsxs)(`div`,{className:`space-y-8`,children:[i,(0,L.jsxs)(`div`,{children:[a,(0,L.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,L.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,L.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,L.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,L.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`})]})]})]})]})}),e[5]=o):o=e[5],o}function Ee(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 De(){let e=(0,F.c)(62),{tab:t,projectId:n}=re(),r=x(),i=ie(),a=O(),o=j(Ae),c=j(ke),u;e[0]!==i.pathname||e[1]!==n?(u=!!n&&i.pathname.startsWith(`/settings/project/`),e[0]=i.pathname,e[1]=n,e[2]=u):u=e[2];let f=u,m;if(e[3]!==i.pathname||e[4]!==i.search||e[5]!==t){let n=new URLSearchParams(i.search).get(`tab`);m=n&&we.includes(n)?n:t&&we.includes(t)?t:Ee(i.pathname),e[3]=i.pathname,e[4]=i.search,e[5]=t,e[6]=m}else m=e[6];let h=m,g=M(),[te,ne]=(0,I.useState)(!1),[v,b]=(0,I.useState)(!0),[S,C]=(0,I.useState)(0),w=(0,I.useRef)(null),T;bb0:{if(f){T=`Project`;break bb0}let t;e[7]===h?t=e[8]:(t=le.find(e=>e.id===h)?.label??`Settings`,e[7]=h,e[8]=t),T=t}let E=T,D;e[9]===g?D=e[10]:(D=()=>{g&&b(!1)},e[9]=g,e[10]=D);let ae=D,A;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{b(!0)},e[11]=A):A=e[11];let se=A,R;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(R=async()=>{try{await l(),C(Oe)}catch(e){console.error(`Failed to reset onboarding:`,e)}},e[12]=R):R=e[12];let De=R,B;e[13]===r?B=e[14]:(B=()=>{r(`/`)},e[13]=r,e[14]=B);let je=B,V;e[15]===o?V=e[16]:(V=o?{type:`project`,id:o}:void 0,e[15]=o,e[16]=V);let Me=V,H;e[17]===r?H=e[18]:(H=()=>{r(`/settings/general`)},e[17]=r,e[18]=H);let Ne=H,U;e[19]!==a||e[20]!==n?(U=async()=>{s(n);try{let e=await y();a({type:oe.SetProjects,projects:e.projects})}catch(e){let t=e;throw console.error(`Failed to refresh projects after settings update:`,t),t}},e[19]=a,e[20]=n,e[21]=U):U=e[21];let Pe=U,W,G;e[22]!==i.pathname||e[23]!==r?(W=()=>{(i.pathname===`/settings`||i.pathname===`/settings/project`||[`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(e=>i.pathname.startsWith(e)))&&r(`/settings/general`,{replace:!0})},G=[i.pathname,r],e[22]=i.pathname,e[23]=r,e[24]=W,e[25]=G):(W=e[24],G=e[25]),(0,I.useEffect)(W,G);let K;e[26]!==je||e[27]!==ae||e[28]!==o?(K=()=>(0,L.jsx)(k,{onTitleClose:je,subtitle:`Settings`,children:(0,L.jsx)(`div`,{className:`px-2 py-2`,children:(0,L.jsx)(ue,{selectedProjectId:o,onResetOnboarding:De,onNavItemSelect:ae})})}),e[26]=je,e[27]=ae,e[28]=o,e[29]=K):K=e[29];let Fe=K,Ie;e[30]!==h||e[31]!==Ne||e[32]!==Pe||e[33]!==Me||e[34]!==f||e[35]!==S||e[36]!==n||e[37]!==c?(Ie=()=>{if(f&&n)return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`Project Settings`}),children:(0,L.jsx)(fe,{projectId:n,onProjectUpdated:Pe})});switch(h){case`general`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`General`}),children:(0,L.jsx)(de,{onboardingResetSignal:S})});case`providers`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(Te,{}),children:(0,L.jsx)(pe,{})});case`models`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(P,{}),children:(0,L.jsx)(me,{})});case`skills`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`Skills`}),children:(0,L.jsx)(ge,{})});case`rules`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`Rules`}),children:(0,L.jsx)(_e,{})});case`slash-commands`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`Slash Commands`}),children:(0,L.jsx)(ve,{})});case`subagents`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`Subagents`}),children:(0,L.jsx)(ye,{})});case`instructions`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`Instructions`}),children:(0,L.jsx)(be,{})});case`system-prompt`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`System Prompt`}),children:(0,L.jsx)(xe,{})});case`mcp-servers`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`MCP Servers`}),children:(0,L.jsx)(he,{})});case`history`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`History`}),children:(0,L.jsx)(Ce,{isOpen:!0,onClose:Ne,initialFilter:Me,projects:c,inline:!0})});case`account`:return(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(z,{title:`Account`}),children:(0,L.jsx)(Se,{})});default:return(0,L.jsx)(z,{title:`Settings`})}},e[30]=h,e[31]=Ne,e[32]=Pe,e[33]=Me,e[34]=f,e[35]=S,e[36]=n,e[37]=c,e[38]=Ie):Ie=e[38];let Le=Ie,Re,ze;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(Re=()=>ne(!0),ze=()=>ne(!1),e[39]=Re,e[40]=ze):(Re=e[39],ze=e[40]);let q;e[41]===Fe?q=e[42]:(q=Fe(),e[41]=Fe,e[42]=q);let J;e[43]!==E||e[44]!==g||e[45]!==v?(J=g&&!v&&(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,L.jsxs)(ee,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:se,children:[(0,L.jsx)(d,{className:`h-4 w-4`}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Show settings menu`})]}),(0,L.jsx)(`span`,{className:p(_.sectionTitle,`truncate text-foreground`),children:E})]}),e[43]=E,e[44]=g,e[45]=v,e[46]=J):J=e[46];let Y;e[47]===J?Y=e[48]:(Y=(0,L.jsx)(N,{className:`pt-8 md:min-h-[103px]`,children:J}),e[47]=J,e[48]=Y);let Be=`flex-1 overflow-auto ${te&&!g?`ml-[40px]`:``}`,X;e[49]===Le?X=e[50]:(X=Le(),e[49]=Le,e[50]=X);let Z;e[51]!==Be||e[52]!==X?(Z=(0,L.jsx)(`div`,{className:Be,children:X}),e[51]=Be,e[52]=X,e[53]=Z):Z=e[53];let Q;e[54]!==Y||e[55]!==Z?(Q=(0,L.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[Y,Z]}),e[54]=Y,e[55]=Z,e[56]=Q):Q=e[56];let $;return e[57]!==g||e[58]!==v||e[59]!==q||e[60]!==Q?($=(0,L.jsx)(ce,{ref:w,collapsible:!0,isMobile:g,mobileShowSidebar:v,onCollapse:Re,onExpand:ze,sidebar:q,children:Q}),e[57]=g,e[58]=v,e[59]=q,e[60]=Q,e[61]=$):$=e[61],$}function Oe(e){return e+1}function ke(e){return e.projects}function Ae(e){return e.selectedProjectId}export{De as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ti as e,fo as t,ii as n}from"./dialogs-config-B4TDFSrS.js";var r=t(),i=e();function a(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`animate-pulse rounded-md bg-muted`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}export{a as t};
|