tarsk 0.4.27 → 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 +438 -148
- 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-DlzO5cMP.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-DZFG2IQM.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-TvYsDwUY.js → page-toolbar-CloU_Kvo.js} +1 -1
- package/dist/public/assets/{project-settings-view-C7GW_R0m.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-DzrIos_Y.js → resizable-dToeUeVD.js} +1 -1
- package/dist/public/assets/{run-stop-button-k1LeM0M-.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-Becs_RxN.js → settings-mcp-servers-view-q6gGMMVX.js} +4 -4
- 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-aPv03-bO.js → settings-skills-view-DV40_L1o.js} +2 -2
- package/dist/public/assets/{settings-slash-commands-view-DLMWXQXA.js → settings-slash-commands-view-BEk3BgOY.js} +1 -1
- 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-oMcXib2A.js → side-panel-container-BAYoMt7B.js} +2 -2
- package/dist/public/assets/{skeleton-Bc0U0oGc.js → skeleton-DveUQR4w.js} +1 -1
- 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-CCvlrC0o.js → tab-context-DWD20a4z.js} +1 -1
- package/dist/public/assets/tabs-CgvpwOBj.js +1 -0
- package/dist/public/assets/{terminal-panel-GuO2XygM.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-DqmC-mB5.js → use-toast-yY7qQuQP.js} +1 -1
- package/dist/public/assets/{utils-Cy2s2TEb.js → utils-BKss67Vg.js} +1 -1
- package/dist/public/assets/{whisper-wasm-Clnf-l-9.js → whisper-wasm-B7iuRPFr.js} +1 -1
- package/dist/public/ide/antigravity.svg +1 -0
- package/dist/public/ide/devin.svg +1 -0
- package/dist/public/index.html +22 -21
- package/package.json +1 -1
- package/dist/public/assets/account-view-BFhjAYmz.js +0 -1
- package/dist/public/assets/alert-dialog--tUzAWFm.js +0 -1
- package/dist/public/assets/api-BBbysRIh.js +0 -1
- package/dist/public/assets/chat-input-container-B_qVOGzW.js +0 -21
- package/dist/public/assets/context-menu-D5slxFcc.js +0 -1
- package/dist/public/assets/conversation-history-view-B4zHwyrw.js +0 -1
- package/dist/public/assets/diff-view-fOVqrHQW.js +0 -3
- package/dist/public/assets/explorer-tab-view-MLrWJ1Y0.js +0 -2
- package/dist/public/assets/explorer-tree-8TyBYuC7.js +0 -1
- package/dist/public/assets/explorer-view-5U70mfAJ.js +0 -1
- package/dist/public/assets/history-view-BR8scGnM.js +0 -1
- package/dist/public/assets/index-0BuHfewk.css +0 -1
- package/dist/public/assets/index-BTbiyooe.js +0 -37
- package/dist/public/assets/mcp-server-card-DupwHcKT.js +0 -1
- package/dist/public/assets/onboarding-Cn5RqOCa.js +0 -1
- package/dist/public/assets/onboarding-dialog-BXsvjU1t.js +0 -1
- package/dist/public/assets/providers-list-view-AVt5I1WB.js +0 -1
- package/dist/public/assets/radio-group-Mifbn8sU.js +0 -1
- package/dist/public/assets/react-vendor-Bao-KYKs.js +0 -22
- package/dist/public/assets/settings-instructions-view-CgfWSPmK.js +0 -1
- package/dist/public/assets/settings-models-view-BqdD_7GR.js +0 -1
- package/dist/public/assets/settings-rules-view-D7j5OHUi.js +0 -8
- package/dist/public/assets/settings-subagents-view-DBYzNE4W.js +0 -2
- package/dist/public/assets/settings-view-CccwUKkf.js +0 -2
- package/dist/public/assets/standard-list-item-D2lbPXa1.js +0 -1
- package/dist/public/assets/store-CwvBC-YP.js +0 -2
- package/dist/public/assets/tabs-Mb_cjIfE.js +0 -1
- package/dist/public/assets/textarea-DpXOZLt8.js +0 -1
- package/dist/public/assets/todos-view-C4GMi1Np.js +0 -1
- /package/dist/public/assets/{dist-BI23Ei33.js → dist-Bjt_i1zi.js} +0 -0
- /package/dist/public/assets/{monaco-DDfTQM3i.js → monaco-SWcefg0q.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{At as t,Dr as n,Rn as r,Si as i,sn as a,ya as o}from"./dialogs-config-DZFG2IQM.js";import{a as s}from"./store-CwvBC-YP.js";import{t as c}from"./textarea-DpXOZLt8.js";import{t as l}from"./use-toast-DqmC-mB5.js";var u=e(o(),1),d=n();function f(){let{state:e}=s(),{selectedThreadId:n}=e,[o,f]=(0,u.useState)(``),[p,m]=(0,u.useState)(!1),[h,g]=(0,u.useState)(!1);(0,u.useEffect)(()=>{n&&(m(!0),t(n,`AGENTS.md`).then(e=>f(e.content)).catch(()=>f(``)).finally(()=>m(!1)))},[n]);async function _(){if(n){g(!0);try{await a(n,`AGENTS.md`,o),l({title:`Instructions saved`})}catch(e){l({title:`Error`,description:e instanceof Error?e.message:`Failed to save instructions`,variant:`destructive`})}finally{g(!1)}}}return n?(0,d.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:(0,d.jsxs)(`div`,{className:`mx-auto flex min-h-0 w-full max-w-4xl flex-1 flex-col p-6`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-6 shrink-0`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Instructions`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Add context like coding guidelines and expectations that are relevant for all conversations. This is stored in the AGENTS.md file.`})]}),(0,d.jsx)(r,{onClick:_,disabled:p||h,children:h?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`})]}),p?(0,d.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,d.jsx)(i,{className:`h-8 w-8 animate-spin text-muted-foreground`})}):(0,d.jsx)(c,{value:o,onChange:e=>f(e.target.value),className:`flex-1 font-mono text-sm resize-none`,placeholder:`Add instructions for your agent in AGENTS.md...`,disabled:h})]})}):(0,d.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Select a thread to edit instructions.`})})}export{f as SettingsInstructionsView,f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$ as t,Dr as n,Et as r,G as i,H as a,K as o,Kr as s,Ln as c,Mn as l,Rn as u,Si as d,Tt as f,U as p,W as m,Yn as h,ei as g,et as _,ga as v,q as ee,qi as y,ya as b}from"./dialogs-config-DZFG2IQM.js";import{c as x,l as S,s as C,u as w}from"./history-view-BR8scGnM.js";import{n as T,r as E}from"./onboarding-Cn5RqOCa.js";import{i as D,n as O,r as te,t as ne}from"./tabs-Mb_cjIfE.js";var k=e(b(),1),A=n();function j(){let[e,n]=(0,k.useState)([]),[b,j]=(0,k.useState)({}),[M,N]=(0,k.useState)({}),[P,F]=(0,k.useState)({}),[I,L]=(0,k.useState)({}),[R,z]=(0,k.useState)(!0),[B,V]=(0,k.useState)(``),[H,U]=(0,k.useState)(`coding`),[W,G]=(0,k.useState)(``),[K,q]=(0,k.useState)({}),[J,Y]=(0,k.useState)(``),X=e=>E(e.id);(0,k.useEffect)(()=>{(async()=>{z(!0),V(``);try{let[e,i,a]=await Promise.all([r(),_(),t()]),s=e.filter(e=>e.apiKey);n(s);let c={};s.forEach(e=>{c[e.slug]=`alphabetical`}),q(c);let l={},u={},d={},f={};await Promise.all(s.map(async e=>{try{let[t,n]=await Promise.all([ee(e.slug),o(e.slug)]);l[e.slug]=t,u[e.slug]=n;let r=new Set((i[e.slug]||[]).map(e=>e.id));d[e.slug]=r;let s=new Set((a[e.slug]||[]).map(e=>e.id));f[e.slug]=s}catch(t){console.error(`Failed to load models for ${e.slug}:`,t),l[e.slug]=[],u[e.slug]=[],d[e.slug]=new Set,f[e.slug]=new Set}})),j(l),N(u),F(d),L(f)}catch(e){V(e instanceof Error?e.message:`Failed to load models`)}finally{z(!1)}})()},[]);let Z=async(e,t,n)=>{try{n===`image`?I[e]?.has(t)?(await a(e,t),L(n=>{let r=new Set(n[e]??[]);return r.delete(t),{...n,[e]:r}})):(await m(e,t),L(n=>({...n,[e]:new Set([...n[e]||[],t])}))):P[e]?.has(t)?(await p(e,t),F(n=>{let r=new Set(n[e]??[]);return r.delete(t),{...n,[e]:r}})):(await i(e,t),F(n=>({...n,[e]:new Set([...n[e]||[],t])}))),Y(`Model preferences saved successfully`),setTimeout(()=>Y(``),3e3)}catch(e){Y(e instanceof Error?e.message:`Failed to save model changes`)}},Q=async(e,t,n)=>{let r=n===`image`?M[e]:b[e],i=n===`image`?I[e]:P[e];if(r)for(let a of r)i?.has(a.id)!==t&&await Z(e,a.id,n)},re=e=>e?e<20?1:e<30?2:e<40?3:e<50?4:5:0,ie=({codingIndex:e,modelName:t})=>{let n=re(e);return n===0?null:(0,A.jsx)(S,{children:(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(`div`,{className:`flex items-center gap-0.5`,children:[1,2,3,4,5].map(e=>(0,A.jsx)(s,{className:`h-3 w-3 ${e<=n?`fill-yellow-400 text-yellow-400`:`text-gray-300`}`},e))})}),(0,A.jsx)(x,{children:(0,A.jsxs)(`p`,{className:`text-sm`,children:[t,` was indexed `,e,` for coding intelligence`]})})]})})},$=(e,t,n)=>{let r=W.toLowerCase();return e.filter(e=>{let t=X(e);return e.name.toLowerCase().includes(r)||e.id.toLowerCase().includes(r)||t.toLowerCase().includes(r)}).sort((e,r)=>{let i=+!t.has(e.id),a=+!t.has(r.id);if(i!==a)return i-a;if(n===`price-low`){let t=!!e.pricing;return t===!!r.pricing?!e.pricing||!r.pricing?0:((e.pricing.prompt??0)+(e.pricing.completion??0))/2-((r.pricing.prompt??0)+(r.pricing.completion??0))/2:t?-1:1}if(n===`price-high`){let t=!!e.pricing;if(t!==!!r.pricing)return t?-1:1;if(!e.pricing||!r.pricing)return 0;let n=((e.pricing.prompt??0)+(e.pricing.completion??0))/2;return((r.pricing.prompt??0)+(r.pricing.completion??0))/2-n}if(n===`coding-index`){let t=e.coding_index!==void 0&&e.coding_index!==null;return t===(r.coding_index!==void 0&&r.coding_index!==null)?e.coding_index==null||r.coding_index==null?0:r.coding_index-e.coding_index:t?-1:1}return X(e).localeCompare(X(r))})};return R?(0,A.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,A.jsx)(d,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):B?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center h-full`,children:(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-sm text-destructive mb-2`,children:B}),(0,A.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>window.location.reload(),children:`Retry`})]})}):e.length===0?(0,A.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Providers Configured`}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Configure a provider with an API key to view available models.`})]})}):(0,A.jsx)(l,{className:`flex-1`,children:(0,A.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[(0,A.jsxs)(`div`,{className:`mb-6`,children:[(0,A.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Models`}),(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`View and manage available models from your configured providers.`})]}),(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(g,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,A.jsx)(c,{placeholder:`Search models across all providers...`,className:`pl-10`,value:W,onChange:e=>G(e.target.value)})]}),(0,A.jsxs)(ne,{value:H,onValueChange:e=>{U(e),G(``)},children:[(0,A.jsxs)(te,{className:`mb-4`,children:[(0,A.jsx)(D,{value:`coding`,children:`Coding`}),e.some(e=>e.name.toLowerCase()===`openrouter`)&&(0,A.jsx)(D,{value:`image`,children:`Image`})]}),(0,A.jsx)(O,{value:`coding`,children:(0,A.jsx)(`div`,{className:`space-y-6`,children:e.map(e=>{let t=b[e.slug]||[],n=P[e.slug]||new Set,r=K[e.slug]||`alphabetical`,i=$(t,n,r);return i.length===0&&W?null:(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:(0,A.jsx)(`img`,{src:f(e.slug),alt:`${e.name} logo`,className:`h-5 w-5 dark:invert`,onError:e=>{e.target.style.display=`none`;let t=e.target.parentElement;t&&(t.classList.remove(`overflow-hidden`),t.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-muted-foreground"><path d="M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5"/><path d="M8.5 8.5a2.5 2.5 0 0 0 0 5"/><path d="M15.5 15.5a2.5 2.5 0 0 0 0-5"/></svg>`)}})}),(0,A.jsx)(`h3`,{className:`text-lg font-semibold`,children:e.name})]}),i.length>0&&(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(T,{id:`select-all-${e.slug}`,checked:i.every(e=>n.has(e.id)),onCheckedChange:t=>Q(e.slug,t===!0,`coding`)}),(0,A.jsx)(`label`,{htmlFor:`select-all-${e.slug}`,className:`text-sm cursor-pointer whitespace-nowrap`,children:`Select all models`})]}),(0,A.jsx)(S,{children:(0,A.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(u,{type:`button`,variant:r===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`alphabetical`})),children:(0,A.jsx)(v,{className:`h-4 w-4`})})}),(0,A.jsx)(x,{children:`Sort A–Z`})]}),(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(u,{type:`button`,variant:r===`price-low`||r===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`price-low`})),children:(0,A.jsx)(y,{className:`h-4 w-4`})})}),(0,A.jsx)(x,{children:`Sort by price`})]}),(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(u,{type:`button`,variant:r===`coding-index`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`coding-index`})),children:(0,A.jsx)(s,{className:`h-4 w-4`})})}),(0,A.jsx)(x,{children:`Sort by coding intelligence`})]})]})})]}),i.length===0?(0,A.jsx)(`div`,{className:`text-center py-4 border border-border rounded-md`,children:(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:W?`No models matching your search.`:`No models available for this provider.`})}):(0,A.jsx)(S,{children:(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:i.map(t=>{let i=n.has(t.id),a=t.pricing;return(0,A.jsxs)(`div`,{className:`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0`,children:[(0,A.jsx)(T,{id:t.id,checked:i,onCheckedChange:()=>Z(e.slug,t.id,`coding`),className:`mt-0`}),(0,A.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,A.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,A.jsx)(`label`,{htmlFor:t.id,className:`text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`,children:X(t)})}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[r===`coding-index`&&(0,A.jsx)(ie,{codingIndex:t.coding_index,modelName:X(t)}),a&&(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:(a.prompt??0)===0&&(a.completion??0)===0?``:`$${h(a.prompt??0)} in | $${h(a.completion??0)} out`})]})]})]},t.id)})})})]},e.slug)})})}),(0,A.jsx)(O,{value:`image`,children:(0,A.jsx)(`div`,{className:`space-y-6`,children:e.filter(e=>e.name.toLowerCase()===`openrouter`).map(e=>{let t=M[e.slug]||[],n=I[e.slug]||new Set,r=K[e.slug]||`alphabetical`,i=$(t,n,r);return i.length===0&&W?null:(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-muted flex items-center justify-center overflow-hidden`,children:(0,A.jsx)(`img`,{src:f(e.slug),alt:`${e.name} logo`,className:`h-5 w-5 dark:invert`,onError:e=>{e.target.style.display=`none`;let t=e.target.parentElement;t&&(t.classList.remove(`overflow-hidden`),t.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-muted-foreground"><path d="M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5"/><path d="M8.5 8.5a2.5 2.5 0 0 0 0 5"/><path d="M15.5 15.5a2.5 2.5 0 0 0 0-5"/></svg>`)}})}),(0,A.jsx)(`h3`,{className:`text-lg font-semibold`,children:e.name})]}),i.length>0&&(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(T,{id:`select-all-image-${e.slug}`,checked:i.every(e=>n.has(e.id)),onCheckedChange:t=>Q(e.slug,t===!0,`image`)}),(0,A.jsx)(`label`,{htmlFor:`select-all-image-${e.slug}`,className:`text-sm cursor-pointer whitespace-nowrap`,children:`Select all models`})]}),(0,A.jsx)(S,{children:(0,A.jsxs)(`div`,{className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(u,{type:`button`,variant:r===`alphabetical`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`alphabetical`})),children:(0,A.jsx)(v,{className:`h-4 w-4`})})}),(0,A.jsx)(x,{children:`Sort A–Z`})]}),(0,A.jsxs)(C,{children:[(0,A.jsx)(w,{asChild:!0,children:(0,A.jsx)(u,{type:`button`,variant:r===`price-low`||r===`price-high`?`secondary`:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>q(t=>({...t,[e.slug]:`price-low`})),children:(0,A.jsx)(y,{className:`h-4 w-4`})})}),(0,A.jsx)(x,{children:`Sort by price`})]})]})})]}),i.length===0?(0,A.jsx)(`div`,{className:`text-center py-4 border border-border rounded-md`,children:(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:W?`No models matching your search.`:`No image models available for this provider.`})}):(0,A.jsx)(S,{children:(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-0 border border-border rounded-md overflow-hidden`,children:i.map(t=>{let r=n.has(t.id),i=t.pricing;return(0,A.jsxs)(`div`,{className:`flex items-center space-x-3 p-3 hover:bg-muted/30 transition-colors cursor-default border-b border-border last:border-b-0`,children:[(0,A.jsx)(T,{id:`image-${t.id}`,checked:r,onCheckedChange:()=>Z(e.slug,t.id,`image`),className:`mt-0`}),(0,A.jsxs)(`div`,{className:`flex-1 flex items-center justify-between gap-3 leading-none`,children:[(0,A.jsx)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:(0,A.jsx)(`label`,{htmlFor:`image-${t.id}`,className:`text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer truncate`,children:X(t)})}),i&&(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap flex-shrink-0`,children:(i.prompt??0)===0&&(i.completion??0)===0?``:`$${h(i.prompt??0)} in | $${h(i.completion??0)} out`})]})]},t.id)})})})]},e.slug)})})})]}),J&&(0,A.jsx)(`div`,{className:`text-sm p-2 rounded-md ${J.includes(`error`)||J.includes(`Failed`)?`text-destructive bg-destructive/10`:`text-green-600 bg-green-50`}`,children:J})]})]})})}export{j as SettingsModelsView,j as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Fn as n,Gt as r,Hn as i,Jn as a,Ln as o,R as s,Rn as c,Si as l,Un as u,V as d,Vi as f,Vr as p,_a as m,aa as h,ei as g,gt as _,jt as v,n as y,r as b,sn as x,ti as S,xt as ee,ya as C}from"./dialogs-config-DZFG2IQM.js";import{n as w,t as T}from"./react-vendor-Bao-KYKs.js";import{a as te}from"./store-CwvBC-YP.js";import{t as E}from"./textarea-DpXOZLt8.js";import{t as D}from"./use-toast-DqmC-mB5.js";import{a as ne,c as re,i as O,n as k,o as A,r as j,s as M,t as N}from"./alert-dialog--tUzAWFm.js";import{n as P}from"./tab-context-CCvlrC0o.js";import{t as F}from"./skeleton-Bc0U0oGc.js";import{t as I}from"./mcp-server-card-DupwHcKT.js";import{n as L,t as R}from"./radio-group-Mifbn8sU.js";var z=m(),B=e(C(),1),V=t(),H=B.forwardRef((e,t)=>{let n=(0,z.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=a(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,r),n[3]=r,n[4]=o);let s;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(w,{className:a(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)}),n[5]=s):s=n[5];let c;return n[6]!==i||n[7]!==t||n[8]!==o?(c=(0,V.jsx)(T,{className:o,...i,ref:t,children:s}),n[6]=i,n[7]=t,n[8]=o,n[9]=c):c=n[9],c});H.displayName=T.displayName;function U({threadId:e,onRuleCreated:t}){let[r,i]=(0,B.useState)(``),[a,s]=(0,B.useState)(``),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(`local`),[m,g]=(0,B.useState)(!1),_=r.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),v=_.length>0&&_.length<=64;return e?(0,V.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,V.jsxs)(`div`,{className:`mb-6`,children:[(0,V.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Rule`}),(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new agent rule. The rule will be saved as a .md file in the .agents/rules folder.`})]}),(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(n,{htmlFor:`ruleName`,children:`Rule Name`}),(0,V.jsx)(o,{id:`ruleName`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. Code Style Guide`,disabled:m}),r&&(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`File name: `,(0,V.jsxs)(`span`,{className:`font-mono`,children:[_||`...`,`.md`]})]})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(n,{htmlFor:`ruleDescription`,children:`Description`}),(0,V.jsx)(E,{id:`ruleDescription`,value:a,onChange:e=>s(e.target.value),placeholder:`Describe when Tarsk should apply this rule...`,className:`resize-none min-h-[120px]`,disabled:m})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(n,{htmlFor:`alwaysApply`,children:`Always Apply`}),(0,V.jsx)(H,{id:`alwaysApply`,checked:u,onCheckedChange:d,disabled:m})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u?`This rule will be automatically added to context for all conversations.`:`Only the rule description will be added to context, allowing the agent to read the rule file when needed.`})]}),(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(n,{children:`Scope`}),(0,V.jsxs)(R,{value:f,onValueChange:e=>p(e),className:`flex gap-4`,disabled:m,children:[(0,V.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,V.jsx)(L,{value:`local`,id:`scope-local`}),(0,V.jsx)(n,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,V.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,V.jsx)(L,{value:`global`,id:`scope-global`,disabled:!0}),(0,V.jsx)(n,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f===`local`?`This rule will only be available for this project.`:`This rule will be available across all projects (coming soon).`})]}),(0,V.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,V.jsx)(c,{onClick:async()=>{if(!(!v||!e)){g(!0);try{let n=`---
|
|
2
|
-
description: ${a.trim()}
|
|
3
|
-
alwaysApply: ${u}
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Place your rule instructions here as markdown.
|
|
7
|
-
`;await x(e,`.agents/rules/${_}.md`,n),D({title:`Rule created`,description:`Rule '${_}' was created successfully.`}),i(``),s(``),d(!1),p(`local`),t?.(_)}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to create rule`,variant:`destructive`})}finally{g(!1)}}},disabled:!v||!a.trim()||m,children:m?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,V.jsxs)(V.Fragment,{children:[`Continue`,(0,V.jsx)(h,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,V.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,V.jsxs)(`div`,{className:`text-center`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add a rule.`})]})})}function W(e){let t=[];for(let n of e)n.type===`file`&&n.path.startsWith(`.agents/rules/`)&&t.push(n),n.children&&n.children.length>0&&t.push(...W(n.children));return t}function G(){let{state:e}=te(),{selectedProjectId:t,selectedThreadId:n}=e,{setActiveMainTab:a,setPendingExplorerPath:l,triggerExplorerRefresh:m,setExplorerClearPath:h}=P(),[C,w]=(0,B.useState)([]),[T,E]=(0,B.useState)(!1),[L,R]=(0,B.useState)(!1),[z,H]=(0,B.useState)(null),[G,K]=(0,B.useState)(!1),[q,J]=(0,B.useState)([]),[Y,X]=(0,B.useState)(new Set),[Z,ie]=(0,B.useState)(``),Q=(0,B.useCallback)(async()=>{if(t){E(!0);try{let e=W(await ee(t));if(n)try{let t=W(await v(n)),r=new Set(e.map(e=>e.path));for(let n of t)r.has(n.path)||e.push(n)}catch{}w(e),X(new Set(e.map(e=>e.path)))}catch{w([]),X(new Set)}finally{E(!1)}}},[t,n]);(0,B.useEffect)(()=>{Q()},[Q]),(0,B.useEffect)(()=>{_().then(J).catch(()=>J([]))},[]);let ae=(0,B.useCallback)(async e=>{if(!t)return;let r=e.name,i=e.path;K(!0);try{try{await s(t,i)}catch{if(n)await d(n,i);else throw Error(`No thread selected to delete from`)}h(i),m(),X(e=>{let t=new Set(e);return t.delete(i),t}),D({title:`Rule removed`,description:r}),H(null),await Q()}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to remove rule`,variant:`destructive`})}finally{K(!1)}},[t,n,Q,m,h]),oe=(0,B.useCallback)(e=>{l(e),a(`explorer`)},[l,a]),se=(0,B.useCallback)(async e=>{let t=`.agents/rules/${e.name}.md`;if(!(!n||Y.has(t)))try{e.gitHubRepo&&e.gitHubFolder?await r(n,e.gitHubRepo,e.gitHubFolder,`.agents/rules`):await x(n,t,[`---`,`description: ${e.description}`,`alwaysApply: ${e.alwaysApply??!1}`,`---`,``,e.content].join(`
|
|
8
|
-
`)),X(e=>new Set(e).add(t)),m(),Q(),D({title:`Rule installed`,description:e.name})}catch(e){D({title:`Error`,description:e instanceof Error?e.message:`Failed to install rule`,variant:`destructive`})}},[n,Y,m,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return t?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,V.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Rules`}),(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage agent rules. Rules define coding standards and project-wide guidelines.`})]}),(0,V.jsx)(c,{onClick:()=>R(!0),disabled:!n,children:`Add Rule`})]}),!n&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to add rules to your project.`}),(0,V.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:`Installed Rules`}),T?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(F,{className:`h-20 w-full`}),(0,V.jsx)(F,{className:`h-20 w-full`})]}):C.length===0?(0,V.jsxs)(`div`,{className:`text-center py-12 border border-dashed rounded-lg mb-8`,children:[(0,V.jsx)(S,{className:`mx-auto h-10 w-10 text-muted-foreground/50 mb-3`}),(0,V.jsx)(`h3`,{className:`text-base font-semibold text-muted-foreground mb-1`,children:`No rules installed`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mb-3`,children:`Add rules to enforce coding standards and project conventions.`})]}):(0,V.jsx)(`div`,{className:`space-y-3 mb-8`,children:C.map(e=>(0,V.jsx)(y,{children:(0,V.jsxs)(b,{className:`flex items-center justify-between p-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(S,{className:`h-4 w-4 text-muted-foreground flex-shrink-0`}),(0,V.jsx)(`h3`,{className:`font-medium truncate`,children:e.name})]}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 truncate font-mono`,children:e.path})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1 ml-4 flex-shrink-0`,children:[(0,V.jsx)(c,{variant:`ghost`,size:`icon-sm`,onClick:()=>oe(e.path),title:`View in explorer`,children:(0,V.jsx)(f,{className:`h-4 w-4`})}),(0,V.jsx)(c,{variant:`ghost`,size:`icon-sm`,onClick:()=>H(e),title:`Delete rule`,children:(0,V.jsx)(p,{className:`h-4 w-4 text-destructive`})})]})]})},e.id))}),(0,V.jsx)(`div`,{className:`flex items-center justify-between mb-3`,children:(0,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Available Rules`})}),!n&&(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to install rules into your project.`}),(0,V.jsxs)(`div`,{className:`relative mb-4`,children:[(0,V.jsx)(g,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,V.jsx)(o,{placeholder:`Search available rules...`,value:Z,onChange:e=>ie(e.target.value),className:`pl-8`})]}),q.length===0?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(F,{className:`h-20 w-full`}),(0,V.jsx)(F,{className:`h-20 w-full`})]}):$.length===0?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:Z.trim()?`No results for "${Z}"`:`No available rules found.`}):(0,V.jsx)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(min(220px, 100%), 1fr))`},children:$.map(e=>{let t=`.agents/rules/${e.name}.md`,n=Y.has(t);return(0,V.jsx)(I,{name:e.name,description:e.description,installed:n,onClick:()=>{n||se(e)},showInstalledControls:!1},e.id)})})]})}),(0,V.jsx)(i,{open:L,onOpenChange:R,children:(0,V.jsx)(u,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,V.jsx)(U,{threadId:n,onRuleCreated:()=>{R(!1),Q(),m()}})})}),(0,V.jsx)(N,{open:z!==null,onOpenChange:e=>!e&&H(null),children:(0,V.jsxs)(O,{children:[(0,V.jsxs)(M,{children:[(0,V.jsx)(re,{children:`Delete Rule`}),(0,V.jsxs)(ne,{children:[`Are you sure you want to delete the rule "`,z?.name,`"? This action cannot be undone.`]})]}),(0,V.jsxs)(A,{children:[(0,V.jsx)(j,{children:`Cancel`}),(0,V.jsx)(k,{onClick:()=>z&&void ae(z),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,V.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,V.jsx)(`p`,{className:`text-muted-foreground`,children:`Select a project to manage rules.`})})}export{G as SettingsRulesView,G as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Fn as n,Gt as r,Hn as i,Ir as a,Ln as o,N as s,R as c,Rn as l,Si as u,Un as d,V as f,Vi as p,Vr as m,aa as h,ei as g,jt as _,mt as v,n as y,r as ee,sn as b,xt as x,ya as S}from"./dialogs-config-DZFG2IQM.js";import{a as C}from"./store-CwvBC-YP.js";import{t as w}from"./textarea-DpXOZLt8.js";import{t as T}from"./use-toast-DqmC-mB5.js";import{a as E,c as D,i as O,n as k,o as A,r as j,s as M,t as te}from"./alert-dialog--tUzAWFm.js";import{n as ne}from"./tab-context-CCvlrC0o.js";import{t as N}from"./skeleton-Bc0U0oGc.js";import{t as re}from"./mcp-server-card-DupwHcKT.js";import{n as P,t as F}from"./radio-group-Mifbn8sU.js";var I=e(S(),1),L=t();function R({threadId:e,onAgentCreated:t}){let[r,i]=(0,I.useState)(``),[a,c]=(0,I.useState)(``),[d,f]=(0,I.useState)(``),[p,m]=(0,I.useState)(`local`),[g,_]=(0,I.useState)(!1),v=r.toLowerCase().replace(/\s+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``),y=v.length>0&&v.length<=64;return e?(0,L.jsxs)(`div`,{className:`max-w-2xl mx-auto p-6`,children:[(0,L.jsxs)(`div`,{className:`mb-6`,children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Add Agent`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Create a new subagent. The agent will be saved as an AGENT.md file in the .agents/agents folder.`})]}),(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{htmlFor:`agentName`,children:`Agent Name`}),(0,L.jsx)(o,{id:`agentName`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. Security Reviewer`,disabled:g}),r&&(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Folder name: `,(0,L.jsx)(`span`,{className:`font-mono`,children:v||`...`})]})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{htmlFor:`agentDescription`,children:`Description`}),(0,L.jsx)(w,{id:`agentDescription`,value:a,onChange:e=>c(e.target.value),placeholder:`Describe what this agent does and when it should be invoked`,className:`resize-none min-h-[120px]`,disabled:g})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{htmlFor:`agentTools`,children:`Allowed Tools (optional)`}),(0,L.jsx)(o,{id:`agentTools`,value:d,onChange:e=>f(e.target.value),placeholder:`e.g. read grep glob`,disabled:g}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Space-separated list of tools this agent can use. Leave empty to allow all coding tools.`})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(n,{children:`Scope`}),(0,L.jsxs)(F,{value:p,onValueChange:e=>m(e),className:`flex gap-4`,disabled:g,children:[(0,L.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,L.jsx)(P,{value:`local`,id:`scope-local`}),(0,L.jsx)(n,{htmlFor:`scope-local`,className:`font-normal cursor-pointer`,children:`Local (this project)`})]}),(0,L.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,L.jsx)(P,{value:`global`,id:`scope-global`,disabled:!0}),(0,L.jsx)(n,{htmlFor:`scope-global`,className:`font-normal cursor-pointer text-muted-foreground`,children:`Global (coming soon)`})]})]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p===`local`?`This agent will only be available for this project.`:`This agent will be available across all projects (coming soon).`})]}),(0,L.jsx)(`div`,{className:`border-t pt-4 flex justify-end`,children:(0,L.jsx)(l,{onClick:async()=>{if(!(!y||!a.trim()||!e)){_(!0);try{let n=await s(e,v,a.trim(),d.trim()||void 0);T({title:`Agent created`,description:`Agent '${v}' was created successfully.`}),i(``),c(``),f(``),m(`local`),t?.(n.path,`AGENT.md`)}catch(e){T({title:`Error`,description:e instanceof Error?e.message:`Failed to create agent`,variant:`destructive`})}finally{_(!1)}}},disabled:!y||!a.trim()||g,children:g?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(u,{className:`mr-2 h-4 w-4 animate-spin`}),`Creating...`]}):(0,L.jsxs)(L.Fragment,{children:[`Continue`,(0,L.jsx)(h,{className:`ml-2 h-4 w-4`})]})})})]})]}):(0,L.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,L.jsxs)(`div`,{className:`text-center`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:`No Thread Selected`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Please select a thread to add an agent.`})]})})}function z(e){let t=[];for(let n of e)n.path.startsWith(`.agents/agents/`)&&n.type===`folder`&&t.push(n),n.children&&n.children.length>0&&t.push(...z(n.children));return t}function B(){let{state:e}=C(),{selectedProjectId:t,selectedThreadId:n}=e,{setActiveMainTab:s,setPendingExplorerPath:u,triggerExplorerRefresh:h,setExplorerClearPath:S}=ne(),[w,P]=(0,I.useState)([]),[F,B]=(0,I.useState)(!1),[V,H]=(0,I.useState)(!1),[U,W]=(0,I.useState)(null),[G,K]=(0,I.useState)(!1),[q,J]=(0,I.useState)([]),[Y,X]=(0,I.useState)(new Set),[Z,ie]=(0,I.useState)(``),Q=(0,I.useCallback)(async()=>{if(t){B(!0);try{let e=z(await x(t));if(n)try{let t=z(await _(n)),r=new Set(e.map(e=>e.path));for(let n of t)r.has(n.path)||e.push(n)}catch{}P(e),X(new Set(e.map(e=>`${e.path}/AGENT.md`)))}catch{P([]),X(new Set)}finally{B(!1)}}},[t,n]);(0,I.useEffect)(()=>{Q()},[Q]),(0,I.useEffect)(()=>{v().then(J).catch(()=>J([]))},[]);let ae=(0,I.useCallback)(async e=>{if(!t)return;let r=e.name,i=e.path;K(!0);try{try{await c(t,i)}catch{if(n)await f(n,i);else throw Error(`No thread selected to delete from`)}S(i),h(),X(e=>{let t=new Set(e);return t.delete(`${i}/AGENT.md`),t}),T({title:`Agent removed`,description:r}),W(null),await Q()}catch(e){T({title:`Error`,description:e instanceof Error?e.message:`Failed to remove agent`,variant:`destructive`})}finally{K(!1)}},[t,n,Q,h,S]),oe=(0,I.useCallback)(e=>{u(`${e}/AGENT.md`),s(`explorer`)},[u,s]),se=(0,I.useCallback)(async e=>{let t=`.agents/agents/${e.id}/AGENT.md`;if(!(!n||Y.has(t)))try{if(e.gitHubRepo&&e.gitHubFolder)await r(n,e.gitHubRepo,e.gitHubFolder,`.agents/agents/${e.id}`);else{let r=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.tools&&r.push(`tools: ${e.tools}`),r.push(`---`,``,e.systemPrompt),await b(n,t,r.join(`
|
|
2
|
-
`))}X(e=>new Set(e).add(t)),h(),Q(),T({title:`Agent installed`,description:e.name})}catch(e){T({title:`Error`,description:e instanceof Error?e.message:`Failed to install agent`,variant:`destructive`})}},[n,Y,h,Q]),$=Z.trim()?q.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):q;return t?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,L.jsxs)(`div`,{className:`max-w-4xl mx-auto p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Subagents`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage subagents. Subagents are specialized agents for focused tasks.`})]}),(0,L.jsx)(l,{onClick:()=>H(!0),disabled:!n,children:`Add Subagent`})]}),!n&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to add subagents to your project.`}),(0,L.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:`Installed Subagents`}),F?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(N,{className:`h-20 w-full`}),(0,L.jsx)(N,{className:`h-20 w-full`})]}):w.length===0?(0,L.jsxs)(`div`,{className:`text-center py-12 border border-dashed rounded-lg mb-8`,children:[(0,L.jsx)(a,{className:`mx-auto h-10 w-10 text-muted-foreground/50 mb-3`}),(0,L.jsx)(`h3`,{className:`text-base font-semibold text-muted-foreground mb-1`,children:`No subagents installed`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mb-3`,children:`Add subagents for specialized, focused tasks.`})]}):(0,L.jsx)(`div`,{className:`space-y-3 mb-8`,children:w.map(e=>(0,L.jsx)(y,{children:(0,L.jsxs)(ee,{className:`flex items-center justify-between p-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(a,{className:`h-4 w-4 text-muted-foreground flex-shrink-0`}),(0,L.jsx)(`h3`,{className:`font-medium truncate`,children:e.name})]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 truncate font-mono`,children:e.path})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1 ml-4 flex-shrink-0`,children:[(0,L.jsx)(l,{variant:`ghost`,size:`icon-sm`,onClick:()=>oe(e.path),title:`View in explorer`,children:(0,L.jsx)(p,{className:`h-4 w-4`})}),(0,L.jsx)(l,{variant:`ghost`,size:`icon-sm`,onClick:()=>W(e),title:`Delete agent`,children:(0,L.jsx)(m,{className:`h-4 w-4 text-destructive`})})]})]})},e.id))}),(0,L.jsx)(`div`,{className:`flex items-center justify-between mb-3`,children:(0,L.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Available Subagents`})}),!n&&(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground bg-muted rounded-md px-3 py-2 mb-4`,children:`Select a thread to install subagents into your project.`}),(0,L.jsxs)(`div`,{className:`relative mb-4`,children:[(0,L.jsx)(g,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,L.jsx)(o,{placeholder:`Search available subagents...`,value:Z,onChange:e=>ie(e.target.value),className:`pl-8`})]}),q.length===0?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(N,{className:`h-20 w-full`}),(0,L.jsx)(N,{className:`h-20 w-full`})]}):$.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:Z.trim()?`No results for "${Z}"`:`No available subagents found.`}):(0,L.jsx)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(min(220px, 100%), 1fr))`},children:$.map(e=>{let t=`.agents/agents/${e.id}/AGENT.md`,n=Y.has(t);return(0,L.jsx)(re,{name:e.name,description:e.description,installed:n,onClick:()=>{n||se(e)},showInstalledControls:!1},e.id)})})]})}),(0,L.jsx)(i,{open:V,onOpenChange:H,children:(0,L.jsx)(d,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,L.jsx)(R,{threadId:n,onAgentCreated:()=>{H(!1),Q(),h()}})})}),(0,L.jsx)(te,{open:U!==null,onOpenChange:e=>!e&&W(null),children:(0,L.jsxs)(O,{children:[(0,L.jsxs)(M,{children:[(0,L.jsx)(D,{children:`Delete Subagent`}),(0,L.jsxs)(E,{children:[`Are you sure you want to delete the subagent "`,U?.name,`"? This action cannot be undone.`]})]}),(0,L.jsxs)(A,{children:[(0,L.jsx)(j,{children:`Cancel`}),(0,L.jsx)(k,{onClick:()=>U&&void ae(U),disabled:G,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:G?`Deleting...`:`Delete`})]})]})})]}):(0,L.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Select a project to manage subagents.`})})}export{B as SettingsSubagentsView,B as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/providers-list-view-AVt5I1WB.js","assets/rolldown-runtime-B1FJdls4.js","assets/history-view-BR8scGnM.js","assets/dialogs-config-DZFG2IQM.js","assets/onboarding-Cn5RqOCa.js","assets/skeleton-Bc0U0oGc.js","assets/tabs-Mb_cjIfE.js","assets/react-vendor-Bao-KYKs.js","assets/monaco-DDfTQM3i.js","assets/settings-models-view-BqdD_7GR.js","assets/settings-mcp-servers-view-Becs_RxN.js","assets/mcp-server-card-DupwHcKT.js","assets/alert-dialog--tUzAWFm.js","assets/textarea-DpXOZLt8.js","assets/use-toast-DqmC-mB5.js","assets/store-CwvBC-YP.js","assets/tab-context-CCvlrC0o.js","assets/settings-skills-view-aPv03-bO.js","assets/radio-group-Mifbn8sU.js","assets/settings-rules-view-D7j5OHUi.js","assets/settings-slash-commands-view-DLMWXQXA.js","assets/settings-subagents-view-DBYzNE4W.js","assets/settings-instructions-view-CgfWSPmK.js","assets/account-view-BFhjAYmz.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{$r as t,$t as n,Dr as r,Fr as i,Ir as a,Lr as o,Ur as s,Yi as c,_a as l,fa as u,la as d,ti as f,ya as p}from"./dialogs-config-DZFG2IQM.js";import{_t as m,bt as h,vt as g,yt as _}from"./react-vendor-Bao-KYKs.js";import{t as v}from"./standard-list-item-D2lbPXa1.js";import{t as y}from"./side-panel-container-oMcXib2A.js";import{n as b,r as x,t as S}from"./resizable-DzrIos_Y.js";var C=l(),w=e(p(),1),T=r(),E=(0,w.forwardRef)(function(e,t){let n=(0,C.c)(20),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:u,className:d,onCollapse:f,onExpand:p}=e,m=a===void 0?25:a,h=o===void 0?20:o,g=s===void 0?30:s,_=c===void 0?40:c,v=l===void 0?!1:l,y=u===void 0?0:u,w=`h-full ${d===void 0?``:d}`,E;n[0]!==y||n[1]!==v||n[2]!==m||n[3]!==g||n[4]!==h||n[5]!==f||n[6]!==p||n[7]!==t||n[8]!==r?(E=(0,T.jsx)(b,{ref:t,defaultSize:m,minSize:h,maxSize:g,collapsible:v,collapsedSize:y,onCollapse:f,onExpand:p,className:`border-r border-transparent`,children:r}),n[0]=y,n[1]=v,n[2]=m,n[3]=g,n[4]=h,n[5]=f,n[6]=p,n[7]=t,n[8]=r,n[9]=E):E=n[9];let D;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,T.jsx)(S,{withHandle:!0,className:`ml-[-40px]`}),n[10]=D):D=n[10];let O;n[11]!==i||n[12]!==_?(O=(0,T.jsx)(b,{minSize:_,className:`overflow-hidden`,children:i}),n[11]=i,n[12]=_,n[13]=O):O=n[13];let k;n[14]!==O||n[15]!==E?(k=(0,T.jsxs)(x,{direction:`horizontal`,className:`h-full`,children:[E,D,O]}),n[14]=O,n[15]=E,n[16]=k):k=n[16];let A;return n[17]!==k||n[18]!==w?(A=(0,T.jsx)(`div`,{className:w,children:k}),n[17]=k,n[18]=w,n[19]=A):A=n[19],A}),D=[{id:`providers`,label:`Providers`,icon:(0,T.jsx)(c,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,T.jsx)(d,{className:`h-4 w-4`}),route:`/settings/models`},{id:`skills`,label:`Skills`,icon:(0,T.jsx)(i,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,T.jsx)(f,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,T.jsx)(s,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,T.jsx)(a,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,T.jsx)(u,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,T.jsx)(t,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`account`,label:`Account`,icon:(0,T.jsx)(o,{className:`h-4 w-4`}),route:`/settings/account`}];function O(e){let t=(0,C.c)(8),{className:n}=e,r=g(),i=m(),a;t[0]===i.pathname?a=t[1]:(a=function(){let e=i.pathname;for(let t of D)if(e.startsWith(t.route))return t.id;return`providers`}(),t[0]=i.pathname,t[1]=a);let o=a,s=`space-y-1${n?` ${n}`:``}`,c;t[2]!==o||t[3]!==r?(c=D.map(e=>(0,T.jsx)(v,{selected:o===e.id,asChild:!0,children:(0,T.jsx)(`button`,{className:`justify-start`,onClick:()=>void r(e.route),children:(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.icon,(0,T.jsx)(`span`,{children:e.label})]})})},e.id)),t[2]=o,t[3]=r,t[4]=c):c=t[4];let l;return t[5]!==s||t[6]!==c?(l=(0,T.jsx)(`div`,{className:s,children:c}),t[5]=s,t[6]=c,t[7]=l):l=t[7],l}var k=(0,w.lazy)(()=>h(()=>import(`./providers-list-view-AVt5I1WB.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),A=(0,w.lazy)(()=>h(()=>import(`./settings-models-view-BqdD_7GR.js`),__vite__mapDeps([9,1,2,3,4,6,7,8]))),j=(0,w.lazy)(()=>h(()=>import(`./settings-mcp-servers-view-Becs_RxN.js`),__vite__mapDeps([10,1,2,3,11,12,7,8,5,13,14,15,16]))),M=(0,w.lazy)(()=>h(()=>import(`./settings-skills-view-aPv03-bO.js`),__vite__mapDeps([17,1,3,11,2,12,7,8,18,5,13,14,15,16]))),N=(0,w.lazy)(()=>h(()=>import(`./settings-rules-view-D7j5OHUi.js`),__vite__mapDeps([19,1,7,2,3,8,11,12,18,5,13,14,15,16]))),P=(0,w.lazy)(()=>h(()=>import(`./settings-slash-commands-view-DLMWXQXA.js`),__vite__mapDeps([20,1,3,11,2,12,7,8,18,5,14,15,16]))),F=(0,w.lazy)(()=>h(()=>import(`./settings-subagents-view-DBYzNE4W.js`),__vite__mapDeps([21,1,3,11,2,12,7,8,18,5,13,14,15,16]))),I=(0,w.lazy)(()=>h(()=>import(`./settings-instructions-view-CgfWSPmK.js`),__vite__mapDeps([22,1,3,13,14,15]))),L=(0,w.lazy)(()=>h(()=>import(`./account-view-BFhjAYmz.js`),__vite__mapDeps([23,1,3,5,14]))),R=[`providers`,`models`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`mcp-servers`,`account`];function z(e){let t=(0,C.c)(5),{title:n}=e,r;t[0]===n?r=t[1]:(r=(0,T.jsx)(`h2`,{className:`text-lg font-semibold text-muted-foreground mb-2`,children:n}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Content coming soon...`}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,T.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,T.jsxs)(`div`,{className:`text-center`,children:[r,i]})}),t[3]=r,t[4]=a),a}function B(e){return e.startsWith(`/settings/providers`)?`providers`:e.startsWith(`/settings/models`)?`models`:e.startsWith(`/settings/skills`)?`skills`:e.startsWith(`/settings/rules`)?`rules`:e.startsWith(`/settings/slash-commands`)?`slash-commands`:e.startsWith(`/settings/subagents`)?`subagents`:e.startsWith(`/settings/instructions`)?`instructions`:e.startsWith(`/settings/mcp-servers`)?`mcp-servers`:e.startsWith(`/settings/account`)?`account`:`providers`}function V(){let e=(0,C.c)(26),{tab:t}=_(),n=g(),r=m(),i;if(e[0]!==r.pathname||e[1]!==r.search||e[2]!==t){let n=new URLSearchParams(r.search).get(`tab`);i=n&&R.includes(n)?n:t&&R.includes(t)?t:B(r.pathname),e[0]=r.pathname,e[1]=r.search,e[2]=t,e[3]=i}else i=e[3];let a=i,[o,s]=(0,w.useState)(!1),c=(0,w.useRef)(null),l=H,u;e[4]===n?u=e[5]:(u=()=>{n(`/`)},e[4]=n,e[5]=u);let d=u,f,p;e[6]!==r.pathname||e[7]!==n?(f=()=>{[`/settings/project`,`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(e=>r.pathname.startsWith(e))&&n(`/settings/providers`,{replace:!0})},p=[r.pathname,n],e[6]=r.pathname,e[7]=n,e[8]=f,e[9]=p):(f=e[8],p=e[9]),(0,w.useEffect)(f,p);let h;e[10]===d?h=e[11]:(h=()=>(0,T.jsx)(y,{onTitleClose:d,subtitle:`Settings`,onResetOnboarding:l,children:(0,T.jsx)(`div`,{className:`px-2 py-2`,children:(0,T.jsx)(O,{})})}),e[10]=d,e[11]=h);let v=h,b;e[12]===a?b=e[13]:(b=()=>{switch(a){case`providers`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Providers`}),children:(0,T.jsx)(k,{})});case`models`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Models`}),children:(0,T.jsx)(A,{})});case`skills`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Skills`}),children:(0,T.jsx)(M,{})});case`rules`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Rules`}),children:(0,T.jsx)(N,{})});case`slash-commands`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Slash Commands`}),children:(0,T.jsx)(P,{})});case`subagents`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Subagents`}),children:(0,T.jsx)(F,{})});case`instructions`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Instructions`}),children:(0,T.jsx)(I,{})});case`mcp-servers`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`MCP Servers`}),children:(0,T.jsx)(j,{})});case`account`:return(0,T.jsx)(w.Suspense,{fallback:(0,T.jsx)(z,{title:`Account`}),children:(0,T.jsx)(L,{})});default:return(0,T.jsx)(z,{title:`Settings`})}},e[12]=a,e[13]=b);let x=b,S,D;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>s(!0),D=()=>s(!1),e[14]=S,e[15]=D):(S=e[14],D=e[15]);let V;e[16]===v?V=e[17]:(V=v(),e[16]=v,e[17]=V);let U=`h-full overflow-auto ${o?`ml-[40px]`:``}`,W;e[18]===x?W=e[19]:(W=x(),e[18]=x,e[19]=W);let G;e[20]!==W||e[21]!==U?(G=(0,T.jsx)(`div`,{className:U,children:W}),e[20]=W,e[21]=U,e[22]=G):G=e[22];let K;return e[23]!==G||e[24]!==V?(K=(0,T.jsx)(E,{ref:c,collapsible:!0,onCollapse:S,onExpand:D,sidebar:V,children:G}),e[23]=G,e[24]=V,e[25]=K):K=e[25],K}async function H(){try{await n()}catch(e){console.error(`Failed to reset onboarding:`,e)}}export{V as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Jn as n,Vn as r,_a as i,ya as a}from"./dialogs-config-DZFG2IQM.js";var o=i(),s=e(a(),1),c=t(),l=s.forwardRef((e,t)=>{let i=(0,o.c)(23),a,s,l,u,d,f,p,m,h;i[0]===e?(a=i[1],s=i[2],l=i[3],u=i[4],d=i[5],f=i[6],p=i[7],m=i[8],h=i[9]):({className:s,selected:f,noBackground:u,level:l,basePadding:a,indentSize:m,asChild:h,style:p,...d}=e,i[0]=e,i[1]=a,i[2]=s,i[3]=l,i[4]=u,i[5]=d,i[6]=f,i[7]=p,i[8]=m,i[9]=h);let g=m===void 0?20:m,_=h===void 0?!1:h,v=l===void 0?void 0:(a??12)+l*g,y=_?r:`div`,b=f&&!u&&`bg-sidebar-accent text-sidebar-accent-foreground font-medium`,x=f&&u&&`font-bold text-foreground`,S;i[10]!==s||i[11]!==b||i[12]!==x?(S=n(`flex items-center gap-2 w-full min-w-0 justify-start px-3 py-2 cursor-pointer rounded-full text-sm transition-colors group overflow-hidden`,`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,b,x,s),i[10]=s,i[11]=b,i[12]=x,i[13]=S):S=i[13];let C=v===void 0?void 0:`${v}px`,w;i[14]!==p||i[15]!==C?(w={paddingLeft:C,...p},i[14]=p,i[15]=C,i[16]=w):w=i[16];let T;return i[17]!==y||i[18]!==d||i[19]!==t||i[20]!==S||i[21]!==w?(T=(0,c.jsx)(y,{ref:t,className:S,style:w,...d}),i[17]=y,i[18]=d,i[19]=t,i[20]=S,i[21]=w,i[22]=T):T=i[22],T});l.displayName=`StandardListItem`;export{l as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{_a as t,ya as n}from"./dialogs-config-DZFG2IQM.js";var r=e(n(),1),i=t();function a(e){return typeof e==`string`?e.replace(/\\n/g,`
|
|
2
|
-
`).replace(/✅/g,`✓`):``}function o(e){if(!e||typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=/\[([A-Za-z]+)\]\s*/g,r,i=0;for(let e of t.matchAll(n))r=e[1],i=e.index+e[0].length;let a=r,o=a?t.slice(i):t;if(a&&o)return[{type:`reasoning`,text:o,label:a}];let s=[],c=0;for(;c<t.length;){let e=t.indexOf(`[`,c);if(e===-1){let e=t.slice(c).trim();e&&s.push({type:`reasoning`,text:e});break}let n=t.slice(c,e).trim();n&&s.push({type:`reasoning`,text:n});let r=0,i=-1;for(let n=e;n<t.length;n++)if(t[n]===`[`)r++;else if(t[n]===`]`&&(r--,r===0)){i=n;break}if(i===-1){let n=t.slice(e).trim();n&&s.push({type:`reasoning`,text:n});break}try{let n=JSON.parse(t.slice(e,i+1));if(Array.isArray(n)){for(let e of n)if(e&&typeof e==`object`&&`type`in e){let t=e.type;(t===`tool-result`||t===`tool_use`)&&s.push(e)}}}catch{let n=t.slice(e,i+1).trim();n&&s.push({type:`reasoning`,text:n})}c=i+1}return s.length>0?s:null}function s(e){return e.map(e=>{if(typeof e==`object`&&e&&!(`type`in e)){let t=e;if(t.reasoning)return{type:`reasoning`,text:typeof t.reasoning==`string`?t.reasoning:JSON.stringify(t.reasoning)};let n=t.text??t.content??t.answer;if(n)return{type:`text`,text:typeof n==`string`?n:JSON.stringify(n)}}return e})}function c(e){let t=[];e.reasoning&&typeof e.reasoning==`string`&&t.push({type:`reasoning`,text:e.reasoning});let n=(typeof e.text==`string`?e.text:null)??(typeof e.content==`string`?e.content:null)??(typeof e.answer==`string`?e.answer:null);return n&&t.push({type:`text`,text:n}),t.length===0&&Object.keys(e).length>0&&t.push({type:`text`,text:JSON.stringify(e,null,2)}),t}function l(e){if(!e)return null;let t=e.trim();if(t.startsWith(`{`)||t.startsWith(`[`))try{let e=JSON.parse(t);if(Array.isArray(e))return s(e);if(typeof e==`object`&&e)return c(e)}catch{}let n=[],r=e.indexOf(`{`),i=e.indexOf(`[`),a=r===-1?i:i===-1?r:Math.min(r,i);if(a!==-1){let t=e.slice(a),r=Math.max(t.lastIndexOf(`]`),t.lastIndexOf(`}`));if(r!==-1){let e=t.substring(0,r+1);try{let i=JSON.parse(e);Array.isArray(i)?n.push(...s(i)):n.push(...c(i));let a=t.substring(r+1).trim();return a&&n.push({type:`text`,text:a}),n}catch{}}}return null}function u(e,t,n){let r=e[e.length-1];return r?.type===t?[...e.slice(0,-1),{type:t,chunks:[...r.chunks,n]}]:[...e,{type:t,chunks:[n]}]}function d(e,t){return e[e.length-1]?.type===`content`?[...e.slice(0,-1),{type:`content`,chunks:[t]}]:[...e,{type:`content`,chunks:[t]}]}function f(e){let t=[];for(let n of e){let e=n.chunks.join(``);if(n.type===`thinking`){let n=o(e)??[];t.push(...n)}else{let n=l(e)??(e.trim()?[{type:`text`,text:e}]:[]);t.push(...n)}}return t}function p(e){let t=f(e);return t.length===0?`...`:t.length===1&&t[0]?.type===`text`&&`text`in t[0]?t[0].text:JSON.stringify(t)}var m=function(e){return e.SetProjects=`SET_PROJECTS`,e.SetProjectsLoading=`SET_PROJECTS_LOADING`,e.SelectThread=`SELECT_THREAD`,e.SetMessages=`SET_MESSAGES`,e.AddMessage=`ADD_MESSAGE`,e.EnqueueChatMessage=`ENQUEUE_CHAT_MESSAGE`,e.RemoveQueuedChatMessage=`REMOVE_QUEUED_CHAT_MESSAGE`,e.SetStreaming=`SET_STREAMING`,e.AppendStreamContent=`APPEND_STREAM_CONTENT`,e.SetStreamContent=`SET_STREAM_CONTENT`,e.AppendStreamThinking=`APPEND_STREAM_THINKING`,e.AppendStreamChunk=`APPEND_STREAM_CHUNK`,e.SetStreamModel=`SET_STREAM_MODEL`,e.SetProjectModel=`SET_PROJECT_MODEL`,e.ResetStream=`RESET_STREAM`,e.StopStream=`STOP_STREAM`,e.ToggleSidebar=`TOGGLE_SIDEBAR`,e.SetCreatingProject=`SET_CREATING_PROJECT`,e.ConfigUpdated=`CONFIG_UPDATED`,e.SetProcessingThreads=`SET_PROCESSING_THREADS`,e.AddProcessingThread=`ADD_PROCESSING_THREAD`,e.RemoveProcessingThread=`REMOVE_PROCESSING_THREAD`,e.AddCreatingProject=`ADD_CREATING_PROJECT`,e.AddCreatingThread=`ADD_CREATING_THREAD`,e.RemoveCreatingProject=`REMOVE_CREATING_PROJECT`,e.RemoveCreatingThread=`REMOVE_CREATING_THREAD`,e.MarkThreadCompleted=`MARK_THREAD_COMPLETED`,e.ClearThreadCompleted=`CLEAR_THREAD_COMPLETED`,e.AddDeletingThread=`ADD_DELETING_THREAD`,e.RemoveDeletingThread=`REMOVE_DELETING_THREAD`,e.AddDeletingProject=`ADD_DELETING_PROJECT`,e.RemoveDeletingProject=`REMOVE_DELETING_PROJECT`,e.AppendCommandOutput=`APPEND_COMMAND_OUTPUT`,e.SetRunningCommand=`SET_RUNNING_COMMAND`,e.ClearCommandOutput=`CLEAR_COMMAND_OUTPUT`,e.ToggleTerminal=`TOGGLE_TERMINAL`,e.SetTerminalOpen=`SET_TERMINAL_OPEN`,e.QueueTerminalCommand=`QUEUE_TERMINAL_COMMAND`,e.ClearQueuedTerminalCommand=`CLEAR_QUEUED_TERMINAL_COMMAND`,e.AppendTerminalLine=`APPEND_TERMINAL_LINE`,e.ClearTerminalOutput=`CLEAR_TERMINAL_OUTPUT`,e.SetTerminalHeight=`SET_TERMINAL_HEIGHT`,e.SetTerminalCwd=`SET_TERMINAL_CWD`,e.SetTerminalRunning=`SET_TERMINAL_RUNNING`,e.SetTerminalHistory=`SET_TERMINAL_HISTORY`,e.SetTerminalHistoryIndex=`SET_TERMINAL_HISTORY_INDEX`,e.UpdateThreadTitle=`UPDATE_THREAD_TITLE`,e.ClearFocusChatInput=`CLEAR_FOCUS_CHAT_INPUT`,e.ClearMessages=`CLEAR_MESSAGES`,e.UpdateToolCallProgress=`UPDATE_TOOL_CALL_PROGRESS`,e.SetPendingChatMessage=`SET_PENDING_CHAT_MESSAGE`,e.ClearPendingChatMessage=`CLEAR_PENDING_CHAT_MESSAGE`,e.IncrementStreamEventCount=`INCREMENT_STREAM_EVENT_COUNT`,e.SetDiffComments=`SET_DIFF_COMMENTS`,e.ClearSelection=`CLEAR_SELECTION`,e}({}),h={projects:[],projectsLoading:!0,selectedThreadId:null,selectedProjectId:null,messages:[],messagesLoaded:!1,queuedChatMessages:[],isStreaming:!1,streamingContent:``,streamingThinking:``,streamingSegments:[],streamingModel:``,streamingEventCount:0,projectModelSelections:{},sidebarOpen:!0,isCreatingProject:!1,configUpdatedAt:0,processingThreadIds:[],completedThreadIds:[],deletingThreadIds:[],deletingProjectIds:[],commandOutput:``,isRunningCommand:!1,terminalStates:{},focusChatInput:!1,toolCallProgress:{},pendingChatMessage:null,diffComments:{}};function g(e,t){switch(t.type){case m.SetProjects:{let n={...e.projectModelSelections};for(let e of t.projects)for(let t of e.threads){if(!t.model)continue;let e=n[t.threadId];n[t.threadId]={id:t.model,provider:t.modelProvider,name:e?.name??t.model,description:e?.description??``,context_length:e?.context_length,features:e?.features,input_modalities:e?.input_modalities,max_output:e?.max_output,pricing:e?.pricing,tarsk_use:e?.tarsk_use,coding_index:e?.coding_index,supportsImages:e?.supportsImages}}return{...e,projects:t.projects,projectModelSelections:n}}case m.SetProjectsLoading:return{...e,projectsLoading:t.projectsLoading};case m.SelectThread:return{...e,selectedThreadId:t.threadId,selectedProjectId:t.projectId,messages:t.initialMessages??[],messagesLoaded:!1,focusChatInput:t.focusInput??!1};case m.ClearSelection:return{...e,selectedThreadId:null,selectedProjectId:null,messages:[],messagesLoaded:!1};case m.SetMessages:return{...e,messages:t.messages,messagesLoaded:!0};case m.AddMessage:return{...e,messages:[...e.messages,t.message]};case m.EnqueueChatMessage:return{...e,queuedChatMessages:[...e.queuedChatMessages,t.message]};case m.RemoveQueuedChatMessage:return{...e,queuedChatMessages:e.queuedChatMessages.filter(e=>e.id!==t.queuedMessageId)};case m.SetStreaming:return{...e,isStreaming:t.isStreaming};case m.AppendStreamContent:return{...e,streamingContent:e.streamingContent+t.content};case m.SetStreamContent:{let n=d(e.streamingSegments,t.content);return{...e,streamingContent:t.content,streamingSegments:n}}case m.AppendStreamThinking:return{...e,streamingThinking:e.streamingThinking+t.content};case m.IncrementStreamEventCount:return{...e,streamingEventCount:e.streamingEventCount+1};case m.AppendStreamChunk:return{...e,streamingSegments:t.segments,streamingContent:t.chunkType===`content`?e.streamingContent+t.content:e.streamingContent,streamingThinking:t.chunkType===`thinking`?e.streamingThinking+t.content:e.streamingThinking};case m.SetStreamModel:return{...e,streamingModel:t.model};case m.SetProjectModel:return console.log(`[Store] SetProjectModel action:`,{threadId:t.threadId,model:{id:t.model.id,provider:t.model.provider}}),{...e,projects:e.projects.map(e=>({...e,threads:e.threads.map(e=>e.threadId===t.threadId?{...e,model:t.model.id,modelProvider:t.model.provider}:e)})),projectModelSelections:{...e.projectModelSelections,[t.threadId]:t.model}};case m.ResetStream:return{...e,streamingContent:``,streamingThinking:``,streamingSegments:[],streamingModel:``,isStreaming:!1,toolCallProgress:{},streamingEventCount:0};case m.StopStream:return{...e,isStreaming:!1};case m.ToggleSidebar:return{...e,sidebarOpen:!e.sidebarOpen};case m.SetCreatingProject:return{...e,isCreatingProject:t.isCreating};case m.ConfigUpdated:return{...e,configUpdatedAt:Date.now()};case m.SetProcessingThreads:return{...e,processingThreadIds:t.threadIds};case m.AddProcessingThread:return{...e,processingThreadIds:e.processingThreadIds.includes(t.threadId)?e.processingThreadIds:[...e.processingThreadIds,t.threadId]};case m.RemoveProcessingThread:return{...e,processingThreadIds:e.processingThreadIds.filter(e=>e!==t.threadId)};case m.AddCreatingProject:return{...e,projects:[...e.projects,{projectId:t.projectId,name:t.projectName,gitUrl:t.gitUrl,threads:[{threadId:t.threadId,title:`thread-1`,path:``,currentBranch:``}]}]};case m.AddCreatingThread:return{...e,projects:e.projects.map(e=>e.projectId===t.projectId?{...e,threads:[...e.threads,{threadId:t.threadId,title:t.title,path:``,currentBranch:``}]}:e)};case m.RemoveCreatingProject:return{...e,projects:e.projects.filter(e=>e.projectId!==t.projectId)};case m.RemoveCreatingThread:return{...e,projects:e.projects.map(e=>e.projectId===t.projectId?{...e,threads:e.threads.filter(e=>e.threadId!==t.threadId)}:e)};case m.MarkThreadCompleted:return{...e,completedThreadIds:e.completedThreadIds.includes(t.threadId)?e.completedThreadIds:[...e.completedThreadIds,t.threadId]};case m.ClearThreadCompleted:return{...e,completedThreadIds:e.completedThreadIds.filter(e=>e!==t.threadId)};case m.AddDeletingThread:return{...e,deletingThreadIds:e.deletingThreadIds.includes(t.threadId)?e.deletingThreadIds:[...e.deletingThreadIds,t.threadId]};case m.RemoveDeletingThread:return{...e,deletingThreadIds:e.deletingThreadIds.filter(e=>e!==t.threadId)};case m.AddDeletingProject:return{...e,deletingProjectIds:e.deletingProjectIds.includes(t.projectId)?e.deletingProjectIds:[...e.deletingProjectIds,t.projectId]};case m.RemoveDeletingProject:return{...e,deletingProjectIds:e.deletingProjectIds.filter(e=>e!==t.projectId)};case m.AppendCommandOutput:return{...e,commandOutput:e.commandOutput+t.content};case m.SetRunningCommand:return{...e,isRunningCommand:t.isRunning};case m.ClearCommandOutput:return{...e,commandOutput:``};case m.ToggleTerminal:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,open:!r.open}}}}case m.SetTerminalOpen:{let n=t.threadId??`default`,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,open:t.open}}}}case m.QueueTerminalCommand:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,queuedRelativeFolder:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,queuedCommand:t.command,queuedRelativeFolder:t.relativeFolder??null,open:!0}}}}case m.ClearQueuedTerminalCommand:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,queuedCommand:null}}}}case m.AppendTerminalLine:{let n=t.threadId??`default`,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,outputLines:[...r.outputLines,t.line]}}}}case m.ClearTerminalOutput:{let n=t.threadId??`default`,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,outputLines:[]}}}}case m.SetTerminalHeight:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,height:t.height}}}}case m.SetTerminalCwd:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,cwd:t.cwd}}}}case m.SetTerminalRunning:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,isRunning:t.isRunning}}}}case m.SetTerminalHistory:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,history:t.history}}}}case m.SetTerminalHistoryIndex:{let n=t.threadId,r=e.terminalStates[n]??{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1};return{...e,terminalStates:{...e.terminalStates,[n]:{...r,historyIndex:t.index}}}}case m.UpdateThreadTitle:return{...e,projects:e.projects.map(e=>e.projectId===t.projectId?{...e,threads:e.threads.map(e=>e.threadId===t.threadId?{...e,title:t.title}:e)}:e)};case m.ClearFocusChatInput:return{...e,focusChatInput:!1};case m.ClearMessages:return{...e,messages:[]};case m.UpdateToolCallProgress:return{...e,toolCallProgress:{...e.toolCallProgress,[t.toolCallId]:t.progress}};case m.SetPendingChatMessage:return{...e,pendingChatMessage:t.message};case m.ClearPendingChatMessage:return{...e,pendingChatMessage:null};case m.SetDiffComments:return{...e,diffComments:{...e.diffComments,[t.threadId]:t.comments}};default:return e}}var _=(0,r.createContext)({state:h,dispatch:()=>{}});function v(){return(0,r.useContext)(_)}function y(e){let t=(0,i.c)(11),{state:n,dispatch:r}=v();if(!e){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n={terminalState:{open:!1,queuedCommand:null,queuedRelativeFolder:null,outputLines:e,height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1},dispatch:b},t[1]=n):n=t[1],n}let a;t[2]!==n.terminalStates||t[3]!==e?(a=n.terminalStates[e]||{open:!1,queuedCommand:null,outputLines:[],height:300,history:[],historyIndex:-1,cwd:`.`,isRunning:!1},t[2]=n.terminalStates,t[3]=e,t[4]=a):a=t[4];let o=a,s;t[5]!==r||t[6]!==e?(s=t=>{r({...t,threadId:e})},t[5]=r,t[6]=e,t[7]=s):s=t[7];let c=s,l;return t[8]!==c||t[9]!==o?(l={terminalState:o,dispatch:c},t[8]=c,t[9]=o,t[10]=l):l=t[10],l}function b(){}export{v as a,f as c,a as d,l as f,h as i,u as l,_ as n,y as o,o as p,g as r,p as s,m as t,d as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Jn as n,_a as r,ya as i}from"./dialogs-config-DZFG2IQM.js";import{F as a,I as o,N as s,P as c}from"./react-vendor-Bao-KYKs.js";var l=r(),u=e(i(),1),d=t(),f=a,p=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=n(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,i),r[3]=i,r[4]=o);let s;return r[5]!==a||r[6]!==t||r[7]!==o?(s=(0,d.jsx)(c,{ref:t,className:o,...a}),r[5]=a,r[6]=t,r[7]=o,r[8]=s):s=r[8],s});p.displayName=c.displayName;var m=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let s;r[3]===i?s=r[4]:(s=n(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm`,i),r[3]=i,r[4]=s);let c;return r[5]!==a||r[6]!==t||r[7]!==s?(c=(0,d.jsx)(o,{ref:t,className:s,...a}),r[5]=a,r[6]=t,r[7]=s,r[8]=c):c=r[8],c});m.displayName=o.displayName;var h=u.forwardRef((e,t)=>{let r=(0,l.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=n(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,i),r[3]=i,r[4]=o);let c;return r[5]!==a||r[6]!==t||r[7]!==o?(c=(0,d.jsx)(s,{ref:t,className:o,...a}),r[5]=a,r[6]=t,r[7]=o,r[8]=c):c=r[8],c});h.displayName=s.displayName;export{m as i,h as n,p as r,f as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-B1FJdls4.js";import{Dr as t,Jn as n,_a as r,ya as i}from"./dialogs-config-DZFG2IQM.js";var a=r(),o=e(i(),1),s=t(),c=o.forwardRef((e,t)=>{let r=(0,a.c)(9),i,o;r[0]===e?(i=r[1],o=r[2]):({className:i,...o}=e,r[0]=e,r[1]=i,r[2]=o);let c;r[3]===i?c=r[4]:(c=n(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,i),r[3]=i,r[4]=c);let l;return r[5]!==o||r[6]!==t||r[7]!==c?(l=(0,s.jsx)(`textarea`,{className:c,ref:t,...o}),r[5]=o,r[6]=t,r[7]=c,r[8]=l):l=r[8],l});c.displayName=`Textarea`;export{c as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./index-BTbiyooe.js";export{e as TodosView};
|
|
File without changes
|
|
File without changes
|