tarsk 0.5.40 → 0.5.41

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.
Files changed (46) hide show
  1. package/dist/index.js +224 -15
  2. package/dist/public/assets/{account-view-BT90zNSx.js → account-view-D-dJ0y-D.js} +1 -1
  3. package/dist/public/assets/{api-DWU0D34A.js → api-DJaJqkc6.js} +1 -1
  4. package/dist/public/assets/{browser-tab-Bp486a9f.js → browser-tab-D7wEj-BD.js} +1 -1
  5. package/dist/public/assets/{commit-dialog-90PGbqs8.js → commit-dialog-DdhGDH4F.js} +1 -1
  6. package/dist/public/assets/{context-menu-C7FTMa2c.js → context-menu-asf2g-KX.js} +1 -1
  7. package/dist/public/assets/{create-repo-dialog-BkUdww3q.js → create-repo-dialog-Bltp6PKZ.js} +1 -1
  8. package/dist/public/assets/{dialogs-config-DZKtVbNK.js → dialogs-config-B-LZ4nOb.js} +1 -1
  9. package/dist/public/assets/{diff-view-B4G8vqZa.js → diff-view-Bi545EPj.js} +1 -1
  10. package/dist/public/assets/{explorer-tab-view-DEQFid8r.js → explorer-tab-view-B-P555GE.js} +2 -2
  11. package/dist/public/assets/{explorer-tree-CPHGgahA.js → explorer-tree-CyXhVrI7.js} +1 -1
  12. package/dist/public/assets/{explorer-view-BTvhSMDQ.js → explorer-view-BAHDhIGN.js} +1 -1
  13. package/dist/public/assets/{git-history-dialog-Bqv0bD41.js → git-history-dialog-Bci_iQmi.js} +1 -1
  14. package/dist/public/assets/{git-ops-button-BnVMlOO3.js → git-ops-button-1lum9QXI.js} +2 -2
  15. package/dist/public/assets/{history-view-jX3PPID6.js → history-view-CAkN8PCo.js} +1 -1
  16. package/dist/public/assets/index-BLO68CQl.js +69 -0
  17. package/dist/public/assets/{mcp-server-card-CTCrhFIS.js → mcp-server-card-DQUpkDFV.js} +1 -1
  18. package/dist/public/assets/{merged-pr-dialog-B2qqrQ1g.js → merged-pr-dialog-tHPrJ2CK.js} +1 -1
  19. package/dist/public/assets/{onboarding-CxtzQldG.js → onboarding-Bbvb7kO4.js} +1 -1
  20. package/dist/public/assets/{project-settings-view-ZJjQbFbQ.js → project-settings-view-BRkHOq_q.js} +1 -1
  21. package/dist/public/assets/{providers-list-view-BH13AB_H.js → providers-list-view-Dex879vv.js} +1 -1
  22. package/dist/public/assets/{pull-request-dialog-ZzVXh6M9.js → pull-request-dialog-WHdmrW83.js} +1 -1
  23. package/dist/public/assets/{pull-with-changes-dialog-LUgd2a4S.js → pull-with-changes-dialog-Ck3OwINV.js} +1 -1
  24. package/dist/public/assets/{push-before-pr-dialog-CFmgu9H_.js → push-before-pr-dialog-Bvqvz04U.js} +1 -1
  25. package/dist/public/assets/{radio-group-Bd8YbtFD.js → radio-group-B0xvu5B9.js} +1 -1
  26. package/dist/public/assets/{react-vendor-Ba8DSNiO.js → react-vendor-D8PTA4EX.js} +1 -1
  27. package/dist/public/assets/{settings-general-view-C8muiP_K.js → settings-general-view-lUxshNA9.js} +1 -1
  28. package/dist/public/assets/{settings-instructions-view-CV7lRPuw.js → settings-instructions-view-C57XGLha.js} +1 -1
  29. package/dist/public/assets/{settings-list-CKPEGohm.js → settings-list-CHGKmGl_.js} +1 -1
  30. package/dist/public/assets/{settings-mcp-servers-view-3gN9ly3z.js → settings-mcp-servers-view-DpqkhrgB.js} +1 -1
  31. package/dist/public/assets/{settings-models-skeleton-l966LEN8.js → settings-models-skeleton-ClrbJy_p.js} +1 -1
  32. package/dist/public/assets/{settings-models-view-CAMouMhE.js → settings-models-view-QPEdnibD.js} +1 -1
  33. package/dist/public/assets/{settings-rules-view-BnazfbJb.js → settings-rules-view-WJU--cRq.js} +1 -1
  34. package/dist/public/assets/{settings-skills-view-DpzKFcpf.js → settings-skills-view-mgHy4G_g.js} +1 -1
  35. package/dist/public/assets/{settings-slash-commands-view-Drje2Dl4.js → settings-slash-commands-view-LB5tVqy1.js} +1 -1
  36. package/dist/public/assets/{settings-subagents-view-D05kHO1W.js → settings-subagents-view-QR2qlA_y.js} +1 -1
  37. package/dist/public/assets/{settings-system-prompt-view-DQmSdSnp.js → settings-system-prompt-view-Dl66VFaj.js} +1 -1
  38. package/dist/public/assets/{settings-view-B6e0GfSv.js → settings-view-BlVJv4Pz.js} +2 -2
  39. package/dist/public/assets/{skeleton-qzmFgKhS.js → skeleton-K-fVduHt.js} +1 -1
  40. package/dist/public/assets/{terminal-panel-BzCO142Q.js → terminal-panel-BGQxckfH.js} +1 -1
  41. package/dist/public/assets/{ui-components-f8jJJzEo.js → ui-components-C4RrfJEJ.js} +1 -1
  42. package/dist/public/assets/{utils-BlXPFbY9.js → utils-B7FQXlI6.js} +1 -1
  43. package/dist/public/index.html +6 -6
  44. package/dist/recommended-models.txt +1 -1
  45. package/package.json +1 -1
  46. package/dist/public/assets/index-DjD2SPNZ.js +0 -65
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{B as t,H as n,Ji as r,Tt as i,U as a,V as o,W as s,Xa as c,ci as l,di as u,fr as d,hr as f,ji as p,mr as m,pr as h,ui as g,vo as _,wi as v,wt as y,xo as b,yo as x,z as S}from"./dialogs-config-DZKtVbNK.js";import{n as C,s as w}from"./onboarding-CxtzQldG.js";import{C as T,D as E,E as D,S as O,T as k,a as A,l as j,n as M,o as N,x as P}from"./history-view-jX3PPID6.js";import{c as F,l as I,o as L,s as R}from"./index-DjD2SPNZ.js";import{a as z,o as B}from"./settings-list-CKPEGohm.js";import{t as V}from"./settings-models-skeleton-l966LEN8.js";var H=e(b(),1),U=x();function W(e){return`settings-models:coding:${e}`}function G(e){return`settings-models:image:${e}`}async function K(){let e=(await i()).filter(e=>e.apiKey),t={};e.forEach(e=>{t[e.slug]=`alphabetical`});let n={},r={};return await Promise.all(e.map(async e=>{try{let t=await s(e.slug);n[e.slug]=t.models,r[e.slug]=new Set(t.enabledModelIds)}catch(t){console.error(`Failed to load models for ${e.slug}:`,t),n[e.slug]=[],r[e.slug]=new Set}})),{providers:e,allModels:n,enabledModelIds:r,providerSortOptions:t}}async function q(e){let t=e.filter(e=>e.name.toLowerCase()===`openrouter`),n={},r={};return await Promise.all(t.map(async e=>{try{let t=await a(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 J=p();function ee({providers:e,globalSearchQuery:t,providerSortOptions:n,setProviderSortOptions:r,filterAndSortModels:i,getModelDisplayName:a,onSaveStatus:s}){let p=A(G(0),()=>q(e)),[b]=(0,H.useState)(p.allImageModels),[x,w]=(0,H.useState)(p.enabledImageModelIds);async function E(e,t){try{x[e]?.has(t)?(await S(e,t),w(n=>{let r=new Set(n[e]??[]);return r.delete(t),{...n,[e]:r}})):(await o(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 D(e,t){let n=b[e],r=x[e];if(n)for(let i of n)r?.has(i.id)!==t&&await E(e,i.id)}return(0,J.jsx)(`div`,{className:`space-y-6`,children:e.filter(e=>e.name.toLowerCase()===`openrouter`).map(e=>{let o=b[e.slug]||[],s=x[e.slug]||new Set,p=n[e.slug]||`alphabetical`,S=i(o,s,p);return S.length===0&&t?null:(0,J.jsxs)(`div`,{className:`space-y-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:(0,J.jsx)(`img`,{src:y(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,J.jsx)(T,{title:e.name,className:`mb-0`})]}),S.length>0&&(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(C,{id:`select-all-image-${e.slug}`,checked:S.every(e=>s.has(e.id)),onCheckedChange:t=>void D(e.slug,t===!0)}),(0,J.jsx)(`label`,{htmlFor:`select-all-image-${e.slug}`,className:g(v.body,`cursor-pointer whitespace-nowrap`),children:`Select all models`})]}),(0,J.jsx)(m,{children:(0,J.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(l,{type:`button`,variant:p===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>r(t=>({...t,[e.slug]:`alphabetical`})),children:(0,J.jsx)(_,{className:`h-4 w-4`})})}),(0,J.jsx)(h,{children:`Sort A–Z`})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(l,{type:`button`,variant:p===`price-low`||p===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>r(t=>({...t,[e.slug]:`price-low`})),children:(0,J.jsx)(c,{className:`h-4 w-4`})})}),(0,J.jsx)(h,{children:`Sort by price`})]})]})})]}),S.length===0?(0,J.jsx)(B,{message:t?`No models matching your search.`:`No image models available for this provider.`}):(0,J.jsx)(m,{children:(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:S.map(t=>{let n=s.has(t.id),r=t.pricing;return(0,J.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,J.jsx)(C,{id:`image-${t.id}`,checked:n,onCheckedChange:()=>void E(e.slug,t.id),className:`mt-0`}),(0,J.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,J.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,J.jsx)(`label`,{htmlFor:`image-${t.id}`,className:g(v.label,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:a(t)})}),r&&(0,J.jsx)(`span`,{className:g(v.compact,`text-muted-foreground whitespace-nowrap flex-shrink-0`),children:(r.prompt??0)===0&&(r.completion??0)===0?``:`$${u(r.prompt??0)} in | $${u(r.completion??0)} out`})]})]},t.id)})})})]},e.slug)})})}function Y({loadVersion:e}){let i=A(W(e),()=>K()),a=i.providers,[o]=(0,H.useState)(i.allModels),[s,p]=(0,H.useState)(i.enabledModelIds),[b,x]=(0,H.useState)(`coding`),[S,M]=(0,H.useState)(``),[N,V]=(0,H.useState)(i.providerSortOptions),[U,G]=(0,H.useState)(``),q=e=>w(e.id),Y=async(e,r)=>{try{s[e]?.has(r)?(await t(e,r),p(t=>{let n=new Set(t[e]??[]);return n.delete(r),{...t,[e]:n}})):(await n(e,r),p(t=>({...t,[e]:new Set([...t[e]||[],r])}))),G(`Model preferences saved successfully`),setTimeout(()=>G(``),3e3)}catch(e){G(e instanceof Error?e.message:`Failed to save model changes`)}},X=async(e,t)=>{let n=o[e],r=s[e];if(n)for(let i of n)r?.has(i.id)!==t&&await Y(e,i.id)},Z=e=>e?e<20?1:e<30?2:e<40?3:e<50?4:5:0,Q=({codingIndex:e,modelName:t})=>{let n=Z(e);return n===0?null:(0,J.jsx)(m,{children:(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(`div`,{className:`flex items-center gap-0.5`,children:[1,2,3,4,5].map(e=>(0,J.jsx)(r,{className:`h-3 w-3 ${e<=n?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},e))})}),(0,J.jsx)(h,{children:(0,J.jsxs)(`p`,{className:v.body,children:[t,` was indexed `,e,` for coding intelligence`]})})]})})},$=(e,t,n)=>{let r=S.toLowerCase();return e.filter(e=>{let t=q(e);return e.name.toLowerCase().includes(r)||e.id.toLowerCase().includes(r)||t.toLowerCase().includes(r)}).sort((e,r)=>{let i=+!t.has(e.id),a=+!t.has(r.id);if(i!==a)return i-a;if(n===`price-low`){let t=!!e.pricing;return t===!!r.pricing?!e.pricing||!r.pricing?0:((e.pricing.prompt??0)+(e.pricing.completion??0))/2-((r.pricing.prompt??0)+(r.pricing.completion??0))/2:t?-1:1}if(n===`price-high`){let t=!!e.pricing;if(t!==!!r.pricing)return t?-1:1;if(!e.pricing||!r.pricing)return 0;let n=((e.pricing.prompt??0)+(e.pricing.completion??0))/2;return((r.pricing.prompt??0)+(r.pricing.completion??0))/2-n}if(n===`coding-index`){let t=e.coding_index!==void 0&&e.coding_index!==null;return t===(r.coding_index!==void 0&&r.coding_index!==null)?e.coding_index==null||r.coding_index==null?0:r.coding_index-e.coding_index:t?-1:1}return q(e).localeCompare(q(r))})};return a.length===0?(0,J.jsx)(k,{title:`No providers configured`,children:`Configure a provider with an API key to view available models.`}):(0,J.jsx)(E,{children:(0,J.jsxs)(D,{children:[(0,J.jsx)(O,{title:`Models`,description:`View and manage available models from your configured providers.`}),(0,J.jsxs)(`div`,{className:`space-y-6`,children:[(0,J.jsx)(z,{placeholder:`Search models across all providers...`,value:S,onChange:M}),(0,J.jsxs)(L,{value:b,onValueChange:e=>{x(e),M(``)},children:[(0,J.jsxs)(F,{className:`mb-4`,children:[(0,J.jsx)(I,{value:`coding`,children:`Coding`}),a.some(e=>e.name.toLowerCase()===`openrouter`)&&(0,J.jsx)(I,{value:`image`,children:`Image`})]}),(0,J.jsx)(R,{value:`coding`,children:(0,J.jsx)(`div`,{className:`space-y-6`,children:a.map(e=>{let t=o[e.slug]||[],n=s[e.slug]||new Set,i=N[e.slug]||`alphabetical`,a=$(t,n,i);return a.length===0&&S?null:(0,J.jsxs)(`div`,{className:`space-y-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:(0,J.jsx)(`img`,{src:y(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,J.jsx)(T,{title:e.name,className:`mb-0`})]}),a.length>0&&(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(C,{id:`select-all-${e.slug}`,checked:a.every(e=>n.has(e.id)),onCheckedChange:t=>X(e.slug,t===!0)}),(0,J.jsx)(`label`,{htmlFor:`select-all-${e.slug}`,className:g(v.body,`cursor-pointer whitespace-nowrap`),children:`Select all models`})]}),(0,J.jsx)(m,{children:(0,J.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(l,{type:`button`,variant:i===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>V(t=>({...t,[e.slug]:`alphabetical`})),children:(0,J.jsx)(_,{className:`h-4 w-4`})})}),(0,J.jsx)(h,{children:`Sort A–Z`})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(l,{type:`button`,variant:i===`price-low`||i===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>V(t=>({...t,[e.slug]:`price-low`})),children:(0,J.jsx)(c,{className:`h-4 w-4`})})}),(0,J.jsx)(h,{children:`Sort by price`})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(l,{type:`button`,variant:i===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>V(t=>({...t,[e.slug]:`coding-index`})),children:(0,J.jsx)(r,{className:`h-4 w-4`})})}),(0,J.jsx)(h,{children:`Sort by coding intelligence`})]})]})})]}),a.length===0?(0,J.jsx)(B,{message:S?`No models matching your search.`:`No models available for this provider.`}):(0,J.jsx)(m,{children:(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:a.map(t=>{let r=n.has(t.id),a=t.pricing;return(0,J.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,J.jsx)(C,{id:t.id,checked:r,onCheckedChange:()=>Y(e.slug,t.id),className:`mt-0`}),(0,J.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,J.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,J.jsx)(`label`,{htmlFor:t.id,className:g(v.body,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:q(t)})}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[i===`coding-index`&&(0,J.jsx)(Q,{codingIndex:t.coding_index,modelName:q(t)}),a&&(0,J.jsx)(`span`,{className:g(v.compact,`text-muted-foreground whitespace-nowrap`),children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${u(a.prompt??0)} in | $${u(a.completion??0)} out`})]})]})]},t.id)})})})]},e.slug)})})}),(0,J.jsx)(R,{value:`image`,children:b===`image`?(0,J.jsx)(H.Suspense,{fallback:(0,J.jsx)(j,{className:`py-12`,size:`sm`}),children:(0,J.jsx)(ee,{providers:a,globalSearchQuery:S,providerSortOptions:N,setProviderSortOptions:V,filterAndSortModels:$,getModelDisplayName:q,onSaveStatus:e=>{G(e),e.includes(`Failed`)||setTimeout(()=>G(``),3e3)}})}):null})]}),U&&(0,J.jsx)(P,{variant:U.includes(`error`)||U.includes(`Failed`)?`error`:`success`,className:`mb-0`,children:U})]})]})})}function X(){let e=(0,U.c)(8),[t,n]=(0,H.useState)(0),r;e[0]===t?r=e[1]:(r=function(){N(W(t)),n(Q)},e[0]=t,e[1]=r);let i=r,a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(V,{}),e[2]=a):a=e[2];let o;e[3]===t?o=e[4]:(o=(0,J.jsx)(H.Suspense,{fallback:a,children:(0,J.jsx)(Y,{loadVersion:t},t)}),e[3]=t,e[4]=o);let s;return e[5]!==i||e[6]!==o?(s=(0,J.jsx)(M,{fallbackTitle:`Failed to load models`,onRetry:i,renderFallback:Z,children:o}),e[5]=i,e[6]=o,e[7]=s):s=e[7],s}function Z(e,t){return(0,J.jsx)(k,{title:`Failed to load models`,action:(0,J.jsx)(l,{variant:`outline`,onClick:t,children:`Retry`}),children:e.message})}function Q(e){return e+1}export{X as SettingsModelsView,X as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{B as t,H as n,Ji as r,Tt as i,U as a,V as o,W as s,Xa as c,ci as l,di as u,fr as d,hr as f,ji as p,mr as m,pr as h,ui as g,vo as _,wi as v,wt as y,xo as b,yo as x,z as S}from"./dialogs-config-B-LZ4nOb.js";import{n as C,s as w}from"./onboarding-Bbvb7kO4.js";import{C as T,D as E,E as D,S as O,T as k,a as A,l as j,n as M,o as N,x as P}from"./history-view-CAkN8PCo.js";import{c as F,l as I,o as L,s as R}from"./index-BLO68CQl.js";import{a as z,o as B}from"./settings-list-CHGKmGl_.js";import{t as V}from"./settings-models-skeleton-ClrbJy_p.js";var H=e(b(),1),U=x();function W(e){return`settings-models:coding:${e}`}function G(e){return`settings-models:image:${e}`}async function K(){let e=(await i()).filter(e=>e.apiKey),t={};e.forEach(e=>{t[e.slug]=`alphabetical`});let n={},r={};return await Promise.all(e.map(async e=>{try{let t=await s(e.slug);n[e.slug]=t.models,r[e.slug]=new Set(t.enabledModelIds)}catch(t){console.error(`Failed to load models for ${e.slug}:`,t),n[e.slug]=[],r[e.slug]=new Set}})),{providers:e,allModels:n,enabledModelIds:r,providerSortOptions:t}}async function q(e){let t=e.filter(e=>e.name.toLowerCase()===`openrouter`),n={},r={};return await Promise.all(t.map(async e=>{try{let t=await a(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 J=p();function ee({providers:e,globalSearchQuery:t,providerSortOptions:n,setProviderSortOptions:r,filterAndSortModels:i,getModelDisplayName:a,onSaveStatus:s}){let p=A(G(0),()=>q(e)),[b]=(0,H.useState)(p.allImageModels),[x,w]=(0,H.useState)(p.enabledImageModelIds);async function E(e,t){try{x[e]?.has(t)?(await S(e,t),w(n=>{let r=new Set(n[e]??[]);return r.delete(t),{...n,[e]:r}})):(await o(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 D(e,t){let n=b[e],r=x[e];if(n)for(let i of n)r?.has(i.id)!==t&&await E(e,i.id)}return(0,J.jsx)(`div`,{className:`space-y-6`,children:e.filter(e=>e.name.toLowerCase()===`openrouter`).map(e=>{let o=b[e.slug]||[],s=x[e.slug]||new Set,p=n[e.slug]||`alphabetical`,S=i(o,s,p);return S.length===0&&t?null:(0,J.jsxs)(`div`,{className:`space-y-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:(0,J.jsx)(`img`,{src:y(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,J.jsx)(T,{title:e.name,className:`mb-0`})]}),S.length>0&&(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(C,{id:`select-all-image-${e.slug}`,checked:S.every(e=>s.has(e.id)),onCheckedChange:t=>void D(e.slug,t===!0)}),(0,J.jsx)(`label`,{htmlFor:`select-all-image-${e.slug}`,className:g(v.body,`cursor-pointer whitespace-nowrap`),children:`Select all models`})]}),(0,J.jsx)(m,{children:(0,J.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(l,{type:`button`,variant:p===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>r(t=>({...t,[e.slug]:`alphabetical`})),children:(0,J.jsx)(_,{className:`h-4 w-4`})})}),(0,J.jsx)(h,{children:`Sort A–Z`})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(l,{type:`button`,variant:p===`price-low`||p===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>r(t=>({...t,[e.slug]:`price-low`})),children:(0,J.jsx)(c,{className:`h-4 w-4`})})}),(0,J.jsx)(h,{children:`Sort by price`})]})]})})]}),S.length===0?(0,J.jsx)(B,{message:t?`No models matching your search.`:`No image models available for this provider.`}):(0,J.jsx)(m,{children:(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:S.map(t=>{let n=s.has(t.id),r=t.pricing;return(0,J.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,J.jsx)(C,{id:`image-${t.id}`,checked:n,onCheckedChange:()=>void E(e.slug,t.id),className:`mt-0`}),(0,J.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,J.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,J.jsx)(`label`,{htmlFor:`image-${t.id}`,className:g(v.label,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:a(t)})}),r&&(0,J.jsx)(`span`,{className:g(v.compact,`text-muted-foreground whitespace-nowrap flex-shrink-0`),children:(r.prompt??0)===0&&(r.completion??0)===0?``:`$${u(r.prompt??0)} in | $${u(r.completion??0)} out`})]})]},t.id)})})})]},e.slug)})})}function Y({loadVersion:e}){let i=A(W(e),()=>K()),a=i.providers,[o]=(0,H.useState)(i.allModels),[s,p]=(0,H.useState)(i.enabledModelIds),[b,x]=(0,H.useState)(`coding`),[S,M]=(0,H.useState)(``),[N,V]=(0,H.useState)(i.providerSortOptions),[U,G]=(0,H.useState)(``),q=e=>w(e.id),Y=async(e,r)=>{try{s[e]?.has(r)?(await t(e,r),p(t=>{let n=new Set(t[e]??[]);return n.delete(r),{...t,[e]:n}})):(await n(e,r),p(t=>({...t,[e]:new Set([...t[e]||[],r])}))),G(`Model preferences saved successfully`),setTimeout(()=>G(``),3e3)}catch(e){G(e instanceof Error?e.message:`Failed to save model changes`)}},X=async(e,t)=>{let n=o[e],r=s[e];if(n)for(let i of n)r?.has(i.id)!==t&&await Y(e,i.id)},Z=e=>e?e<20?1:e<30?2:e<40?3:e<50?4:5:0,Q=({codingIndex:e,modelName:t})=>{let n=Z(e);return n===0?null:(0,J.jsx)(m,{children:(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(`div`,{className:`flex items-center gap-0.5`,children:[1,2,3,4,5].map(e=>(0,J.jsx)(r,{className:`h-3 w-3 ${e<=n?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},e))})}),(0,J.jsx)(h,{children:(0,J.jsxs)(`p`,{className:v.body,children:[t,` was indexed `,e,` for coding intelligence`]})})]})})},$=(e,t,n)=>{let r=S.toLowerCase();return e.filter(e=>{let t=q(e);return e.name.toLowerCase().includes(r)||e.id.toLowerCase().includes(r)||t.toLowerCase().includes(r)}).sort((e,r)=>{let i=+!t.has(e.id),a=+!t.has(r.id);if(i!==a)return i-a;if(n===`price-low`){let t=!!e.pricing;return t===!!r.pricing?!e.pricing||!r.pricing?0:((e.pricing.prompt??0)+(e.pricing.completion??0))/2-((r.pricing.prompt??0)+(r.pricing.completion??0))/2:t?-1:1}if(n===`price-high`){let t=!!e.pricing;if(t!==!!r.pricing)return t?-1:1;if(!e.pricing||!r.pricing)return 0;let n=((e.pricing.prompt??0)+(e.pricing.completion??0))/2;return((r.pricing.prompt??0)+(r.pricing.completion??0))/2-n}if(n===`coding-index`){let t=e.coding_index!==void 0&&e.coding_index!==null;return t===(r.coding_index!==void 0&&r.coding_index!==null)?e.coding_index==null||r.coding_index==null?0:r.coding_index-e.coding_index:t?-1:1}return q(e).localeCompare(q(r))})};return a.length===0?(0,J.jsx)(k,{title:`No providers configured`,children:`Configure a provider with an API key to view available models.`}):(0,J.jsx)(E,{children:(0,J.jsxs)(D,{children:[(0,J.jsx)(O,{title:`Models`,description:`View and manage available models from your configured providers.`}),(0,J.jsxs)(`div`,{className:`space-y-6`,children:[(0,J.jsx)(z,{placeholder:`Search models across all providers...`,value:S,onChange:M}),(0,J.jsxs)(L,{value:b,onValueChange:e=>{x(e),M(``)},children:[(0,J.jsxs)(F,{className:`mb-4`,children:[(0,J.jsx)(I,{value:`coding`,children:`Coding`}),a.some(e=>e.name.toLowerCase()===`openrouter`)&&(0,J.jsx)(I,{value:`image`,children:`Image`})]}),(0,J.jsx)(R,{value:`coding`,children:(0,J.jsx)(`div`,{className:`space-y-6`,children:a.map(e=>{let t=o[e.slug]||[],n=s[e.slug]||new Set,i=N[e.slug]||`alphabetical`,a=$(t,n,i);return a.length===0&&S?null:(0,J.jsxs)(`div`,{className:`space-y-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:(0,J.jsx)(`img`,{src:y(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,J.jsx)(T,{title:e.name,className:`mb-0`})]}),a.length>0&&(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(C,{id:`select-all-${e.slug}`,checked:a.every(e=>n.has(e.id)),onCheckedChange:t=>X(e.slug,t===!0)}),(0,J.jsx)(`label`,{htmlFor:`select-all-${e.slug}`,className:g(v.body,`cursor-pointer whitespace-nowrap`),children:`Select all models`})]}),(0,J.jsx)(m,{children:(0,J.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(l,{type:`button`,variant:i===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>V(t=>({...t,[e.slug]:`alphabetical`})),children:(0,J.jsx)(_,{className:`h-4 w-4`})})}),(0,J.jsx)(h,{children:`Sort A–Z`})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(l,{type:`button`,variant:i===`price-low`||i===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>V(t=>({...t,[e.slug]:`price-low`})),children:(0,J.jsx)(c,{className:`h-4 w-4`})})}),(0,J.jsx)(h,{children:`Sort by price`})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(f,{asChild:!0,children:(0,J.jsx)(l,{type:`button`,variant:i===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>V(t=>({...t,[e.slug]:`coding-index`})),children:(0,J.jsx)(r,{className:`h-4 w-4`})})}),(0,J.jsx)(h,{children:`Sort by coding intelligence`})]})]})})]}),a.length===0?(0,J.jsx)(B,{message:S?`No models matching your search.`:`No models available for this provider.`}):(0,J.jsx)(m,{children:(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:a.map(t=>{let r=n.has(t.id),a=t.pricing;return(0,J.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,J.jsx)(C,{id:t.id,checked:r,onCheckedChange:()=>Y(e.slug,t.id),className:`mt-0`}),(0,J.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,J.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,J.jsx)(`label`,{htmlFor:t.id,className:g(v.body,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`),children:q(t)})}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[i===`coding-index`&&(0,J.jsx)(Q,{codingIndex:t.coding_index,modelName:q(t)}),a&&(0,J.jsx)(`span`,{className:g(v.compact,`text-muted-foreground whitespace-nowrap`),children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${u(a.prompt??0)} in | $${u(a.completion??0)} out`})]})]})]},t.id)})})})]},e.slug)})})}),(0,J.jsx)(R,{value:`image`,children:b===`image`?(0,J.jsx)(H.Suspense,{fallback:(0,J.jsx)(j,{className:`py-12`,size:`sm`}),children:(0,J.jsx)(ee,{providers:a,globalSearchQuery:S,providerSortOptions:N,setProviderSortOptions:V,filterAndSortModels:$,getModelDisplayName:q,onSaveStatus:e=>{G(e),e.includes(`Failed`)||setTimeout(()=>G(``),3e3)}})}):null})]}),U&&(0,J.jsx)(P,{variant:U.includes(`error`)||U.includes(`Failed`)?`error`:`success`,className:`mb-0`,children:U})]})]})})}function X(){let e=(0,U.c)(8),[t,n]=(0,H.useState)(0),r;e[0]===t?r=e[1]:(r=function(){N(W(t)),n(Q)},e[0]=t,e[1]=r);let i=r,a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(V,{}),e[2]=a):a=e[2];let o;e[3]===t?o=e[4]:(o=(0,J.jsx)(H.Suspense,{fallback:a,children:(0,J.jsx)(Y,{loadVersion:t},t)}),e[3]=t,e[4]=o);let s;return e[5]!==i||e[6]!==o?(s=(0,J.jsx)(M,{fallbackTitle:`Failed to load models`,onRetry:i,renderFallback:Z,children:o}),e[5]=i,e[6]=o,e[7]=s):s=e[7],s}function Z(e,t){return(0,J.jsx)(k,{title:`Failed to load models`,action:(0,J.jsx)(l,{variant:`outline`,onClick:t,children:`Retry`}),children:e.message})}function Q(e){return e+1}export{X as SettingsModelsView,X as default};
@@ -1,4 +1,4 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Dr as t,Ea as n,Er as r,Gt as i,L as a,Or as o,P as s,Ui as c,Wa as l,ci as u,ia as d,ji as f,jt as p,ln as m,pt as h,so as g,ui as _,vt as ee,wi as v,xo as y,yo as b}from"./dialogs-config-DZKtVbNK.js";import{n as x,t as S}from"./react-vendor-Ba8DSNiO.js";import{A as te,C,D as w,E as ne,F as T,I as re,M as ie,N as ae,P as oe,S as E,T as D,b as O,j as k,k as A,x as j,y as M}from"./history-view-jX3PPID6.js";import{C as se,E as N,O as P,j as F}from"./index-DjD2SPNZ.js";import{t as I}from"./skeleton-qzmFgKhS.js";import{a as ce,i as le,n as L,r as R,t as z}from"./settings-list-CKPEGohm.js";import{t as B}from"./mcp-server-card-CTCrhFIS.js";var V=b(),H=e(y(),1),U=f(),W=H.forwardRef((e,t)=>{let n=(0,V.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=_(`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,U.jsx)(x,{className:_(`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,U.jsx)(S,{className:a,...i,ref:t,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});W.displayName=S.displayName;function ue({threadId:e,onRuleCreated:t}){let[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(``),[c,l]=(0,H.useState)(!1),[d,f]=(0,H.useState)(!1),p=i.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),h=p.length>0&&p.length<=64;return e?(0,U.jsx)(w,{children:(0,U.jsxs)(M,{children:[(0,U.jsx)(E,{title:`Add Rule`,description:`Create a new agent rule. The rule will be saved as a .md file in the .agents/rules folder.`}),(0,U.jsxs)(`div`,{className:`space-y-6`,children:[(0,U.jsxs)(O,{title:`Rule Name`,children:[(0,U.jsx)(r,{id:`ruleName`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g. Code Style Guide`,disabled:d}),i?(0,U.jsxs)(`p`,{className:_(v.caption,`mt-2`),children:[`File name: `,(0,U.jsxs)(`span`,{className:`font-mono`,children:[p||`...`,`.md`]})]}):null]}),(0,U.jsx)(O,{title:`Description`,children:(0,U.jsx)(P,{id:`ruleDescription`,value:o,onChange:e=>s(e.target.value),placeholder:`Describe when Tarsk should apply this rule...`,className:`resize-none min-h-[120px]`,disabled:d})}),(0,U.jsx)(O,{title:`Always Apply`,description:c?`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,U.jsx)(W,{id:`alwaysApply`,checked:c,onCheckedChange:l,disabled:d})}),(0,U.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,U.jsx)(u,{onClick:async()=>{if(!(!h||!e)){f(!0);try{let n=`---
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Dr as t,Ea as n,Er as r,Gt as i,L as a,Or as o,P as s,Ui as c,Wa as l,ci as u,ia as d,ji as f,jt as p,ln as m,pt as h,so as g,ui as _,vt as ee,wi as v,xo as y,yo as b}from"./dialogs-config-B-LZ4nOb.js";import{n as x,t as S}from"./react-vendor-D8PTA4EX.js";import{A as te,C,D as w,E as ne,F as T,I as re,M as ie,N as ae,P as oe,S as E,T as D,b as O,j as k,k as A,x as j,y as M}from"./history-view-CAkN8PCo.js";import{C as se,E as N,O as P,j as F}from"./index-BLO68CQl.js";import{t as I}from"./skeleton-K-fVduHt.js";import{a as ce,i as le,n as L,r as R,t as z}from"./settings-list-CHGKmGl_.js";import{t as B}from"./mcp-server-card-DQUpkDFV.js";var V=b(),H=e(y(),1),U=f(),W=H.forwardRef((e,t)=>{let n=(0,V.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=_(`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,U.jsx)(x,{className:_(`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,U.jsx)(S,{className:a,...i,ref:t,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});W.displayName=S.displayName;function ue({threadId:e,onRuleCreated:t}){let[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(``),[c,l]=(0,H.useState)(!1),[d,f]=(0,H.useState)(!1),p=i.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),h=p.length>0&&p.length<=64;return e?(0,U.jsx)(w,{children:(0,U.jsxs)(M,{children:[(0,U.jsx)(E,{title:`Add Rule`,description:`Create a new agent rule. The rule will be saved as a .md file in the .agents/rules folder.`}),(0,U.jsxs)(`div`,{className:`space-y-6`,children:[(0,U.jsxs)(O,{title:`Rule Name`,children:[(0,U.jsx)(r,{id:`ruleName`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g. Code Style Guide`,disabled:d}),i?(0,U.jsxs)(`p`,{className:_(v.caption,`mt-2`),children:[`File name: `,(0,U.jsxs)(`span`,{className:`font-mono`,children:[p||`...`,`.md`]})]}):null]}),(0,U.jsx)(O,{title:`Description`,children:(0,U.jsx)(P,{id:`ruleDescription`,value:o,onChange:e=>s(e.target.value),placeholder:`Describe when Tarsk should apply this rule...`,className:`resize-none min-h-[120px]`,disabled:d})}),(0,U.jsx)(O,{title:`Always Apply`,description:c?`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,U.jsx)(W,{id:`alwaysApply`,checked:c,onCheckedChange:l,disabled:d})}),(0,U.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,U.jsx)(u,{onClick:async()=>{if(!(!h||!e)){f(!0);try{let n=`---
2
2
  description: ${o.trim()}
3
3
  alwaysApply: ${c}
4
4
  ---
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Dr as t,Ea as n,Er as r,Gt as i,L as a,Li as o,Or as s,P as c,Ui as l,Wa as u,ci as d,ji as f,jt as p,k as m,ln as ee,mt as te,so as h,ui as g,vt as ne,wi as _,xo as v}from"./dialogs-config-DZKtVbNK.js";import{A as y,C as b,D as x,E as S,F as C,I as re,M as ie,N as ae,P as oe,S as w,T,b as E,j as se,k as ce,x as le,y as D}from"./history-view-jX3PPID6.js";import{C as O,E as k,O as A,j}from"./index-DjD2SPNZ.js";import{t as M}from"./skeleton-qzmFgKhS.js";import{a as N,i as P,n as F,r as I,t as L}from"./settings-list-CKPEGohm.js";import{t as R}from"./mcp-server-card-CTCrhFIS.js";var z=e(v(),1),B=f();function V({threadId:e,onSkillCreated:t}){let[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(``),[c,l]=(0,z.useState)(!1),u=i.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),f=u.length>0&&u.length<=64;return e?(0,B.jsx)(x,{children:(0,B.jsxs)(D,{children:[(0,B.jsx)(w,{title:`Add Skill`,description:`Create a new agent skill. The skill will be saved as a SKILL.md file in the .agents/skills folder.`}),(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(E,{title:`Skill Name`,children:[(0,B.jsx)(r,{id:`skillName`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g. Code Review`,disabled:c}),i?(0,B.jsxs)(`p`,{className:g(_.caption,`mt-2`),children:[`Folder name: `,(0,B.jsx)(`span`,{className:`font-mono`,children:u||`...`})]}):null]}),(0,B.jsx)(E,{title:`Description`,children:(0,B.jsx)(A,{id:`skillDescription`,value:o,onChange:e=>s(e.target.value),placeholder:`Describe when Tarsk should apply this skill`,className:`resize-none min-h-[120px]`,disabled:c})}),(0,B.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,B.jsx)(d,{onClick:async()=>{if(!(!f||!o.trim()||!e)){l(!0);try{let n=await m(e,u,o.trim());k({title:`Skill created`,description:`Skill '${u}' was created successfully.`}),a(``),s(``),t?.(n.path,`SKILL.md`)}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{l(!1)}}},disabled:!f||!o.trim()||c,children:c?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(n,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,B.jsxs)(B.Fragment,{children:[`Continue`,(0,B.jsx)(h,{className:`ml-2 h-4 w-4`})]})})})]})]})}):(0,B.jsx)(T,{title:`No thread selected`,children:`Please select a thread to add a skill.`})}function H(e){let t=[];for(let n of e){if(n.path===`.agents/skills`&&n.type===`folder`&&n.children)for(let e of n.children)e.type===`folder`&&t.push(e);n.children&&n.children.length>0&&t.push(...H(n.children))}return t}function U(){let e=j(e=>e.selectedProjectId),n=j(e=>e.selectedThreadId),{setActiveMainTab:r,setPendingExplorerPath:f,triggerExplorerRefresh:m,setExplorerClearPath:h}=O(),[g,_]=(0,z.useState)([]),[v,E]=(0,z.useState)(!1),[D,A]=(0,z.useState)(!1),[U,W]=(0,z.useState)(null),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)([]),[Y,X]=(0,z.useState)(new Set),[Z,ue]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(e){E(!0);try{let t=H(await ne(e));if(n)try{let e=H(await p(n)),r=new Set(t.map(e=>e.path));for(let n of e)r.has(n.path)||t.push(n)}catch{}_(t),X(new Set(t.map(e=>`${e.path}/SKILL.md`)))}catch{_([]),X(new Set)}finally{E(!1)}}},[e,n]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{te().then(J).catch(()=>J([]))},[]);let de=(0,z.useCallback)(async t=>{if(!e)return;let r=t.name,i=t.path;K(!0);try{try{await c(e,i)}catch{if(n)await a(n,i);else throw Error(`No thread selected to delete from`)}h(i),m(),X(e=>{let t=new Set(e);return t.delete(`${i}/SKILL.md`),t}),k({title:`Skill removed`,description:r}),W(null),await Q()}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to remove skill`,variant:`destructive`})}finally{K(!1)}},[e,n,Q,m,h]),fe=(0,z.useCallback)(e=>{f(`${e}/SKILL.md`),r(`explorer`)},[f,r]),pe=(0,z.useCallback)(async e=>{let t=`.agents/skills/${e.id}/SKILL.md`;if(!(!n||Y.has(t)))try{if(e.gitHubRepo&&e.gitHubFolder)await i(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 ee(n,t,r.join(`
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Dr as t,Ea as n,Er as r,Gt as i,L as a,Li as o,Or as s,P as c,Ui as l,Wa as u,ci as d,ji as f,jt as p,k as m,ln as ee,mt as te,so as h,ui as g,vt as ne,wi as _,xo as v}from"./dialogs-config-B-LZ4nOb.js";import{A as y,C as b,D as x,E as S,F as C,I as re,M as ie,N as ae,P as oe,S as w,T,b as E,j as se,k as ce,x as le,y as D}from"./history-view-CAkN8PCo.js";import{C as O,E as k,O as A,j}from"./index-BLO68CQl.js";import{t as M}from"./skeleton-K-fVduHt.js";import{a as N,i as P,n as F,r as I,t as L}from"./settings-list-CHGKmGl_.js";import{t as R}from"./mcp-server-card-DQUpkDFV.js";var z=e(v(),1),B=f();function V({threadId:e,onSkillCreated:t}){let[i,a]=(0,z.useState)(``),[o,s]=(0,z.useState)(``),[c,l]=(0,z.useState)(!1),u=i.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),f=u.length>0&&u.length<=64;return e?(0,B.jsx)(x,{children:(0,B.jsxs)(D,{children:[(0,B.jsx)(w,{title:`Add Skill`,description:`Create a new agent skill. The skill will be saved as a SKILL.md file in the .agents/skills folder.`}),(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(E,{title:`Skill Name`,children:[(0,B.jsx)(r,{id:`skillName`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g. Code Review`,disabled:c}),i?(0,B.jsxs)(`p`,{className:g(_.caption,`mt-2`),children:[`Folder name: `,(0,B.jsx)(`span`,{className:`font-mono`,children:u||`...`})]}):null]}),(0,B.jsx)(E,{title:`Description`,children:(0,B.jsx)(A,{id:`skillDescription`,value:o,onChange:e=>s(e.target.value),placeholder:`Describe when Tarsk should apply this skill`,className:`resize-none min-h-[120px]`,disabled:c})}),(0,B.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,B.jsx)(d,{onClick:async()=>{if(!(!f||!o.trim()||!e)){l(!0);try{let n=await m(e,u,o.trim());k({title:`Skill created`,description:`Skill '${u}' was created successfully.`}),a(``),s(``),t?.(n.path,`SKILL.md`)}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{l(!1)}}},disabled:!f||!o.trim()||c,children:c?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(n,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,B.jsxs)(B.Fragment,{children:[`Continue`,(0,B.jsx)(h,{className:`ml-2 h-4 w-4`})]})})})]})]})}):(0,B.jsx)(T,{title:`No thread selected`,children:`Please select a thread to add a skill.`})}function H(e){let t=[];for(let n of e){if(n.path===`.agents/skills`&&n.type===`folder`&&n.children)for(let e of n.children)e.type===`folder`&&t.push(e);n.children&&n.children.length>0&&t.push(...H(n.children))}return t}function U(){let e=j(e=>e.selectedProjectId),n=j(e=>e.selectedThreadId),{setActiveMainTab:r,setPendingExplorerPath:f,triggerExplorerRefresh:m,setExplorerClearPath:h}=O(),[g,_]=(0,z.useState)([]),[v,E]=(0,z.useState)(!1),[D,A]=(0,z.useState)(!1),[U,W]=(0,z.useState)(null),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)([]),[Y,X]=(0,z.useState)(new Set),[Z,ue]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(e){E(!0);try{let t=H(await ne(e));if(n)try{let e=H(await p(n)),r=new Set(t.map(e=>e.path));for(let n of e)r.has(n.path)||t.push(n)}catch{}_(t),X(new Set(t.map(e=>`${e.path}/SKILL.md`)))}catch{_([]),X(new Set)}finally{E(!1)}}},[e,n]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{te().then(J).catch(()=>J([]))},[]);let de=(0,z.useCallback)(async t=>{if(!e)return;let r=t.name,i=t.path;K(!0);try{try{await c(e,i)}catch{if(n)await a(n,i);else throw Error(`No thread selected to delete from`)}h(i),m(),X(e=>{let t=new Set(e);return t.delete(`${i}/SKILL.md`),t}),k({title:`Skill removed`,description:r}),W(null),await Q()}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to remove skill`,variant:`destructive`})}finally{K(!1)}},[e,n,Q,m,h]),fe=(0,z.useCallback)(e=>{f(`${e}/SKILL.md`),r(`explorer`)},[f,r]),pe=(0,z.useCallback)(async e=>{let t=`.agents/skills/${e.id}/SKILL.md`;if(!(!n||Y.has(t)))try{if(e.gitHubRepo&&e.gitHubFolder)await i(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 ee(n,t,r.join(`
2
2
  `))}X(e=>new Set(e).add(t)),m(),Q(),k({title:`Skill installed`,description:e.name})}catch(e){k({title:`Error`,description:e instanceof Error?e.message:`Failed to install skill`,variant:`destructive`})}},[n,Y,m,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(x,{children:(0,B.jsxs)(S,{children:[(0,B.jsx)(w,{title:`Skills`,description:`Manage agent skills. Skills are reusable instruction sets that guide agent behavior.`,action:(0,B.jsx)(d,{onClick:()=>A(!0),disabled:!n,children:`Add Skill`})}),!n&&(0,B.jsx)(le,{children:`Select a thread to add or install skills.`}),(0,B.jsx)(b,{title:`Installed`}),v?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(M,{className:`h-20 w-full`}),(0,B.jsx)(M,{className:`h-20 w-full`})]}):g.length===0?(0,B.jsx)(L,{icon:o,title:`No skills installed`,description:`Add skills to extend agent capabilities with reusable instructions.`}):(0,B.jsx)(`div`,{className:`space-y-3 mb-8`,children:g.map(e=>(0,B.jsx)(F,{title:e.name,subtitle:e.path,subtitleMono:!0,actions:[{label:`View in explorer`,icon:(0,B.jsx)(u,{className:`h-4 w-4`}),onClick:()=>fe(e.path)},{label:`Delete skill`,icon:(0,B.jsx)(l,{className:`h-4 w-4`}),onClick:()=>W(e),destructive:!0}]},e.id))}),(0,B.jsx)(b,{title:`Available`,className:`mb-0`}),(0,B.jsx)(N,{placeholder:`Search available skills...`,value:Z,onChange:ue}),q.length===0?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(M,{className:`h-20 w-full`}),(0,B.jsx)(M,{className:`h-20 w-full`})]}):$.length===0?(0,B.jsx)(P,{searchQuery:Z,emptyLabel:`No available skills found.`}):(0,B.jsx)(I,{children:$.map(e=>{let t=`.agents/skills/${e.id}/SKILL.md`,n=Y.has(t);return(0,B.jsx)(R,{name:e.name,description:e.description,installed:n,onClick:()=>{n||pe(e)},showInstalledControls:!1},e.id)})})]})}),(0,B.jsx)(t,{open:D,onOpenChange:A,children:(0,B.jsx)(s,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,B.jsx)(V,{threadId:n,onSkillCreated:()=>{A(!1),Q(),m()}})})}),(0,B.jsx)(ce,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,B.jsxs)(ie,{children:[(0,B.jsxs)(C,{children:[(0,B.jsx)(re,{children:`Delete Skill`}),(0,B.jsxs)(ae,{children:[`Are you sure you want to delete the skill "`,U?.name,`"? This action cannot be undone.`]})]}),(0,B.jsxs)(oe,{children:[(0,B.jsx)(se,{children:`Cancel`}),(0,B.jsx)(y,{onClick:()=>U&&void de(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,B.jsx)(T,{children:`Select a project to manage skills.`})}export{U as SettingsSkillsView,U as default};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Dr as t,Dt as n,E as r,Ea as i,Er as a,F as o,Gi as s,Gt as c,Or as l,Ui as u,Wa as d,ci as f,ht as p,ji as m,so as h,ui as g,wi as _,wr as v,xo as y}from"./dialogs-config-DZKtVbNK.js";import{A as b,C as x,D as S,E as C,F as ee,I as te,M as ne,N as w,P as T,S as E,T as D,b as O,j as re,k,x as A,y as j}from"./history-view-jX3PPID6.js";import{C as M,E as N,j as P}from"./index-DjD2SPNZ.js";import{t as F}from"./skeleton-qzmFgKhS.js";import{n as I,t as L}from"./radio-group-Bd8YbtFD.js";import{a as ie,i as ae,n as oe,r as se,t as R}from"./settings-list-CKPEGohm.js";import{t as ce}from"./mcp-server-card-CTCrhFIS.js";var z=e(y(),1),B=m();function V({projectId:e,threadId:t,onCommandCreated:n}){let[o,s]=(0,z.useState)(``),[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(``),[p,m]=(0,z.useState)(`default`),[y,b]=(0,z.useState)(!1),x=o.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),C=x.length>0&&x.length<=64;return e?(0,B.jsx)(S,{children:(0,B.jsxs)(j,{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)(a,{id:`commandName`,value:o,onChange:e=>s(e.target.value),placeholder:`e.g. review`,disabled:y}),o?(0,B.jsxs)(`p`,{className:g(_.caption,`mt-2`),children:[`Command: `,(0,B.jsxs)(`span`,{className:`font-mono`,children:[`/`,x||`...`]})]}):null]}),(0,B.jsx)(O,{title:`Description`,children:(0,B.jsx)(a,{id:`commandDescription`,value:c,onChange:e=>l(e.target.value),placeholder:`Brief description shown in autocomplete`,disabled:y})}),(0,B.jsx)(O,{title:`Argument Hint`,description:`Shows after the command name to guide users what to type`,children:(0,B.jsx)(a,{id:`argumentHint`,value:u,onChange:e=>d(e.target.value),placeholder:`e.g. <focus-area> or <branch-name>`,disabled:y})}),(0,B.jsx)(O,{title:`Mode`,description:p==="default"?`Standard chat mode`:`Activates plan mode when this command is used`,children:(0,B.jsxs)(L,{value:p,onValueChange:e=>m(e),className:`flex gap-4`,disabled:y,children:[(0,B.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,B.jsx)(I,{value:`default`,id:`mode-default`}),(0,B.jsx)(v,{htmlFor:`mode-default`,className:g(_.labelNormal,`cursor-pointer`),children:`Default`})]}),(0,B.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,B.jsx)(I,{value:`plan`,id:`mode-plan`}),(0,B.jsx)(v,{htmlFor:`mode-plan`,className:g(_.labelNormal,`cursor-pointer`),children:`Plan`})]})]})}),(0,B.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,B.jsx)(f,{onClick:async()=>{if(!(!C||!e)){b(!0);try{await r(x,``,{description:c.trim()||void 0,argumentHint:u.trim()||void 0,mode:p===`plan`?`plan`:void 0},`project`,t??void 0),N({title:`Command created`,description:`Command '/${x}' was created successfully.`}),s(``),l(``),d(``),m(`default`),n?.(x)}catch(e){N({title:`Error`,description:e instanceof Error?e.message:`Failed to create command`,variant:`destructive`})}finally{b(!1)}}},disabled:!C||y,children:y?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(i,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,B.jsxs)(B.Fragment,{children:[`Continue`,(0,B.jsx)(h,{className:`ml-2 h-4 w-4`})]})})})]})]})}):(0,B.jsx)(D,{title:`No project selected`,children:`Please select a project to add a slash command.`})}function H(){let e=P(e=>e.selectedProjectId),i=P(e=>e.selectedThreadId),{setActiveMainTab:a,setPendingExplorerPath:m,triggerExplorerRefresh:h,setExplorerClearPath:v}=M(),[y,O]=(0,z.useState)([]),[j,I]=(0,z.useState)(!1),[L,H]=(0,z.useState)(!1),[U,W]=(0,z.useState)(null),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)([]),[Y,X]=(0,z.useState)(new Map),[Z,le]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(i){I(!0);try{let e=await n(i);O(e.filter(e=>!e.isBuiltIn)),X(new Map(e.map(e=>[e.name,e.filePath])))}catch{O([]),X(new Map)}finally{I(!1)}}},[i]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{p().then(J).catch(()=>J([]))},[]);let ue=(0,z.useCallback)(async e=>{K(!0);try{await o(e.filePath),v(e.filePath),h(),X(t=>{let n=new Map(t);return n.delete(e.name),n}),N({title:`Command removed`,description:`/${e.name}`}),W(null),await Q()}catch(e){N({title:`Error`,description:e instanceof Error?e.message:`Failed to remove command`,variant:`destructive`})}finally{K(!1)}},[Q,h,v]),de=(0,z.useCallback)(e=>{m(e),a(`explorer`)},[m,a]),fe=(0,z.useCallback)(async e=>{if(!(!i||Y.has(e.name)))try{if(e.gitHubRepo&&e.gitHubFolder){let t=`.agents/commands`;await c(i,e.gitHubRepo,e.gitHubFolder,t);let n=`${t}/${e.name}.md`;X(t=>new Map(t).set(e.name,n))}else{let t=await r(e.name,e.content,{description:e.description,argumentHint:e.argumentHint},`project`,i);X(n=>new Map(n).set(e.name,t.filePath))}h(),Q(),N({title:`Command installed`,description:`/${e.name}`})}catch(e){N({title:`Error`,description:e instanceof Error?e.message:`Failed to install command`,variant:`destructive`})}},[i,Y,h,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{children:(0,B.jsxs)(C,{children:[(0,B.jsx)(E,{title:`Slash Commands`,description:`Manage slash commands. Commands are quick actions available via / in chat.`,action:(0,B.jsx)(f,{onClick:()=>H(!0),disabled:!i,children:`Add Command`})}),!i&&(0,B.jsx)(A,{children:`Select a thread to add or install slash commands.`}),(0,B.jsx)(x,{title:`Installed`}),j?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(F,{className:`h-20 w-full`}),(0,B.jsx)(F,{className:`h-20 w-full`})]}):y.length===0?(0,B.jsx)(R,{icon:s,title:`No slash commands installed`,description:`Add slash commands to create quick actions in chat.`}):(0,B.jsx)(`div`,{className:`space-y-3 mb-8`,children:y.map(e=>(0,B.jsx)(oe,{title:`/${e.name}`,subtitle:e.metadata?.description||`No description`,badge:e.metadata?.mode?(0,B.jsx)(`span`,{className:g(_.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)(d,{className:`h-4 w-4`}),onClick:()=>de(e.filePath)},{label:`Delete command`,icon:(0,B.jsx)(u,{className:`h-4 w-4`}),onClick:()=>W(e),destructive:!0}]},e.filePath))}),(0,B.jsx)(x,{title:`Available`,className:`mb-0`}),(0,B.jsx)(ie,{placeholder:`Search available commands...`,value:Z,onChange:le}),q.length===0?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(F,{className:`h-20 w-full`}),(0,B.jsx)(F,{className:`h-20 w-full`})]}):$.length===0?(0,B.jsx)(ae,{searchQuery:Z,emptyLabel:`No available commands found.`}):(0,B.jsx)(se,{children:$.map(e=>{let t=Y.has(e.name);return(0,B.jsx)(ce,{name:`/${e.name}`,description:e.description,installed:t,onClick:()=>{t||fe(e)},showInstalledControls:!1},e.id)})})]})}),(0,B.jsx)(t,{open:L,onOpenChange:H,children:(0,B.jsx)(l,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,B.jsx)(V,{projectId:e,threadId:i,onCommandCreated:()=>{H(!1),Q(),h()}})})}),(0,B.jsx)(k,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,B.jsxs)(ne,{children:[(0,B.jsxs)(ee,{children:[(0,B.jsx)(te,{children:`Delete Slash Command`}),(0,B.jsxs)(w,{children:[`Are you sure you want to delete "/`,U?.name,`"? This action cannot be undone.`]})]}),(0,B.jsxs)(T,{children:[(0,B.jsx)(re,{children:`Cancel`}),(0,B.jsx)(b,{onClick:()=>U&&void ue(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,B.jsx)(D,{children:`Select a project to manage slash commands.`})}export{H as SettingsSlashCommandsView,H as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Dr as t,Dt as n,E as r,Ea as i,Er as a,F as o,Gi as s,Gt as c,Or as l,Ui as u,Wa as d,ci as f,ht as p,ji as m,so as h,ui as g,wi as _,wr as v,xo as y}from"./dialogs-config-B-LZ4nOb.js";import{A as b,C as x,D as S,E as C,F as ee,I as te,M as ne,N as w,P as T,S as E,T as D,b as O,j as re,k,x as A,y as j}from"./history-view-CAkN8PCo.js";import{C as M,E as N,j as P}from"./index-BLO68CQl.js";import{t as F}from"./skeleton-K-fVduHt.js";import{n as I,t as L}from"./radio-group-B0xvu5B9.js";import{a as ie,i as ae,n as oe,r as se,t as R}from"./settings-list-CHGKmGl_.js";import{t as ce}from"./mcp-server-card-DQUpkDFV.js";var z=e(y(),1),B=m();function V({projectId:e,threadId:t,onCommandCreated:n}){let[o,s]=(0,z.useState)(``),[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(``),[p,m]=(0,z.useState)(`default`),[y,b]=(0,z.useState)(!1),x=o.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),C=x.length>0&&x.length<=64;return e?(0,B.jsx)(S,{children:(0,B.jsxs)(j,{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)(a,{id:`commandName`,value:o,onChange:e=>s(e.target.value),placeholder:`e.g. review`,disabled:y}),o?(0,B.jsxs)(`p`,{className:g(_.caption,`mt-2`),children:[`Command: `,(0,B.jsxs)(`span`,{className:`font-mono`,children:[`/`,x||`...`]})]}):null]}),(0,B.jsx)(O,{title:`Description`,children:(0,B.jsx)(a,{id:`commandDescription`,value:c,onChange:e=>l(e.target.value),placeholder:`Brief description shown in autocomplete`,disabled:y})}),(0,B.jsx)(O,{title:`Argument Hint`,description:`Shows after the command name to guide users what to type`,children:(0,B.jsx)(a,{id:`argumentHint`,value:u,onChange:e=>d(e.target.value),placeholder:`e.g. <focus-area> or <branch-name>`,disabled:y})}),(0,B.jsx)(O,{title:`Mode`,description:p==="default"?`Standard chat mode`:`Activates plan mode when this command is used`,children:(0,B.jsxs)(L,{value:p,onValueChange:e=>m(e),className:`flex gap-4`,disabled:y,children:[(0,B.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,B.jsx)(I,{value:`default`,id:`mode-default`}),(0,B.jsx)(v,{htmlFor:`mode-default`,className:g(_.labelNormal,`cursor-pointer`),children:`Default`})]}),(0,B.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,B.jsx)(I,{value:`plan`,id:`mode-plan`}),(0,B.jsx)(v,{htmlFor:`mode-plan`,className:g(_.labelNormal,`cursor-pointer`),children:`Plan`})]})]})}),(0,B.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,B.jsx)(f,{onClick:async()=>{if(!(!C||!e)){b(!0);try{await r(x,``,{description:c.trim()||void 0,argumentHint:u.trim()||void 0,mode:p===`plan`?`plan`:void 0},`project`,t??void 0),N({title:`Command created`,description:`Command '/${x}' was created successfully.`}),s(``),l(``),d(``),m(`default`),n?.(x)}catch(e){N({title:`Error`,description:e instanceof Error?e.message:`Failed to create command`,variant:`destructive`})}finally{b(!1)}}},disabled:!C||y,children:y?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(i,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,B.jsxs)(B.Fragment,{children:[`Continue`,(0,B.jsx)(h,{className:`ml-2 h-4 w-4`})]})})})]})]})}):(0,B.jsx)(D,{title:`No project selected`,children:`Please select a project to add a slash command.`})}function H(){let e=P(e=>e.selectedProjectId),i=P(e=>e.selectedThreadId),{setActiveMainTab:a,setPendingExplorerPath:m,triggerExplorerRefresh:h,setExplorerClearPath:v}=M(),[y,O]=(0,z.useState)([]),[j,I]=(0,z.useState)(!1),[L,H]=(0,z.useState)(!1),[U,W]=(0,z.useState)(null),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)([]),[Y,X]=(0,z.useState)(new Map),[Z,le]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(i){I(!0);try{let e=await n(i);O(e.filter(e=>!e.isBuiltIn)),X(new Map(e.map(e=>[e.name,e.filePath])))}catch{O([]),X(new Map)}finally{I(!1)}}},[i]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{p().then(J).catch(()=>J([]))},[]);let ue=(0,z.useCallback)(async e=>{K(!0);try{await o(e.filePath),v(e.filePath),h(),X(t=>{let n=new Map(t);return n.delete(e.name),n}),N({title:`Command removed`,description:`/${e.name}`}),W(null),await Q()}catch(e){N({title:`Error`,description:e instanceof Error?e.message:`Failed to remove command`,variant:`destructive`})}finally{K(!1)}},[Q,h,v]),de=(0,z.useCallback)(e=>{m(e),a(`explorer`)},[m,a]),fe=(0,z.useCallback)(async e=>{if(!(!i||Y.has(e.name)))try{if(e.gitHubRepo&&e.gitHubFolder){let t=`.agents/commands`;await c(i,e.gitHubRepo,e.gitHubFolder,t);let n=`${t}/${e.name}.md`;X(t=>new Map(t).set(e.name,n))}else{let t=await r(e.name,e.content,{description:e.description,argumentHint:e.argumentHint},`project`,i);X(n=>new Map(n).set(e.name,t.filePath))}h(),Q(),N({title:`Command installed`,description:`/${e.name}`})}catch(e){N({title:`Error`,description:e instanceof Error?e.message:`Failed to install command`,variant:`destructive`})}},[i,Y,h,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{children:(0,B.jsxs)(C,{children:[(0,B.jsx)(E,{title:`Slash Commands`,description:`Manage slash commands. Commands are quick actions available via / in chat.`,action:(0,B.jsx)(f,{onClick:()=>H(!0),disabled:!i,children:`Add Command`})}),!i&&(0,B.jsx)(A,{children:`Select a thread to add or install slash commands.`}),(0,B.jsx)(x,{title:`Installed`}),j?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(F,{className:`h-20 w-full`}),(0,B.jsx)(F,{className:`h-20 w-full`})]}):y.length===0?(0,B.jsx)(R,{icon:s,title:`No slash commands installed`,description:`Add slash commands to create quick actions in chat.`}):(0,B.jsx)(`div`,{className:`space-y-3 mb-8`,children:y.map(e=>(0,B.jsx)(oe,{title:`/${e.name}`,subtitle:e.metadata?.description||`No description`,badge:e.metadata?.mode?(0,B.jsx)(`span`,{className:g(_.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)(d,{className:`h-4 w-4`}),onClick:()=>de(e.filePath)},{label:`Delete command`,icon:(0,B.jsx)(u,{className:`h-4 w-4`}),onClick:()=>W(e),destructive:!0}]},e.filePath))}),(0,B.jsx)(x,{title:`Available`,className:`mb-0`}),(0,B.jsx)(ie,{placeholder:`Search available commands...`,value:Z,onChange:le}),q.length===0?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(F,{className:`h-20 w-full`}),(0,B.jsx)(F,{className:`h-20 w-full`})]}):$.length===0?(0,B.jsx)(ae,{searchQuery:Z,emptyLabel:`No available commands found.`}):(0,B.jsx)(se,{children:$.map(e=>{let t=Y.has(e.name);return(0,B.jsx)(ce,{name:`/${e.name}`,description:e.description,installed:t,onClick:()=>{t||fe(e)},showInstalledControls:!1},e.id)})})]})}),(0,B.jsx)(t,{open:L,onOpenChange:H,children:(0,B.jsx)(l,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,B.jsx)(V,{projectId:e,threadId:i,onCommandCreated:()=>{H(!1),Q(),h()}})})}),(0,B.jsx)(k,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,B.jsxs)(ne,{children:[(0,B.jsxs)(ee,{children:[(0,B.jsx)(te,{children:`Delete Slash Command`}),(0,B.jsxs)(w,{children:[`Are you sure you want to delete "/`,U?.name,`"? This action cannot be undone.`]})]}),(0,B.jsxs)(T,{children:[(0,B.jsx)(re,{children:`Cancel`}),(0,B.jsx)(b,{onClick:()=>U&&void ue(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,B.jsx)(D,{children:`Select a project to manage slash commands.`})}export{H as SettingsSlashCommandsView,H as default};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Dr as t,Ea as n,Er as r,Gt as i,L as a,O as o,Or as s,P as c,Ri as l,Ui as u,Wa as d,ci as f,dt as p,ji as m,jt as h,ln as ee,so as g,ui as _,vt as v,wi as y,xo as b}from"./dialogs-config-DZKtVbNK.js";import{A as te,C as x,D as S,E as C,F as w,I as ne,M as re,N as ie,P as ae,S as T,T as E,b as D,j as O,k as oe,x as k,y as A}from"./history-view-jX3PPID6.js";import{C as se,E as j,O as M,j as N}from"./index-DjD2SPNZ.js";import{t as P}from"./skeleton-qzmFgKhS.js";import{a as ce,i as le,n as F,r as I,t as L}from"./settings-list-CKPEGohm.js";import{t as R}from"./mcp-server-card-CTCrhFIS.js";var z=e(b(),1),B=m();function V({threadId:e,onAgentCreated:t}){let[i,a]=(0,z.useState)(``),[s,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(``),[d,p]=(0,z.useState)(!1),m=i.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),h=m.length>0&&m.length<=64;return e?(0,B.jsx)(S,{children:(0,B.jsxs)(A,{children:[(0,B.jsx)(T,{title:`Add Agent`,description:`Create a new subagent. The agent will be saved as an AGENT.md file in the .agents/agents folder.`}),(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(D,{title:`Agent Name`,children:[(0,B.jsx)(r,{id:`agentName`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g. Security Reviewer`,disabled:d}),i?(0,B.jsxs)(`p`,{className:_(y.caption,`mt-2`),children:[`Folder name: `,(0,B.jsx)(`span`,{className:`font-mono`,children:m||`...`})]}):null]}),(0,B.jsx)(D,{title:`Description`,children:(0,B.jsx)(M,{id:`agentDescription`,value:s,onChange:e=>c(e.target.value),placeholder:`Describe what this agent does and when it should be invoked`,className:`resize-none min-h-[120px]`,disabled:d})}),(0,B.jsx)(D,{title:`Allowed Tools`,description:`Space-separated list of tools this agent can use. Leave empty to allow all coding tools.`,children:(0,B.jsx)(r,{id:`agentTools`,value:l,onChange:e=>u(e.target.value),placeholder:`e.g. read grep glob`,disabled:d})}),(0,B.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,B.jsx)(f,{onClick:async()=>{if(!(!h||!s.trim()||!e)){p(!0);try{let n=await o(e,m,s.trim(),l.trim()||void 0);j({title:`Agent created`,description:`Agent '${m}' was created successfully.`}),a(``),c(``),u(``),t?.(n.path,`AGENT.md`)}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to create agent`,variant:`destructive`})}finally{p(!1)}}},disabled:!h||!s.trim()||d,children:d?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(n,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,B.jsxs)(B.Fragment,{children:[`Continue`,(0,B.jsx)(g,{className:`ml-2 h-4 w-4`})]})})})]})]})}):(0,B.jsx)(E,{title:`No thread selected`,children:`Please select a thread to add an agent.`})}function H(e){let t=[];for(let n of e)n.path.startsWith(`.agents/agents/`)&&n.type===`folder`&&t.push(n),n.children&&n.children.length>0&&t.push(...H(n.children));return t}function U(){let e=N(e=>e.selectedProjectId),n=N(e=>e.selectedThreadId),{setActiveMainTab:r,setPendingExplorerPath:o,triggerExplorerRefresh:m,setExplorerClearPath:g}=se(),[_,y]=(0,z.useState)([]),[b,D]=(0,z.useState)(!1),[A,M]=(0,z.useState)(!1),[U,W]=(0,z.useState)(null),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)([]),[Y,X]=(0,z.useState)(new Set),[Z,ue]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(e){D(!0);try{let t=H(await v(e));if(n)try{let e=H(await h(n)),r=new Set(t.map(e=>e.path));for(let n of e)r.has(n.path)||t.push(n)}catch{}y(t),X(new Set(t.map(e=>`${e.path}/AGENT.md`)))}catch{y([]),X(new Set)}finally{D(!1)}}},[e,n]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{p().then(J).catch(()=>J([]))},[]);let de=(0,z.useCallback)(async t=>{if(!e)return;let r=t.name,i=t.path;K(!0);try{try{await c(e,i)}catch{if(n)await a(n,i);else throw Error(`No thread selected to delete from`)}g(i),m(),X(e=>{let t=new Set(e);return t.delete(`${i}/AGENT.md`),t}),j({title:`Agent removed`,description:r}),W(null),await Q()}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to remove agent`,variant:`destructive`})}finally{K(!1)}},[e,n,Q,m,g]),fe=(0,z.useCallback)(e=>{o(`${e}/AGENT.md`),r(`explorer`)},[o,r]),pe=(0,z.useCallback)(async e=>{let t=`.agents/agents/${e.id}/AGENT.md`;if(!(!n||Y.has(t)))try{if(e.gitHubRepo&&e.gitHubFolder)await i(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(`
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Dr as t,Ea as n,Er as r,Gt as i,L as a,O as o,Or as s,P as c,Ri as l,Ui as u,Wa as d,ci as f,dt as p,ji as m,jt as h,ln as ee,so as g,ui as _,vt as v,wi as y,xo as b}from"./dialogs-config-B-LZ4nOb.js";import{A as te,C as x,D as S,E as C,F as w,I as ne,M as re,N as ie,P as ae,S as T,T as E,b as D,j as O,k as oe,x as k,y as A}from"./history-view-CAkN8PCo.js";import{C as se,E as j,O as M,j as N}from"./index-BLO68CQl.js";import{t as P}from"./skeleton-K-fVduHt.js";import{a as ce,i as le,n as F,r as I,t as L}from"./settings-list-CHGKmGl_.js";import{t as R}from"./mcp-server-card-DQUpkDFV.js";var z=e(b(),1),B=m();function V({threadId:e,onAgentCreated:t}){let[i,a]=(0,z.useState)(``),[s,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(``),[d,p]=(0,z.useState)(!1),m=i.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),h=m.length>0&&m.length<=64;return e?(0,B.jsx)(S,{children:(0,B.jsxs)(A,{children:[(0,B.jsx)(T,{title:`Add Agent`,description:`Create a new subagent. The agent will be saved as an AGENT.md file in the .agents/agents folder.`}),(0,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(D,{title:`Agent Name`,children:[(0,B.jsx)(r,{id:`agentName`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g. Security Reviewer`,disabled:d}),i?(0,B.jsxs)(`p`,{className:_(y.caption,`mt-2`),children:[`Folder name: `,(0,B.jsx)(`span`,{className:`font-mono`,children:m||`...`})]}):null]}),(0,B.jsx)(D,{title:`Description`,children:(0,B.jsx)(M,{id:`agentDescription`,value:s,onChange:e=>c(e.target.value),placeholder:`Describe what this agent does and when it should be invoked`,className:`resize-none min-h-[120px]`,disabled:d})}),(0,B.jsx)(D,{title:`Allowed Tools`,description:`Space-separated list of tools this agent can use. Leave empty to allow all coding tools.`,children:(0,B.jsx)(r,{id:`agentTools`,value:l,onChange:e=>u(e.target.value),placeholder:`e.g. read grep glob`,disabled:d})}),(0,B.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,B.jsx)(f,{onClick:async()=>{if(!(!h||!s.trim()||!e)){p(!0);try{let n=await o(e,m,s.trim(),l.trim()||void 0);j({title:`Agent created`,description:`Agent '${m}' was created successfully.`}),a(``),c(``),u(``),t?.(n.path,`AGENT.md`)}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to create agent`,variant:`destructive`})}finally{p(!1)}}},disabled:!h||!s.trim()||d,children:d?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(n,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,B.jsxs)(B.Fragment,{children:[`Continue`,(0,B.jsx)(g,{className:`ml-2 h-4 w-4`})]})})})]})]})}):(0,B.jsx)(E,{title:`No thread selected`,children:`Please select a thread to add an agent.`})}function H(e){let t=[];for(let n of e)n.path.startsWith(`.agents/agents/`)&&n.type===`folder`&&t.push(n),n.children&&n.children.length>0&&t.push(...H(n.children));return t}function U(){let e=N(e=>e.selectedProjectId),n=N(e=>e.selectedThreadId),{setActiveMainTab:r,setPendingExplorerPath:o,triggerExplorerRefresh:m,setExplorerClearPath:g}=se(),[_,y]=(0,z.useState)([]),[b,D]=(0,z.useState)(!1),[A,M]=(0,z.useState)(!1),[U,W]=(0,z.useState)(null),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)([]),[Y,X]=(0,z.useState)(new Set),[Z,ue]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(e){D(!0);try{let t=H(await v(e));if(n)try{let e=H(await h(n)),r=new Set(t.map(e=>e.path));for(let n of e)r.has(n.path)||t.push(n)}catch{}y(t),X(new Set(t.map(e=>`${e.path}/AGENT.md`)))}catch{y([]),X(new Set)}finally{D(!1)}}},[e,n]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{p().then(J).catch(()=>J([]))},[]);let de=(0,z.useCallback)(async t=>{if(!e)return;let r=t.name,i=t.path;K(!0);try{try{await c(e,i)}catch{if(n)await a(n,i);else throw Error(`No thread selected to delete from`)}g(i),m(),X(e=>{let t=new Set(e);return t.delete(`${i}/AGENT.md`),t}),j({title:`Agent removed`,description:r}),W(null),await Q()}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to remove agent`,variant:`destructive`})}finally{K(!1)}},[e,n,Q,m,g]),fe=(0,z.useCallback)(e=>{o(`${e}/AGENT.md`),r(`explorer`)},[o,r]),pe=(0,z.useCallback)(async e=>{let t=`.agents/agents/${e.id}/AGENT.md`;if(!(!n||Y.has(t)))try{if(e.gitHubRepo&&e.gitHubFolder)await i(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
2
  `))}X(e=>new Set(e).add(t)),m(),Q(),j({title:`Agent installed`,description:e.name})}catch(e){j({title:`Error`,description:e instanceof Error?e.message:`Failed to install agent`,variant:`destructive`})}},[n,Y,m,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return e?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{children:(0,B.jsxs)(C,{children:[(0,B.jsx)(T,{title:`Subagents`,description:`Manage subagents. Subagents are specialized agents for focused tasks.`,action:(0,B.jsx)(f,{onClick:()=>M(!0),disabled:!n,children:`Add Subagent`})}),!n&&(0,B.jsx)(k,{children:`Select a thread to add or install subagents.`}),(0,B.jsx)(x,{title:`Installed`}),b?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(P,{className:`h-20 w-full`}),(0,B.jsx)(P,{className:`h-20 w-full`})]}):_.length===0?(0,B.jsx)(L,{icon:l,title:`No subagents installed`,description:`Add subagents for specialized, focused tasks.`}):(0,B.jsx)(`div`,{className:`space-y-3 mb-8`,children:_.map(e=>(0,B.jsx)(F,{title:e.name,subtitle:e.path,subtitleMono:!0,actions:[{label:`View in explorer`,icon:(0,B.jsx)(d,{className:`h-4 w-4`}),onClick:()=>fe(e.path)},{label:`Delete agent`,icon:(0,B.jsx)(u,{className:`h-4 w-4`}),onClick:()=>W(e),destructive:!0}]},e.id))}),(0,B.jsx)(x,{title:`Available`,className:`mb-0`}),(0,B.jsx)(ce,{placeholder:`Search available subagents...`,value:Z,onChange:ue}),q.length===0?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(P,{className:`h-20 w-full`}),(0,B.jsx)(P,{className:`h-20 w-full`})]}):$.length===0?(0,B.jsx)(le,{searchQuery:Z,emptyLabel:`No available subagents found.`}):(0,B.jsx)(I,{children:$.map(e=>{let t=`.agents/agents/${e.id}/AGENT.md`,n=Y.has(t);return(0,B.jsx)(R,{name:e.name,description:e.description,installed:n,onClick:()=>{n||pe(e)},showInstalledControls:!1},e.id)})})]})}),(0,B.jsx)(t,{open:A,onOpenChange:M,children:(0,B.jsx)(s,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,B.jsx)(V,{threadId:n,onAgentCreated:()=>{M(!1),Q(),m()}})})}),(0,B.jsx)(oe,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,B.jsxs)(re,{children:[(0,B.jsxs)(w,{children:[(0,B.jsx)(ne,{children:`Delete Subagent`}),(0,B.jsxs)(ie,{children:[`Are you sure you want to delete the subagent "`,U?.name,`"? This action cannot be undone.`]})]}),(0,B.jsxs)(ae,{children:[(0,B.jsx)(O,{children:`Cancel`}),(0,B.jsx)(te,{onClick:()=>U&&void de(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,B.jsx)(E,{children:`Select a project to manage subagents.`})}export{U as SettingsSubagentsView,U as default};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ea as t,Kt as n,ci as r,ji as i,ui as a,wi as o,wn as s,wr as c,xo as l,xt as u}from"./dialogs-config-DZKtVbNK.js";import{n as d}from"./onboarding-CxtzQldG.js";import{A as f,E as p,F as m,I as h,M as g,N as _,P as v,S as y,T as b,j as x,k as S,w as C}from"./history-view-jX3PPID6.js";import{E as w,O as T,j as E}from"./index-DjD2SPNZ.js";var D=e(l(),1),O=i();function k(){let e=E(e=>e.selectedProjectId),[i,l]=(0,D.useState)(``),[k,A]=(0,D.useState)(``),[j,M]=(0,D.useState)(!0),[N,P]=(0,D.useState)(!1),[F,I]=(0,D.useState)(``),[L,R]=(0,D.useState)(!1),[z,B]=(0,D.useState)(!1),[V,H]=(0,D.useState)(!1);(0,D.useEffect)(()=>{e&&(R(!0),u(e).then(e=>{let t=e.useCustomSystemPrompt;l(e.generatedPrompt),P(t),I(e.customSystemPrompt),M(!t),A(t?e.customSystemPrompt:e.generatedPrompt)}).catch(()=>{l(``),A(``),M(!0),P(!1),I(``)}).finally(()=>R(!1)))},[e]);function U(){return j?N:k.trim()!==F.trim()}function W(e){A(e),j&&M(!1)}function G(){A(i),M(!0)}function K(e){if(!e){M(!1);return}if(k===i){G();return}H(!0)}function q(){G(),H(!1)}function J(){H(!1)}async function Y(){if(e){if(!j&&!k.trim()){w({title:`System prompt required`,description:`Enter a system prompt or enable Generated.`,variant:`destructive`});return}B(!0);try{await s(e,{customSystemPrompt:j?null:k.trim(),useCustomSystemPrompt:!j}),n(),P(!j),I(j?``:k.trim()),w({title:`System prompt settings saved`})}catch(e){w({title:`Error`,description:e instanceof Error?e.message:`Failed to save system prompt settings`,variant:`destructive`})}finally{B(!1)}}}return e?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(C,{children:(0,O.jsxs)(p,{className:`w-full flex-1 flex flex-col min-h-0`,children:[(0,O.jsx)(y,{title:`System Prompt`,description:`View the default system prompt or override it for this project. Instructions, rules, and other context are added separately at runtime.`,action:(0,O.jsx)(r,{onClick:Y,disabled:L||z||!U(),children:z?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(t,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`})}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,O.jsx)(d,{id:`use-generated-prompt`,checked:j,onCheckedChange:e=>K(e===!0),disabled:L||z}),(0,O.jsx)(c,{htmlFor:`use-generated-prompt`,className:a(o.labelNormal,`cursor-pointer`),children:`Generated`})]}),L?(0,O.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,O.jsx)(t,{className:`h-8 w-8 animate-spin text-muted-foreground`})}):(0,O.jsx)(T,{value:k,onChange:e=>W(e.target.value),className:a(o.mono,`flex-1 min-h-0 resize-none`),placeholder:`System prompt will appear here...`,disabled:z})]})}),(0,O.jsx)(S,{open:V,onOpenChange:H,children:(0,O.jsxs)(g,{children:[(0,O.jsxs)(m,{children:[(0,O.jsx)(h,{children:`Overwrite custom system prompt?`}),(0,O.jsx)(_,{children:`This will replace your custom system prompt with the generated default. You can save the change after confirming.`})]}),(0,O.jsxs)(v,{children:[(0,O.jsx)(x,{onClick:J,children:`No`}),(0,O.jsx)(f,{onClick:q,children:`Yes`})]})]})})]}):(0,O.jsx)(b,{children:`Select a project to edit the system prompt.`})}export{k as SettingsSystemPromptView,k as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ea as t,Kt as n,ci as r,ji as i,ui as a,wi as o,wn as s,wr as c,xo as l,xt as u}from"./dialogs-config-B-LZ4nOb.js";import{n as d}from"./onboarding-Bbvb7kO4.js";import{A as f,E as p,F as m,I as h,M as g,N as _,P as v,S as y,T as b,j as x,k as S,w as C}from"./history-view-CAkN8PCo.js";import{E as w,O as T,j as E}from"./index-BLO68CQl.js";var D=e(l(),1),O=i();function k(){let e=E(e=>e.selectedProjectId),[i,l]=(0,D.useState)(``),[k,A]=(0,D.useState)(``),[j,M]=(0,D.useState)(!0),[N,P]=(0,D.useState)(!1),[F,I]=(0,D.useState)(``),[L,R]=(0,D.useState)(!1),[z,B]=(0,D.useState)(!1),[V,H]=(0,D.useState)(!1);(0,D.useEffect)(()=>{e&&(R(!0),u(e).then(e=>{let t=e.useCustomSystemPrompt;l(e.generatedPrompt),P(t),I(e.customSystemPrompt),M(!t),A(t?e.customSystemPrompt:e.generatedPrompt)}).catch(()=>{l(``),A(``),M(!0),P(!1),I(``)}).finally(()=>R(!1)))},[e]);function U(){return j?N:k.trim()!==F.trim()}function W(e){A(e),j&&M(!1)}function G(){A(i),M(!0)}function K(e){if(!e){M(!1);return}if(k===i){G();return}H(!0)}function q(){G(),H(!1)}function J(){H(!1)}async function Y(){if(e){if(!j&&!k.trim()){w({title:`System prompt required`,description:`Enter a system prompt or enable Generated.`,variant:`destructive`});return}B(!0);try{await s(e,{customSystemPrompt:j?null:k.trim(),useCustomSystemPrompt:!j}),n(),P(!j),I(j?``:k.trim()),w({title:`System prompt settings saved`})}catch(e){w({title:`Error`,description:e instanceof Error?e.message:`Failed to save system prompt settings`,variant:`destructive`})}finally{B(!1)}}}return e?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(C,{children:(0,O.jsxs)(p,{className:`w-full flex-1 flex flex-col min-h-0`,children:[(0,O.jsx)(y,{title:`System Prompt`,description:`View the default system prompt or override it for this project. Instructions, rules, and other context are added separately at runtime.`,action:(0,O.jsx)(r,{onClick:Y,disabled:L||z||!U(),children:z?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(t,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`})}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,O.jsx)(d,{id:`use-generated-prompt`,checked:j,onCheckedChange:e=>K(e===!0),disabled:L||z}),(0,O.jsx)(c,{htmlFor:`use-generated-prompt`,className:a(o.labelNormal,`cursor-pointer`),children:`Generated`})]}),L?(0,O.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,O.jsx)(t,{className:`h-8 w-8 animate-spin text-muted-foreground`})}):(0,O.jsx)(T,{value:k,onChange:e=>W(e.target.value),className:a(o.mono,`flex-1 min-h-0 resize-none`),placeholder:`System prompt will appear here...`,disabled:z})]})}),(0,O.jsx)(S,{open:V,onOpenChange:H,children:(0,O.jsxs)(g,{children:[(0,O.jsxs)(m,{children:[(0,O.jsx)(h,{children:`Overwrite custom system prompt?`}),(0,O.jsx)(_,{children:`This will replace your custom system prompt with the generated default. You can save the change after confirming.`})]}),(0,O.jsxs)(v,{children:[(0,O.jsx)(x,{onClick:J,children:`No`}),(0,O.jsx)(f,{onClick:q,children:`Yes`})]})]})})]}):(0,O.jsx)(b,{children:`Select a project to edit the system prompt.`})}export{k as SettingsSystemPromptView,k as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-general-view-C8muiP_K.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-DjD2SPNZ.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-jX3PPID6.js","assets/dialogs-config-DZKtVbNK.js","assets/onboarding-CxtzQldG.js","assets/whisper-wasm-EGutPGND.js","assets/react-vendor-Ba8DSNiO.js","assets/utils-BlXPFbY9.js","assets/index-jIBJk8xl.css","assets/project-settings-view-ZJjQbFbQ.js","assets/radio-group-Bd8YbtFD.js","assets/providers-list-view-BH13AB_H.js","assets/skeleton-qzmFgKhS.js","assets/settings-models-view-CAMouMhE.js","assets/settings-models-skeleton-l966LEN8.js","assets/settings-list-CKPEGohm.js","assets/settings-mcp-servers-view-3gN9ly3z.js","assets/mcp-server-card-CTCrhFIS.js","assets/settings-skills-view-DpzKFcpf.js","assets/settings-rules-view-BnazfbJb.js","assets/settings-slash-commands-view-Drje2Dl4.js","assets/settings-subagents-view-D05kHO1W.js","assets/settings-instructions-view-CV7lRPuw.js","assets/settings-system-prompt-view-DQmSdSnp.js","assets/account-view-BT90zNSx.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$i as t,Ba as n,Ci as r,Gi as i,Kt as a,Li as o,Qa as s,Ri as c,St as l,Xi as u,ci as d,do as f,en as p,ha as m,ia as h,ja as g,ji as _,po as v,ta as y,ui as b,wi as ee,xo as x,yo as te,zi as S}from"./dialogs-config-DZKtVbNK.js";import{ct as ne,lt as re,st as ie}from"./react-vendor-Ba8DSNiO.js";import{r as C}from"./monaco-CZnIWXyV.js";import{c as w,o as T}from"./onboarding-CxtzQldG.js";import{D as E,E as D,T as O}from"./history-view-jX3PPID6.js";import{A as k,T as A,i as ae,j,k as M,n as N,p as P,r as F}from"./index-DjD2SPNZ.js";import{t as I}from"./settings-models-skeleton-l966LEN8.js";var L=te(),R=e(x(),1),z=_(),oe=(0,R.forwardRef)(function(e,t){let n=(0,L.c)(28),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:u,className:d,onCollapse:f,onExpand:p,isMobile:m,mobileShowSidebar:h}=e,g=a===void 0?25:a,_=o===void 0?20:o,v=s===void 0?30:s,y=c===void 0?40:c,ee=l===void 0?!1:l,x=u===void 0?0:u,te=d===void 0?``:d,S=m===void 0?!1:m,ne=h===void 0?!0:h,re=S&&!ne,ie=S&&ne,C=`h-full ${te}`,w=S?100:g,T=S?50:_,E=S?100:v,D=re&&`hidden`,O;n[0]===D?O=n[1]:(O=b(`border-r border-transparent`,D),n[0]=D,n[1]=O);let k;n[2]!==x||n[3]!==ee||n[4]!==f||n[5]!==p||n[6]!==t||n[7]!==r||n[8]!==w||n[9]!==T||n[10]!==E||n[11]!==O?(k=(0,z.jsx)(F,{ref:t,defaultSize:w,minSize:T,maxSize:E,collapsible:ee,collapsedSize:x,onCollapse:f,onExpand:p,className:O,children:r}),n[2]=x,n[3]=ee,n[4]=f,n[5]=p,n[6]=t,n[7]=r,n[8]=w,n[9]=T,n[10]=E,n[11]=O,n[12]=k):k=n[12];let A;n[13]===S?A=n[14]:(A=!S&&(0,z.jsx)(N,{withHandle:!0,className:`ml-[-40px]`}),n[13]=S,n[14]=A);let j=ie&&`hidden`,M;n[15]===j?M=n[16]:(M=b(`overflow-hidden`,j),n[15]=j,n[16]=M);let P;n[17]!==i||n[18]!==y||n[19]!==M?(P=(0,z.jsx)(F,{minSize:y,className:M,children:i}),n[17]=i,n[18]=y,n[19]=M,n[20]=P):P=n[20];let I;n[21]!==k||n[22]!==A||n[23]!==P?(I=(0,z.jsxs)(ae,{direction:`horizontal`,className:`h-full`,children:[k,A,P]}),n[21]=k,n[22]=A,n[23]=P,n[24]=I):I=n[24];let R;return n[25]!==C||n[26]!==I?(R=(0,z.jsx)(`div`,{className:C,children:I}),n[25]=C,n[26]=I,n[27]=R):R=n[27],R}),se=[{id:`providers`,label:`Providers`,icon:(0,z.jsx)(s,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,z.jsx)(f,{className:`h-4 w-4`}),route:`/settings/models`},{id:`skills`,label:`Skills`,icon:(0,z.jsx)(o,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,z.jsx)(h,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,z.jsx)(i,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,z.jsx)(c,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,z.jsx)(v,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`system-prompt`,label:`System Prompt`,icon:(0,z.jsx)(u,{className:`h-4 w-4`}),route:`/settings/system-prompt`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,z.jsx)(y,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`general`,label:`General`,icon:(0,z.jsx)(t,{className:`h-4 w-4`}),route:`/settings/general`},{id:`history`,label:`History`,icon:(0,z.jsx)(g,{className:`h-4 w-4`}),route:`/settings/history`},{id:`account`,label:`Account`,icon:(0,z.jsx)(S,{className:`h-4 w-4`}),route:`/settings/account`}];function B(e){let t=[...se];if(!e)return t;let r=t.findIndex(e=>e.id===`skills`);return t.splice(r,0,{id:`project`,label:`Project`,icon:(0,z.jsx)(n,{className:`h-4 w-4`}),route:`/settings/project/${e}`}),t}function ce(e){let t=(0,L.c)(13),{className:n,selectedProjectId:r,onResetOnboarding:i,onNavItemSelect:a}=e,o=ne(),s=ie(),c=(0,R.useRef)(0),l=(0,R.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,R.useEffect)(u,d);let f,p;if(t[2]!==n||t[3]!==s.pathname||t[4]!==o||t[5]!==a||t[6]!==i||t[7]!==r){let e=B(r),u=function(){let t=s.pathname;if(t.startsWith(`/settings/project/`))return`project`;for(let n of e)if(t.startsWith(n.route))return n.id;return`general`}(),d=function(e){e.id===`general`&&i&&(l.current&&clearTimeout(l.current),c.current+=1,c.current>=3?(c.current=0,i()):l.current=setTimeout(()=>{c.current=0},1500)),a?.(),o(e.route)};f=`space-y-1${n?` ${n}`:``}`,p=e.map((t,n)=>(0,z.jsxs)(R.Fragment,{children:[(0,z.jsx)(w,{selected:u===t.id,asChild:!0,children:(0,z.jsx)(`button`,{className:`justify-start`,onClick:()=>d(t),children:(0,z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[t.icon,(0,z.jsx)(`span`,{children:t.label})]})})}),(t.id===`models`||t.id===`mcp-servers`||n===e.length-1)&&(0,z.jsx)(T,{className:`my-2 bg-sidebar-border`})]},t.id)),t[2]=n,t[3]=s.pathname,t[4]=o,t[5]=a,t[6]=i,t[7]=r,t[8]=f,t[9]=p}else f=t[8],p=t[9];let m;return t[10]!==f||t[11]!==p?(m=(0,z.jsx)(`div`,{className:f,children:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12],m}var le=(0,R.lazy)(()=>C(()=>import(`./settings-general-view-C8muiP_K.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),ue=(0,R.lazy)(()=>C(()=>import(`./project-settings-view-ZJjQbFbQ.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11,13]))),de=(0,R.lazy)(()=>C(()=>import(`./providers-list-view-BH13AB_H.js`),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,15]))),fe=(0,R.lazy)(()=>C(()=>import(`./settings-models-view-CAMouMhE.js`),__vite__mapDeps([16,1,2,3,4,5,6,7,8,9,10,11,17,15,18]))),pe=(0,R.lazy)(()=>C(()=>import(`./settings-mcp-servers-view-3gN9ly3z.js`),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),me=(0,R.lazy)(()=>C(()=>import(`./settings-skills-view-DpzKFcpf.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),he=(0,R.lazy)(()=>C(()=>import(`./settings-rules-view-BnazfbJb.js`),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),ge=(0,R.lazy)(()=>C(()=>import(`./settings-slash-commands-view-Drje2Dl4.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,10,11,20,13,18,15]))),_e=(0,R.lazy)(()=>C(()=>import(`./settings-subagents-view-D05kHO1W.js`),__vite__mapDeps([24,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),ve=(0,R.lazy)(()=>C(()=>import(`./settings-instructions-view-CV7lRPuw.js`),__vite__mapDeps([25,1,2,3,4,5,6,7,8,9,10,11]))),ye=(0,R.lazy)(()=>C(()=>import(`./settings-system-prompt-view-DQmSdSnp.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11]))),be=(0,R.lazy)(()=>C(()=>import(`./account-view-BT90zNSx.js`),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,15]))),xe=(0,R.lazy)(()=>C(()=>import(`./history-view-jX3PPID6.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 V(e){let t=(0,L.c)(2),{title:n}=e,r;return t[0]===n?r=t[1]:(r=(0,z.jsx)(O,{title:n,children:`Content coming soon...`}),t[0]=n,t[1]=r),r}function Ce(){let e=(0,L.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsxs)(`div`,{className:`mb-6`,children:[(0,z.jsx)(`div`,{className:`h-8 w-32 bg-muted rounded animate-pulse mb-2`}),(0,z.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,z.jsx)(`div`,{className:`mb-6`,children:(0,z.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,z.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,z.jsxs)(`div`,{children:[r,(0,z.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,z.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,z.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`})]})]}),a=(0,z.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,z.jsx)(E,{children:(0,z.jsxs)(D,{children:[t,n,(0,z.jsxs)(`div`,{className:`space-y-8`,children:[i,(0,z.jsxs)(`div`,{children:[a,(0,z.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,z.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,z.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,z.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,z.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 Ee(){let e=(0,L.c)(61),{tab:t,projectId:n}=re(),i=ne(),o=ie(),s=k(),c=j(ke),u=j(Oe),f;e[0]!==o.pathname||e[1]!==n?(f=!!n&&o.pathname.startsWith(`/settings/project/`),e[0]=o.pathname,e[1]=n,e[2]=f):f=e[2];let h=f,g;e[3]===o.pathname?g=e[4]:(g=Te(o.pathname),e[3]=o.pathname,e[4]=g);let _=g!==null,v;if(e[5]!==o.pathname||e[6]!==o.search||e[7]!==t){let n=new URLSearchParams(o.search).get(`tab`);v=n&&Se.includes(n)?n:t&&Se.includes(t)?t:we(o.pathname),e[5]=o.pathname,e[6]=o.search,e[7]=t,e[8]=v}else v=e[8];let y=v,x=P(),[te,S]=(0,R.useState)(!1),[C,w]=(0,R.useState)(!0),[T,E]=(0,R.useState)(0),D=(0,R.useRef)(null),O;bb0:{if(h){O=`Project`;break bb0}let t;e[9]===y?t=e[10]:(t=se.find(e=>e.id===y)?.label??`Settings`,e[9]=y,e[10]=t),O=t}let ae=O,N;e[11]===x?N=e[12]:(N=()=>{x&&w(!1)},e[11]=x,e[12]=N);let F=N,B;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=()=>{w(!0)},e[13]=B):B=e[13];let Ee=B,H;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(H=async()=>{try{await p(),E(De)}catch(e){console.error(`Failed to reset onboarding:`,e)}},e[14]=H):H=e[14];let Ae=H,U;e[15]===i?U=e[16]:(U=()=>{i(`/`)},e[15]=i,e[16]=U);let je=U,W;e[17]===c?W=e[18]:(W=c?{type:`project`,id:c}:void 0,e[17]=c,e[18]=W);let Me=W,G;e[19]===i?G=e[20]:(G=()=>{i(`/settings/general`)},e[19]=i,e[20]=G);let Ne=G,K;e[21]!==s||e[22]!==n?(K=async()=>{a(n);try{let e=await l();s({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]=s,e[22]=n,e[23]=K):K=e[23];let Pe=K,q,J;e[24]!==o.pathname||e[25]!==i?(q=()=>{(o.pathname===`/settings`||o.pathname===`/settings/project`||[`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(e=>o.pathname.startsWith(e)))&&i(`/settings/general`,{replace:!0})},J=[o.pathname,i],e[24]=o.pathname,e[25]=i,e[26]=q,e[27]=J):(q=e[26],J=e[27]),(0,R.useEffect)(q,J);let Y;e[28]!==je||e[29]!==F||e[30]!==c?(Y=()=>(0,z.jsx)(A,{onTitleClose:je,subtitle:`Settings`,children:(0,z.jsx)(`div`,{className:`px-2 py-2`,children:(0,z.jsx)(ce,{selectedProjectId:c,onResetOnboarding:Ae,onNavItemSelect:F})})}),e[28]=je,e[29]=F,e[30]=c,e[31]=Y):Y=e[31];let Fe=Y,Ie;e[32]!==y||e[33]!==Ne||e[34]!==Pe||e[35]!==Me||e[36]!==h||e[37]!==T||e[38]!==n||e[39]!==u?(Ie=()=>{if(h&&n)return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Project Settings`}),children:(0,z.jsx)(ue,{projectId:n,onProjectUpdated:Pe})});switch(y){case`general`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`General`}),children:(0,z.jsx)(le,{onboardingResetSignal:T})});case`providers`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(Ce,{}),children:(0,z.jsx)(de,{})});case`models`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(I,{}),children:(0,z.jsx)(fe,{})});case`skills`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Skills`}),children:(0,z.jsx)(me,{})});case`rules`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Rules`}),children:(0,z.jsx)(he,{})});case`slash-commands`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Slash Commands`}),children:(0,z.jsx)(ge,{})});case`subagents`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Subagents`}),children:(0,z.jsx)(_e,{})});case`instructions`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Instructions`}),children:(0,z.jsx)(ve,{})});case`system-prompt`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`System Prompt`}),children:(0,z.jsx)(ye,{})});case`mcp-servers`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`MCP Servers`}),children:(0,z.jsx)(pe,{})});case`history`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`History`}),children:(0,z.jsx)(xe,{isOpen:!0,onClose:Ne,initialFilter:Me,projects:u,inline:!0})});case`account`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Account`}),children:(0,z.jsx)(be,{})});default:return(0,z.jsx)(V,{title:`Settings`})}},e[32]=y,e[33]=Ne,e[34]=Pe,e[35]=Me,e[36]=h,e[37]=T,e[38]=n,e[39]=u,e[40]=Ie):Ie=e[40];let Le=Ie,Re,ze;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Re=()=>S(!0),ze=()=>S(!1),e[41]=Re,e[42]=ze):(Re=e[41],ze=e[42]);let X;e[43]===Fe?X=e[44]:(X=Fe(),e[43]=Fe,e[44]=X);let Be=`flex-1 overflow-auto ${te&&!x?`ml-[40px]`:``}`,Z;e[45]!==ae||e[46]!==x||e[47]!==_||e[48]!==C?(Z=x&&!C&&!_?(0,z.jsx)(`div`,{className:b(r.settingsPage,`pb-0`),children:(0,z.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-center gap-2`,children:[(0,z.jsxs)(d,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground`,onClick:Ee,children:[(0,z.jsx)(m,{className:`h-4 w-4`}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Show settings menu`})]}),(0,z.jsx)(`span`,{className:b(ee.sectionTitle,`truncate text-foreground`),children:ae})]})}):null,e[45]=ae,e[46]=x,e[47]=_,e[48]=C,e[49]=Z):Z=e[49];let Q;e[50]===Le?Q=e[51]:(Q=Le(),e[50]=Le,e[51]=Q);let $;e[52]!==Be||e[53]!==Z||e[54]!==Q?($=(0,z.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:(0,z.jsxs)(`div`,{className:Be,children:[Z,Q]})}),e[52]=Be,e[53]=Z,e[54]=Q,e[55]=$):$=e[55];let Ve;return e[56]!==x||e[57]!==C||e[58]!==X||e[59]!==$?(Ve=(0,z.jsx)(oe,{ref:D,collapsible:!0,isMobile:x,mobileShowSidebar:C,onCollapse:Re,onExpand:ze,sidebar:X,children:$}),e[56]=x,e[57]=C,e[58]=X,e[59]=$,e[60]=Ve):Ve=e[60],Ve}function De(e){return e+1}function Oe(e){return e.projects}function ke(e){return e.selectedProjectId}export{Ee as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-general-view-lUxshNA9.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-BLO68CQl.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-CAkN8PCo.js","assets/dialogs-config-B-LZ4nOb.js","assets/onboarding-Bbvb7kO4.js","assets/whisper-wasm-EGutPGND.js","assets/react-vendor-D8PTA4EX.js","assets/utils-B7FQXlI6.js","assets/index-jIBJk8xl.css","assets/project-settings-view-BRkHOq_q.js","assets/radio-group-B0xvu5B9.js","assets/providers-list-view-Dex879vv.js","assets/skeleton-K-fVduHt.js","assets/settings-models-view-QPEdnibD.js","assets/settings-models-skeleton-ClrbJy_p.js","assets/settings-list-CHGKmGl_.js","assets/settings-mcp-servers-view-DpqkhrgB.js","assets/mcp-server-card-DQUpkDFV.js","assets/settings-skills-view-mgHy4G_g.js","assets/settings-rules-view-WJU--cRq.js","assets/settings-slash-commands-view-LB5tVqy1.js","assets/settings-subagents-view-QR2qlA_y.js","assets/settings-instructions-view-C57XGLha.js","assets/settings-system-prompt-view-Dl66VFaj.js","assets/account-view-D-dJ0y-D.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$i as t,Ba as n,Ci as r,Gi as i,Kt as a,Li as o,Qa as s,Ri as c,St as l,Xi as u,ci as d,do as f,en as p,ha as m,ia as h,ja as g,ji as _,po as v,ta as y,ui as b,wi as ee,xo as x,yo as te,zi as S}from"./dialogs-config-B-LZ4nOb.js";import{ct as ne,lt as re,st as ie}from"./react-vendor-D8PTA4EX.js";import{r as C}from"./monaco-CZnIWXyV.js";import{c as w,o as T}from"./onboarding-Bbvb7kO4.js";import{D as E,E as D,T as O}from"./history-view-CAkN8PCo.js";import{A as k,T as A,i as ae,j,k as M,n as N,p as P,r as F}from"./index-BLO68CQl.js";import{t as I}from"./settings-models-skeleton-ClrbJy_p.js";var L=te(),R=e(x(),1),z=_(),oe=(0,R.forwardRef)(function(e,t){let n=(0,L.c)(28),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:u,className:d,onCollapse:f,onExpand:p,isMobile:m,mobileShowSidebar:h}=e,g=a===void 0?25:a,_=o===void 0?20:o,v=s===void 0?30:s,y=c===void 0?40:c,ee=l===void 0?!1:l,x=u===void 0?0:u,te=d===void 0?``:d,S=m===void 0?!1:m,ne=h===void 0?!0:h,re=S&&!ne,ie=S&&ne,C=`h-full ${te}`,w=S?100:g,T=S?50:_,E=S?100:v,D=re&&`hidden`,O;n[0]===D?O=n[1]:(O=b(`border-r border-transparent`,D),n[0]=D,n[1]=O);let k;n[2]!==x||n[3]!==ee||n[4]!==f||n[5]!==p||n[6]!==t||n[7]!==r||n[8]!==w||n[9]!==T||n[10]!==E||n[11]!==O?(k=(0,z.jsx)(F,{ref:t,defaultSize:w,minSize:T,maxSize:E,collapsible:ee,collapsedSize:x,onCollapse:f,onExpand:p,className:O,children:r}),n[2]=x,n[3]=ee,n[4]=f,n[5]=p,n[6]=t,n[7]=r,n[8]=w,n[9]=T,n[10]=E,n[11]=O,n[12]=k):k=n[12];let A;n[13]===S?A=n[14]:(A=!S&&(0,z.jsx)(N,{withHandle:!0,className:`ml-[-40px]`}),n[13]=S,n[14]=A);let j=ie&&`hidden`,M;n[15]===j?M=n[16]:(M=b(`overflow-hidden`,j),n[15]=j,n[16]=M);let P;n[17]!==i||n[18]!==y||n[19]!==M?(P=(0,z.jsx)(F,{minSize:y,className:M,children:i}),n[17]=i,n[18]=y,n[19]=M,n[20]=P):P=n[20];let I;n[21]!==k||n[22]!==A||n[23]!==P?(I=(0,z.jsxs)(ae,{direction:`horizontal`,className:`h-full`,children:[k,A,P]}),n[21]=k,n[22]=A,n[23]=P,n[24]=I):I=n[24];let R;return n[25]!==C||n[26]!==I?(R=(0,z.jsx)(`div`,{className:C,children:I}),n[25]=C,n[26]=I,n[27]=R):R=n[27],R}),se=[{id:`providers`,label:`Providers`,icon:(0,z.jsx)(s,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,z.jsx)(f,{className:`h-4 w-4`}),route:`/settings/models`},{id:`skills`,label:`Skills`,icon:(0,z.jsx)(o,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,z.jsx)(h,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,z.jsx)(i,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,z.jsx)(c,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,z.jsx)(v,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`system-prompt`,label:`System Prompt`,icon:(0,z.jsx)(u,{className:`h-4 w-4`}),route:`/settings/system-prompt`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,z.jsx)(y,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`general`,label:`General`,icon:(0,z.jsx)(t,{className:`h-4 w-4`}),route:`/settings/general`},{id:`history`,label:`History`,icon:(0,z.jsx)(g,{className:`h-4 w-4`}),route:`/settings/history`},{id:`account`,label:`Account`,icon:(0,z.jsx)(S,{className:`h-4 w-4`}),route:`/settings/account`}];function B(e){let t=[...se];if(!e)return t;let r=t.findIndex(e=>e.id===`skills`);return t.splice(r,0,{id:`project`,label:`Project`,icon:(0,z.jsx)(n,{className:`h-4 w-4`}),route:`/settings/project/${e}`}),t}function ce(e){let t=(0,L.c)(13),{className:n,selectedProjectId:r,onResetOnboarding:i,onNavItemSelect:a}=e,o=ne(),s=ie(),c=(0,R.useRef)(0),l=(0,R.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,R.useEffect)(u,d);let f,p;if(t[2]!==n||t[3]!==s.pathname||t[4]!==o||t[5]!==a||t[6]!==i||t[7]!==r){let e=B(r),u=function(){let t=s.pathname;if(t.startsWith(`/settings/project/`))return`project`;for(let n of e)if(t.startsWith(n.route))return n.id;return`general`}(),d=function(e){e.id===`general`&&i&&(l.current&&clearTimeout(l.current),c.current+=1,c.current>=3?(c.current=0,i()):l.current=setTimeout(()=>{c.current=0},1500)),a?.(),o(e.route)};f=`space-y-1${n?` ${n}`:``}`,p=e.map((t,n)=>(0,z.jsxs)(R.Fragment,{children:[(0,z.jsx)(w,{selected:u===t.id,asChild:!0,children:(0,z.jsx)(`button`,{className:`justify-start`,onClick:()=>d(t),children:(0,z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[t.icon,(0,z.jsx)(`span`,{children:t.label})]})})}),(t.id===`models`||t.id===`mcp-servers`||n===e.length-1)&&(0,z.jsx)(T,{className:`my-2 bg-sidebar-border`})]},t.id)),t[2]=n,t[3]=s.pathname,t[4]=o,t[5]=a,t[6]=i,t[7]=r,t[8]=f,t[9]=p}else f=t[8],p=t[9];let m;return t[10]!==f||t[11]!==p?(m=(0,z.jsx)(`div`,{className:f,children:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12],m}var le=(0,R.lazy)(()=>C(()=>import(`./settings-general-view-lUxshNA9.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),ue=(0,R.lazy)(()=>C(()=>import(`./project-settings-view-BRkHOq_q.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11,13]))),de=(0,R.lazy)(()=>C(()=>import(`./providers-list-view-Dex879vv.js`),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,15]))),fe=(0,R.lazy)(()=>C(()=>import(`./settings-models-view-QPEdnibD.js`),__vite__mapDeps([16,1,2,3,4,5,6,7,8,9,10,11,17,15,18]))),pe=(0,R.lazy)(()=>C(()=>import(`./settings-mcp-servers-view-DpqkhrgB.js`),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),me=(0,R.lazy)(()=>C(()=>import(`./settings-skills-view-mgHy4G_g.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),he=(0,R.lazy)(()=>C(()=>import(`./settings-rules-view-WJU--cRq.js`),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),ge=(0,R.lazy)(()=>C(()=>import(`./settings-slash-commands-view-LB5tVqy1.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,10,11,20,13,18,15]))),_e=(0,R.lazy)(()=>C(()=>import(`./settings-subagents-view-QR2qlA_y.js`),__vite__mapDeps([24,1,2,3,4,5,6,7,8,9,10,11,20,18,15]))),ve=(0,R.lazy)(()=>C(()=>import(`./settings-instructions-view-C57XGLha.js`),__vite__mapDeps([25,1,2,3,4,5,6,7,8,9,10,11]))),ye=(0,R.lazy)(()=>C(()=>import(`./settings-system-prompt-view-Dl66VFaj.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11]))),be=(0,R.lazy)(()=>C(()=>import(`./account-view-D-dJ0y-D.js`),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,15]))),xe=(0,R.lazy)(()=>C(()=>import(`./history-view-CAkN8PCo.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 V(e){let t=(0,L.c)(2),{title:n}=e,r;return t[0]===n?r=t[1]:(r=(0,z.jsx)(O,{title:n,children:`Content coming soon...`}),t[0]=n,t[1]=r),r}function Ce(){let e=(0,L.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsxs)(`div`,{className:`mb-6`,children:[(0,z.jsx)(`div`,{className:`h-8 w-32 bg-muted rounded animate-pulse mb-2`}),(0,z.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,z.jsx)(`div`,{className:`mb-6`,children:(0,z.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,z.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,z.jsxs)(`div`,{children:[r,(0,z.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,z.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,z.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`})]})]}),a=(0,z.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,z.jsx)(E,{children:(0,z.jsxs)(D,{children:[t,n,(0,z.jsxs)(`div`,{className:`space-y-8`,children:[i,(0,z.jsxs)(`div`,{children:[a,(0,z.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,z.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,z.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,z.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,z.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 Ee(){let e=(0,L.c)(61),{tab:t,projectId:n}=re(),i=ne(),o=ie(),s=k(),c=j(ke),u=j(Oe),f;e[0]!==o.pathname||e[1]!==n?(f=!!n&&o.pathname.startsWith(`/settings/project/`),e[0]=o.pathname,e[1]=n,e[2]=f):f=e[2];let h=f,g;e[3]===o.pathname?g=e[4]:(g=Te(o.pathname),e[3]=o.pathname,e[4]=g);let _=g!==null,v;if(e[5]!==o.pathname||e[6]!==o.search||e[7]!==t){let n=new URLSearchParams(o.search).get(`tab`);v=n&&Se.includes(n)?n:t&&Se.includes(t)?t:we(o.pathname),e[5]=o.pathname,e[6]=o.search,e[7]=t,e[8]=v}else v=e[8];let y=v,x=P(),[te,S]=(0,R.useState)(!1),[C,w]=(0,R.useState)(!0),[T,E]=(0,R.useState)(0),D=(0,R.useRef)(null),O;bb0:{if(h){O=`Project`;break bb0}let t;e[9]===y?t=e[10]:(t=se.find(e=>e.id===y)?.label??`Settings`,e[9]=y,e[10]=t),O=t}let ae=O,N;e[11]===x?N=e[12]:(N=()=>{x&&w(!1)},e[11]=x,e[12]=N);let F=N,B;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=()=>{w(!0)},e[13]=B):B=e[13];let Ee=B,H;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(H=async()=>{try{await p(),E(De)}catch(e){console.error(`Failed to reset onboarding:`,e)}},e[14]=H):H=e[14];let Ae=H,U;e[15]===i?U=e[16]:(U=()=>{i(`/`)},e[15]=i,e[16]=U);let je=U,W;e[17]===c?W=e[18]:(W=c?{type:`project`,id:c}:void 0,e[17]=c,e[18]=W);let Me=W,G;e[19]===i?G=e[20]:(G=()=>{i(`/settings/general`)},e[19]=i,e[20]=G);let Ne=G,K;e[21]!==s||e[22]!==n?(K=async()=>{a(n);try{let e=await l();s({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]=s,e[22]=n,e[23]=K):K=e[23];let Pe=K,q,J;e[24]!==o.pathname||e[25]!==i?(q=()=>{(o.pathname===`/settings`||o.pathname===`/settings/project`||[`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(e=>o.pathname.startsWith(e)))&&i(`/settings/general`,{replace:!0})},J=[o.pathname,i],e[24]=o.pathname,e[25]=i,e[26]=q,e[27]=J):(q=e[26],J=e[27]),(0,R.useEffect)(q,J);let Y;e[28]!==je||e[29]!==F||e[30]!==c?(Y=()=>(0,z.jsx)(A,{onTitleClose:je,subtitle:`Settings`,children:(0,z.jsx)(`div`,{className:`px-2 py-2`,children:(0,z.jsx)(ce,{selectedProjectId:c,onResetOnboarding:Ae,onNavItemSelect:F})})}),e[28]=je,e[29]=F,e[30]=c,e[31]=Y):Y=e[31];let Fe=Y,Ie;e[32]!==y||e[33]!==Ne||e[34]!==Pe||e[35]!==Me||e[36]!==h||e[37]!==T||e[38]!==n||e[39]!==u?(Ie=()=>{if(h&&n)return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Project Settings`}),children:(0,z.jsx)(ue,{projectId:n,onProjectUpdated:Pe})});switch(y){case`general`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`General`}),children:(0,z.jsx)(le,{onboardingResetSignal:T})});case`providers`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(Ce,{}),children:(0,z.jsx)(de,{})});case`models`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(I,{}),children:(0,z.jsx)(fe,{})});case`skills`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Skills`}),children:(0,z.jsx)(me,{})});case`rules`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Rules`}),children:(0,z.jsx)(he,{})});case`slash-commands`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Slash Commands`}),children:(0,z.jsx)(ge,{})});case`subagents`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Subagents`}),children:(0,z.jsx)(_e,{})});case`instructions`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Instructions`}),children:(0,z.jsx)(ve,{})});case`system-prompt`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`System Prompt`}),children:(0,z.jsx)(ye,{})});case`mcp-servers`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`MCP Servers`}),children:(0,z.jsx)(pe,{})});case`history`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`History`}),children:(0,z.jsx)(xe,{isOpen:!0,onClose:Ne,initialFilter:Me,projects:u,inline:!0})});case`account`:return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(V,{title:`Account`}),children:(0,z.jsx)(be,{})});default:return(0,z.jsx)(V,{title:`Settings`})}},e[32]=y,e[33]=Ne,e[34]=Pe,e[35]=Me,e[36]=h,e[37]=T,e[38]=n,e[39]=u,e[40]=Ie):Ie=e[40];let Le=Ie,Re,ze;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Re=()=>S(!0),ze=()=>S(!1),e[41]=Re,e[42]=ze):(Re=e[41],ze=e[42]);let X;e[43]===Fe?X=e[44]:(X=Fe(),e[43]=Fe,e[44]=X);let Be=`flex-1 overflow-auto ${te&&!x?`ml-[40px]`:``}`,Z;e[45]!==ae||e[46]!==x||e[47]!==_||e[48]!==C?(Z=x&&!C&&!_?(0,z.jsx)(`div`,{className:b(r.settingsPage,`pb-0`),children:(0,z.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-center gap-2`,children:[(0,z.jsxs)(d,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground`,onClick:Ee,children:[(0,z.jsx)(m,{className:`h-4 w-4`}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Show settings menu`})]}),(0,z.jsx)(`span`,{className:b(ee.sectionTitle,`truncate text-foreground`),children:ae})]})}):null,e[45]=ae,e[46]=x,e[47]=_,e[48]=C,e[49]=Z):Z=e[49];let Q;e[50]===Le?Q=e[51]:(Q=Le(),e[50]=Le,e[51]=Q);let $;e[52]!==Be||e[53]!==Z||e[54]!==Q?($=(0,z.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:(0,z.jsxs)(`div`,{className:Be,children:[Z,Q]})}),e[52]=Be,e[53]=Z,e[54]=Q,e[55]=$):$=e[55];let Ve;return e[56]!==x||e[57]!==C||e[58]!==X||e[59]!==$?(Ve=(0,z.jsx)(oe,{ref:D,collapsible:!0,isMobile:x,mobileShowSidebar:C,onCollapse:Re,onExpand:ze,sidebar:X,children:$}),e[56]=x,e[57]=C,e[58]=X,e[59]=$,e[60]=Ve):Ve=e[60],Ve}function De(e){return e+1}function Oe(e){return e.projects}function ke(e){return e.selectedProjectId}export{Ee as default};
@@ -1 +1 @@
1
- import{ji as e,ui as t,yo as n}from"./dialogs-config-DZKtVbNK.js";var r=n(),i=e();function a(e){let n=(0,r.c)(8),a,o;n[0]===e?(a=n[1],o=n[2]):({className:a,...o}=e,n[0]=e,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=t(`animate-pulse rounded-md bg-muted`,a),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}export{a as t};
1
+ import{ji as e,ui as t,yo as n}from"./dialogs-config-B-LZ4nOb.js";var r=n(),i=e();function a(e){let n=(0,r.c)(8),a,o;n[0]===e?(a=n[1],o=n[2]):({className:a,...o}=e,n[0]=e,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=t(`animate-pulse rounded-md bg-muted`,a),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}export{a as t};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$a as t,ji as n,nn as r,so as i,xo as a}from"./dialogs-config-DZKtVbNK.js";import{C as o,M as s,S as c,j as l,k as u}from"./index-DjD2SPNZ.js";var d=e(a(),1),f=n();function p(){let e=l(e=>e.selectedProjectId),n=l(e=>e.selectedThreadId),a=l(e=>e.projects),{terminalState:p,dispatch:m}=s(n),{queuedCommand:h,queuedRelativeFolder:g,outputLines:_,history:v,historyIndex:y,cwd:b,isRunning:x}=p,[S,C]=(0,d.useState)(``),[w,T]=(0,d.useState)([]),E=a.flatMap(e=>e.threads).find(e=>e.threadId===n)?.path??null,D=!b||b===`.`||b===`./`?E:b,O=!D||D===E,{activeMainTab:k}=o(),A=(0,d.useRef)(null),j=(0,d.useRef)(null),M=(0,d.useRef)(0);(0,d.useEffect)(()=>{A.current&&(A.current.scrollTop=A.current.scrollHeight)},[w]),(0,d.useEffect)(()=>{T(_),M.current=_.length},[n,_]),(0,d.useEffect)(()=>{if(_.length===0)T([]),M.current=0;else if(_.length>M.current){let e=_.slice(M.current);T(t=>[...t,...e]),M.current=_.length}},[_]),(0,d.useEffect)(()=>{x||j.current?.focus()},[x]),(0,d.useEffect)(()=>{k===`terminal`&&j.current?.focus()},[k]);let N=(0,d.useCallback)(async(t,i)=>{if(!(!e||!n||!t.trim())){m({type:u.AppendTerminalLine,line:{type:`input`,content:t}}),m({type:u.SetTerminalHistory,history:[t,...v.filter(e=>e!==t)].slice(0,50)}),m({type:u.SetTerminalHistoryIndex,index:-1}),C(``),m({type:u.SetTerminalRunning,isRunning:!0});try{let a=await r(e,n,t,i??void 0);if(!a){m({type:u.AppendTerminalLine,line:{type:`system`,content:`Command started but no output stream received.`}}),m({type:u.SetTerminalRunning,isRunning:!1});return}let o=a.getReader(),s=new TextDecoder,l=``;for(;;){let{done:e,value:t}=await o.read();if(e)break;l+=s.decode(t,{stream:!0});let n=l.split(`
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$a as t,ji as n,nn as r,so as i,xo as a}from"./dialogs-config-B-LZ4nOb.js";import{C as o,M as s,S as c,j as l,k as u}from"./index-BLO68CQl.js";var d=e(a(),1),f=n();function p(){let e=l(e=>e.selectedProjectId),n=l(e=>e.selectedThreadId),a=l(e=>e.projects),{terminalState:p,dispatch:m}=s(n),{queuedCommand:h,queuedRelativeFolder:g,outputLines:_,history:v,historyIndex:y,cwd:b,isRunning:x}=p,[S,C]=(0,d.useState)(``),[w,T]=(0,d.useState)([]),E=a.flatMap(e=>e.threads).find(e=>e.threadId===n)?.path??null,D=!b||b===`.`||b===`./`?E:b,O=!D||D===E,{activeMainTab:k}=o(),A=(0,d.useRef)(null),j=(0,d.useRef)(null),M=(0,d.useRef)(0);(0,d.useEffect)(()=>{A.current&&(A.current.scrollTop=A.current.scrollHeight)},[w]),(0,d.useEffect)(()=>{T(_),M.current=_.length},[n,_]),(0,d.useEffect)(()=>{if(_.length===0)T([]),M.current=0;else if(_.length>M.current){let e=_.slice(M.current);T(t=>[...t,...e]),M.current=_.length}},[_]),(0,d.useEffect)(()=>{x||j.current?.focus()},[x]),(0,d.useEffect)(()=>{k===`terminal`&&j.current?.focus()},[k]);let N=(0,d.useCallback)(async(t,i)=>{if(!(!e||!n||!t.trim())){m({type:u.AppendTerminalLine,line:{type:`input`,content:t}}),m({type:u.SetTerminalHistory,history:[t,...v.filter(e=>e!==t)].slice(0,50)}),m({type:u.SetTerminalHistoryIndex,index:-1}),C(``),m({type:u.SetTerminalRunning,isRunning:!0});try{let a=await r(e,n,t,i??void 0);if(!a){m({type:u.AppendTerminalLine,line:{type:`system`,content:`Command started but no output stream received.`}}),m({type:u.SetTerminalRunning,isRunning:!1});return}let o=a.getReader(),s=new TextDecoder,l=``;for(;;){let{done:e,value:t}=await o.read();if(e)break;l+=s.decode(t,{stream:!0});let n=l.split(`
2
2
  `);l=n.pop()??``;for(let e of n)if(e.trim())try{let t=JSON.parse(e);typeof t==`string`?m({type:u.AppendTerminalLine,line:{type:`output`,content:c(t)}}):t.type===`error`?m({type:u.AppendTerminalLine,line:{type:`error`,content:c(t.message)}}):t.type===`cwd`&&m({type:u.SetTerminalCwd,cwd:t.path})}catch{m({type:u.AppendTerminalLine,line:{type:`output`,content:c(e)}})}}if(l.trim())try{let e=JSON.parse(l);typeof e==`string`?m({type:u.AppendTerminalLine,line:{type:`output`,content:c(e)}}):e.type===`error`?m({type:u.AppendTerminalLine,line:{type:`error`,content:c(e.message)}}):e.type===`cwd`&&m({type:u.SetTerminalCwd,cwd:e.path})}catch{m({type:u.AppendTerminalLine,line:{type:`output`,content:c(l)}})}}catch(e){m({type:u.AppendTerminalLine,line:{type:`error`,content:e instanceof Error?e.message:`Failed to run command`}})}finally{m({type:u.SetTerminalRunning,isRunning:!1})}}},[e,n,m,v]);return(0,d.useEffect)(()=>{h&&!x&&(N(h,g??void 0),m({type:u.ClearQueuedTerminalCommand}))},[h,g,x,m,N]),(0,f.jsxs)(`div`,{className:`flex flex-col h-full bg-neutral-950 text-neutral-200 font-mono text-sm overflow-hidden`,children:[(0,f.jsxs)(`div`,{ref:A,className:`flex-1 overflow-y-auto p-4 space-y-0.5 terminal-scrollbar`,onClick:e=>{e.target===e.currentTarget&&j.current?.focus()},children:[w.length===0&&!x&&(0,f.jsx)(`div`,{className:`text-neutral-600 italic text-xs`,children:`Enter your commands below...`}),w.map((e,t)=>(0,f.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,f.jsx)(i,{className:`h-4 w-4 mt-1 shrink-0 text-blue-400/70`}),(0,f.jsx)(`span`,{children:e.content})]},t))]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-t border-white/5 bg-white/5`,children:[!O&&(0,f.jsx)(`span`,{className:`text-blue-400 text-xs font-bold whitespace-nowrap`,children:D.split(`/`).pop()}),(0,f.jsx)(i,{className:`h-4 w-4 text-blue-400 ${O?``:`-ml-1`}`}),(0,f.jsx)(`input`,{ref:j,type:`text`,className:`flex-1 bg-transparent border-none outline-none text-neutral-200 placeholder:text-neutral-700 h-6`,placeholder:x?`Running...`:`Type a command...`,value:S,onChange:e=>C(e.target.value),onKeyDown:e=>{if(e.key===`Enter`)N(S);else if(e.key===`ArrowUp`){e.preventDefault();let t=y+1;t<v.length&&(m({type:u.SetTerminalHistoryIndex,index:t}),C(v[t]))}else if(e.key===`ArrowDown`){e.preventDefault();let t=y-1;t>=0?(m({type:u.SetTerminalHistoryIndex,index:t}),C(v[t])):(m({type:u.SetTerminalHistoryIndex,index:-1}),C(``))}},disabled:x}),(0,f.jsxs)(`div`,{className:`flex items-center gap-1 px-1.5 py-0.5 rounded border border-white/10 bg-white/5`,children:[(0,f.jsx)(t,{className:`h-3 w-3 text-neutral-600`}),(0,f.jsx)(`span`,{className:`text-[10px] text-neutral-600 uppercase font-bold`,children:`Enter`})]})]})]})}export{p as TerminalPanel};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ir as t,Lr as n,Mi as r,Pr as i,Rr as a,Tr as o,ii as s,xo as c}from"./dialogs-config-DZKtVbNK.js";var l=1,u=.9,d=.8,f=.17,p=.1,m=.999,h=.9999,g=.99,_=/[\\\/_+.#"@\[\(\{&]/,v=/[\\\/_+.#"@\[\(\{&]/g,y=/[\s-]/,b=/[\s-]/g;function x(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?l:g;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),S=n.indexOf(c,i),C=0,w,T,E,D;S>=0;)w=x(e,t,n,r,S+1,a+1,o),w>C&&(S===i?w*=l:_.test(e.charAt(S-1))?(w*=d,E=e.slice(i,S-1).match(v),E&&i>0&&(w*=m**+E.length)):y.test(e.charAt(S-1))?(w*=u,D=e.slice(i,S-1).match(b),D&&i>0&&(w*=m**+D.length)):(w*=f,i>0&&(w*=m**+(S-i))),e.charAt(S)!==t.charAt(a)&&(w*=h)),(w<p&&n.charAt(S-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(S-1)!==r.charAt(a))&&(T=x(e,t,n,r,S+1,a+2,o),T*p>w&&(w=T*p)),w>C&&(C=w),S=n.indexOf(c,S+1);return o[s]=C,C}function S(e){return e.toLowerCase().replace(b,` `)}function C(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,x(e,t,S(e),S(t),0,0,{})}var w=e(c(),1),T=`[cmdk-group=""]`,E=`[cmdk-group-items=""]`,D=`[cmdk-group-heading=""]`,O=`[cmdk-item=""]`,k=`${O}:not([aria-disabled="true"])`,A=`cmdk-item-select`,j=`data-value`,ee=(e,t,n)=>C(e,t,n),M=w.createContext(void 0),N=()=>w.useContext(M),P=w.createContext(void 0),F=()=>w.useContext(P),I=w.createContext(void 0),L=w.forwardRef((e,t)=>{let n=Y(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Y(()=>new Set),i=Y(()=>new Map),a=Y(()=>new Map),c=Y(()=>new Set),l=q(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=s(),x=s(),S=s(),C=w.useRef(null),N=re();J(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,F.emit()}},[f]),J(()=>{N(6,V)},[]);let F=w.useMemo(()=>({subscribe:e=>(c.current.add(e),()=>c.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)B(),R(),N(1,z);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(N(7,()=>{n.current.selectedItemId=H()?.id,F.emit()}),r||N(5,V),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}F.emit()}},emit:()=>{c.current.forEach(e=>e())}}),[]),I=w.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,L(t,r)),N(2,()=>{R(),F.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),N(3,()=>{B(),R(),n.current.value||z(),F.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=H();N(4,()=>{B(),t?.getAttribute(`id`)===e&&z(),F.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:S,labelId:x,listInnerRef:C}),[]);function L(e,t){let r=l.current?.filter??ee;return e?r(e,n.current.search,t):0}function R(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=C.current;U().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(E);t?t.appendChild(e.parentElement===t?e:e.closest(`${E} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${E} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${T}[${j}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function z(){let e=U().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(j);F.setState(`value`,e||void 0)}function B(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=L(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function V(){var e;let t=H();t&&(t.parentElement?.firstChild===t&&((e=t.closest(T)?.querySelector(D))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function H(){return C.current?.querySelector(`${O}[aria-selected="true"]`)}function U(){return Array.from(C.current?.querySelectorAll(k)||[])}function W(e){let t=U()[e];t&&F.setState(`value`,t.getAttribute(j))}function G(e){var t;let n=H(),r=U(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&F.setState(`value`,a.getAttribute(j))}function K(e){let t=H()?.closest(T),n;for(;t&&!n;)t=e>0?te(t,T):ne(t,T),n=t?.querySelector(k);n?F.setState(`value`,n.getAttribute(j)):G(e)}let X=()=>W(U().length-1),Z=e=>{e.preventDefault(),e.metaKey?X():e.altKey?K(1):G(1)},Q=e=>{e.preventDefault(),e.metaKey?W(0):e.altKey?K(-1):G(-1)};return w.createElement(o.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&Z(e);break;case`ArrowDown`:Z(e);break;case`p`:case`k`:v&&e.ctrlKey&&Q(e);break;case`ArrowUp`:Q(e);break;case`Home`:e.preventDefault(),W(0);break;case`End`:e.preventDefault(),X();break;case`Enter`:{e.preventDefault();let t=H();if(t){let e=new Event(A);t.dispatchEvent(e)}}}}},w.createElement(`label`,{"cmdk-label":``,htmlFor:I.inputId,id:I.labelId,style:ie},u),$(e,e=>w.createElement(P.Provider,{value:F},w.createElement(M.Provider,{value:I},e))))}),R=w.forwardRef((e,t)=>{let n=s(),i=w.useRef(null),a=w.useContext(I),c=N(),l=q(e),u=l.current?.forceMount??a?.forceMount;J(()=>{if(!u)return c.item(n,a?.id)},[u]);let d=Z(n,i,[e.value,e.children,i],e.keywords),f=F(),p=X(e=>e.value&&e.value===d.current),m=X(e=>u||c.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);w.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(A,h),()=>t.removeEventListener(A,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:x,...S}=e;return w.createElement(o.div,{ref:r(i,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||c.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),z=w.forwardRef((e,t)=>{let{heading:n,children:i,forceMount:a,...c}=e,l=s(),u=w.useRef(null),d=w.useRef(null),f=s(),p=N(),m=X(e=>a||p.filter()===!1?!0:e.search?e.filtered.groups.has(l):!0);J(()=>p.group(l),[]),Z(l,u,[e.value,e.heading,d]);let h=w.useMemo(()=>({id:l,forceMount:a}),[a]);return w.createElement(o.div,{ref:r(u,t),...c,"cmdk-group":``,role:`presentation`,hidden:m?void 0:!0},n&&w.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),$(e,e=>w.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},w.createElement(I.Provider,{value:h},e))))}),B=w.forwardRef((e,t)=>{let{alwaysRender:n,...i}=e,a=w.useRef(null),s=X(e=>!e.search);return!n&&!s?null:w.createElement(o.div,{ref:r(a,t),...i,"cmdk-separator":``,role:`separator`})}),V=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=F(),s=X(e=>e.search),c=X(e=>e.selectedItemId),l=N();return w.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),w.createElement(o.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:s,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),H=w.forwardRef((e,t)=>{let{children:n,label:i=`Suggestions`,...a}=e,s=w.useRef(null),c=w.useRef(null),l=X(e=>e.selectedItemId),u=N();return w.useEffect(()=>{if(c.current&&s.current){let e=c.current,t=s.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),w.createElement(o.div,{ref:r(s,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":i,id:u.listId},$(e,e=>w.createElement(`div`,{ref:r(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),U=w.forwardRef((e,r)=>{let{open:o,onOpenChange:s,overlayClassName:c,contentClassName:l,container:u,...d}=e;return w.createElement(a,{open:o,onOpenChange:s},w.createElement(n,{container:u},w.createElement(t,{"cmdk-overlay":``,className:c}),w.createElement(i,{"aria-label":e.label,"cmdk-dialog":``,className:l},w.createElement(L,{ref:r,...d}))))}),W=w.forwardRef((e,t)=>X(e=>e.filtered.count===0)?w.createElement(o.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),G=w.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return w.createElement(o.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$(e,e=>w.createElement(`div`,{"aria-hidden":!0},e)))}),K=Object.assign(L,{List:H,Item:R,Input:V,Group:z,Separator:B,Dialog:U,Empty:W,Loading:G});function te(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ne(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function q(e){let t=w.useRef(e);return J(()=>{t.current=e}),t}var J=typeof window>`u`?w.useEffect:w.useLayoutEffect;function Y(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function X(e){let t=F(),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function Z(e,t,n,r=[]){let i=w.useRef(),a=N();return J(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(j,s),i.current=s}),i}var re=()=>{let[e,t]=w.useState(),n=Y(()=>new Map);return J(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Q(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function $({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(Q(t),{ref:t.ref},n(t.props.children)):n(t)}var ie={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};export{K as t};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ir as t,Lr as n,Mi as r,Pr as i,Rr as a,Tr as o,ii as s,xo as c}from"./dialogs-config-B-LZ4nOb.js";var l=1,u=.9,d=.8,f=.17,p=.1,m=.999,h=.9999,g=.99,_=/[\\\/_+.#"@\[\(\{&]/,v=/[\\\/_+.#"@\[\(\{&]/g,y=/[\s-]/,b=/[\s-]/g;function x(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?l:g;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),S=n.indexOf(c,i),C=0,w,T,E,D;S>=0;)w=x(e,t,n,r,S+1,a+1,o),w>C&&(S===i?w*=l:_.test(e.charAt(S-1))?(w*=d,E=e.slice(i,S-1).match(v),E&&i>0&&(w*=m**+E.length)):y.test(e.charAt(S-1))?(w*=u,D=e.slice(i,S-1).match(b),D&&i>0&&(w*=m**+D.length)):(w*=f,i>0&&(w*=m**+(S-i))),e.charAt(S)!==t.charAt(a)&&(w*=h)),(w<p&&n.charAt(S-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(S-1)!==r.charAt(a))&&(T=x(e,t,n,r,S+1,a+2,o),T*p>w&&(w=T*p)),w>C&&(C=w),S=n.indexOf(c,S+1);return o[s]=C,C}function S(e){return e.toLowerCase().replace(b,` `)}function C(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,x(e,t,S(e),S(t),0,0,{})}var w=e(c(),1),T=`[cmdk-group=""]`,E=`[cmdk-group-items=""]`,D=`[cmdk-group-heading=""]`,O=`[cmdk-item=""]`,k=`${O}:not([aria-disabled="true"])`,A=`cmdk-item-select`,j=`data-value`,ee=(e,t,n)=>C(e,t,n),M=w.createContext(void 0),N=()=>w.useContext(M),P=w.createContext(void 0),F=()=>w.useContext(P),I=w.createContext(void 0),L=w.forwardRef((e,t)=>{let n=Y(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Y(()=>new Set),i=Y(()=>new Map),a=Y(()=>new Map),c=Y(()=>new Set),l=q(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=s(),x=s(),S=s(),C=w.useRef(null),N=re();J(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,F.emit()}},[f]),J(()=>{N(6,V)},[]);let F=w.useMemo(()=>({subscribe:e=>(c.current.add(e),()=>c.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)B(),R(),N(1,z);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(N(7,()=>{n.current.selectedItemId=H()?.id,F.emit()}),r||N(5,V),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}F.emit()}},emit:()=>{c.current.forEach(e=>e())}}),[]),I=w.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,L(t,r)),N(2,()=>{R(),F.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),N(3,()=>{B(),R(),n.current.value||z(),F.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=H();N(4,()=>{B(),t?.getAttribute(`id`)===e&&z(),F.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:S,labelId:x,listInnerRef:C}),[]);function L(e,t){let r=l.current?.filter??ee;return e?r(e,n.current.search,t):0}function R(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=C.current;U().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(E);t?t.appendChild(e.parentElement===t?e:e.closest(`${E} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${E} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${T}[${j}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function z(){let e=U().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(j);F.setState(`value`,e||void 0)}function B(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=L(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function V(){var e;let t=H();t&&(t.parentElement?.firstChild===t&&((e=t.closest(T)?.querySelector(D))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function H(){return C.current?.querySelector(`${O}[aria-selected="true"]`)}function U(){return Array.from(C.current?.querySelectorAll(k)||[])}function W(e){let t=U()[e];t&&F.setState(`value`,t.getAttribute(j))}function G(e){var t;let n=H(),r=U(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&F.setState(`value`,a.getAttribute(j))}function K(e){let t=H()?.closest(T),n;for(;t&&!n;)t=e>0?te(t,T):ne(t,T),n=t?.querySelector(k);n?F.setState(`value`,n.getAttribute(j)):G(e)}let X=()=>W(U().length-1),Z=e=>{e.preventDefault(),e.metaKey?X():e.altKey?K(1):G(1)},Q=e=>{e.preventDefault(),e.metaKey?W(0):e.altKey?K(-1):G(-1)};return w.createElement(o.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&Z(e);break;case`ArrowDown`:Z(e);break;case`p`:case`k`:v&&e.ctrlKey&&Q(e);break;case`ArrowUp`:Q(e);break;case`Home`:e.preventDefault(),W(0);break;case`End`:e.preventDefault(),X();break;case`Enter`:{e.preventDefault();let t=H();if(t){let e=new Event(A);t.dispatchEvent(e)}}}}},w.createElement(`label`,{"cmdk-label":``,htmlFor:I.inputId,id:I.labelId,style:ie},u),$(e,e=>w.createElement(P.Provider,{value:F},w.createElement(M.Provider,{value:I},e))))}),R=w.forwardRef((e,t)=>{let n=s(),i=w.useRef(null),a=w.useContext(I),c=N(),l=q(e),u=l.current?.forceMount??a?.forceMount;J(()=>{if(!u)return c.item(n,a?.id)},[u]);let d=Z(n,i,[e.value,e.children,i],e.keywords),f=F(),p=X(e=>e.value&&e.value===d.current),m=X(e=>u||c.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);w.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(A,h),()=>t.removeEventListener(A,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:x,...S}=e;return w.createElement(o.div,{ref:r(i,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||c.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),z=w.forwardRef((e,t)=>{let{heading:n,children:i,forceMount:a,...c}=e,l=s(),u=w.useRef(null),d=w.useRef(null),f=s(),p=N(),m=X(e=>a||p.filter()===!1?!0:e.search?e.filtered.groups.has(l):!0);J(()=>p.group(l),[]),Z(l,u,[e.value,e.heading,d]);let h=w.useMemo(()=>({id:l,forceMount:a}),[a]);return w.createElement(o.div,{ref:r(u,t),...c,"cmdk-group":``,role:`presentation`,hidden:m?void 0:!0},n&&w.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),$(e,e=>w.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},w.createElement(I.Provider,{value:h},e))))}),B=w.forwardRef((e,t)=>{let{alwaysRender:n,...i}=e,a=w.useRef(null),s=X(e=>!e.search);return!n&&!s?null:w.createElement(o.div,{ref:r(a,t),...i,"cmdk-separator":``,role:`separator`})}),V=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=F(),s=X(e=>e.search),c=X(e=>e.selectedItemId),l=N();return w.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),w.createElement(o.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:s,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),H=w.forwardRef((e,t)=>{let{children:n,label:i=`Suggestions`,...a}=e,s=w.useRef(null),c=w.useRef(null),l=X(e=>e.selectedItemId),u=N();return w.useEffect(()=>{if(c.current&&s.current){let e=c.current,t=s.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),w.createElement(o.div,{ref:r(s,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":i,id:u.listId},$(e,e=>w.createElement(`div`,{ref:r(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),U=w.forwardRef((e,r)=>{let{open:o,onOpenChange:s,overlayClassName:c,contentClassName:l,container:u,...d}=e;return w.createElement(a,{open:o,onOpenChange:s},w.createElement(n,{container:u},w.createElement(t,{"cmdk-overlay":``,className:c}),w.createElement(i,{"aria-label":e.label,"cmdk-dialog":``,className:l},w.createElement(L,{ref:r,...d}))))}),W=w.forwardRef((e,t)=>X(e=>e.filtered.count===0)?w.createElement(o.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),G=w.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return w.createElement(o.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$(e,e=>w.createElement(`div`,{"aria-hidden":!0},e)))}),K=Object.assign(L,{List:H,Item:R,Input:V,Group:z,Separator:B,Dialog:U,Empty:W,Loading:G});function te(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ne(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function q(e){let t=w.useRef(e);return J(()=>{t.current=e}),t}var J=typeof window>`u`?w.useEffect:w.useLayoutEffect;function Y(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function X(e){let t=F(),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function Z(e,t,n,r=[]){let i=w.useRef(),a=N();return J(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(j,s),i.current=s}),i}var re=()=>{let[e,t]=w.useState(),n=Y(()=>new Map);return J(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Q(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function $({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(Q(t),{ref:t.ref},n(t.props.children)):n(t)}var ie={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};export{K as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{xo as t}from"./dialogs-config-DZKtVbNK.js";var n=e(t(),1),r=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},i=[`light`,`dark`],a=`(prefers-color-scheme: dark)`,o=typeof window>`u`,s=n.createContext(void 0),c={setTheme:e=>{},themes:[]},l=()=>n.useContext(s)??c,u=e=>n.useContext(s)?n.createElement(n.Fragment,null,e.children):n.createElement(f,{...e}),d=[`light`,`dark`],f=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:o=!0,storageKey:c=`theme`,themes:l=d,defaultTheme:u=r?`system`:`light`,attribute:f=`data-theme`,value:_,children:v,nonce:y,scriptProps:b})=>{let[x,S]=n.useState(()=>m(c,u)),[C,w]=n.useState(()=>x===`system`?g():x),T=_?Object.values(_):l,E=n.useCallback(e=>{let n=e;if(!n)return;e===`system`&&r&&(n=g());let a=_?_[n]:n,s=t?h(y):null,c=document.documentElement,l=e=>{e===`class`?(c.classList.remove(...T),a&&c.classList.add(a)):e.startsWith(`data-`)&&(a?c.setAttribute(e,a):c.removeAttribute(e))};if(Array.isArray(f)?f.forEach(l):l(f),o){let e=i.includes(u)?u:null,t=i.includes(n)?n:e;c.style.colorScheme=t}s?.()},[y]),D=n.useCallback(e=>{let t=typeof e==`function`?e(x):e;S(t);try{localStorage.setItem(c,t)}catch{}},[x]),O=n.useCallback(t=>{w(g(t)),x===`system`&&r&&!e&&E(`system`)},[x,e]);n.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(O),O(e),()=>e.removeListener(O)},[O]),n.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?S(e.newValue):D(u))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[D]),n.useEffect(()=>{E(e??x)},[e,x]);let k=n.useMemo(()=>({theme:x,setTheme:D,forcedTheme:e,resolvedTheme:x===`system`?C:x,themes:r?[...l,`system`]:l,systemTheme:r?C:void 0}),[x,D,e,C,r,l]);return n.createElement(s.Provider,{value:k},n.createElement(p,{forcedTheme:e,storageKey:c,attribute:f,enableSystem:r,enableColorScheme:o,defaultTheme:u,value:_,themes:l,nonce:y,scriptProps:b}),v)},p=n.memo(({forcedTheme:e,storageKey:t,attribute:i,enableSystem:a,enableColorScheme:o,defaultTheme:s,value:c,themes:l,nonce:u,scriptProps:d})=>{let f=JSON.stringify([i,t,s,e,l,c,a,o]).slice(1,-1);return n.createElement(`script`,{...d,suppressHydrationWarning:!0,nonce:typeof window>`u`?u:``,dangerouslySetInnerHTML:{__html:`(${r.toString()})(${f})`}})}),m=(e,t)=>{if(o)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},h=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},g=e=>(e||=window.matchMedia(a),e.matches?`dark`:`light`);export{l as n,u as t};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{xo as t}from"./dialogs-config-B-LZ4nOb.js";var n=e(t(),1),r=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},i=[`light`,`dark`],a=`(prefers-color-scheme: dark)`,o=typeof window>`u`,s=n.createContext(void 0),c={setTheme:e=>{},themes:[]},l=()=>n.useContext(s)??c,u=e=>n.useContext(s)?n.createElement(n.Fragment,null,e.children):n.createElement(f,{...e}),d=[`light`,`dark`],f=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:o=!0,storageKey:c=`theme`,themes:l=d,defaultTheme:u=r?`system`:`light`,attribute:f=`data-theme`,value:_,children:v,nonce:y,scriptProps:b})=>{let[x,S]=n.useState(()=>m(c,u)),[C,w]=n.useState(()=>x===`system`?g():x),T=_?Object.values(_):l,E=n.useCallback(e=>{let n=e;if(!n)return;e===`system`&&r&&(n=g());let a=_?_[n]:n,s=t?h(y):null,c=document.documentElement,l=e=>{e===`class`?(c.classList.remove(...T),a&&c.classList.add(a)):e.startsWith(`data-`)&&(a?c.setAttribute(e,a):c.removeAttribute(e))};if(Array.isArray(f)?f.forEach(l):l(f),o){let e=i.includes(u)?u:null,t=i.includes(n)?n:e;c.style.colorScheme=t}s?.()},[y]),D=n.useCallback(e=>{let t=typeof e==`function`?e(x):e;S(t);try{localStorage.setItem(c,t)}catch{}},[x]),O=n.useCallback(t=>{w(g(t)),x===`system`&&r&&!e&&E(`system`)},[x,e]);n.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(O),O(e),()=>e.removeListener(O)},[O]),n.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?S(e.newValue):D(u))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[D]),n.useEffect(()=>{E(e??x)},[e,x]);let k=n.useMemo(()=>({theme:x,setTheme:D,forcedTheme:e,resolvedTheme:x===`system`?C:x,themes:r?[...l,`system`]:l,systemTheme:r?C:void 0}),[x,D,e,C,r,l]);return n.createElement(s.Provider,{value:k},n.createElement(p,{forcedTheme:e,storageKey:c,attribute:f,enableSystem:r,enableColorScheme:o,defaultTheme:u,value:_,themes:l,nonce:y,scriptProps:b}),v)},p=n.memo(({forcedTheme:e,storageKey:t,attribute:i,enableSystem:a,enableColorScheme:o,defaultTheme:s,value:c,themes:l,nonce:u,scriptProps:d})=>{let f=JSON.stringify([i,t,s,e,l,c,a,o]).slice(1,-1);return n.createElement(`script`,{...d,suppressHydrationWarning:!0,nonce:typeof window>`u`?u:``,dangerouslySetInnerHTML:{__html:`(${r.toString()})(${f})`}})}),m=(e,t)=>{if(o)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},h=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},g=e=>(e||=window.matchMedia(a),e.matches?`dark`:`light`);export{l as n,u as t};
@@ -22,15 +22,15 @@
22
22
  <meta name="apple-mobile-web-app-title" content="Tarsk" />
23
23
 
24
24
  <title>Tarsk</title>
25
- <script type="module" crossorigin src="/assets/index-DjD2SPNZ.js"></script>
25
+ <script type="module" crossorigin src="/assets/index-BLO68CQl.js"></script>
26
26
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
27
27
  <link rel="modulepreload" crossorigin href="/assets/monaco-CZnIWXyV.js">
28
- <link rel="modulepreload" crossorigin href="/assets/dialogs-config-DZKtVbNK.js">
29
- <link rel="modulepreload" crossorigin href="/assets/history-view-jX3PPID6.js">
30
- <link rel="modulepreload" crossorigin href="/assets/onboarding-CxtzQldG.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/dialogs-config-B-LZ4nOb.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/history-view-CAkN8PCo.js">
30
+ <link rel="modulepreload" crossorigin href="/assets/onboarding-Bbvb7kO4.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/whisper-wasm-EGutPGND.js">
32
- <link rel="modulepreload" crossorigin href="/assets/react-vendor-Ba8DSNiO.js">
33
- <link rel="modulepreload" crossorigin href="/assets/utils-BlXPFbY9.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/react-vendor-D8PTA4EX.js">
33
+ <link rel="modulepreload" crossorigin href="/assets/utils-B7FQXlI6.js">
34
34
  <link rel="stylesheet" crossorigin href="/assets/monaco-Br_kD0ds.css">
35
35
  <link rel="stylesheet" crossorigin href="/assets/index-jIBJk8xl.css">
36
36
  </head>
@@ -9,5 +9,5 @@
9
9
  "Gemini 3.5 Flash",
10
10
  "Kimi K2.6",
11
11
  "Deepseek V4 Pro",
12
- "GLM-5.1"
12
+ "GLM-5.2"
13
13
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tarsk",
3
- "version": "0.5.40",
3
+ "version": "0.5.41",
4
4
  "description": "CLI for Tarsk - Project Threads Manager",
5
5
  "keywords": [
6
6
  "cli",