tarsk 0.4.26 → 0.4.27

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 (71) hide show
  1. package/dist/index.js +197 -51
  2. package/dist/public/assets/account-view-BFhjAYmz.js +1 -0
  3. package/dist/public/assets/alert-dialog--tUzAWFm.js +1 -0
  4. package/dist/public/assets/api-BBbysRIh.js +1 -0
  5. package/dist/public/assets/{browser-tab-BNkQAd5u.js → browser-tab-DlzO5cMP.js} +1 -1
  6. package/dist/public/assets/chat-input-container-B_qVOGzW.js +21 -0
  7. package/dist/public/assets/context-menu-D5slxFcc.js +1 -0
  8. package/dist/public/assets/conversation-history-view-B4zHwyrw.js +1 -0
  9. package/dist/public/assets/{dialogs-config-BEsTbY1C.js → dialogs-config-DZFG2IQM.js} +3 -3
  10. package/dist/public/assets/diff-view-fOVqrHQW.js +3 -0
  11. package/dist/public/assets/explorer-tab-view-MLrWJ1Y0.js +2 -0
  12. package/dist/public/assets/{explorer-tree-KuYjR6r9.js → explorer-tree-8TyBYuC7.js} +1 -1
  13. package/dist/public/assets/{explorer-view-Cj6fyxMP.js → explorer-view-5U70mfAJ.js} +1 -1
  14. package/dist/public/assets/history-view-BR8scGnM.js +1 -0
  15. package/dist/public/assets/index-0BuHfewk.css +1 -0
  16. package/dist/public/assets/index-BTbiyooe.js +37 -0
  17. package/dist/public/assets/mcp-server-card-DupwHcKT.js +1 -0
  18. package/dist/public/assets/onboarding-Cn5RqOCa.js +1 -0
  19. package/dist/public/assets/onboarding-dialog-BXsvjU1t.js +1 -0
  20. package/dist/public/assets/{page-toolbar-DM-x5q1_.js → page-toolbar-TvYsDwUY.js} +1 -1
  21. package/dist/public/assets/{project-settings-view-wkrbmymL.js → project-settings-view-C7GW_R0m.js} +1 -1
  22. package/dist/public/assets/providers-list-view-AVt5I1WB.js +1 -0
  23. package/dist/public/assets/radio-group-Mifbn8sU.js +1 -0
  24. package/dist/public/assets/react-vendor-Bao-KYKs.js +22 -0
  25. package/dist/public/assets/resizable-DzrIos_Y.js +1 -0
  26. package/dist/public/assets/{run-stop-button-CZ62jJDn.js → run-stop-button-k1LeM0M-.js} +2 -2
  27. package/dist/public/assets/settings-instructions-view-CgfWSPmK.js +1 -0
  28. package/dist/public/assets/settings-mcp-servers-view-Becs_RxN.js +5 -0
  29. package/dist/public/assets/settings-models-view-BqdD_7GR.js +1 -0
  30. package/dist/public/assets/settings-rules-view-D7j5OHUi.js +8 -0
  31. package/dist/public/assets/settings-skills-view-aPv03-bO.js +2 -0
  32. package/dist/public/assets/settings-slash-commands-view-DLMWXQXA.js +1 -0
  33. package/dist/public/assets/settings-subagents-view-DBYzNE4W.js +2 -0
  34. package/dist/public/assets/settings-view-CccwUKkf.js +2 -0
  35. package/dist/public/assets/{side-panel-container-DVnN8vFb.js → side-panel-container-oMcXib2A.js} +2 -2
  36. package/dist/public/assets/skeleton-Bc0U0oGc.js +1 -0
  37. package/dist/public/assets/{standard-list-item-ByRgCvKd.js → standard-list-item-D2lbPXa1.js} +1 -1
  38. package/dist/public/assets/{store-Dyy2UFdD.js → store-CwvBC-YP.js} +1 -1
  39. package/dist/public/assets/{tab-context-DBrXMyNd.js → tab-context-CCvlrC0o.js} +1 -1
  40. package/dist/public/assets/{tabs-DxQZhlZp.js → tabs-Mb_cjIfE.js} +1 -1
  41. package/dist/public/assets/{terminal-panel-COYGYBV5.js → terminal-panel-GuO2XygM.js} +2 -2
  42. package/dist/public/assets/{textarea-CUYwgm5q.js → textarea-DpXOZLt8.js} +1 -1
  43. package/dist/public/assets/todos-view-C4GMi1Np.js +1 -0
  44. package/dist/public/assets/{use-toast-BqYP6xbg.js → use-toast-DqmC-mB5.js} +1 -1
  45. package/dist/public/assets/{utils-BavofGRh.js → utils-Cy2s2TEb.js} +1 -1
  46. package/dist/public/assets/whisper-wasm-Clnf-l-9.js +2 -0
  47. package/dist/public/index.html +21 -20
  48. package/dist/public/wasm/libmain-CWYJvMY5.js +3318 -0
  49. package/dist/public/wasm/libmain-D9-QM3iM.mjs +3301 -0
  50. package/package.json +4 -3
  51. package/dist/public/assets/account-view-g3bIVa-z.js +0 -1
  52. package/dist/public/assets/alert-dialog-DXEB8gMn.js +0 -1
  53. package/dist/public/assets/api-DQLZE-zX.js +0 -1
  54. package/dist/public/assets/chat-input-container-C8o4YcJZ.js +0 -1
  55. package/dist/public/assets/context-menu-CThafUml.js +0 -1
  56. package/dist/public/assets/conversation-history-view-64T6FDPb.js +0 -1
  57. package/dist/public/assets/diff-view-DgR-WEkB.js +0 -3
  58. package/dist/public/assets/explorer-tab-view-B53xe5xM.js +0 -2
  59. package/dist/public/assets/history-view-_L50vkTM.js +0 -1
  60. package/dist/public/assets/index-CAoVFXj2.css +0 -1
  61. package/dist/public/assets/index-Q5OqmtNF.js +0 -50
  62. package/dist/public/assets/onboarding-C_q_uRK0.js +0 -1
  63. package/dist/public/assets/onboarding-dialog-Cum5S2wE.js +0 -1
  64. package/dist/public/assets/provider-details-view-jc3yYdzr.js +0 -1
  65. package/dist/public/assets/providers-sidebar-B796hXzU.js +0 -1
  66. package/dist/public/assets/react-vendor-QkuITxN7.js +0 -17
  67. package/dist/public/assets/resizable-GT3fWOfA.js +0 -1
  68. package/dist/public/assets/settings-view-BbL7i34u.js +0 -2
  69. package/dist/public/assets/todos-view-DB99PEKH.js +0 -1
  70. /package/dist/public/assets/{dist-CIGnaqp2.js → dist-BI23Ei33.js} +0 -0
  71. /package/dist/public/assets/{monaco-c-HyCuEi.js → monaco-DDfTQM3i.js} +0 -0
