tarsk 0.5.44 → 0.5.46
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/bundled-skills/available-models/SKILL.md +9 -0
- package/dist/index.js +5760 -3884
- package/dist/public/assets/{account-view-CTizS7Yb.js → account-view-XO30M3P0.js} +1 -1
- package/dist/public/assets/api-Dhzdgb40.js +1 -0
- package/dist/public/assets/browser-tab-B7XwV-sa.js +1 -0
- package/dist/public/assets/commit-dialog-D96fJ90J.js +1 -0
- package/dist/public/assets/context-menu-PIC-g8wy.js +1 -0
- package/dist/public/assets/create-repo-dialog-CTyZJfi1.js +1 -0
- package/dist/public/assets/{dialogs-config-CxRnlUcQ.js → dialogs-config-BEazgV7k.js} +14 -14
- package/dist/public/assets/diff-view-JfXPy7qA.js +3 -0
- package/dist/public/assets/explorer-tab-view-CUFm_j8i.js +2 -0
- package/dist/public/assets/explorer-tree-D5h9dOAX.js +1 -0
- package/dist/public/assets/explorer-view-IOQM4kWJ.js +1 -0
- package/dist/public/assets/git-history-dialog-qUZ7Qsp4.js +1 -0
- package/dist/public/assets/git-ops-button-0IGtolLO.js +2 -0
- package/dist/public/assets/history-view-BMVTxWTg.js +9 -0
- package/dist/public/assets/index-B4PyD4Io.js +73 -0
- package/dist/public/assets/index-HzthG2_q.css +1 -0
- package/dist/public/assets/mcp-server-card-ChdAZekt.js +1 -0
- package/dist/public/assets/merged-pr-dialog-DAXqT4Xe.js +1 -0
- package/dist/public/assets/model-star-rating-BzpXBjSo.js +1 -0
- package/dist/public/assets/onboarding-Bi5MieW-.js +1 -0
- package/dist/public/assets/project-settings-view-DHZVnkug.js +1 -0
- package/dist/public/assets/providers-list-view-Dgid2Wui.js +1 -0
- package/dist/public/assets/pull-request-dialog-RwRZAOLd.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-oGP-j8Yw.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-BQ0QC6Qu.js +1 -0
- package/dist/public/assets/radio-group-n9qyUxmu.js +1 -0
- package/dist/public/assets/react-vendor-iDwBzcYF.js +16 -0
- package/dist/public/assets/settings-general-view-D94zYQNc.js +1 -0
- package/dist/public/assets/settings-instructions-view-DG6YpJy-.js +1 -0
- package/dist/public/assets/settings-list-owWkHWxE.js +1 -0
- package/dist/public/assets/settings-mcp-servers-view-DsUxcHD0.js +5 -0
- package/dist/public/assets/{settings-models-skeleton-DAEnT4kC.js → settings-models-skeleton-Cse6L-Nd.js} +1 -1
- package/dist/public/assets/settings-models-view-BAxf3eJq.js +1 -0
- package/dist/public/assets/settings-rules-view-BPKmp2c-.js +8 -0
- package/dist/public/assets/settings-skills-view-DD_0AweF.js +3 -0
- package/dist/public/assets/settings-slash-commands-view-CSEjoSTd.js +1 -0
- package/dist/public/assets/settings-subagents-view-Bs5ftymi.js +2 -0
- package/dist/public/assets/{settings-system-prompt-view-0sXVxXh3.js → settings-system-prompt-view-BNhTFs0x.js} +1 -1
- package/dist/public/assets/settings-view-CZ9Gvo8Y.js +2 -0
- package/dist/public/assets/skeleton-6mGMglV0.js +1 -0
- package/dist/public/assets/slug-utils-BT1eqWhW.js +1 -0
- package/dist/public/assets/tabs-iUSYYupj.js +1 -0
- package/dist/public/assets/terminal-panel-DwHeNF9e.js +7 -0
- package/dist/public/assets/terminal-panel-kHJ-D0s7.css +1 -0
- package/dist/public/assets/todos-view-CWPTnaGF.js +17 -0
- package/dist/public/assets/{ui-components-DaffuSG7.js → ui-components-kSaUEA_X.js} +1 -1
- package/dist/public/assets/{use-deferred-search-b843Ztu9.js → use-deferred-search-DGJskNBr.js} +1 -1
- package/dist/public/assets/{utils-BIt9KCVx.js → utils-CECQ_-6N.js} +1 -1
- package/dist/public/assets/web-B3nTDZgN.js +1 -0
- package/dist/public/assets/web-C59q93HV.js +1 -0
- package/dist/public/assets/{web-BBGaE-6B.js → web-DVkb9rcs.js} +1 -1
- package/dist/public/assets/web-bG55HoO2.js +1 -0
- package/dist/public/index.html +7 -7
- package/package.json +1 -1
- package/dist/public/assets/api-Cuj9iSVv.js +0 -1
- package/dist/public/assets/browser-tab-DSpOIu84.js +0 -1
- package/dist/public/assets/commit-dialog-kTaKOsNO.js +0 -1
- package/dist/public/assets/context-menu-DRXV-Suu.js +0 -1
- package/dist/public/assets/create-repo-dialog-gIZLk6LZ.js +0 -1
- package/dist/public/assets/diff-view-B2OdJMRe.js +0 -3
- package/dist/public/assets/explorer-tab-view-fejcb7N1.js +0 -2
- package/dist/public/assets/explorer-tree-C2kLAwI0.js +0 -1
- package/dist/public/assets/explorer-view-BmKKHyrH.js +0 -1
- package/dist/public/assets/git-history-dialog-B2ABiCXZ.js +0 -1
- package/dist/public/assets/git-ops-button-Bxx_jyqR.js +0 -2
- package/dist/public/assets/history-view-DebwP9D7.js +0 -9
- package/dist/public/assets/index-C2_gO3dh.css +0 -1
- package/dist/public/assets/index-D9aY24hf.js +0 -89
- package/dist/public/assets/mcp-server-card-B6iwOybN.js +0 -1
- package/dist/public/assets/merged-pr-dialog-CObeSEaB.js +0 -1
- package/dist/public/assets/model-star-rating-BgdOyTTO.js +0 -1
- package/dist/public/assets/onboarding-BN_K08ma.js +0 -1
- package/dist/public/assets/project-settings-view-BDvHOmF8.js +0 -1
- package/dist/public/assets/providers-list-view-DydWz8z3.js +0 -1
- package/dist/public/assets/pull-request-dialog-LJhZpT8C.js +0 -1
- package/dist/public/assets/pull-with-changes-dialog-BPIj9wIk.js +0 -1
- package/dist/public/assets/push-before-pr-dialog-DzBp93KT.js +0 -1
- package/dist/public/assets/radio-group-B9xMCZ1X.js +0 -1
- package/dist/public/assets/react-vendor-CE5Dmjd0.js +0 -16
- package/dist/public/assets/settings-general-view-D_44BPVr.js +0 -1
- package/dist/public/assets/settings-instructions-view-Y6EK67-G.js +0 -1
- package/dist/public/assets/settings-list-BZDwK9bE.js +0 -1
- package/dist/public/assets/settings-mcp-servers-view-B8IqOOnN.js +0 -5
- package/dist/public/assets/settings-models-view-CluPgRkw.js +0 -1
- package/dist/public/assets/settings-rules-view-CxHrCDwn.js +0 -8
- package/dist/public/assets/settings-skills-view-BE9u6FvJ.js +0 -2
- package/dist/public/assets/settings-slash-commands-view-CVOZ3GH3.js +0 -1
- package/dist/public/assets/settings-subagents-view-mguSf6zE.js +0 -2
- package/dist/public/assets/settings-view-BE8EW7s7.js +0 -2
- package/dist/public/assets/skeleton-CVhaOA8k.js +0 -1
- package/dist/public/assets/slug-utils-DGOwJkKI.js +0 -1
- package/dist/public/assets/terminal-panel-PjkgqbY6.js +0 -1
- package/dist/public/assets/web-D6dBzWD1.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Aa as t,Ar as n,Dn as r,Fo as i,Hn as a,La as o,Lo as s,Po as c,Rn as l,X as u,_o as d,bo as f,ga as ee,hi as p,ji as m,n as te,pi as ne,r as h,yo as re}from"./dialogs-config-CxRnlUcQ.js";import{a as ie,i as ae,o as g,r as oe,s as _}from"./react-vendor-CE5Dmjd0.js";import{C as se,D as ce,E as le,S as ue,b as de}from"./history-view-DebwP9D7.js";import{n as fe}from"./utils-BIt9KCVx.js";import{t as pe}from"./index-D9aY24hf.js";var me=i(),v=e(s(),1),y=c(),he=v.forwardRef((e,t)=>{let n=(0,me.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 a;n[3]===r?a=n[4]:(a=p(`relative flex w-full touch-none select-none items-center`,r),n[3]=r,n[4]=a);let o,s;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,y.jsx)(_,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,y.jsx)(ae,{className:`absolute h-full bg-primary`})}),s=(0,y.jsx)(g,{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]=o,n[6]=s):(o=n[5],s=n[6]);let c;return n[7]!==i||n[8]!==t||n[9]!==a?(c=(0,y.jsxs)(ie,{ref:t,className:a,...i,children:[o,s]}),n[7]=i,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});he.displayName=ie.displayName;var b=50;function ge(){let[e,t]=(0,v.useState)(b),[n,i]=(0,v.useState)(b.toString()),[a,o]=(0,v.useState)(!0),[s,c]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=!1;async function n(){try{let n=await u();e||(t(n.maximumTurnCount),i(n.maximumTurnCount.toString()))}catch(e){console.error(`Failed to load maximum turn count:`,e)}finally{e||o(!1)}}return n(),()=>{e=!0}},[]);function l(e){i(e)}async function d(e){c(!0);try{let n=await r({maximumTurnCount:e});t(n.maximumTurnCount),i(n.maximumTurnCount.toString())}catch(e){throw console.error(`Failed to update maximum turn count:`,e),e}finally{c(!1)}}function f(){i(e.toString())}return{defaultMaximumTurnCount:b,draftMaximumTurnCount:n,isLoading:a,isSaving:s,maximumTurnCount:e,resetDraftMaximumTurnCount:f,setDraftMaximumTurnCount:l,updateMaximumTurnCount:d}}var x={isMacOS:!1,granted:!1,available:!1,message:``};function _e(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!0),[i,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),f=(0,v.useCallback)(async()=>{r(!0),o(null);try{t(await l(`api/system-permissions/screen-recording`))}catch(e){o(e instanceof Error?e.message:`Failed to check screen recording permission`),t({...x,message:`Unable to check permission status.`})}finally{r(!1)}},[]);return(0,v.useEffect)(()=>{f()},[f]),{status:e,isLoading:n,error:i,isOpeningSettings:s,openSettingsError:u,refresh:f,openSystemSettings:(0,v.useCallback)(async()=>{c(!0),d(null);try{let e=await a(`api/system-permissions/screen-recording/open-settings`,{});if(!e.success){let t=e.message||`Failed to open System Settings`;console.error(`[useScreenRecordingPermission] ${t}`,e.error),d(t)}}catch(e){let t=e instanceof Error?e.message:`Failed to open System Settings`;console.error(`[useScreenRecordingPermission] Error opening System Settings:`,e),d(t)}finally{c(!1)}},[])}}var S=`local`,ve=`tarsk-server-bind-mode-changed`;function ye(){if(typeof window>`u`)return!1;try{return sessionStorage.getItem(ve)===`true`}catch{return!1}}function be(e){if(!(typeof window>`u`))try{e?sessionStorage.setItem(ve,`true`):sessionStorage.removeItem(ve)}catch{}}function xe(){let[e,t]=(0,v.useState)(S),[n,i]=(0,v.useState)(null),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!0),[l,d]=(0,v.useState)(!1),[f,ee]=(0,v.useState)(ye);(0,v.useEffect)(()=>{let e=!1;async function n(){try{let n=await u();e||(t(n.serverBindMode),i(n.serverBindMode),o(n.networkAddresses))}catch(e){console.error(`Failed to load server bind mode:`,e)}finally{e||c(!1)}}return n(),()=>{e=!0}},[]);async function p(e){d(!0);try{let n=await r({serverBindMode:e});t(n.serverBindMode),o(n.networkAddresses),ee(!0),be(!0)}catch(e){throw console.error(`Failed to update server bind mode:`,e),e}finally{d(!1)}}let m=n!==null&&e!==n;return{defaultServerBindMode:S,hasServerBindModeChanged:m,isLoading:s,isSaving:l,needsRestart:m||f,networkAddresses:a,serverBindMode:e,updateServerBindMode:p}}var Se=[{value:`local`,label:`No`},{value:`network`,label:`Yes`}],Ce=[{value:`light`,label:`Light`},{value:`dark`,label:`Dark`},{value:`system`,label:`System`}],we=[`462`,`8100`].includes(typeof document<`u`?document.location.port:``)?`462`:`641`,Te=600;function Ee(e){let r=(0,me.c)(113),{onboardingResetSignal:i}=e,a=i===void 0?0:i,[s,c]=(0,v.useState)(!1),{theme:l,setTheme:u}=fe(),{scale:h,updateScale:ie,resetScale:ae,min:g,max:_,default:b}=pe(),{defaultMaximumTurnCount:x,draftMaximumTurnCount:S,isLoading:ve,isSaving:ye,resetDraftMaximumTurnCount:be,setDraftMaximumTurnCount:Ee,updateMaximumTurnCount:ke}=ge(),{status:C,isLoading:Ae,isOpeningSettings:je,openSettingsError:Me,refresh:Ne,openSystemSettings:Pe}=_e(),{isLoading:Fe,isSaving:Ie,needsRestart:w,networkAddresses:T,serverBindMode:E,updateServerBindMode:Le}=xe(),Re,ze;r[0]===a?(Re=r[1],ze=r[2]):(Re=()=>{if(a===0)return;c(!0);let e=setTimeout(()=>{c(!1)},Te);return()=>{clearTimeout(e)}},ze=[a],r[0]=a,r[1]=Re,r[2]=ze),(0,v.useEffect)(Re,ze);let Be;r[3]===Ee?Be=r[4]:(Be=function(e){Ee(e.target.value)},r[3]=Ee,r[4]=Be);let Ve=Be,He;r[5]!==x||r[6]!==S||r[7]!==be||r[8]!==ke?(He=async function(){let e=Number.parseInt(S,10),t=Number.isFinite(e)&&e>0?e:x;try{await ke(t)}catch{be()}},r[5]=x,r[6]=S,r[7]=be,r[8]=ke,r[9]=He):He=r[9];let Ue=He,We;r[10]===ie?We=r[11]:(We=function(e){e.length>0&&ie(e[0])},r[10]=ie,r[11]=We);let Ge=We,Ke=s&&`animate-headline-reset`,D;r[12]===Ke?D=r[13]:(D=p(Ke),r[12]=Ke,r[13]=D);let O;r[14]===D?O=r[15]:(O=(0,y.jsx)(ue,{title:`General`,description:`Customize the appearance and behavior of Tarsk.`,titleClassName:D}),r[14]=D,r[15]=O);let qe,Je;r[16]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,y.jsx)(ee,{className:`h-3.5 w-3.5`}),Je=(0,y.jsx)(`span`,{className:`sr-only`,children:`Reset font size to default`}),r[16]=qe,r[17]=Je):(qe=r[16],Je=r[17]);let k;r[18]===ae?k=r[19]:(k=(0,y.jsxs)(ne,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:ae,children:[qe,Je]}),r[18]=ae,r[19]=k);let A;r[20]===h?A=r[21]:(A=(0,y.jsxs)(`span`,{className:`${m.mono} tabular-nums w-12 text-right`,children:[h,`%`]}),r[20]=h,r[21]=A);let j;r[22]!==k||r[23]!==A?(j=(0,y.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[k,A]}),r[22]=k,r[23]=A,r[24]=j):j=r[24];let M;r[25]===g?M=r[26]:(M=(0,y.jsxs)(`span`,{className:`${m.bodyMuted} w-8 text-right`,children:[g,`%`]}),r[25]=g,r[26]=M);let N;r[27]===h?N=r[28]:(N=[h],r[27]=h,r[28]=N);let P;r[29]!==Ge||r[30]!==_||r[31]!==g||r[32]!==N?(P=(0,y.jsx)(he,{value:N,min:g,max:_,step:5,onValueChange:Ge,"aria-label":`Font size`}),r[29]=Ge,r[30]=_,r[31]=g,r[32]=N,r[33]=P):P=r[33];let F;r[34]===_?F=r[35]:(F=(0,y.jsxs)(`span`,{className:`${m.bodyMuted} w-9`,children:[_,`%`]}),r[34]=_,r[35]=F);let Ye;r[36]!==M||r[37]!==P||r[38]!==F?(Ye=(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[M,P,F]}),r[36]=M,r[37]=P,r[38]=F,r[39]=Ye):Ye=r[39];let I;r[40]!==b||r[41]!==h?(I=h!==b&&(0,y.jsxs)(`p`,{className:`${m.bodyMuted} mt-2`,children:[`Font size has been changed from the default (`,b,`%).`]}),r[40]=b,r[41]=h,r[42]=I):I=r[42];let L;r[43]!==j||r[44]!==Ye||r[45]!==I?(L=(0,y.jsxs)(de,{title:`Font Size`,description:`Adjust the text size across the entire application.`,action:j,children:[Ye,I]}),r[43]=j,r[44]=Ye,r[45]=I,r[46]=L):L=r[46];let R;r[47]===u?R=r[48]:(R=e=>{(e===`light`||e===`dark`||e===`system`)&&u(e)},r[47]=u,r[48]=R);let Xe;r[49]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=Ce.map(Oe),r[49]=Xe):Xe=r[49];let z;r[50]!==R||r[51]!==l?(z=(0,y.jsx)(de,{title:`Appearance`,description:`Choose your preferred color scheme.`,children:(0,y.jsx)(te,{type:`single`,value:l,onValueChange:R,"aria-label":`Appearance`,variant:`outline`,className:`inline-flex rounded-full border bg-muted/40 p-1`,children:Xe})}),r[50]=R,r[51]=l,r[52]=z):z=r[52];let B;r[53]===Ue?B=r[54]:(B=()=>{Ue()},r[53]=Ue,r[54]=B);let Ze=ve||ye,V;r[55]!==S||r[56]!==Ve||r[57]!==B||r[58]!==Ze?(V=(0,y.jsx)(n,{type:`number`,min:1,step:1,value:S,onChange:Ve,onBlur:B,disabled:Ze,"aria-label":`Maximum turn count`,className:`w-28 text-right font-mono tabular-nums flex-shrink-0`}),r[55]=S,r[56]=Ve,r[57]=B,r[58]=Ze,r[59]=V):V=r[59];let H;r[60]===x?H=r[61]:(H=(0,y.jsxs)(`p`,{className:m.bodyMuted,children:[`Default: `,x,` turns.`]}),r[60]=x,r[61]=H);let U;r[62]!==V||r[63]!==H?(U=(0,y.jsx)(de,{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}),r[62]=V,r[63]=H,r[64]=U):U=r[64];let W;r[65]!==je||r[66]!==Ae||r[67]!==Pe||r[68]!==Ne||r[69]!==Me||r[70]!==C?.granted||r[71]!==C?.isMacOS||r[72]!==C?.message?(W=C?.isMacOS&&(0,y.jsx)(de,{title:`Screen & System Audio Recording`,description:`Tarsk needs this macOS permission to capture screen content for browser tools and screen sharing features.`,action:(0,y.jsx)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:(0,y.jsxs)(ne,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:()=>void Ne(),disabled:Ae,children:[Ae?(0,y.jsx)(o,{className:`h-3.5 w-3.5 animate-spin`}):(0,y.jsx)(ee,{className:`h-3.5 w-3.5`}),(0,y.jsx)(`span`,{className:`sr-only`,children:`Refresh permission status`})]})}),children:(0,y.jsx)(`div`,{className:`flex items-center gap-3`,children:Ae?(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(o,{className:`h-4 w-4 animate-spin text-muted-foreground`}),(0,y.jsx)(`span`,{className:m.bodyMuted,children:`Checking permission status...`})]}):C?.granted?(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(re,{className:`h-4 w-4 text-green-500`}),(0,y.jsx)(`span`,{className:p(m.body,`text-green-600 dark:text-green-400`),children:`Permission granted`})]}):(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(d,{className:`h-4 w-4 text-amber-500`}),(0,y.jsx)(`span`,{className:p(m.body,`text-amber-600 dark:text-amber-400`),children:`Permission not granted`})]}),(0,y.jsx)(`p`,{className:m.bodyMuted,children:C?.message??`Tarsk needs Screen & System Audio Recording permission to use browser tools.`}),(0,y.jsx)(ne,{size:`sm`,onClick:()=>void Pe(),disabled:je,className:`w-fit`,children:je?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o,{className:`h-4 w-4 mr-2 animate-spin`}),`Opening Settings...`]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(t,{className:`h-4 w-4 mr-2`}),`Open System Settings`]})}),Me&&(0,y.jsxs)(`div`,{className:`flex items-start gap-2 p-3 rounded-md bg-destructive/10 text-destructive`,children:[(0,y.jsx)(f,{className:`h-4 w-4 mt-0.5 flex-shrink-0`}),(0,y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,y.jsx)(`p`,{className:m.body,children:`Failed to open System Settings`}),(0,y.jsx)(`p`,{className:m.bodyMuted,children:Me}),(0,y.jsxs)(`p`,{className:m.bodyMuted,children:[`Please open it manually:`,` `,(0,y.jsx)(`strong`,{children:`System Settings > Privacy & Security > Screen & System Audio Recording`})]})]})]})]})})}),r[65]=je,r[66]=Ae,r[67]=Pe,r[68]=Ne,r[69]=Me,r[70]=C?.granted,r[71]=C?.isMacOS,r[72]=C?.message,r[73]=W):W=r[73];let Qe,$e;r[74]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,y.jsx)(se,{title:`Mobile & Network Access`,className:`mb-1`}),$e=(0,y.jsx)(`p`,{className:p(m.bodyMuted,`mb-3`),children:`Allow the Tarsk mobile app or other web browsers to access Tarsk on the wifi network.`}),r[74]=Qe,r[75]=$e):(Qe=r[74],$e=r[75]);let et=Fe||Ie,G;r[76]===Le?G=r[77]:(G=e=>{(e===`local`||e===`network`)&&Le(e)},r[76]=Le,r[77]=G);let tt;r[78]===Symbol.for(`react.memo_cache_sentinel`)?(tt=Se.map(De),r[78]=tt):tt=r[78];let K;r[79]!==E||r[80]!==et||r[81]!==G?(K=(0,y.jsx)(te,{type:`single`,value:E,disabled:et,onValueChange:G,"aria-label":`Server bind mode`,variant:`outline`,className:`inline-flex rounded-full border bg-muted/40 p-1`,children:tt}),r[79]=E,r[80]=et,r[81]=G,r[82]=K):K=r[82];let q;r[83]!==w||r[84]!==T||r[85]!==E?(q=E===`network`&&T.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`p`,{className:`${m.bodyMuted} mt-3`,children:[`Available on the network at:`,` `,(0,y.jsxs)(`span`,{className:m.mono,children:[`http://`,T[0],`:`,we]})]}),w&&(0,y.jsx)(`p`,{className:`${m.bodyMuted} mt-1`,children:`You will need to restart for this setting to take effect.`})]}),r[83]=w,r[84]=T,r[85]=E,r[86]=q):q=r[86];let J;r[87]!==T||r[88]!==E?(J=E===`network`&&T.length===0&&(0,y.jsx)(`p`,{className:`${m.bodyMuted} mt-3`,children:`No network IP addresses were detected on this computer.`}),r[87]=T,r[88]=E,r[89]=J):J=r[89];let Y;r[90]!==w||r[91]!==E?(Y=w&&E===`local`&&(0,y.jsxs)(`p`,{className:`${m.bodyMuted} mt-3`,children:[(0,y.jsx)(`br`,{}),`You will need to restart for this setting to take effect.`]}),r[90]=w,r[91]=E,r[92]=Y):Y=r[92];let X;r[93]!==K||r[94]!==q||r[95]!==J||r[96]!==Y?(X=(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[Qe,$e,K,q,J,Y]}),r[93]=K,r[94]=q,r[95]=J,r[96]=Y,r[97]=X):X=r[97];let Z;r[98]!==T||r[99]!==E?(Z=E===`network`&&T.length>0&&(0,y.jsxs)(`div`,{className:`hidden md:flex flex-col items-center gap-2 flex-shrink-0`,children:[(0,y.jsx)(oe,{value:`http://${T[0]}:${we}`,size:128,bgColor:`hsl(var(--background))`,fgColor:`hsl(var(--foreground))`,level:`M`}),(0,y.jsx)(`p`,{className:`${m.compact} text-muted-foreground text-center`,children:`Scan with the Tarsk Mobile App`})]}),r[98]=T,r[99]=E,r[100]=Z):Z=r[100];let Q;r[101]!==X||r[102]!==Z?(Q=(0,y.jsxs)(`div`,{className:`flex items-start gap-6`,children:[X,Z]}),r[101]=X,r[102]=Z,r[103]=Q):Q=r[103];let $;r[104]!==L||r[105]!==z||r[106]!==U||r[107]!==W||r[108]!==Q?($=(0,y.jsxs)(`div`,{className:`space-y-8`,children:[L,z,U,W,Q]}),r[104]=L,r[105]=z,r[106]=U,r[107]=W,r[108]=Q,r[109]=$):$=r[109];let nt;return r[110]!==$||r[111]!==O?(nt=(0,y.jsx)(ce,{children:(0,y.jsxs)(le,{children:[O,$]})}),r[110]=$,r[111]=O,r[112]=nt):nt=r[112],nt}function De(e){return(0,y.jsx)(h,{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 Oe(e){return(0,y.jsx)(h,{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{Ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{La as t,Lo as n,Po as r,hi as i,ji as a,jt as o,pi as s,pn as c}from"./dialogs-config-CxRnlUcQ.js";import{E as l,S as u,T as d,w as f}from"./history-view-DebwP9D7.js";import{B as p,I as m,R as h}from"./index-D9aY24hf.js";var g=e(n(),1),_=r();function v(){let e=p(e=>e.selectedThreadId),[n,r]=(0,g.useState)(``),[v,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(!1);(0,g.useEffect)(()=>{e&&(y(!0),o(e,`AGENTS.md`).then(e=>r(e.content)).catch(()=>r(``)).finally(()=>y(!1)))},[e]);async function S(){if(e){x(!0);try{await c(e,`AGENTS.md`,n),m({title:`Instructions saved`})}catch(e){m({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)(s,{onClick:S,disabled:v||b,children:b?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(t,{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)(t,{className:`h-8 w-8 animate-spin text-muted-foreground`})}):(0,_.jsx)(h,{value:n,onChange:e=>r(e.target.value),className:i(a.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{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ar as t,Fo as n,Lo as r,Po as i,_r as a,fa as o,gr as s,hi as c,ji as l,pi as u,vr as d,yr as f}from"./dialogs-config-CxRnlUcQ.js";import{C as p,I as m,i as h,r as g}from"./history-view-DebwP9D7.js";import{t as _}from"./skeleton-CVhaOA8k.js";var v=n(),y=i(),b=e(r(),1),x=m(e=>(0,y.jsxs)(`div`,{className:`text-center py-12 border border-dashed rounded-lg mb-8`,children:[e.v0,(0,y.jsx)(`h3`,{className:e.v1,children:e.v2}),(0,y.jsx)(`p`,{className:e.v3,children:e.v4})]}),{name:`InstalledEmptyState_1`,portals:[`v0`,`v2`,`v4`]}),S=function(e){let t=(0,v.c)(8),{icon:n,title:r,description:i}=e,a;t[0]===n?a=t[1]:(a=(0,y.jsx)(n,{className:`mx-auto h-10 w-10 text-muted-foreground/50 mb-3`}),t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=c(l.emptyStateTitle,`mb-1`),t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=c(l.bodyMuted,`mb-3`),t[3]=s):s=t[3];let u;return t[4]!==i||t[5]!==a||t[6]!==r?(u=(0,y.jsx)(x,{v0:a,v1:o,v2:r,v3:s,v4:i}),t[4]=i,t[5]=a,t[6]=r,t[7]=u):u=t[7],u};function C(e){let t=(0,v.c)(16),{title:n,subtitle:r,subtitleMono:i,badge:a,actions:o}=e,s=i===void 0?!1:i,u;t[0]===n?u=t[1]:(u=typeof n==`string`?(0,y.jsx)(`h3`,{className:c(l.label,`truncate`),children:n}):n,t[0]=n,t[1]=u);let d;t[2]!==a||t[3]!==u?(d=(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u,a]}),t[2]=a,t[3]=u,t[4]=d):d=t[4];let f;t[5]!==r||t[6]!==s?(f=r?(0,y.jsx)(`p`,{className:c(l.bodyMuted,`mt-1 truncate`,s&&l.mono),children:r}):null,t[5]=r,t[6]=s,t[7]=f):f=t[7];let p;t[8]!==d||t[9]!==f?(p=(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[d,f]}),t[8]=d,t[9]=f,t[10]=p):p=t[10];let m;t[11]===o?m=t[12]:(m=(0,y.jsx)(w,{actions:o}),t[11]=o,t[12]=m);let _;return t[13]!==p||t[14]!==m?(_=(0,y.jsx)(g,{children:(0,y.jsxs)(h,{className:`flex items-center justify-between p-4`,children:[p,m]})}),t[13]=p,t[14]=m,t[15]=_):_=t[15],_}function w(e){let t=(0,v.c)(4),{actions:n}=e,r;t[0]===n?r=t[1]:(r=n.map(T),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,y.jsx)(d,{delayDuration:300,children:(0,y.jsx)(`div`,{className:`flex items-center gap-1 ml-4 flex-shrink-0`,children:r})}),t[2]=r,t[3]=i),i}function T(e){return(0,y.jsxs)(s,{children:[(0,y.jsx)(f,{asChild:!0,children:(0,y.jsx)(u,{variant:`ghost`,size:`icon-sm`,onClick:e.onClick,children:(0,y.jsx)(`span`,{className:e.destructive?`text-destructive`:void 0,children:e.icon})})}),(0,y.jsx)(a,{children:e.label})]},e.label)}function E(e){let n=(0,v.c)(7),{placeholder:r,value:i,onChange:a}=e,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,y.jsx)(o,{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]===a?c=n[2]:(c=e=>a(e.target.value),n[1]=a,n[2]=c);let l;return n[3]!==r||n[4]!==c||n[5]!==i?(l=(0,y.jsxs)(`div`,{className:`relative mb-4`,children:[s,(0,y.jsx)(t,{placeholder:r,value:i,onChange:c,className:`pl-8`})]}),n[3]=r,n[4]=c,n[5]=i,n[6]=l):l=n[6],l}function D(e){let t=(0,v.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,y.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 O(e){let t=(0,v.c)(3),{searchQuery:n,emptyLabel:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=c(l.bodyMuted,`text-center py-8`),t[0]=i):i=t[0];let a=n.trim()?`No results for "${n}"`:r,o;return t[1]===a?o=t[2]:(o=(0,y.jsx)(`p`,{className:i,children:a}),t[1]=a,t[2]=o),o}function k(e){let t=(0,v.c)(3),{message:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=c(l.bodyMuted,`text-center py-8`),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,y.jsx)(`p`,{className:r,children:n}),t[1]=n,t[2]=i),i}function A(e){let t=(0,v.c)(7),{loading:n,items:r,emptyState:i,getKey:a,renderRow:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,y.jsx)(p,{title:`Installed`}),t[0]=s):s=t[0];let c;return t[1]!==i||t[2]!==a||t[3]!==r||t[4]!==n||t[5]!==o?(c=(0,y.jsxs)(y.Fragment,{children:[s,n?(0,y.jsxs)(`div`,{className:`space-y-3`,children:[(0,y.jsx)(_,{className:`h-20 w-full`}),(0,y.jsx)(_,{className:`h-20 w-full`})]}):r.length===0?(0,y.jsx)(S,{...i}):(0,y.jsx)(`div`,{className:`space-y-3 mb-8`,children:r.map(e=>(0,y.jsx)(b.Fragment,{children:o(e)},a(e)))})]}),t[1]=i,t[2]=a,t[3]=r,t[4]=n,t[5]=o,t[6]=c):c=t[6],c}export{O as a,D as i,C as n,E as o,A as r,k as s,S as t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$i as t,Ar as n,Ca as r,Fo as i,Ki as a,Lo as o,M as s,Nr as c,Po as l,ba as u,ji as d,jr as f,lt as p,no as m,pi as h,pt as g,ua as _,un as v}from"./dialogs-config-CxRnlUcQ.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-DebwP9D7.js";import{B as L,I as R,M as z,N as B,R as V,c as ne,d as H,l as U,u as re}from"./index-D9aY24hf.js";import{t as W}from"./skeleton-CVhaOA8k.js";import{a as ie,i as G,n as K,o as ae,t as oe}from"./settings-list-BZDwK9bE.js";import{t as se}from"./mcp-server-card-B6iwOybN.js";var q=i(),J=e(o(),1);function ce(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 p(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 le(){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=()=>{g().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 Y(e,t,n){await v(e,t,n)}async function ue(e,t){await s(e,t)}var X=l();function de(e){return e?.url?`remote`:`local`}function fe(e){return Object.entries(e??{}).map(([e,t])=>({key:e,value:t}))}function Z({projectPath:e,serverName:t,initialName:r,initialConfig:i,onBack:o}){let{installedServers:s}=ce(e),c=!!t,[l,f]=(0,J.useState)(`local`),[p,m]=(0,J.useState)(``),[g,_]=(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,z]=(0,J.useState)(!1),[B,W]=(0,J.useState)(null),[ie,G]=(0,J.useState)(c),[K,ae]=(0,J.useState)(``),[oe,se]=(0,J.useState)(``);function q(e,t){let n=de(t);f(n),m(e),_(t.command??``),y((t.args??[]).join(`
|
|
2
|
-
`)),x(t.url??``),C(t.transport??`sse`),T(fe(t.env)),D(fe(t.headers)),ae(e),se(JSON.stringify({name:e,type:n,config:t}))}(0,J.useEffect)(()=>{if(c&&t){let e=s.find(e=>e.name===t);e&&(q(e.name,e.config),G(!1))}else i&&q(r??``,i),G(!1)},[s,t,c,i,r]);let le=(0,J.useCallback)(()=>{T(e=>[...e,{key:``,value:``}])},[]),Z=(0,J.useCallback)(e=>{T(t=>t.filter((t,n)=>n!==e))},[]),Q=(0,J.useCallback)((e,t)=>{T(n=>n.map((n,r)=>r===e?{...n,key:t}:n))},[]),pe=(0,J.useCallback)((e,t)=>{T(n=>n.map((n,r)=>r===e?{...n,value:t}:n))},[]),$=(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(l===`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:g.trim(),args:t,...e?{env:e}:{}}}let ye=JSON.stringify({name:p.trim(),type:l,config:ve()}),be=async()=>{W(null);let t=p.trim();if(!t){W(`Server name is required`);return}if(l===`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(!g.trim()){W(`Command is required`);return}P(!0);try{if(!e)throw Error(`No project path`);await Y(e,K||t,ve()),R({title:`Success`,description:c?`MCP server configuration saved`:`MCP server added`}),o()}catch(e){W(e instanceof Error?e.message:`Failed to save server`)}finally{P(!1)}},xe=async()=>{if(e){z(!0);try{await ue(e,K),R({title:`Success`,description:`MCP server removed`}),o()}catch(e){W(e instanceof Error?e.message:`Failed to delete server`)}finally{z(!1)}}},Se=c?ye!==oe:p.trim()!==``||g.trim()!==``||v.trim()!==``||b.trim()!==``||w.length>0||E.length>0;return ie?(0,X.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,X.jsx)(`p`,{className:d.bodyMuted,children:`Loading server configuration...`})}):(0,X.jsx)(ee,{children:(0,X.jsxs)(I,{children:[(0,X.jsx)(te,{title:c?p:`Add MCP Server`,description:c?`Edit MCP Server configuration.`:`Configure a new MCP Server.`}),(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsx)(O,{title:`Server name`,description:c?`Server name cannot be changed`:void 0,children:(0,X.jsx)(n,{id:`server-name`,placeholder:`e.g. filesystem`,value:p,onChange:e=>m(e.target.value),disabled:c})}),(0,X.jsxs)(ne,{value:l,onValueChange:e=>f(e),className:`w-full`,children:[(0,X.jsxs)(re,{className:`grid w-full grid-cols-2`,children:[(0,X.jsx)(H,{value:`local`,children:`Local (stdio)`}),(0,X.jsx)(H,{value:`remote`,children:`Remote (HTTP/SSE)`})]}),(0,X.jsxs)(U,{value:`local`,className:`space-y-6 mt-6`,children:[(0,X.jsx)(O,{title:`Command`,children:(0,X.jsx)(n,{id:`server-command`,placeholder:`e.g. npx`,value:g,onChange:e=>_(e.target.value)})}),(0,X.jsx)(O,{title:`Arguments`,description:`One argument per line`,children:(0,X.jsx)(V,{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,X.jsxs)(U,{value:`remote`,className:`space-y-6 mt-6`,children:[(0,X.jsx)(O,{title:`Server URL`,description:`Paste the MCP endpoint URL from your provider.`,children:(0,X.jsx)(n,{id:`server-url`,placeholder:`https://example.com/mcp`,value:b,onChange:e=>x(e.target.value),className:`font-mono`})}),(0,X.jsx)(O,{title:`Transport`,children:(0,X.jsxs)(k,{value:S,onValueChange:e=>C(e),children:[(0,X.jsx)(M,{children:(0,X.jsx)(j,{})}),(0,X.jsxs)(A,{children:[(0,X.jsx)(F,{value:`sse`,children:`SSE (Server-Sent Events)`}),(0,X.jsx)(F,{value:`streamableHttp`,children:`Streamable HTTP`})]})]})}),(0,X.jsx)(O,{title:`HTTP headers`,description:`Optional headers for authentication.`,action:(0,X.jsxs)(h,{variant:`ghost`,size:`sm`,onClick:$,children:[(0,X.jsx)(u,{className:`h-3 w-3 mr-1`}),`Add header`]}),children:E.length===0?(0,X.jsx)(`p`,{className:d.caption,children:`No headers configured`}):(0,X.jsx)(`div`,{className:`flex flex-col gap-2`,children:E.map((e,t)=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(n,{placeholder:`Authorization`,value:e.key,onChange:e=>he(t,e.target.value),className:`font-mono w-[35%]`}),(0,X.jsx)(n,{placeholder:`Bearer ...`,value:e.value,onChange:e=>ge(t,e.target.value),className:`font-mono flex-1`}),(0,X.jsx)(h,{variant:`ghost`,size:`icon`,onClick:()=>me(t),className:`h-9 w-9 flex-shrink-0`,children:(0,X.jsx)(a,{className:`h-3.5 w-3.5`})})]},t))})})]})]}),(0,X.jsx)(O,{title:`Environment variables`,description:l===`remote`?`Optional metadata for local tooling.`:void 0,action:(0,X.jsxs)(h,{variant:`ghost`,size:`sm`,onClick:le,children:[(0,X.jsx)(u,{className:`h-3 w-3 mr-1`}),`Add variable`]}),children:w.length===0?(0,X.jsx)(`p`,{className:d.caption,children:`No environment variables configured`}):(0,X.jsx)(`div`,{className:`flex flex-col gap-2`,children:w.map((e,t)=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(n,{placeholder:`KEY`,value:e.key,onChange:e=>Q(t,e.target.value),className:`font-mono w-[35%]`}),(0,X.jsx)(n,{placeholder:`value`,value:e.value,onChange:e=>pe(t,e.target.value),className:`font-mono flex-1`}),(0,X.jsx)(h,{variant:`ghost`,size:`icon`,onClick:()=>Z(t),className:`h-9 w-9 flex-shrink-0`,children:(0,X.jsx)(a,{className:`h-3.5 w-3.5`})})]},t))})}),B&&(0,X.jsx)(`p`,{className:d.error,children:B}),(0,X.jsxs)(`div`,{className:`border-t pt-4 flex items-center justify-between`,children:[c&&(0,X.jsx)(h,{variant:`destructive`,onClick:xe,disabled:L||N,children:L?`Removing...`:`Remove`}),!c&&(0,X.jsx)(`div`,{}),(0,X.jsx)(h,{onClick:be,disabled:N||L||!Se,children:N?c?`Saving...`:`Adding...`:c?`Save`:`Add`})]})]})]})})}function Q(e){return e.name.toLowerCase().replace(/\s+/g,`-`)}function pe(e){return e.url?e.url:`${e.command??``} ${e.args?.join(` `)??``}`.trim()}function $(){let e=L(e=>e.selectedProjectId),n=L(e=>e.projects).find(t=>t.projectId===e)?.projectPath,{installedServers:i,loadingConfig:a,loadInstalledServers:o}=ce(n),{popularServers:s}=le(),{setActiveMainTab:l}=B(),{setPendingExplorerPath:u,triggerExplorerRefresh:d}=z(),[p,g]=(0,J.useState)(!1),[v,O]=(0,J.useState)(null),[k,A]=(0,J.useState)(null),[j,M]=(0,J.useState)(null),[F,I]=(0,J.useState)(!1),[V,ne]=(0,J.useState)(``),H=(0,J.useCallback)(async e=>{if(n){I(!0);try{await ue(n,e),await o(),d(),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)}}},[n,o,d]),U=(0,J.useCallback)(()=>{u(`.agents/mcp.json`),l(`explorer`)},[u,l]),re=(0,J.useCallback)(async e=>{if(!n)return;let t=Q(e);if(!i.some(n=>n.name===t||n.name===e.id)){if(e.url!==void 0){if(!e.url.trim()){O({name:t,config:{url:``,transport:e.transport??`sse`,...Object.keys(e.env??{}).length>0?{env:e.env}:{}}}),g(!0);return}try{await Y(n,t,{url:e.url,transport:e.transport??`sse`,...Object.keys(e.env??{}).length>0?{env:e.env}:{}}),await o(),d(),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 Y(n,t,{command:e.command,args:e.args??[],...Object.keys(e.env??{}).length>0?{env:e.env}:{}}),await o(),d(),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`})}}},[n,i,o,d]),q=V.trim()?s.filter(e=>e.name.toLowerCase().includes(V.toLowerCase())||e.description.toLowerCase().includes(V.toLowerCase())):s;return e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ee,{children:(0,X.jsxs)(x,{children:[(0,X.jsx)(te,{title:`MCP Servers`,description:`Manage Model Context Protocol servers for your project.`,action:(0,X.jsx)(h,{onClick:()=>g(!0),children:`Add Server`})}),(0,X.jsx)(b,{title:`Installed`}),a?(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsx)(W,{className:`h-20 w-full`}),(0,X.jsx)(W,{className:`h-20 w-full`})]}):i.length===0?(0,X.jsx)(oe,{icon:_,title:`No MCP servers installed`,description:`Add an MCP server to extend agent capabilities.`}):(0,X.jsx)(`div`,{className:`space-y-3 mb-8`,children:i.map(e=>(0,X.jsx)(K,{title:e.name,subtitle:pe(e.config),subtitleMono:!0,actions:[{label:`View config file`,icon:(0,X.jsx)(m,{className:`h-4 w-4`}),onClick:U},{label:`Edit server`,icon:(0,X.jsx)(r,{className:`h-4 w-4`}),onClick:()=>A(e.name)},{label:`Delete server`,icon:(0,X.jsx)(t,{className:`h-4 w-4`}),onClick:()=>M(e.name),destructive:!0}]},e.name))}),(0,X.jsx)(b,{title:`Available`,className:`mb-0`}),(0,X.jsx)(ae,{placeholder:`Search available servers...`,value:V,onChange:ne}),s.length===0?(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsx)(W,{className:`h-20 w-full`}),(0,X.jsx)(W,{className:`h-20 w-full`})]}):q.length===0?(0,X.jsx)(ie,{searchQuery:V,emptyLabel:`No available servers found.`}):(0,X.jsx)(G,{children:q.map(e=>{let t=Q(e),n=i.some(n=>n.name===t||n.name===e.id);return(0,X.jsx)(se,{name:e.name,description:e.description,installed:n,onClick:()=>{n||re(e)},showInstalledControls:!1},e.id)})})]})}),(0,X.jsx)(f,{open:p,onOpenChange:e=>{g(e),e||O(null)},children:(0,X.jsx)(c,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,X.jsx)(Z,{projectPath:n,initialName:v?.name,initialConfig:v?.config,onBack:()=>{g(!1),O(null),o(),d()}})})}),(0,X.jsx)(f,{open:k!==null,onOpenChange:e=>{e||A(null)},children:(0,X.jsx)(c,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,X.jsx)(Z,{projectPath:n,serverName:k??void 0,onBack:()=>{A(null),o(),d()}})})}),(0,X.jsx)(T,{open:j!==null,onOpenChange:e=>!e&&M(null),children:(0,X.jsxs)(N,{children:[(0,X.jsxs)(E,{children:[(0,X.jsx)(S,{children:`Delete MCP Server`}),(0,X.jsxs)(C,{children:[`Are you sure you want to delete the server "`,j,`"? This action cannot be undone.`]})]}),(0,X.jsxs)(w,{children:[(0,X.jsx)(y,{children:`Cancel`}),(0,X.jsx)(P,{onClick:()=>j&&void H(j),disabled:F,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:F?`Deleting...`:`Delete`})]})]})})]}):(0,X.jsx)(D,{children:`Select a project to manage MCP servers.`})}export{$ as SettingsMCPServersView,$ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{B as t,Et as n,Fo as r,H as i,Lo as a,No as o,Po as s,Tt as c,U as l,V as u,W as d,_r as f,gi as p,gr as m,hi as h,ji as g,pi as _,ra as v,uo as y,vr as b,yr as x,z as S}from"./dialogs-config-CxRnlUcQ.js";import{C,D as w,E as T,S as E,T as D,a as O,l as k,n as A,o as j,x as ee}from"./history-view-DebwP9D7.js";import{a as M,n as te,u as N}from"./onboarding-BN_K08ma.js";import{c as P,d as F,l as I,u as L}from"./index-D9aY24hf.js";import{t as R}from"./use-deferred-search-b843Ztu9.js";import{t as z}from"./model-star-rating-BgdOyTTO.js";import{o as B,s as V}from"./settings-list-BZDwK9bE.js";import{t as H}from"./settings-models-skeleton-DAEnT4kC.js";var U=e(a(),1),W=r();function G(e){return`settings-models:coding:${e}`}function K(e){return`settings-models:image:${e}`}async function q(){let e=(await n()).filter(e=>e.apiKey),t={};e.forEach(e=>{t[e.slug]=`alphabetical`});let r={},i={};return await Promise.all(e.map(async e=>{try{let t=await d(e.slug);r[e.slug]=t.models,i[e.slug]=new Set(t.enabledModelIds)}catch(t){console.error(`Failed to load models for ${e.slug}:`,t),r[e.slug]=[],i[e.slug]=new Set}})),{providers:e,allModels:r,enabledModelIds:i,providerSortOptions:t}}async function J(e){let t=e.filter(e=>e.name.toLowerCase()===`openrouter`),n={},r={};return await Promise.all(t.map(async e=>{try{let t=await l(e.slug);n[e.slug]=t.models,r[e.slug]=new Set(t.enabledModelIds)}catch(t){console.error(`Failed to load image models for ${e.slug}:`,t),n[e.slug]=[],r[e.slug]=new Set}})),{allImageModels:n,enabledImageModelIds:r}}var Y=s();function ne({providers:e,globalSearchQuery:t,providerSortOptions:n,setProviderSortOptions:r,filterAndSortModels:i,getModelDisplayName:a,onSaveStatus:s}){let l=O(K(0),()=>J(e)),[d]=(0,U.useState)(l.allImageModels),[v,w]=(0,U.useState)(l.enabledImageModelIds);async function T(e,t){try{v[e]?.has(t)?(await S(e,t),w(n=>{let r=new Set(n[e]??[]);return r.delete(t),{...n,[e]:r}})):(await u(e,t),w(n=>({...n,[e]:new Set([...n[e]||[],t])}))),s(`Model preferences saved successfully`)}catch(e){s(e instanceof Error?e.message:`Failed to save model changes`)}}async function E(e,t){let n=d[e],r=v[e];if(n)for(let i of n)r?.has(i.id)!==t&&await T(e,i.id)}return(0,Y.jsx)(`div`,{className:`space-y-6`,children:e.filter(e=>e.name.toLowerCase()===`openrouter`).map(e=>{let s=d[e.slug]||[],l=v[e.slug]||new Set,u=n[e.slug]||`alphabetical`,S=i(s,l,u);return S.length===0&&t?null:(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:(0,Y.jsx)(`img`,{src:c(e.slug),alt:`${e.name} logo`,className:`h-5 w-5 dark:invert`,onError:e=>{e.target.style.display=`none`;let t=e.target.parentElement;t&&(t.classList.remove(`overflow-hidden`),t.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-muted-foreground"><path d="M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5"/><path d="M8.5 8.5a2.5 2.5 0 0 0 0 5"/><path d="M15.5 15.5a2.5 2.5 0 0 0 0-5"/></svg>`)}})}),(0,Y.jsx)(C,{title:e.name,className:`mb-0`})]}),S.length>0&&(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(M,{id:`select-all-image-${e.slug}`,checked:S.every(e=>l.has(e.id)),onCheckedChange:t=>void E(e.slug,t===!0)}),(0,Y.jsx)(`label`,{htmlFor:`select-all-image-${e.slug}`,className:h(g.body,`cursor-pointer whitespace-nowrap`),children:`Select all models`})]}),(0,Y.jsx)(b,{children:(0,Y.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,Y.jsxs)(m,{children:[(0,Y.jsx)(x,{asChild:!0,children:(0,Y.jsx)(_,{type:`button`,variant:u===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>r(t=>({...t,[e.slug]:`alphabetical`})),children:(0,Y.jsx)(o,{className:`h-4 w-4`})})}),(0,Y.jsx)(f,{children:`Sort A–Z`})]}),(0,Y.jsxs)(m,{children:[(0,Y.jsx)(x,{asChild:!0,children:(0,Y.jsx)(_,{type:`button`,variant:u===`price-low`||u===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>r(t=>({...t,[e.slug]:`price-low`})),children:(0,Y.jsx)(y,{className:`h-4 w-4`})})}),(0,Y.jsx)(f,{children:`Sort by price`})]})]})})]}),S.length===0?(0,Y.jsx)(V,{message:t?`No models matching your search.`:`No image models available for this provider.`}):(0,Y.jsx)(b,{children:(0,Y.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:S.map(t=>{let n=l.has(t.id),r=t.pricing;return(0,Y.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`,children:[(0,Y.jsx)(M,{id:`image-${t.id}`,checked:n,onCheckedChange:()=>void T(e.slug,t.id),className:`mt-0`}),(0,Y.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,Y.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,Y.jsx)(`label`,{htmlFor:`image-${t.id}`,className:h(g.label,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:a(t)})}),r&&(0,Y.jsx)(`span`,{className:h(g.compact,`text-muted-foreground whitespace-nowrap flex-shrink-0`),children:(r.prompt??0)===0&&(r.completion??0)===0?``:`$${p(r.prompt??0)} in | $${p(r.completion??0)} out`})]})]},t.id)})})})]},e.slug)})})}function X({loadVersion:e}){let n=O(G(e),()=>q()),r=n.providers,[a]=(0,U.useState)(n.allModels),[s,l]=(0,U.useState)(n.enabledModelIds),[u,d]=(0,U.useState)(`coding`),{query:S,setQuery:A,deferredQuery:j}=R(),[H,W]=(0,U.useState)(n.providerSortOptions),[K,J]=(0,U.useState)(``),X=e=>N(e.id),Z=async(e,n)=>{try{s[e]?.has(n)?(await t(e,n),l(t=>{let r=new Set(t[e]??[]);return r.delete(n),{...t,[e]:r}})):(await i(e,n),l(t=>({...t,[e]:new Set([...t[e]||[],n])}))),J(`Model preferences saved successfully`),setTimeout(()=>J(``),3e3)}catch(e){J(e instanceof Error?e.message:`Failed to save model changes`)}},Q=async(e,t)=>{let n=a[e],r=s[e];if(n)for(let i of n)r?.has(i.id)!==t&&await Z(e,i.id)},$=(e,t,n)=>te({models:e,query:j,sortBy:n,getDisplayName:X,getPriority:e=>+!t.has(e.id)});return r.length===0?(0,Y.jsx)(D,{title:`No providers configured`,children:`Configure a provider with an API key to view available models.`}):(0,Y.jsx)(w,{children:(0,Y.jsxs)(T,{children:[(0,Y.jsx)(E,{title:`Models`,description:`View and manage available models from your configured providers.`}),(0,Y.jsxs)(`div`,{className:`space-y-6`,children:[(0,Y.jsx)(B,{placeholder:`Search models across all providers...`,value:S,onChange:A}),(0,Y.jsxs)(P,{value:u,onValueChange:e=>{d(e),A(``)},children:[(0,Y.jsxs)(L,{className:`mb-4`,children:[(0,Y.jsx)(F,{value:`coding`,children:`Coding`}),r.some(e=>e.name.toLowerCase()===`openrouter`)&&(0,Y.jsx)(F,{value:`image`,children:`Image`})]}),(0,Y.jsx)(I,{value:`coding`,children:(0,Y.jsx)(`div`,{className:`space-y-6`,children:r.map(e=>{let t=a[e.slug]||[],n=s[e.slug]||new Set,r=H[e.slug]||`alphabetical`,i=$(t,n,r);return i.length===0&&S?null:(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:(0,Y.jsx)(`img`,{src:c(e.slug),alt:`${e.name} logo`,className:`h-5 w-5 dark:invert`,onError:e=>{e.target.style.display=`none`;let t=e.target.parentElement;t&&(t.classList.remove(`overflow-hidden`),t.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-muted-foreground"><path d="M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5"/><path d="M8.5 8.5a2.5 2.5 0 0 0 0 5"/><path d="M15.5 15.5a2.5 2.5 0 0 0 0-5"/></svg>`)}})}),(0,Y.jsx)(C,{title:e.name,className:`mb-0`})]}),i.length>0&&(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(M,{id:`select-all-${e.slug}`,checked:i.every(e=>n.has(e.id)),onCheckedChange:t=>Q(e.slug,t===!0)}),(0,Y.jsx)(`label`,{htmlFor:`select-all-${e.slug}`,className:h(g.body,`cursor-pointer whitespace-nowrap`),children:`Select all models`})]}),(0,Y.jsx)(b,{children:(0,Y.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,Y.jsxs)(m,{children:[(0,Y.jsx)(x,{asChild:!0,children:(0,Y.jsx)(_,{type:`button`,variant:r===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>W(t=>({...t,[e.slug]:`alphabetical`})),children:(0,Y.jsx)(o,{className:`h-4 w-4`})})}),(0,Y.jsx)(f,{children:`Sort A–Z`})]}),(0,Y.jsxs)(m,{children:[(0,Y.jsx)(x,{asChild:!0,children:(0,Y.jsx)(_,{type:`button`,variant:r===`price-low`||r===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>W(t=>({...t,[e.slug]:`price-low`})),children:(0,Y.jsx)(y,{className:`h-4 w-4`})})}),(0,Y.jsx)(f,{children:`Sort by price`})]}),(0,Y.jsxs)(m,{children:[(0,Y.jsx)(x,{asChild:!0,children:(0,Y.jsx)(_,{type:`button`,variant:r===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>W(t=>({...t,[e.slug]:`coding-index`})),children:(0,Y.jsx)(v,{className:`h-4 w-4`})})}),(0,Y.jsx)(f,{children:`Sort by coding intelligence`})]})]})})]}),i.length===0?(0,Y.jsx)(V,{message:S?`No models matching your search.`:`No models available for this provider.`}):(0,Y.jsx)(b,{children:(0,Y.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:i.map(t=>{let i=n.has(t.id),a=t.pricing;return(0,Y.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`,children:[(0,Y.jsx)(M,{id:t.id,checked:i,onCheckedChange:()=>Z(e.slug,t.id),className:`mt-0`}),(0,Y.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,Y.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,Y.jsx)(`label`,{htmlFor:t.id,className:h(g.body,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:X(t)})}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[r===`coding-index`&&(0,Y.jsx)(z,{codingIndex:t.coding_index,modelName:X(t)}),a&&(0,Y.jsx)(`span`,{className:h(g.compact,`text-muted-foreground whitespace-nowrap`),children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${p(a.prompt??0)} in | $${p(a.completion??0)} out`})]})]})]},t.id)})})})]},e.slug)})})}),(0,Y.jsx)(I,{value:`image`,children:u===`image`?(0,Y.jsx)(U.Suspense,{fallback:(0,Y.jsx)(k,{className:`py-12`,size:`sm`}),children:(0,Y.jsx)(ne,{providers:r,globalSearchQuery:S,providerSortOptions:H,setProviderSortOptions:W,filterAndSortModels:$,getModelDisplayName:X,onSaveStatus:e=>{J(e),e.includes(`Failed`)||setTimeout(()=>J(``),3e3)}})}):null})]}),K&&(0,Y.jsx)(ee,{variant:K.includes(`error`)||K.includes(`Failed`)?`error`:`success`,className:`mb-0`,children:K})]})]})})}function Z(){let e=(0,W.c)(8),[t,n]=(0,U.useState)(0),r;e[0]===t?r=e[1]:(r=function(){j(G(t)),n($)},e[0]=t,e[1]=r);let i=r,a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(H,{}),e[2]=a):a=e[2];let o;e[3]===t?o=e[4]:(o=(0,Y.jsx)(U.Suspense,{fallback:a,children:(0,Y.jsx)(X,{loadVersion:t},t)}),e[3]=t,e[4]=o);let s;return e[5]!==i||e[6]!==o?(s=(0,Y.jsx)(A,{fallbackTitle:`Failed to load models`,onRetry:i,renderFallback:Q,children:o}),e[5]=i,e[6]=o,e[7]=s):s=e[7],s}function Q(e,t){return(0,Y.jsx)(D,{title:`Failed to load models`,action:(0,Y.jsx)(_,{variant:`outline`,onClick:t,children:`Retry`}),children:e.message})}function $(e){return e+1}export{Z as SettingsModelsView,Z as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$i as t,Ar as n,Fo as r,L as i,Lo as a,Mt as o,Nr as s,P as c,Po as l,hi as u,ji as d,jr as f,mt as p,no as m,pa as h,pi as ee,pn as g,qt as te,yt as ne}from"./dialogs-config-CxRnlUcQ.js";import{n as _,t as v}from"./react-vendor-CE5Dmjd0.js";import{A as re,C as ie,D as y,E as b,F as x,M as ae,N as oe,O as se,P as S,S as C,T as w,b as T,j as E,k as D,x as ce,y as O}from"./history-view-DebwP9D7.js";import{B as k,I as A,M as le,N as ue,R as j}from"./index-D9aY24hf.js";import{t as M}from"./skeleton-CVhaOA8k.js";import{t as de}from"./use-deferred-search-b843Ztu9.js";import{a as N,i as P,n as F,o as I,r as L}from"./settings-list-BZDwK9bE.js";import{t as R}from"./mcp-server-card-B6iwOybN.js";import{n as z,r as B,t as V}from"./slug-utils-DGOwJkKI.js";var H=r(),U=e(a(),1),W=l(),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=u(`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)(_,{className:u(`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)(v,{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=v.displayName;function fe({threadId:e,onRuleCreated:t}){let[r,i]=(0,U.useState)(``),[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(!1),[l,f]=(0,U.useState)(!1),p=z(r),m=V(p),h=async()=>{if(!(!m||!e)){f(!0);try{let n=`---
|
|
2
|
-
description: ${a.trim()}
|
|
3
|
-
alwaysApply: ${s}
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Place your rule instructions here as markdown.
|
|
7
|
-
`;await g(e,`.agents/rules/${p}.md`,n),A({title:`Rule created`,description:`Rule '${p}' was created successfully.`}),i(``),o(``),c(!1),t?.(p)}catch(e){A({title:`Error`,description:e instanceof Error?e.message:`Failed to create rule`,variant:`destructive`})}finally{f(!1)}}};return e?(0,W.jsx)(y,{children:(0,W.jsxs)(O,{children:[(0,W.jsx)(C,{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)(T,{title:`Rule Name`,children:[(0,W.jsx)(n,{id:`ruleName`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. Code Style Guide`,disabled:l}),r?(0,W.jsxs)(`p`,{className:u(d.caption,`mt-2`),children:[`File name: `,(0,W.jsxs)(`span`,{className:`font-mono`,children:[p||`...`,`.md`]})]}):null]}),(0,W.jsx)(T,{title:`Description`,children:(0,W.jsx)(j,{id:`ruleDescription`,value:a,onChange:e=>o(e.target.value),placeholder:`Describe when Tarsk should apply this rule...`,className:`resize-none min-h-[120px]`,disabled:l})}),(0,W.jsx)(T,{title:`Always Apply`,description:s?`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:s,onCheckedChange:c,disabled:l})}),(0,W.jsx)(B,{onContinue:()=>void h(),disabled:!m||!a.trim(),creating:l})]})]})}):(0,W.jsx)(w,{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=k(e=>e.selectedProjectId),n=k(e=>e.selectedThreadId),{setActiveMainTab:r}=ue(),{setPendingExplorerPath:a,triggerExplorerRefresh:l,setExplorerClearPath:u}=le(),[d,_]=(0,U.useState)([]),[v,T]=(0,U.useState)(!1),[O,j]=(0,U.useState)(!1),[z,B]=(0,U.useState)(null),[V,H]=(0,U.useState)(!1),[G,q]=(0,U.useState)([]),[J,Y]=(0,U.useState)(new Set),{query:X,setQuery:pe,deferredQuery:Z}=de(),Q=(0,U.useCallback)(async()=>{if(e){T(!0);try{let t=K(await ne(e));if(n)try{let e=K(await o(n)),r=new Set(t.map(e=>e.path));for(let n of e)r.has(n.path)||t.push(n)}catch{}_(t),Y(new Set(t.map(e=>e.path)))}catch{_([]),Y(new Set)}finally{T(!1)}}},[e,n]);(0,U.useEffect)(()=>{Q()},[Q]),(0,U.useEffect)(()=>{p().then(q).catch(()=>q([]))},[]);let me=(0,U.useCallback)(async t=>{if(!e)return;let r=t.name,a=t.path;H(!0);try{try{await c(e,a)}catch{if(n)await i(n,a);else throw Error(`No thread selected to delete from`)}u(a),l(),Y(e=>{let t=new Set(e);return t.delete(a),t}),A({title:`Rule removed`,description:r}),B(null),await Q()}catch(e){A({title:`Error`,description:e instanceof Error?e.message:`Failed to remove rule`,variant:`destructive`})}finally{H(!1)}},[e,n,Q,l,u]),he=(0,U.useCallback)(e=>{a(e),r(`explorer`)},[a,r]),ge=(0,U.useCallback)(async e=>{let t=`.agents/rules/${e.name}.md`;if(!(!n||J.has(t)))try{e.gitHubRepo&&e.gitHubFolder?await te(n,e.gitHubRepo,e.gitHubFolder,`.agents/rules`):await g(n,t,[`---`,`description: ${e.description}`,`alwaysApply: ${e.alwaysApply??!1}`,`---`,``,e.content].join(`
|
|
8
|
-
`)),Y(e=>new Set(e).add(t)),l(),Q(),A({title:`Rule installed`,description:e.name})}catch(e){A({title:`Error`,description:e instanceof Error?e.message:`Failed to install rule`,variant:`destructive`})}},[n,J,l,Q]),$=(0,U.useMemo)(()=>Z.trim()?G.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):G,[G,Z]);return e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(y,{children:(0,W.jsxs)(b,{children:[(0,W.jsx)(C,{title:`Rules`,description:`Manage agent rules. Rules define coding standards and project-wide guidelines.`,action:(0,W.jsx)(ee,{onClick:()=>j(!0),disabled:!n,children:`Add Rule`})}),!n&&(0,W.jsx)(ce,{children:`Select a thread to add or install rules.`}),(0,W.jsx)(L,{loading:v,items:d,emptyState:{icon:h,title:`No rules installed`,description:`Add rules to enforce coding standards and project conventions.`},getKey:e=>e.id,renderRow:e=>(0,W.jsx)(F,{title:e.name,subtitle:e.path,subtitleMono:!0,actions:[{label:`View in explorer`,icon:(0,W.jsx)(m,{className:`h-4 w-4`}),onClick:()=>he(e.path)},{label:`Delete rule`,icon:(0,W.jsx)(t,{className:`h-4 w-4`}),onClick:()=>B(e),destructive:!0}]})}),(0,W.jsx)(ie,{title:`Available`,className:`mb-0`}),(0,W.jsx)(I,{placeholder:`Search available rules...`,value:X,onChange:pe}),G.length===0?(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(M,{className:`h-20 w-full`}),(0,W.jsx)(M,{className:`h-20 w-full`})]}):$.length===0?(0,W.jsx)(N,{searchQuery:X,emptyLabel:`No available rules found.`}):(0,W.jsx)(P,{children:$.map(e=>{let t=`.agents/rules/${e.name}.md`,n=J.has(t);return(0,W.jsx)(R,{name:e.name,description:e.description,installed:n,onClick:()=>{n||ge(e)},showInstalledControls:!1},e.id)})})]})}),(0,W.jsx)(f,{open:O,onOpenChange:j,children:(0,W.jsx)(s,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,W.jsx)(fe,{threadId:n,onRuleCreated:()=>{j(!1),Q(),l()}})})}),(0,W.jsx)(se,{open:z!==null,onOpenChange:e=>!e&&B(null),children:(0,W.jsxs)(E,{children:[(0,W.jsxs)(S,{children:[(0,W.jsx)(x,{children:`Delete Rule`}),(0,W.jsxs)(ae,{children:[`Are you sure you want to delete the rule "`,z?.name,`"? This action cannot be undone.`]})]}),(0,W.jsxs)(oe,{children:[(0,W.jsx)(re,{children:`Cancel`}),(0,W.jsx)(D,{onClick:()=>z&&void me(z),disabled:V,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:V?`Deleting...`:`Delete`})]})]})})]}):(0,W.jsx)(w,{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{$i as t,Ar as n,L as r,Lo as i,Mt as a,Nr as o,P as s,Po as c,hi as l,ht as u,ji as d,jr as f,k as p,no as m,pi as ee,pn as h,qi as g,qt as _,yt as v}from"./dialogs-config-CxRnlUcQ.js";import{A as te,C as ne,D as y,E as re,F as ie,M as ae,N as oe,O as se,P as b,S as x,T as S,b as C,j as ce,k as w,x as le,y as T}from"./history-view-DebwP9D7.js";import{B as E,I as D,M as ue,N as de,R as O}from"./index-D9aY24hf.js";import{t as k}from"./skeleton-CVhaOA8k.js";import{t as A}from"./use-deferred-search-b843Ztu9.js";import{a as j,i as M,n as N,o as P,r as F}from"./settings-list-BZDwK9bE.js";import{t as I}from"./mcp-server-card-B6iwOybN.js";import{n as L,r as R,t as z}from"./slug-utils-DGOwJkKI.js";var B=e(i(),1),V=c();function fe({threadId:e,onSkillCreated:t}){let[r,i]=(0,B.useState)(``),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(!1),u=L(r),f=z(u),m=async()=>{if(!(!f||!a.trim()||!e)){c(!0);try{let n=await p(e,u,a.trim());D({title:`Skill created`,description:`Skill '${u}' was created successfully.`}),i(``),o(``),t?.(n.path,`SKILL.md`)}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{c(!1)}}};return e?(0,V.jsx)(y,{children:(0,V.jsxs)(T,{children:[(0,V.jsx)(x,{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,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(C,{title:`Skill Name`,children:[(0,V.jsx)(n,{id:`skillName`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. Code Review`,disabled:s}),r?(0,V.jsxs)(`p`,{className:l(d.caption,`mt-2`),children:[`Folder name: `,(0,V.jsx)(`span`,{className:`font-mono`,children:u||`...`})]}):null]}),(0,V.jsx)(C,{title:`Description`,children:(0,V.jsx)(O,{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,V.jsx)(R,{onContinue:()=>void m(),disabled:!f||!a.trim(),creating:s})]})]})}):(0,V.jsx)(S,{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=E(e=>e.selectedProjectId),n=E(e=>e.selectedThreadId),{setActiveMainTab:i}=de(),{setPendingExplorerPath:c,triggerExplorerRefresh:l,setExplorerClearPath:d}=ue(),[p,C]=(0,B.useState)([]),[T,O]=(0,B.useState)(!1),[L,R]=(0,B.useState)(!1),[z,U]=(0,B.useState)(null),[W,G]=(0,B.useState)(!1),[K,q]=(0,B.useState)([]),[J,Y]=(0,B.useState)(new Set),{query:X,setQuery:pe,deferredQuery:Z}=A(),Q=(0,B.useCallback)(async()=>{if(e){O(!0);try{let t=H(await v(e));if(n)try{let e=H(await a(n)),r=new Set(t.map(e=>e.path));for(let n of e)r.has(n.path)||t.push(n)}catch{}C(t),Y(new Set(t.map(e=>`${e.path}/SKILL.md`)))}catch{C([]),Y(new Set)}finally{O(!1)}}},[e,n]);(0,B.useEffect)(()=>{Q()},[Q]),(0,B.useEffect)(()=>{u().then(q).catch(()=>q([]))},[]);let me=(0,B.useCallback)(async t=>{if(!e)return;let i=t.name,a=t.path;G(!0);try{try{await s(e,a)}catch{if(n)await r(n,a);else throw Error(`No thread selected to delete from`)}d(a),l(),Y(e=>{let t=new Set(e);return t.delete(`${a}/SKILL.md`),t}),D({title:`Skill removed`,description:i}),U(null),await Q()}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to remove skill`,variant:`destructive`})}finally{G(!1)}},[e,n,Q,l,d]),he=(0,B.useCallback)(e=>{c(`${e}/SKILL.md`),i(`explorer`)},[c,i]),ge=(0,B.useCallback)(async e=>{let t=`.agents/skills/${e.id}/SKILL.md`;if(!(!n||J.has(t)))try{if(e.gitHubRepo&&e.gitHubFolder)await _(n,e.gitHubRepo,e.gitHubFolder,`.agents/skills/${e.id}`);else{let r=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.allowedTools&&r.push(`allowed-tools: ${e.allowedTools}`),e.license&&r.push(`license: ${e.license}`),r.push(`---`,``,e.instructions),await h(n,t,r.join(`
|
|
2
|
-
`))}Y(e=>new Set(e).add(t)),l(),Q(),D({title:`Skill installed`,description:e.name})}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to install skill`,variant:`destructive`})}},[n,J,l,Q]),$=(0,B.useMemo)(()=>Z.trim()?K.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):K,[K,Z]);return e?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(y,{children:(0,V.jsxs)(re,{children:[(0,V.jsx)(x,{title:`Skills`,description:`Manage agent skills. Skills are reusable instruction sets that guide agent behavior.`,action:(0,V.jsx)(ee,{onClick:()=>R(!0),disabled:!n,children:`Add Skill`})}),!n&&(0,V.jsx)(le,{children:`Select a thread to add or install skills.`}),(0,V.jsx)(F,{loading:T,items:p,emptyState:{icon:g,title:`No skills installed`,description:`Add skills to extend agent capabilities with reusable instructions.`},getKey:e=>e.id,renderRow:e=>(0,V.jsx)(N,{title:e.name,subtitle:e.path,subtitleMono:!0,actions:[{label:`View in explorer`,icon:(0,V.jsx)(m,{className:`h-4 w-4`}),onClick:()=>he(e.path)},{label:`Delete skill`,icon:(0,V.jsx)(t,{className:`h-4 w-4`}),onClick:()=>U(e),destructive:!0}]})}),(0,V.jsx)(ne,{title:`Available`,className:`mb-0`}),(0,V.jsx)(P,{placeholder:`Search available skills...`,value:X,onChange:pe}),K.length===0?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(k,{className:`h-20 w-full`}),(0,V.jsx)(k,{className:`h-20 w-full`})]}):$.length===0?(0,V.jsx)(j,{searchQuery:X,emptyLabel:`No available skills found.`}):(0,V.jsx)(M,{children:$.map(e=>{let t=`.agents/skills/${e.id}/SKILL.md`,n=J.has(t);return(0,V.jsx)(I,{name:e.name,description:e.description,installed:n,onClick:()=>{n||ge(e)},showInstalledControls:!1},e.id)})})]})}),(0,V.jsx)(f,{open:L,onOpenChange:R,children:(0,V.jsx)(o,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,V.jsx)(fe,{threadId:n,onSkillCreated:()=>{R(!1),Q(),l()}})})}),(0,V.jsx)(se,{open:z!==null,onOpenChange:e=>!e&&U(null),children:(0,V.jsxs)(ce,{children:[(0,V.jsxs)(b,{children:[(0,V.jsx)(ie,{children:`Delete Skill`}),(0,V.jsxs)(ae,{children:[`Are you sure you want to delete the skill "`,z?.name,`"? This action cannot be undone.`]})]}),(0,V.jsxs)(oe,{children:[(0,V.jsx)(te,{children:`Cancel`}),(0,V.jsx)(w,{onClick:()=>z&&void me(z),disabled:W,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:W?`Deleting...`:`Delete`})]})]})})]}):(0,V.jsx)(S,{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{$i as t,Ar as n,E as r,F as i,Lo as a,Nr as o,Or as s,Ot as c,Po as l,gt as u,hi as d,ji as f,jr as p,no as m,pi as h,qt as g,ta as _}from"./dialogs-config-CxRnlUcQ.js";import{A as v,C as y,D as b,E as x,F as ee,M as S,N as C,O as w,P as T,S as E,T as D,b as O,j as te,k as ne,x as re,y as k}from"./history-view-DebwP9D7.js";import{B as A,I as j,M as ie,N as M}from"./index-D9aY24hf.js";import{t as N}from"./skeleton-CVhaOA8k.js";import{n as P,t as F}from"./radio-group-B9xMCZ1X.js";import{a as ae,i as oe,n as se,o as ce,r as le}from"./settings-list-BZDwK9bE.js";import{t as ue}from"./mcp-server-card-B6iwOybN.js";import{n as I,r as L,t as R}from"./slug-utils-DGOwJkKI.js";var z=e(a(),1),B=l();function V({projectId:e,threadId:t,onCommandCreated:i}){let[a,o]=(0,z.useState)(``),[c,l]=(0,z.useState)(``),[u,p]=(0,z.useState)(``),[m,h]=(0,z.useState)(`default`),[g,_]=(0,z.useState)(!1),v=I(a),y=R(v),x=async()=>{if(!(!y||!e)){_(!0);try{await r(v,``,{description:c.trim()||void 0,argumentHint:u.trim()||void 0,mode:m===`plan`?`plan`:void 0},`project`,t??void 0),j({title:`Command created`,description:`Command '/${v}' was created successfully.`}),o(``),l(``),p(``),h(`default`),i?.(v)}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to create command`,variant:`destructive`})}finally{_(!1)}}};return e?(0,B.jsx)(b,{children:(0,B.jsxs)(k,{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)(n,{id:`commandName`,value:a,onChange:e=>o(e.target.value),placeholder:`e.g. review`,disabled:g}),a?(0,B.jsxs)(`p`,{className:d(f.caption,`mt-2`),children:[`Command: `,(0,B.jsxs)(`span`,{className:`font-mono`,children:[`/`,v||`...`]})]}):null]}),(0,B.jsx)(O,{title:`Description`,children:(0,B.jsx)(n,{id:`commandDescription`,value:c,onChange:e=>l(e.target.value),placeholder:`Brief description shown in autocomplete`,disabled:g})}),(0,B.jsx)(O,{title:`Argument Hint`,description:`Shows after the command name to guide users what to type`,children:(0,B.jsx)(n,{id:`argumentHint`,value:u,onChange:e=>p(e.target.value),placeholder:`e.g. <focus-area> or <branch-name>`,disabled:g})}),(0,B.jsx)(O,{title:`Mode`,description:m==="default"?`Standard chat mode`:`Activates plan mode when this command is used`,children:(0,B.jsxs)(F,{value:m,onValueChange:e=>h(e),className:`flex gap-4`,disabled:g,children:[(0,B.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,B.jsx)(P,{value:`default`,id:`mode-default`}),(0,B.jsx)(s,{htmlFor:`mode-default`,className:d(f.labelNormal,`cursor-pointer`),children:`Default`})]}),(0,B.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,B.jsx)(P,{value:`plan`,id:`mode-plan`}),(0,B.jsx)(s,{htmlFor:`mode-plan`,className:d(f.labelNormal,`cursor-pointer`),children:`Plan`})]})]})}),(0,B.jsx)(L,{onContinue:()=>void x(),disabled:!y,creating:g})]})]})}):(0,B.jsx)(D,{title:`No project selected`,children:`Please select a project to add a slash command.`})}function H(){let e=A(e=>e.selectedProjectId),n=A(e=>e.selectedThreadId),{setActiveMainTab:a}=M(),{setPendingExplorerPath:s,triggerExplorerRefresh:l,setExplorerClearPath:O}=ie(),[k,P]=(0,z.useState)([]),[F,I]=(0,z.useState)(!1),[L,R]=(0,z.useState)(!1),[H,U]=(0,z.useState)(null),[W,G]=(0,z.useState)(!1),[K,q]=(0,z.useState)([]),[J,Y]=(0,z.useState)(new Map),[X,Z]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(n){I(!0);try{let e=await c(n);P(e.filter(e=>!e.isBuiltIn)),Y(new Map(e.map(e=>[e.name,e.filePath])))}catch{P([]),Y(new Map)}finally{I(!1)}}},[n]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{u().then(q).catch(()=>q([]))},[]);let de=(0,z.useCallback)(async e=>{G(!0);try{await i(e.filePath),O(e.filePath),l(),Y(t=>{let n=new Map(t);return n.delete(e.name),n}),j({title:`Command removed`,description:`/${e.name}`}),U(null),await Q()}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to remove command`,variant:`destructive`})}finally{G(!1)}},[Q,l,O]),fe=(0,z.useCallback)(e=>{s(e),a(`explorer`)},[s,a]),pe=(0,z.useCallback)(async e=>{if(!(!n||J.has(e.name)))try{if(e.gitHubRepo&&e.gitHubFolder){let t=`.agents/commands`;await g(n,e.gitHubRepo,e.gitHubFolder,t);let r=`${t}/${e.name}.md`;Y(t=>new Map(t).set(e.name,r))}else{let t=await r(e.name,e.content,{description:e.description,argumentHint:e.argumentHint},`project`,n);Y(n=>new Map(n).set(e.name,t.filePath))}l(),Q(),j({title:`Command installed`,description:`/${e.name}`})}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to install command`,variant:`destructive`})}},[n,J,l,Q]),$=X.trim()?K.filter(e=>e.name.toLowerCase().includes(X.toLowerCase())||e.description.toLowerCase().includes(X.toLowerCase())):K;return e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(b,{children:(0,B.jsxs)(x,{children:[(0,B.jsx)(E,{title:`Slash Commands`,description:`Manage slash commands. Commands are quick actions available via / in chat.`,action:(0,B.jsx)(h,{onClick:()=>R(!0),disabled:!n,children:`Add Command`})}),!n&&(0,B.jsx)(re,{children:`Select a thread to add or install slash commands.`}),(0,B.jsx)(le,{loading:F,items:k,emptyState:{icon:_,title:`No slash commands installed`,description:`Add slash commands to create quick actions in chat.`},getKey:e=>e.filePath,renderRow:e=>(0,B.jsx)(se,{title:`/${e.name}`,subtitle:e.metadata?.description||`No description`,badge:e.metadata?.mode?(0,B.jsx)(`span`,{className:d(f.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)(m,{className:`h-4 w-4`}),onClick:()=>fe(e.filePath)},{label:`Delete command`,icon:(0,B.jsx)(t,{className:`h-4 w-4`}),onClick:()=>U(e),destructive:!0}]})}),(0,B.jsx)(y,{title:`Available`,className:`mb-0`}),(0,B.jsx)(ce,{placeholder:`Search available commands...`,value:X,onChange:Z}),K.length===0?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(N,{className:`h-20 w-full`}),(0,B.jsx)(N,{className:`h-20 w-full`})]}):$.length===0?(0,B.jsx)(ae,{searchQuery:X,emptyLabel:`No available commands found.`}):(0,B.jsx)(oe,{children:$.map(e=>{let t=J.has(e.name);return(0,B.jsx)(ue,{name:`/${e.name}`,description:e.description,installed:t,onClick:()=>{t||pe(e)},showInstalledControls:!1},e.id)})})]})}),(0,B.jsx)(p,{open:L,onOpenChange:R,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:n,onCommandCreated:()=>{R(!1),Q(),l()}})})}),(0,B.jsx)(w,{open:H!==null,onOpenChange:e=>!e&&U(null),children:(0,B.jsxs)(te,{children:[(0,B.jsxs)(T,{children:[(0,B.jsx)(ee,{children:`Delete Slash Command`}),(0,B.jsxs)(S,{children:[`Are you sure you want to delete "/`,H?.name,`"? This action cannot be undone.`]})]}),(0,B.jsxs)(C,{children:[(0,B.jsx)(v,{children:`Cancel`}),(0,B.jsx)(ne,{onClick:()=>H&&void de(H),disabled:W,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:W?`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{$i as t,Ar as n,Ji as r,L as i,Lo as a,Mt as o,Nr as s,O as c,P as l,Po as u,ft as d,hi as f,ji as p,jr as m,no as h,pi as g,pn as ee,qt as _,yt as v}from"./dialogs-config-CxRnlUcQ.js";import{A as y,C as b,D as x,E as te,F as ne,M as S,N as re,O as ie,P as ae,S as C,T as w,b as T,j as oe,k as E,x as se,y as D}from"./history-view-DebwP9D7.js";import{B as O,I as k,M as ce,N as le,R as A}from"./index-D9aY24hf.js";import{t as j}from"./skeleton-CVhaOA8k.js";import{a as ue,i as M,n as N,o as P,r as F}from"./settings-list-BZDwK9bE.js";import{t as I}from"./mcp-server-card-B6iwOybN.js";import{n as L,r as R,t as z}from"./slug-utils-DGOwJkKI.js";var B=e(a(),1),V=u();function H({threadId:e,onAgentCreated:t}){let[r,i]=(0,B.useState)(``),[a,o]=(0,B.useState)(``),[s,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(!1),m=L(r),h=z(m),g=async()=>{if(!(!h||!a.trim()||!e)){d(!0);try{let n=await c(e,m,a.trim(),s.trim()||void 0);k({title:`Agent created`,description:`Agent '${m}' was created successfully.`}),i(``),o(``),l(``),t?.(n.path,`AGENTS.md`)}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to create agent`,variant:`destructive`})}finally{d(!1)}}};return e?(0,V.jsx)(x,{children:(0,V.jsxs)(D,{children:[(0,V.jsx)(C,{title:`Add Agent`,description:`Create a new agent. The agent will be saved as an AGENTS.md file in the .agents folder.`}),(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(T,{title:`Agent Name`,children:[(0,V.jsx)(n,{id:`agentName`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. Code Reviewer`,disabled:u}),r?(0,V.jsxs)(`p`,{className:f(p.caption,`mt-2`),children:[`Folder name: `,(0,V.jsx)(`span`,{className:`font-mono`,children:m||`...`})]}):null]}),(0,V.jsx)(T,{title:`Description`,children:(0,V.jsx)(A,{id:`agentDescription`,value:a,onChange:e=>o(e.target.value),placeholder:`Describe the agent's purpose and behavior...`,className:`resize-none min-h-[120px]`,disabled:u})}),(0,V.jsx)(T,{title:`Tools`,description:`Optional space-separated list of tools this agent can use`,children:(0,V.jsx)(n,{id:`agentTools`,value:s,onChange:e=>l(e.target.value),placeholder:`e.g. read grep glob`,disabled:u})}),(0,V.jsx)(R,{onContinue:()=>void g(),disabled:!h||!a.trim(),creating:u})]})]})}):(0,V.jsx)(w,{title:`No thread selected`,children:`Please select a thread to add an agent.`})}function U(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(...U(n.children));return t}function W(){let e=O(e=>e.selectedProjectId),n=O(e=>e.selectedThreadId),{setActiveMainTab:a}=le(),{setPendingExplorerPath:c,triggerExplorerRefresh:u,setExplorerClearPath:f}=ce(),[p,T]=(0,B.useState)([]),[D,A]=(0,B.useState)(!1),[L,R]=(0,B.useState)(!1),[z,W]=(0,B.useState)(null),[G,K]=(0,B.useState)(!1),[q,J]=(0,B.useState)([]),[Y,X]=(0,B.useState)(new Set),[Z,de]=(0,B.useState)(``),Q=(0,B.useCallback)(async()=>{if(e){A(!0);try{let t=U(await v(e));if(n)try{let e=U(await o(n)),r=new Set(t.map(e=>e.path));for(let n of e)r.has(n.path)||t.push(n)}catch{}T(t),X(new Set(t.map(e=>`${e.path}/AGENT.md`)))}catch{T([]),X(new Set)}finally{A(!1)}}},[e,n]);(0,B.useEffect)(()=>{Q()},[Q]),(0,B.useEffect)(()=>{d().then(J).catch(()=>J([]))},[]);let fe=(0,B.useCallback)(async t=>{if(!e)return;let r=t.name,a=t.path;K(!0);try{try{await l(e,a)}catch{if(n)await i(n,a);else throw Error(`No thread selected to delete from`)}f(a),u(),X(e=>{let t=new Set(e);return t.delete(`${a}/AGENT.md`),t}),k({title:`Agent removed`,description:r}),W(null),await Q()}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to remove agent`,variant:`destructive`})}finally{K(!1)}},[e,n,Q,u,f]),pe=(0,B.useCallback)(e=>{c(`${e}/AGENT.md`),a(`explorer`)},[c,a]),me=(0,B.useCallback)(async e=>{let t=`.agents/agents/${e.id}/AGENT.md`;if(!(!n||Y.has(t)))try{if(e.gitHubRepo&&e.gitHubFolder)await _(n,e.gitHubRepo,e.gitHubFolder,`.agents/agents/${e.id}`);else{let r=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.tools&&r.push(`tools: ${e.tools}`),r.push(`---`,``,e.systemPrompt),await ee(n,t,r.join(`
|
|
2
|
-
`))}X(e=>new Set(e).add(t)),u(),Q(),k({title:`Agent installed`,description:e.name})}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to install agent`,variant:`destructive`})}},[n,Y,u,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return e?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(x,{children:(0,V.jsxs)(te,{children:[(0,V.jsx)(C,{title:`Subagents`,description:`Manage subagents. Subagents are specialized agents for focused tasks.`,action:(0,V.jsx)(g,{onClick:()=>R(!0),disabled:!n,children:`Add Subagent`})}),!n&&(0,V.jsx)(se,{children:`Select a thread to add or install subagents.`}),(0,V.jsx)(F,{loading:D,items:p,emptyState:{icon:r,title:`No subagents installed`,description:`Add subagents for specialized, focused tasks.`},getKey:e=>e.id,renderRow:e=>(0,V.jsx)(N,{title:e.name,subtitle:e.path,subtitleMono:!0,actions:[{label:`View in explorer`,icon:(0,V.jsx)(h,{className:`h-4 w-4`}),onClick:()=>pe(e.path)},{label:`Delete agent`,icon:(0,V.jsx)(t,{className:`h-4 w-4`}),onClick:()=>W(e),destructive:!0}]})}),(0,V.jsx)(b,{title:`Available`,className:`mb-0`}),(0,V.jsx)(P,{placeholder:`Search available subagents...`,value:Z,onChange:de}),q.length===0?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(j,{className:`h-20 w-full`}),(0,V.jsx)(j,{className:`h-20 w-full`})]}):$.length===0?(0,V.jsx)(ue,{searchQuery:Z,emptyLabel:`No available subagents found.`}):(0,V.jsx)(M,{children:$.map(e=>{let t=`.agents/agents/${e.id}/AGENT.md`,n=Y.has(t);return(0,V.jsx)(I,{name:e.name,description:e.description,installed:n,onClick:()=>{n||me(e)},showInstalledControls:!1},e.id)})})]})}),(0,V.jsx)(m,{open:L,onOpenChange:R,children:(0,V.jsx)(s,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,V.jsx)(H,{threadId:n,onAgentCreated:()=>{R(!1),Q(),u()}})})}),(0,V.jsx)(ie,{open:z!==null,onOpenChange:e=>!e&&W(null),children:(0,V.jsxs)(oe,{children:[(0,V.jsxs)(ae,{children:[(0,V.jsx)(ne,{children:`Delete Subagent`}),(0,V.jsxs)(S,{children:[`Are you sure you want to delete the subagent "`,z?.name,`"? This action cannot be undone.`]})]}),(0,V.jsxs)(re,{children:[(0,V.jsx)(y,{children:`Cancel`}),(0,V.jsx)(E,{onClick:()=>z&&void fe(z),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,V.jsx)(w,{children:`Select a project to manage subagents.`})}export{W as SettingsSubagentsView,W as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-general-view-D_44BPVr.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-D9aY24hf.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-DebwP9D7.js","assets/dialogs-config-CxRnlUcQ.js","assets/onboarding-BN_K08ma.js","assets/vosk-speech-CgILeNJR.js","assets/react-vendor-CE5Dmjd0.js","assets/utils-BIt9KCVx.js","assets/index-C2_gO3dh.css","assets/project-settings-view-BDvHOmF8.js","assets/radio-group-B9xMCZ1X.js","assets/providers-list-view-DydWz8z3.js","assets/model-star-rating-BgdOyTTO.js","assets/skeleton-CVhaOA8k.js","assets/use-deferred-search-b843Ztu9.js","assets/settings-models-view-CluPgRkw.js","assets/settings-models-skeleton-DAEnT4kC.js","assets/settings-list-BZDwK9bE.js","assets/settings-mcp-servers-view-B8IqOOnN.js","assets/mcp-server-card-B6iwOybN.js","assets/settings-skills-view-BE9u6FvJ.js","assets/slug-utils-DGOwJkKI.js","assets/settings-rules-view-CxHrCDwn.js","assets/settings-slash-commands-view-CVOZ3GH3.js","assets/settings-subagents-view-mguSf6zE.js","assets/settings-instructions-view-Y6EK67-G.js","assets/settings-system-prompt-view-0sXVxXh3.js","assets/account-view-CTizS7Yb.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ai as t,Ct as n,Da as r,Eo as i,Fo as a,Ha as o,Ji as s,Jt as c,Lo as l,Oo as u,Po as d,Yi as f,Za as p,aa as m,ca as h,fo as g,hi as _,in as v,ji as y,pa as b,pi as x,qi as S,ta as ee,ua as C}from"./dialogs-config-CxRnlUcQ.js";import{At as te,jt as ne,kt as re}from"./react-vendor-CE5Dmjd0.js";import{r as w}from"./monaco-CZnIWXyV.js";import{D as T,E,T as D}from"./history-view-DebwP9D7.js";import{d as O,l as k}from"./onboarding-BN_K08ma.js";import{B as A,F as j,H as M,b as N,f as ie,m as P,p as F,z as I}from"./index-D9aY24hf.js";import{t as L}from"./settings-models-skeleton-DAEnT4kC.js";var R=a(),z=e(l(),1),B=d(),ae=(0,z.forwardRef)(function(e,t){let n=(0,R.c)(28),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:u,className:d,onCollapse:f,onExpand:p,isMobile:m,mobileShowSidebar:h}=e,g=a===void 0?25:a,v=o===void 0?20:o,y=s===void 0?30:s,b=c===void 0?40:c,x=l===void 0?!1:l,S=u===void 0?0:u,ee=d===void 0?``:d,C=m===void 0?!1:m,te=h===void 0?!0:h,ne=C&&!te,re=C&&te,w=`h-full ${ee}`,T=C?100:g,E=C?50:v,D=C?100:y,O=ne&&`hidden`,k;n[0]===O?k=n[1]:(k=_(`border-r border-transparent`,O),n[0]=O,n[1]=k);let A;n[2]!==S||n[3]!==x||n[4]!==f||n[5]!==p||n[6]!==t||n[7]!==r||n[8]!==T||n[9]!==E||n[10]!==D||n[11]!==k?(A=(0,B.jsx)(F,{ref:t,defaultSize:T,minSize:E,maxSize:D,collapsible:x,collapsedSize:S,onCollapse:f,onExpand:p,className:k,children:r}),n[2]=S,n[3]=x,n[4]=f,n[5]=p,n[6]=t,n[7]=r,n[8]=T,n[9]=E,n[10]=D,n[11]=k,n[12]=A):A=n[12];let j;n[13]===C?j=n[14]:(j=!C&&(0,B.jsx)(ie,{withHandle:!0,className:`ml-[-40px]`}),n[13]=C,n[14]=j);let M=re&&`hidden`,N;n[15]===M?N=n[16]:(N=_(`overflow-hidden`,M),n[15]=M,n[16]=N);let I;n[17]!==i||n[18]!==b||n[19]!==N?(I=(0,B.jsx)(F,{minSize:b,className:N,children:i}),n[17]=i,n[18]=b,n[19]=N,n[20]=I):I=n[20];let L;n[21]!==A||n[22]!==j||n[23]!==I?(L=(0,B.jsxs)(P,{direction:`horizontal`,className:`h-full`,children:[A,j,I]}),n[21]=A,n[22]=j,n[23]=I,n[24]=L):L=n[24];let z;return n[25]!==w||n[26]!==L?(z=(0,B.jsx)(`div`,{className:w,children:L}),n[25]=w,n[26]=L,n[27]=z):z=n[27],z}),oe=[{id:`providers`,label:`Providers`,icon:(0,B.jsx)(g,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,B.jsx)(i,{className:`h-4 w-4`}),route:`/settings/models`},{id:`skills`,label:`Skills`,icon:(0,B.jsx)(S,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,B.jsx)(b,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,B.jsx)(ee,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,B.jsx)(s,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,B.jsx)(u,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`system-prompt`,label:`System Prompt`,icon:(0,B.jsx)(m,{className:`h-4 w-4`}),route:`/settings/system-prompt`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,B.jsx)(C,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`general`,label:`General`,icon:(0,B.jsx)(h,{className:`h-4 w-4`}),route:`/settings/general`},{id:`history`,label:`History`,icon:(0,B.jsx)(o,{className:`h-4 w-4`}),route:`/settings/history`},{id:`account`,label:`Account`,icon:(0,B.jsx)(f,{className:`h-4 w-4`}),route:`/settings/account`}];function V(e){let t=[...oe];if(!e)return t;let n=t.findIndex(e=>e.id===`skills`);return t.splice(n,0,{id:`project`,label:`Project`,icon:(0,B.jsx)(p,{className:`h-4 w-4`}),route:`/settings/project/${e}`}),t}function se(e){let t=(0,R.c)(21),{className:n,selectedProjectId:r,onResetOnboarding:i,onNavItemSelect:a}=e,o=te(),s=re(),c=(0,z.useRef)(0),l=(0,z.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,z.useEffect)(u,d);let f=N(),p;t[2]===r?p=t[3]:(p=V(r),t[2]=r,t[3]=p);let m=p,h;t[4]!==f||t[5]!==m?(h=f?m.filter(ce):m,t[4]=f,t[5]=m,t[6]=h):h=t[6];let g=h,_;t[7]!==s.pathname||t[8]!==g?(_=function(){let e=s.pathname;if(e.startsWith(`/settings/project/`))return`project`;for(let t of g)if(e.startsWith(t.route))return t.id;return`general`}(),t[7]=s.pathname,t[8]=g,t[9]=_):_=t[9];let v=_,y,b;if(t[10]!==v||t[11]!==n||t[12]!==g||t[13]!==o||t[14]!==a||t[15]!==i){let e=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)};y=`space-y-1${n?` ${n}`:``}`,b=g.map((t,n)=>(0,B.jsxs)(z.Fragment,{children:[(0,B.jsx)(O,{selected:v===t.id,asChild:!0,children:(0,B.jsx)(`button`,{className:`justify-start`,onClick:()=>e(t),children:(0,B.jsxs)(`span`,{className:`flex items-center gap-2`,children:[t.icon,(0,B.jsx)(`span`,{children:t.label})]})})}),(t.id===`models`||t.id===`mcp-servers`||n===g.length-1)&&(0,B.jsx)(k,{className:`my-2 bg-sidebar-border`})]},t.id)),t[10]=v,t[11]=n,t[12]=g,t[13]=o,t[14]=a,t[15]=i,t[16]=y,t[17]=b}else y=t[16],b=t[17];let x;return t[18]!==y||t[19]!==b?(x=(0,B.jsx)(`div`,{className:y,children:b}),t[18]=y,t[19]=b,t[20]=x):x=t[20],x}function ce(e){return e.id!==`account`}var le=(0,z.lazy)(()=>w(()=>import(`./settings-general-view-D_44BPVr.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),ue=(0,z.lazy)(()=>w(()=>import(`./project-settings-view-BDvHOmF8.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11,13]))),de=(0,z.lazy)(()=>w(()=>import(`./providers-list-view-DydWz8z3.js`),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,15,16,17]))),fe=(0,z.lazy)(()=>w(()=>import(`./settings-models-view-CluPgRkw.js`),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,10,11,15,19,16,20,17]))),pe=(0,z.lazy)(()=>w(()=>import(`./settings-mcp-servers-view-B8IqOOnN.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,22,20,16]))),me=(0,z.lazy)(()=>w(()=>import(`./settings-skills-view-BE9u6FvJ.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,10,11,22,24,20,16,17]))),he=(0,z.lazy)(()=>w(()=>import(`./settings-rules-view-CxHrCDwn.js`),__vite__mapDeps([25,1,2,3,4,5,6,7,8,9,10,11,22,24,20,16,17]))),ge=(0,z.lazy)(()=>w(()=>import(`./settings-slash-commands-view-CVOZ3GH3.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11,22,24,13,20,16]))),_e=(0,z.lazy)(()=>w(()=>import(`./settings-subagents-view-mguSf6zE.js`),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,22,24,20,16]))),ve=(0,z.lazy)(()=>w(()=>import(`./settings-instructions-view-Y6EK67-G.js`),__vite__mapDeps([28,1,2,3,4,5,6,7,8,9,10,11]))),ye=(0,z.lazy)(()=>w(()=>import(`./settings-system-prompt-view-0sXVxXh3.js`),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,10,11]))),be=(0,z.lazy)(()=>w(()=>import(`./account-view-CTizS7Yb.js`),__vite__mapDeps([30,1,2,3,4,5,6,7,8,9,10,11,16]))),xe=(0,z.lazy)(()=>w(()=>import(`./history-view-DebwP9D7.js`).then(e=>e.t),__vite__mapDeps([5,1,6]))),Se=[`general`,`providers`,`models`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`system-prompt`,`mcp-servers`,`history`,`account`];function H(e){let t=(0,R.c)(2),{title:n}=e,r;return t[0]===n?r=t[1]:(r=(0,B.jsx)(D,{title:n,children:`Content coming soon...`}),t[0]=n,t[1]=r),r}function Ce(){let e=(0,R.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsxs)(`div`,{className:`mb-6`,children:[(0,B.jsx)(`div`,{className:`h-8 w-32 bg-muted rounded animate-pulse mb-2`}),(0,B.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,B.jsx)(`div`,{className:`mb-6`,children:(0,B.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,B.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,B.jsxs)(`div`,{children:[r,(0,B.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,B.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,B.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`})]})]}),a=(0,B.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,B.jsx)(T,{children:(0,B.jsxs)(E,{children:[t,n,(0,B.jsxs)(`div`,{className:`space-y-8`,children:[i,(0,B.jsxs)(`div`,{children:[a,(0,B.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,B.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,B.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,B.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,B.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`})]})]})]})]})}),e[5]=o):o=e[5],o}function we(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 Te(e){let t=e.match(/^\/settings\/providers\/([^/]+)$/);return t?decodeURIComponent(t[1]):null}function U(){let e=(0,R.c)(62),{tab:i,projectId:a}=ne(),o=te(),s=re(),l=I(),u=A(Oe),d=A(De),f;e[0]!==s.pathname||e[1]!==a?(f=!!a&&s.pathname.startsWith(`/settings/project/`),e[0]=s.pathname,e[1]=a,e[2]=f):f=e[2];let p=f,m;e[3]===s.pathname?m=e[4]:(m=Te(s.pathname),e[3]=s.pathname,e[4]=m);let h=m!==null,g;if(e[5]!==s.pathname||e[6]!==s.search||e[7]!==i){let t=new URLSearchParams(s.search).get(`tab`);g=t&&Se.includes(t)?t:i&&Se.includes(i)?i:we(s.pathname),e[5]=s.pathname,e[6]=s.search,e[7]=i,e[8]=g}else g=e[8];let b=g,S=N(),[ee,C]=(0,z.useState)(!1),[w,T]=(0,z.useState)(!0),[E,D]=(0,z.useState)(0),O=(0,z.useRef)(null),k;bb0:{if(p){k=`Project`;break bb0}let t;e[9]===b?t=e[10]:(t=oe.find(e=>e.id===b)?.label??`Settings`,e[9]=b,e[10]=t),k=t}let ie=k,P;e[11]===S?P=e[12]:(P=()=>{S&&T(!1)},e[11]=S,e[12]=P);let F=P,V;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>{T(!0)},e[13]=V):V=e[13];let ce=V,U;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(U=async()=>{try{await v(),D(Ee)}catch(e){console.error(`Failed to reset onboarding:`,e)}},e[14]=U):U=e[14];let ke=U,W;e[15]===o?W=e[16]:(W=()=>{o(`/`)},e[15]=o,e[16]=W);let Ae=W,G;e[17]===u?G=e[18]:(G=u?{type:`project`,id:u}:void 0,e[17]=u,e[18]=G);let je=G,K;e[19]===o?K=e[20]:(K=()=>{o(`/settings/general`)},e[19]=o,e[20]=K);let Me=K,q;e[21]!==l||e[22]!==a?(q=async()=>{c(a);try{let e=await n();l({type:M.SetProjects,projects:e.projects})}catch(e){let t=e;throw console.error(`Failed to refresh projects after settings update:`,t),t}},e[21]=l,e[22]=a,e[23]=q):q=e[23];let Ne=q,Pe,Fe;e[24]!==S||e[25]!==s.pathname||e[26]!==o?(Pe=()=>{(s.pathname===`/settings`||s.pathname===`/settings/project`||[`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(e=>s.pathname.startsWith(e))||S&&s.pathname.startsWith(`/settings/account`))&&o(`/settings/general`,{replace:!0})},Fe=[s.pathname,o,S],e[24]=S,e[25]=s.pathname,e[26]=o,e[27]=Pe,e[28]=Fe):(Pe=e[27],Fe=e[28]),(0,z.useEffect)(Pe,Fe);let J;e[29]!==Ae||e[30]!==F||e[31]!==u?(J=()=>(0,B.jsx)(j,{onTitleClose:Ae,subtitle:`Settings`,children:(0,B.jsx)(`div`,{className:`px-2 py-2`,children:(0,B.jsx)(se,{selectedProjectId:u,onResetOnboarding:ke,onNavItemSelect:F})})}),e[29]=Ae,e[30]=F,e[31]=u,e[32]=J):J=e[32];let Ie=J,Le;e[33]!==b||e[34]!==Me||e[35]!==Ne||e[36]!==je||e[37]!==p||e[38]!==E||e[39]!==a||e[40]!==d?(Le=()=>{if(p&&a)return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`Project Settings`}),children:(0,B.jsx)(ue,{projectId:a,onProjectUpdated:Ne})});switch(b){case`general`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`General`}),children:(0,B.jsx)(le,{onboardingResetSignal:E})});case`providers`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(Ce,{}),children:(0,B.jsx)(de,{})});case`models`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(L,{}),children:(0,B.jsx)(fe,{})});case`skills`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`Skills`}),children:(0,B.jsx)(me,{})});case`rules`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`Rules`}),children:(0,B.jsx)(he,{})});case`slash-commands`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`Slash Commands`}),children:(0,B.jsx)(ge,{})});case`subagents`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`Subagents`}),children:(0,B.jsx)(_e,{})});case`instructions`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`Instructions`}),children:(0,B.jsx)(ve,{})});case`system-prompt`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`System Prompt`}),children:(0,B.jsx)(ye,{})});case`mcp-servers`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`MCP Servers`}),children:(0,B.jsx)(pe,{})});case`history`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`History`}),children:(0,B.jsx)(xe,{isOpen:!0,onClose:Me,initialFilter:je,projects:d,inline:!0})});case`account`:return(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(H,{title:`Account`}),children:(0,B.jsx)(be,{})});default:return(0,B.jsx)(H,{title:`Settings`})}},e[33]=b,e[34]=Me,e[35]=Ne,e[36]=je,e[37]=p,e[38]=E,e[39]=a,e[40]=d,e[41]=Le):Le=e[41];let Re=Le,ze,Be;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>C(!0),Be=()=>C(!1),e[42]=ze,e[43]=Be):(ze=e[42],Be=e[43]);let Y;e[44]===Ie?Y=e[45]:(Y=Ie(),e[44]=Ie,e[45]=Y);let Ve=`flex-1 overflow-auto ${ee&&!S?`ml-[40px]`:``}`,X;e[46]!==ie||e[47]!==S||e[48]!==h||e[49]!==w?(X=S&&!w&&!h?(0,B.jsx)(`div`,{className:_(t.settingsPage,`pb-0`),children:(0,B.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-center gap-2`,children:[(0,B.jsxs)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground`,onClick:ce,children:[(0,B.jsx)(r,{className:`h-4 w-4`}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Show settings menu`})]}),(0,B.jsx)(`span`,{className:_(y.sectionTitle,`truncate text-foreground`),children:ie})]})}):null,e[46]=ie,e[47]=S,e[48]=h,e[49]=w,e[50]=X):X=e[50];let Z;e[51]===Re?Z=e[52]:(Z=Re(),e[51]=Re,e[52]=Z);let Q;e[53]!==Ve||e[54]!==X||e[55]!==Z?(Q=(0,B.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:(0,B.jsxs)(`div`,{className:Ve,children:[X,Z]})}),e[53]=Ve,e[54]=X,e[55]=Z,e[56]=Q):Q=e[56];let $;return e[57]!==S||e[58]!==w||e[59]!==Y||e[60]!==Q?($=(0,B.jsx)(ae,{ref:O,collapsible:!0,isMobile:S,mobileShowSidebar:w,onCollapse:ze,onExpand:Be,sidebar:Y,children:Q}),e[57]=S,e[58]=w,e[59]=Y,e[60]=Q,e[61]=$):$=e[61],$}function Ee(e){return e+1}function De(e){return e.projects}function Oe(e){return e.selectedProjectId}export{U as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fo as e,Po as t,hi as n}from"./dialogs-config-CxRnlUcQ.js";var r=e(),i=t();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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fo as e,La as t,Po as n,So as r,pi as i}from"./dialogs-config-CxRnlUcQ.js";var a=e(),o=n();function s(e){let n=(0,a.c)(6),{onContinue:s,disabled:c,creating:l}=e,u=c||l,d;n[0]===l?d=n[1]:(d=l?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,o.jsxs)(o.Fragment,{children:[`Continue`,(0,o.jsx)(r,{className:`ml-2 h-4 w-4`})]}),n[0]=l,n[1]=d);let f;return n[2]!==s||n[3]!==u||n[4]!==d?(f=(0,o.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,o.jsx)(i,{onClick:s,disabled:u,children:d})}),n[2]=s,n[3]=u,n[4]=d,n[5]=f):f=n[5],f}function c(e){return e.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``)}function l(e){return e.length>0&&e.length<=64}export{c as n,s as r,l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Lo as t,Po as n,So as r,on as i,po as a}from"./dialogs-config-CxRnlUcQ.js";import{B as o,H as s,N as c,V as l,j as u,n as d}from"./index-D9aY24hf.js";var f=e(t(),1),p=n();function m(){let e=o(e=>e.selectedProjectId),t=o(e=>e.selectedThreadId),n=o(e=>e.projects),{terminalState:m,dispatch:h}=l(t),{queuedCommand:g,queuedRelativeFolder:_,outputLines:v,history:y,historyIndex:b,cwd:x,isRunning:S}=m,[C,w]=(0,f.useState)(``),[T,E]=(0,f.useState)([]),D=n.flatMap(e=>e.threads).find(e=>e.threadId===t)?.path??null,O=!x||x===`.`||x===`./`?D:x,k=!O||O===D,{activeMainTab:A}=c(),j=(0,f.useRef)(null),M=(0,f.useRef)(null),N=(0,f.useRef)(0);(0,f.useEffect)(()=>{j.current&&(j.current.scrollTop=j.current.scrollHeight)},[T]),(0,f.useEffect)(()=>{E(v),N.current=v.length},[t,v]),(0,f.useEffect)(()=>{if(v.length===0)E([]),N.current=0;else if(v.length>N.current){let e=v.slice(N.current);E(t=>[...t,...e]),N.current=v.length}},[v]),(0,f.useEffect)(()=>{S||M.current?.focus()},[S]),(0,f.useEffect)(()=>{A===`terminal`&&M.current?.focus()},[A]);let P=(0,f.useCallback)(async(n,r)=>{if(!(!e||!t||!n.trim())){h({type:s.AppendTerminalLine,line:{type:`input`,content:n}}),h({type:s.SetTerminalHistory,history:[n,...y.filter(e=>e!==n)].slice(0,50)}),h({type:s.SetTerminalHistoryIndex,index:-1}),w(``),h({type:s.SetTerminalRunning,isRunning:!0});try{let a=await i(e,t,n,r??void 0);if(!a){h({type:s.AppendTerminalLine,line:{type:`system`,content:`Command started but no output stream received.`}}),h({type:s.SetTerminalRunning,isRunning:!1});return}await d(a,{onOutput:e=>{h({type:s.AppendTerminalLine,line:{type:`output`,content:e}})},onError:e=>{h({type:s.AppendTerminalLine,line:{type:`error`,content:e}})},onCwd:e=>{h({type:s.SetTerminalCwd,cwd:e})}},u)}catch(e){h({type:s.AppendTerminalLine,line:{type:`error`,content:e instanceof Error?e.message:`Failed to run command`}})}finally{h({type:s.SetTerminalRunning,isRunning:!1})}}},[e,t,h,y]);return(0,f.useEffect)(()=>{g&&!S&&(P(g,_??void 0),h({type:s.ClearQueuedTerminalCommand}))},[g,_,S,h,P]),(0,p.jsxs)(`div`,{className:`flex flex-col h-full bg-neutral-950 text-neutral-200 font-mono text-sm overflow-hidden`,children:[(0,p.jsxs)(`div`,{ref:j,className:`flex-1 overflow-y-auto p-4 space-y-0.5 terminal-scrollbar`,onClick:e=>{e.target===e.currentTarget&&M.current?.focus()},children:[T.length===0&&!S&&(0,p.jsx)(`div`,{className:`text-neutral-600 italic text-xs`,children:`Enter your commands below...`}),T.map((e,t)=>(0,p.jsxs)(`div`,{className:`whitespace-pre-wrap break-all leading-6 ${e.type===`input`?`flex items-start gap-2 text-neutral-200`:e.type===`error`?`text-red-400`:e.type===`system`?`text-blue-400`:``}`,children:[e.type===`input`&&(0,p.jsx)(r,{className:`h-4 w-4 mt-1 shrink-0 text-blue-400/70`}),(0,p.jsx)(`span`,{children:e.content})]},t))]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-t border-white/5 bg-white/5`,children:[!k&&(0,p.jsx)(`span`,{className:`text-blue-400 text-xs font-bold whitespace-nowrap`,children:O.split(`/`).pop()}),(0,p.jsx)(r,{className:`h-4 w-4 text-blue-400 ${k?``:`-ml-1`}`}),(0,p.jsx)(`input`,{ref:M,type:`text`,className:`flex-1 bg-transparent border-none outline-none text-neutral-200 placeholder:text-neutral-700 h-6`,placeholder:S?`Running...`:`Type a command...`,value:C,onChange:e=>w(e.target.value),onKeyDown:e=>{if(e.key===`Enter`)P(C);else if(e.key===`ArrowUp`){e.preventDefault();let t=b+1;t<y.length&&(h({type:s.SetTerminalHistoryIndex,index:t}),w(y[t]))}else if(e.key===`ArrowDown`){e.preventDefault();let t=b-1;t>=0?(h({type:s.SetTerminalHistoryIndex,index:t}),w(y[t])):(h({type:s.SetTerminalHistoryIndex,index:-1}),w(``))}},disabled:S}),(0,p.jsxs)(`div`,{className:`flex items-center gap-1 px-1.5 py-0.5 rounded border border-white/10 bg-white/5`,children:[(0,p.jsx)(a,{className:`h-3 w-3 text-neutral-600`}),(0,p.jsx)(`span`,{className:`text-[10px] text-neutral-600 uppercase font-bold`,children:`Enter`})]})]})]})}export{m as TerminalPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,h as t,i as n,o as r}from"./index-D9aY24hf.js";var i=class extends t{async stopAndHideScanner(){console.log(window.OSBarcodeWebScanner),window.OSBarcodeWebScanner&&(await window.OSBarcodeWebScanner.stop(),window.OSBarcodeWebScanner=null),document.getElementById(`cap-os-barcode-scanner-container-dialog`).style.display=`none`}buildScannerElement(){if(document.getElementById(`cap-os-barcode-scanner-container`)){document.getElementById(`cap-os-barcode-scanner-container`).className=`scanner-container-display`;return}let e=document.body.appendChild(document.createElement(`div`));e.id=`cap-os-barcode-scanner-container`;let t=document.createElement(`div`);t.id=`cap-os-barcode-scanner-container-dialog`,t.className=`scanner-dialog`;let n=document.createElement(`div`);n.className=`scanner-dialog-inner`;let r=document.createElement(`span`);r.id=`cap-os-barcode-scanner-close-button`,r.className=`close-button`,r.innerHTML=`×`,n.appendChild(r);let i=document.createElement(`p`);i.innerHTML=` `,n.appendChild(i);let a=document.createElement(`div`);a.className=`scanner-container-full-width`,a.id=`cap-os-barcode-scanner-container-scanner`,n.appendChild(a),t.appendChild(n),e.appendChild(t)}async scanBarcode(t){return this.buildScannerElement(),document.getElementById(`cap-os-barcode-scanner-container-dialog`).style.display=`block`,new Promise((i,a)=>{let o={facingMode:t.cameraDirection===1?`environment`:`user`,hasScannerButton:!1,scanButton:t.scanButton===void 0?!1:t.scanButton,showScanLine:!1,scanInstructions:t.scanInstructions?t.scanInstructions:``,orientation:t.scanOrientation?t.scanOrientation:n.PORTRAIT,showCameraSelection:t.web?.showCameraSelection?t.web.showCameraSelection:!1,typeHint:t.hint===17?void 0:t.hint,scannerFPS:t.web?.scannerFPS?t.web.scannerFPS:50},s=!1,c=document.getElementById(`cap-os-barcode-scanner-close-button`);c&&(c.onclick=async()=>{s||(s=!0,await this.stopAndHideScanner(),a(Error(`Couldn’t scan because the process was cancelled.`)))});let l=document.getElementById(`cap-os-barcode-scanner-container-scanner`);if(!l)throw Error(`Scanner Element is required for web`);window.OSBarcodeWebScanner=new r(l.id,{formatsToSupport:o.typeHint===void 0?void 0:[o.typeHint],verbose:void 0});let u={fps:o.scannerFPS,qrbox:l.getBoundingClientRect().width*(9/16)-10,aspectRatio:16/9,videoConstraints:{focusMode:`continuous`,height:{min:576,ideal:1920},deviceId:void 0,facingMode:o.facingMode}};window.OSBarcodeWebScanner.start({facingMode:o.facingMode},u,(t,n)=>{this.stopAndHideScanner(),i({ScanResult:t,format:n.result.format?.format??e.ALL})},e=>{[`NotFoundException`,`No barcode or QR code detected`,`No MultiFormat Readers were able to detect the code`].find(t=>e.indexOf(t)!==-1)||(this.stopAndHideScanner(),console.error(`[Scanner Web Error] ${e}`),a(e))})})}};export{i as CapacitorBarcodeScannerWeb};
|