tarsk 0.4.26 → 0.4.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +634 -198
- package/dist/public/assets/account-view-DcpSNB3N.js +1 -0
- package/dist/public/assets/alert-dialog-CQRWdGnn.js +1 -0
- package/dist/public/assets/api-CH5gAPs5.js +1 -0
- package/dist/public/assets/{browser-tab-BNkQAd5u.js → browser-tab-CiAz6nc1.js} +1 -1
- package/dist/public/assets/chat-input-container-C6U_WFFu.js +21 -0
- package/dist/public/assets/context-menu-A9p22S7d.js +1 -0
- package/dist/public/assets/conversation-history-view-CD_uVRNY.js +1 -0
- package/dist/public/assets/{dialogs-config-BEsTbY1C.js → dialogs-config-vkfELnGl.js} +3 -3
- package/dist/public/assets/diff-view-CjbcDB6m.js +3 -0
- package/dist/public/assets/explorer-tab-view-BfycKUUW.js +2 -0
- package/dist/public/assets/explorer-tree-DTFYhczJ.js +1 -0
- package/dist/public/assets/explorer-view-C0KcZ8NQ.js +1 -0
- package/dist/public/assets/history-view-Dn0hQIKU.js +1 -0
- package/dist/public/assets/index-Bdde81Uo.css +1 -0
- package/dist/public/assets/index-DKQVo4Vz.js +29 -0
- package/dist/public/assets/markdown-renderer-CNuyXHcy.js +10 -0
- package/dist/public/assets/mcp-server-card-DBEBe3Qh.js +1 -0
- package/dist/public/assets/onboarding-DslO5AS6.js +1 -0
- package/dist/public/assets/onboarding-dialog-CE-GhoDt.js +1 -0
- package/dist/public/assets/{page-toolbar-DM-x5q1_.js → page-toolbar-CloU_Kvo.js} +1 -1
- package/dist/public/assets/{project-settings-view-wkrbmymL.js → project-settings-view-CxD9JZoB.js} +1 -1
- package/dist/public/assets/providers-list-view-CNxVBJlM.js +1 -0
- package/dist/public/assets/radio-group-Co0Lg6se.js +1 -0
- package/dist/public/assets/react-vendor-DyE9sO8V.js +22 -0
- package/dist/public/assets/resizable-dToeUeVD.js +1 -0
- package/dist/public/assets/{run-stop-button-CZ62jJDn.js → run-stop-button-DZ4JFwdL.js} +2 -2
- package/dist/public/assets/settings-instructions-view-DWzAH2yN.js +1 -0
- package/dist/public/assets/settings-mcp-servers-view-q6gGMMVX.js +5 -0
- package/dist/public/assets/settings-models-view-BDDFQWWC.js +1 -0
- package/dist/public/assets/settings-rules-view-DsEwgDFr.js +8 -0
- package/dist/public/assets/settings-skills-view-DV40_L1o.js +2 -0
- package/dist/public/assets/settings-slash-commands-view-BEk3BgOY.js +1 -0
- package/dist/public/assets/settings-subagents-view-d3P4ylDX.js +2 -0
- package/dist/public/assets/settings-view-ClTMPafQ.js +2 -0
- package/dist/public/assets/{side-panel-container-DVnN8vFb.js → side-panel-container-BAYoMt7B.js} +2 -2
- package/dist/public/assets/skeleton-DveUQR4w.js +1 -0
- package/dist/public/assets/standard-list-item-BLlgm1qW.js +1 -0
- package/dist/public/assets/store-BcwWHqYr.js +4 -0
- package/dist/public/assets/{tab-context-DBrXMyNd.js → tab-context-DWD20a4z.js} +1 -1
- package/dist/public/assets/tabs-CgvpwOBj.js +1 -0
- package/dist/public/assets/{terminal-panel-COYGYBV5.js → terminal-panel-CkIe2d2K.js} +2 -2
- package/dist/public/assets/textarea-C2UIAa7y.js +1 -0
- package/dist/public/assets/todos-view-C-awG1dZ.js +1 -0
- package/dist/public/assets/{use-toast-BqYP6xbg.js → use-toast-yY7qQuQP.js} +1 -1
- package/dist/public/assets/{utils-BavofGRh.js → utils-BKss67Vg.js} +1 -1
- package/dist/public/assets/whisper-wasm-B7iuRPFr.js +2 -0
- package/dist/public/ide/antigravity.svg +1 -0
- package/dist/public/ide/devin.svg +1 -0
- package/dist/public/index.html +22 -20
- package/dist/public/wasm/libmain-CWYJvMY5.js +3318 -0
- package/dist/public/wasm/libmain-D9-QM3iM.mjs +3301 -0
- package/package.json +4 -3
- package/dist/public/assets/account-view-g3bIVa-z.js +0 -1
- package/dist/public/assets/alert-dialog-DXEB8gMn.js +0 -1
- package/dist/public/assets/api-DQLZE-zX.js +0 -1
- package/dist/public/assets/chat-input-container-C8o4YcJZ.js +0 -1
- package/dist/public/assets/context-menu-CThafUml.js +0 -1
- package/dist/public/assets/conversation-history-view-64T6FDPb.js +0 -1
- package/dist/public/assets/diff-view-DgR-WEkB.js +0 -3
- package/dist/public/assets/explorer-tab-view-B53xe5xM.js +0 -2
- package/dist/public/assets/explorer-tree-KuYjR6r9.js +0 -1
- package/dist/public/assets/explorer-view-Cj6fyxMP.js +0 -1
- package/dist/public/assets/history-view-_L50vkTM.js +0 -1
- package/dist/public/assets/index-CAoVFXj2.css +0 -1
- package/dist/public/assets/index-Q5OqmtNF.js +0 -50
- package/dist/public/assets/onboarding-C_q_uRK0.js +0 -1
- package/dist/public/assets/onboarding-dialog-Cum5S2wE.js +0 -1
- package/dist/public/assets/provider-details-view-jc3yYdzr.js +0 -1
- package/dist/public/assets/providers-sidebar-B796hXzU.js +0 -1
- package/dist/public/assets/react-vendor-QkuITxN7.js +0 -17
- package/dist/public/assets/resizable-GT3fWOfA.js +0 -1
- package/dist/public/assets/settings-view-BbL7i34u.js +0 -2
- package/dist/public/assets/standard-list-item-ByRgCvKd.js +0 -1
- package/dist/public/assets/store-Dyy2UFdD.js +0 -2
- package/dist/public/assets/tabs-DxQZhlZp.js +0 -1
- package/dist/public/assets/textarea-CUYwgm5q.js +0 -1
- package/dist/public/assets/todos-view-DB99PEKH.js +0 -1
- /package/dist/public/assets/{dist-CIGnaqp2.js → dist-Bjt_i1zi.js} +0 -0
- /package/dist/public/assets/{monaco-c-HyCuEi.js → monaco-SWcefg0q.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ar as e,Ni as t,Zn as n,ba as r}from"./dialogs-config-vkfELnGl.js";import{M as i,N as a,j as o}from"./react-vendor-DyE9sO8V.js";var s=r(),c=e(),l=e=>{let t=(0,s.c)(8),r,a;t[0]===e?(r=t[1],a=t[2]):({className:r,...a}=e,t[0]=e,t[1]=r,t[2]=a);let o;t[3]===r?o=t[4]:(o=n(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,r),t[3]=r,t[4]=o);let l;return t[5]!==a||t[6]!==o?(l=(0,c.jsx)(i,{className:o,...a}),t[5]=a,t[6]=o,t[7]=l):l=t[7],l},u=o,d=e=>{let r=(0,s.c)(12),i,o,l;r[0]===e?(i=r[1],o=r[2],l=r[3]):({withHandle:l,className:i,...o}=e,r[0]=e,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)(t,{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{
|
|
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:
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Ar as t,Sa as n,Ti as r,Vn as i,Xr as a,Yt as o,hn as s,li as c,pn as l}from"./dialogs-config-vkfELnGl.js";import{a as u,o as d,t as f}from"./store-BcwWHqYr.js";import{c as p,l as m,s as h,u as g}from"./history-view-Dn0hQIKU.js";import{t as _}from"./use-toast-yY7qQuQP.js";import{n as v}from"./tab-context-DWD20a4z.js";var y=e(n(),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:n}){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 o(e)).isRunning)}catch{E(!1)}})()},[e]);let j=()=>{k({projectId:e,runCommand:t||``})},M=async()=>{A.current=!0,O(!0);try{await s(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 n?(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)(a,{className:`h-10 w-10 fill-current`}):(0,x.jsx)(c,{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)(i,{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)(a,{className:`h-4 w-4 fill-current`}):(0,x.jsx)(c,{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{Ar as t,Mt as n,Sa as r,Ti as i,Vn as a,un as o}from"./dialogs-config-vkfELnGl.js";import{a as s}from"./store-BcwWHqYr.js";import{t as c}from"./textarea-C2UIAa7y.js";import{t as l}from"./use-toast-yY7qQuQP.js";var u=e(r(),1),d=t();function f(){let{state:e}=s(),{selectedThreadId:t}=e,[r,f]=(0,u.useState)(``),[p,m]=(0,u.useState)(!1),[h,g]=(0,u.useState)(!1);(0,u.useEffect)(()=>{t&&(m(!0),n(t,`AGENTS.md`).then(e=>f(e.content)).catch(()=>f(``)).finally(()=>m(!1)))},[t]);async function _(){if(t){g(!0);try{await o(t,`AGENTS.md`,r),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 t?(0,d.jsx)(`div`,{className:`h-full flex flex-col overflow-hidden`,children:(0,d.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6 w-full flex-1 flex flex-col min-h-0`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,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. Stored in AGENTS.md file.`})]}),(0,d.jsx)(a,{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:r,onChange:e=>f(e.target.value),className:`flex-1 min-h-0 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{Ar as t,Bn as n,Gn as r,Ir as i,Kn as a,R as o,Rn as s,Sa as c,Vn as l,Wr as u,_t as d,ba as f,ci as p,ft as m,n as h,ni as g,r as _,ri as v,sn as y,ui as b}from"./dialogs-config-vkfELnGl.js";import{a as x}from"./store-BcwWHqYr.js";import{t as S}from"./textarea-C2UIAa7y.js";import{c as C,l as w,s as T,u as E}from"./history-view-Dn0hQIKU.js";import{t as D}from"./use-toast-yY7qQuQP.js";import{a as O,c as k,i as ee,n as A,o as j,r as M,s as N,t as P}from"./alert-dialog-CQRWdGnn.js";import{n as F}from"./tab-context-DWD20a4z.js";import{t as I}from"./skeleton-DveUQR4w.js";import{t as L}from"./mcp-server-card-DBEBe3Qh.js";var R=f(),z=e(c(),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 m(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=()=>{d().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 y(e,t,n)}async function U(e,t){await o(e,t)}var W=t();function G({projectPath:e,serverName:t,onBack:r}){let{installedServers:a}=B(e),o=!!t,[c,u]=(0,z.useState)(``),[d,f]=(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)(o),[O,k]=(0,z.useState)(``),[ee,A]=(0,z.useState)(``),[j,M]=(0,z.useState)(``),[N,P]=(0,z.useState)([]);(0,z.useEffect)(()=>{if(o&&t){let e=a.find(e=>e.name===t);if(e){u(e.name),f(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),A(e.config.command),M(t),P(n),E(!1)}}else E(!1)},[a,t,o]);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=c.trim(),n=d.trim();if(!t){w(`Server name is required`);return}if(!n){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:o?`MCP server configuration saved`:`MCP server added`}),r()}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`}),r()}catch(e){w(e instanceof Error?e.message:`Failed to delete server`)}finally{x(!1)}}},q=o?d!==ee||m!==j||JSON.stringify(g)!==JSON.stringify(N):c.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:o?c:`Add MCP Server`}),(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:o?`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)(s,{htmlFor:`server-name`,children:`Server name`}),(0,W.jsx)(n,{id:`server-name`,placeholder:`e.g. filesystem`,value:c,onChange:e=>u(e.target.value),disabled:o}),o&&(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)(s,{htmlFor:`server-command`,children:`Command`}),(0,W.jsx)(n,{id:`server-command`,placeholder:`e.g. npx`,value:d,onChange:e=>f(e.target.value),className:`text-sm`})]}),(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsxs)(s,{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)(s,{children:`Environment variables`}),(0,W.jsxs)(l,{variant:`ghost`,size:`sm`,onClick:F,className:`h-6 px-2 text-xs`,children:[(0,W.jsx)(p,{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)(n,{placeholder:`KEY`,value:e.key,onChange:e=>L(t,e.target.value),className:`font-mono text-xs w-[35%]`}),(0,W.jsx)(n,{placeholder:`value`,value:e.value,onChange:e=>R(t,e.target.value),className:`font-mono text-xs flex-1`}),(0,W.jsx)(l,{variant:`ghost`,size:`icon`,onClick:()=>I(t),className:`h-9 w-9 flex-shrink-0`,children:(0,W.jsx)(i,{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:[o&&(0,W.jsx)(l,{variant:`destructive`,onClick:K,disabled:b||v,children:b?`Removing...`:`Remove`}),!o&&(0,W.jsx)(`div`,{}),(0,W.jsx)(l,{onClick:G,disabled:v||b||!q,children:v?o?`Saving...`:`Adding...`:o?`Save`:`Add`})]})]})]})}function K(e){return e.name.toLowerCase().replace(/\s+/g,`-`)}function q(){let{state:e}=x(),{selectedProjectId:t,projects:i}=e,o=i.find(e=>e.projectId===t)?.projectPath,{installedServers:s,loadingConfig:c,loadInstalledServers:d}=B(o),{popularServers:f}=V(),{setActiveMainTab:p,setPendingExplorerPath:m,triggerExplorerRefresh:y}=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(o){Q(!0);try{await U(o,e),await d(),y(),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)}}},[o,d,y]),re=(0,z.useCallback)(()=>{m(`.agents/mcp.json`),p(`explorer`)},[m,p]),ie=(0,z.useCallback)(async e=>{if(!o)return;let t=K(e);if(!s.some(n=>n.name===t||n.name===e.id))try{await H(o,t,{command:e.command,args:e.args,...Object.keys(e.env??{}).length>0?{env:e.env}:{}}),await d(),y(),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`})}},[o,s,d,y]),ae=$.trim()?f.filter(e=>e.name.toLowerCase().includes($.toLowerCase())||e.description.toLowerCase().includes($.toLowerCase())):f;return t?(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)(l,{onClick:()=>R(!0),children:`Add Server`})]}),(0,W.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:`Installed MCP Servers`}),c?(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)(g,{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)(h,{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)(g,{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)(l,{variant:`ghost`,size:`icon-sm`,onClick:re,children:(0,W.jsx)(b,{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)(l,{variant:`ghost`,size:`icon-sm`,onClick:()=>J(e.name),children:(0,W.jsx)(b,{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)(l,{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)(v,{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)(n,{placeholder:`Search available servers...`,value:$,onChange:e=>te(e.target.value),className:`pl-8`})]}),f.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)(r,{open:S,onOpenChange:R,children:(0,W.jsx)(a,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,W.jsx)(G,{projectPath:o,onBack:()=>{R(!1),d(),y()}})})}),(0,W.jsx)(r,{open:q!==null,onOpenChange:e=>{e||J(null)},children:(0,W.jsx)(a,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,W.jsx)(G,{projectPath:o,serverName:q??void 0,onBack:()=>{J(null),d(),y()}})})}),(0,W.jsx)(P,{open:Y!==null,onOpenChange:e=>!e&&X(null),children:(0,W.jsxs)(ee,{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)(j,{children:[(0,W.jsx)(M,{children:`Cancel`}),(0,W.jsx)(A,{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{Ar as t,Bn as n,Dt as r,Fn as i,G as a,J as o,K as s,Ot as c,Qn as l,Sa as u,Ti as d,Vn as f,W as p,Xi as m,Y as h,Yr as g,q as _,ri as ee,ya as v}from"./dialogs-config-vkfELnGl.js";import{c as y,l as b,s as x,u as S}from"./history-view-Dn0hQIKU.js";import{o as C,s as w}from"./onboarding-DslO5AS6.js";import{i as T,n as E,r as D,t as O}from"./tabs-CgvpwOBj.js";var k=e(u(),1),A=t();function j(){let[e,t]=(0,k.useState)([]),[u,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=>w(e.id);(0,k.useEffect)(()=>{(async()=>{z(!0),V(``);try{let e=(await c()).filter(e=>e.apiKey);t(e);let n={};e.forEach(e=>{n[e.slug]=`alphabetical`}),q(n);let r={},i={},a={},s={};await Promise.all(e.map(async e=>{try{let[t,n]=await Promise.all([h(e.slug),o(e.slug)]);r[e.slug]=t.models,i[e.slug]=n.models;let c=new Set(t.enabledModelIds);a[e.slug]=c;let l=new Set(n.enabledModelIds);s[e.slug]=l}catch(t){console.error(`Failed to load models for ${e.slug}:`,t),r[e.slug]=[],i[e.slug]=[],a[e.slug]=new Set,s[e.slug]=new Set}})),j(r),N(i),F(a),L(s)}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 p(e,t),L(n=>{let r=new Set(n[e]??[]);return r.delete(t),{...n,[e]:r}})):(await s(e,t),L(n=>({...n,[e]:new Set([...n[e]||[],t])}))):P[e]?.has(t)?(await a(e,t),F(n=>{let r=new Set(n[e]??[]);return r.delete(t),{...n,[e]:r}})):(await _(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]:u[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)},te=e=>e?e<20?1:e<30?2:e<40?3:e<50?4:5:0,ne=({codingIndex:e,modelName:t})=>{let n=te(e);return n===0?null:(0,A.jsx)(b,{children:(0,A.jsxs)(x,{children:[(0,A.jsx)(S,{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)(g,{className:`h-3 w-3 ${e<=n?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},e))})}),(0,A.jsx)(y,{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)(f,{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)(i,{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)(ee,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,A.jsx)(n,{placeholder:`Search models across all providers...`,className:`pl-10`,value:W,onChange:e=>G(e.target.value)})]}),(0,A.jsxs)(O,{value:H,onValueChange:e=>{U(e),G(``)},children:[(0,A.jsxs)(D,{className:`mb-4`,children:[(0,A.jsx)(T,{value:`coding`,children:`Coding`}),e.some(e=>e.name.toLowerCase()===`openrouter`)&&(0,A.jsx)(T,{value:`image`,children:`Image`})]}),(0,A.jsx)(E,{value:`coding`,children:(0,A.jsx)(`div`,{className:`space-y-6`,children:e.map(e=>{let t=u[e.slug]||[],n=P[e.slug]||new Set,i=K[e.slug]||`alphabetical`,a=$(t,n,i);return a.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:r(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})]}),a.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)(C,{id:`select-all-${e.slug}`,checked:a.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)(b,{children:(0,A.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,A.jsxs)(x,{children:[(0,A.jsx)(S,{asChild:!0,children:(0,A.jsx)(f,{type:`button`,variant:i===`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)(y,{children:`Sort A–Z`})]}),(0,A.jsxs)(x,{children:[(0,A.jsx)(S,{asChild:!0,children:(0,A.jsx)(f,{type:`button`,variant:i===`price-low`||i===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`price-low`})),children:(0,A.jsx)(m,{className:`h-4 w-4`})})}),(0,A.jsx)(y,{children:`Sort by price`})]}),(0,A.jsxs)(x,{children:[(0,A.jsx)(S,{asChild:!0,children:(0,A.jsx)(f,{type:`button`,variant:i===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`coding-index`})),children:(0,A.jsx)(g,{className:`h-4 w-4`})})}),(0,A.jsx)(y,{children:`Sort by coding intelligence`})]})]})})]}),a.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)(b,{children:(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:a.map(t=>{let r=n.has(t.id),a=t.pricing;return(0,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)(C,{id:t.id,checked:r,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:[i===`coding-index`&&(0,A.jsx)(ne,{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?``:`$${l(a.prompt??0)} in | $${l(a.completion??0)} out`})]})]})]},t.id)})})})]},e.slug)})})}),(0,A.jsx)(E,{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,i=K[e.slug]||`alphabetical`,a=$(t,n,i);return a.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:r(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})]}),a.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)(C,{id:`select-all-image-${e.slug}`,checked:a.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)(b,{children:(0,A.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,A.jsxs)(x,{children:[(0,A.jsx)(S,{asChild:!0,children:(0,A.jsx)(f,{type:`button`,variant:i===`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)(y,{children:`Sort A–Z`})]}),(0,A.jsxs)(x,{children:[(0,A.jsx)(S,{asChild:!0,children:(0,A.jsx)(f,{type:`button`,variant:i===`price-low`||i===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`price-low`})),children:(0,A.jsx)(m,{className:`h-4 w-4`})})}),(0,A.jsx)(y,{children:`Sort by price`})]})]})})]}),a.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)(b,{children:(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:a.map(t=>{let r=n.has(t.id),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)(C,{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?``:`$${l(i.prompt??0)} in | $${l(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{Ar as t,B as n,Bn as r,Ct as i,Gn as a,Kn as o,Nt as s,Rn as c,Sa as l,Ti as u,U as d,Vn as f,Wi as p,Wr as m,Zn as h,ba as g,ca as _,ii as v,n as ee,qt as te,r as ne,ri as y,un as b,vt as x}from"./dialogs-config-vkfELnGl.js";import{n as S,r as C}from"./react-vendor-DyE9sO8V.js";import{a as re}from"./store-BcwWHqYr.js";import{t as w}from"./textarea-C2UIAa7y.js";import{t as T}from"./use-toast-yY7qQuQP.js";import{a as ie,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./alert-dialog-CQRWdGnn.js";import{n as N}from"./tab-context-DWD20a4z.js";import{t as P}from"./skeleton-DveUQR4w.js";import{t as F}from"./mcp-server-card-DBEBe3Qh.js";import{n as I,t as L}from"./radio-group-Co0Lg6se.js";var R=g(),z=e(l(),1),B=t(),V=z.forwardRef((e,t)=>{let n=(0,R.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=h(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,B.jsx)(C,{className:h(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,B.jsx)(S,{className:a,...i,ref:t,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});V.displayName=S.displayName;function H({threadId:e,onRuleCreated:t}){let[n,i]=(0,z.useState)(``),[a,o]=(0,z.useState)(``),[s,l]=(0,z.useState)(!1),[d,p]=(0,z.useState)(`local`),[m,h]=(0,z.useState)(!1),g=n.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),v=g.length>0&&g.length<=64;return e?(0,B.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,B.jsxs)(`div`,{className:`mb-6`,children:[(0,B.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Rule`}),(0,B.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,B.jsxs)(`div`,{className:`space-y-6`,children:[(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(c,{htmlFor:`ruleName`,children:`Rule Name`}),(0,B.jsx)(r,{id:`ruleName`,value:n,onChange:e=>i(e.target.value),placeholder:`e.g. Code Style Guide`,disabled:m}),n&&(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`File name: `,(0,B.jsxs)(`span`,{className:`font-mono`,children:[g||`...`,`.md`]})]})]}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(c,{htmlFor:`ruleDescription`,children:`Description`}),(0,B.jsx)(w,{id:`ruleDescription`,value:a,onChange:e=>o(e.target.value),placeholder:`Describe when Tarsk should apply this rule...`,className:`resize-none min-h-[120px]`,disabled:m})]}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(c,{htmlFor:`alwaysApply`,children:`Always Apply`}),(0,B.jsx)(V,{id:`alwaysApply`,checked:s,onCheckedChange:l,disabled:m})]}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s?`This rule will be automatically added to context for all conversations.`:`Only the rule description will be added to context, allowing the agent to read the rule file when needed.`})]}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(c,{children:`Scope`}),(0,B.jsxs)(L,{value:d,onValueChange:e=>p(e),className:`flex gap-4`,disabled:m,children:[(0,B.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,B.jsx)(I,{value:`local`,id:`scope-local`}),(0,B.jsx)(c,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,B.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,B.jsx)(I,{value:`global`,id:`scope-global`,disabled:!0}),(0,B.jsx)(c,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d===`local`?`This rule will only be available for this project.`:`This rule will be available across all projects (coming soon).`})]}),(0,B.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,B.jsx)(f,{onClick:async()=>{if(!(!v||!e)){h(!0);try{let n=`---
|
|
2
|
+
description: ${a.trim()}
|
|
3
|
+
alwaysApply: ${s}
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Place your rule instructions here as markdown.
|
|
7
|
+
`;await b(e,`.agents/rules/${g}.md`,n),T({title:`Rule created`,description:`Rule '${g}' was created successfully.`}),i(``),o(``),l(!1),p(`local`),t?.(g)}catch(e){T({title:`Error`,description:e instanceof Error?e.message:`Failed to create rule`,variant:`destructive`})}finally{h(!1)}}},disabled:!v||!a.trim()||m,children:m?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(u,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,B.jsxs)(B.Fragment,{children:[`Continue`,(0,B.jsx)(_,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,B.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,B.jsxs)(`div`,{className:`text-center`,children:[(0,B.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add a rule.`})]})})}function U(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(...U(n.children));return t}function W(){let{state:e}=re(),{selectedProjectId:t,selectedThreadId:c}=e,{setActiveMainTab:l,setPendingExplorerPath:u,triggerExplorerRefresh:h,setExplorerClearPath:g}=N(),[_,S]=(0,z.useState)([]),[C,w]=(0,z.useState)(!1),[I,L]=(0,z.useState)(!1),[R,V]=(0,z.useState)(null),[W,G]=(0,z.useState)(!1),[K,q]=(0,z.useState)([]),[J,Y]=(0,z.useState)(new Set),[X,Z]=(0,z.useState)(``),Q=(0,z.useCallback)(async()=>{if(t){w(!0);try{let e=U(await i(t));if(c)try{let t=U(await s(c)),n=new Set(e.map(e=>e.path));for(let r of t)n.has(r.path)||e.push(r)}catch{}S(e),Y(new Set(e.map(e=>e.path)))}catch{S([]),Y(new Set)}finally{w(!1)}}},[t,c]);(0,z.useEffect)(()=>{Q()},[Q]),(0,z.useEffect)(()=>{x().then(q).catch(()=>q([]))},[]);let ae=(0,z.useCallback)(async e=>{if(!t)return;let r=e.name,i=e.path;G(!0);try{try{await n(t,i)}catch{if(c)await d(c,i);else throw Error(`No thread selected to delete from`)}g(i),h(),Y(e=>{let t=new Set(e);return t.delete(i),t}),T({title:`Rule removed`,description:r}),V(null),await Q()}catch(e){T({title:`Error`,description:e instanceof Error?e.message:`Failed to remove rule`,variant:`destructive`})}finally{G(!1)}},[t,c,Q,h,g]),oe=(0,z.useCallback)(e=>{u(e),l(`explorer`)},[u,l]),se=(0,z.useCallback)(async e=>{let t=`.agents/rules/${e.name}.md`;if(!(!c||J.has(t)))try{e.gitHubRepo&&e.gitHubFolder?await te(c,e.gitHubRepo,e.gitHubFolder,`.agents/rules`):await b(c,t,[`---`,`description: ${e.description}`,`alwaysApply: ${e.alwaysApply??!1}`,`---`,``,e.content].join(`
|
|
8
|
+
`)),Y(e=>new Set(e).add(t)),h(),Q(),T({title:`Rule installed`,description:e.name})}catch(e){T({title:`Error`,description:e instanceof Error?e.message:`Failed to install rule`,variant:`destructive`})}},[c,J,h,Q]),$=X.trim()?K.filter(e=>e.name.toLowerCase().includes(X.toLowerCase())||e.description.toLowerCase().includes(X.toLowerCase())):K;return t?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,B.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Rules`}),(0,B.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage agent rules. Rules define coding standards and project-wide guidelines.`})]}),(0,B.jsx)(f,{onClick:()=>L(!0),disabled:!c,children:`Add Rule`})]}),!c&&(0,B.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,B.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:`Installed Rules`}),C?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(P,{className:`h-20 w-full`}),(0,B.jsx)(P,{className:`h-20 w-full`})]}):_.length===0?(0,B.jsxs)(`div`,{className:`text-center py-12 border border-dashed rounded-lg mb-8`,children:[(0,B.jsx)(v,{className:`mx-auto h-10 w-10 text-muted-foreground/50 mb-3`}),(0,B.jsx)(`h3`,{className:`text-base font-semibold text-muted-foreground mb-1`,children:`No rules installed`}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground mb-3`,children:`Add rules to enforce coding standards and project conventions.`})]}):(0,B.jsx)(`div`,{className:`space-y-3 mb-8`,children:_.map(e=>(0,B.jsx)(ee,{children:(0,B.jsxs)(ne,{className:`flex items-center justify-between p-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(v,{className:`h-4 w-4 text-muted-foreground flex-shrink-0`}),(0,B.jsx)(`h3`,{className:`font-medium truncate`,children:e.name})]}),(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 truncate font-mono`,children:e.path})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 ml-4 flex-shrink-0`,children:[(0,B.jsx)(f,{variant:`ghost`,size:`icon-sm`,onClick:()=>oe(e.path),title:`View in explorer`,children:(0,B.jsx)(p,{className:`h-4 w-4`})}),(0,B.jsx)(f,{variant:`ghost`,size:`icon-sm`,onClick:()=>V(e),title:`Delete rule`,children:(0,B.jsx)(m,{className:`h-4 w-4 text-destructive`})})]})]})},e.id))}),(0,B.jsx)(`div`,{className:`flex items-center justify-between mb-3`,children:(0,B.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Available Rules`})}),!c&&(0,B.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,B.jsxs)(`div`,{className:`relative mb-4`,children:[(0,B.jsx)(y,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,B.jsx)(r,{placeholder:`Search available rules...`,value:X,onChange:e=>Z(e.target.value),className:`pl-8`})]}),K.length===0?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(P,{className:`h-20 w-full`}),(0,B.jsx)(P,{className:`h-20 w-full`})]}):$.length===0?(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:X.trim()?`No results for "${X}"`:`No available rules found.`}):(0,B.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=J.has(t);return(0,B.jsx)(F,{name:e.name,description:e.description,installed:n,onClick:()=>{n||se(e)},showInstalledControls:!1},e.id)})})]})}),(0,B.jsx)(a,{open:I,onOpenChange:L,children:(0,B.jsx)(o,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,B.jsx)(H,{threadId:c,onRuleCreated:()=>{L(!1),Q(),h()}})})}),(0,B.jsx)(M,{open:R!==null,onOpenChange:e=>!e&&V(null),children:(0,B.jsxs)(D,{children:[(0,B.jsxs)(j,{children:[(0,B.jsx)(E,{children:`Delete Rule`}),(0,B.jsxs)(ie,{children:[`Are you sure you want to delete the rule "`,R?.name,`"? This action cannot be undone.`]})]}),(0,B.jsxs)(k,{children:[(0,B.jsx)(A,{children:`Cancel`}),(0,B.jsx)(O,{onClick:()=>R&&void ae(R),disabled:W,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:W?`Deleting...`:`Delete`})]})]})})]}):(0,B.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,B.jsx)(`p`,{className:`text-muted-foreground`,children:`Select a project to manage rules.`})})}export{W as SettingsRulesView,W as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Ar as t,B as n,Bn as r,Ct as i,Gn as a,I as o,Kn as s,Nt as c,Rn as l,Rr as u,Sa as d,Ti as f,U as p,Vn as m,Wi as h,Wr as g,ca as _,n as v,qt as y,r as b,ri as x,un as S,yt as C}from"./dialogs-config-vkfELnGl.js";import{a as w}from"./store-BcwWHqYr.js";import{t as T}from"./textarea-C2UIAa7y.js";import{t as E}from"./use-toast-yY7qQuQP.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-CQRWdGnn.js";import{n as j}from"./tab-context-DWD20a4z.js";import{t as M}from"./skeleton-DveUQR4w.js";import{t as N}from"./mcp-server-card-DBEBe3Qh.js";import{n as P,t as F}from"./radio-group-Co0Lg6se.js";var I=e(d(),1),L=t();function R({threadId:e,onSkillCreated:t}){let[n,i]=(0,I.useState)(``),[a,s]=(0,I.useState)(``),[c,u]=(0,I.useState)(`local`),[d,p]=(0,I.useState)(!1),h=n.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),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)(l,{htmlFor:`skillName`,children:`Skill Name`}),(0,L.jsx)(r,{id:`skillName`,value:n,onChange:e=>i(e.target.value),placeholder:`e.g. Code Review`,disabled:d}),n&&(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)(l,{htmlFor:`skillDescription`,children:`Description`}),(0,L.jsx)(T,{id:`skillDescription`,value:a,onChange:e=>s(e.target.value),placeholder:`Describe when Tarsk should apply this skill`,className:`resize-none min-h-[120px]`,disabled:d})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(l,{children:`Scope`}),(0,L.jsxs)(F,{value:c,onValueChange:e=>u(e),className:`flex gap-4`,disabled:d,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)(l,{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)(l,{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:c===`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)(m,{onClick:async()=>{if(!(!g||!a.trim()||!e)){p(!0);try{let n=await o(e,h,a.trim());E({title:`Skill created`,description:`Skill '${h}' was created successfully.`}),i(``),s(``),u(`local`),t?.(n.path,`SKILL.md`)}catch(e){E({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{p(!1)}}},disabled:!g||!a.trim()||d,children:d?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(f,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,L.jsxs)(L.Fragment,{children:[`Continue`,(0,L.jsx)(_,{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:o}=e,{setActiveMainTab:l,setPendingExplorerPath:d,triggerExplorerRefresh:f,setExplorerClearPath:_}=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 i(t));if(o)try{let t=z(await c(o)),n=new Set(e.map(e=>e.path));for(let r of t)n.has(r.path)||e.push(r)}catch{}P(e),X(new Set(e.map(e=>`${e.path}/SKILL.md`)))}catch{P([]),X(new Set)}finally{B(!1)}}},[t,o]);(0,I.useEffect)(()=>{Q()},[Q]),(0,I.useEffect)(()=>{C().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 n(t,i)}catch{if(o)await p(o,i);else throw Error(`No thread selected to delete from`)}_(i),f(),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,o,Q,f,_]),oe=(0,I.useCallback)(e=>{d(`${e}/SKILL.md`),l(`explorer`)},[d,l]),se=(0,I.useCallback)(async e=>{let t=`.agents/skills/${e.id}/SKILL.md`;if(!(!o||Y.has(t)))try{if(e.gitHubRepo&&e.gitHubFolder)await y(o,e.gitHubRepo,e.gitHubFolder,`.agents/skills/${e.id}`);else{let n=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.allowedTools&&n.push(`allowed-tools: ${e.allowedTools}`),e.license&&n.push(`license: ${e.license}`),n.push(`---`,``,e.instructions),await S(o,t,n.join(`
|
|
2
|
+
`))}X(e=>new Set(e).add(t)),f(),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`})}},[o,Y,f,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)(m,{onClick:()=>H(!0),disabled:!o,children:`Add Skill`})]}),!o&&(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)(u,{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)(v,{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)(u,{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)(m,{variant:`ghost`,size:`icon-sm`,onClick:()=>oe(e.path),title:`View in explorer`,children:(0,L.jsx)(h,{className:`h-4 w-4`})}),(0,L.jsx)(m,{variant:`ghost`,size:`icon-sm`,onClick:()=>W(e),title:`Delete skill`,children:(0,L.jsx)(g,{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`})}),!o&&(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)(x,{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)(r,{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)(s,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,L.jsx)(R,{threadId:o,onSkillCreated:()=>{H(!1),Q(),f()}})})}),(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{Ar as t,Bn as n,Gn as r,Kn as i,Kr as a,N as o,Rn as s,Sa as c,Ti as l,V as u,Vn as d,Wi as f,Wr as p,bt as m,ca as h,kt as g,n as _,qt as v,r as y,ri as b}from"./dialogs-config-vkfELnGl.js";import{a as x}from"./store-BcwWHqYr.js";import{t as S}from"./use-toast-yY7qQuQP.js";import{a as C,c as w,i as ee,n as T,o as E,r as D,s as O,t as k}from"./alert-dialog-CQRWdGnn.js";import{n as A}from"./tab-context-DWD20a4z.js";import{t as j}from"./skeleton-DveUQR4w.js";import{t as M}from"./mcp-server-card-DBEBe3Qh.js";import{n as N,t as P}from"./radio-group-Co0Lg6se.js";var F=e(c(),1),I=t();function L({projectId:e,threadId:t,onCommandCreated:r}){let[i,a]=(0,F.useState)(``),[c,u]=(0,F.useState)(``),[f,p]=(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)(s,{htmlFor:`commandName`,children:`Command Name`}),(0,I.jsx)(n,{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)(s,{htmlFor:`commandDescription`,children:`Description`}),(0,I.jsx)(n,{id:`commandDescription`,value:c,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)(s,{htmlFor:`argumentHint`,children:`Argument Hint (optional)`}),(0,I.jsx)(n,{id:`argumentHint`,value:f,onChange:e=>p(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)(s,{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)(s,{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)(s,{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)(s,{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)(s,{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)(s,{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)(d,{onClick:async()=>{if(!(!C||!e)){b(!0);try{await o(x,``,{description:c.trim()||void 0,argumentHint:f.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(``),p(``),g(`default`),v(`local`),r?.(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)(l,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,I.jsxs)(I.Fragment,{children:[`Continue`,(0,I.jsx)(h,{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:s}=e,{setActiveMainTab:c,setPendingExplorerPath:l,triggerExplorerRefresh:h,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(s){B(!0);try{let e=await g(s);R(e.filter(e=>!e.isBuiltIn)),X(new Map(e.map(e=>[e.name,e.filePath])))}catch{R([]),X(new Map)}finally{B(!1)}}},[s]);(0,F.useEffect)(()=>{Q()},[Q]),(0,F.useEffect)(()=>{m().then(J).catch(()=>J([]))},[]);let ne=(0,F.useCallback)(async e=>{K(!0);try{await u(e.filePath),N(e.filePath),h(),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,h,N]),re=(0,F.useCallback)(e=>{l(e),c(`explorer`)},[l,c]),ie=(0,F.useCallback)(async e=>{if(!(!s||Y.has(e.name)))try{if(e.gitHubRepo&&e.gitHubFolder){let t=`.agents/commands`;await v(s,e.gitHubRepo,e.gitHubFolder,t);let n=`${t}/${e.name}.md`;X(t=>new Map(t).set(e.name,n))}else{let t=await o(e.name,e.content,{description:e.description,argumentHint:e.argumentHint},`project`,s);X(n=>new Map(n).set(e.name,t.filePath))}h(),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`})}},[s,Y,h,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)(d,{onClick:()=>H(!0),disabled:!s,children:`Add Command`})]}),!s&&(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)(a,{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)(_,{children:(0,I.jsxs)(y,{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)(a,{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)(d,{variant:`ghost`,size:`icon-sm`,onClick:()=>re(e.filePath),title:`View in explorer`,children:(0,I.jsx)(f,{className:`h-4 w-4`})}),(0,I.jsx)(d,{variant:`ghost`,size:`icon-sm`,onClick:()=>W(e),title:`Delete command`,children:(0,I.jsx)(p,{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`})}),!s&&(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)(b,{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)(n,{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)(r,{open:V,onOpenChange:H,children:(0,I.jsx)(i,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,I.jsx)(L,{projectId:t,threadId:s,onCommandCreated:()=>{H(!1),Q(),h()}})})}),(0,I.jsx)(k,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,I.jsxs)(ee,{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)(E,{children:[(0,I.jsx)(D,{children:`Cancel`}),(0,I.jsx)(T,{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{Ar as t,B as n,Bn as r,Ct as i,F as a,Gn as o,Kn as s,Nt as c,Rn as l,Sa as u,Ti as d,U as f,Vn as p,Wi as m,Wr as h,ca as g,gt as _,n as v,qt as y,r as b,ri as x,un as ee,zr as S}from"./dialogs-config-vkfELnGl.js";import{a as C}from"./store-BcwWHqYr.js";import{t as w}from"./textarea-C2UIAa7y.js";import{t as T}from"./use-toast-yY7qQuQP.js";import{a as E,c as D,i as O,n as k,o as A,r as j,s as te,t as ne}from"./alert-dialog-CQRWdGnn.js";import{n as re}from"./tab-context-DWD20a4z.js";import{t as M}from"./skeleton-DveUQR4w.js";import{t as N}from"./mcp-server-card-DBEBe3Qh.js";import{n as P,t as F}from"./radio-group-Co0Lg6se.js";var I=e(u(),1),L=t();function R({threadId:e,onAgentCreated:t}){let[n,i]=(0,I.useState)(``),[o,s]=(0,I.useState)(``),[c,u]=(0,I.useState)(``),[f,m]=(0,I.useState)(`local`),[h,_]=(0,I.useState)(!1),v=n.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)(l,{htmlFor:`agentName`,children:`Agent Name`}),(0,L.jsx)(r,{id:`agentName`,value:n,onChange:e=>i(e.target.value),placeholder:`e.g. Security Reviewer`,disabled:h}),n&&(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)(l,{htmlFor:`agentDescription`,children:`Description`}),(0,L.jsx)(w,{id:`agentDescription`,value:o,onChange:e=>s(e.target.value),placeholder:`Describe what this agent does and when it should be invoked`,className:`resize-none min-h-[120px]`,disabled:h})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(l,{htmlFor:`agentTools`,children:`Allowed Tools (optional)`}),(0,L.jsx)(r,{id:`agentTools`,value:c,onChange:e=>u(e.target.value),placeholder:`e.g. read grep glob`,disabled:h}),(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)(l,{children:`Scope`}),(0,L.jsxs)(F,{value:f,onValueChange:e=>m(e),className:`flex gap-4`,disabled:h,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)(l,{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)(l,{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:f===`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)(p,{onClick:async()=>{if(!(!y||!o.trim()||!e)){_(!0);try{let n=await a(e,v,o.trim(),c.trim()||void 0);T({title:`Agent created`,description:`Agent '${v}' was created successfully.`}),i(``),s(``),u(``),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||!o.trim()||h,children:h?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(d,{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 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:a}=e,{setActiveMainTab:l,setPendingExplorerPath:u,triggerExplorerRefresh:d,setExplorerClearPath:g}=re(),[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 i(t));if(a)try{let t=z(await c(a)),n=new Set(e.map(e=>e.path));for(let r of t)n.has(r.path)||e.push(r)}catch{}P(e),X(new Set(e.map(e=>`${e.path}/AGENT.md`)))}catch{P([]),X(new Set)}finally{B(!1)}}},[t,a]);(0,I.useEffect)(()=>{Q()},[Q]),(0,I.useEffect)(()=>{_().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 n(t,i)}catch{if(a)await f(a,i);else throw Error(`No thread selected to delete from`)}g(i),d(),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,a,Q,d,g]),oe=(0,I.useCallback)(e=>{u(`${e}/AGENT.md`),l(`explorer`)},[u,l]),se=(0,I.useCallback)(async e=>{let t=`.agents/agents/${e.id}/AGENT.md`;if(!(!a||Y.has(t)))try{if(e.gitHubRepo&&e.gitHubFolder)await y(a,e.gitHubRepo,e.gitHubFolder,`.agents/agents/${e.id}`);else{let n=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.tools&&n.push(`tools: ${e.tools}`),n.push(`---`,``,e.systemPrompt),await ee(a,t,n.join(`
|
|
2
|
+
`))}X(e=>new Set(e).add(t)),d(),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`})}},[a,Y,d,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)(p,{onClick:()=>H(!0),disabled:!a,children:`Add Subagent`})]}),!a&&(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)(M,{className:`h-20 w-full`}),(0,L.jsx)(M,{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)(S,{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)(v,{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)(S,{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)(p,{variant:`ghost`,size:`icon-sm`,onClick:()=>oe(e.path),title:`View in explorer`,children:(0,L.jsx)(m,{className:`h-4 w-4`})}),(0,L.jsx)(p,{variant:`ghost`,size:`icon-sm`,onClick:()=>W(e),title:`Delete agent`,children:(0,L.jsx)(h,{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`})}),!a&&(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)(x,{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)(r,{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)(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 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)(N,{name:e.name,description:e.description,installed:n,onClick:()=>{n||se(e)},showInstalledControls:!1},e.id)})})]})}),(0,L.jsx)(o,{open:V,onOpenChange:H,children:(0,L.jsx)(s,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,L.jsx)(R,{threadId:a,onAgentCreated:()=>{H(!1),Q(),d()}})})}),(0,L.jsx)(ne,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,L.jsxs)(O,{children:[(0,L.jsxs)(te,{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-CNxVBJlM.js","assets/rolldown-runtime-B1FJdls4.js","assets/history-view-Dn0hQIKU.js","assets/dialogs-config-vkfELnGl.js","assets/onboarding-DslO5AS6.js","assets/skeleton-DveUQR4w.js","assets/tabs-CgvpwOBj.js","assets/react-vendor-DyE9sO8V.js","assets/monaco-SWcefg0q.js","assets/settings-models-view-BDDFQWWC.js","assets/settings-mcp-servers-view-q6gGMMVX.js","assets/mcp-server-card-DBEBe3Qh.js","assets/alert-dialog-CQRWdGnn.js","assets/textarea-C2UIAa7y.js","assets/use-toast-yY7qQuQP.js","assets/store-BcwWHqYr.js","assets/tab-context-DWD20a4z.js","assets/settings-skills-view-DV40_L1o.js","assets/radio-group-Co0Lg6se.js","assets/settings-rules-view-DsEwgDFr.js","assets/settings-slash-commands-view-BEk3BgOY.js","assets/settings-subagents-view-d3P4ylDX.js","assets/settings-instructions-view-DWzAH2yN.js","assets/account-view-DcpSNB3N.js","assets/conversation-history-view-CD_uVRNY.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Ar as t,Br as n,Kr as r,Qi as i,Rr as a,Sa as o,Zn as s,ba as c,fa as l,ha as u,ii as d,ji as f,ni as p,tn as m,zr as h}from"./dialogs-config-vkfELnGl.js";import{bt as g,t as _,vt as v,xt as y,yt as b}from"./react-vendor-DyE9sO8V.js";import{a as x}from"./store-BcwWHqYr.js";import{t as S}from"./standard-list-item-BLlgm1qW.js";import{t as C}from"./side-panel-container-BAYoMt7B.js";import{n as w,r as T,t as E}from"./resizable-dToeUeVD.js";var D=c(),O=e(o(),1),k=t(),A=(0,O.forwardRef)(function(e,t){let n=(0,D.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,b=`h-full ${d===void 0?``:d}`,x;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?(x=(0,k.jsx)(w,{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]=x):x=n[9];let S;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,k.jsx)(E,{withHandle:!0,className:`ml-[-40px]`}),n[10]=S):S=n[10];let C;n[11]!==i||n[12]!==_?(C=(0,k.jsx)(w,{minSize:_,className:`overflow-hidden`,children:i}),n[11]=i,n[12]=_,n[13]=C):C=n[13];let O;n[14]!==C||n[15]!==x?(O=(0,k.jsxs)(T,{direction:`horizontal`,className:`h-full`,children:[x,S,C]}),n[14]=C,n[15]=x,n[16]=O):O=n[16];let A;return n[17]!==O||n[18]!==b?(A=(0,k.jsx)(`div`,{className:b,children:O}),n[17]=O,n[18]=b,n[19]=A):A=n[19],A}),j=O.forwardRef((e,t)=>{let n=(0,D.c)(14),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:r,orientation:a,decorative:o,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let c=a===void 0?`horizontal`:a,l=o===void 0?!0:o,u=c===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,d;n[5]!==r||n[6]!==u?(d=s(`shrink-0 bg-border`,u,r),n[5]=r,n[6]=u,n[7]=d):d=n[7];let f;return n[8]!==l||n[9]!==c||n[10]!==i||n[11]!==t||n[12]!==d?(f=(0,k.jsx)(_,{ref:t,decorative:l,orientation:c,className:d,...i}),n[8]=l,n[9]=c,n[10]=i,n[11]=t,n[12]=d,n[13]=f):f=n[13],f});j.displayName=_.displayName;var M=[{id:`providers`,label:`Providers`,icon:(0,k.jsx)(i,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,k.jsx)(l,{className:`h-4 w-4`}),route:`/settings/models`},{id:`skills`,label:`Skills`,icon:(0,k.jsx)(a,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,k.jsx)(d,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,k.jsx)(r,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,k.jsx)(h,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,k.jsx)(u,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,k.jsx)(p,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`history`,label:`History`,icon:(0,k.jsx)(f,{className:`h-4 w-4`}),route:`/settings/history`},{id:`account`,label:`Account`,icon:(0,k.jsx)(n,{className:`h-4 w-4`}),route:`/settings/account`}];function N(e){let t=(0,D.c)(8),{className:n}=e,r=b(),i=v(),a;t[0]===i.pathname?a=t[1]:(a=function(){let e=i.pathname;for(let t of M)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=M.map((e,t)=>(0,k.jsxs)(O.Fragment,{children:[t===M.length-1&&(0,k.jsx)(j,{className:`my-2 bg-sidebar-border`}),(0,k.jsx)(S,{selected:o===e.id,asChild:!0,children:(0,k.jsx)(`button`,{className:`justify-start`,onClick:()=>void r(e.route),children:(0,k.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.icon,(0,k.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,k.jsx)(`div`,{className:s,children:c}),t[5]=s,t[6]=c,t[7]=l):l=t[7],l}var P=(0,O.lazy)(()=>y(()=>import(`./providers-list-view-CNxVBJlM.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),F=(0,O.lazy)(()=>y(()=>import(`./settings-models-view-BDDFQWWC.js`),__vite__mapDeps([9,1,2,3,4,6,7,8]))),I=(0,O.lazy)(()=>y(()=>import(`./settings-mcp-servers-view-q6gGMMVX.js`),__vite__mapDeps([10,1,2,3,11,12,7,8,5,13,14,15,16]))),L=(0,O.lazy)(()=>y(()=>import(`./settings-skills-view-DV40_L1o.js`),__vite__mapDeps([17,1,3,11,2,12,7,8,18,5,13,14,15,16]))),R=(0,O.lazy)(()=>y(()=>import(`./settings-rules-view-DsEwgDFr.js`),__vite__mapDeps([19,1,7,2,3,8,11,12,18,5,13,14,15,16]))),z=(0,O.lazy)(()=>y(()=>import(`./settings-slash-commands-view-BEk3BgOY.js`),__vite__mapDeps([20,1,3,11,2,12,7,8,18,5,14,15,16]))),B=(0,O.lazy)(()=>y(()=>import(`./settings-subagents-view-d3P4ylDX.js`),__vite__mapDeps([21,1,3,11,2,12,7,8,18,5,13,14,15,16]))),V=(0,O.lazy)(()=>y(()=>import(`./settings-instructions-view-DWzAH2yN.js`),__vite__mapDeps([22,1,3,13,14,15]))),H=(0,O.lazy)(()=>y(()=>import(`./account-view-DcpSNB3N.js`),__vite__mapDeps([23,1,3,5,14]))),U=(0,O.lazy)(()=>y(()=>import(`./conversation-history-view-CD_uVRNY.js`),__vite__mapDeps([24,2,1,3]))),W=[`providers`,`models`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`mcp-servers`,`history`,`account`];function G(e){let t=(0,D.c)(5),{title:n}=e,r;t[0]===n?r=t[1]:(r=(0,k.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,k.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,k.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,k.jsxs)(`div`,{className:`text-center`,children:[r,i]})}),t[3]=r,t[4]=a),a}function K(){let e=(0,D.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,k.jsxs)(`div`,{className:`mb-6`,children:[(0,k.jsx)(`div`,{className:`h-8 w-32 bg-muted rounded animate-pulse mb-2`}),(0,k.jsx)(`div`,{className:`h-4 w-64 bg-muted rounded animate-pulse`})]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,k.jsx)(`div`,{className:`mb-6`,children:(0,k.jsx)(`div`,{className:`h-10 w-full bg-muted rounded animate-pulse`})}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,k.jsx)(`div`,{className:`h-4 w-36 bg-muted rounded animate-pulse mb-3`}),e[2]=r):r=e[2];let i,a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,k.jsxs)(`div`,{children:[r,(0,k.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,k.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,k.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`})]})]}),a=(0,k.jsx)(`div`,{className:`h-4 w-40 bg-muted rounded animate-pulse mb-3`}),e[3]=i,e[4]=a):(i=e[3],a=e[4]);let o;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,k.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,k.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[t,n,(0,k.jsxs)(`div`,{className:`space-y-8`,children:[i,(0,k.jsxs)(`div`,{children:[a,(0,k.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,k.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,k.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,k.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`}),(0,k.jsx)(`div`,{className:`h-24 bg-muted rounded-lg animate-pulse`})]})]})]})]})}),e[5]=o):o=e[5],o}function q(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/history`)?`history`:e.startsWith(`/settings/account`)?`account`:`providers`}function J(){let e=(0,D.c)(33),{tab:t}=g(),n=b(),r=v(),{state:i}=x(),a;if(e[0]!==r.pathname||e[1]!==r.search||e[2]!==t){let n=new URLSearchParams(r.search).get(`tab`);a=n&&W.includes(n)?n:t&&W.includes(t)?t:q(r.pathname),e[0]=r.pathname,e[1]=r.search,e[2]=t,e[3]=a}else a=e[3];let o=a,[s,c]=(0,O.useState)(!1),l=(0,O.useRef)(null),u=ee,d;e[4]===n?d=e[5]:(d=()=>{n(`/`)},e[4]=n,e[5]=d);let f=d,p;e[6]===i.selectedProjectId?p=e[7]:(p=i.selectedProjectId?{type:`project`,id:i.selectedProjectId}:void 0,e[6]=i.selectedProjectId,e[7]=p);let m=p,h;e[8]===n?h=e[9]:(h=()=>{n(`/settings/providers`)},e[8]=n,e[9]=h);let _=h,y,S;e[10]!==r.pathname||e[11]!==n?(y=()=>{[`/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})},S=[r.pathname,n],e[10]=r.pathname,e[11]=n,e[12]=y,e[13]=S):(y=e[12],S=e[13]),(0,O.useEffect)(y,S);let w;e[14]===f?w=e[15]:(w=()=>(0,k.jsx)(C,{onTitleClose:f,subtitle:`Settings`,onResetOnboarding:u,children:(0,k.jsx)(`div`,{className:`px-2 py-2`,children:(0,k.jsx)(N,{})})}),e[14]=f,e[15]=w);let T=w,E;e[16]!==o||e[17]!==_||e[18]!==m||e[19]!==i.projects?(E=()=>{switch(o){case`providers`:return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(K,{}),children:(0,k.jsx)(P,{})});case`models`:return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(G,{title:`Models`}),children:(0,k.jsx)(F,{})});case`skills`:return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(G,{title:`Skills`}),children:(0,k.jsx)(L,{})});case`rules`:return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(G,{title:`Rules`}),children:(0,k.jsx)(R,{})});case`slash-commands`:return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(G,{title:`Slash Commands`}),children:(0,k.jsx)(z,{})});case`subagents`:return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(G,{title:`Subagents`}),children:(0,k.jsx)(B,{})});case`instructions`:return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(G,{title:`Instructions`}),children:(0,k.jsx)(V,{})});case`mcp-servers`:return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(G,{title:`MCP Servers`}),children:(0,k.jsx)(I,{})});case`history`:return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(G,{title:`History`}),children:(0,k.jsx)(U,{isOpen:!0,onClose:_,initialFilter:m,projects:i.projects,inline:!0})});case`account`:return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(G,{title:`Account`}),children:(0,k.jsx)(H,{})});default:return(0,k.jsx)(G,{title:`Settings`})}},e[16]=o,e[17]=_,e[18]=m,e[19]=i.projects,e[20]=E):E=e[20];let j=E,M,J;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>c(!0),J=()=>c(!1),e[21]=M,e[22]=J):(M=e[21],J=e[22]);let Y;e[23]===T?Y=e[24]:(Y=T(),e[23]=T,e[24]=Y);let X=`h-full overflow-auto ${s?`ml-[40px]`:``}`,Z;e[25]===j?Z=e[26]:(Z=j(),e[25]=j,e[26]=Z);let Q;e[27]!==X||e[28]!==Z?(Q=(0,k.jsx)(`div`,{className:X,children:Z}),e[27]=X,e[28]=Z,e[29]=Q):Q=e[29];let $;return e[30]!==Y||e[31]!==Q?($=(0,k.jsx)(A,{ref:l,collapsible:!0,onCollapse:M,onExpand:J,sidebar:Y,children:Q}),e[30]=Y,e[31]=Q,e[32]=$):$=e[32],$}async function ee(){try{await m()}catch(e){console.error(`Failed to reset onboarding:`,e)}}export{J as default};
|
package/dist/public/assets/{side-panel-container-DVnN8vFb.js → side-panel-container-BAYoMt7B.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialogs-config-
|
|
2
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialogs-config-vkfELnGl.js","assets/rolldown-runtime-B1FJdls4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Ar as t,Fn as n,Ir as r,Sa as i,Vn as a,ca as o}from"./dialogs-config-vkfELnGl.js";import{xt as s}from"./react-vendor-DyE9sO8V.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-vkfELnGl.js`).then(e=>e.S);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)(o,{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)(a,{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{Ar as e,Zn as t,ba as n}from"./dialogs-config-vkfELnGl.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Ar as t,Sa as n,Wn as r,Zn as i,ba as a}from"./dialogs-config-vkfELnGl.js";var o=a(),s=e(n(),1),c=t(),l=s.forwardRef((e,t)=>{let n=(0,o.c)(23),a,s,l,u,d,f,p,m,h;n[0]===e?(a=n[1],s=n[2],l=n[3],u=n[4],d=n[5],f=n[6],p=n[7],m=n[8],h=n[9]):({className:s,selected:f,noBackground:u,level:l,basePadding:a,indentSize:m,asChild:h,style:p,...d}=e,n[0]=e,n[1]=a,n[2]=s,n[3]=l,n[4]=u,n[5]=d,n[6]=f,n[7]=p,n[8]=m,n[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;n[10]!==s||n[11]!==b||n[12]!==x?(S=i(`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),n[10]=s,n[11]=b,n[12]=x,n[13]=S):S=n[13];let C=v===void 0?void 0:`${v}px`,w;n[14]!==p||n[15]!==C?(w={paddingLeft:C,...p},n[14]=p,n[15]=C,n[16]=w):w=n[16];let T;return n[17]!==y||n[18]!==d||n[19]!==t||n[20]!==S||n[21]!==w?(T=(0,c.jsx)(y,{ref:t,className:S,style:w,...d}),n[17]=y,n[18]=d,n[19]=t,n[20]=S,n[21]=w,n[22]=T):T=n[22],T});l.displayName=`StandardListItem`;export{l as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Sa as t,ba as n}from"./dialogs-config-vkfELnGl.js";var r=e(t(),1),i=n();function a(e){return typeof e==`string`?e.replace(/\\n/g,`
|
|
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,t=!1){let n=[],r=[],i=()=>{r.length>0&&(n.push({type:`thinking-group`,text:r.join(`
|
|
3
|
+
|
|
4
|
+
`),isCurrentlyStreaming:!1}),r=[])};for(let t of e)t.type===`reasoning`&&`text`in t?r.push(t.text):(i(),n.push(t));if(i(),t&&n.length>0){let e=n[n.length-1];e.type===`thinking-group`&&(e.isCurrentlyStreaming=!0)}return n}function m(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 h=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.SetChatInputDraft=`SET_CHAT_INPUT_DRAFT`,e.ClearChatInputDraft=`CLEAR_CHAT_INPUT_DRAFT`,e}({}),g={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:{},chatInputDrafts:{}};function _(e,t){switch(t.type){case h.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,contextWindow:e?.contextWindow,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 h.SetProjectsLoading:return{...e,projectsLoading:t.projectsLoading};case h.SelectThread:return{...e,selectedThreadId:t.threadId,selectedProjectId:t.projectId,messages:t.initialMessages??[],messagesLoaded:!1,focusChatInput:t.focusInput??!1};case h.ClearSelection:return{...e,selectedThreadId:null,selectedProjectId:null,messages:[],messagesLoaded:!1};case h.SetMessages:return{...e,messages:t.messages,messagesLoaded:!0};case h.AddMessage:return{...e,messages:[...e.messages,t.message]};case h.EnqueueChatMessage:return{...e,queuedChatMessages:[...e.queuedChatMessages,t.message]};case h.RemoveQueuedChatMessage:return{...e,queuedChatMessages:e.queuedChatMessages.filter(e=>e.id!==t.queuedMessageId)};case h.SetStreaming:return{...e,isStreaming:t.isStreaming};case h.AppendStreamContent:return{...e,streamingContent:e.streamingContent+t.content};case h.SetStreamContent:{let n=d(e.streamingSegments,t.content);return{...e,streamingContent:t.content,streamingSegments:n}}case h.AppendStreamThinking:return{...e,streamingThinking:e.streamingThinking+t.content};case h.IncrementStreamEventCount:return{...e,streamingEventCount:e.streamingEventCount+1};case h.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 h.SetStreamModel:return{...e,streamingModel:t.model};case h.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 h.ResetStream:return{...e,streamingContent:``,streamingThinking:``,streamingSegments:[],streamingModel:``,isStreaming:!1,toolCallProgress:{},streamingEventCount:0};case h.StopStream:return{...e,isStreaming:!1};case h.ToggleSidebar:return{...e,sidebarOpen:!e.sidebarOpen};case h.SetCreatingProject:return{...e,isCreatingProject:t.isCreating};case h.ConfigUpdated:return{...e,configUpdatedAt:Date.now()};case h.SetProcessingThreads:return{...e,processingThreadIds:t.threadIds};case h.AddProcessingThread:return{...e,processingThreadIds:e.processingThreadIds.includes(t.threadId)?e.processingThreadIds:[...e.processingThreadIds,t.threadId]};case h.RemoveProcessingThread:return{...e,processingThreadIds:e.processingThreadIds.filter(e=>e!==t.threadId)};case h.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 h.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 h.RemoveCreatingProject:return{...e,projects:e.projects.filter(e=>e.projectId!==t.projectId)};case h.RemoveCreatingThread:return{...e,projects:e.projects.map(e=>e.projectId===t.projectId?{...e,threads:e.threads.filter(e=>e.threadId!==t.threadId)}:e)};case h.MarkThreadCompleted:return{...e,completedThreadIds:e.completedThreadIds.includes(t.threadId)?e.completedThreadIds:[...e.completedThreadIds,t.threadId]};case h.ClearThreadCompleted:return{...e,completedThreadIds:e.completedThreadIds.filter(e=>e!==t.threadId)};case h.AddDeletingThread:return{...e,deletingThreadIds:e.deletingThreadIds.includes(t.threadId)?e.deletingThreadIds:[...e.deletingThreadIds,t.threadId]};case h.RemoveDeletingThread:return{...e,deletingThreadIds:e.deletingThreadIds.filter(e=>e!==t.threadId)};case h.AddDeletingProject:return{...e,deletingProjectIds:e.deletingProjectIds.includes(t.projectId)?e.deletingProjectIds:[...e.deletingProjectIds,t.projectId]};case h.RemoveDeletingProject:return{...e,deletingProjectIds:e.deletingProjectIds.filter(e=>e!==t.projectId)};case h.AppendCommandOutput:return{...e,commandOutput:e.commandOutput+t.content};case h.SetRunningCommand:return{...e,isRunningCommand:t.isRunning};case h.ClearCommandOutput:return{...e,commandOutput:``};case h.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 h.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 h.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 h.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 h.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 h.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 h.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 h.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 h.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 h.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 h.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 h.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 h.ClearFocusChatInput:return{...e,focusChatInput:!1};case h.ClearMessages:return{...e,messages:[]};case h.UpdateToolCallProgress:return{...e,toolCallProgress:{...e.toolCallProgress,[t.toolCallId]:t.progress}};case h.SetPendingChatMessage:return{...e,pendingChatMessage:t.message};case h.ClearPendingChatMessage:return{...e,pendingChatMessage:null};case h.SetDiffComments:return{...e,diffComments:{...e.diffComments,[t.threadId]:t.comments}};case h.SetChatInputDraft:return{...e,chatInputDrafts:{...e.chatInputDrafts,[t.threadId]:t.draft}};case h.ClearChatInputDraft:{let{[t.threadId]:n,...r}=e.chatInputDrafts;return{...e,chatInputDrafts:r}}default:return e}}var v=(0,r.createContext)({state:g,dispatch:()=>{}});function y(){return(0,r.useContext)(v)}function b(e){let t=(0,i.c)(11),{state:n,dispatch:r}=y();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:x},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 x(){}export{y as a,f as c,p as d,a as f,g as i,u as l,o as m,v as n,b as o,l as p,_ as r,m as s,h as t,d as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Sa as t}from"./dialogs-config-vkfELnGl.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Ar as t,Sa as n,Zn as r,ba as i}from"./dialogs-config-vkfELnGl.js";import{F as a,I as o,L as s,P as c}from"./react-vendor-DyE9sO8V.js";var l=i(),u=e(n(),1),d=t(),f=o,p=u.forwardRef((e,t)=>{let n=(0,l.c)(9),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let s;n[3]===i?s=n[4]:(s=r(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,i),n[3]=i,n[4]=s);let c;return n[5]!==o||n[6]!==t||n[7]!==s?(c=(0,d.jsx)(a,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=c):c=n[8],c});p.displayName=a.displayName;var m=u.forwardRef((e,t)=>{let n=(0,l.c)(9),i,a;n[0]===e?(i=n[1],a=n[2]):({className:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let o;n[3]===i?o=n[4]:(o=r(`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),n[3]=i,n[4]=o);let c;return n[5]!==a||n[6]!==t||n[7]!==o?(c=(0,d.jsx)(s,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=c):c=n[8],c});m.displayName=s.displayName;var h=u.forwardRef((e,t)=>{let n=(0,l.c)(9),i,a;n[0]===e?(i=n[1],a=n[2]):({className:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let o;n[3]===i?o=n[4]:(o=r(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,i),n[3]=i,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,d.jsx)(c,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});h.displayName=c.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{
|
|
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})}}},[
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$i as t,Ar as n,Sa as r,ca as i,rn as a}from"./dialogs-config-vkfELnGl.js";import{a as o,o as s,t as c}from"./store-BcwWHqYr.js";import{n as l}from"./tab-context-DWD20a4z.js";var u=e(r(),1),d=n();function f(){let e=o().state,{selectedProjectId:n,selectedThreadId:r}=e,{terminalState:f,dispatch:p}=s(r),{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===r)?.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},[r,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,t)=>{if(!(!n||!r||!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 a(n,r,e,t??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})}}},[n,r,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)(i,{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)(i,{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)(t,{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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Ar as t,Sa as n,Zn as r,ba as i}from"./dialogs-config-vkfELnGl.js";var a=i(),o=e(n(),1),s=t(),c=o.forwardRef((e,t)=>{let n=(0,a.c)(9),i,o;n[0]===e?(i=n[1],o=n[2]):({className:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let c;n[3]===i?c=n[4]:(c=r(`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),n[3]=i,n[4]=c);let l;return n[5]!==o||n[6]!==t||n[7]!==c?(l=(0,s.jsx)(`textarea`,{className:c,ref:t,...o}),n[5]=o,n[6]=t,n[7]=c,n[8]=l):l=n[8],l});c.displayName=`Textarea`;export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./index-DKQVo4Vz.js";export{e as TodosView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Sa as t,ba as n}from"./dialogs-config-vkfELnGl.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 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Sa as t}from"./dialogs-config-vkfELnGl.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{xt as e}from"./react-vendor-DyE9sO8V.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="15" viewBox="0 0 16 15" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="antigravity__mask0_111_52" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="16" height="15"><path d="M14.0777 13.984C14.945 14.6345 16.2458 14.2008 15.0533 13.0084C11.476 9.53949 12.2349 0 7.79033 0C3.34579 0 4.10461 9.53949 0.527295 13.0084C-0.773543 14.3092 0.635692 14.6345 1.50293 13.984C4.86344 11.7076 4.64663 7.69664 7.79033 7.69664C10.934 7.69664 10.7172 11.7076 14.0777 13.984Z" fill="black"/></mask><g mask="url(#antigravity__mask0_111_52)"><g filter="url(#antigravity__filter0_f_111_52)"><path d="M-0.658907 -3.2306C-0.922679 -0.906781 1.07986 1.22861 3.81388 1.53894C6.54791 1.84927 8.97811 0.217009 9.24188 -2.10681C9.50565 -4.43063 7.50312 -6.56602 4.76909 -6.87635C2.03506 -7.18667 -0.395135 -5.55442 -0.658907 -3.2306Z" fill="#FFE432"/></g><g filter="url(#antigravity__filter1_f_111_52)"><path d="M9.88233 4.36642C10.5673 7.31568 13.566 9.13902 16.5801 8.43896C19.5942 7.73891 21.4823 4.78056 20.7973 1.83131C20.1123 -1.11795 17.1136 -2.94128 14.0995 -2.24123C11.0854 -1.54118 9.19733 1.41717 9.88233 4.36642Z" fill="#FC413D"/></g><g filter="url(#antigravity__filter2_f_111_52)"><path d="M-8.05291 6.34512C-7.18736 9.38883 -3.28925 10.9473 0.653774 9.82598C4.5968 8.7047 7.09158 5.32829 6.22603 2.28458C5.36048 -0.759142 1.46236 -2.31758 -2.48066 -1.19629C-6.42368 -0.0750048 -8.91846 3.3014 -8.05291 6.34512Z" fill="#00B95C"/></g><g filter="url(#antigravity__filter3_f_111_52)"><path d="M-8.05291 6.34512C-7.18736 9.38883 -3.28925 10.9473 0.653774 9.82598C4.5968 8.7047 7.09158 5.32829 6.22603 2.28458C5.36048 -0.759142 1.46236 -2.31758 -2.48066 -1.19629C-6.42368 -0.0750048 -8.91846 3.3014 -8.05291 6.34512Z" fill="#00B95C"/></g><g filter="url(#antigravity__filter4_f_111_52)"><path d="M-4.92402 8.86746C-2.75421 11.0837 0.982691 10.9438 3.42257 8.55507C5.86246 6.1663 6.08139 2.43321 3.91158 0.216963C1.74177 -1.99928 -1.99513 -1.85942 -4.43501 0.529349C-6.87489 2.91812 -7.09383 6.65122 -4.92402 8.86746Z" fill="#00B95C"/></g><g filter="url(#antigravity__filter5_f_111_52)"><path d="M6.42819 17.2263C7.10197 20.1273 9.91278 21.953 12.7063 21.3042C15.4998 20.6553 17.2182 17.7777 16.5444 14.8767C15.8707 11.9757 13.0599 10.15 10.2663 10.7988C7.47281 11.4477 5.75441 14.3253 6.42819 17.2263Z" fill="#3186FF"/></g><g filter="url(#antigravity__filter6_f_111_52)"><path d="M1.66508 -5.94539C0.254213 -2.80254 1.7978 0.951609 5.11277 2.43973C8.42774 3.92785 12.2588 2.58642 13.6696 -0.556431C15.0805 -3.69928 13.5369 -7.45343 10.222 -8.94155C6.90699 -10.4297 3.07594 -9.08824 1.66508 -5.94539Z" fill="#FBBC04"/></g><g filter="url(#antigravity__filter7_f_111_52)"><path d="M-2.11428 24.3903C-5.52984 23.0496 0.307266 12.0177 1.75874 8.32038C3.21024 4.62304 7.15576 2.71272 10.5713 4.05357C13.9869 5.39442 18.0354 12.7796 16.5838 16.477C15.1323 20.1743 1.30129 25.7311 -2.11428 24.3903Z" fill="#3186FF"/></g><g filter="url(#antigravity__filter8_f_111_52)"><path d="M18.5814 10.6598C17.6669 11.727 15.2806 11.1828 13.2514 9.44417C11.2222 7.70556 10.3185 5.43097 11.2329 4.3637C12.1473 3.29646 14.5336 3.84069 16.5628 5.57928C18.592 7.31789 19.4958 9.59249 18.5814 10.6598Z" fill="#749BFF"/></g><g filter="url(#antigravity__filter9_f_111_52)"><path d="M11.7552 5.22715C15.5162 7.77124 19.8471 7.93838 21.4286 5.60045C23.0101 3.26253 21.2433 -0.695128 17.4823 -3.23922C13.7213 -5.78331 9.39044 -5.95044 7.80896 -3.61252C6.22747 -1.27459 7.99428 2.68306 11.7552 5.22715Z" fill="#FC413D"/></g><g filter="url(#antigravity__filter10_f_111_52)"><path d="M-0.592149 1.08896C-1.5239 3.33663 -1.21959 5.59799 0.0875457 6.13985C1.39468 6.68171 3.20966 5.29888 4.14141 3.05121C5.07316 0.803541 4.76885 -1.45782 3.46171 -1.99968C2.15458 -2.54154 0.339602 -1.15871 -0.592149 1.08896Z" fill="#FFEE48"/></g></g><defs><filter id="antigravity__filter0_f_111_52" x="-2.12817" y="-8.35998" width="12.8393" height="11.383" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="0.722959" result="effect1_foregroundBlur_111_52"/></filter><filter id="antigravity__filter1_f_111_52" x="2.75168" y="-9.38089" width="25.1763" height="24.96" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="3.49513" result="effect1_foregroundBlur_111_52"/></filter><filter id="antigravity__filter2_f_111_52" x="-14.1669" y="-7.50196" width="26.5068" height="23.6338" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="2.97119" result="effect1_foregroundBlur_111_52"/></filter><filter id="antigravity__filter3_f_111_52" x="-14.1669" y="-7.50196" width="26.5068" height="23.6338" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="2.97119" result="effect1_foregroundBlur_111_52"/></filter><filter id="antigravity__filter4_f_111_52" x="-12.3607" y="-7.29981" width="23.709" height="23.6846" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="2.97119" result="effect1_foregroundBlur_111_52"/></filter><filter id="antigravity__filter5_f_111_52" x="0.634962" y="5.02095" width="21.7027" height="22.0616" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="2.82351" result="effect1_foregroundBlur_111_52"/></filter><filter id="antigravity__filter6_f_111_52" x="-3.97547" y="-14.6666" width="23.2857" height="22.8313" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="2.5589" result="effect1_foregroundBlur_111_52"/></filter><filter id="antigravity__filter7_f_111_52" x="-7.7407" y="-0.945408" width="29.1982" height="30.1105" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="2.2852" result="effect1_foregroundBlur_111_52"/></filter><filter id="antigravity__filter8_f_111_52" x="6.78641" y="-0.27231" width="16.2415" height="15.5681" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="2.04485" result="effect1_foregroundBlur_111_52"/></filter><filter id="antigravity__filter9_f_111_52" x="3.77526" y="-8.71693" width="21.687" height="19.4212" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="1.72712" result="effect1_foregroundBlur_111_52"/></filter><filter id="antigravity__filter10_f_111_52" x="-5.40727" y="-6.39238" width="14.3639" height="16.9254" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="2.1376" result="effect1_foregroundBlur_111_52"/></filter></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60" fill="none"><path d="M23.2312 25.1611L23.2312 25.1651C24.079 24.6758 25.0422 24.4173 26.0173 24.4173L26.089 24.4173L26.1904 24.4193C26.2581 24.4212 26.3238 24.4232 26.3914 24.4292L26.4412 24.4332C27.2452 24.4928 28.0094 24.7196 28.7218 25.1114C28.7934 25.1512 28.8631 25.1909 28.9328 25.2327C28.9865 25.2665 29.0402 25.3003 29.0959 25.3361L29.1477 25.3699C29.5875 25.6663 29.9835 26.0263 30.3338 26.4479C30.3815 26.5056 30.4273 26.5633 30.483 26.6369L30.5109 26.6727C30.5467 26.7204 30.5825 26.7701 30.6163 26.8198L30.678 26.9093C30.7059 26.9511 30.7318 26.9929 30.7576 27.0346C30.7795 27.0704 30.8014 27.1062 30.8233 27.142L30.8611 27.2057C31.3507 28.051 31.6094 29.0176 31.6094 29.9961L31.6074 29.9961C31.6074 30.9766 31.3487 31.9412 30.8591 32.7865L30.7736 32.9317C30.7377 32.9894 30.7019 33.045 30.6661 33.1007L30.6382 33.1425C30.1845 33.8088 29.6074 34.3557 28.9089 34.7774C28.8392 34.8191 28.7696 34.8589 28.6979 34.8987C28.6422 34.9305 28.5845 34.9584 28.5268 34.9882L28.4711 35.016C27.9934 35.2487 27.484 35.4118 26.9447 35.5033C26.871 35.5152 26.7974 35.5252 26.7238 35.5351L26.6621 35.5431C26.6024 35.5491 26.5427 35.555 26.481 35.561C26.4452 35.563 26.4094 35.567 26.3735 35.5689C26.3238 35.5729 26.276 35.5749 26.2263 35.5749C26.1845 35.5749 26.1427 35.5769 26.1009 35.5789L26.0253 35.5789L26.0213 35.5789C25.0442 35.5789 24.081 35.3203 23.2332 34.8311L18.067 31.8517L7.73063 37.8263L7.72664 49.7497L18.063 55.7144L28.4034 49.7477L28.4034 43.783C28.4034 42.8025 28.6621 41.8379 29.1517 40.9926L29.2372 40.8474C29.2731 40.7898 29.3089 40.7341 29.3447 40.6784L29.3726 40.6366C29.8263 39.9703 30.4034 39.4234 31.1019 39.0018C31.1716 38.96 31.2412 38.9202 31.3129 38.8804C31.3686 38.8506 31.4243 38.8208 31.484 38.7909L31.5397 38.7631C32.0173 38.5304 32.5268 38.3673 33.0661 38.2758C33.1397 38.2639 33.2134 38.2539 33.287 38.244L33.3487 38.236C33.4084 38.2301 33.4681 38.2241 33.5318 38.2181L33.6373 38.2102C33.687 38.2062 33.7348 38.2042 33.7845 38.2042C33.8263 38.2042 33.8681 38.2022 33.9099 38.2002L33.9855 38.2002L33.9895 38.2002C34.9666 38.2002 35.9298 38.4588 36.7776 38.9481L41.9458 41.9274L52.2861 35.9608L52.2822 24.0334L41.9478 18.0668L36.7796 21.0541L36.7756 21.0461C35.9258 21.5354 34.9646 21.788 33.9815 21.7939L33.9159 21.7939L33.8124 21.7919C33.7447 21.79 33.6791 21.788 33.6114 21.782L33.5616 21.778C32.7577 21.7184 31.9935 21.4916 31.281 21.0998C31.2094 21.06 31.1397 21.0203 31.0701 20.9785C31.0144 20.9447 30.9606 20.9089 30.9069 20.8751L30.8552 20.8413C30.4154 20.5449 30.0193 20.1849 29.6691 19.7633C29.6213 19.7056 29.5755 19.6479 29.5198 19.5743L29.492 19.5385C29.4561 19.4908 29.4203 19.4411 29.3865 19.3914L29.3248 19.3019C29.2969 19.2601 29.2711 19.2183 29.2452 19.1766C29.2233 19.1408 29.1994 19.105 29.1775 19.0672L29.1417 19.0055C28.6522 18.1602 28.3934 17.1936 28.3934 16.2151L28.3915 16.2151L28.3915 10.2524L18.1048 4.31363L18.0551 4.28578L7.71869 10.2604L7.71471 22.1838L18.0511 28.1484L23.2213 25.1651L23.2312 25.1611Z" fill="#191919" fill-opacity="0.4"/></svg>
|
package/dist/public/index.html
CHANGED
|
@@ -19,27 +19,29 @@
|
|
|
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-
|
|
22
|
+
<script type="module" crossorigin src="/assets/index-DKQVo4Vz.js"></script>
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-B1FJdls4.js">
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/dialogs-config-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/history-view-
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/monaco-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/react-vendor-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/onboarding-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/alert-dialog-
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/use-toast-
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/store-
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/tab-context-
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
37
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
38
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
39
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
40
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
41
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
42
|
-
<link rel="
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/dialogs-config-vkfELnGl.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/history-view-Dn0hQIKU.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/monaco-SWcefg0q.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/react-vendor-DyE9sO8V.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/onboarding-DslO5AS6.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/alert-dialog-CQRWdGnn.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/use-toast-yY7qQuQP.js">
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/assets/store-BcwWHqYr.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/assets/tab-context-DWD20a4z.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/whisper-wasm-B7iuRPFr.js">
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/utils-BKss67Vg.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/chat-input-container-C6U_WFFu.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/markdown-renderer-CNuyXHcy.js">
|
|
37
|
+
<link rel="modulepreload" crossorigin href="/assets/page-toolbar-CloU_Kvo.js">
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/assets/run-stop-button-DZ4JFwdL.js">
|
|
39
|
+
<link rel="modulepreload" crossorigin href="/assets/side-panel-container-BAYoMt7B.js">
|
|
40
|
+
<link rel="modulepreload" crossorigin href="/assets/resizable-dToeUeVD.js">
|
|
41
|
+
<link rel="modulepreload" crossorigin href="/assets/standard-list-item-BLlgm1qW.js">
|
|
42
|
+
<link rel="modulepreload" crossorigin href="/assets/tabs-CgvpwOBj.js">
|
|
43
|
+
<link rel="modulepreload" crossorigin href="/assets/textarea-C2UIAa7y.js">
|
|
44
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Bdde81Uo.css">
|
|
43
45
|
</head>
|
|
44
46
|
<body class="font-sans antialiased">
|
|
45
47
|
<div id="root"></div>
|