tarsk 0.4.21 → 0.4.22
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 +52 -152
- package/dist/public/assets/{account-view-D1kGyryt.js → account-view-pOQZWJfl.js} +1 -1
- package/dist/public/assets/{alert-dialog-Bk7neo_n.js → alert-dialog-BeLER45U.js} +1 -1
- package/dist/public/assets/{api-DL5XaoTS.js → api-Bagaj1rQ.js} +1 -1
- package/dist/public/assets/{browser-tab-BUOT-D_w.js → browser-tab-DmootUHa.js} +1 -1
- package/dist/public/assets/chat-input-container-CfXgimBQ.js +1 -0
- package/dist/public/assets/context-menu-BlG_bTqN.js +1 -0
- package/dist/public/assets/conversation-history-view-DjO711iz.js +1 -0
- package/dist/public/assets/{dialogs-config-DmDjliuA.js → dialogs-config-Dwpv4SNp.js} +1 -1
- package/dist/public/assets/{diff-view-DXIv51Tn.js → diff-view-B8Grak1p.js} +2 -2
- package/dist/public/assets/{explorer-tab-view-tyn_6pBh.js → explorer-tab-view-lFzzjVe8.js} +2 -2
- package/dist/public/assets/explorer-tree-CyWyxQvY.js +1 -0
- package/dist/public/assets/{explorer-view-Bw3-gTSX.js → explorer-view-DjN4dtgh.js} +1 -1
- package/dist/public/assets/{history-view-BOjZoBCb.js → history-view-BvAOaO8q.js} +1 -1
- package/dist/public/assets/index-C7dA1l3u.js +50 -0
- package/dist/public/assets/onboarding-dialog-DSmKEXk4.js +1 -0
- package/dist/public/assets/onboarding-vGz3IczM.js +1 -0
- package/dist/public/assets/{page-toolbar-CvreDTwj.js → page-toolbar-CBE5_3E3.js} +1 -1
- package/dist/public/assets/{project-settings-view-BJYR_l3u.js → project-settings-view-B13GlkU6.js} +1 -1
- package/dist/public/assets/{provider-details-view-B1eTEo0M.js → provider-details-view-BQQKYvR8.js} +1 -1
- package/dist/public/assets/providers-sidebar-C2RknYQn.js +1 -0
- package/dist/public/assets/react-vendor-CYvpNUsM.js +17 -0
- package/dist/public/assets/{resizable-DJ5w1ZWX.js → resizable-C82J5y6K.js} +1 -1
- package/dist/public/assets/{run-stop-button-iZHomql0.js → run-stop-button-1ECLRujs.js} +2 -2
- package/dist/public/assets/{settings-view-C38jeeqJ.js → settings-view-CxiVTevy.js} +2 -2
- package/dist/public/assets/{side-panel-container-BqWSTCOr.js → side-panel-container-B9Dn9qD2.js} +2 -2
- package/dist/public/assets/{standard-list-item-CpBjveM0.js → standard-list-item-BJWg4I9s.js} +1 -1
- package/dist/public/assets/{store-CAPnOXso.js → store-Cn1lT5YJ.js} +1 -1
- package/dist/public/assets/{tab-context-Bmd79Rk0.js → tab-context-COCYkRNN.js} +1 -1
- package/dist/public/assets/{tabs-DEmnnGvq.js → tabs-M7nUZf6O.js} +1 -1
- package/dist/public/assets/{terminal-panel-r8cb3-tk.js → terminal-panel-Cea0pLdX.js} +2 -2
- package/dist/public/assets/{textarea-BjfyGfGR.js → textarea-C5IMo2ya.js} +1 -1
- package/dist/public/assets/todos-view-DDVfCfgF.js +1 -0
- package/dist/public/assets/{use-toast-C9B1H3P9.js → use-toast-rlEtMnzM.js} +1 -1
- package/dist/public/assets/{utils-BG_JNnOl.js → utils-C3gmypZX.js} +1 -1
- package/dist/public/index.html +18 -18
- package/package.json +1 -1
- package/dist/public/assets/chat-input-container-2a99CMGs.js +0 -1
- package/dist/public/assets/context-menu-DHHElhQ1.js +0 -1
- package/dist/public/assets/conversation-history-view-HVFzgO9e.js +0 -1
- package/dist/public/assets/explorer-tree-DOg67ane.js +0 -1
- package/dist/public/assets/index-DAw9BEzt.js +0 -50
- package/dist/public/assets/onboarding-BgEjTEKs.js +0 -1
- package/dist/public/assets/onboarding-dialog-EiVl-ynw.js +0 -1
- package/dist/public/assets/providers-sidebar-Df50eL_5.js +0 -1
- package/dist/public/assets/react-vendor-CaS5zjF7.js +0 -17
- package/dist/public/assets/todos-view-MAb840dD.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$ as t,$i as n,Bn as r,C as i,Cr as a,Ct as o,Er as s,Fi as c,Gn as l,Gt as u,Hn as d,Ii as f,Ji as p,K as m,Nn as h,Pi as g,Pn as _,Ri as v,Rn as y,Sr as b,T as x,Tr as S,Un as C,Vn as w,W as T,Wn as E,cr as D,hi as O,hr as k,ia as A,kn as ee,la as te,oa as j,rn as ne,sa as M,vi as N,yr as P,zn as re}from"./dialogs-config-DmDjliuA.js";import{_ as ie,a as F,c as I,i as L,l as R,n as z,o as B,r as V,s as H,u as U}from"./history-view-BOjZoBCb.js";var W=e(te(),1),G=M(),K=a();function q(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 J=`Checkbox`,[ae,oe]=b(J),[se,Y]=ae(J);function ce(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]=P({prop:n,defaultProp:i??!1,onChange:c,caller:J}),[m,h]=W.useState(null),[g,_]=W.useState(null),v=W.useRef(!1),y=m?!!o||!!m.closest(`form`):!0,b={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,K.jsx)(se,{scope:t,...b,children:me(d)?d(b):r})}var X=`CheckboxTrigger`,le=W.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:c,checked:l,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:h}=Y(X,e),g=S(i,d),_=W.useRef(l);return W.useEffect(()=>{let e=a?.form;if(e){let t=()=>f(_.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,f]),(0,K.jsx)(k.button,{type:`button`,role:`checkbox`,"aria-checked":Q(l)?`mixed`:l,"aria-required":u,"data-state":he(l),"data-disabled":c?``:void 0,disabled:c,value:o,...r,ref:g,onKeyDown:s(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:s(n,e=>{f(e=>Q(e)?!0:!e),h&&m&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});le.displayName=X;var Z=W.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,K.jsx)(ce,{__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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(le,{...d,ref:t,__scopeCheckbox:n}),e&&(0,K.jsx)(pe,{__scopeCheckbox:n})]})})});Z.displayName=J;var ue=`CheckboxIndicator`,de=W.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Y(ue,n);return(0,K.jsx)(D,{present:r||Q(a.checked)||a.checked===!0,children:(0,K.jsx)(k.span,{"data-state":he(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});de.displayName=ue;var fe=`CheckboxBubbleInput`,pe=W.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=Y(fe,e),m=S(n,p),h=B(a),g=ie(r);W.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=Q(a),n.call(e,Q(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=W.useRef(Q(a)?!1:a);return(0,K.jsx)(k.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});pe.displayName=fe;function me(e){return typeof e==`function`}function Q(e){return e===`indeterminate`}function he(e){return Q(e)?`indeterminate`:e?`checked`:`unchecked`}var $=W.forwardRef((e,t)=>{let r=(0,G.c)(10),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=E(`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`,i),r[3]=i,r[4]=o);let s;r[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(de,{className:E(`flex items-center justify-center text-current`),children:(0,K.jsx)(n,{className:`h-4 w-4`})}),r[5]=s):s=r[5];let c;return r[6]!==a||r[7]!==t||r[8]!==o?(c=(0,K.jsx)(Z,{ref:t,className:o,...a,children:s}),r[6]=a,r[7]=t,r[8]=o,r[9]=c):c=r[9],c});$.displayName=Z.displayName;function ge({selectedProvider:e,onProviderChange:t,showApiKeyInput:n=!0,onApiKeyChange:r,isLoading:i,error:a,variant:s=`dropdown`}){let[c,l]=(0,W.useState)([]),[d,p]=(0,W.useState)(!1),m=async e=>{try{await u(e)}catch(e){console.error(`Failed to open provider website:`,e)}};return(0,W.useEffect)(()=>{(async()=>{p(!0);try{let n=await o();l(n),n.length>0&&!e&&t(n[0])}catch(e){console.error(`Failed to load providers:`,e)}finally{p(!1)}})()},[e,t]),d?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-4`,children:(0,K.jsx)(O,{className:`h-4 w-4 animate-spin text-muted-foreground`})}):s===`dropdown`?(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[a&&(0,K.jsx)(`p`,{className:`text-sm text-destructive`,children:a}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`label`,{className:`text-sm font-medium`,children:`AI Provider`}),(0,K.jsxs)(z,{value:e?.name??``,onValueChange:e=>{let n=c.find(t=>t.name===e);n&&t(n)},children:[(0,K.jsx)(F,{children:e?e.name:`Select a provider`}),(0,K.jsx)(V,{children:c.map(e=>(0,K.jsx)(L,{value:e.name,children:e.name},e.name))})]})]}),e?.url&&(0,K.jsx)(R,{children:(0,K.jsxs)(H,{children:[(0,K.jsx)(U,{asChild:!0,children:(0,K.jsxs)(_,{variant:`ghost`,size:`sm`,onClick:()=>m(e.url),className:`flex items-center gap-1 text-sm text-brand h-auto p-0`,children:[`Visit provider website `,(0,K.jsx)(f,{className:`h-3.5 w-3.5`})]})}),(0,K.jsx)(I,{children:(0,K.jsx)(`p`,{children:e.url})})]})}),n&&e&&(0,K.jsx)(_e,{provider:e,value:e.apiKey??``,onChange:r,isLoading:i})]}):null}function _e(e){let t=(0,G.c)(24),{provider:n,value:r,onChange:i,isLoading:a}=e,[o,s]=(0,W.useState)(!1);if(n.authType!==`APIKey`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This provider uses OAuth for authentication.`}),t[0]=e):e=t[0];let r;return t[1]===n.name?r=t[2]:(r=(0,K.jsxs)(`div`,{className:`rounded-md bg-muted/30 p-4 text-center`,children:[e,(0,K.jsxs)(_,{variant:`outline`,size:`sm`,className:`mt-2`,disabled:!0,children:[`Sign in with `,n.name]})]}),t[1]=n.name,t[2]=r),r}let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,K.jsx)(R,{children:(0,K.jsxs)(H,{children:[(0,K.jsx)(U,{asChild:!0,children:(0,K.jsx)(`label`,{htmlFor:`api-key`,className:`text-sm font-medium cursor-help`,children:`API Key`})}),(0,K.jsx)(I,{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,K.jsx)(N,{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 d=o?`text`:`password`,f=n.keyName??`Enter API Key`,p;t[5]===i?p=t[6]:(p=e=>i?.(e.target.value),t[5]=i,t[6]=p);let m;t[7]!==a||t[8]!==d||t[9]!==f||t[10]!==p||t[11]!==r?(m=(0,K.jsx)(h,{id:`api-key`,type:d,placeholder:f,className:`pl-10 pr-10`,value:r,onChange:p,disabled:a}),t[7]=a,t[8]=d,t[9]=f,t[10]=p,t[11]=r,t[12]=m):m=t[12];let v;t[13]===o?v=t[14]:(v=()=>s(!o),t[13]=o,t[14]=v);let y=(a??!1)||!r,b;t[15]===o?b=t[16]:(b=o?(0,K.jsx)(c,{className:`h-4 w-4 text-muted-foreground`}):(0,K.jsx)(g,{className:`h-4 w-4 text-muted-foreground`}),t[15]=o,t[16]=b);let x;t[17]!==v||t[18]!==y||t[19]!==b?(x=(0,K.jsx)(_,{type:`button`,variant:`ghost`,size:`sm`,className:`absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0`,onClick:v,disabled:y,children:b}),t[17]=v,t[18]=y,t[19]=b,t[20]=x):x=t[20];let S;return t[21]!==x||t[22]!==m?(S=(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[l,(0,K.jsxs)(`div`,{className:`relative`,children:[u,m,x]})]}),t[21]=x,t[22]=m,t[23]=S):S=t[23],S}function ve({provider:e,onModelsChange:n,isLoading:r,disabled:i,displayMode:a=`grid`}){let[o,s]=(0,W.useState)([]),[c,u]=(0,W.useState)(new Set),[d,f]=(0,W.useState)(new Map),[p,h]=(0,W.useState)(!1),[g,y]=(0,W.useState)(``),[b,x]=(0,W.useState)(`alphabetical`);(0,W.useEffect)(()=>{S()},[e]);let S=async()=>{h(!0),y(``),x(`alphabetical`);try{s(await m(e));let n=(await t())[e]||[];u(new Set(n.map(e=>e.id))),f(new Map)}catch(t){console.error(`Failed to load models for ${e}:`,t),s([]),u(new Set)}finally{h(!1)}},C=(e,t)=>{let r=new Set(e);o.forEach(e=>{t.has(e.id)&&(t.get(e.id)?r.add(e.id):r.delete(e.id))}),n?.(r)},w=e=>{f(t=>{let n=new Map(t),r=c.has(e),i=n.has(e),a=n.get(e),o=!(i?a:r);return o===r?n.delete(e):n.set(e,o),C(c,n),n})},T=e=>{f(t=>{let n=new Map(t);return o.forEach(t=>{let r=c.has(t.id);e?r?n.delete(t.id):n.set(t.id,!0):r?n.set(t.id,!1):n.delete(t.id)}),C(c,n),n})},D=e=>q(e.id),k=o.filter(e=>{let t=g.toLowerCase(),n=D(e);return e.name.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||n.toLowerCase().includes(t)}).sort((e,t)=>{let n=+!c.has(e.id),r=+!c.has(t.id);if(n!==r)return n-r;if(b===`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(b===`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 D(e).localeCompare(D(t))});return p||r?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,K.jsx)(O,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):o.length===0?(0,K.jsx)(`div`,{className:`text-center py-8`,children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No models available for this provider.`})}):a===`compact`?(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:E(`flex items-center justify-between`,i&&`opacity-25`),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)($,{id:`select-all-models`,disabled:i,checked:o.every(e=>{let t=d.has(e.id),n=d.get(e.id);return t?n:c.has(e.id)}),onCheckedChange:e=>T(e===!0)}),(0,K.jsx)(`label`,{htmlFor:`select-all-models`,className:`text-sm cursor-pointer`,children:`Select all models`})]}),(0,K.jsx)(R,{children:(0,K.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,K.jsxs)(H,{children:[(0,K.jsx)(U,{asChild:!0,children:(0,K.jsx)(_,{type:`button`,variant:b===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>x(`alphabetical`),disabled:i,children:(0,K.jsx)(j,{className:`h-4 w-4`})})}),(0,K.jsx)(I,{children:`Sort A–Z`})]}),(0,K.jsxs)(H,{children:[(0,K.jsx)(U,{asChild:!0,children:(0,K.jsx)(_,{type:`button`,variant:b===`price-low`||b===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>{x(b===`price-low`?`price-high`:`price-low`)},disabled:i,children:(0,K.jsx)(v,{className:`h-4 w-4`})})}),(0,K.jsx)(I,{children:`Sort by price`})]})]})})]}),(0,K.jsx)(R,{children:(0,K.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:k.length===0?(0,K.jsx)(`div`,{className:`text-center py-4`,children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No models available.`})}):k.map(e=>{let t=c.has(e.id),n=d.has(e.id),r=d.get(e.id),a=n?r:t,o=e.pricing;return(0,K.jsxs)(H,{children:[(0,K.jsx)(U,{asChild:!0,children:(0,K.jsxs)(`div`,{className:E(`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0`,i&&`opacity-25`),children:[(0,K.jsx)($,{id:e.id,disabled:i,checked:a??!1,onCheckedChange:()=>w(e.id),className:`mt-0`}),(0,K.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,K.jsx)(`label`,{htmlFor:e.id,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate flex-1 w-0`,children:D(e)}),o&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap flex-shrink-0`,children:(o.prompt??0)<=0&&(o.completion??0)<=0?`Free`:`${l(o.prompt??0)} in | ${l(o.completion??0)} out`})]})]})}),e.description&&(0,K.jsx)(I,{side:`top`,className:`max-w-xs`,children:(0,K.jsx)(`p`,{className:`text-sm`,children:e.description})})]},e.id)})})})]}):null}function ye({open:e,onOpenChange:t,onComplete:a}){let[s,c]=(0,W.useState)(`git-check`),[l,u]=(0,W.useState)(null),[h,g]=(0,W.useState)(!1),[v,b]=(0,W.useState)([]),[S,D]=(0,W.useState)(null),[k,te]=(0,W.useState)(``),[j,M]=(0,W.useState)(!1),[N,P]=(0,W.useState)(``),[ie,F]=(0,W.useState)(new Set),[I,L]=(0,W.useState)(!1),[R,z]=(0,W.useState)(!1);(0,W.useEffect)(()=>{e&&s===`git-check`&&B()},[e,s]),(0,W.useEffect)(()=>{e&&s===`provider-selection`&&v.length===0&&V()},[e,s,v.length]),(0,W.useEffect)(()=>{e&&s===`model-selection`&&S&&H()},[e,s,S]);let B=async()=>{g(!0);try{u((await i()).gitInstalled)}catch(e){console.error(`Failed to check git installation:`,e),u(!1)}finally{g(!1)}},V=async()=>{try{let e=await o();b(e),e.length>0&&!S&&D(e[0])}catch(e){console.error(`Failed to load providers:`,e)}},H=async()=>{if(S){L(!0);try{await m(S.name),F(new Set)}catch(e){console.error(`Failed to load models:`,e)}finally{L(!1)}}},U=async()=>{if(!S||!k.trim()){P(`Please enter an API key`);return}M(!0),P(``);try{await ne(S.slug,k),c(`model-selection`)}catch(e){P(e instanceof Error?e.message:`Failed to validate API key`)}finally{M(!1)}},G=async()=>{if(S){z(!0);try{for(let e of ie)await T(S.name,e);await x(),a?.(),t(!1)}catch(e){console.error(`Failed to complete onboarding:`,e)}finally{z(!1)}}},q=async()=>{z(!0);try{await x(),a?.(),t(!1)}catch(e){console.error(`Failed to skip onboarding:`,e)}finally{z(!1)}};return(0,K.jsx)(y,{open:e,onOpenChange:t,children:(0,K.jsxs)(re,{className:`max-w-2xl h-[min(42rem,90dvh)] flex flex-col p-0 overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`px-6 pt-6 pb-2`,children:[(0,K.jsxs)(`div`,{className:`w-1/2 mx-auto flex items-center gap-2 mb-6`,children:[(0,K.jsx)(`div`,{className:E(`flex items-center justify-center h-8 w-8 rounded-full text-sm font-medium`,s===`git-check`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`1`}),(0,K.jsx)(`div`,{className:E(`h-0.5 flex-1`,s===`provider-selection`||s===`model-selection`?`bg-primary`:`bg-muted`)}),(0,K.jsx)(`div`,{className:E(`flex items-center justify-center h-8 w-8 rounded-full text-sm font-medium`,s===`provider-selection`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`2`}),(0,K.jsx)(`div`,{className:E(`h-0.5 flex-1`,s===`model-selection`?`bg-primary`:`bg-muted`)}),(0,K.jsx)(`div`,{className:E(`flex items-center justify-center h-8 w-8 rounded-full text-sm font-medium`,s===`model-selection`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:`3`})]}),(0,K.jsxs)(d,{children:[s===`git-check`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(C,{children:`Let's get started`}),(0,K.jsx)(r,{children:`First, we need to check that Git is installed on your system.`})]}),s===`provider-selection`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(C,{children:`Select an AI Provider`}),(0,K.jsx)(r,{children:`Choose your preferred AI provider and enter your API key.`})]}),s===`model-selection`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(C,{children:`Select Models`}),(0,K.jsx)(r,{children:`Choose which models you want to use with this provider.`})]})]})]}),(0,K.jsx)(ee,{className:`flex-1 min-h-0 overflow-hidden`,children:(0,K.jsxs)(`div`,{className:`px-6 py-4`,children:[s===`git-check`&&(0,K.jsx)(`div`,{className:`space-y-4`,children:h?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,K.jsx)(O,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):l?(0,K.jsxs)(`div`,{className:`rounded-lg border border-green-200 bg-green-50 p-4 flex items-start gap-3`,children:[(0,K.jsx)(n,{className:`h-5 w-5 text-green-600 flex-shrink-0 mt-0.5`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h4`,{className:`font-medium text-green-900`,children:`Git is installed`}),(0,K.jsx)(`p`,{className:`text-sm text-green-800`,children:`You're all set to use Git features in Tarsk.`})]})]}):(0,K.jsxs)(`div`,{className:`rounded-lg border border-yellow-200 bg-yellow-50 p-4 flex items-start gap-3`,children:[(0,K.jsx)(p,{className:`h-5 w-5 text-yellow-600 flex-shrink-0 mt-0.5`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`h4`,{className:`font-medium text-yellow-900`,children:`Git is not installed`}),(0,K.jsx)(`p`,{className:`text-sm text-yellow-800 mt-1`,children:`Git is required for some features in Tarsk. You can continue without it, but we recommend installing it.`}),(0,K.jsxs)(`a`,{href:`https://git-scm.com/downloads`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-sm text-blue-600 hover:underline mt-2`,children:[`Download Git `,(0,K.jsx)(f,{className:`h-3 w-3`})]})]})]})}),s===`provider-selection`&&(0,K.jsx)(`div`,{className:`space-y-4`,children:S&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ge,{selectedProvider:S,onProviderChange:e=>{D(e),te(e.apiKey??``),P(``)},showApiKeyInput:!0,variant:`dropdown`,isLoading:j}),N&&(0,K.jsx)(`div`,{className:`rounded-md bg-destructive/10 p-3 text-sm text-destructive`,children:N})]})}),s===`model-selection`&&S&&(0,K.jsx)(`div`,{className:`space-y-4`,children:(0,K.jsx)(ve,{provider:S.slug,isLoading:I,displayMode:`compact`,disabled:!1,onModelsChange:F})})]})}),(0,K.jsx)(`div`,{className:`px-6 py-4 border-t border-border bg-muted/10`,children:(0,K.jsxs)(w,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`div`,{children:s===`provider-selection`&&(0,K.jsx)(_,{variant:`ghost`,onClick:()=>q(),disabled:R,children:`Skip for now`})}),(0,K.jsxs)(`div`,{className:`flex gap-3`,children:[s!==`git-check`&&(0,K.jsx)(_,{variant:`outline`,onClick:()=>{s===`provider-selection`?c(`git-check`):s===`model-selection`&&c(`provider-selection`)},disabled:R,children:`Back`}),s===`git-check`&&(0,K.jsxs)(_,{onClick:()=>{c(`provider-selection`)},disabled:h,className:`gap-2`,children:[`Continue `,(0,K.jsx)(A,{className:`h-4 w-4`})]}),s===`provider-selection`&&(0,K.jsx)(_,{onClick:U,disabled:j||!k.trim()||!S,className:`gap-2`,children:j?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(O,{className:`h-4 w-4 animate-spin`}),`Validating...`]}):(0,K.jsxs)(K.Fragment,{children:[`Next `,(0,K.jsx)(A,{className:`h-4 w-4`})]})}),s===`model-selection`&&(0,K.jsx)(_,{onClick:G,disabled:R,className:`gap-2`,children:R?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(O,{className:`h-4 w-4 animate-spin`}),`Finishing...`]}):(0,K.jsxs)(K.Fragment,{children:[`Finish `,(0,K.jsx)(n,{className:`h-4 w-4`})]})})]})]})})]})})}export{$ as n,q as r,ye as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./onboarding-BgEjTEKs.js";export{e as OnboardingDialog,e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$i as t,Cr as n,Ct as r,Pn as i,Wn as a,la as o}from"./dialogs-config-DmDjliuA.js";import{t as s}from"./standard-list-item-CpBjveM0.js";var c=e(o(),1),l=n();function u({selectedProvider:e,onProviderSelect:n,className:o}){let[u,d]=(0,c.useState)([]),[f,p]=(0,c.useState)(!1),[m,h]=(0,c.useState)(``);(0,c.useEffect)(()=>{(async()=>{p(!0),h(``);try{d(await r())}catch(e){h(e instanceof Error?e.message:`Failed to load providers`)}finally{p(!1)}})()},[]);let g=[...u].sort((e,t)=>{let n=!!e.apiKey,r=!!t.apiKey;return n&&!r?-1:!n&&r?1:e.name.localeCompare(t.name)});return f?(0,l.jsx)(`div`,{className:a(`p-2`,o),children:(0,l.jsxs)(`div`,{className:`animate-pulse space-y-2`,children:[(0,l.jsx)(`div`,{className:`h-8 bg-muted rounded`}),(0,l.jsx)(`div`,{className:`h-8 bg-muted rounded`}),(0,l.jsx)(`div`,{className:`h-8 bg-muted rounded`})]})}):m?(0,l.jsx)(`div`,{className:a(`p-2`,o),children:(0,l.jsxs)(`div`,{className:`text-center`,children:[(0,l.jsx)(`p`,{className:`text-sm text-destructive mb-2`,children:m}),(0,l.jsx)(i,{variant:`outline`,size:`sm`,onClick:()=>window.location.reload(),children:`Retry`})]})}):(0,l.jsx)(`div`,{className:a(`space-y-1`,o),children:g.map(r=>(0,l.jsx)(s,{onClick:()=>n(r.name),selected:e===r.name,asChild:!0,children:(0,l.jsxs)(`button`,{className:`justify-between group`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`img`,{src:`https://models.tarsk.io/svg/${r.slug}.svg`,alt:`${r.name} logo`,className:`h-4 w-4 flex-shrink-0`,onError:e=>{e.currentTarget.style.visibility=`hidden`}}),(0,l.jsx)(`span`,{className:a(r.apiKey&&`font-bold text-foreground`),children:r.name})]}),r.apiKey&&(0,l.jsx)(t,{className:`h-3.5 w-3.5 text-green-500`})]})},r.name))})}export{u as ProvidersSidebar,u as default};
|