tarsk 0.5.65 → 0.5.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled-skills/skill-creator/eval-viewer/generate_review.js +41 -40
- package/dist/bundled-skills/skill-creator/scripts/aggregate_benchmark.js +106 -98
- package/dist/bundled-skills/skill-creator/scripts/generate_report.js +78 -67
- package/dist/bundled-skills/skill-creator/scripts/improve_description.js +119 -72
- package/dist/bundled-skills/skill-creator/scripts/run_eval.js +76 -54
- package/dist/bundled-skills/skill-creator/scripts/run_loop.js +221 -142
- package/dist/index.js +51645 -47173
- package/dist/public/assets/{account-view-Dp0PfqVq.js → account-view-BlK6g38q.js} +1 -1
- package/dist/public/assets/{alert-dialog-Ge-FFGao.js → alert-dialog-B6An1LDY.js} +1 -1
- package/dist/public/assets/{async-error-boundary-B0tQed36.js → async-error-boundary-Rf-s2_Ez.js} +1 -1
- package/dist/public/assets/browser-tab-BJxPUVJi.js +12 -0
- package/dist/public/assets/{card-xQfAy2Rx.js → card-BDQUHsPD.js} +1 -1
- package/dist/public/assets/chat-dock-context-DyKjqpND.js +1 -0
- package/dist/public/assets/commit-dialog-CYb1kJCq.js +1 -0
- package/dist/public/assets/commit-error-dialog-DvxaNRcH.js +1 -0
- package/dist/public/assets/commit-method-fields-Dijc502F.js +1 -0
- package/dist/public/assets/context-menu-C51M1WGZ.js +1 -0
- package/dist/public/assets/conversation-history-view-w_6Jd3d-.js +1 -0
- package/dist/public/assets/create-project-dialog-CSVkngnF.js +6 -0
- package/dist/public/assets/create-repo-dialog-CcFA8pXz.js +1 -0
- package/dist/public/assets/{delete-confirm-dialog-Dy0dOtPe.js → delete-confirm-dialog-uTSX_x-i.js} +1 -1
- package/dist/public/assets/diff-view-XN5G5F6E.js +4 -0
- package/dist/public/assets/dist-IeRYu0zQ.js +142 -0
- package/dist/public/assets/{explorer-tab-context-8bs_tiCO.js → explorer-tab-context-BdjTEbFh.js} +1 -1
- package/dist/public/assets/explorer-tab-view-A2ICDFPB.js +2 -0
- package/dist/public/assets/explorer-tree-B04Ba59E.js +1 -0
- package/dist/public/assets/explorer-view-CofaKFiu.js +75 -0
- package/dist/public/assets/git-history-dialog-V3kaff2G.js +1 -0
- package/dist/public/assets/index-B0xy4BkI.js +3360 -0
- package/dist/public/assets/index-Cndc50ux.css +1 -0
- package/dist/public/assets/interactive-BrHVRHmQ.js +21 -0
- package/dist/public/assets/{main-tab-context-DHeKIUsf.js → main-tab-context-zQSuRQQG.js} +1 -1
- package/dist/public/assets/mcp-server-card-DOsP-SQ8.js +1 -0
- package/dist/public/assets/merged-pr-dialog-BerRzLlh.js +1 -0
- package/dist/public/assets/model-list-controls-Dw98tMn7.js +1 -0
- package/dist/public/assets/{monaco-setup-x3evbdq3.js → monaco-setup-C87kBr4u.js} +1 -1
- package/dist/public/assets/onboarding-DVc9-yKJ.js +46 -0
- package/dist/public/assets/project-env-vars-view-BQwUd7y6.js +1 -0
- package/dist/public/assets/project-model-aliases-view-CobSp09z.js +1 -0
- package/dist/public/assets/project-settings-view-CPTd5lEi.js +1 -0
- package/dist/public/assets/{project-tools-view-C44y08lY.js → project-tools-view-DShQghoz.js} +1 -1
- package/dist/public/assets/providers-list-view-Da9VMcuP.js +1 -0
- package/dist/public/assets/pull-request-dialog-BAarT9EM.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-BcF25mjQ.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-BF0NzV2u.js +1 -0
- package/dist/public/assets/react-vendor-B7jFrulV.js +22 -0
- package/dist/public/assets/settings-general-view-DT4nElcL.js +1 -0
- package/dist/public/assets/settings-instructions-view-Bsr8wRMf.js +1 -0
- package/dist/public/assets/settings-list-B9wyVzKw.js +1 -0
- package/dist/public/assets/settings-logs-view-CyaGqUKH.js +5 -0
- package/dist/public/assets/settings-mcp-servers-view-BTUWHB5K.js +5 -0
- package/dist/public/assets/settings-models-view-DFwkVdt3.js +1 -0
- package/dist/public/assets/settings-rules-view-BhA9tjVh.js +8 -0
- package/dist/public/assets/settings-skills-view-BFoO9oZk.js +3 -0
- package/dist/public/assets/{settings-slack-view-OFUhhjTj.js → settings-slack-view-D4mrQ9C9.js} +1 -1
- package/dist/public/assets/settings-slash-commands-view-BLKPDUVG.js +1 -0
- package/dist/public/assets/settings-statistics-view-fa6iBiP8.js +1 -0
- package/dist/public/assets/settings-storage-view-LaiAi5gv.js +1 -0
- package/dist/public/assets/settings-subagents-view-BjMz2Ri_.js +2 -0
- package/dist/public/assets/settings-system-prompt-view-DNh1yqZh.js +1 -0
- package/dist/public/assets/settings-view-BoC66Wji.js +2 -0
- package/dist/public/assets/skeleton-CJSNEi3C.js +1 -0
- package/dist/public/assets/store-B_cK-gsT.js +8 -0
- package/dist/public/assets/{table-CYWF-RhQ.js → table-Cb2C1rQy.js} +1 -1
- package/dist/public/assets/tasks-view-B049aXpC.js +2 -0
- package/dist/public/assets/{terminal-panel-BxUHr-tZ.js → terminal-panel-Pv5xqCpm.js} +3 -3
- package/dist/public/assets/thread-tool-blocks-D9HUkPHB.js +1 -0
- package/dist/public/assets/{ui-components-DjoQfi8k.js → ui-components-DJLsrr5e.js} +1 -1
- package/dist/public/assets/{use-active-dock-panel-instance-BE69kVdb.js → use-active-dock-panel-instance-BlRDPUlZ.js} +1 -1
- package/dist/public/assets/{use-deferred-search-DXrcdbyC.js → use-deferred-search-0sV7mSzX.js} +1 -1
- package/dist/public/assets/use-installed-ai-files-DmLnugpj.js +1 -0
- package/dist/public/assets/{use-settings-page-loading-BC_wP7pl.js → use-settings-page-loading-BU2CDnfE.js} +1 -1
- package/dist/public/assets/{use-suspense-resource-rX-GqyWi.js → use-suspense-resource-CExc4Svq.js} +1 -1
- package/dist/public/assets/{use-toast-BFQ85Ly5.js → use-toast-hxHsVv6a.js} +1 -1
- package/dist/public/assets/{utils-Rlf65JHq.js → utils-SsF94Pkg.js} +1 -1
- package/dist/public/assets/{web-Q-tJsXNN.js → web-BidDZaMC.js} +1 -1
- package/dist/public/assets/{web-D8z4Nni0.js → web-C_HuLxHj.js} +1 -1
- package/dist/public/assets/{web-CxBqU2BU.js → web-DHUv7oQP.js} +1 -1
- package/dist/public/assets/{web-DTwF_7w-.js → web-JMCxQg4N.js} +1 -1
- package/dist/public/browser-preview-rpc.js +465 -7
- package/dist/public/index.html +14 -16
- package/dist/recommended-models.txt +5 -5
- package/package.json +1 -14
- package/dist/public/assets/api-BsPadLpi.js +0 -1
- package/dist/public/assets/browser-tab-hcbTzpVn.js +0 -8
- package/dist/public/assets/chat-dock-context-yQDhSXnw.js +0 -1
- package/dist/public/assets/commit-dialog-DK-NP7EN.js +0 -1
- package/dist/public/assets/commit-method-fields-DG3NtLE2.js +0 -1
- package/dist/public/assets/context-menu-M5y1Qb8G.js +0 -1
- package/dist/public/assets/conversation-history-view-YGPt-fC9.js +0 -1
- package/dist/public/assets/create-project-dialog-DW4oGrl2.js +0 -6
- package/dist/public/assets/create-repo-dialog-BFBOFZ2W.js +0 -1
- package/dist/public/assets/diff-view-Cy5PjlG_.js +0 -4
- package/dist/public/assets/dist-oojFghRi.js +0 -134
- package/dist/public/assets/explorer-tab-view-D6t9Ce05.js +0 -2
- package/dist/public/assets/explorer-tree-BCs2U0De.js +0 -1
- package/dist/public/assets/explorer-view-CxN4GRyn.js +0 -75
- package/dist/public/assets/git-history-dialog-fm9qhkgI.js +0 -1
- package/dist/public/assets/git-ops-button-DO1ng45p.js +0 -2
- package/dist/public/assets/index-B7qJtiRL.js +0 -3307
- package/dist/public/assets/index-GYexJ6QO.css +0 -1
- package/dist/public/assets/interactive-WtOIgeV4.js +0 -21
- package/dist/public/assets/local-tool-blocks-DlqmJ7__.js +0 -1
- package/dist/public/assets/mcp-server-card-V4Ddsgv3.js +0 -1
- package/dist/public/assets/merged-pr-dialog-Bi5pJzTO.js +0 -1
- package/dist/public/assets/model-list-controls-oiBE9X9_.js +0 -1
- package/dist/public/assets/onboarding-dbhmRuxw.js +0 -46
- package/dist/public/assets/project-env-vars-view-OVck-YEy.js +0 -1
- package/dist/public/assets/project-model-aliases-view-Cu-n2j94.js +0 -1
- package/dist/public/assets/project-settings-view-DKkLgg3C.js +0 -1
- package/dist/public/assets/providers-list-view-BEXiqKg8.js +0 -1
- package/dist/public/assets/pull-request-dialog-BOl1VloY.js +0 -1
- package/dist/public/assets/pull-with-changes-dialog-CJKvLUaf.js +0 -1
- package/dist/public/assets/push-before-pr-dialog-BZLScOoO.js +0 -1
- package/dist/public/assets/react-vendor-wGLyNWf9.js +0 -22
- package/dist/public/assets/settings-general-view-LnCQ2zkv.js +0 -1
- package/dist/public/assets/settings-instructions-view-B7lADJZh.js +0 -1
- package/dist/public/assets/settings-list-C5MACtux.js +0 -1
- package/dist/public/assets/settings-logs-view-YWMyQqu5.js +0 -5
- package/dist/public/assets/settings-mcp-servers-view-CN7JO2UD.js +0 -5
- package/dist/public/assets/settings-models-view-CswWfeDN.js +0 -1
- package/dist/public/assets/settings-rules-view-__5f33ot.js +0 -8
- package/dist/public/assets/settings-skills-view-Dvfrl9kz.js +0 -3
- package/dist/public/assets/settings-slash-commands-view-B1pO-Yie.js +0 -1
- package/dist/public/assets/settings-statistics-view-Bp624KXI.js +0 -1
- package/dist/public/assets/settings-storage-view-CHpGieRu.js +0 -1
- package/dist/public/assets/settings-subagents-view-CFggo62r.js +0 -2
- package/dist/public/assets/settings-system-prompt-view-BWD6RrX8.js +0 -1
- package/dist/public/assets/settings-view-ZgVxZhur.js +0 -2
- package/dist/public/assets/skeleton-B_xdlo2b.js +0 -1
- package/dist/public/assets/slug-utils-C5rnmMMP.js +0 -1
- package/dist/public/assets/store-CSyJjyNs.js +0 -7
- package/dist/public/assets/tasks-view-4yyCDYbV.js +0 -2
- package/dist/public/assets/thread-tool-blocks-BfowiaTH.js +0 -1
- package/dist/public/assets/use-installed-ai-files-CZIOFhcX.js +0 -1
package/dist/public/assets/{explorer-tab-context-8bs_tiCO.js → explorer-tab-context-BdjTEbFh.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,ki as r}from"./interactive-BrHVRHmQ.js";var i=n(),a=e(r(),1),o=t(),s=(0,a.createContext)(null);function c(e){let t=(0,i.c)(8),{children:n}=e,[r,c]=(0,a.useState)(null),[u,d]=(0,a.useState)(0),[f,p]=(0,a.useState)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{d(l)},t[0]=m):m=t[0];let h=m,g;t[1]!==f||t[2]!==u||t[3]!==r?(g={pendingExplorerPath:r,setPendingExplorerPath:c,explorerRefreshTick:u,triggerExplorerRefresh:h,explorerClearPath:f,setExplorerClearPath:p},t[1]=f,t[2]=u,t[3]=r,t[4]=g):g=t[4];let _=g,v;return t[5]!==n||t[6]!==_?(v=(0,o.jsx)(s.Provider,{value:_,children:n}),t[5]=n,t[6]=_,t[7]=v):v=t[7],v}function l(e){return e+1}function u(){let e=(0,a.useContext)(s);if(!e)throw Error(`useExplorerTab must be used within an ExplorerTabProvider`);return e}export{u as n,c as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/explorer-tree-B04Ba59E.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-B0xy4BkI.js","assets/monaco-D1hpqXQ0.js","assets/monaco-BQve5vfS.css","assets/onboarding-DVc9-yKJ.js","assets/interactive-BrHVRHmQ.js","assets/alert-dialog-B6An1LDY.js","assets/react-vendor-B7jFrulV.js","assets/use-toast-hxHsVv6a.js","assets/chat-dock-context-DyKjqpND.js","assets/store-B_cK-gsT.js","assets/explorer-tab-context-BdjTEbFh.js","assets/main-tab-context-zQSuRQQG.js","assets/use-suspense-resource-CExc4Svq.js","assets/thread-tool-blocks-D9HUkPHB.js","assets/ndjson-stream-DeGpE5o5.js","assets/utils-SsF94Pkg.js","assets/index-Cndc50ux.css","assets/async-error-boundary-Rf-s2_Ez.js","assets/card-BDQUHsPD.js","assets/context-menu-C51M1WGZ.js","assets/ui-components-DJLsrr5e.js","assets/explorer-view-CofaKFiu.js","assets/monaco-setup-C87kBr4u.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Rr as n,_ as r,i,ki as a}from"./interactive-BrHVRHmQ.js";import{bt as o,ht as ee,xt as s}from"./onboarding-DVc9-yKJ.js";import{l as c}from"./monaco-D1hpqXQ0.js";import{r as l}from"./store-B_cK-gsT.js";import{t as u}from"./use-toast-hxHsVv6a.js";import{n as d}from"./explorer-tab-context-BdjTEbFh.js";import{$ as f,Pt as p,Q as m,X as h,Y as g,Z as _,c as v,l as y,s as b,u as x}from"./index-B0xy4BkI.js";import{t as S}from"./async-error-boundary-Rf-s2_Ez.js";var C=e(a(),1),w=t(),te=(0,C.lazy)(()=>c(()=>import(`./explorer-tree-B04Ba59E.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]))),ne=(0,C.lazy)(()=>c(()=>import(`./explorer-view-CofaKFiu.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,24])));function T(){let e=l(e=>e.selectedThreadId),t=b(),[a,c]=(0,C.useState)(null),[T,E]=(0,C.useState)(!0),[D,O]=(0,C.useState)(null),[k,A]=(0,C.useState)(!1),[j,M]=(0,C.useState)(!1),N=(0,C.useRef)(0),{pendingExplorerPath:P,setPendingExplorerPath:F,explorerClearPath:I,setExplorerClearPath:L,triggerExplorerRefresh:R}=d();(0,C.useEffect)(()=>{function e(e){f(e.dataTransfer)&&e.preventDefault()}return window.addEventListener(`dragover`,e),window.addEventListener(`drop`,e),()=>{window.removeEventListener(`dragover`,e),window.removeEventListener(`drop`,e)}},[]),(0,C.useEffect)(()=>{E(!0)},[e]);let z=(0,C.useCallback)(e=>{c(e),t&&E(!1)},[t]),B=(0,C.useCallback)(()=>{E(!0)},[]),V=(0,C.useCallback)(e=>{c(e),t&&E(!1)},[t]);(0,C.useEffect)(()=>{P&&(c({name:P.split(`/`).pop()??P,path:P,type:`file`}),t&&E(!1),F(null))},[t,P,F]),(0,C.useEffect)(()=>{I&&(a&&(a.path===I||a.path.startsWith(I+`/`))&&(c(null),t&&E(!0)),L(null))},[I,t,a,L]);function H(){N.current=0,M(!1)}function U(e){f(e.dataTransfer)&&(N.current+=1,M(!0))}function W(e){f(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}function G(e){f(e.dataTransfer)&&(N.current=Math.max(0,N.current-1),N.current===0&&M(!1))}function K(e){if(!f(e.dataTransfer))return;e.preventDefault(),H();let{files:t,skippedFolders:n}=m(e.dataTransfer);n>0&&u({title:`Folders skipped`,description:`Only files can be copied. Drop individual files instead of folders.`}),t.length!==0&&O({files:t,dirPath:``})}let q=(0,C.useCallback)((e,t)=>{N.current=0,M(!1),O({files:e,dirPath:t})},[]);async function J(){if(!(!D||!e||k)){A(!0);try{let{copied:t,failures:n}=await _(e,D.dirPath,D.files);t.length>0&&R(),u(h(D,t.length,n))}finally{A(!1),O(null)}}}let Y={onDragEnter:U,onDragOver:W,onDragLeave:G,onDrop:K},X=j?(0,w.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-50 flex items-center justify-center bg-background/70`,children:(0,w.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border-2 border-dashed border-primary bg-background px-6 py-4`,children:[(0,w.jsx)(r,{className:`h-4 w-4 text-primary`}),(0,w.jsx)(`span`,{className:n.label,children:`Drop files to copy them into the repository`})]})}):null,Z=(0,w.jsx)(ee,{className:`h-full`,children:e?(0,w.jsx)(p,{threadId:e,children:(0,w.jsx)(S,{fallbackTitle:`Failed to load files`,children:(0,w.jsx)(C.Suspense,{fallback:(0,w.jsx)(s,{}),children:(0,w.jsx)(te,{threadId:e,selectedPath:a?.path??null,onNodeSelect:z,onFilesDrop:q})})})}):(0,w.jsx)(`p`,{className:i(n.caption,`px-3 py-4 text-center`),children:`No thread selected.`})}),Q=(0,w.jsx)(C.Suspense,{fallback:(0,w.jsx)(o,{}),children:(0,w.jsx)(ne,{selectedFile:a,showTreeBackButton:t&&!T,onShowTree:B,onFileCreated:V})}),$=(0,w.jsx)(g,{pendingDrop:D,dropCopying:k,onConfirm:()=>{J()},onDismiss:()=>{O(null)}});return t?(0,w.jsxs)(`div`,{className:`relative flex h-full flex-col overflow-hidden`,...Y,children:[X,$,(0,w.jsx)(`div`,{className:i(`flex-1 min-h-0 overflow-hidden`,!T&&`hidden`),children:Z}),(0,w.jsx)(`div`,{className:i(`flex-1 min-h-0 overflow-hidden`,T&&`hidden`),children:Q})]}):(0,w.jsxs)(`div`,{className:`relative flex h-full flex-col overflow-hidden`,...Y,children:[X,$,(0,w.jsxs)(x,{direction:`horizontal`,className:`flex-1 overflow-hidden`,children:[(0,w.jsx)(y,{defaultSize:25,minSize:15,maxSize:50,className:`overflow-hidden border-r border-border`,children:Z}),(0,w.jsx)(v,{withHandle:!0}),(0,w.jsx)(y,{className:`overflow-hidden`,children:Q})]})]})}export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{B as t,Di as n,Oi as r,Rr as i,Rt as a,Vt as o,i as s,ki as c,xn as l,yn as u,zt as d}from"./interactive-BrHVRHmQ.js";import{f,x as p,xt as m,yt as h}from"./onboarding-DVc9-yKJ.js";import{t as g}from"./use-toast-hxHsVv6a.js";import{a as _,c as v,i as y,n as b,r as x,t as S}from"./alert-dialog-B6An1LDY.js";import{n as C}from"./explorer-tab-context-BdjTEbFh.js";import{n as w,t as T}from"./use-suspense-resource-CExc4Svq.js";import{$ as E,At as D,Ft as O,Q as k,at as A,ct as j,et as M,jt as ee,kt as N,nt as P,ot as F,pt as I,tt as L}from"./index-B0xy4BkI.js";import{a as R,i as z,n as B,r as V,t as te}from"./context-menu-C51M1WGZ.js";import{t as ne}from"./async-error-boundary-Rf-s2_Ez.js";import{t as H}from"./ui-components-DJLsrr5e.js";var U=r(),W=e(c(),1),G=n(),re=W.forwardRef((e,t)=>{let n=(0,U.c)(9),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=s(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,G.jsx)(H,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});re.displayName=H.displayName;var K=W.forwardRef((e,n)=>{let r=(0,U.c)(10),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]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.jsx)(t,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),r[3]=o):o=r[3];let c;r[4]===i?c=r[5]:(c=s(`flex h-11 w-full rounded-md bg-transparent py-3 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),r[4]=i,r[5]=c);let l;return r[6]!==a||r[7]!==n||r[8]!==c?(l=(0,G.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[o,(0,G.jsx)(H.Input,{ref:n,className:c,...a})]}),r[6]=a,r[7]=n,r[8]=c,r[9]=l):l=r[9],l});K.displayName=H.Input.displayName;var q=W.forwardRef((e,t)=>{let n=(0,U.c)(9),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=s(`max-h-[300px] overflow-y-auto overflow-x-hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,G.jsx)(H.List,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});q.displayName=H.List.displayName;var J=W.forwardRef((e,t)=>{let n=(0,U.c)(4),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=s(i.bodyMuted,`py-6 text-center`),n[0]=r):r=n[0];let a;return n[1]!==e||n[2]!==t?(a=(0,G.jsx)(H.Empty,{ref:t,className:r,...e}),n[1]=e,n[2]=t,n[3]=a):a=n[3],a});J.displayName=H.Empty.displayName;var Y=W.forwardRef((e,t)=>{let n=(0,U.c)(9),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=s(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,G.jsx)(H.Group,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Y.displayName=H.Group.displayName;var ie=W.forwardRef((e,t)=>{let n=(0,U.c)(9),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=s(`-mx-1 h-px bg-divider`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,G.jsx)(H.Separator,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ie.displayName=H.Separator.displayName;var ae=W.forwardRef((e,t)=>{let n=(0,U.c)(9),r,a;n[0]===e?(r=n[1],a=n[2]):({className:r,...a}=e,n[0]=e,n[1]=r,n[2]=a);let o;n[3]===r?o=n[4]:(o=s(s(i.body,`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`),r),n[3]=r,n[4]=o);let c;return n[5]!==a||n[6]!==t||n[7]!==o?(c=(0,G.jsx)(H.Item,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=c):c=n[8],c});ae.displayName=H.Item.displayName;var oe=e=>{let t=(0,U.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=s(i.compact,`ml-auto tracking-widest text-muted-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,G.jsx)(`span`,{className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o};oe.displayName=`CommandShortcut`;var X=100,se=500;function Z(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean)}function ce(e,t){return t.length===0?!0:t.every(t=>e.haystack.includes(t))}function le(e,t,n){if(t.length===0)return[];let r=[];for(let n of e)if(ce(n,t)&&(r.push(n.node),r.length>=se))break;return r.sort((e,t)=>ue(e,t,n)).slice(0,X)}function ue(e,t,n){let r=n.trim().toLowerCase(),i=e.name.toLowerCase(),a=t.name.toLowerCase(),o=r?i.startsWith(r):!1;return o===(r?a.startsWith(r):!1)?e.type===t.type?e.path.localeCompare(t.path):e.type===`folder`?-1:1:o?-1:1}function de(e){let t=(0,U.c)(38),{items:n,isReady:r,onRequestIndex:o,onOpenChange:c,onSelect:l}=e,u=r===void 0?!1:r,d=(0,W.useRef)(null),f=(0,W.useRef)(!1),m=(0,W.useRef)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(``),y=(0,W.useDeferredValue)(_),b;t[0]===o?b=t[1]:(b=function(){m.current||(m.current=!0,o())},t[0]=o,t[1]=b);let x=b,S;t[2]!==y||t[3]!==n?(S=le(n,Z(y),y),t[2]=y,t[3]=n,t[4]=S):S=t[4];let C=S,w,T;t[5]!==c||t[6]!==_?(w=()=>{let e=_.trim().length>0;g(e),f.current!==e&&(f.current=e,c(e))},T=[c,_],t[5]=c,t[6]=_,t[7]=w,t[8]=T):(w=t[7],T=t[8]),(0,W.useEffect)(w,T);let E;t[9]===c?E=t[10]:(E=function(e){e||v(``),g(e),c(e),e&&requestAnimationFrame(()=>d.current?.focus())},t[9]=c,t[10]=E);let O=E,k;t[11]!==c||t[12]!==l?(k=function(e){l(e),g(!1),c(!1),v(``)},t[11]=c,t[12]=l,t[13]=k):k=t[13];let A=k,j;t[14]===x?j=t[15]:(j=e=>{x(),v(e.target.value)},t[14]=x,t[15]=j);let M;t[16]!==_||t[17]!==x||t[18]!==j?(M=(0,G.jsx)(ee,{asChild:!0,children:(0,G.jsx)(`div`,{className:`bg-transparent`,children:(0,G.jsx)(p,{ref:d,value:_,onPointerDown:x,onChange:j,placeholder:`Search files and folders`,className:`pr-[4px]`})})}),t[16]=_,t[17]=x,t[18]=j,t[19]=M):M=t[19];let P;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(P=s(i.compact,`py-4`),t[20]=P):P=t[20];let F=u?`No matches found.`:`Indexing files and folders...`,L;t[21]===F?L=t[22]:(L=(0,G.jsx)(J,{className:P,children:F}),t[21]=F,t[22]=L);let R;if(t[23]!==A||t[24]!==C){let e;t[26]===A?e=t[27]:(e=e=>(0,G.jsxs)(ae,{value:e.path,onSelect:()=>A(e),className:e.ignored?`opacity-50`:void 0,children:[e.type===`folder`?(0,G.jsx)(a,{className:`h-4 w-4 text-muted-foreground`}):(0,G.jsx)(I,{filename:e.name}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`truncate`,children:e.name}),(0,G.jsx)(`div`,{className:s(i.compact,`truncate text-muted-foreground`),children:e.path})]})]},e.path),t[26]=A,t[27]=e),R=C.map(e),t[23]=A,t[24]=C,t[25]=R}else R=t[25];let z;t[28]===R?z=t[29]:(z=(0,G.jsx)(Y,{children:R}),t[28]=R,t[29]=z);let B;t[30]!==L||t[31]!==z?(B=(0,G.jsx)(D,{align:`start`,side:`bottom`,sideOffset:4,onOpenAutoFocus:Q,className:`w-[var(--radix-popover-trigger-width)] p-0`,children:(0,G.jsx)(re,{shouldFilter:!1,children:(0,G.jsxs)(q,{children:[L,z]})})}),t[30]=L,t[31]=z,t[32]=B):B=t[32];let V;return t[33]!==O||t[34]!==h||t[35]!==B||t[36]!==M?(V=(0,G.jsxs)(N,{open:h,onOpenChange:O,children:[M,B]}),t[33]=O,t[34]=h,t[35]=B,t[36]=M,t[37]=V):V=t[37],V}function Q(e){return e.preventDefault()}function fe(e,t,n){return`explorer-dir:${e}:${t}:${n}`}function pe(e){let t=(0,U.c)(12),{threadId:n,dirPath:r,version:i,children:a}=e,o;t[0]!==r||t[1]!==n||t[2]!==i?(o=fe(n,r,i),t[0]=r,t[1]=n,t[2]=i,t[3]=o):o=t[3];let s;t[4]!==r||t[5]!==n?(s=()=>A(n,r).then(me),t[4]=r,t[5]=n,t[6]=s):s=t[6];let c=T(o,s),l;t[7]!==a||t[8]!==c?(l=a(c),t[7]=a,t[8]=c,t[9]=l):l=t[9];let u;return t[10]===l?u=t[11]:(u=(0,G.jsx)(G.Fragment,{children:l}),t[10]=l,t[11]=u),u}function me(e){return e.entries}function he(e){let t=(0,U.c)(17),{defaultValue:n,onCommit:r,onCancel:a,level:o,basePadding:s,icon:c}=e,l=(0,W.useRef)(null),u,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{l.current?.focus(),l.current?.select()},d=[],t[0]=u,t[1]=d):(u=t[0],d=t[1]),(0,W.useEffect)(u,d);let p;t[2]!==a||t[3]!==r?(p=function(e){if(e.key===`Enter`){let e=l.current?.value.trim()??``;e?r(e):a()}else e.key===`Escape`&&a()},t[2]=a,t[3]=r,t[4]=p):p=t[4];let m=p,h;t[5]!==a||t[6]!==r?(h=function(){let e=l.current?.value.trim()??``;e?r(e):a()},t[5]=a,t[6]=r,t[7]=h):h=t[7];let g=h,_;t[8]!==n||t[9]!==g||t[10]!==m?(_=(0,G.jsx)(`input`,{ref:l,defaultValue:n,onKeyDown:m,onBlur:g,className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`,onClick:$}),t[8]=n,t[9]=g,t[10]=m,t[11]=_):_=t[11];let v;return t[12]!==s||t[13]!==c||t[14]!==o||t[15]!==_?(v=(0,G.jsxs)(f,{level:o,basePadding:s,className:i.conversationBody,children:[c,_]}),t[12]=s,t[13]=c,t[14]=o,t[15]=_,t[16]=v):v=t[16],v}function $(e){return e.stopPropagation()}function ge(e){return e.map(e=>({node:e,haystack:`${e.name} ${e.path}`.toLowerCase()}))}function _e(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(0,t):``}var ve=(0,W.memo)(function e({node:t,level:n,threadId:r,selectedPath:c,expandedPaths:p,getDirVersion:m,renamingPath:_,newItemIn:v,onToggleFolder:y,onSelectNode:b,onStartRename:x,onCommitRename:S,onCancelRename:C,onDelete:w,onOpen:T,onCopyReference:D,onNewFile:O,onNewFolder:A,onCommitNewItem:j,onCancelNewItem:M,dropTargetPath:ee,onFolderDropTargetChange:N,onFilesDrop:P}){let F=p.has(t.path),L=_===t.path,ne=v?.dirPath===t.path&&F,H=ee===t.path;return t.type===`folder`?(0,G.jsxs)(te,{children:[(0,G.jsx)(R,{asChild:!0,children:(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(f,{level:n,basePadding:10,selected:c===t.path,className:s(i.conversationBody,t.ignored&&`opacity-50`,H&&`bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-primary`),onClick:e=>{e.stopPropagation(),y(t)},onDragOver:e=>{E(e.dataTransfer)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`copy`,H||N(t.path))},onDragLeave:e=>{E(e.dataTransfer)&&(e.currentTarget.contains(e.relatedTarget)||H&&N(null))},onDrop:e=>{if(!E(e.dataTransfer))return;e.preventDefault(),e.stopPropagation(),N(null);let{files:n,skippedFolders:r}=k(e.dataTransfer);r>0&&g({title:`Folders skipped`,description:`Only files can be copied. Drop individual files instead of folders.`}),n.length>0&&P(n,t.path)},children:[(0,G.jsx)(`span`,{className:`text-muted-foreground w-3 flex-shrink-0`,children:F?(0,G.jsx)(l,{className:`h-3 w-3`}):(0,G.jsx)(u,{className:`h-3 w-3`})}),L?(0,G.jsxs)(G.Fragment,{children:[F?(0,G.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}):(0,G.jsx)(a,{className:`h-4 w-4 flex-shrink-0`}),(0,G.jsx)(`input`,{autoFocus:!0,defaultValue:t.name,onKeyDown:e=>{if(e.key===`Enter`){let n=e.target.value.trim();n?S(t,n):C()}else e.key===`Escape`&&C()},onBlur:e=>{let n=e.target.value.trim();n?S(t,n):C()},onClick:e=>e.stopPropagation(),className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`})]}):(0,G.jsxs)(G.Fragment,{children:[F?(0,G.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}):(0,G.jsx)(a,{className:`h-4 w-4 flex-shrink-0`}),(0,G.jsx)(`span`,{className:`flex-1 truncate`,children:t.name})]})]}),F&&(0,G.jsx)(`div`,{children:(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(h,{}),children:(0,G.jsx)(pe,{threadId:r,dirPath:t.path,version:m(t.path),children:t=>(0,G.jsxs)(G.Fragment,{children:[ne&&(0,G.jsx)(he,{defaultValue:``,level:n+1,basePadding:v.type===`folder`?10:22,icon:v.type===`folder`?(0,G.jsx)(a,{className:`h-4 w-4 flex-shrink-0`}):(0,G.jsx)(o,{className:`h-4 w-4 flex-shrink-0 text-muted-foreground`}),onCommit:j,onCancel:M}),t.map(t=>(0,G.jsx)(e,{node:t,level:n+1,threadId:r,selectedPath:c,expandedPaths:p,getDirVersion:m,renamingPath:_,newItemIn:v,onToggleFolder:y,onSelectNode:b,onStartRename:x,onCommitRename:S,onCancelRename:C,onDelete:w,onOpen:T,onCopyReference:D,onNewFile:O,onNewFolder:A,onCommitNewItem:j,onCancelNewItem:M,dropTargetPath:ee,onFolderDropTargetChange:N,onFilesDrop:P},t.path))]})})})})]})}),(0,G.jsxs)(B,{children:[(0,G.jsx)(V,{onSelect:()=>T(t),children:`Open`}),(0,G.jsx)(z,{}),(0,G.jsx)(V,{onSelect:()=>O(t.path),children:`New File...`}),(0,G.jsx)(V,{onSelect:()=>A(t.path),children:`New Folder...`}),(0,G.jsx)(z,{}),(0,G.jsx)(V,{onSelect:()=>D(t),children:`Copy Reference`}),(0,G.jsx)(V,{onSelect:()=>x(t),children:`Rename...`}),(0,G.jsx)(V,{onSelect:()=>w(t),className:`text-destructive focus:text-destructive`,children:`Delete`})]})]}):(0,G.jsxs)(te,{children:[(0,G.jsx)(R,{asChild:!0,children:(0,G.jsxs)(f,{level:n,basePadding:22,selected:c===t.path,className:s(i.conversationBody,t.ignored&&`opacity-50`),onClick:()=>b(t),children:[(0,G.jsx)(I,{filename:t.name}),L?(0,G.jsx)(`input`,{autoFocus:!0,defaultValue:t.name,onKeyDown:e=>{if(e.key===`Enter`){let n=e.target.value.trim();n?S(t,n):C()}else e.key===`Escape`&&C()},onBlur:e=>{let n=e.target.value.trim();n?S(t,n):C()},onClick:e=>e.stopPropagation(),className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`}):(0,G.jsx)(`span`,{className:`flex-1 truncate`,children:t.name})]})}),(0,G.jsxs)(B,{children:[(0,G.jsx)(V,{onSelect:()=>T(t),children:`Open`}),(0,G.jsx)(z,{}),(0,G.jsx)(V,{onSelect:()=>O(_e(t.path)),children:`New File...`}),(0,G.jsx)(V,{onSelect:()=>A(_e(t.path)),children:`New Folder...`}),(0,G.jsx)(z,{}),(0,G.jsx)(V,{onSelect:()=>D(t),children:`Copy Reference`}),(0,G.jsx)(V,{onSelect:()=>x(t),children:`Rename...`}),(0,G.jsx)(V,{onSelect:()=>w(t),className:`text-destructive focus:text-destructive`,children:`Delete`})]})]})}),ye=new Map;function be({threadId:e,selectedPath:t,onNodeSelect:n,onFilesDrop:r}){let[i,s]=(0,W.useState)(()=>new Map([[``,0]])),[c,l]=(0,W.useState)(new Set),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(null),[h,T]=(0,W.useState)(null),[E,D]=(0,W.useState)(null),[k,ee]=(0,W.useState)(!1),[N,I]=(0,W.useState)([]),[z,H]=(0,W.useState)(!1),[U,re]=(0,W.useState)(!1),K=(0,W.useRef)(null),q=(0,W.useRef)(0),J=(0,W.useRef)(null),{explorerRefreshTick:Y,pendingExplorerPath:ie,setExplorerClearPath:ae}=C(),{fetchUnifiedStatus:oe}=O(),X=(0,W.useMemo)(()=>`${e}:${Y}`,[Y,e]),se=(0,W.useCallback)(e=>{(0,W.startTransition)(()=>{ee(t=>t===e?t:e)})},[]),Z=(0,W.useCallback)(async()=>{if(!e)return;let t=ye.get(X);if(t){I(t),H(!0);return}if(K.current!==X){K.current=X,I([]),H(!1);try{let t=ge((await A(e,``,!0)).entries);ye.set(X,t),I(t),H(!0)}catch{I([]),H(!1)}finally{K.current===X&&(K.current=null)}}},[X,e]),ce=(0,W.useCallback)(()=>{re(!0)},[]),le=(0,W.useCallback)(()=>{ye.delete(X),I([]),H(!1)},[X]),ue=(0,W.useCallback)(()=>{le(),U&&Z()},[le,Z,U]),Q=(0,W.useCallback)(e=>i.get(e)??0,[i]),me=(0,W.useCallback)(e=>{s(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},[]),$=(0,W.useCallback)(t=>{e&&(w(fe(e,t,Q(t))),me(t))},[me,Q,e]),be=(0,W.useCallback)(t=>{if(!e)return;let n=t.path.split(`/`);t.type===`file`&&n.pop();let r=[],i=``;for(let e of n)i=i?`${i}/${e}`:e,r.push(i);l(e=>{let t=new Set(e);for(let e of r)t.add(e);return t})},[e]);(0,W.useEffect)(()=>{if(!e)return;let t=J.current!==null&&J.current!==e;J.current=e,t&&(s(new Map([[``,0]])),l(new Set),d(null),p(null),q.current=Y)},[Y,e]),(0,W.useEffect)(()=>{!e||Y<=q.current||(q.current=Y,s(t=>{let n=new Set([``]);for(let e of c)n.add(e);let r=new Map(t);for(let i of n){let n=t.get(i)??0;w(fe(e,i,n)),r.set(i,n+1)}return r}))},[Y,c,e]),(0,W.useEffect)(()=>{I([]),H(!1),re(!1),K.current=null},[X]),(0,W.useEffect)(()=>{!U||!e||Z()},[Z,U,e]),(0,W.useEffect)(()=>{if(!ie||!e)return;let t=ie.split(`/`);t.pop();let n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);if(n.length!==0){l(e=>{let t=new Set(e);for(let e of n)t.add(e);return t});for(let e of n)s(t=>{if(t.has(e))return t;let n=new Map(t);return n.set(e,0),n})}},[ie,e]);function xe(e){c.has(e.path)?l(t=>{let n=new Set(t);return n.delete(e.path),n}):(l(t=>new Set(t).add(e.path)),s(t=>{if(t.has(e.path))return t;let n=new Map(t);return n.set(e.path,0),n}))}function Se(e){T(e)}async function Ce(t){try{await F(e,t.path)}catch{g({title:`Error`,description:`Failed to open "${t.name}"`,variant:`destructive`})}}async function we(e){try{await navigator.clipboard.writeText(e.path);let t=g({title:`Copied`,description:`Reference copied to clipboard.`});window.setTimeout(()=>{t.dismiss()},2e3)}catch{g({title:`Error`,description:`Failed to copy reference for "${e.name}"`,variant:`destructive`})}}async function Te(){if(!h)return;let t=h;T(null);try{await P(e,t.path),ae(t.path),$(_e(t.path)),ue(),oe(!0),l(e=>{let n=new Set(e);for(let e of n)(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n}),s(e=>{let n=new Map(e);for(let e of n.keys())(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n})}catch{g({title:`Error`,description:`Failed to move "${t.name}" to trash`,variant:`destructive`})}}function Ee(e){p(null),d(e.path)}async function De(t,n){if(n===t.name){d(null);return}d(null);try{await j(e,t.path,n),$(_e(t.path)),ue(),oe(!0),t.type===`folder`&&(l(e=>{let n=new Set(e);for(let e of n)(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n}),s(e=>{let n=new Map(e);for(let e of n.keys())(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n}))}catch{g({title:`Error`,description:`Failed to rename "${t.name}"`,variant:`destructive`})}}function Oe(e){d(null),c.has(e)||(l(t=>new Set(t).add(e)),s(t=>{if(t.has(e))return t;let n=new Map(t);return n.set(e,0),n})),p({dirPath:e,type:`file`})}function ke(e){d(null),c.has(e)||(l(t=>new Set(t).add(e)),s(t=>{if(t.has(e))return t;let n=new Map(t);return n.set(e,0),n})),p({dirPath:e,type:`folder`})}async function Ae(t){if(!f)return;let{dirPath:n,type:r}=f;p(null);try{r===`file`?await M(e,n,t):await L(e,n,t),$(n),ue(),oe(!0)}catch{g({title:`Error`,description:`Failed to create ${r} "${t}"`,variant:`destructive`})}}function je(){p(null)}let Me=(0,W.useCallback)((e,t)=>{r?.(e,t)},[r]);function Ne(e){be(e),e.type===`file`&&n(e)}let Pe=f?.dirPath===``?(0,G.jsx)(he,{defaultValue:``,level:0,basePadding:f.type===`folder`?10:22,icon:f.type===`folder`?(0,G.jsx)(a,{className:`h-4 w-4 flex-shrink-0`}):(0,G.jsx)(o,{className:`h-4 w-4 flex-shrink-0 text-muted-foreground`}),onCommit:Ae,onCancel:je}):null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(S,{open:h!==null,onOpenChange:e=>!e&&T(null),children:(0,G.jsxs)(y,{children:[(0,G.jsx)(v,{children:`Move to Trash`}),(0,G.jsxs)(_,{children:[`Move “`,h?.name,`” to trash?`]}),(0,G.jsxs)(`div`,{className:`flex gap-3 justify-end`,children:[(0,G.jsx)(x,{children:`Cancel`}),(0,G.jsx)(b,{onClick:()=>void Te(),children:`Move to Trash`})]})]})}),(0,G.jsx)(`div`,{className:`border-b border-border px-2 py-2`,children:(0,G.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,G.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,G.jsx)(de,{items:N,isReady:z,onRequestIndex:ce,onOpenChange:se,onSelect:e=>Ne(e)},X)})})}),(0,G.jsxs)(te,{children:[(0,G.jsx)(R,{asChild:!0,disabled:k,children:(0,G.jsx)(`div`,{className:`py-2 min-h-full`,children:(0,G.jsx)(ne,{fallbackTitle:`Failed to load files`,onRetry:()=>$(``),children:(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(m,{}),children:(0,G.jsx)(pe,{threadId:e,dirPath:``,version:Q(``),children:r=>(0,G.jsxs)(G.Fragment,{children:[Pe,r.map(r=>(0,G.jsx)(ve,{node:r,level:0,threadId:e,selectedPath:t,expandedPaths:c,getDirVersion:Q,renamingPath:u,newItemIn:f,onToggleFolder:xe,onSelectNode:n,onStartRename:Ee,onCommitRename:De,onCancelRename:()=>d(null),onDelete:Se,onOpen:Ce,onCopyReference:we,onNewFile:Oe,onNewFolder:ke,onCommitNewItem:Ae,onCancelNewItem:je,dropTargetPath:E,onFolderDropTargetChange:D,onFilesDrop:Me},r.path))]})})})})})}),(0,G.jsxs)(B,{children:[(0,G.jsx)(V,{onSelect:()=>Oe(``),children:`New File...`}),(0,G.jsx)(V,{onSelect:()=>ke(``),children:`New Folder...`})]})]})]})}export{be as default};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,J as n,Oi as r,Qt as i,Rr as a,Sn as o,Ut as s,Wt as c,X as l,_r as u,dn as ee,i as d,it as te,ki as f,tr as p,vr as m,yt as h}from"./interactive-BrHVRHmQ.js";import{d as ne}from"./react-vendor-B7jFrulV.js";import{Ca as re,Eo as g,Yn as ie,bt as _}from"./onboarding-DVc9-yKJ.js";import{r as ae}from"./store-B_cK-gsT.js";import{t as v}from"./use-toast-hxHsVv6a.js";import{n as oe}from"./explorer-tab-context-BdjTEbFh.js";import{n as y,t as b}from"./use-suspense-resource-CExc4Svq.js";import{n as se}from"./utils-SsF94Pkg.js";import{Bt as x,It as S,Kt as C,Lt as w,at as T,et as ce,it as E,lt as le,ot as ue,qt as de,rt as D,st as fe,zt as pe}from"./index-B0xy4BkI.js";import{t as O}from"./async-error-boundary-Rf-s2_Ez.js";import"./monaco-setup-C87kBr4u.js";var k=r(),A=e(f(),1),j=t(),M=p(`explorer.preview`),N=[{label:`Markdown`,ext:`md`,icon:c},{label:`TypeScript`,ext:`ts`,icon:i},{label:`Text`,ext:`txt`,icon:s}];async function P(e,t){try{let n=await T(e,``),r=new Set(n.entries.map(e=>e.name)),i=`untitled`,a=`${i}.${t}`,o=2;for(;r.has(a);)a=`${i}${o}.${t}`,o++;return a}catch{return`untitled.${t}`}}function F(e){return m(e)===`md`}function I(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,mdc:`markdown`,css:`css`,scss:`scss`,html:`html`,py:`python`,sh:`shell`,yaml:`yaml`,yml:`yaml`,xml:`xml`,sql:`sql`}[m(e)]??`plaintext`}function L(e,t){return`explorer-file:${e}:${t}`}function R(e){let t=(0,k.c)(11),{threadId:n,path:r,contentKey:i,onContentReady:a}=e,o;t[0]!==r||t[1]!==n?(o=L(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==n?(s=async()=>{try{return await E(n,r)}catch(e){let t=e;throw z(`Failed to load explorer file preview`,{threadId:n,path:r},t),t}},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c=b(o,s),l,u;return t[6]!==i||t[7]!==a||t[8]!==c.content?(l=()=>{a({key:i,content:c.content,original:c.content})},u=[a,c.content,i],t[6]=i,t[7]=a,t[8]=c.content,t[9]=l,t[10]=u):(l=t[9],u=t[10]),(0,A.useLayoutEffect)(l,u),null}function z(e,t,n){M.error(e,{...t,error:n})}function B(e,t){return`explorer-media:${e}:${t}`}function V(e,t){let n=(0,k.c)(11),r;n[0]!==t||n[1]!==e?(r=B(e,t),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;n[3]!==t||n[4]!==e?(i=async()=>{try{return await D(e,t)}catch(n){let r=n;throw z(`Failed to load explorer media preview`,{threadId:e,path:t},r),r}},n[3]=t,n[4]=e,n[5]=i):i=n[5];let a=b(r,i),o;n[6]===a?o=n[7]:(o=URL.createObjectURL(a),n[6]=a,n[7]=o);let s=o,c,l;return n[8]===s?(c=n[9],l=n[10]):(c=()=>()=>{URL.revokeObjectURL(s)},l=[s],n[8]=s,n[9]=c,n[10]=l),(0,A.useEffect)(c,l),s}function me(e){let t=(0,k.c)(3),{threadId:n,path:r,alt:i}=e,a=V(n,r),o;return t[0]!==i||t[1]!==a?(o=(0,j.jsx)(`div`,{className:`flex items-center justify-center h-full p-4 overflow-auto`,children:(0,j.jsx)(`img`,{src:a,alt:i,className:`max-w-full max-h-full object-contain`})}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o}function he(e){let t=(0,k.c)(2),{threadId:n,path:r}=e,i=V(n,r),a;return t[0]===i?a=t[1]:(a=(0,j.jsx)(`div`,{className:`flex items-center justify-center h-full p-4`,children:(0,j.jsx)(`video`,{src:i,controls:!0,className:`max-w-full max-h-full`})}),t[0]=i,t[1]=a),a}function H({selectedFile:e,showTreeBackButton:t=!1,onShowTree:r,onFileCreated:i}){let{resolvedTheme:s}=se(),f=ae(e=>e.selectedThreadId),{triggerExplorerRefresh:p}=oe(),m=(0,A.useRef)(null),b=(0,A.useRef)(null),T=(0,A.useRef)(!1),[E,D]=(0,A.useState)(null),[k,M]=(0,A.useState)(!1),[V,H]=(0,A.useState)(!1),[U,W]=(0,A.useState)(`edit`),[ge,_e]=(0,A.useState)(0),[G,ve]=(0,A.useState)(null),[K,q]=(0,A.useState)(!1),ye=e?.path??null;(0,A.useEffect)(()=>{f&&ie(f).then(ve).catch(()=>{})},[f]);let be=async()=>{if(!(!G||K)){q(!0);try{await navigator.clipboard.writeText(G),v({title:`Copied`,description:`Repository folder path copied to clipboard.`})}catch(e){z(`Failed to copy explorer folder path`,{threadId:f,folderPath:G},e),v({title:`Error`,description:`Failed to copy path to clipboard.`,variant:`destructive`})}finally{q(!1)}}},xe=async()=>{if(f)try{await ue(f,`.`)}catch(e){z(`Failed to open explorer repository folder`,{threadId:f,folderPath:G},e),v({title:`Error`,description:`Failed to open repository folder.`,variant:`destructive`})}},Se=(0,A.useCallback)(async e=>{if(f)try{let t=await P(f,e);await ce(f,``,t);let n={name:t,path:t,type:`file`};b.current=t,T.current=!0,i?.(n),p(),v({title:`Created`,description:`${t} created successfully.`})}catch(t){z(`Failed to create explorer file`,{threadId:f,extension:e},t),v({title:`Error`,description:`Failed to create file.`,variant:`destructive`})}},[f,i,p]),J=e?u(e.path,e.name):null,Y=e?.type===`file`&&f&&!J?e:null,X=Y?`${f}:${Y.path}:${ge}`:null,Z=E&&E.key===X?E:null,Q=Z?.content??``,Ce=Z?.original??``;(0,A.useEffect)(()=>()=>{m.current&&=(m.current.getModel()?.dispose(),m.current.dispose(),null)},[]),(0,A.useEffect)(()=>{e?.type===`file`?b.current===e.path?(b.current=null,W(`edit`)):W(F(e.path)?`view`:`edit`):W(`edit`)},[ye,f]);async function $(){if(!(!f||!e||!X)){M(!0);try{await le(f,e.path,Q),D({key:X,content:Q,original:Q}),v({title:`Saved`,description:`${e.name} saved successfully.`})}catch(t){z(`Failed to save explorer file`,{threadId:f,path:e.path},t),v({title:`Error`,description:t instanceof Error?t.message:`Failed to save file`,variant:`destructive`})}finally{M(!1)}}}async function we(){if(!(!f||!e||V)){H(!0);try{if(!re()){if(typeof window>`u`)return;let t=document.querySelector(`[data-markdown-print-content]`);if(!(t instanceof HTMLElement)){v({title:`Print unavailable`,description:`Couldn't find the markdown preview to print.`,variant:`destructive`});return}let n=`<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>${e.name??`Markdown document`}</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
color-scheme: light;
|
|
10
|
+
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
11
|
+
line-height: 1.5;
|
|
12
|
+
}
|
|
13
|
+
* {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
body {
|
|
17
|
+
margin: 0;
|
|
18
|
+
background: white;
|
|
19
|
+
color: black;
|
|
20
|
+
}
|
|
21
|
+
.markdown-print-shell {
|
|
22
|
+
max-width: 900px;
|
|
23
|
+
margin: 0 auto;
|
|
24
|
+
padding: 32px;
|
|
25
|
+
}
|
|
26
|
+
img, video, svg {
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
height: auto;
|
|
29
|
+
}
|
|
30
|
+
pre {
|
|
31
|
+
white-space: pre-wrap;
|
|
32
|
+
overflow-wrap: anywhere;
|
|
33
|
+
border: 1px solid #d4d4d8;
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
padding: 12px;
|
|
36
|
+
background: #f4f4f5;
|
|
37
|
+
}
|
|
38
|
+
code {
|
|
39
|
+
white-space: pre-wrap;
|
|
40
|
+
overflow-wrap: anywhere;
|
|
41
|
+
}
|
|
42
|
+
table {
|
|
43
|
+
width: 100%;
|
|
44
|
+
border-collapse: collapse;
|
|
45
|
+
}
|
|
46
|
+
th, td {
|
|
47
|
+
border: 1px solid #d4d4d8;
|
|
48
|
+
padding: 8px;
|
|
49
|
+
text-align: left;
|
|
50
|
+
}
|
|
51
|
+
@page {
|
|
52
|
+
margin: 0.75in;
|
|
53
|
+
}
|
|
54
|
+
@media print {
|
|
55
|
+
body {
|
|
56
|
+
-webkit-print-color-adjust: exact;
|
|
57
|
+
print-color-adjust: exact;
|
|
58
|
+
}
|
|
59
|
+
.markdown-print-shell {
|
|
60
|
+
max-width: none;
|
|
61
|
+
padding: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
65
|
+
</head>
|
|
66
|
+
<body>
|
|
67
|
+
<main class="markdown-print-shell">${t.innerHTML}</main>
|
|
68
|
+
<script>
|
|
69
|
+
window.addEventListener("load", () => {
|
|
70
|
+
window.focus();
|
|
71
|
+
window.print();
|
|
72
|
+
}, { once: true });
|
|
73
|
+
<\/script>
|
|
74
|
+
</body>
|
|
75
|
+
</html>`,r=window.open(``,`_blank`,`noopener,noreferrer`);if(!r){v({title:`Print blocked`,description:`Allow pop-ups to print this file.`,variant:`destructive`});return}r.document.open(),r.document.write(n),r.document.close();return}v({title:`PDF created`,description:`Opened ${(await fe(f,e.path)).outputPath.split(/[\\/]/).pop()??`the PDF`} in your default app.`})}catch(t){z(`Failed to print markdown file as PDF`,{threadId:f,path:e.path},t),v({title:`PDF export failed`,description:t instanceof Error?t.message:`Failed to convert this markdown file to PDF.`,variant:`destructive`})}finally{H(!1)}}}function Te(){!f||!Y||(y(L(f,Y.path)),_e(e=>e+1))}return f?(0,j.jsxs)(`div`,{className:`explorer-view-root flex flex-col h-full print:block print:h-auto`,children:[(0,j.jsxs)(de,{className:`justify-between print:hidden`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[t&&r?(0,j.jsxs)(g,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:r,children:[(0,j.jsx)(te,{className:`h-4 w-4`}),(0,j.jsx)(`span`,{className:`sr-only`,children:`Show file tree`})]}):null,(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,j.jsx)(`span`,{className:d(a.label,`truncate leading-normal text-foreground`),children:e?e.name:`Select a file to edit`}),(0,j.jsx)(`span`,{className:d(a.compact,`truncate text-muted-foreground`),children:e?e.path:`Browse and edit repository files`})]})]}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[Y&&Z?(0,j.jsxs)(j.Fragment,{children:[F(Y.path)&&U===`view`?(0,j.jsxs)(g,{size:`sm`,variant:`outline`,onClick:()=>void we(),disabled:V,children:[V?(0,j.jsx)(h,{className:`h-4 w-4 animate-spin`}):(0,j.jsx)(n,{className:`h-4 w-4`}),V?`Printing…`:`Print`]}):null,F(Y.path)?(0,j.jsxs)(`div`,{className:`flex rounded-full border border-input bg-background p-0.5`,children:[(0,j.jsx)(g,{size:`sm`,variant:U===`view`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>W(`view`),children:`View`}),(0,j.jsx)(g,{size:`sm`,variant:U===`edit`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>W(`edit`),children:`Edit`})]}):null,(0,j.jsxs)(g,{size:`sm`,onClick:()=>void $(),disabled:k||!Q||Q===Ce,children:[k?(0,j.jsx)(h,{className:`h-4 w-4 animate-spin`}):null,`Save`]})]}):null,e?null:(0,j.jsxs)(w,{children:[(0,j.jsx)(C,{asChild:!0,children:(0,j.jsxs)(g,{size:`sm`,className:`gap-1.5`,children:[(0,j.jsx)(l,{className:`h-3.5 w-3.5`}),`New file`]})}),(0,j.jsx)(pe,{align:`end`,children:N.map(({label:e,ext:t,icon:n})=>(0,j.jsxs)(x,{onSelect:()=>void Se(t),children:[(0,j.jsx)(n,{className:`h-4 w-4`}),e]},t))})]})]})]}),(0,j.jsx)(`div`,{className:`flex-1 overflow-hidden print:overflow-visible print:flex-none`,children:(0,j.jsx)(`div`,{className:`h-full relative overflow-hidden print:h-auto print:overflow-visible`,children:Y?(0,j.jsxs)(O,{fallbackTitle:`Failed to load file`,onRetry:Te,children:[(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(_,{}),children:(0,j.jsx)(R,{threadId:f,path:Y.path,contentKey:X??``,onContentReady:D},X??void 0)}),Z?F(Y.path)&&U===`view`?(0,j.jsx)(`div`,{className:`h-full overflow-auto p-6 print:h-auto print:overflow-visible print:p-0`,children:(0,j.jsx)(`div`,{className:`mx-auto max-w-4xl print:max-w-none`,"data-markdown-print-content":!0,children:(0,j.jsx)(S,{content:Q,enableMermaid:!0})})}):(0,j.jsx)(ne,{height:`100%`,language:I(Y.path),value:Q,onChange:e=>D(t=>t&&{...t,content:e??``}),onMount:e=>{m.current=e,T.current&&(T.current=!1,e.focus())},theme:s===`dark`?`vs-dark`:`vs-light`,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,automaticLayout:!0,fontSize:14,lineNumbers:`on`,renderLineHighlight:`line`,scrollbar:{vertical:`auto`,horizontal:`auto`}}}):(0,j.jsx)(_,{})]},X??void 0):e?.type===`file`&&J===`image`?(0,j.jsx)(O,{fallbackTitle:`Failed to load image`,onRetry:()=>{!f||!e||y(B(f,e.path))},children:(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(_,{}),children:(0,j.jsx)(me,{threadId:f,path:e.path,alt:e.name})})},e.path):e?.type===`file`&&J===`video`?(0,j.jsx)(O,{fallbackTitle:`Failed to load video`,onRetry:()=>{!f||!e||y(B(f,e.path))},children:(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(_,{}),children:(0,j.jsx)(he,{threadId:f,path:e.path})})},e.path):(0,j.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center p-8`,children:[(0,j.jsx)(`h2`,{className:d(a.pageTitle,`text-foreground`),children:`File Explorer`}),(0,j.jsx)(`p`,{className:d(a.pageSubtitle),children:`Browse and edit files`})]})})}),e?null:(0,j.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 px-4 py-2`,children:G?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,onClick:()=>void xe(),className:d(a.compact,`min-w-0 flex-1 truncate text-left font-mono text-muted-foreground hover:text-foreground hover:underline`),title:G,children:G}),(0,j.jsxs)(g,{variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0`,onClick:()=>void be(),disabled:K,children:[K?(0,j.jsx)(o,{className:`h-3.5 w-3.5`}):(0,j.jsx)(ee,{className:`h-3.5 w-3.5`}),(0,j.jsx)(`span`,{className:`sr-only`,children:`Copy path`})]})]}):(0,j.jsx)(`p`,{className:d(a.compact,`text-muted-foreground/50 italic`),children:`Loading path...`})})]}):(0,j.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center`,children:[(0,j.jsx)(c,{className:`h-8 w-8 text-muted-foreground`}),(0,j.jsx)(`p`,{className:a.bodyMuted,children:`Select a thread to browse its files`})]})}export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Di as e,Oi as t,Rr as n,i as r,yt as i}from"./interactive-BrHVRHmQ.js";import{A as a,D as o,Eo as s,O as c,T as l,j as u,k as d}from"./onboarding-DVc9-yKJ.js";var f=t(),p=e();function m(e){let t=(0,f.c)(28),{open:m,onOpenChange:g,commits:_,displayedCommits:v,isLoadingMore:y,onScroll:b,currentBranch:x}=e,S;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,p.jsx)(u,{children:`Commit History`}),t[0]=S):S=t[0];let C;t[1]===x?C=t[2]:(C=(0,p.jsxs)(a,{children:[S,(0,p.jsxs)(c,{children:[`Recent commits on branch `,x]})]}),t[1]=x,t[2]=C);let w;t[3]===v?w=t[4]:(w=v.length>0?v.map(h):(0,p.jsx)(`p`,{className:r(n.bodyMuted,`text-center py-8`),children:`No commits found`}),t[3]=v,t[4]=w);let T;t[5]===y?T=t[6]:(T=y&&(0,p.jsx)(`div`,{className:`p-3 text-center`,children:(0,p.jsx)(i,{className:`h-4 w-4 animate-spin inline`})}),t[5]=y,t[6]=T);let E;t[7]!==_.length||t[8]!==v.length||t[9]!==y?(E=v.length<_.length&&!y&&(0,p.jsx)(`div`,{className:r(n.caption,`p-3 text-center`),children:`Scroll to load more`}),t[7]=_.length,t[8]=v.length,t[9]=y,t[10]=E):E=t[10];let D;t[11]!==w||t[12]!==T||t[13]!==E?(D=(0,p.jsxs)(`div`,{className:`divide-y`,children:[w,T,E]}),t[11]=w,t[12]=T,t[13]=E,t[14]=D):D=t[14];let O;t[15]!==b||t[16]!==D?(O=(0,p.jsx)(`div`,{className:`flex-1 overflow-y-auto border rounded-lg`,onScroll:b,children:D}),t[15]=b,t[16]=D,t[17]=O):O=t[17];let k;t[18]===g?k=t[19]:(k=(0,p.jsx)(d,{children:(0,p.jsx)(s,{onClick:()=>g(!1),children:`Close`})}),t[18]=g,t[19]=k);let A;t[20]!==C||t[21]!==O||t[22]!==k?(A=(0,p.jsxs)(o,{className:`max-w-2xl max-h-[80vh] flex flex-col`,children:[C,O,k]}),t[20]=C,t[21]=O,t[22]=k,t[23]=A):A=t[23];let j;return t[24]!==g||t[25]!==m||t[26]!==A?(j=(0,p.jsx)(l,{open:m,onOpenChange:g,children:A}),t[24]=g,t[25]=m,t[26]=A,t[27]=j):j=t[27],j}function h(e){return(0,p.jsxs)(`div`,{className:`p-3 hover:bg-muted/50 transition-colors`,children:[(0,p.jsx)(`p`,{className:r(n.label,`break-words`),children:e.message}),(0,p.jsxs)(`p`,{className:r(n.bodyMuted,`mt-1`),children:[(0,p.jsx)(`span`,{className:n.mono,children:e.hash.substring(0,7)}),` •`,` `,e.author,` • `,new Date(e.date).toLocaleDateString()]})]},e.hash)}export{m as GitHistoryDialog};
|