@@ -0,0 +1 @@
1
+ import{Ai as e,Dr as t,Jn as n,_a as r}from"./dialogs-config-DZFG2IQM.js";import{A as i,M as a,j as o}from"./react-vendor-Bao-KYKs.js";var s=r(),c=t(),l=e=>{let t=(0,s.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=n(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,r),t[3]=r,t[4]=a);let l;return t[5]!==i||t[6]!==a?(l=(0,c.jsx)(o,{className:a,...i}),t[5]=i,t[6]=a,t[7]=l):l=t[7],l},u=i,d=t=>{let r=(0,s.c)(12),i,o,l;r[0]===t?(i=r[1],o=r[2],l=r[3]):({withHandle:l,className:i,...o}=t,r[0]=t,r[1]=i,r[2]=o,r[3]=l);let u;r[4]===i?u=r[5]:(u=n(`relative flex w-px items-center justify-center bg-transparent after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90`,i),r[4]=i,r[5]=u);let d;r[6]===l?d=r[7]:(d=l&&(0,c.jsx)(`div`,{className:`hidden z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border`,children:(0,c.jsx)(e,{className:`h-2.5 w-2.5`})}),r[6]=l,r[7]=d);let f;return r[8]!==o||r[9]!==u||r[10]!==d?(f=(0,c.jsx)(a,{className:u,...o,children:d}),r[8]=o,r[9]=u,r[10]=d,r[11]=f):f=r[11],f};export{u as n,l as r,d as t};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Cr as t,Pn as n,Vr as r,Wt as i,da as a,ei as o,gi as s,ln as c,sn as l}from"./dialogs-config-BEsTbY1C.js";import{a as u,o as d,t as f}from"./store-Dyy2UFdD.js";import{c as p,l as m,s as h,u as g}from"./history-view-_L50vkTM.js";import{t as _}from"./use-toast-BqYP6xbg.js";import{n as v}from"./tab-context-DBrXMyNd.js";var y=e(a(),1);function b(){let{state:e}=u(),{selectedThreadId:t}=e,{dispatch:n}=d(t),{setActiveMainTab:r,setDevServerUrl:i,setDevServerRunning:a,setDevServerLoading:o}=v();return{startServer:async e=>{if(!e?.runCommand||!e?.projectId)return;o(!0),n({type:f.ClearTerminalOutput}),n({type:f.SetTerminalOpen,open:!1}),n({type:f.AppendTerminalLine,line:{type:`system`,content:`Starting dev server: ${e.runCommand}`}});let s=!1,c=setTimeout(()=>{s=!0,n({type:f.SetTerminalOpen,open:!0})},3e3);try{let u=await l(e.projectId,t??void 0);if(!u){clearTimeout(c),n({type:f.AppendTerminalLine,line:{type:`error`,content:`Failed to start dev server`}}),o(!1);return}let d=u.getReader(),p=new TextDecoder;a(!0),o(!1);let m=!1,h=!1;for(;;){let{done:e,value:t}=await d.read();if(e)break;let a=p.decode(t,{stream:!0});try{let e=a.split(`
2
- `).filter(e=>e.trim());for(let t of e)try{let e=JSON.parse(t);h||(h=!0,o(!1)),e.type===`url`&&e.url&&(clearTimeout(c),n({type:f.AppendTerminalLine,line:{type:`system`,content:`✓ Server running at: ${e.url}`}}),i(e.url),r(`browser`),s&&setTimeout(()=>{n({type:f.SetTerminalOpen,open:!1})},100),m=!0)}catch{}}catch{}}m||n({type:f.AppendTerminalLine,line:{type:`system`,content:`Server is running but URL could not be detected`}})}catch(e){console.error(`Failed to start dev server:`,e),o(!1),n({type:f.AppendTerminalLine,line:{type:`error`,content:`Failed to start dev server`}})}},setServerUrl:i}}var x=t();function S({projectId:e,runCommand:t,large:a}){let{state:l}=u(),{selectedThreadId:S}=l,{dispatch:C}=d(S),{setDevServerUrl:w,devServerRunning:T,setDevServerRunning:E,devServerLoading:D,setDevServerLoading:O}=v(),{startServer:k}=b(),A=(0,y.useRef)(!1);(0,y.useEffect)(()=>{(async()=>{try{E((await i(e)).isRunning)}catch{E(!1)}})()},[e]);let j=()=>{k({projectId:e,runCommand:t||``})},M=async()=>{A.current=!0,O(!0);try{await c(e),E(!1),w(null),C({type:f.AppendTerminalLine,line:{type:`system`,content:`Server stopped`}})}catch(e){let t=e instanceof Error?e.message:`Failed to stop dev server`;C({type:f.AppendTerminalLine,line:{type:`error`,content:t}}),_({title:`Error`,description:t,variant:`destructive`})}finally{O(!1)}},N=!!t;return a?(0,x.jsxs)(`button`,{onClick:T?M:j,disabled:D||!T&&!N,className:`flex flex-col items-center gap-3 group disabled:opacity-40 disabled:cursor-not-allowed ${T?`text-orange-500`:`text-muted-foreground`}`,children:[D?(0,x.jsx)(s,{className:`h-10 w-10 animate-spin`}):T?(0,x.jsx)(r,{className:`h-10 w-10 fill-current`}):(0,x.jsx)(o,{className:`h-10 w-10 fill-current group-hover:text-foreground transition-colors`}),(0,x.jsx)(`span`,{className:`text-sm group-hover:text-foreground transition-colors`,children:D?`Starting...`:T?`Stop dev server`:`Start dev server`})]}):(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(m,{children:(0,x.jsxs)(h,{children:[(0,x.jsx)(g,{asChild:!0,children:(0,x.jsxs)(n,{variant:`ghost`,size:`icon`,className:`h-8 w-8 ${T?`text-orange-500 bg-orange-500/10`:`text-muted-foreground`}`,onClick:T?M:j,disabled:D||!T&&!N,children:[D?(0,x.jsx)(s,{className:`h-4 w-4 animate-spin`}):T?(0,x.jsx)(r,{className:`h-4 w-4 fill-current`}):(0,x.jsx)(o,{className:`h-4 w-4`}),(0,x.jsx)(`span`,{className:`sr-only`,children:T?`Stop dev server`:`Start dev server`})]})}),(0,x.jsx)(p,{children:T?`Stop dev server`:N?`Start dev server: ${t}`:`Set run command in project settings`})]})})})}export{b as n,S as t};
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Rn as n,Si as r,fn as i,oi as a,qr as o,qt as s,un as c,ya as l}from"./dialogs-config-DZFG2IQM.js";import{a as u,o as d,t as f}from"./store-CwvBC-YP.js";import{c as p,l as m,s as h,u as g}from"./history-view-BR8scGnM.js";import{t as _}from"./use-toast-DqmC-mB5.js";import{n as v}from"./tab-context-CCvlrC0o.js";var y=e(l(),1);function b(){let{state:e}=u(),{selectedThreadId:t}=e,{dispatch:n}=d(t),{setActiveMainTab:r,setDevServerUrl:i,setDevServerRunning:a,setDevServerLoading:o}=v();return{startServer:async e=>{if(!e?.runCommand||!e?.projectId)return;o(!0),n({type:f.ClearTerminalOutput}),n({type:f.SetTerminalOpen,open:!1}),n({type:f.AppendTerminalLine,line:{type:`system`,content:`Starting dev server: ${e.runCommand}`}});let s=!1,l=setTimeout(()=>{s=!0,n({type:f.SetTerminalOpen,open:!0})},3e3);try{let u=await c(e.projectId,t??void 0);if(!u){clearTimeout(l),n({type:f.AppendTerminalLine,line:{type:`error`,content:`Failed to start dev server`}}),o(!1);return}let d=u.getReader(),p=new TextDecoder;a(!0),o(!1);let m=!1,h=!1;for(;;){let{done:e,value:t}=await d.read();if(e)break;let a=p.decode(t,{stream:!0});try{let e=a.split(`
2
+ `).filter(e=>e.trim());for(let t of e)try{let e=JSON.parse(t);h||(h=!0,o(!1)),e.type===`url`&&e.url&&(clearTimeout(l),n({type:f.AppendTerminalLine,line:{type:`system`,content:`✓ Server running at: ${e.url}`}}),i(e.url),r(`browser`),s&&setTimeout(()=>{n({type:f.SetTerminalOpen,open:!1})},100),m=!0)}catch{}}catch{}}m||n({type:f.AppendTerminalLine,line:{type:`system`,content:`Server is running but URL could not be detected`}})}catch(e){console.error(`Failed to start dev server:`,e),o(!1),n({type:f.AppendTerminalLine,line:{type:`error`,content:`Failed to start dev server`}})}},setServerUrl:i}}var x=t();function S({projectId:e,runCommand:t,large:c}){let{state:l}=u(),{selectedThreadId:S}=l,{dispatch:C}=d(S),{setDevServerUrl:w,devServerRunning:T,setDevServerRunning:E,devServerLoading:D,setDevServerLoading:O}=v(),{startServer:k}=b(),A=(0,y.useRef)(!1);(0,y.useEffect)(()=>{(async()=>{try{E((await s(e)).isRunning)}catch{E(!1)}})()},[e]);let j=()=>{k({projectId:e,runCommand:t||``})},M=async()=>{A.current=!0,O(!0);try{await i(e),E(!1),w(null),C({type:f.AppendTerminalLine,line:{type:`system`,content:`Server stopped`}})}catch(e){let t=e instanceof Error?e.message:`Failed to stop dev server`;C({type:f.AppendTerminalLine,line:{type:`error`,content:t}}),_({title:`Error`,description:t,variant:`destructive`})}finally{O(!1)}},N=!!t;return c?(0,x.jsxs)(`button`,{onClick:T?M:j,disabled:D||!T&&!N,className:`flex flex-col items-center gap-3 group disabled:opacity-40 disabled:cursor-not-allowed ${T?`text-orange-500`:`text-muted-foreground`}`,children:[D?(0,x.jsx)(r,{className:`h-10 w-10 animate-spin`}):T?(0,x.jsx)(o,{className:`h-10 w-10 fill-current`}):(0,x.jsx)(a,{className:`h-10 w-10 fill-current group-hover:text-foreground transition-colors`}),(0,x.jsx)(`span`,{className:`text-sm group-hover:text-foreground transition-colors`,children:D?`Starting...`:T?`Stop dev server`:`Start dev server`})]}):(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(m,{children:(0,x.jsxs)(h,{children:[(0,x.jsx)(g,{asChild:!0,children:(0,x.jsxs)(n,{variant:`ghost`,size:`icon`,className:`h-8 w-8 ${T?`text-orange-500 bg-orange-500/10`:`text-muted-foreground`}`,onClick:T?M:j,disabled:D||!T&&!N,children:[D?(0,x.jsx)(r,{className:`h-4 w-4 animate-spin`}):T?(0,x.jsx)(o,{className:`h-4 w-4 fill-current`}):(0,x.jsx)(a,{className:`h-4 w-4`}),(0,x.jsx)(`span`,{className:`sr-only`,children:T?`Stop dev server`:`Start dev server`})]})}),(0,x.jsx)(p,{children:T?`Stop dev server`:N?`Start dev server: ${t}`:`Set run command in project settings`})]})})})}export{b as n,S as t};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{At as t,Dr as n,Rn as r,Si as i,sn as a,ya as o}from"./dialogs-config-DZFG2IQM.js";import{a as s}from"./store-CwvBC-YP.js";import{t as c}from"./textarea-DpXOZLt8.js";import{t as l}from"./use-toast-DqmC-mB5.js";var u=e(o(),1),d=n();function f(){let{state:e}=s(),{selectedThreadId:n}=e,[o,f]=(0,u.useState)(``),[p,m]=(0,u.useState)(!1),[h,g]=(0,u.useState)(!1);(0,u.useEffect)(()=>{n&&(m(!0),t(n,`AGENTS.md`).then(e=>f(e.content)).catch(()=>f(``)).finally(()=>m(!1)))},[n]);async function _(){if(n){g(!0);try{await a(n,`AGENTS.md`,o),l({title:`Instructions saved`})}catch(e){l({title:`Error`,description:e instanceof Error?e.message:`Failed to save instructions`,variant:`destructive`})}finally{g(!1)}}}return n?(0,d.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:(0,d.jsxs)(`div`,{className:`mx-auto flex min-h-0 w-full max-w-4xl flex-1 flex-col p-6`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-6 shrink-0`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Instructions`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Add context like coding guidelines and expectations that are relevant for all conversations. This is stored in the AGENTS.md file.`})]}),(0,d.jsx)(r,{onClick:_,disabled:p||h,children:h?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`})]}),p?(0,d.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,d.jsx)(i,{className:`h-8 w-8 animate-spin text-muted-foreground`})}):(0,d.jsx)(c,{value:o,onChange:e=>f(e.target.value),className:`flex-1 font-mono text-sm resize-none`,placeholder:`Add instructions for your agent in AGENTS.md...`,disabled:h})]})}):(0,d.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Select a thread to edit instructions.`})})}export{f as SettingsInstructionsView,f as default};
@@ -0,0 +1,5 @@
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$r as t,Dr as n,Fn as r,Hn as i,I as a,Ln as o,Nr as s,Rn as c,Un as l,Vr as u,_a as d,ai as f,an as p,ei as m,ht as h,n as g,r as _,si as v,ut as y,ya as b}from"./dialogs-config-DZFG2IQM.js";import{a as x}from"./store-CwvBC-YP.js";import{t as S}from"./textarea-DpXOZLt8.js";import{c as C,l as w,s as T,u as E}from"./history-view-BR8scGnM.js";import{t as D}from"./use-toast-DqmC-mB5.js";import{a as O,c as k,i as A,n as j,o as ee,r as M,s as N,t as P}from"./alert-dialog--tUzAWFm.js";import{n as F}from"./tab-context-CCvlrC0o.js";import{t as I}from"./skeleton-Bc0U0oGc.js";import{t as L}from"./mcp-server-card-DupwHcKT.js";var R=d(),z=e(b(),1);function B(e){let[t,n]=(0,z.useState)([]),[r,i]=(0,z.useState)(!1),a=(0,z.useCallback)(async()=>{if(e){i(!0);try{let t=await y(e);n(Object.entries(t.servers??{}).map(([e,t])=>({name:e,config:t})))}catch{n([])}finally{i(!1)}}},[e]);return(0,z.useEffect)(()=>{a()},[a]),{installedServers:t,loadingConfig:r,loadInstalledServers:a}}function V(){let e=(0,R.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,z.useState)(t),i,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{h().then(r).catch(()=>r([]))},a=[],e[1]=i,e[2]=a):(i=e[1],a=e[2]),(0,z.useEffect)(i,a);let o;return e[3]===n?o=e[4]:(o={popularServers:n},e[3]=n,e[4]=o),o}async function H(e,t,n){await p(e,t,n)}async function U(e,t){await a(e,t)}var W=n();function G({projectPath:e,serverName:t,onBack:n}){let{installedServers:i}=B(e),a=!!t,[l,u]=(0,z.useState)(``),[d,p]=(0,z.useState)(``),[m,h]=(0,z.useState)(``),[g,_]=(0,z.useState)([]),[v,y]=(0,z.useState)(!1),[b,x]=(0,z.useState)(!1),[C,w]=(0,z.useState)(null),[T,E]=(0,z.useState)(a),[O,k]=(0,z.useState)(``),[A,j]=(0,z.useState)(``),[ee,M]=(0,z.useState)(``),[N,P]=(0,z.useState)([]);(0,z.useEffect)(()=>{if(a&&t){let e=i.find(e=>e.name===t);if(e){u(e.name),p(e.config.command);let t=e.config.args.join(`
2
+ `);h(t);let n=Object.entries(e.config.env??{}).map(([e,t])=>({key:e,value:t}));_(n),k(e.name),j(e.config.command),M(t),P(n),E(!1)}}else E(!1)},[i,t,a]);let F=(0,z.useCallback)(()=>{_(e=>[...e,{key:``,value:``}])},[]),I=(0,z.useCallback)(e=>{_(t=>t.filter((t,n)=>n!==e))},[]),L=(0,z.useCallback)((e,t)=>{_(n=>n.map((n,r)=>r===e?{...n,key:t}:n))},[]),R=(0,z.useCallback)((e,t)=>{_(n=>n.map((n,r)=>r===e?{...n,value:t}:n))},[]),V=()=>{let e=m.split(`
3
+ `).map(e=>e.trim()).filter(Boolean),t={};for(let{key:e,value:n}of g)e.trim()&&(t[e.trim()]=n);return{command:d.trim(),args:e,...Object.keys(t).length>0?{env:t}:{}}},G=async()=>{w(null);let t=l.trim(),r=d.trim();if(!t){w(`Server name is required`);return}if(!r){w(`Command is required`);return}y(!0);try{if(!e)throw Error(`No project path`);await H(e,O||t,V()),D({title:`Success`,description:a?`MCP server configuration saved`:`MCP server added`}),n()}catch(e){w(e instanceof Error?e.message:`Failed to save server`)}finally{y(!1)}},K=async()=>{if(e){x(!0);try{await U(e,O),D({title:`Success`,description:`MCP server removed`}),n()}catch(e){w(e instanceof Error?e.message:`Failed to delete server`)}finally{x(!1)}}},q=a?d!==A||m!==ee||JSON.stringify(g)!==JSON.stringify(N):l.trim()!==``||d.trim()!==``||m.trim()!==``||g.length>0;return T?(0,W.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading server configuration...`})}):(0,W.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,W.jsxs)(`div`,{className:`mb-6`,children:[(0,W.jsx)(`h1`,{className:`text-2xl font-bold`,children:a?l:`Add MCP Server`}),(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:a?`Edit MCP Server configuration.`:`Configure a new MCP Server.`})]}),(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(r,{htmlFor:`server-name`,children:`Server name`}),(0,W.jsx)(o,{id:`server-name`,placeholder:`e.g. filesystem`,value:l,onChange:e=>u(e.target.value),disabled:a}),a&&(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Server name cannot be changed`})]}),(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(r,{htmlFor:`server-command`,children:`Command`}),(0,W.jsx)(o,{id:`server-command`,placeholder:`e.g. npx`,value:d,onChange:e=>p(e.target.value),className:`text-sm`})]}),(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsxs)(r,{htmlFor:`server-args`,children:[`Arguments `,(0,W.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(one per line)`})]}),(0,W.jsx)(S,{id:`server-args`,placeholder:`-y
4
+ @modelcontextprotocol/server-filesystem
5
+ /path/to/dir`,value:m,onChange:e=>h(e.target.value),className:`font-mono text-xs min-h-[80px] resize-none`})]}),(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(r,{children:`Environment variables`}),(0,W.jsxs)(c,{variant:`ghost`,size:`sm`,onClick:F,className:`h-6 px-2 text-xs`,children:[(0,W.jsx)(f,{className:`h-3 w-3 mr-1`}),`Add variable`]})]}),g.length===0?(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground py-1`,children:`No environment variables configured`}):(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:g.map((e,t)=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(o,{placeholder:`KEY`,value:e.key,onChange:e=>L(t,e.target.value),className:`font-mono text-xs w-[35%]`}),(0,W.jsx)(o,{placeholder:`value`,value:e.value,onChange:e=>R(t,e.target.value),className:`font-mono text-xs flex-1`}),(0,W.jsx)(c,{variant:`ghost`,size:`icon`,onClick:()=>I(t),className:`h-9 w-9 flex-shrink-0`,children:(0,W.jsx)(s,{className:`h-3.5 w-3.5`})})]},t))})]}),C&&(0,W.jsx)(`p`,{className:`text-sm text-destructive`,children:C}),(0,W.jsxs)(`div`,{className:`border-t pt-4 flex items-center justify-between`,children:[a&&(0,W.jsx)(c,{variant:`destructive`,onClick:K,disabled:b||v,children:b?`Removing...`:`Remove`}),!a&&(0,W.jsx)(`div`,{}),(0,W.jsx)(c,{onClick:G,disabled:v||b||!q,children:v?a?`Saving...`:`Adding...`:a?`Save`:`Add`})]})]})]})}function K(e){return e.name.toLowerCase().replace(/\s+/g,`-`)}function q(){let{state:e}=x(),{selectedProjectId:n,projects:r}=e,a=r.find(e=>e.projectId===n)?.projectPath,{installedServers:s,loadingConfig:d,loadInstalledServers:f}=B(a),{popularServers:p}=V(),{setActiveMainTab:h,setPendingExplorerPath:y,triggerExplorerRefresh:b}=F(),[S,R]=(0,z.useState)(!1),[q,J]=(0,z.useState)(null),[Y,X]=(0,z.useState)(null),[Z,Q]=(0,z.useState)(!1),[$,te]=(0,z.useState)(``),ne=(0,z.useCallback)(async e=>{if(a){Q(!0);try{await U(a,e),await f(),b(),D({title:`MCP server removed`,description:e}),X(null)}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to remove server`,variant:`destructive`})}finally{Q(!1)}}},[a,f,b]),re=(0,z.useCallback)(()=>{y(`.agents/mcp.json`),h(`explorer`)},[y,h]),ie=(0,z.useCallback)(async e=>{if(!a)return;let t=K(e);if(!s.some(n=>n.name===t||n.name===e.id))try{await H(a,t,{command:e.command,args:e.args,...Object.keys(e.env??{}).length>0?{env:e.env}:{}}),await f(),b(),D({title:`MCP server installed`,description:e.name})}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to install server`,variant:`destructive`})}},[a,s,f,b]),ae=$.trim()?p.filter(e=>e.name.toLowerCase().includes($.toLowerCase())||e.description.toLowerCase().includes($.toLowerCase())):p;return n?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,W.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h1`,{className:`text-2xl font-bold`,children:`MCP Servers`}),(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage Model Context Protocol servers for your project.`})]}),(0,W.jsx)(c,{onClick:()=>R(!0),children:`Add Server`})]}),(0,W.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:`Installed MCP Servers`}),d?(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(I,{className:`h-20 w-full`}),(0,W.jsx)(I,{className:`h-20 w-full`})]}):s.length===0?(0,W.jsxs)(`div`,{className:`text-center py-12 border border-dashed rounded-lg mb-8`,children:[(0,W.jsx)(t,{className:`mx-auto h-10 w-10 text-muted-foreground/50 mb-3`}),(0,W.jsx)(`h3`,{className:`text-base font-semibold text-muted-foreground mb-1`,children:`No MCP servers installed`}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground mb-3`,children:`Add an MCP server to extend agent capabilities.`})]}):(0,W.jsx)(`div`,{className:`space-y-3 mb-8`,children:s.map(e=>(0,W.jsx)(g,{children:(0,W.jsxs)(_,{className:`flex items-center justify-between p-4`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(t,{className:`h-4 w-4 text-muted-foreground flex-shrink-0`}),(0,W.jsx)(`h3`,{className:`font-medium truncate`,children:e.name})]}),(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground mt-1 truncate font-mono`,children:[e.config.command,` `,e.config.args?.join(` `)]})]}),(0,W.jsx)(w,{delayDuration:300,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-1 ml-4 flex-shrink-0`,children:[(0,W.jsxs)(T,{children:[(0,W.jsx)(E,{asChild:!0,children:(0,W.jsx)(c,{variant:`ghost`,size:`icon-sm`,onClick:re,children:(0,W.jsx)(v,{className:`h-4 w-4`})})}),(0,W.jsx)(C,{children:`View config file`})]}),(0,W.jsxs)(T,{children:[(0,W.jsx)(E,{asChild:!0,children:(0,W.jsx)(c,{variant:`ghost`,size:`icon-sm`,onClick:()=>J(e.name),children:(0,W.jsx)(v,{className:`h-4 w-4`})})}),(0,W.jsx)(C,{children:`Edit server`})]}),(0,W.jsxs)(T,{children:[(0,W.jsx)(E,{asChild:!0,children:(0,W.jsx)(c,{variant:`ghost`,size:`icon-sm`,onClick:()=>X(e.name),children:(0,W.jsx)(u,{className:`h-4 w-4 text-destructive`})})}),(0,W.jsx)(C,{children:`Delete server`})]})]})})]})},e.name))}),(0,W.jsx)(`div`,{className:`flex items-center justify-between mb-3`,children:(0,W.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Available MCP Servers`})}),(0,W.jsxs)(`div`,{className:`relative mb-4`,children:[(0,W.jsx)(m,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,W.jsx)(o,{placeholder:`Search available servers...`,value:$,onChange:e=>te(e.target.value),className:`pl-8`})]}),p.length===0?(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(I,{className:`h-20 w-full`}),(0,W.jsx)(I,{className:`h-20 w-full`})]}):ae.length===0?(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:$.trim()?`No results for "${$}"`:`No available servers found.`}):(0,W.jsx)(`div`,{className:`grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(min(220px,100%),1fr))]`,children:ae.map(e=>{let t=K(e),n=s.some(n=>n.name===t||n.name===e.id);return(0,W.jsx)(L,{name:e.name,description:e.description,installed:n,onClick:()=>{n||ie(e)},showInstalledControls:!1},e.id)})})]})}),(0,W.jsx)(i,{open:S,onOpenChange:R,children:(0,W.jsx)(l,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,W.jsx)(G,{projectPath:a,onBack:()=>{R(!1),f(),b()}})})}),(0,W.jsx)(i,{open:q!==null,onOpenChange:e=>{e||J(null)},children:(0,W.jsx)(l,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,W.jsx)(G,{projectPath:a,serverName:q??void 0,onBack:()=>{J(null),f(),b()}})})}),(0,W.jsx)(P,{open:Y!==null,onOpenChange:e=>!e&&X(null),children:(0,W.jsxs)(A,{children:[(0,W.jsxs)(N,{children:[(0,W.jsx)(k,{children:`Delete MCP Server`}),(0,W.jsxs)(O,{children:[`Are you sure you want to delete the server "`,Y,`"? This action cannot be undone.`]})]}),(0,W.jsxs)(ee,{children:[(0,W.jsx)(M,{children:`Cancel`}),(0,W.jsx)(j,{onClick:()=>Y&&void ne(Y),disabled:Z,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:Z?`Deleting...`:`Delete`})]})]})})]}):(0,W.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Select a project to manage MCP servers.`})})}export{q as SettingsMCPServersView,q as default};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$ as t,Dr as n,Et as r,G as i,H as a,K as o,Kr as s,Ln as c,Mn as l,Rn as u,Si as d,Tt as f,U as p,W as m,Yn as h,ei as g,et as _,ga as v,q as ee,qi as y,ya as b}from"./dialogs-config-DZFG2IQM.js";import{c as x,l as S,s as C,u as w}from"./history-view-BR8scGnM.js";import{n as T,r as E}from"./onboarding-Cn5RqOCa.js";import{i as D,n as O,r as te,t as ne}from"./tabs-Mb_cjIfE.js";var k=e(b(),1),A=n();function j(){let[e,n]=(0,k.useState)([]),[b,j]=(0,k.useState)({}),[M,N]=(0,k.useState)({}),[P,F]=(0,k.useState)({}),[I,L]=(0,k.useState)({}),[R,z]=(0,k.useState)(!0),[B,V]=(0,k.useState)(``),[H,U]=(0,k.useState)(`coding`),[W,G]=(0,k.useState)(``),[K,q]=(0,k.useState)({}),[J,Y]=(0,k.useState)(``),X=e=>E(e.id);(0,k.useEffect)(()=>{(async()=>{z(!0),V(``);try{let[e,i,a]=await Promise.all([r(),_(),t()]),s=e.filter(e=>e.apiKey);n(s);let c={};s.forEach(e=>{c[e.slug]=`alphabetical`}),q(c);let l={},u={},d={},f={};await Promise.all(s.map(async e=>{try{let[t,n]=await Promise.all([ee(e.slug),o(e.slug)]);l[e.slug]=t,u[e.slug]=n;let r=new Set((i[e.slug]||[]).map(e=>e.id));d[e.slug]=r;let s=new Set((a[e.slug]||[]).map(e=>e.id));f[e.slug]=s}catch(t){console.error(`Failed to load models for ${e.slug}:`,t),l[e.slug]=[],u[e.slug]=[],d[e.slug]=new Set,f[e.slug]=new Set}})),j(l),N(u),F(d),L(f)}catch(e){V(e instanceof Error?e.message:`Failed to load models`)}finally{z(!1)}})()},[]);let Z=async(e,t,n)=>{try{n===`image`?I[e]?.has(t)?(await a(e,t),L(n=>{let r=new Set(n[e]??[]);return r.delete(t),{...n,[e]:r}})):(await m(e,t),L(n=>({...n,[e]:new Set([...n[e]||[],t])}))):P[e]?.has(t)?(await p(e,t),F(n=>{let r=new Set(n[e]??[]);return r.delete(t),{...n,[e]:r}})):(await i(e,t),F(n=>({...n,[e]:new Set([...n[e]||[],t])}))),Y(`Model preferences saved successfully`),setTimeout(()=>Y(``),3e3)}catch(e){Y(e instanceof Error?e.message:`Failed to save model changes`)}},Q=async(e,t,n)=>{let r=n===`image`?M[e]:b[e],i=n===`image`?I[e]:P[e];if(r)for(let a of r)i?.has(a.id)!==t&&await Z(e,a.id,n)},re=e=>e?e<20?1:e<30?2:e<40?3:e<50?4:5:0,ie=({codingIndex:e,modelName:t})=>{let n=re(e);return n===0?null:(0,A.jsx)(S,{children:(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(`div`,{className:`flex items-center gap-0.5`,children:[1,2,3,4,5].map(e=>(0,A.jsx)(s,{className:`h-3 w-3 ${e<=n?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},e))})}),(0,A.jsx)(x,{children:(0,A.jsxs)(`p`,{className:`text-sm`,children:[t,` was indexed `,e,` for coding intelligence`]})})]})})},$=(e,t,n)=>{let r=W.toLowerCase();return e.filter(e=>{let t=X(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 X(e).localeCompare(X(r))})};return R?(0,A.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,A.jsx)(d,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):B?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center h-full`,children:(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-sm text-destructive mb-2`,children:B}),(0,A.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>window.location.reload(),children:`Retry`})]})}):e.length===0?(0,A.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Providers Configured`}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure a provider with an API key to view available models.`})]})}):(0,A.jsx)(l,{className:`flex-1`,children:(0,A.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[(0,A.jsxs)(`div`,{className:`mb-6`,children:[(0,A.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Models`}),(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`View and manage available models from your configured providers.`})]}),(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(g,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,A.jsx)(c,{placeholder:`Search models across all providers...`,className:`pl-10`,value:W,onChange:e=>G(e.target.value)})]}),(0,A.jsxs)(ne,{value:H,onValueChange:e=>{U(e),G(``)},children:[(0,A.jsxs)(te,{className:`mb-4`,children:[(0,A.jsx)(D,{value:`coding`,children:`Coding`}),e.some(e=>e.name.toLowerCase()===`openrouter`)&&(0,A.jsx)(D,{value:`image`,children:`Image`})]}),(0,A.jsx)(O,{value:`coding`,children:(0,A.jsx)(`div`,{className:`space-y-6`,children:e.map(e=>{let t=b[e.slug]||[],n=P[e.slug]||new Set,r=K[e.slug]||`alphabetical`,i=$(t,n,r);return i.length===0&&W?null:(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:(0,A.jsx)(`img`,{src:f(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,A.jsx)(`h3`,{className:`text-lg font-semibold`,children:e.name})]}),i.length>0&&(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(T,{id:`select-all-${e.slug}`,checked:i.every(e=>n.has(e.id)),onCheckedChange:t=>Q(e.slug,t===!0,`coding`)}),(0,A.jsx)(`label`,{htmlFor:`select-all-${e.slug}`,className:`text-sm cursor-pointer whitespace-nowrap`,children:`Select all models`})]}),(0,A.jsx)(S,{children:(0,A.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(u,{type:`button`,variant:r===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`alphabetical`})),children:(0,A.jsx)(v,{className:`h-4 w-4`})})}),(0,A.jsx)(x,{children:`Sort A–Z`})]}),(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(u,{type:`button`,variant:r===`price-low`||r===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`price-low`})),children:(0,A.jsx)(y,{className:`h-4 w-4`})})}),(0,A.jsx)(x,{children:`Sort by price`})]}),(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(u,{type:`button`,variant:r===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`coding-index`})),children:(0,A.jsx)(s,{className:`h-4 w-4`})})}),(0,A.jsx)(x,{children:`Sort by coding intelligence`})]})]})})]}),i.length===0?(0,A.jsx)(`div`,{className:`text-center py-4 border border-border rounded-md`,children:(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:W?`No models matching your search.`:`No models available for this provider.`})}):(0,A.jsx)(S,{children:(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:i.map(t=>{let i=n.has(t.id),a=t.pricing;return(0,A.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,A.jsx)(T,{id:t.id,checked:i,onCheckedChange:()=>Z(e.slug,t.id,`coding`),className:`mt-0`}),(0,A.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,A.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,A.jsx)(`label`,{htmlFor:t.id,className:`text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`,children:X(t)})}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[r===`coding-index`&&(0,A.jsx)(ie,{codingIndex:t.coding_index,modelName:X(t)}),a&&(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${h(a.prompt??0)} in | $${h(a.completion??0)} out`})]})]})]},t.id)})})})]},e.slug)})})}),(0,A.jsx)(O,{value:`image`,children:(0,A.jsx)(`div`,{className:`space-y-6`,children:e.filter(e=>e.name.toLowerCase()===`openrouter`).map(e=>{let t=M[e.slug]||[],n=I[e.slug]||new Set,r=K[e.slug]||`alphabetical`,i=$(t,n,r);return i.length===0&&W?null:(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:(0,A.jsx)(`img`,{src:f(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,A.jsx)(`h3`,{className:`text-lg font-semibold`,children:e.name})]}),i.length>0&&(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(T,{id:`select-all-image-${e.slug}`,checked:i.every(e=>n.has(e.id)),onCheckedChange:t=>Q(e.slug,t===!0,`image`)}),(0,A.jsx)(`label`,{htmlFor:`select-all-image-${e.slug}`,className:`text-sm cursor-pointer whitespace-nowrap`,children:`Select all models`})]}),(0,A.jsx)(S,{children:(0,A.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(u,{type:`button`,variant:r===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`alphabetical`})),children:(0,A.jsx)(v,{className:`h-4 w-4`})})}),(0,A.jsx)(x,{children:`Sort A–Z`})]}),(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(u,{type:`button`,variant:r===`price-low`||r===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`price-low`})),children:(0,A.jsx)(y,{className:`h-4 w-4`})})}),(0,A.jsx)(x,{children:`Sort by price`})]})]})})]}),i.length===0?(0,A.jsx)(`div`,{className:`text-center py-4 border border-border rounded-md`,children:(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:W?`No models matching your search.`:`No image models available for this provider.`})}):(0,A.jsx)(S,{children:(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:i.map(t=>{let r=n.has(t.id),i=t.pricing;return(0,A.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,A.jsx)(T,{id:`image-${t.id}`,checked:r,onCheckedChange:()=>Z(e.slug,t.id,`image`),className:`mt-0`}),(0,A.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,A.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,A.jsx)(`label`,{htmlFor:`image-${t.id}`,className:`text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`,children:X(t)})}),i&&(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap flex-shrink-0`,children:(i.prompt??0)===0&&(i.completion??0)===0?``:`$${h(i.prompt??0)} in | $${h(i.completion??0)} out`})]})]},t.id)})})})]},e.slug)})})})]}),J&&(0,A.jsx)(`div`,{className:`text-sm p-2 rounded-md ${J.includes(`error`)||J.includes(`Failed`)?`text-destructive bg-destructive/10`:`text-green-600 bg-green-50`}`,children:J})]})]})})}export{j as SettingsModelsView,j as default};
@@ -0,0 +1,8 @@
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Fn as n,Gt as r,Hn as i,Jn as a,Ln as o,R as s,Rn as c,Si as l,Un as u,V as d,Vi as f,Vr as p,_a as m,aa as h,ei as g,gt as _,jt as v,n as y,r as b,sn as x,ti as S,xt as ee,ya as C}from"./dialogs-config-DZFG2IQM.js";import{n as w,t as T}from"./react-vendor-Bao-KYKs.js";import{a as te}from"./store-CwvBC-YP.js";import{t as E}from"./textarea-DpXOZLt8.js";import{t as D}from"./use-toast-DqmC-mB5.js";import{a as ne,c as re,i as O,n as k,o as A,r as j,s as M,t as N}from"./alert-dialog--tUzAWFm.js";import{n as P}from"./tab-context-CCvlrC0o.js";import{t as F}from"./skeleton-Bc0U0oGc.js";import{t as I}from"./mcp-server-card-DupwHcKT.js";import{n as L,t as R}from"./radio-group-Mifbn8sU.js";var z=m(),B=e(C(),1),V=t(),H=B.forwardRef((e,t)=>{let n=(0,z.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 o;n[3]===r?o=n[4]:(o=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]=o);let s;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(w,{className:a(`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]=s):s=n[5];let c;return n[6]!==i||n[7]!==t||n[8]!==o?(c=(0,V.jsx)(T,{className:o,...i,ref:t,children:s}),n[6]=i,n[7]=t,n[8]=o,n[9]=c):c=n[9],c});H.displayName=T.displayName;function U({threadId:e,onRuleCreated:t}){let[r,i]=(0,B.useState)(``),[a,s]=(0,B.useState)(``),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(`local`),[m,g]=(0,B.useState)(!1),_=r.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),v=_.length>0&&_.length<=64;return e?(0,V.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,V.jsxs)(`div`,{className:`mb-6`,children:[(0,V.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Rule`}),(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new agent rule. The rule will be saved as a .md file in the .agents/rules folder.`})]}),(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(n,{htmlFor:`ruleName`,children:`Rule Name`}),(0,V.jsx)(o,{id:`ruleName`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. Code Style Guide`,disabled:m}),r&&(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`File name: `,(0,V.jsxs)(`span`,{className:`font-mono`,children:[_||`...`,`.md`]})]})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(n,{htmlFor:`ruleDescription`,children:`Description`}),(0,V.jsx)(E,{id:`ruleDescription`,value:a,onChange:e=>s(e.target.value),placeholder:`Describe when Tarsk should apply this rule...`,className:`resize-none min-h-[120px]`,disabled:m})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(n,{htmlFor:`alwaysApply`,children:`Always Apply`}),(0,V.jsx)(H,{id:`alwaysApply`,checked:u,onCheckedChange:d,disabled:m})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u?`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.`})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(n,{children:`Scope`}),(0,V.jsxs)(R,{value:f,onValueChange:e=>p(e),className:`flex gap-4`,disabled:m,children:[(0,V.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,V.jsx)(L,{value:`local`,id:`scope-local`}),(0,V.jsx)(n,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,V.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,V.jsx)(L,{value:`global`,id:`scope-global`,disabled:!0}),(0,V.jsx)(n,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f===`local`?`This rule will only be available for this project.`:`This rule will be available across all projects (coming soon).`})]}),(0,V.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,V.jsx)(c,{onClick:async()=>{if(!(!v||!e)){g(!0);try{let n=`---
2
+ description: ${a.trim()}
3
+ alwaysApply: ${u}
4
+ ---
5
+
6
+ Place your rule instructions here as markdown.
7
+ `;await x(e,`.agents/rules/${_}.md`,n),D({title:`Rule created`,description:`Rule '${_}' was created successfully.`}),i(``),s(``),d(!1),p(`local`),t?.(_)}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to create rule`,variant:`destructive`})}finally{g(!1)}}},disabled:!v||!a.trim()||m,children:m?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,V.jsxs)(V.Fragment,{children:[`Continue`,(0,V.jsx)(h,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,V.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,V.jsxs)(`div`,{className:`text-center`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add a rule.`})]})})}function W(e){let t=[];for(let n of e)n.type===`file`&&n.path.startsWith(`.agents/rules/`)&&t.push(n),n.children&&n.children.length>0&&t.push(...W(n.children));return t}function G(){let{state:e}=te(),{selectedProjectId:t,selectedThreadId:n}=e,{setActiveMainTab:a,setPendingExplorerPath:l,triggerExplorerRefresh:m,setExplorerClearPath:h}=P(),[C,w]=(0,B.useState)([]),[T,E]=(0,B.useState)(!1),[L,R]=(0,B.useState)(!1),[z,H]=(0,B.useState)(null),[G,K]=(0,B.useState)(!1),[q,J]=(0,B.useState)([]),[Y,X]=(0,B.useState)(new Set),[Z,ie]=(0,B.useState)(``),Q=(0,B.useCallback)(async()=>{if(t){E(!0);try{let e=W(await ee(t));if(n)try{let t=W(await v(n)),r=new Set(e.map(e=>e.path));for(let n of t)r.has(n.path)||e.push(n)}catch{}w(e),X(new Set(e.map(e=>e.path)))}catch{w([]),X(new Set)}finally{E(!1)}}},[t,n]);(0,B.useEffect)(()=>{Q()},[Q]),(0,B.useEffect)(()=>{_().then(J).catch(()=>J([]))},[]);let ae=(0,B.useCallback)(async e=>{if(!t)return;let r=e.name,i=e.path;K(!0);try{try{await s(t,i)}catch{if(n)await d(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),t}),D({title:`Rule removed`,description:r}),H(null),await Q()}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to remove rule`,variant:`destructive`})}finally{K(!1)}},[t,n,Q,m,h]),oe=(0,B.useCallback)(e=>{l(e),a(`explorer`)},[l,a]),se=(0,B.useCallback)(async e=>{let t=`.agents/rules/${e.name}.md`;if(!(!n||Y.has(t)))try{e.gitHubRepo&&e.gitHubFolder?await r(n,e.gitHubRepo,e.gitHubFolder,`.agents/rules`):await x(n,t,[`---`,`description: ${e.description}`,`alwaysApply: ${e.alwaysApply??!1}`,`---`,``,e.content].join(`
8
+ `)),X(e=>new Set(e).add(t)),m(),Q(),D({title:`Rule installed`,description:e.name})}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to install rule`,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 t?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Rules`}),(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage agent rules. Rules define coding standards and project-wide guidelines.`})]}),(0,V.jsx)(c,{onClick:()=>R(!0),disabled:!n,children:`Add Rule`})]}),!n&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to add rules to your project.`}),(0,V.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:`Installed Rules`}),T?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(F,{className:`h-20 w-full`}),(0,V.jsx)(F,{className:`h-20 w-full`})]}):C.length===0?(0,V.jsxs)(`div`,{className:`text-center py-12 border border-dashed rounded-lg mb-8`,children:[(0,V.jsx)(S,{className:`mx-auto h-10 w-10 text-muted-foreground/50 mb-3`}),(0,V.jsx)(`h3`,{className:`text-base font-semibold text-muted-foreground mb-1`,children:`No rules installed`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mb-3`,children:`Add rules to enforce coding standards and project conventions.`})]}):(0,V.jsx)(`div`,{className:`space-y-3 mb-8`,children:C.map(e=>(0,V.jsx)(y,{children:(0,V.jsxs)(b,{className:`flex items-center justify-between p-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(S,{className:`h-4 w-4 text-muted-foreground flex-shrink-0`}),(0,V.jsx)(`h3`,{className:`font-medium truncate`,children:e.name})]}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 truncate font-mono`,children:e.path})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1 ml-4 flex-shrink-0`,children:[(0,V.jsx)(c,{variant:`ghost`,size:`icon-sm`,onClick:()=>oe(e.path),title:`View in explorer`,children:(0,V.jsx)(f,{className:`h-4 w-4`})}),(0,V.jsx)(c,{variant:`ghost`,size:`icon-sm`,onClick:()=>H(e),title:`Delete rule`,children:(0,V.jsx)(p,{className:`h-4 w-4 text-destructive`})})]})]})},e.id))}),(0,V.jsx)(`div`,{className:`flex items-center justify-between mb-3`,children:(0,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Available Rules`})}),!n&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to install rules into your project.`}),(0,V.jsxs)(`div`,{className:`relative mb-4`,children:[(0,V.jsx)(g,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,V.jsx)(o,{placeholder:`Search available rules...`,value:Z,onChange:e=>ie(e.target.value),className:`pl-8`})]}),q.length===0?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(F,{className:`h-20 w-full`}),(0,V.jsx)(F,{className:`h-20 w-full`})]}):$.length===0?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:Z.trim()?`No results for "${Z}"`:`No available rules found.`}):(0,V.jsx)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(min(220px, 100%), 1fr))`},children:$.map(e=>{let t=`.agents/rules/${e.name}.md`,n=Y.has(t);return(0,V.jsx)(I,{name:e.name,description:e.description,installed:n,onClick:()=>{n||se(e)},showInstalledControls:!1},e.id)})})]})}),(0,V.jsx)(i,{open:L,onOpenChange:R,children:(0,V.jsx)(u,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,V.jsx)(U,{threadId:n,onRuleCreated:()=>{R(!1),Q(),m()}})})}),(0,V.jsx)(N,{open:z!==null,onOpenChange:e=>!e&&H(null),children:(0,V.jsxs)(O,{children:[(0,V.jsxs)(M,{children:[(0,V.jsx)(re,{children:`Delete Rule`}),(0,V.jsxs)(ne,{children:[`Are you sure you want to delete the rule "`,z?.name,`"? This action cannot be undone.`]})]}),(0,V.jsxs)(A,{children:[(0,V.jsx)(j,{children:`Cancel`}),(0,V.jsx)(k,{onClick:()=>z&&void ae(z),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,V.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:`Select a project to manage rules.`})})}export{G as SettingsRulesView,G as default};
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Fn as n,Fr as r,Gt as i,Hn as a,Ln as o,P as s,R as c,Rn as l,Si as u,Un as d,V as f,Vi as p,Vr as m,_t as h,aa as g,ei as _,jt as v,n as y,r as b,sn as x,xt as S,ya as C}from"./dialogs-config-DZFG2IQM.js";import{a as w}from"./store-CwvBC-YP.js";import{t as T}from"./textarea-DpXOZLt8.js";import{t as E}from"./use-toast-DqmC-mB5.js";import{a as D,c as O,i as k,n as A,o as ee,r as te,s as ne,t as re}from"./alert-dialog--tUzAWFm.js";import{n as j}from"./tab-context-CCvlrC0o.js";import{t as M}from"./skeleton-Bc0U0oGc.js";import{t as N}from"./mcp-server-card-DupwHcKT.js";import{n as P,t as F}from"./radio-group-Mifbn8sU.js";var I=e(C(),1),L=t();function R({threadId:e,onSkillCreated:t}){let[r,i]=(0,I.useState)(``),[a,c]=(0,I.useState)(``),[d,f]=(0,I.useState)(`local`),[p,m]=(0,I.useState)(!1),h=r.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),_=h.length>0&&h.length<=64;return e?(0,L.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,L.jsxs)(`div`,{className:`mb-6`,children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Skill`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new agent skill. The skill will be saved as a SKILL.md file in the .agents/skills folder.`})]}),(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{htmlFor:`skillName`,children:`Skill Name`}),(0,L.jsx)(o,{id:`skillName`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. Code Review`,disabled:p}),r&&(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Folder name: `,(0,L.jsx)(`span`,{className:`font-mono`,children:h||`...`})]})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{htmlFor:`skillDescription`,children:`Description`}),(0,L.jsx)(T,{id:`skillDescription`,value:a,onChange:e=>c(e.target.value),placeholder:`Describe when Tarsk should apply this skill`,className:`resize-none min-h-[120px]`,disabled:p})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{children:`Scope`}),(0,L.jsxs)(F,{value:d,onValueChange:e=>f(e),className:`flex gap-4`,disabled:p,children:[(0,L.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,L.jsx)(P,{value:`local`,id:`scope-local`}),(0,L.jsx)(n,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,L.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,L.jsx)(P,{value:`global`,id:`scope-global`,disabled:!0}),(0,L.jsx)(n,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d===`local`?`This skill will only be available for this project.`:`This skill will be available across all projects (coming soon).`})]}),(0,L.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,L.jsx)(l,{onClick:async()=>{if(!(!_||!a.trim()||!e)){m(!0);try{let n=await s(e,h,a.trim());E({title:`Skill created`,description:`Skill '${h}' was created successfully.`}),i(``),c(``),f(`local`),t?.(n.path,`SKILL.md`)}catch(e){E({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{m(!1)}}},disabled:!_||!a.trim()||p,children:p?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(u,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,L.jsxs)(L.Fragment,{children:[`Continue`,(0,L.jsx)(g,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,L.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,L.jsxs)(`div`,{className:`text-center`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add a skill.`})]})})}function z(e){let t=[];for(let n of e)n.path.startsWith(`.agents/skills/`)&&n.type===`folder`&&t.push(n),n.children&&n.children.length>0&&t.push(...z(n.children));return t}function B(){let{state:e}=w(),{selectedProjectId:t,selectedThreadId:n}=e,{setActiveMainTab:s,setPendingExplorerPath:u,triggerExplorerRefresh:g,setExplorerClearPath:C}=j(),[T,P]=(0,I.useState)([]),[F,B]=(0,I.useState)(!1),[V,H]=(0,I.useState)(!1),[U,W]=(0,I.useState)(null),[G,K]=(0,I.useState)(!1),[q,J]=(0,I.useState)([]),[Y,X]=(0,I.useState)(new Set),[Z,ie]=(0,I.useState)(``),Q=(0,I.useCallback)(async()=>{if(t){B(!0);try{let e=z(await S(t));if(n)try{let t=z(await v(n)),r=new Set(e.map(e=>e.path));for(let n of t)r.has(n.path)||e.push(n)}catch{}P(e),X(new Set(e.map(e=>`${e.path}/SKILL.md`)))}catch{P([]),X(new Set)}finally{B(!1)}}},[t,n]);(0,I.useEffect)(()=>{Q()},[Q]),(0,I.useEffect)(()=>{h().then(J).catch(()=>J([]))},[]);let ae=(0,I.useCallback)(async e=>{if(!t)return;let r=e.name,i=e.path;K(!0);try{try{await c(t,i)}catch{if(n)await f(n,i);else throw Error(`No thread selected to delete from`)}C(i),g(),X(e=>{let t=new Set(e);return t.delete(`${i}/SKILL.md`),t}),E({title:`Skill removed`,description:r}),W(null),await Q()}catch(e){E({title:`Error`,description:e instanceof Error?e.message:`Failed to remove skill`,variant:`destructive`})}finally{K(!1)}},[t,n,Q,g,C]),oe=(0,I.useCallback)(e=>{u(`${e}/SKILL.md`),s(`explorer`)},[u,s]),se=(0,I.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 x(n,t,r.join(`
2
+ `))}X(e=>new Set(e).add(t)),g(),Q(),E({title:`Skill installed`,description:e.name})}catch(e){E({title:`Error`,description:e instanceof Error?e.message:`Failed to install skill`,variant:`destructive`})}},[n,Y,g,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return t?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,L.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Skills`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage agent skills. Skills are reusable instruction sets that guide agent behavior.`})]}),(0,L.jsx)(l,{onClick:()=>H(!0),disabled:!n,children:`Add Skill`})]}),!n&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to add skills to your project.`}),(0,L.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:`Installed Skills`}),F?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(M,{className:`h-20 w-full`}),(0,L.jsx)(M,{className:`h-20 w-full`})]}):T.length===0?(0,L.jsxs)(`div`,{className:`text-center py-12 border border-dashed rounded-lg mb-8`,children:[(0,L.jsx)(r,{className:`mx-auto h-10 w-10 text-muted-foreground/50 mb-3`}),(0,L.jsx)(`h3`,{className:`text-base font-semibold text-muted-foreground mb-1`,children:`No skills installed`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mb-3`,children:`Add skills to extend agent capabilities with reusable instructions.`})]}):(0,L.jsx)(`div`,{className:`space-y-3 mb-8`,children:T.map(e=>(0,L.jsx)(y,{children:(0,L.jsxs)(b,{className:`flex items-center justify-between p-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(r,{className:`h-4 w-4 text-muted-foreground flex-shrink-0`}),(0,L.jsx)(`h3`,{className:`font-medium truncate`,children:e.name})]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 truncate font-mono`,children:e.path})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1 ml-4 flex-shrink-0`,children:[(0,L.jsx)(l,{variant:`ghost`,size:`icon-sm`,onClick:()=>oe(e.path),title:`View in explorer`,children:(0,L.jsx)(p,{className:`h-4 w-4`})}),(0,L.jsx)(l,{variant:`ghost`,size:`icon-sm`,onClick:()=>W(e),title:`Delete skill`,children:(0,L.jsx)(m,{className:`h-4 w-4 text-destructive`})})]})]})},e.id))}),(0,L.jsx)(`div`,{className:`flex items-center justify-between mb-3`,children:(0,L.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Available Skills`})}),!n&&(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to install skills into your project.`}),(0,L.jsxs)(`div`,{className:`relative mb-4`,children:[(0,L.jsx)(_,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,L.jsx)(o,{placeholder:`Search available skills...`,value:Z,onChange:e=>ie(e.target.value),className:`pl-8`})]}),q.length===0?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(M,{className:`h-20 w-full`}),(0,L.jsx)(M,{className:`h-20 w-full`})]}):$.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:Z.trim()?`No results for "${Z}"`:`No available skills found.`}):(0,L.jsx)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(min(220px, 100%), 1fr))`},children:$.map(e=>{let t=`.agents/skills/${e.id}/SKILL.md`,n=Y.has(t);return(0,L.jsx)(N,{name:e.name,description:e.description,installed:n,onClick:()=>{n||se(e)},showInstalledControls:!1},e.id)})})]})}),(0,L.jsx)(a,{open:V,onOpenChange:H,children:(0,L.jsx)(d,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,L.jsx)(R,{threadId:n,onSkillCreated:()=>{H(!1),Q(),g()}})})}),(0,L.jsx)(re,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,L.jsxs)(k,{children:[(0,L.jsxs)(ne,{children:[(0,L.jsx)(O,{children:`Delete Skill`}),(0,L.jsxs)(D,{children:[`Are you sure you want to delete the skill "`,U?.name,`"? This action cannot be undone.`]})]}),(0,L.jsxs)(ee,{children:[(0,L.jsx)(te,{children:`Cancel`}),(0,L.jsx)(A,{onClick:()=>U&&void ae(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,L.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Select a project to manage skills.`})})}export{B as SettingsSkillsView,B as default};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Dt as n,Fn as r,Gt as i,Hn as a,Ln as o,Rn as s,Si as c,Un as l,Ur as u,Vi as d,Vr as f,aa as p,ei as m,j as h,n as g,r as _,vt as v,ya as y,z as b}from"./dialogs-config-DZFG2IQM.js";import{a as x}from"./store-CwvBC-YP.js";import{t as S}from"./use-toast-DqmC-mB5.js";import{a as C,c as w,i as T,n as E,o as ee,r as D,s as O,t as k}from"./alert-dialog--tUzAWFm.js";import{n as A}from"./tab-context-CCvlrC0o.js";import{t as j}from"./skeleton-Bc0U0oGc.js";import{t as M}from"./mcp-server-card-DupwHcKT.js";import{n as N,t as P}from"./radio-group-Mifbn8sU.js";var F=e(y(),1),I=t();function L({projectId:e,threadId:t,onCommandCreated:n}){let[i,a]=(0,F.useState)(``),[l,u]=(0,F.useState)(``),[d,f]=(0,F.useState)(``),[m,g]=(0,F.useState)(`default`),[_,v]=(0,F.useState)(`local`),[y,b]=(0,F.useState)(!1),x=i.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),C=x.length>0&&x.length<=64;return e?(0,I.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,I.jsxs)(`div`,{className:`mb-6`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Slash Command`}),(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new slash command. The command will be saved as a .md file in the ~/.agents/commands folder.`})]}),(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(r,{htmlFor:`commandName`,children:`Command Name`}),(0,I.jsx)(o,{id:`commandName`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g. review`,disabled:y}),i&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Command: `,(0,I.jsxs)(`span`,{className:`font-mono`,children:[`/`,x||`...`]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(r,{htmlFor:`commandDescription`,children:`Description`}),(0,I.jsx)(o,{id:`commandDescription`,value:l,onChange:e=>u(e.target.value),placeholder:`Brief description shown in autocomplete`,disabled:y})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(r,{htmlFor:`argumentHint`,children:`Argument Hint (optional)`}),(0,I.jsx)(o,{id:`argumentHint`,value:d,onChange:e=>f(e.target.value),placeholder:`e.g. <focus-area> or <branch-name>`,disabled:y}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Shows after the command name to guide users what to type`})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(r,{children:`Mode`}),(0,I.jsxs)(P,{value:m,onValueChange:e=>g(e),className:`flex gap-4`,disabled:y,children:[(0,I.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,I.jsx)(N,{value:`default`,id:`mode-default`}),(0,I.jsx)(r,{htmlFor:`mode-default`,className:`font-normal cursor-pointer`,children:`Default`})]}),(0,I.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,I.jsx)(N,{value:`plan`,id:`mode-plan`}),(0,I.jsx)(r,{htmlFor:`mode-plan`,className:`font-normal cursor-pointer`,children:`Plan`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:m===`default`?`Standard chat mode`:`Activates plan mode when this command is used`})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(r,{children:`Scope`}),(0,I.jsxs)(P,{value:_,onValueChange:e=>v(e),className:`flex gap-4`,disabled:y,children:[(0,I.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,I.jsx)(N,{value:`local`,id:`scope-local`}),(0,I.jsx)(r,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,I.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,I.jsx)(N,{value:`global`,id:`scope-global`,disabled:!0}),(0,I.jsx)(r,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_===`local`?`This command will only be available for this project.`:`This command will be available across all projects (coming soon).`})]}),(0,I.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,I.jsx)(s,{onClick:async()=>{if(!(!C||!e)){b(!0);try{await h(x,``,{description:l.trim()||void 0,argumentHint:d.trim()||void 0,mode:m===`plan`?`plan`:void 0},_===`global`?`global`:`project`,t??void 0),S({title:`Command created`,description:`Command '/${x}' was created successfully.`}),a(``),u(``),f(``),g(`default`),v(`local`),n?.(x)}catch(e){S({title:`Error`,description:e instanceof Error?e.message:`Failed to create command`,variant:`destructive`})}finally{b(!1)}}},disabled:!C||y,children:y?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,I.jsxs)(I.Fragment,{children:[`Continue`,(0,I.jsx)(p,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,I.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,I.jsxs)(`div`,{className:`text-center`,children:[(0,I.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Project Selected`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a project to add a slash command.`})]})})}function R(){let{state:e}=x(),{selectedProjectId:t,selectedThreadId:r}=e,{setActiveMainTab:c,setPendingExplorerPath:p,triggerExplorerRefresh:y,setExplorerClearPath:N}=A(),[P,R]=(0,F.useState)([]),[z,B]=(0,F.useState)(!1),[V,H]=(0,F.useState)(!1),[U,W]=(0,F.useState)(null),[G,K]=(0,F.useState)(!1),[q,J]=(0,F.useState)([]),[Y,X]=(0,F.useState)(new Map),[Z,te]=(0,F.useState)(``),Q=(0,F.useCallback)(async()=>{if(r){B(!0);try{let e=await n(r);R(e.filter(e=>!e.isBuiltIn)),X(new Map(e.map(e=>[e.name,e.filePath])))}catch{R([]),X(new Map)}finally{B(!1)}}},[r]);(0,F.useEffect)(()=>{Q()},[Q]),(0,F.useEffect)(()=>{v().then(J).catch(()=>J([]))},[]);let ne=(0,F.useCallback)(async e=>{K(!0);try{await b(e.filePath),N(e.filePath),y(),X(t=>{let n=new Map(t);return n.delete(e.name),n}),S({title:`Command removed`,description:`/${e.name}`}),W(null),await Q()}catch(e){S({title:`Error`,description:e instanceof Error?e.message:`Failed to remove command`,variant:`destructive`})}finally{K(!1)}},[Q,y,N]),re=(0,F.useCallback)(e=>{p(e),c(`explorer`)},[p,c]),ie=(0,F.useCallback)(async e=>{if(!(!r||Y.has(e.name)))try{if(e.gitHubRepo&&e.gitHubFolder){let t=`.agents/commands`;await i(r,e.gitHubRepo,e.gitHubFolder,t);let n=`${t}/${e.name}.md`;X(t=>new Map(t).set(e.name,n))}else{let t=await h(e.name,e.content,{description:e.description,argumentHint:e.argumentHint},`project`,r);X(n=>new Map(n).set(e.name,t.filePath))}y(),Q(),S({title:`Command installed`,description:`/${e.name}`})}catch(e){S({title:`Error`,description:e instanceof Error?e.message:`Failed to install command`,variant:`destructive`})}},[r,Y,y,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return t?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,I.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Slash Commands`}),(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage slash commands. Commands are quick actions available via / in chat.`})]}),(0,I.jsx)(s,{onClick:()=>H(!0),disabled:!r,children:`Add Command`})]}),!r&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to add slash commands to your project.`}),(0,I.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:`Installed Slash Commands`}),z?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsx)(j,{className:`h-20 w-full`}),(0,I.jsx)(j,{className:`h-20 w-full`})]}):P.length===0?(0,I.jsxs)(`div`,{className:`text-center py-12 border border-dashed rounded-lg mb-8`,children:[(0,I.jsx)(u,{className:`mx-auto h-10 w-10 text-muted-foreground/50 mb-3`}),(0,I.jsx)(`h3`,{className:`text-base font-semibold text-muted-foreground mb-1`,children:`No slash commands installed`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground mb-3`,children:`Add slash commands to create quick actions in chat.`})]}):(0,I.jsx)(`div`,{className:`space-y-3 mb-8`,children:P.map(e=>(0,I.jsx)(g,{children:(0,I.jsxs)(_,{className:`flex items-center justify-between p-4`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(u,{className:`h-4 w-4 text-muted-foreground flex-shrink-0`}),(0,I.jsxs)(`h3`,{className:`font-medium truncate`,children:[`/`,e.name]}),e.metadata?.mode&&(0,I.jsx)(`span`,{className:`text-xs bg-muted px-1.5 py-0.5 rounded flex-shrink-0`,children:e.metadata.mode})]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 truncate`,children:e.metadata?.description||`No description`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1 ml-4 flex-shrink-0`,children:[(0,I.jsx)(s,{variant:`ghost`,size:`icon-sm`,onClick:()=>re(e.filePath),title:`View in explorer`,children:(0,I.jsx)(d,{className:`h-4 w-4`})}),(0,I.jsx)(s,{variant:`ghost`,size:`icon-sm`,onClick:()=>W(e),title:`Delete command`,children:(0,I.jsx)(f,{className:`h-4 w-4 text-destructive`})})]})]})},e.filePath))}),(0,I.jsx)(`div`,{className:`flex items-center justify-between mb-3`,children:(0,I.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Available Slash Commands`})}),!r&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to install slash commands into your project.`}),(0,I.jsxs)(`div`,{className:`relative mb-4`,children:[(0,I.jsx)(m,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,I.jsx)(o,{placeholder:`Search available commands...`,value:Z,onChange:e=>te(e.target.value),className:`pl-8`})]}),q.length===0?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsx)(j,{className:`h-20 w-full`}),(0,I.jsx)(j,{className:`h-20 w-full`})]}):$.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:Z.trim()?`No results for "${Z}"`:`No available commands found.`}):(0,I.jsx)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(min(220px, 100%), 1fr))`},children:$.map(e=>{let t=Y.has(e.name);return(0,I.jsx)(M,{name:`/${e.name}`,description:e.description,installed:t,onClick:()=>{t||ie(e)},showInstalledControls:!1},e.id)})})]})}),(0,I.jsx)(a,{open:V,onOpenChange:H,children:(0,I.jsx)(l,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,I.jsx)(L,{projectId:t,threadId:r,onCommandCreated:()=>{H(!1),Q(),y()}})})}),(0,I.jsx)(k,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,I.jsxs)(T,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(w,{children:`Delete Slash Command`}),(0,I.jsxs)(C,{children:[`Are you sure you want to delete "/`,U?.name,`"? This action cannot be undone.`]})]}),(0,I.jsxs)(ee,{children:[(0,I.jsx)(D,{children:`Cancel`}),(0,I.jsx)(E,{onClick:()=>U&&void ne(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,I.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`Select a project to manage slash commands.`})})}export{R as SettingsSlashCommandsView,R as default};
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Fn as n,Gt as r,Hn as i,Ir as a,Ln as o,N as s,R as c,Rn as l,Si as u,Un as d,V as f,Vi as p,Vr as m,aa as h,ei as g,jt as _,mt as v,n as y,r as ee,sn as b,xt as x,ya as S}from"./dialogs-config-DZFG2IQM.js";import{a as C}from"./store-CwvBC-YP.js";import{t as w}from"./textarea-DpXOZLt8.js";import{t as T}from"./use-toast-DqmC-mB5.js";import{a as E,c as D,i as O,n as k,o as A,r as j,s as M,t as te}from"./alert-dialog--tUzAWFm.js";import{n as ne}from"./tab-context-CCvlrC0o.js";import{t as N}from"./skeleton-Bc0U0oGc.js";import{t as re}from"./mcp-server-card-DupwHcKT.js";import{n as P,t as F}from"./radio-group-Mifbn8sU.js";var I=e(S(),1),L=t();function R({threadId:e,onAgentCreated:t}){let[r,i]=(0,I.useState)(``),[a,c]=(0,I.useState)(``),[d,f]=(0,I.useState)(``),[p,m]=(0,I.useState)(`local`),[g,_]=(0,I.useState)(!1),v=r.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),y=v.length>0&&v.length<=64;return e?(0,L.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,L.jsxs)(`div`,{className:`mb-6`,children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Agent`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new subagent. The agent will be saved as an AGENT.md file in the .agents/agents folder.`})]}),(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{htmlFor:`agentName`,children:`Agent Name`}),(0,L.jsx)(o,{id:`agentName`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. Security Reviewer`,disabled:g}),r&&(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Folder name: `,(0,L.jsx)(`span`,{className:`font-mono`,children:v||`...`})]})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{htmlFor:`agentDescription`,children:`Description`}),(0,L.jsx)(w,{id:`agentDescription`,value:a,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:g})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{htmlFor:`agentTools`,children:`Allowed Tools (optional)`}),(0,L.jsx)(o,{id:`agentTools`,value:d,onChange:e=>f(e.target.value),placeholder:`e.g. read grep glob`,disabled:g}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Space-separated list of tools this agent can use. Leave empty to allow all coding tools.`})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{children:`Scope`}),(0,L.jsxs)(F,{value:p,onValueChange:e=>m(e),className:`flex gap-4`,disabled:g,children:[(0,L.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,L.jsx)(P,{value:`local`,id:`scope-local`}),(0,L.jsx)(n,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,L.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,L.jsx)(P,{value:`global`,id:`scope-global`,disabled:!0}),(0,L.jsx)(n,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p===`local`?`This agent will only be available for this project.`:`This agent will be available across all projects (coming soon).`})]}),(0,L.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,L.jsx)(l,{onClick:async()=>{if(!(!y||!a.trim()||!e)){_(!0);try{let n=await s(e,v,a.trim(),d.trim()||void 0);T({title:`Agent created`,description:`Agent '${v}' was created successfully.`}),i(``),c(``),f(``),m(`local`),t?.(n.path,`AGENT.md`)}catch(e){T({title:`Error`,description:e instanceof Error?e.message:`Failed to create agent`,variant:`destructive`})}finally{_(!1)}}},disabled:!y||!a.trim()||g,children:g?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(u,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,L.jsxs)(L.Fragment,{children:[`Continue`,(0,L.jsx)(h,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,L.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,L.jsxs)(`div`,{className:`text-center`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add an agent.`})]})})}function z(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(...z(n.children));return t}function B(){let{state:e}=C(),{selectedProjectId:t,selectedThreadId:n}=e,{setActiveMainTab:s,setPendingExplorerPath:u,triggerExplorerRefresh:h,setExplorerClearPath:S}=ne(),[w,P]=(0,I.useState)([]),[F,B]=(0,I.useState)(!1),[V,H]=(0,I.useState)(!1),[U,W]=(0,I.useState)(null),[G,K]=(0,I.useState)(!1),[q,J]=(0,I.useState)([]),[Y,X]=(0,I.useState)(new Set),[Z,ie]=(0,I.useState)(``),Q=(0,I.useCallback)(async()=>{if(t){B(!0);try{let e=z(await x(t));if(n)try{let t=z(await _(n)),r=new Set(e.map(e=>e.path));for(let n of t)r.has(n.path)||e.push(n)}catch{}P(e),X(new Set(e.map(e=>`${e.path}/AGENT.md`)))}catch{P([]),X(new Set)}finally{B(!1)}}},[t,n]);(0,I.useEffect)(()=>{Q()},[Q]),(0,I.useEffect)(()=>{v().then(J).catch(()=>J([]))},[]);let ae=(0,I.useCallback)(async e=>{if(!t)return;let r=e.name,i=e.path;K(!0);try{try{await c(t,i)}catch{if(n)await f(n,i);else throw Error(`No thread selected to delete from`)}S(i),h(),X(e=>{let t=new Set(e);return t.delete(`${i}/AGENT.md`),t}),T({title:`Agent removed`,description:r}),W(null),await Q()}catch(e){T({title:`Error`,description:e instanceof Error?e.message:`Failed to remove agent`,variant:`destructive`})}finally{K(!1)}},[t,n,Q,h,S]),oe=(0,I.useCallback)(e=>{u(`${e}/AGENT.md`),s(`explorer`)},[u,s]),se=(0,I.useCallback)(async e=>{let t=`.agents/agents/${e.id}/AGENT.md`;if(!(!n||Y.has(t)))try{if(e.gitHubRepo&&e.gitHubFolder)await r(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 b(n,t,r.join(`
2
+ `))}X(e=>new Set(e).add(t)),h(),Q(),T({title:`Agent installed`,description:e.name})}catch(e){T({title:`Error`,description:e instanceof Error?e.message:`Failed to install agent`,variant:`destructive`})}},[n,Y,h,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return t?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,L.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Subagents`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage subagents. Subagents are specialized agents for focused tasks.`})]}),(0,L.jsx)(l,{onClick:()=>H(!0),disabled:!n,children:`Add Subagent`})]}),!n&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to add subagents to your project.`}),(0,L.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:`Installed Subagents`}),F?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(N,{className:`h-20 w-full`}),(0,L.jsx)(N,{className:`h-20 w-full`})]}):w.length===0?(0,L.jsxs)(`div`,{className:`text-center py-12 border border-dashed rounded-lg mb-8`,children:[(0,L.jsx)(a,{className:`mx-auto h-10 w-10 text-muted-foreground/50 mb-3`}),(0,L.jsx)(`h3`,{className:`text-base font-semibold text-muted-foreground mb-1`,children:`No subagents installed`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mb-3`,children:`Add subagents for specialized, focused tasks.`})]}):(0,L.jsx)(`div`,{className:`space-y-3 mb-8`,children:w.map(e=>(0,L.jsx)(y,{children:(0,L.jsxs)(ee,{className:`flex items-center justify-between p-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(a,{className:`h-4 w-4 text-muted-foreground flex-shrink-0`}),(0,L.jsx)(`h3`,{className:`font-medium truncate`,children:e.name})]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 truncate font-mono`,children:e.path})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1 ml-4 flex-shrink-0`,children:[(0,L.jsx)(l,{variant:`ghost`,size:`icon-sm`,onClick:()=>oe(e.path),title:`View in explorer`,children:(0,L.jsx)(p,{className:`h-4 w-4`})}),(0,L.jsx)(l,{variant:`ghost`,size:`icon-sm`,onClick:()=>W(e),title:`Delete agent`,children:(0,L.jsx)(m,{className:`h-4 w-4 text-destructive`})})]})]})},e.id))}),(0,L.jsx)(`div`,{className:`flex items-center justify-between mb-3`,children:(0,L.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Available Subagents`})}),!n&&(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to install subagents into your project.`}),(0,L.jsxs)(`div`,{className:`relative mb-4`,children:[(0,L.jsx)(g,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,L.jsx)(o,{placeholder:`Search available subagents...`,value:Z,onChange:e=>ie(e.target.value),className:`pl-8`})]}),q.length===0?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(N,{className:`h-20 w-full`}),(0,L.jsx)(N,{className:`h-20 w-full`})]}):$.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:Z.trim()?`No results for "${Z}"`:`No available subagents found.`}):(0,L.jsx)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(min(220px, 100%), 1fr))`},children:$.map(e=>{let t=`.agents/agents/${e.id}/AGENT.md`,n=Y.has(t);return(0,L.jsx)(re,{name:e.name,description:e.description,installed:n,onClick:()=>{n||se(e)},showInstalledControls:!1},e.id)})})]})}),(0,L.jsx)(i,{open:V,onOpenChange:H,children:(0,L.jsx)(d,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,L.jsx)(R,{threadId:n,onAgentCreated:()=>{H(!1),Q(),h()}})})}),(0,L.jsx)(te,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,L.jsxs)(O,{children:[(0,L.jsxs)(M,{children:[(0,L.jsx)(D,{children:`Delete Subagent`}),(0,L.jsxs)(E,{children:[`Are you sure you want to delete the subagent "`,U?.name,`"? This action cannot be undone.`]})]}),(0,L.jsxs)(A,{children:[(0,L.jsx)(j,{children:`Cancel`}),(0,L.jsx)(k,{onClick:()=>U&&void ae(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,L.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Select a project to manage subagents.`})})}export{B as SettingsSubagentsView,B as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/providers-list-view-AVt5I1WB.js","assets/rolldown-runtime-B1FJdls4.js","assets/history-view-BR8scGnM.js","assets/dialogs-config-DZFG2IQM.js","assets/onboarding-Cn5RqOCa.js","assets/skeleton-Bc0U0oGc.js","assets/tabs-Mb_cjIfE.js","assets/react-vendor-Bao-KYKs.js","assets/monaco-DDfTQM3i.js","assets/settings-models-view-BqdD_7GR.js","assets/settings-mcp-servers-view-Becs_RxN.js","assets/mcp-server-card-DupwHcKT.js","assets/alert-dialog--tUzAWFm.js","assets/textarea-DpXOZLt8.js","assets/use-toast-DqmC-mB5.js","assets/store-CwvBC-YP.js","assets/tab-context-CCvlrC0o.js","assets/settings-skills-view-aPv03-bO.js","assets/radio-group-Mifbn8sU.js","assets/settings-rules-view-D7j5OHUi.js","assets/settings-slash-commands-view-DLMWXQXA.js","assets/settings-subagents-view-DBYzNE4W.js","assets/settings-instructions-view-CgfWSPmK.js","assets/account-view-BFhjAYmz.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$r as t,$t as n,Dr as r,Fr as i,Ir as a,Lr as o,Ur as s,Yi as c,_a as l,fa as u,la as d,ti as f,ya as p}from"./dialogs-config-DZFG2IQM.js";import{_t as m,bt as h,vt as g,yt as _}from"./react-vendor-Bao-KYKs.js";import{t as v}from"./standard-list-item-D2lbPXa1.js";import{t as y}from"./side-panel-container-oMcXib2A.js";import{n as b,r as x,t as S}from"./resizable-DzrIos_Y.js";var C=l(),w=e(p(),1),T=r(),E=(0,w.forwardRef)(function(e,t){let n=(0,C.c)(20),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:u,className:d,onCollapse:f,onExpand:p}=e,m=a===void 0?25:a,h=o===void 0?20:o,g=s===void 0?30:s,_=c===void 0?40:c,v=l===void 0?!1:l,y=u===void 0?0:u,w=`h-full ${d===void 0?``:d}`,E;n[0]!==y||n[1]!==v||n[2]!==m||n[3]!==g||n[4]!==h||n[5]!==f||n[6]!==p||n[7]!==t||n[8]!==r?(E=(0,T.jsx)(b,{ref:t,defaultSize:m,minSize:h,maxSize:g,collapsible:v,collapsedSize:y,onCollapse:f,onExpand:p,className:`border-r border-transparent`,children:r}),n[0]=y,n[1]=v,n[2]=m,n[3]=g,n[4]=h,n[5]=f,n[6]=p,n[7]=t,n[8]=r,n[9]=E):E=n[9];let D;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,T.jsx)(S,{withHandle:!0,className:`ml-[-40px]`}),n[10]=D):D=n[10];let O;n[11]!==i||n[12]!==_?(O=(0,T.jsx)(b,{minSize:_,className:`overflow-hidden`,children:i}),n[11]=i,n[12]=_,n[13]=O):O=n[13];let k;n[14]!==O||n[15]!==E?(k=(0,T.jsxs)(x,{direction:`horizontal`,className:`h-full`,children:[E,D,O]}),n[14]=O,n[15]=E,n[16]=k):k=n[16];let A;return n[17]!==k||n[18]!==w?(A=(0,T.jsx)(`div`,{className:w,children:k}),n[17]=k,n[18]=w,n[19]=A):A=n[19],A}),D=[{id:`providers`,label:`Providers`,icon:(0,T.jsx)(c,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,T.jsx)(d,{className:`h-4 w-4`}),route:`/settings/models`},{id:`skills`,label:`Skills`,icon:(0,T.jsx)(i,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,T.jsx)(f,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,T.jsx)(s,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,T.jsx)(a,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,T.jsx)(u,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,T.jsx)(t,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`account`,label:`Account`,icon:(0,T.jsx)(o,{className:`h-4 w-4`}),route:`/settings/account`}];function O(e){let t=(0,C.c)(8),{className:n}=e,r=g(),i=m(),a;t[0]===i.pathname?a=t[1]:(a=function(){let e=i.pathname;for(let t of D)if(e.startsWith(t.route))return t.id;return`providers`}(),t[0]=i.pathname,t[1]=a);let o=a,s=`space-y-1${n?` ${n}`:``}`,c;t[2]!==o||t[3]!==r?(c=D.map(e=>(0,T.jsx)(v,{selected:o===e.id,asChild:!0,children:(0,T.jsx)(`button`,{className:`justify-start`,onClick:()=>void r(e.route),children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.icon,(0,T.jsx)(`span`,{children:e.label})]})})},e.id)),t[2]=o,t[3]=r,t[4]=c):c=t[4];let l;return t[5]!==s||t[6]!==c?(l=(0,T.jsx)(`div`,{className:s,children:c}),t[5]=s,t[6]=c,t[7]=l):l=t[7],l}var k=(0,w.lazy)(()=>h(()=>import(`./providers-list-view-AVt5I1WB.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),A=(0,w.lazy)(()=>h(()=>import(`./settings-models-view-BqdD_7GR.js`),__vite__mapDeps([9,1,2,3,4,6,7,8]))),j=(0,w.lazy)(()=>h(()=>import(`./settings-mcp-servers-view-Becs_RxN.js`),__vite__mapDeps([10,1,2,3,11,12,7,8,5,13,14,15,16]))),M=(0,w.lazy)(()=>h(()=>import(`./settings-skills-view-aPv03-bO.js`),__vite__mapDeps([17,1,3,11,2,12,7,8,18,5,13,14,15,16]))),N=(0,w.lazy)(()=>h(()=>import(`./settings-rules-view-D7j5OHUi.js`),__vite__mapDeps([19,1,7,2,3,8,11,12,18,5,13,14,15,16]))),P=(0,w.lazy)(()=>h(()=>import(`./settings-slash-commands-view-DLMWXQXA.js`),__vite__mapDeps([20,1,3,11,2,12,7,8,18,5,14,15,16]))),F=(0,w.lazy)(()=>h(()=>import(`./settings-subagents-view-DBYzNE4W.js`),__vite__mapDeps([21,1,3,11,2,12,7,8,18,5,13,14,15,16]))),I=(0,w.lazy)(()=>h(()=>import(`./settings-instructions-view-CgfWSPmK.js`),__vite__mapDeps([22,1,3,13,14,15]))),L=(0,w.lazy)(()=>h(()=>import(`./account-view-BFhjAYmz.js`),__vite__mapDeps([23,1,3,5,14]))),R=[`providers`,`models`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`mcp-servers`,`account`];function z(e){let t=(0,C.c)(5),{title:n}=e,r;t[0]===n?r=t[1]:(r=(0,T.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:n}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Content coming soon...`}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,T.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,T.jsxs)(`div`,{className:`text-center`,children:[r,i]})}),t[3]=r,t[4]=a),a}function B(e){return 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/mcp-servers`)?`mcp-servers`:e.startsWith(`/settings/account`)?`account`:`providers`}function V(){let e=(0,C.c)(26),{tab:t}=_(),n=g(),r=m(),i;if(e[0]!==r.pathname||e[1]!==r.search||e[2]!==t){let n=new URLSearchParams(r.search).get(`tab`);i=n&&R.includes(n)?n:t&&R.includes(t)?t:B(r.pathname),e[0]=r.pathname,e[1]=r.search,e[2]=t,e[3]=i}else i=e[3];let a=i,[o,s]=(0,w.useState)(!1),c=(0,w.useRef)(null),l=H,u;e[4]===n?u=e[5]:(u=()=>{n(`/`)},e[4]=n,e[5]=u);let d=u,f,p;e[6]!==r.pathname||e[7]!==n?(f=()=>{[`/settings/project`,`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(e=>r.pathname.startsWith(e))&&n(`/settings/providers`,{replace:!0})},p=[r.pathname,n],e[6]=r.pathname,e[7]=n,e[8]=f,e[9]=p):(f=e[8],p=e[9]),(0,w.useEffect)(f,p);let h;e[10]===d?h=e[11]:(h=()=>(0,T.jsx)(y,{onTitleClose:d,subtitle:`Settings`,onResetOnboarding:l,children:(0,T.jsx)(`div`,{className:`px-2 py-2`,children:(0,T.jsx)(O,{})})}),e[10]=d,e[11]=h);let v=h,b;e[12]===a?b=e[13]:(b=()=>{switch(a){case`providers`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Providers`}),children:(0,T.jsx)(k,{})});case`models`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Models`}),children:(0,T.jsx)(A,{})});case`skills`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Skills`}),children:(0,T.jsx)(M,{})});case`rules`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Rules`}),children:(0,T.jsx)(N,{})});case`slash-commands`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Slash Commands`}),children:(0,T.jsx)(P,{})});case`subagents`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Subagents`}),children:(0,T.jsx)(F,{})});case`instructions`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Instructions`}),children:(0,T.jsx)(I,{})});case`mcp-servers`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`MCP Servers`}),children:(0,T.jsx)(j,{})});case`account`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Account`}),children:(0,T.jsx)(L,{})});default:return(0,T.jsx)(z,{title:`Settings`})}},e[12]=a,e[13]=b);let x=b,S,D;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>s(!0),D=()=>s(!1),e[14]=S,e[15]=D):(S=e[14],D=e[15]);let V;e[16]===v?V=e[17]:(V=v(),e[16]=v,e[17]=V);let U=`h-full overflow-auto ${o?`ml-[40px]`:``}`,W;e[18]===x?W=e[19]:(W=x(),e[18]=x,e[19]=W);let G;e[20]!==W||e[21]!==U?(G=(0,T.jsx)(`div`,{className:U,children:W}),e[20]=W,e[21]=U,e[22]=G):G=e[22];let K;return e[23]!==G||e[24]!==V?(K=(0,T.jsx)(E,{ref:c,collapsible:!0,onCollapse:S,onExpand:D,sidebar:V,children:G}),e[23]=G,e[24]=V,e[25]=K):K=e[25],K}async function H(){try{await n()}catch(e){console.error(`Failed to reset onboarding:`,e)}}export{V as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialogs-config-BEsTbY1C.js","assets/rolldown-runtime-B1FJdls4.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Cr as t,Pn as n,Qi as r,da as i,kn as a,kr as o}from"./dialogs-config-BEsTbY1C.js";import{vt as s}from"./react-vendor-QkuITxN7.js";var c=e(i(),1),l=t();function u({children:e,collapsed:t,title:i,onTitleClose:u,subtitle:d,headerAction:f,footer:p,onResetOnboarding:m,onLogoClick:h}){let g=(0,c.useRef)(0),_=(0,c.useRef)(null);return(0,c.useEffect)(()=>()=>{_.current&&clearTimeout(_.current)},[]),(0,l.jsxs)(`div`,{className:`flex flex-col bg-sidebar text-sidebar-foreground mx-2.5 mt-8 mr-10 rounded-3xl shadow-2xl overflow-hidden`,style:{containerType:`inline-size`,height:`calc(100% - 32px)`},children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sidebar-border px-4 py-3 h-[61px]`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`div`,{className:`flex h-7 w-7 items-center justify-center overflow-hidden rounded-md border border-sidebar-border shadow-sm`,children:(0,l.jsx)(`img`,{src:`/tarsk.svg`,alt:`Tarsk`,className:`h-full w-full cursor-pointer`,onClick:m||h?async()=>{if(h?.(),m)if(_.current&&clearTimeout(_.current),g.current+=1,g.current>=3){g.current=0;let{resetOnboarding:e}=await s(async()=>{let{resetOnboarding:e}=await import(`./dialogs-config-BEsTbY1C.js`).then(e=>e.b);return{resetOnboarding:e}},__vite__mapDeps([0,1]));e()}else _.current=setTimeout(()=>{g.current=0},500)}:void 0})}),!t&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,l.jsx)(`span`,{className:`text-sm font-semibold tracking-tight`,children:`Tarsk`}),d&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r,{className:`h-3 w-3 text-sidebar-foreground/60`}),(0,l.jsx)(`span`,{className:`text-sm font-medium text-sidebar-foreground/80`,children:d})]})]})]}),(i??u??f)&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 ml-auto`,children:[f&&!t&&f,i&&(0,l.jsx)(`span`,{className:`text-xs font-medium text-sidebar-foreground/80`,children:i}),u&&(0,l.jsxs)(n,{variant:`ghost`,size:`icon`,className:`h-7 w-7 text-sidebar-foreground`,onClick:u,children:[(0,l.jsx)(o,{className:`h-4 w-4`}),(0,l.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}),(0,l.jsx)(a,{className:`flex-1`,children:e}),p&&(0,l.jsx)(`div`,{className:`border-t border-sidebar-border`,children:p})]})}export{u as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialogs-config-DZFG2IQM.js","assets/rolldown-runtime-B1FJdls4.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Mn as n,Nr as r,Rn as i,aa as a,ya as o}from"./dialogs-config-DZFG2IQM.js";import{bt as s}from"./react-vendor-Bao-KYKs.js";var c=e(o(),1),l=t();function u({children:e,collapsed:t,title:o,onTitleClose:u,subtitle:d,headerAction:f,footer:p,onResetOnboarding:m,onLogoClick:h}){let g=(0,c.useRef)(0),_=(0,c.useRef)(null);return(0,c.useEffect)(()=>()=>{_.current&&clearTimeout(_.current)},[]),(0,l.jsxs)(`div`,{className:`flex flex-col bg-sidebar text-sidebar-foreground mx-2.5 mt-8 mr-10 rounded-3xl shadow-2xl overflow-hidden`,style:{containerType:`inline-size`,height:`calc(100% - 32px)`},children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sidebar-border px-4 py-3 h-[61px]`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`div`,{className:`flex h-7 w-7 items-center justify-center overflow-hidden rounded-md border border-sidebar-border shadow-sm`,children:(0,l.jsx)(`img`,{src:`/tarsk.svg`,alt:`Tarsk`,className:`h-full w-full cursor-pointer`,onClick:m||h?async()=>{if(h?.(),m)if(_.current&&clearTimeout(_.current),g.current+=1,g.current>=3){g.current=0;let{resetOnboarding:e}=await s(async()=>{let{resetOnboarding:e}=await import(`./dialogs-config-DZFG2IQM.js`).then(e=>e.b);return{resetOnboarding:e}},__vite__mapDeps([0,1]));e()}else _.current=setTimeout(()=>{g.current=0},500)}:void 0})}),!t&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,l.jsx)(`span`,{className:`text-sm font-semibold tracking-tight`,children:`Tarsk`}),d&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a,{className:`h-3 w-3 text-sidebar-foreground/60`}),(0,l.jsx)(`span`,{className:`text-sm font-medium text-sidebar-foreground/80`,children:d})]})]})]}),(o??u??f)&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 ml-auto`,children:[f&&!t&&f,o&&(0,l.jsx)(`span`,{className:`text-xs font-medium text-sidebar-foreground/80`,children:o}),u&&(0,l.jsxs)(i,{variant:`ghost`,size:`icon`,className:`h-7 w-7 text-sidebar-foreground`,onClick:u,children:[(0,l.jsx)(r,{className:`h-4 w-4`}),(0,l.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}),(0,l.jsx)(n,{className:`flex-1`,children:e}),p&&(0,l.jsx)(`div`,{className:`border-t border-sidebar-border`,children:p})]})}export{u as t};
@@ -0,0 +1 @@
1
+ import{Dr as e,Jn as t,_a as n}from"./dialogs-config-DZFG2IQM.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 +1 @@
1
- import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Cr as t,Ln as n,Wn as r,da as i,la as a}from"./dialogs-config-BEsTbY1C.js";var o=a(),s=e(i(),1),c=t(),l=s.forwardRef((e,t)=>{let i=(0,o.c)(23),a,s,l,u,d,f,p,m,h;i[0]===e?(a=i[1],s=i[2],l=i[3],u=i[4],d=i[5],f=i[6],p=i[7],m=i[8],h=i[9]):({className:s,selected:f,noBackground:u,level:l,basePadding:a,indentSize:m,asChild:h,style:p,...d}=e,i[0]=e,i[1]=a,i[2]=s,i[3]=l,i[4]=u,i[5]=d,i[6]=f,i[7]=p,i[8]=m,i[9]=h);let g=m===void 0?20:m,_=h===void 0?!1:h,v=l===void 0?void 0:(a??12)+l*g,y=_?n:`div`,b=f&&!u&&`bg-sidebar-accent text-sidebar-accent-foreground font-medium`,x=f&&u&&`font-bold text-foreground`,S;i[10]!==s||i[11]!==b||i[12]!==x?(S=r(`flex items-center gap-2 w-full min-w-0 justify-start px-3 py-2 cursor-pointer rounded-full text-sm transition-colors group overflow-hidden`,`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,b,x,s),i[10]=s,i[11]=b,i[12]=x,i[13]=S):S=i[13];let C=v===void 0?void 0:`${v}px`,w;i[14]!==p||i[15]!==C?(w={paddingLeft:C,...p},i[14]=p,i[15]=C,i[16]=w):w=i[16];let T;return i[17]!==y||i[18]!==d||i[19]!==t||i[20]!==S||i[21]!==w?(T=(0,c.jsx)(y,{ref:t,className:S,style:w,...d}),i[17]=y,i[18]=d,i[19]=t,i[20]=S,i[21]=w,i[22]=T):T=i[22],T});l.displayName=`StandardListItem`;export{l as t};
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Jn as n,Vn as r,_a as i,ya as a}from"./dialogs-config-DZFG2IQM.js";var o=i(),s=e(a(),1),c=t(),l=s.forwardRef((e,t)=>{let i=(0,o.c)(23),a,s,l,u,d,f,p,m,h;i[0]===e?(a=i[1],s=i[2],l=i[3],u=i[4],d=i[5],f=i[6],p=i[7],m=i[8],h=i[9]):({className:s,selected:f,noBackground:u,level:l,basePadding:a,indentSize:m,asChild:h,style:p,...d}=e,i[0]=e,i[1]=a,i[2]=s,i[3]=l,i[4]=u,i[5]=d,i[6]=f,i[7]=p,i[8]=m,i[9]=h);let g=m===void 0?20:m,_=h===void 0?!1:h,v=l===void 0?void 0:(a??12)+l*g,y=_?r:`div`,b=f&&!u&&`bg-sidebar-accent text-sidebar-accent-foreground font-medium`,x=f&&u&&`font-bold text-foreground`,S;i[10]!==s||i[11]!==b||i[12]!==x?(S=n(`flex items-center gap-2 w-full min-w-0 justify-start px-3 py-2 cursor-pointer rounded-full text-sm transition-colors group overflow-hidden`,`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,b,x,s),i[10]=s,i[11]=b,i[12]=x,i[13]=S):S=i[13];let C=v===void 0?void 0:`${v}px`,w;i[14]!==p||i[15]!==C?(w={paddingLeft:C,...p},i[14]=p,i[15]=C,i[16]=w):w=i[16];let T;return i[17]!==y||i[18]!==d||i[19]!==t||i[20]!==S||i[21]!==w?(T=(0,c.jsx)(y,{ref:t,className:S,style:w,...d}),i[17]=y,i[18]=d,i[19]=t,i[20]=S,i[21]=w,i[22]=T):T=i[22],T});l.displayName=`StandardListItem`;export{l as t};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{da as t,la as n}from"./dialogs-config-BEsTbY1C.js";var r=e(t(),1),i=n();function a(e){return typeof e==`string`?e.replace(/\\n/g,`
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{_a as t,ya as n}from"./dialogs-config-DZFG2IQM.js";var r=e(n(),1),i=t();function a(e){return typeof e==`string`?e.replace(/\\n/g,`
2
2
  `).replace(/✅/g,`✓`):``}function o(e){if(!e||typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=/\[([A-Za-z]+)\]\s*/g,r,i=0;for(let e of t.matchAll(n))r=e[1],i=e.index+e[0].length;let a=r,o=a?t.slice(i):t;if(a&&o)return[{type:`reasoning`,text:o,label:a}];let s=[],c=0;for(;c<t.length;){let e=t.indexOf(`[`,c);if(e===-1){let e=t.slice(c).trim();e&&s.push({type:`reasoning`,text:e});break}let n=t.slice(c,e).trim();n&&s.push({type:`reasoning`,text:n});let r=0,i=-1;for(let n=e;n<t.length;n++)if(t[n]===`[`)r++;else if(t[n]===`]`&&(r--,r===0)){i=n;break}if(i===-1){let n=t.slice(e).trim();n&&s.push({type:`reasoning`,text:n});break}try{let n=JSON.parse(t.slice(e,i+1));if(Array.isArray(n)){for(let e of n)if(e&&typeof e==`object`&&`type`in e){let t=e.type;(t===`tool-result`||t===`tool_use`)&&s.push(e)}}}catch{let n=t.slice(e,i+1).trim();n&&s.push({type:`reasoning`,text:n})}c=i+1}return s.length>0?s:null}function s(e){return e.map(e=>{if(typeof e==`object`&&e&&!(`type`in e)){let t=e;if(t.reasoning)return{type:`reasoning`,text:typeof t.reasoning==`string`?t.reasoning:JSON.stringify(t.reasoning)};let n=t.text??t.content??t.answer;if(n)return{type:`text`,text:typeof n==`string`?n:JSON.stringify(n)}}return e})}function c(e){let t=[];e.reasoning&&typeof e.reasoning==`string`&&t.push({type:`reasoning`,text:e.reasoning});let n=(typeof e.text==`string`?e.text:null)??(typeof e.content==`string`?e.content:null)??(typeof e.answer==`string`?e.answer:null);return n&&t.push({type:`text`,text:n}),t.length===0&&Object.keys(e).length>0&&t.push({type:`text`,text:JSON.stringify(e,null,2)}),t}function l(e){if(!e)return null;let t=e.trim();if(t.startsWith(`{`)||t.startsWith(`[`))try{let e=JSON.parse(t);if(Array.isArray(e))return s(e);if(typeof e==`object`&&e)return c(e)}catch{}let n=[],r=e.indexOf(`{`),i=e.indexOf(`[`),a=r===-1?i:i===-1?r:Math.min(r,i);if(a!==-1){let t=e.slice(a),r=Math.max(t.lastIndexOf(`]`),t.lastIndexOf(`}`));if(r!==-1){let e=t.substring(0,r+1);try{let i=JSON.parse(e);Array.isArray(i)?n.push(...s(i)):n.push(...c(i));let a=t.substring(r+1).trim();return a&&n.push({type:`text`,text:a}),n}catch{}}}return null}function u(e,t,n){let r=e[e.length-1];return r?.type===t?[...e.slice(0,-1),{type:t,chunks:[...r.chunks,n]}]:[...e,{type:t,chunks:[n]}]}function d(e,t){return e[e.length-1]?.type===`content`?[...e.slice(0,-1),{type:`content`,chunks:[t]}]:[...e,{type:`content`,chunks:[t]}]}function f(e){let t=[];for(let n of e){let e=n.chunks.join(``);if(n.type===`thinking`){let n=o(e)??[];t.push(...n)}else{let n=l(e)??(e.trim()?[{type:`text`,text:e}]:[]);t.push(...n)}}return t}function p(e){let t=f(e);return t.length===0?`...`:t.length===1&&t[0]?.type===`text`&&`text`in t[0]?t[0].text:JSON.stringify(t)}var m=function(e){return e.SetProjects=`SET_PROJECTS`,e.SetProjectsLoading=`SET_PROJECTS_LOADING`,e.SelectThread=`SELECT_THREAD`,e.SetMessages=`SET_MESSAGES`,e.AddMessage=`ADD_MESSAGE`,e.EnqueueChatMessage=`ENQUEUE_CHAT_MESSAGE`,e.RemoveQueuedChatMessage=`REMOVE_QUEUED_CHAT_MESSAGE`,e.SetStreaming=`SET_STREAMING`,e.AppendStreamContent=`APPEND_STREAM_CONTENT`,e.SetStreamContent=`SET_STREAM_CONTENT`,e.AppendStreamThinking=`APPEND_STREAM_THINKING`,e.AppendStreamChunk=`APPEND_STREAM_CHUNK`,e.SetStreamModel=`SET_STREAM_MODEL`,e.SetProjectModel=`SET_PROJECT_MODEL`,e.ResetStream=`RESET_STREAM`,e.StopStream=`STOP_STREAM`,e.ToggleSidebar=`TOGGLE_SIDEBAR`,e.SetCreatingProject=`SET_CREATING_PROJECT`,e.ConfigUpdated=`CONFIG_UPDATED`,e.SetProcessingThreads=`SET_PROCESSING_THREADS`,e.AddProcessingThread=`ADD_PROCESSING_THREAD`,e.RemoveProcessingThread=`REMOVE_PROCESSING_THREAD`,e.AddCreatingProject=`ADD_CREATING_PROJECT`,e.AddCreatingThread=`ADD_CREATING_THREAD`,e.RemoveCreatingProject=`REMOVE_CREATING_PROJECT`,e.RemoveCreatingThread=`REMOVE_CREATING_THREAD`,e.MarkThreadCompleted=`MARK_THREAD_COMPLETED`,e.ClearThreadCompleted=`CLEAR_THREAD_COMPLETED`,e.AddDeletingThread=`ADD_DELETING_THREAD`,e.RemoveDeletingThread=`REMOVE_DELETING_THREAD`,e.AddDeletingProject=`ADD_DELETING_PROJECT`,e.RemoveDeletingProject=`REMOVE_DELETING_PROJECT`,e.AppendCommandOutput=`APPEND_COMMAND_OUTPUT`,e.SetRunningCommand=`SET_RUNNING_COMMAND`,e.ClearCommandOutput=`CLEAR_COMMAND_OUTPUT`,e.ToggleTerminal=`TOGGLE_TERMINAL`,e.SetTerminalOpen=`SET_TERMINAL_OPEN`,e.QueueTerminalCommand=`QUEUE_TERMINAL_COMMAND`,e.ClearQueuedTerminalCommand=`CLEAR_QUEUED_TERMINAL_COMMAND`,e.AppendTerminalLine=`APPEND_TERMINAL_LINE`,e.ClearTerminalOutput=`CLEAR_TERMINAL_OUTPUT`,e.SetTerminalHeight=`SET_TERMINAL_HEIGHT`,e.SetTerminalCwd=`SET_TERMINAL_CWD`,e.SetTerminalRunning=`SET_TERMINAL_RUNNING`,e.SetTerminalHistory=`SET_TERMINAL_HISTORY`,e.SetTerminalHistoryIndex=`SET_TERMINAL_HISTORY_INDEX`,e.UpdateThreadTitle=`UPDATE_THREAD_TITLE`,e.ClearFocusChatInput=`CLEAR_FOCUS_CHAT_INPUT`,e.ClearMessages=`CLEAR_MESSAGES`,e.UpdateToolCallProgress=`UPDATE_TOOL_CALL_PROGRESS`,e.SetPendingChatMessage=`SET_PENDING_CHAT_MESSAGE`,e.ClearPendingChatMessage=`CLEAR_PENDING_CHAT_MESSAGE`,e.IncrementStreamEventCount=`INCREMENT_STREAM_EVENT_COUNT`,e.SetDiffComments=`SET_DIFF_COMMENTS`,e.ClearSelection=`CLEAR_SELECTION`,e}({}),h={projects:[],projectsLoading:!0,selectedThreadId:null,selectedProjectId:null,messages:[],messagesLoaded:!1,queuedChatMessages:[],isStreaming:!1,streamingContent:``,streamingThinking:``,streamingSegments:[],streamingModel:``,streamingEventCount:0,projectModelSelections:{},sidebarOpen:!0,isCreatingProject:!1,configUpdatedAt:0,processingThreadIds:[],completedThreadIds:[],deletingThreadIds:[],deletingProjectIds:[],commandOutput:``,isRunningCommand:!1,terminalStates:{},focusChatInput:!1,toolCallProgress:{},pendingChatMessage:null,diffComments:{}};function g(e,t){switch(t.type){case m.SetProjects:{let n={...e.projectModelSelections};for(let e of t.projects)for(let t of e.threads){if(!t.model)continue;let e=n[t.threadId];n[t.threadId]={id:t.model,provider:t.modelProvider,name:e?.name??t.model,description:e?.description??``,context_length:e?.context_length,features:e?.features,input_modalities:e?.input_modalities,max_output:e?.max_output,pricing:e?.pricing,tarsk_use:e?.tarsk_use,coding_index:e?.coding_index,supportsImages:e?.supportsImages}}return{...e,projects:t.projects,projectModelSelections:n}}case m.SetProjectsLoading:return{...e,projectsLoading:t.projectsLoading};case m.SelectThread:return{...e,selectedThreadId:t.threadId,selectedProjectId:t.projectId,messages:t.initialMessages??[],messagesLoaded:!1,focusChatInput:t.focusInput??!1};case m.ClearSelection:return{...e,selectedThreadId:null,selectedProjectId:null,messages:[],messagesLoaded:!1};case m.SetMessages:return{...e,messages:t.messages,messagesLoaded:!0};case m.AddMessage:return{...e,messages:[...e.messages,t.message]};case m.EnqueueChatMessage:return{...e,queuedChatMessages:[...e.queuedChatMessages,t.message]};case m.RemoveQueuedChatMessage:return{...e,queuedChatMessages:e.queuedChatMessages.filter(e=>e.id!==t.queuedMessageId)};case m.SetStreaming:return{...e,isStreaming:t.isStreaming};case m.AppendStreamContent:return{...e,streamingContent:e.streamingContent+t.content};case m.SetStreamContent:{let n=d(e.streamingSegments,t.content);return{...e,streamingContent:t.content,streamingSegments:n}}case m.AppendStreamThinking:return{...e,streamingThinking:e.streamingThinking+t.content};case m.IncrementStreamEventCount:return{...e,streamingEventCount:e.streamingEventCount+1};case m.AppendStreamChunk:return{...e,streamingSegments:t.segments,streamingContent:t.chunkType===`content`?e.streamingContent+t.content:e.streamingContent,streamingThinking:t.chunkType===`thinking`?e.streamingThinking+t.content:e.streamingThinking};case m.SetStreamModel:return{...e,streamingModel:t.model};case m.SetProjectModel:return console.log(`[Store] SetProjectModel action:`,{threadId:t.threadId,model:{id:t.model.id,provider:t.model.provider}}),{...e,projects:e.projects.map(e=>({...e,threads:e.threads.map(e=>e.threadId===t.threadId?{...e,model:t.model.id,modelProvider:t.model.provider}:e)})),projectModelSelections:{...e.projectModelSelections,[t.threadId]:t.model}};case m.ResetStream:return{...e,streamingContent:``,streamingThinking:``,streamingSegments:[],streamingModel:``,isStreaming:!1,toolCallProgress:{},streamingEventCount:0};case m.StopStream:return{...e,isStreaming:!1};case m.ToggleSidebar:return{...e,sidebarOpen:!e.sidebarOpen};case m.SetCreatingProject:return{...e,isCreatingProject:t.isCreating};case m.ConfigUpdated:return{...e,configUpdatedAt:Date.now()};case m.SetProcessingThreads:return{...e,processingThreadIds:t.threadIds};case m.AddProcessingThread:return{...e,processingThreadIds:e.processingThreadIds.includes(t.threadId)?e.processingThreadIds:[...e.processingThreadIds,t.threadId]};case m.RemoveProcessingThread:return{...e,processingThreadIds:e.processingThreadIds.filter(e=>e!==t.threadId)};case m.AddCreatingProject:return{...e,projects:[...e.projects,{projectId:t.projectId,name:t.projectName,gitUrl:t.gitUrl,threads:[{threadId:t.threadId,title:`thread-1`,path:``,currentBranch:``}]}]};case m.AddCreatingThread:return{...e,projects:e.projects.map(e=>e.projectId===t.projectId?{...e,threads:[...e.threads,{threadId:t.threadId,title:t.title,path:``,currentBranch:``}]}:e)};case m.RemoveCreatingProject:return{...e,projects:e.projects.filter(e=>e.projectId!==t.projectId)};case m.RemoveCreatingThread:return{...e,projects:e.projects.map(e=>e.projectId===t.projectId?{...e,threads:e.threads.filter(e=>e.threadId!==t.threadId)}:e)};case m.MarkThreadCompleted:return{...e,completedThreadIds:e.completedThreadIds.includes(t.threadId)?e.completedThreadIds:[...e.completedThreadIds,t.threadId]};case m.ClearThreadCompleted:return{...e,completedThreadIds:e.completedThreadIds.filter(e=>e!==t.threadId)};case m.AddDeletingThread:return{...e,deletingThreadIds:e.deletingThreadIds.includes(t.threadId)?e.deletingThreadIds:[...e.deletingThreadIds,t.threadId]};case m.RemoveDeletingThread:return{...e,deletingThreadIds:e.deletingThreadIds.filter(e=>e!==t.threadId)};case m.AddDeletingProject:return{...e,deletingProjectIds:e.deletingProjectIds.includes(t.projectId)?e.deletingProjectIds:[...e.deletingProjectIds,t.projectId]};case m.RemoveDeletingProject:return{...e,deletingProjectIds:e.deletingProjectIds.filter(e=>e!==t.projectId)};case m.AppendCommandOutput:return{...e,commandOutput:e.commandOutput+t.content};case m.SetRunningCommand:return{...e,isRunningCommand:t.isRunning};case m.ClearCommandOutput:return{...e,commandOutput:``};case m.ToggleTerminal:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,open:!r.open}}}}case m.SetTerminalOpen:{let n=t.threadId??`default`,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,open:t.open}}}}case m.QueueTerminalCommand:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,queuedRelativeFolder:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,queuedCommand:t.command,queuedRelativeFolder:t.relativeFolder??null,open:!0}}}}case m.ClearQueuedTerminalCommand:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,queuedCommand:null}}}}case m.AppendTerminalLine:{let n=t.threadId??`default`,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,outputLines:[...r.outputLines,t.line]}}}}case m.ClearTerminalOutput:{let n=t.threadId??`default`,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,outputLines:[]}}}}case m.SetTerminalHeight:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,height:t.height}}}}case m.SetTerminalCwd:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,cwd:t.cwd}}}}case m.SetTerminalRunning:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,isRunning:t.isRunning}}}}case m.SetTerminalHistory:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,history:t.history}}}}case m.SetTerminalHistoryIndex:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,historyIndex:t.index}}}}case m.UpdateThreadTitle:return{...e,projects:e.projects.map(e=>e.projectId===t.projectId?{...e,threads:e.threads.map(e=>e.threadId===t.threadId?{...e,title:t.title}:e)}:e)};case m.ClearFocusChatInput:return{...e,focusChatInput:!1};case m.ClearMessages:return{...e,messages:[]};case m.UpdateToolCallProgress:return{...e,toolCallProgress:{...e.toolCallProgress,[t.toolCallId]:t.progress}};case m.SetPendingChatMessage:return{...e,pendingChatMessage:t.message};case m.ClearPendingChatMessage:return{...e,pendingChatMessage:null};case m.SetDiffComments:return{...e,diffComments:{...e.diffComments,[t.threadId]:t.comments}};default:return e}}var _=(0,r.createContext)({state:h,dispatch:()=>{}});function v(){return(0,r.useContext)(_)}function y(e){let t=(0,i.c)(11),{state:n,dispatch:r}=v();if(!e){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n={terminalState:{open:!1,queuedCommand:null,queuedRelativeFolder:null,outputLines:e,height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1},dispatch:b},t[1]=n):n=t[1],n}let a;t[2]!==n.terminalStates||t[3]!==e?(a=n.terminalStates[e]||{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1},t[2]=n.terminalStates,t[3]=e,t[4]=a):a=t[4];let o=a,s;t[5]!==r||t[6]!==e?(s=t=>{r({...t,threadId:e})},t[5]=r,t[6]=e,t[7]=s):s=t[7];let c=s,l;return t[8]!==c||t[9]!==o?(l={terminalState:o,dispatch:c},t[8]=c,t[9]=o,t[10]=l):l=t[10],l}function b(){}export{v as a,f as c,a as d,l as f,h as i,u as l,_ as n,y as o,o as p,g as r,p as s,m as t,d as u};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{da as t}from"./dialogs-config-BEsTbY1C.js";var n=e(t(),1),r=(0,n.createContext)({activeMainTab:`chat`,setActiveMainTab:()=>{},devServerUrl:null,setDevServerUrl:()=>{},devServerRunning:!1,setDevServerRunning:()=>{},devServerLoading:!1,setDevServerLoading:()=>{},terminalNotification:!1,setTerminalNotification:()=>{},pendingExplorerPath:null,setPendingExplorerPath:()=>{},explorerRefreshTick:0,triggerExplorerRefresh:()=>{},explorerClearPath:null,setExplorerClearPath:()=>{},browserResetTrigger:0,triggerBrowserReset:()=>{}});function i(){return(0,n.useContext)(r)}export{i as n,r as t};
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{ya as t}from"./dialogs-config-DZFG2IQM.js";var n=e(t(),1),r=(0,n.createContext)({activeMainTab:`chat`,setActiveMainTab:()=>{},devServerUrl:null,setDevServerUrl:()=>{},devServerRunning:!1,setDevServerRunning:()=>{},devServerLoading:!1,setDevServerLoading:()=>{},terminalNotification:!1,setTerminalNotification:()=>{},pendingExplorerPath:null,setPendingExplorerPath:()=>{},explorerRefreshTick:0,triggerExplorerRefresh:()=>{},explorerClearPath:null,setExplorerClearPath:()=>{},browserResetTrigger:0,triggerBrowserReset:()=>{}});function i(){return(0,n.useContext)(r)}export{i as n,r as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Cr as t,Wn as n,da as r,la as i}from"./dialogs-config-BEsTbY1C.js";import{F as a,I as o,N as s,P as c}from"./react-vendor-QkuITxN7.js";var l=i(),u=e(r(),1),d=t(),f=a,p=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=n(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,i),r[3]=i,r[4]=o);let s;return r[5]!==a||r[6]!==t||r[7]!==o?(s=(0,d.jsx)(c,{ref:t,className:o,...a}),r[5]=a,r[6]=t,r[7]=o,r[8]=s):s=r[8],s});p.displayName=c.displayName;var m=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let s;r[3]===i?s=r[4]:(s=n(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm`,i),r[3]=i,r[4]=s);let c;return r[5]!==a||r[6]!==t||r[7]!==s?(c=(0,d.jsx)(o,{ref:t,className:s,...a}),r[5]=a,r[6]=t,r[7]=s,r[8]=c):c=r[8],c});m.displayName=o.displayName;var h=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=n(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,i),r[3]=i,r[4]=o);let c;return r[5]!==a||r[6]!==t||r[7]!==o?(c=(0,d.jsx)(s,{ref:t,className:o,...a}),r[5]=a,r[6]=t,r[7]=o,r[8]=c):c=r[8],c});h.displayName=s.displayName;export{m as i,h as n,p as r,f as t};
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Jn as n,_a as r,ya as i}from"./dialogs-config-DZFG2IQM.js";import{F as a,I as o,N as s,P as c}from"./react-vendor-Bao-KYKs.js";var l=r(),u=e(i(),1),d=t(),f=a,p=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=n(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,i),r[3]=i,r[4]=o);let s;return r[5]!==a||r[6]!==t||r[7]!==o?(s=(0,d.jsx)(c,{ref:t,className:o,...a}),r[5]=a,r[6]=t,r[7]=o,r[8]=s):s=r[8],s});p.displayName=c.displayName;var m=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let s;r[3]===i?s=r[4]:(s=n(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm`,i),r[3]=i,r[4]=s);let c;return r[5]!==a||r[6]!==t||r[7]!==s?(c=(0,d.jsx)(o,{ref:t,className:s,...a}),r[5]=a,r[6]=t,r[7]=s,r[8]=c):c=r[8],c});m.displayName=o.displayName;var h=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=n(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,i),r[3]=i,r[4]=o);let c;return r[5]!==a||r[6]!==t||r[7]!==o?(c=(0,d.jsx)(s,{ref:t,className:o,...a}),r[5]=a,r[6]=t,r[7]=o,r[8]=c):c=r[8],c});h.displayName=s.displayName;export{m as i,h as n,p as r,f as t};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Cr as t,Qi as n,Qt as r,Ui as i,da as a}from"./dialogs-config-BEsTbY1C.js";import{a as o,o as s,t as c}from"./store-Dyy2UFdD.js";import{n as l}from"./tab-context-DBrXMyNd.js";var u=e(a(),1),d=t();function f(){let e=o().state,{selectedProjectId:t,selectedThreadId:a}=e,{terminalState:f,dispatch:p}=s(a),{queuedCommand:m,queuedRelativeFolder:h,outputLines:g,history:_,historyIndex:v,cwd:y,isRunning:b}=f,[x,S]=(0,u.useState)(``),[C,w]=(0,u.useState)([]),T=e.projects.flatMap(e=>e.threads).find(e=>e.threadId===a)?.path??null,E=!y||y===`.`||y===`./`?T:y,D=!E||E===T,{activeMainTab:O}=l(),k=(0,u.useRef)(null),A=(0,u.useRef)(null),j=(0,u.useRef)(0);(0,u.useEffect)(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[C]),(0,u.useEffect)(()=>{w(g),j.current=g.length},[a,g]),(0,u.useEffect)(()=>{if(g.length===0)w([]),j.current=0;else if(g.length>j.current){let e=g.slice(j.current);w(t=>[...t,...e]),j.current=g.length}},[g]),(0,u.useEffect)(()=>{b||A.current?.focus()},[b]),(0,u.useEffect)(()=>{O===`terminal`&&A.current?.focus()},[O]);let M=(0,u.useCallback)(async(e,n)=>{if(!(!t||!a||!e.trim())){p({type:c.AppendTerminalLine,line:{type:`input`,content:e}}),p({type:c.SetTerminalHistory,history:[e,..._.filter(t=>t!==e)].slice(0,50)}),p({type:c.SetTerminalHistoryIndex,index:-1}),S(``),p({type:c.SetTerminalRunning,isRunning:!0});try{let i=await r(t,a,e,n??void 0);if(!i){p({type:c.AppendTerminalLine,line:{type:`system`,content:`Command started but no output stream received.`}}),p({type:c.SetTerminalRunning,isRunning:!1});return}let o=i.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
- `);l=n.pop()??``;for(let e of n)if(e.trim())try{let t=JSON.parse(e);typeof t==`string`?p({type:c.AppendTerminalLine,line:{type:`output`,content:t}}):t.type===`error`?p({type:c.AppendTerminalLine,line:{type:`error`,content:t.message}}):t.type===`cwd`&&p({type:c.SetTerminalCwd,cwd:t.path})}catch{p({type:c.AppendTerminalLine,line:{type:`output`,content:e}})}}if(l.trim())try{let e=JSON.parse(l);typeof e==`string`?p({type:c.AppendTerminalLine,line:{type:`output`,content:e}}):e.type===`error`?p({type:c.AppendTerminalLine,line:{type:`error`,content:e.message}}):e.type===`cwd`&&p({type:c.SetTerminalCwd,cwd:e.path})}catch{p({type:c.AppendTerminalLine,line:{type:`output`,content:l}})}}catch(e){p({type:c.AppendTerminalLine,line:{type:`error`,content:e instanceof Error?e.message:`Failed to run command`}})}finally{p({type:c.SetTerminalRunning,isRunning:!1})}}},[t,a,p,_]);return(0,u.useEffect)(()=>{m&&!b&&(M(m,h??void 0),p({type:c.ClearQueuedTerminalCommand}))},[m,h,b,p,M]),(0,d.jsxs)(`div`,{className:`flex flex-col h-full bg-neutral-950 text-neutral-200 font-mono text-sm overflow-hidden`,children:[(0,d.jsxs)(`div`,{ref:k,className:`flex-1 overflow-y-auto p-4 space-y-0.5 terminal-scrollbar`,onClick:e=>{e.target===e.currentTarget&&A.current?.focus()},children:[C.length===0&&!b&&(0,d.jsx)(`div`,{className:`text-neutral-600 italic text-xs`,children:`Enter your commands below...`}),C.map((e,t)=>(0,d.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,d.jsx)(n,{className:`h-4 w-4 mt-1 shrink-0 text-blue-400/70`}),(0,d.jsx)(`span`,{children:e.content})]},t))]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-t border-white/5 bg-white/5`,children:[!D&&(0,d.jsx)(`span`,{className:`text-blue-400 text-xs font-bold whitespace-nowrap`,children:E.split(`/`).pop()}),(0,d.jsx)(n,{className:`h-4 w-4 text-blue-400 ${D?``:`-ml-1`}`}),(0,d.jsx)(`input`,{ref:A,type:`text`,className:`flex-1 bg-transparent border-none outline-none text-neutral-200 placeholder:text-neutral-700 h-6`,placeholder:b?`Running...`:`Type a command...`,value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{if(e.key===`Enter`)M(x);else if(e.key===`ArrowUp`){e.preventDefault();let t=v+1;t<_.length&&(p({type:c.SetTerminalHistoryIndex,index:t}),S(_[t]))}else if(e.key===`ArrowDown`){e.preventDefault();let t=v-1;t>=0?(p({type:c.SetTerminalHistoryIndex,index:t}),S(_[t])):(p({type:c.SetTerminalHistoryIndex,index:-1}),S(``))}},disabled:b}),(0,d.jsxs)(`div`,{className:`flex items-center gap-1 px-1.5 py-0.5 rounded border border-white/10 bg-white/5`,children:[(0,d.jsx)(i,{className:`h-3 w-3 text-neutral-600`}),(0,d.jsx)(`span`,{className:`text-[10px] text-neutral-600 uppercase font-bold`,children:`Enter`})]})]})]})}export{f as TerminalPanel};
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Xi as n,aa as r,tn as i,ya as a}from"./dialogs-config-DZFG2IQM.js";import{a as o,o as s,t as c}from"./store-CwvBC-YP.js";import{n as l}from"./tab-context-CCvlrC0o.js";var u=e(a(),1),d=t();function f(){let e=o().state,{selectedProjectId:t,selectedThreadId:a}=e,{terminalState:f,dispatch:p}=s(a),{queuedCommand:m,queuedRelativeFolder:h,outputLines:g,history:_,historyIndex:v,cwd:y,isRunning:b}=f,[x,S]=(0,u.useState)(``),[C,w]=(0,u.useState)([]),T=e.projects.flatMap(e=>e.threads).find(e=>e.threadId===a)?.path??null,E=!y||y===`.`||y===`./`?T:y,D=!E||E===T,{activeMainTab:O}=l(),k=(0,u.useRef)(null),A=(0,u.useRef)(null),j=(0,u.useRef)(0);(0,u.useEffect)(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[C]),(0,u.useEffect)(()=>{w(g),j.current=g.length},[a,g]),(0,u.useEffect)(()=>{if(g.length===0)w([]),j.current=0;else if(g.length>j.current){let e=g.slice(j.current);w(t=>[...t,...e]),j.current=g.length}},[g]),(0,u.useEffect)(()=>{b||A.current?.focus()},[b]),(0,u.useEffect)(()=>{O===`terminal`&&A.current?.focus()},[O]);let M=(0,u.useCallback)(async(e,n)=>{if(!(!t||!a||!e.trim())){p({type:c.AppendTerminalLine,line:{type:`input`,content:e}}),p({type:c.SetTerminalHistory,history:[e,..._.filter(t=>t!==e)].slice(0,50)}),p({type:c.SetTerminalHistoryIndex,index:-1}),S(``),p({type:c.SetTerminalRunning,isRunning:!0});try{let r=await i(t,a,e,n??void 0);if(!r){p({type:c.AppendTerminalLine,line:{type:`system`,content:`Command started but no output stream received.`}}),p({type:c.SetTerminalRunning,isRunning:!1});return}let o=r.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
+ `);l=n.pop()??``;for(let e of n)if(e.trim())try{let t=JSON.parse(e);typeof t==`string`?p({type:c.AppendTerminalLine,line:{type:`output`,content:t}}):t.type===`error`?p({type:c.AppendTerminalLine,line:{type:`error`,content:t.message}}):t.type===`cwd`&&p({type:c.SetTerminalCwd,cwd:t.path})}catch{p({type:c.AppendTerminalLine,line:{type:`output`,content:e}})}}if(l.trim())try{let e=JSON.parse(l);typeof e==`string`?p({type:c.AppendTerminalLine,line:{type:`output`,content:e}}):e.type===`error`?p({type:c.AppendTerminalLine,line:{type:`error`,content:e.message}}):e.type===`cwd`&&p({type:c.SetTerminalCwd,cwd:e.path})}catch{p({type:c.AppendTerminalLine,line:{type:`output`,content:l}})}}catch(e){p({type:c.AppendTerminalLine,line:{type:`error`,content:e instanceof Error?e.message:`Failed to run command`}})}finally{p({type:c.SetTerminalRunning,isRunning:!1})}}},[t,a,p,_]);return(0,u.useEffect)(()=>{m&&!b&&(M(m,h??void 0),p({type:c.ClearQueuedTerminalCommand}))},[m,h,b,p,M]),(0,d.jsxs)(`div`,{className:`flex flex-col h-full bg-neutral-950 text-neutral-200 font-mono text-sm overflow-hidden`,children:[(0,d.jsxs)(`div`,{ref:k,className:`flex-1 overflow-y-auto p-4 space-y-0.5 terminal-scrollbar`,onClick:e=>{e.target===e.currentTarget&&A.current?.focus()},children:[C.length===0&&!b&&(0,d.jsx)(`div`,{className:`text-neutral-600 italic text-xs`,children:`Enter your commands below...`}),C.map((e,t)=>(0,d.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,d.jsx)(r,{className:`h-4 w-4 mt-1 shrink-0 text-blue-400/70`}),(0,d.jsx)(`span`,{children:e.content})]},t))]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-t border-white/5 bg-white/5`,children:[!D&&(0,d.jsx)(`span`,{className:`text-blue-400 text-xs font-bold whitespace-nowrap`,children:E.split(`/`).pop()}),(0,d.jsx)(r,{className:`h-4 w-4 text-blue-400 ${D?``:`-ml-1`}`}),(0,d.jsx)(`input`,{ref:A,type:`text`,className:`flex-1 bg-transparent border-none outline-none text-neutral-200 placeholder:text-neutral-700 h-6`,placeholder:b?`Running...`:`Type a command...`,value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{if(e.key===`Enter`)M(x);else if(e.key===`ArrowUp`){e.preventDefault();let t=v+1;t<_.length&&(p({type:c.SetTerminalHistoryIndex,index:t}),S(_[t]))}else if(e.key===`ArrowDown`){e.preventDefault();let t=v-1;t>=0?(p({type:c.SetTerminalHistoryIndex,index:t}),S(_[t])):(p({type:c.SetTerminalHistoryIndex,index:-1}),S(``))}},disabled:b}),(0,d.jsxs)(`div`,{className:`flex items-center gap-1 px-1.5 py-0.5 rounded border border-white/10 bg-white/5`,children:[(0,d.jsx)(n,{className:`h-3 w-3 text-neutral-600`}),(0,d.jsx)(`span`,{className:`text-[10px] text-neutral-600 uppercase font-bold`,children:`Enter`})]})]})]})}export{f as TerminalPanel};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Cr as t,Wn as n,da as r,la as i}from"./dialogs-config-BEsTbY1C.js";var a=i(),o=e(r(),1),s=t(),c=o.forwardRef((e,t)=>{let r=(0,a.c)(9),i,o;r[0]===e?(i=r[1],o=r[2]):({className:i,...o}=e,r[0]=e,r[1]=i,r[2]=o);let c;r[3]===i?c=r[4]:(c=n(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,i),r[3]=i,r[4]=c);let l;return r[5]!==o||r[6]!==t||r[7]!==c?(l=(0,s.jsx)(`textarea`,{className:c,ref:t,...o}),r[5]=o,r[6]=t,r[7]=c,r[8]=l):l=r[8],l});c.displayName=`Textarea`;export{c as t};
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Jn as n,_a as r,ya as i}from"./dialogs-config-DZFG2IQM.js";var a=r(),o=e(i(),1),s=t(),c=o.forwardRef((e,t)=>{let r=(0,a.c)(9),i,o;r[0]===e?(i=r[1],o=r[2]):({className:i,...o}=e,r[0]=e,r[1]=i,r[2]=o);let c;r[3]===i?c=r[4]:(c=n(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,i),r[3]=i,r[4]=c);let l;return r[5]!==o||r[6]!==t||r[7]!==c?(l=(0,s.jsx)(`textarea`,{className:c,ref:t,...o}),r[5]=o,r[6]=t,r[7]=c,r[8]=l):l=r[8],l});c.displayName=`Textarea`;export{c as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./index-BTbiyooe.js";export{e as TodosView};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{da as t,la as n}from"./dialogs-config-BEsTbY1C.js";var r=n(),i=e(t(),1),a=1,o=1e6,s=0;function c(){return s=(s+1)%(2**53-1),s.toString()}var l=new Map,u=e=>{if(l.has(e))return;let t=setTimeout(()=>{l.delete(e),m({type:`REMOVE_TOAST`,toastId:e})},o);l.set(e,t)},d=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,a)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?u(n):e.toasts.forEach(e=>{u(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},f=[],p={toasts:[]};function m(e){p=d(p,e),f.forEach(e=>{e(p)})}function h({...e}){let t=c(),n=e=>m({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>m({type:`DISMISS_TOAST`,toastId:t});return m({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function g(){let e=(0,r.c)(5),[t,n]=i.useState(p),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>(f.push(n),()=>{let e=f.indexOf(n);e>-1&&f.splice(e,1)}),e[0]=a):a=e[0];let o;e[1]===t?o=e[2]:(o=[t],e[1]=t,e[2]=o),i.useEffect(a,o);let s;return e[3]===t?s=e[4]:(s={...t,toast:h,dismiss:_},e[3]=t,e[4]=s),s}function _(e){return m({type:`DISMISS_TOAST`,toastId:e})}export{g as n,h as t};
1
+ import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{_a as t,ya as n}from"./dialogs-config-DZFG2IQM.js";var r=t(),i=e(n(),1),a=1,o=1e6,s=0;function c(){return s=(s+1)%(2**53-1),s.toString()}var l=new Map,u=e=>{if(l.has(e))return;let t=setTimeout(()=>{l.delete(e),m({type:`REMOVE_TOAST`,toastId:e})},o);l.set(e,t)},d=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,a)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?u(n):e.toasts.forEach(e=>{u(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},f=[],p={toasts:[]};function m(e){p=d(p,e),f.forEach(e=>{e(p)})}function h({...e}){let t=c(),n=e=>m({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>m({type:`DISMISS_TOAST`,toastId:t});return m({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function g(){let e=(0,r.c)(5),[t,n]=i.useState(p),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>(f.push(n),()=>{let e=f.indexOf(n);e>-1&&f.splice(e,1)}),e[0]=a):a=e[0];let o;e[1]===t?o=e[2]:(o=[t],e[1]=t,e[2]=o),i.useEffect(a,o);let s;return e[3]===t?s=e[4]:(s={...t,toast:h,dismiss:_},e[3]=t,e[4]=s),s}function _(e){return m({type:`DISMISS_TOAST`,toastId:e})}export{g as n,h as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{da as t}from"./dialogs-config-BEsTbY1C.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-B1FJdls4.js";import{ya as t}from"./dialogs-config-DZFG2IQM.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};
@@ -0,0 +1,2 @@
1
+ import{bt as e}from"./react-vendor-Bao-KYKs.js";var t=class e{static levels={DEBUG:0,INFO:1,WARN:2,ERROR:3};level;prefix;constructor(t=e.levels.INFO,n=``){this.level=t,this.prefix=n}debug(...t){this.level<=e.levels.DEBUG&&console.debug(`[${this.prefix}] [DEBUG]`,...t)}info(...t){this.level<=e.levels.INFO&&console.info(`[${this.prefix}] [INFO]`,...t)}warn(...t){this.level<=e.levels.WARN&&console.warn(`[${this.prefix}] [WARN]`,...t)}error(...t){this.level<=e.levels.ERROR&&console.error(`[${this.prefix}] [ERROR]`,...t)}setLevel(e){this.level=e}getLevel(){return this.level}};function n(e){try{return JSON.stringify(e)}catch{return`"[non-serializable]"`}}function r(e){let t;try{t=n(e)}catch{console.error(`[voice-log] failed to serialize log payload`);return}fetch(`/api/logs`,{method:`POST`,headers:{"Content-Type":`application/json`},body:t}).catch(e=>{console.error(`[voice-log] fetch to /api/logs failed:`,e)})}function i(e){function t(t,n,i){r({level:t,context:e,message:n,data:i});let a=`[${e}]`;t===`ERROR`?console.error(a,n,i??``):t===`WARN`?console.warn(a,n,i??``):t===`DEBUG`?console.debug(a,n,i??``):console.info(a,n,i??``)}return{debug:(e,n)=>t(`DEBUG`,e,n),info:(e,n)=>t(`INFO`,e,n),warn:(e,n)=>t(`WARN`,e,n),error:(e,n)=>t(`ERROR`,e,n),separator:e=>t(`INFO`,`${`─`.repeat(20)} ${e} ${`─`.repeat(20)}`)}}var a=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),o={language:`auto`,threads:4,translate:!1};function s(e){let t=String(e).trim().replace(`,`,`.`),n=t.split(`:`).map(Number);if(n.some(Number.isNaN))throw Error(`Bad time: "${e}"`);let r=0,i=0,a=0;if(n.length===3)[r,i]=n,a=parseFloat(t.split(`:`).pop()||`0`);else if(n.length===2)[i]=n,a=parseFloat(t.split(`:`).pop()||`0`);else throw Error(`Bad time format: "${e}"`);return Math.floor(((r*60+i)*60+a)*1e3)}function c(e){let t=/^\s*\[?\s*([0-9]{1,2}:[0-9]{2}:(?:[0-9]{2}[.,][0-9]{1,3})|[0-9]{1,2}:[0-9]{2}[.,][0-9]{1,3})\s*-->\s*([0-9]{1,2}:[0-9]{2}:(?:[0-9]{2}[.,][0-9]{1,3})|[0-9]{1,2}:[0-9]{2}[.,][0-9]{1,3})\s*\]?\s*(.*)\s*$/.exec(e);if(!t)throw Error(`Line does not match VTT-like pattern: `+e);let n=t[1],r=t[2],i=t[3]||``,a=s(n),o=s(r);if(o<a)throw Error(`End time is before start time`);return{startMs:a,endMs:o,start:n,end:r,text:i}}function l(e){return new Promise(t=>setTimeout(t,e))}function u(e,t){let n=null,r=!1,i=null,a=null;return{timeoutError:()=>new Promise((o,s)=>{a=o,i=s,n=setTimeout(()=>{!r&&i&&(r=!0,i(Error(t)))},e)}),clear:()=>{n&&=(clearTimeout(n),null),a&&=(a(),null),r=!0,i=null}}}function d(e,t=16e3*100){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.subarray(r,r+t));return n}var f=class{logger;constructor(e,n){this.whisperService=e,this.logger=new t(n?.logLevel||t.levels.ERROR,`TranscriptionSession`)}async*streaming(e,t={}){let{timeoutMs:n=3e4}=t,r=d(e),i=0;for(let e of r){let r=[],a=null,o=!1,s,c=0,{timeoutError:d,clear:f}=u(n,`Transcribe timeout`),p=()=>this.whisperService.transcribe(e,e=>{c=e.timeEnd,e.timeStart+=i,e.timeEnd+=i,this.logger.debug(`Transcription segment in session:`,e),a?(a(e),a=null):r.push(e),f()},t).then(()=>{this.logger.debug(`Transcription done in session then`),o=!0,i+=c,f(),a?.(void 0)}).catch(e=>{this.logger.debug(`Transcription error in session catch:`,e),s=e,f(),a?.(void 0)});for(p();;){if(s){if(t.restartModelOnError){this.whisperService.restartModel(),p();continue}throw s}if(o)break;if(r.length)yield r.shift();else try{let e=await Promise.race([new Promise(e=>a=e),d()]);e&&(yield e)}catch(e){s=e}}t.sleepMsBetweenChunks&&await l(t.sleepMsBetweenChunks)}}async*streamimg(e,t={}){yield*this.streaming(e,t)}},p=i(`WhisperWasmService`),m=class extends EventTarget{on(e,t){return this.addEventListener(e,t),()=>this.removeEventListener(e,t)}emit(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))}},h=class{wasmModule=null;instance=null;modelFileName=`whisper.bin`;isTranscribing=!1;bus=new m;logger;modelData=null;constructor(e){this.logger=new t(e?.logLevel??t.levels.ERROR,`WhisperWasmService`),e?.init&&this.loadWasmScript()}async checkWasmSupport(){return await a()}async loadWasmScript(){let t=`${typeof window<`u`?window.location.origin:``}/wasm/libmain-D9-QM3iM.mjs`;p.info(`Loading WASM script`,{url:t}),this.wasmModule=await(await e(async()=>{let{default:e}=await import(t);return{default:e}},[])).default({print:(e,...t)=>{t.length>0&&this.logger.debug(t),e.startsWith(`[`)?(this.logger.info(e),this.bus.emit(`transcribe`,e)):(this.logger.debug(e),this.bus.emit(`system_info`,e))},printErr:(e,...t)=>{t.length>0&&this.logger.debug(t),this.logger.warn(e),p.warn(`WASM stderr output`,{message:e,extra:t.length?t:void 0}),this.bus.emit(`transcribeError`,e)}}),p.info(`WASM script loaded successfully`)}async initModel(e){if(!await this.checkWasmSupport())throw Error(`WASM is not supported`);return p.info(`Initializing WASM model`,{sizeBytes:e.byteLength,sizeMB:(e.byteLength/1024/1024).toFixed(2)}),this.modelData=e,this.wasmModule&&(this.wasmModule.FS_unlink(this.modelFileName),this.wasmModule.free(),p.debug(`Previous WASM module freed`)),await this.loadWasmScript(),await l(100),p.info(`Storing model in WASM FS`,{fileName:this.modelFileName,sizeBytes:e.byteLength}),this.storeFS(this.modelFileName,e),p.info(`Creating WASM instance`),this.instance=this.wasmModule.init(this.modelFileName),p.info(`WASM instance created`,{instance:this.instance}),Promise.resolve()}restartModel(){if(!this.modelData)throw Error(`Model not loaded`);return this.initModel(this.modelData)}storeFS(e,t){if(!this.wasmModule)throw Error(`WASM module not loaded`);try{this.wasmModule.FS_unlink(e)}catch{}this.wasmModule.FS_createDataFile(`/`,e,t,!0,!0,!0)}async transcribe(e,t,n={}){if(this.isTranscribing)throw Error(`Already transcribing`);if(!this.wasmModule)throw Error(`WASM module not loaded`);if(!this.instance)throw Error(`WASM instance not loaded`);e.length>16e3*120&&this.logger.warn(`It's not recommended to transcribe audio data that is longer than 120 seconds`),this.isTranscribing=!0;let{language:r=`auto`,threads:i=4,translate:a=!1}={...o,...n},s=[],l=Date.now();p.info(`Calling WASM full_default`,{sampleCount:e.length,durationSec:(e.length/16e3).toFixed(2),language:r,threads:i,translate:a,instance:this.instance});try{this.wasmModule.full_default(this.instance,e,r,i,a),p.info(`WASM full_default returned without throwing`)}catch(e){let t=e instanceof Error?e.message:String(e);throw p.error(`WASM full_default threw an exception`,{error:t,type:e instanceof Error?e.constructor.name:typeof e,stack:e instanceof Error?e.stack?.split(`
2
+ `).slice(0,5).join(` | `):void 0}),this.isTranscribing=!1,e}return await new Promise((e,n)=>{let r=this.bus.on(`transcribe`,e=>{let{startMs:n,endMs:r,text:i}=c(e.detail),a={timeStart:n,timeEnd:r,text:i,raw:e.detail};s.push(a),t?.(a)}),i=setTimeout(()=>{this.isTranscribing=!1,r(),a(),this.logger.error(`Transcribe timeout`),n(Error(`Transcribe timeout`)),this.bus.emit(`transcribeError`,`Transcribe timeout`)},240*1e3),a=this.bus.on(`transcribeError`,t=>{this.isTranscribing=!1,r(),a(),clearTimeout(i),this.logger.debug(`Transcribe error`,t.detail),e({segments:s,transcribeDurationMs:Date.now()-l})})})}createSession(){return new f(this,{logLevel:this.logger.getLevel()})}},g={"tiny.en":{id:`tiny.en`,name:`Tiny English`,size:75,language:`en`,quantized:!1,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.en.bin`},tiny:{id:`tiny`,name:`Tiny Multilingual`,size:75,language:`multilingual`,quantized:!1,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin`},"base.en":{id:`base.en`,name:`Base English`,size:142,language:`en`,quantized:!1,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.en.bin`},base:{id:`base`,name:`Base Multilingual`,size:142,language:`multilingual`,quantized:!1,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.bin`},"small.en":{id:`small.en`,name:`Small English`,size:466,language:`en`,quantized:!1,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.en.bin`},small:{id:`small`,name:`Small Multilingual`,size:466,language:`multilingual`,quantized:!1,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin`},"tiny.en-q5_1":{id:`tiny.en-q5_1`,name:`Tiny English (Q5_1)`,size:31,language:`en`,quantized:!0,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.en-q5_1.bin`},"tiny-q5_1":{id:`tiny-q5_1`,name:`Tiny Multilingual (Q5_1)`,size:31,language:`multilingual`,quantized:!0,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny-q5_1.bin`},"base.en-q5_1":{id:`base.en-q5_1`,name:`Base English (Q5_1)`,size:57,language:`en`,quantized:!0,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.en-q5_1.bin`},"base-q5_1":{id:`base-q5_1`,name:`Base Multilingual (Q5_1)`,size:57,language:`multilingual`,quantized:!0,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base-q5_1.bin`},"small.en-q5_1":{id:`small.en-q5_1`,name:`Small English (Q5_1)`,size:182,language:`en`,quantized:!0,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.en-q5_1.bin`},"small-q5_1":{id:`small-q5_1`,name:`Small Multilingual (Q5_1)`,size:182,language:`multilingual`,quantized:!0,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small-q5_1.bin`},"medium.en-q5_0":{id:`medium.en-q5_0`,name:`Medium English (Q5_0)`,size:515,language:`en`,quantized:!0,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-medium.en-q5_0.bin`},"medium-q5_0":{id:`medium-q5_0`,name:`Medium Multilingual (Q5_0)`,size:515,language:`multilingual`,quantized:!0,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-medium-q5_0.bin`},"large-q5_0":{id:`large-q5_0`,name:`Large Multilingual (Q5_0)`,size:1030,language:`multilingual`,quantized:!0,url:`https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-q5_0.bin`}};function _(){return Object.values(g).map(({url:e,...t})=>t)}function v(e){return g[e]}var y=class{cacheEnabled=!0;models=_();logger;constructor(e={logLevel:t.levels.ERROR}){this.logger=new t(e.logLevel,`ModelManager`)}async loadModel(e,t=!0,n){let r=v(e);if(!r)throw Error(`Model ${e} not found in config`);if(this.cacheEnabled&&t){let t=await this.getCachedModel(e);if(t)return this.logger.info(`Model ${e} loaded from cache`),n&&n(100),t}this.logger.info(`Loading model ${e} from ${r.url}`);let i=await fetch(r.url);if(!i.ok)throw Error(`Failed to load model: ${i.statusText}`);let a=i.headers.get(`content-length`),o=a?parseInt(a,10):0,s=0,c=i.body?.getReader();if(!c)throw Error(`Response body is not readable`);let l=[];try{let e=!1;for(;!e;){let t=await c.read();e=t.done,!e&&t.value&&(l.push(t.value),s+=t.value.length,n&&o>0&&n(Math.round(s/o*100)))}}finally{c.releaseLock()}let u=l.reduce((e,t)=>e+t.length,0),d=new Uint8Array(u),f=0;for(let e of l)d.set(e,f),f+=e.length;return this.cacheEnabled&&t&&await this.saveModelToCache(e,d),n&&n(100),d}async loadModelByUrl(e,t){try{if(this.cacheEnabled){let n=await this.getCachedModelByUrl(e);if(n)return this.logger.info(`WASM module loaded from cache by URL: ${e}`),t&&t(100),n}this.logger.info(`Loading WASM module from URL: ${e}`);let n=await fetch(e);if(!n.ok)throw Error(`Failed to load WASM module: ${n.statusText}`);let r=n.headers.get(`content-length`),i=r?parseInt(r,10):0,a=0,o=n.body?.getReader();if(!o)throw Error(`Response body is not readable`);let s=[];try{let e=!1;for(;!e;){let n=await o.read();e=n.done,!e&&n.value&&(s.push(n.value),a+=n.value.length,t&&i>0&&t(Math.round(a/i*100)))}}finally{o.releaseLock()}let c=s.reduce((e,t)=>e+t.length,0),l=new Uint8Array(c),u=0;for(let e of s)l.set(e,u),u+=e.length;return this.cacheEnabled&&await this.saveModelToCacheByUrl(e,l),t&&t(100),l}catch(e){this.logger.error(e);let t=e instanceof Error?e.message:`Failed to load WASM module`;throw Error(t)}}async getCachedModelByUrl(e){try{let t=(await this.openIndexedDB()).transaction([`modelsByUrl`],`readonly`).objectStore(`modelsByUrl`);return new Promise((n,r)=>{let i=t.get(e);i.onsuccess=()=>{let e=i.result;e&&e.data?n(e.data):n(null)},i.onerror=()=>r(i.error)})}catch(e){return this.logger.error(`Error reading model from cache by URL:`,e),null}}async saveModelToCacheByUrl(e,t){try{let n=(await this.openIndexedDB()).transaction([`modelsByUrl`],`readwrite`).objectStore(`modelsByUrl`);await new Promise((r,i)=>{let a=n.put({url:e,data:t,timestamp:Date.now(),size:t.length});a.onsuccess=()=>r(),a.onerror=()=>i(a.error)}),this.logger.info(`Model saved to cache by URL: ${e}`)}catch(e){this.logger.error(`Error saving model to cache by URL:`,e)}}async getAvailableModels(){let e=[...this.models];if(!this.cacheEnabled)return e;try{let t=await this.getCachedModelNames();return e.map(e=>({...e,cached:t.includes(e.id)}))}catch(t){return this.logger.error(`Error checking cache status:`,t),e}}getAvailableModelsSync(){return[...this.models]}getModelConfig(e){return v(e)}async saveModelToCache(e,t){try{let n=(await this.openIndexedDB()).transaction([`models`],`readwrite`).objectStore(`models`);await new Promise((r,i)=>{let a=n.put({name:e,data:t,timestamp:Date.now(),size:t.length});a.onsuccess=()=>r(),a.onerror=()=>i(a.error)}),this.logger.info(`Model ${e} saved to cache`)}catch(e){this.logger.error(`Error saving model to cache:`,e)}}async getCachedModel(e){try{let t=(await this.openIndexedDB()).transaction([`models`],`readonly`).objectStore(`models`);return new Promise((n,r)=>{let i=t.get(e);i.onsuccess=()=>{let e=i.result;e&&e.data?n(e.data):n(null)},i.onerror=()=>r(i.error)})}catch(e){return this.logger.error(`Error getting cached model:`,e),null}}async getCachedModelNames(){try{let e=(await this.openIndexedDB()).transaction([`models`],`readonly`).objectStore(`models`);return new Promise((t,n)=>{let r=e.getAllKeys();r.onsuccess=()=>{let e=r.result;t(e)},r.onerror=()=>n(r.error)})}catch(e){return this.logger.error(`Error getting cached model names:`,e),[]}}async openIndexedDB(){return new Promise((e,t)=>{let n=indexedDB.open(`WhisperModels`,2);n.onerror=()=>t(n.error),n.onsuccess=()=>e(n.result),n.onupgradeneeded=e=>{let t=e.target.result;if(!t.objectStoreNames.contains(`models`)){let e=t.createObjectStore(`models`,{keyPath:`name`});e.createIndex(`timestamp`,`timestamp`,{unique:!1}),e.createIndex(`size`,`size`,{unique:!1})}if(!t.objectStoreNames.contains(`modelsByUrl`)){let e=t.createObjectStore(`modelsByUrl`,{keyPath:`url`});e.createIndex(`timestamp`,`timestamp`,{unique:!1}),e.createIndex(`size`,`size`,{unique:!1})}}})}async clearCache(){try{let e=(await this.openIndexedDB()).transaction([`models`,`modelsByUrl`],`readwrite`),t=e.objectStore(`models`);await new Promise((e,n)=>{let r=t.clear();r.onsuccess=()=>e(),r.onerror=()=>n(r.error)});let n=e.objectStore(`modelsByUrl`);await new Promise((e,t)=>{let r=n.clear();r.onsuccess=()=>e(),r.onerror=()=>t(r.error)}),this.logger.info(`Model cache cleared`)}catch(e){this.logger.error(`Error clearing cache:`,e)}}async getCacheInfo(){try{let e=(await this.openIndexedDB()).transaction([`models`],`readonly`).objectStore(`models`);return new Promise((t,n)=>{let r=e.getAll();r.onsuccess=()=>{let e=r.result,n=e.reduce((e,t)=>e+(t.size||0),0);t({count:e.length,totalSize:n})},r.onerror=()=>n(r.error)})}catch(e){return this.logger.error(`Error getting cache info:`,e),{count:0,totalSize:0}}}},b={targetSampleRate:16e3,targetChannels:1,inputSampleRate:16e3,normalize:!0,noiseReduction:!1,logLevel:t.levels.ERROR,signal:void 0,recordingDurationMs:1e4};function x(e){return typeof e==`number`?e:e?t.levels[e]:t.levels.ERROR}function S(e){return new t(x(e.logLevel),`AudioConverter`)}function C(e){if(e?.aborted)throw new DOMException(`Aborted`,`AbortError`)}function w(){return typeof window>`u`?!1:!!(window.AudioContext||window.webkitAudioContext||window.OfflineAudioContext||window.webkitOfflineAudioContext)}async function T(e,t={},n={}){if(!w())throw Error(`Web Audio API is not supported in this browser`);let r={...b,...t},i=S(r),a=[];try{C(r.signal),i.info(`Converting from MediaStream`),n.onProgress?.(0,`Starting recording...`);let t=await N(e,r,n,i);n.onProgress?.(50,`Recording completed, decoding...`);let o=await E(await t.arrayBuffer(),r,n,i);n.onProgress?.(70,`Audio decoded, processing...`);let s=await D(o,r,n,i,a);return n.onProgress?.(100,`Conversion completed`),s}catch(e){throw i.error(`MediaStream conversion failed:`,e),n.onError?.(e),e}}async function E(e,t,n,r){n.onProgress?.(15,`Decoding audio data`);let i=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t.targetSampleRate});try{return await i.decodeAudioData(e)}catch(e){throw r.error(`Audio decoding failed:`,e),Error(`Failed to decode audio: ${e.message}`)}finally{try{await i.close()}catch{}}}async function D(e,t,n,r,i){n.onProgress?.(50,`Converting audio format...`),M(e,t,i);let a=await O(e,t,n);n.onProgress?.(70,`Converting to Float32Array...`);let o=k(a);return n.onProgress?.(80,`Applying effects...`),t.normalize&&A(o),t.noiseReduction&&j(o),n.onProgress?.(90,`Finalizing...`),{audioData:o,audioInfo:{sampleRate:a.sampleRate,duration:a.duration,channels:a.numberOfChannels,bitDepth:32,format:`float32`},warnings:i.length>0?i:void 0}}async function O(e,t,n){n.onProgress?.(60,`Converting audio format...`);let r=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(t.targetChannels,Math.floor(e.length*t.targetSampleRate/e.sampleRate),t.targetSampleRate),i=r.createBufferSource();return i.buffer=e,i.connect(r.destination),i.start(0),await r.startRendering()}function k(e){if(e.numberOfChannels===1)return e.getChannelData(0);{let t=e.getChannelData(0),n=e.getChannelData(1),r=new Float32Array(t.length);for(let e=0;e<t.length;e++)r[e]=(t[e]+n[e])/2;return r}}function A(e){let t=0;for(let n=0;n<e.length;n++)t=Math.max(t,Math.abs(e[n]));if(t>0){let n=.95/t;for(let t=0;t<e.length;t++)e[t]*=n}}function j(e){let t=new Float32Array(e.length);for(let n=0;n<e.length;n++){let r=0,i=0;for(let t=Math.max(0,n-3);t<=Math.min(e.length-1,n+3);t++)r+=e[t],i++;t[n]=r/i}e.set(t)}function M(e,t,n){e.numberOfChannels>2&&n.push(`Audio has ${e.numberOfChannels} channels, will be mixed to mono`),e.sampleRate!==t.targetSampleRate&&n.push(`Audio sample rate (${e.sampleRate}Hz) will be converted to ${t.targetSampleRate}Hz`)}async function N(e,t,n,r){if(typeof window>`u`)throw Error(`MediaStream recording is only supported in browser environments`);if(!window.MediaRecorder)throw Error(`MediaRecorder is not supported in this browser`);let i=window.MediaRecorder,a=[`audio/webm;codecs=opus`,`audio/webm`,`audio/ogg;codecs=opus`,`audio/ogg`].find(e=>i.isTypeSupported(e)),o=new i(e,a?{mimeType:a}:void 0),s=[],c=new Promise((e,t)=>{o.ondataavailable=e=>{e.data&&e.data.size>0&&s.push(e.data)},o.onerror=()=>t(Error(`MediaRecorder error`)),o.onstop=()=>{let t=a||o.mimeType||`application/octet-stream`;e(new Blob(s,{type:t}))}}),l=t.signal,u=()=>{try{o.state!==`inactive`&&o.stop()}catch{}};l?.addEventListener(`abort`,u,{once:!0});let d=t.recordingDurationMs??1e4,f=setTimeout(()=>{try{o.state!==`inactive`&&o.stop()}catch{}},d);n.onProgress?.(20,`Recording audio...`),r.debug(`Starting MediaRecorder`,{mimeType:a??o.mimeType,durationMs:d}),o.start(250);try{return await c}finally{clearTimeout(f),l?.removeEventListener(`abort`,u)}}export{i,y as n,h as r,T as t};
@@ -19,27 +19,28 @@
19
19
  <meta name="apple-mobile-web-app-title" content="Tarsk" />
20
20
 
21
21
  <title>Tarsk</title>
22
- <script type="module" crossorigin src="/assets/index-Q5OqmtNF.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-BTbiyooe.js"></script>
23
23
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-B1FJdls4.js">
24
- <link rel="modulepreload" crossorigin href="/assets/dialogs-config-BEsTbY1C.js">
25
- <link rel="modulepreload" crossorigin href="/assets/history-view-_L50vkTM.js">
26
- <link rel="modulepreload" crossorigin href="/assets/monaco-c-HyCuEi.js">
27
- <link rel="modulepreload" crossorigin href="/assets/react-vendor-QkuITxN7.js">
28
- <link rel="modulepreload" crossorigin href="/assets/onboarding-C_q_uRK0.js">
29
- <link rel="modulepreload" crossorigin href="/assets/alert-dialog-DXEB8gMn.js">
30
- <link rel="modulepreload" crossorigin href="/assets/use-toast-BqYP6xbg.js">
31
- <link rel="modulepreload" crossorigin href="/assets/store-Dyy2UFdD.js">
32
- <link rel="modulepreload" crossorigin href="/assets/tab-context-DBrXMyNd.js">
33
- <link rel="modulepreload" crossorigin href="/assets/chat-input-container-C8o4YcJZ.js">
34
- <link rel="modulepreload" crossorigin href="/assets/page-toolbar-DM-x5q1_.js">
35
- <link rel="modulepreload" crossorigin href="/assets/run-stop-button-CZ62jJDn.js">
36
- <link rel="modulepreload" crossorigin href="/assets/side-panel-container-DVnN8vFb.js">
37
- <link rel="modulepreload" crossorigin href="/assets/resizable-GT3fWOfA.js">
38
- <link rel="modulepreload" crossorigin href="/assets/standard-list-item-ByRgCvKd.js">
39
- <link rel="modulepreload" crossorigin href="/assets/tabs-DxQZhlZp.js">
40
- <link rel="modulepreload" crossorigin href="/assets/textarea-CUYwgm5q.js">
41
- <link rel="modulepreload" crossorigin href="/assets/utils-BavofGRh.js">
42
- <link rel="stylesheet" crossorigin href="/assets/index-CAoVFXj2.css">
24
+ <link rel="modulepreload" crossorigin href="/assets/dialogs-config-DZFG2IQM.js">
25
+ <link rel="modulepreload" crossorigin href="/assets/history-view-BR8scGnM.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/monaco-DDfTQM3i.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/react-vendor-Bao-KYKs.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/onboarding-Cn5RqOCa.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/alert-dialog--tUzAWFm.js">
30
+ <link rel="modulepreload" crossorigin href="/assets/use-toast-DqmC-mB5.js">
31
+ <link rel="modulepreload" crossorigin href="/assets/store-CwvBC-YP.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/tab-context-CCvlrC0o.js">
33
+ <link rel="modulepreload" crossorigin href="/assets/whisper-wasm-Clnf-l-9.js">
34
+ <link rel="modulepreload" crossorigin href="/assets/utils-Cy2s2TEb.js">
35
+ <link rel="modulepreload" crossorigin href="/assets/chat-input-container-B_qVOGzW.js">
36
+ <link rel="modulepreload" crossorigin href="/assets/page-toolbar-TvYsDwUY.js">
37
+ <link rel="modulepreload" crossorigin href="/assets/run-stop-button-k1LeM0M-.js">
38
+ <link rel="modulepreload" crossorigin href="/assets/side-panel-container-oMcXib2A.js">
39
+ <link rel="modulepreload" crossorigin href="/assets/resizable-DzrIos_Y.js">
40
+ <link rel="modulepreload" crossorigin href="/assets/standard-list-item-D2lbPXa1.js">
41
+ <link rel="modulepreload" crossorigin href="/assets/tabs-Mb_cjIfE.js">
42
+ <link rel="modulepreload" crossorigin href="/assets/textarea-DpXOZLt8.js">
43
+ <link rel="stylesheet" crossorigin href="/assets/index-0BuHfewk.css">
43
44
  </head>
44
45
  <body class="font-sans antialiased">
45
46
  <div id="root"></div>