dorkos 0.76.0 → 0.81.0
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/bin/cli.js +5849 -2662
- package/dist/client/assets/{AboutPage-BoqHP_rW.js → AboutPage-CG2PlGB9.js} +1 -1
- package/dist/client/assets/{AppearancePage-B95H8Nxj.js → AppearancePage-uc6vrPjQ.js} +1 -1
- package/dist/client/assets/BaseTanStackRouterDevtoolsPanel-B-iktbLX-CZ9OxU7F.js +539 -0
- package/dist/client/assets/{BlintzCanvas-CRXCmtua.js → BlintzCanvas-C0dWt42q.js} +82 -82
- package/dist/client/assets/{CanvasCsvContent-pdVBTYKX.js → CanvasCsvContent-DpTj502y.js} +1 -1
- package/dist/client/assets/{CanvasFileContent-Cl03ayCc.js → CanvasFileContent-BfbMK0ME.js} +2 -2
- package/dist/client/assets/{CanvasModel3dContent-C3g0j2bn.js → CanvasModel3dContent-BjkWZBVq.js} +2 -2
- package/dist/client/assets/{CodeMirrorDiff-BQLLfs4g.js → CodeMirrorDiff-BtkeZDXX.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BSvvxSHw.js → CodeMirrorEditor-C2mjcn0M.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-aPcsWZg1.js → ConnectionAccessLists-CrvGcp6D.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-BvzkayxV.js → ConnectionsPage-C2q7w1vY.js} +1 -1
- package/dist/client/assets/{ConventionPage-Y7bDPPze.js → ConventionPage-CGoZt1nC.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CNROBv9F-wx_-3fZ2.js → FloatingTanStackRouterDevtools-CqogiFob-Dl7G5M5j.js} +1 -1
- package/dist/client/assets/HandlePage-DbVA5ABk.js +1 -0
- package/dist/client/assets/LexicalField-CCu1Ihg3.js +24 -0
- package/dist/client/assets/{ManagesPage--n7TgT9l.js → ManagesPage-c1KIJkFC.js} +1 -1
- package/dist/client/assets/{Model3dViewer-uKAbOmCS.js → Model3dViewer-BO0fwX9g.js} +1 -1
- package/dist/client/assets/NamePage-Cvksm2Vr.js +1 -0
- package/dist/client/assets/{NotificationsPage-DB4qTW3T.js → NotificationsPage-BVSSDb9i.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-DT20V6CQ.js → PersonalityPopover-CI9kf81k.js} +1 -1
- package/dist/client/assets/PhotoPage-DOvne6fS.js +1 -0
- package/dist/client/assets/{RoomsPage-DEEUnf0J.js → RoomsPage-B7s1XM1i.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-D2pucfeO.js → RunsOnPopover-LTrQIz4S.js} +1 -1
- package/dist/client/assets/{SessionsPage-DBPX5adt.js → SessionsPage-FLHcXJLg.js} +2 -2
- package/dist/client/assets/{SkillsPage-C9HXskYL.js → SkillsPage-loa1-bcL.js} +1 -1
- package/dist/client/assets/{TasksPage-Dqf9owXs.js → TasksPage-CjTt9J5n.js} +1 -1
- package/dist/client/assets/{ToolsPage-DaoSMDQU.js → ToolsPage-DMnjLq2L.js} +2 -2
- package/dist/client/assets/{TopologyGraph-DF6kFfjI.js → TopologyGraph-CRAGEuPI.js} +1 -1
- package/dist/client/assets/{agent-browser-BuaZOCOm.js → agent-browser-DH-qe6tt.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-B1wBbLs7.js → highlighted-body-KPVGNVTW-CKyNuC2a.js} +1 -1
- package/dist/client/assets/{index-DumYh9rX.js → index-0R0NT72V.js} +1 -1
- package/dist/client/assets/{index-D2XIUtpU.js → index-37p1_k_N.js} +1 -1
- package/dist/client/assets/{index-D3g04gH1.js → index-9FBdK--F.js} +1 -1
- package/dist/client/assets/{index-BNTWz-au.js → index-B0rpOocp.js} +1 -1
- package/dist/client/assets/{index-CShzpSy7.js → index-BGLRcYYE.js} +1 -1
- package/dist/client/assets/{index--Uyc_XG6.js → index-BHz_iLMm.js} +9 -9
- package/dist/client/assets/{index-CA4kPvkQ.js → index-BL-LFVsO.js} +1 -1
- package/dist/client/assets/{index-DD2mSWO0.js → index-BPl8DTOI.js} +1 -1
- package/dist/client/assets/{index-MMjhiA-J.js → index-BVkt7309.js} +1 -1
- package/dist/client/assets/{index-2HT5vouX.js → index-BaITIF12.js} +1 -1
- package/dist/client/assets/{index-ByjBP7eT.js → index-BhMgFrop.js} +1 -1
- package/dist/client/assets/{index-BvU5XdA6.js → index-BmHCO7JA.js} +1 -1
- package/dist/client/assets/{index-VeV-4NUe.js → index-Bq1ocT_z.js} +1 -1
- package/dist/client/assets/{index-DaFsjYfq.js → index-C6itZC0I.js} +1 -1
- package/dist/client/assets/{index-C3EW9tRL.js → index-CCa_zFfO.js} +1 -1
- package/dist/client/assets/{index-BeBR9uSg.js → index-CGYDEGb1.js} +1 -1
- package/dist/client/assets/{index-DRYYCdpC.js → index-CPiL-M1V.js} +1 -1
- package/dist/client/assets/{index-B6jQgG8Q.js → index-CT4uhPjz.js} +1 -1
- package/dist/client/assets/{index-WVQrRVpj.js → index-CWuLOWsu.js} +2 -2
- package/dist/client/assets/{index-C7Uur-_Y.js → index-C_H8Na06.js} +3 -3
- package/dist/client/assets/{index-BIs_UKpi.js → index-CgTvuqsz.js} +1 -1
- package/dist/client/assets/{index-BHQYCx1L.js → index-Cn5LkLHK.js} +1 -1
- package/dist/client/assets/{index-DwUKcf_k.js → index-CoJiX2o7.js} +1 -1
- package/dist/client/assets/{index-BvT0F_8s.js → index-Criu5f4m.js} +1 -1
- package/dist/client/assets/{index-do5L767D.js → index-CugRpUpy.js} +1 -1
- package/dist/client/assets/{index-CwYrgtmx.js → index-D-nXANER.js} +1 -1
- package/dist/client/assets/{index-B2Ye-nkG.js → index-D2P8UWWS.js} +1 -1
- package/dist/client/assets/{index-DEAVZK-q.js → index-DBsoxmLK.js} +1 -1
- package/dist/client/assets/{index-Bxcqjip5.js → index-DN2SO8dj.js} +1 -1
- package/dist/client/assets/{index-CN4hFvoG.js → index-DRBI-tjH.js} +1 -1
- package/dist/client/assets/{index-Cg0bm_ag.js → index-DyAjYNxU.js} +414 -414
- package/dist/client/assets/{index-IErk5ecA.js → index-O1R1Ir-o.js} +1 -1
- package/dist/client/assets/{index-CpCRZ8P5.js → index-UTvS0wz6.js} +1 -1
- package/dist/client/assets/{index-BMsvIr1C.js → index-Z0979U-2.js} +1 -1
- package/dist/client/assets/{index-BImpyKDK.js → index-_r_3OCOV.js} +1 -1
- package/dist/client/assets/{index-B_p4CrFG.js → index-hnccffr-.js} +1 -1
- package/dist/client/assets/{room-files-source-BrzosNI0.js → room-files-source-BmK7_zzB.js} +2 -2
- package/dist/client/assets/{soul-file-CMitSV0e.js → soul-file-0ee-EflV.js} +1 -1
- package/dist/client/assets/{use-mesh-update-MH2NsGx-.js → use-mesh-update-D1KVLTOA.js} +1 -1
- package/dist/client/assets/{use-personality-commit-BHO7hV2D.js → use-personality-commit-KFutjy9j.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/index.js +7642 -10600
- package/dist/server/index.js.map +2 -2
- package/package.json +8 -6
- package/dist/client/assets/BaseTanStackRouterDevtoolsPanel-fP2H3uLR-DivgCeAN.js +0 -539
- package/dist/client/assets/HandlePage-BeHlZs_e.js +0 -1
- package/dist/client/assets/LexicalField-B3z9B3Jc.js +0 -24
- package/dist/client/assets/NamePage-Bh6_6TMn.js +0 -1
- package/dist/client/assets/PhotoPage-B3qZqkg9.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e0 as we,fX as re,aV as W,ec as le,w as B,r as l,fY as ke,fZ as z,f_ as H,f$ as S,e5 as oe,g0 as J,g1 as Q,cS as Ee,g2 as Re,bv as je,g3 as Ne,x as V,g4 as Te,g5 as De,et as Se,g6 as Oe,ac as se,g7 as Fe,j as t,aA as ce,ah as de,aM as _e,C as Pe,g8 as Me,d7 as ue,g9 as Ae,fa as he,ff as Le,ag as ae,ga as fe,gb as pe,gc as Ie,eB as ze,eC as Ke,eD as He,eE as K,eF as q,dl as $e,B as Y,dC as Ye,dD as Ue,dE as Be,dF as Qe,dG as qe,dH as We,dI as Ge,dJ as Ve,fl as Xe,gd as Ze,ae as X,ge as me,gf as Je,aU as et,gg as tt,gh as nt,gi as st,gj as at,eb as ee,gk as xe,y as rt,aK as ot,gl as it,gm as lt}from"./index-DyAjYNxU.js";import{p as ct,F as dt,w as ut,c as ht}from"./room-files-source-BmK7_zzB.js";import{N as Xt,R as Zt}from"./room-files-source-BmK7_zzB.js";/**
|
|
2
2
|
* @license lucide-react v1.44.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ge={name:"file-plus",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]};ge.node;const ht=we(ge),pt=[".git",".dork",".claude",".agents","node_modules"];function xt(e){return e.startsWith(".")||pt.includes(e)}const te=["ROOM.md","README.md"];function ne(e){return te.some(s=>s.toLowerCase()===e.toLowerCase())}function mt(e){return e.filter(s=>!xt(s.name))}function gt(e){if(e.reduce((p,m)=>m.type==="file"&&ne(m.name)?p+1:p,0)===0)return e;const n=[],x=[];for(const p of e)p.type==="file"&&ne(p.name)?n.push(p):x.push(p);return n.sort((p,m)=>te.findIndex(f=>f.toLowerCase()===p.name.toLowerCase())-te.findIndex(f=>f.toLowerCase()===m.name.toLowerCase())),[...n,...x]}function G(e,s,n){return["file-explorer","tree",e.scopeKey,s,e.filtersHidden?n:null]}function ye(e,s,n,x){return{queryKey:G(e,s,n),queryFn:()=>e.list(s,{showHidden:n}),staleTime:re.FILE_TREE_STALE_TIME_MS,gcTime:re.FILE_TREE_GC_TIME_MS,placeholderData:p=>p??x.getQueryData(G(e,s,!n))}}const yt=["CONFLICT","COPY_INTO_SELF","DIR_NOT_EMPTY","NOT_FOUND","REFUSE_ROOT","OUTSIDE_BOUNDARY"];function ve(e){const s=le(e);return s!==void 0&&yt.includes(s)?s:void 0}const Ce="Can’t copy a folder into itself",vt={CONFLICT:"That name already exists",COPY_INTO_SELF:Ce,DIR_NOT_EMPTY:"This folder isn’t empty",NOT_FOUND:"That item no longer exists",REFUSE_ROOT:"Can’t modify the working directory root",OUTSIDE_BOUNDARY:"That path is outside the working directory"};function $(e,s){const n=ve(e);W.error(n?vt[n]:s)}const Ct=/ copy(?: \d+)?$/;function bt({name:e,isDir:s,taken:n}){const x=new Set(n);if(!x.has(e))return e;const p=s?-1:e.lastIndexOf("."),m=p>0,f=m?e.slice(p):"",a=(m?e.slice(0,p):e).replace(Ct,"");for(let h=1;;h+=1){const v=h===1?`${a} copy${f}`:`${a} copy ${h}${f}`;if(!x.has(v))return v}}function ie(e,s,n){return{name:s,path:e,type:n,size:0,mtime:Date.now(),isSymlink:!1}}function wt(e){const s=Q(),{source:n,showHidden:x,queryClient:p,inFlightRef:m}=e,f=n.cwd??"",[a,h]=l.useState(null),v=l.useCallback(async r=>{m.current+=1;try{return await r()}finally{m.current-=1}},[m]),i=l.useMemo(()=>{const r=d=>G(n,d,x);return{getChildren:d=>{var g;return((g=p.getQueryData(r(d)))==null?void 0:g.entries)??[]},isLoaded:d=>p.getQueryData(r(d))!==void 0,takenNames:async d=>(await s.readFileTree(f,{path:d===z?void 0:d,showHidden:!0})).entries.map(C=>C.name),snapshot:d=>p.getQueryData(r(d)),setChildren:(d,g)=>{p.setQueryData(r(d),C=>({entries:ke(g((C==null?void 0:C.entries)??[]))}))},restore:(d,g)=>{p.setQueryData(r(d),g)},invalidate:d=>{p.invalidateQueries({queryKey:r(d),exact:!0})}}},[p,s,f,n,x]),E=l.useCallback((r,d,g)=>v(async()=>{const C=U(r,d),w=!i.getChildren(r).some(y=>y.path===C),j=i.snapshot(r);w&&i.setChildren(r,y=>[...y,ie(C,d,g)]);try{return await s.createEntry(f,C,g),!0}catch(y){return w&&i.restore(r,j),$(y,`Couldn’t create ${g==="dir"?"folder":"file"}`),!1}finally{i.invalidate(r)}}),[s,f,i,v]),T=l.useCallback((r,d)=>v(async()=>{if(d===r.name||d.length===0)return!0;const g=H(r.path),C=U(g,d),w=i.getChildren(g).some(N=>N.path===C),j=i.snapshot(g),y={...r,name:d,path:C};w||i.setChildren(g,N=>N.map(A=>A.path===r.path?y:A));try{return await s.renameEntry(f,r.path,C),S.getState().remapExpandedPaths(r.path,C),!0}catch(N){return w||i.restore(g,j),$(N,"Couldn’t rename"),!1}finally{i.invalidate(g)}}),[s,f,i,v]),b=l.useCallback(r=>v(async()=>{const d=H(r.path),g=i.snapshot(d);i.setChildren(d,C=>C.filter(w=>w.path!==r.path));try{await s.deleteEntry(f,r.path,{recursive:!0}),S.getState().dropExpandedPaths(r.path)}catch(C){i.restore(d,g),$(C,"Couldn’t delete")}finally{i.invalidate(d)}}),[s,f,i,v]),M=l.useCallback(r=>v(async()=>{const d=H(r.path);if(r.type==="file"){const g=i.snapshot(d);i.setChildren(d,C=>C.filter(w=>w.path!==r.path));try{await s.deleteEntry(f,r.path),S.getState().dropExpandedPaths(r.path)}catch(C){i.restore(d,g),$(C,"Couldn’t delete")}finally{i.invalidate(d)}return}try{await s.deleteEntry(f,r.path),i.setChildren(d,g=>g.filter(C=>C.path!==r.path)),S.getState().dropExpandedPaths(r.path),i.invalidate(d)}catch(g){if(ve(g)==="DIR_NOT_EMPTY"){h(r);return}$(g,"Couldn’t delete")}}),[s,f,i,v]),_=l.useCallback(async()=>{const r=a;h(null),r&&await b(r)},[a,b]),O=l.useCallback(()=>h(null),[]),P=l.useCallback((r,d)=>v(async()=>{const g=H(r),C=oe(r),w=U(d,C);if(d===g||w===r||J(d,r))return;const j=i.getChildren(g).find(c=>c.path===r);if(!j)return;const y=i.isLoaded(d),N=y&&i.getChildren(d).some(c=>c.path===w),A={...j,name:C,path:w},u=i.snapshot(g),o=y?i.snapshot(d):void 0;i.setChildren(g,c=>c.filter(k=>k.path!==r)),y&&!N&&i.setChildren(d,c=>[...c,A]);try{await s.renameEntry(f,r,w),S.getState().remapExpandedPaths(r,w)}catch(c){i.restore(g,u),y&&!N&&i.restore(d,o),$(c,"Couldn’t move")}finally{i.invalidate(g),y&&i.invalidate(d)}}),[s,f,i,v]),R=l.useCallback((r,d)=>v(async()=>{if(r.isDir&&J(d,r.path)){W.error(Ce);return}let g;try{g=await i.takenNames(d)}catch(N){$(N,"Couldn’t copy");return}const C=bt({name:oe(r.path),isDir:r.isDir,taken:g}),w=U(d,C),j=i.isLoaded(d),y=j?i.snapshot(d):void 0;if(j){const N=i.getChildren(H(r.path)).find(u=>u.path===r.path),A=N?{...N,name:C,path:w}:ie(w,C,r.isDir?"dir":"file");i.setChildren(d,u=>[...u,A])}try{await s.copyEntry(f,r.path,w)}catch(N){j&&i.restore(d,y),$(N,"Couldn’t copy")}finally{i.invalidate(d)}}),[s,f,i,v]);return{createEntry:E,renameEntry:T,removeEntry:M,moveEntry:P,copyEntry:R,pendingRecursiveDelete:a,confirmRecursiveDelete:_,cancelRecursiveDelete:O}}function kt(e){return e!=null&&e.startsWith("darwin")?"Reveal in Finder":e!=null&&e.startsWith("win32")?"Reveal in File Explorer":"Show in File Manager"}function Et(e,s){const n=e.includes("\\")&&!e.includes("/"),x=e.replace(/[\\/]+$/,""),p=n?s.split("/").join("\\"):s;return`${x}${n?"\\":"/"}${p}`}function Rt(e){const s=Q(),{data:n}=Ee(),x=l.useMemo(()=>s.supportsReveal?kt(n==null?void 0:n.platform):null,[s.supportsReveal,n==null?void 0:n.platform]),p=l.useCallback(async v=>{if(e)try{await s.revealEntry(e,v.path)}catch(i){$(i,"Couldn’t open the file manager")}},[s,e]),{copy:m}=Re(),f=l.useCallback(async(v,i)=>{const E=i==="absolute"&&e?Et(e,v.path):v.path;await m(E)||W.error("Couldn’t copy to the clipboard")},[e,m]),a=l.useCallback(v=>{je(Ne(v.path))||W.error("Open a chat first to add a file to it")},[]),h=l.useCallback(v=>{S.getState().setClipboard({path:v.path,isDir:v.type==="dir"});try{navigator.clipboard.writeText(v.path).catch(()=>{})}catch{}},[]);return{revealLabel:x,reveal:p,copyPath:f,addToChat:a,copyToClipboard:h}}const jt={scopeKey:"",cwd:null,writable:!1,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list:()=>Promise.resolve({entries:[]})};function Nt(e){var u,o;const s=Q(),n=V(),{setTheme:x}=Te(),p=S(c=>c.showHidden),m=S(c=>c.expanded),f=S(c=>c.loadExplorerForCwd),a=S(c=>c.pruneMissing),h=(e==null?void 0:e.scopeKey)??null,v=(e==null?void 0:e.cwd)??null;l.useEffect(()=>{f(h)},[h,f]);const i=l.useMemo(()=>[z,...De(m)],[m]),E=Se({queries:e?i.map(c=>ye(e,c,p,n)):[]}),T=(e==null?void 0:e.filtersHidden)??!0,b=l.useMemo(()=>{const c={};return i.forEach((k,F)=>{var B;const L=E[F];let I=((B=L==null?void 0:L.data)==null?void 0:B.entries)??[];!p&&!T&&(I=mt(I)),k===z&&(I=gt(I)),c[k]={entries:I,loading:(L==null?void 0:L.isLoading)??!1,error:(L==null?void 0:L.isError)??!1}}),c},[i,E,p,T]),M=l.useRef(0),_=l.useRef({});l.useEffect(()=>{M.current>0||i.forEach((c,k)=>{var L,I,B;const F=(I=(L=E[k])==null?void 0:L.data)==null?void 0:I.entries;!F||(B=E[k])!=null&&B.isError||_.current[c]!==F&&(_.current[c]=F,a(c,F.map(D=>D.name)))})},[i,E,a]);const O=l.useMemo(()=>Oe(m,b),[m,b]),P=!!e&&!!((u=b[z])!=null&&u.loading),R=!!e&&!!((o=b[z])!=null&&o.error),r=l.useMemo(()=>{var k;const c=new Set;for(const F of i)F!==z&&((k=b[F])!=null&&k.error)&&c.add(F);return c},[i,b]),d=l.useCallback(c=>{if(c.type!=="dir")return;const k=S.getState();k.setDirExpanded(c.path,!k.expanded[c.path])},[]),g=l.useCallback(c=>{if(c===z)return;const k=S.getState();k.expanded[c]||k.setDirExpanded(c,!0)},[]),C=(e==null?void 0:e.preview)==="canvas",w=l.useCallback(c=>{if(c.type!=="file"||!C)return;const k={getStore:se.getState,setTheme:x,supportsTerminal:s.supportsTerminal};Fe(k,{action:"open_file",sourcePath:c.path},"user")},[C,x,s]),j=l.useCallback(()=>{h!==null&&n.invalidateQueries({queryKey:["file-explorer","tree",h]})},[n,h]),y=l.useCallback(c=>{e!==null&&n.invalidateQueries({queryKey:G(e,c,p),exact:!0})},[n,e,p]);l.useEffect(()=>{if(e!=null&&e.events)return e.events(j)},[e,j]);const N=wt({source:e??jt,showHidden:p,queryClient:n,inFlightRef:M}),A=Rt(v);return{rows:O,rootLoading:P,rootError:R,errorPaths:r,toggleExpand:d,ensureExpanded:g,openFile:w,reload:j,retryDir:y,...N,...A}}function Tt(e){const{transport:s,cwd:n}=e;return{scopeKey:n,cwd:n,writable:!0,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list(x,p){return s.readFileTree(n,{path:x===""?void 0:x,showHidden:p.showHidden})}}}const Dt=12;function St({row:e,selected:s,renaming:n,error:x,onSelect:p,onActivate:m,onRetry:f,onSubmitRename:a,onCancelRename:h,onNewFile:v,onNewFolder:i,onStartRename:E,onDelete:T,onMove:b,onCopyInto:M,onCopy:_,onPaste:O,onDuplicate:P,canPasteInto:R,revealLabel:r,onReveal:d,onAddToChat:g,onCopyPath:C,readOnly:w=!1,provenance:j=!1}){const{entry:y,depth:N,expanded:A,loading:u}=e,o=y.type==="dir",c=o?y.path:H(y.path),[k,F]=l.useState(!1),L=!o&&N===0&&ne(y.name),I=ct(y.lastCommit),B=t.jsxs("div",{role:"treeitem","aria-label":y.name,"aria-expanded":o?A:void 0,"aria-selected":s,tabIndex:-1,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),p(y),m(y))},draggable:!n&&!w,onDragStart:D=>{w||(D.dataTransfer.setData("text/plain",y.path),D.dataTransfer.setData(Ie,y.path),D.dataTransfer.effectAllowed="copyMove")},onDragOver:D=>{D.stopPropagation(),!(w||!o||!pe(D.dataTransfer.types))&&(D.preventDefault(),D.dataTransfer.dropEffect=D.altKey?"copy":"move",F(!0))},onDragLeave:()=>F(!1),onDrop:D=>{if(D.stopPropagation(),w||!o)return;F(!1);const Z=he(D.dataTransfer);Z!==null&&(D.preventDefault(),D.altKey?M(Z,y.path):b(Z,y.path))},onClick:()=>{p(y),m(y)},className:ae("flex w-full cursor-pointer items-center gap-1 py-1 pr-2 text-sm transition-colors",s?"bg-accent text-foreground":"hover:bg-accent/50",k&&"ring-ring/60 bg-accent ring-1"),style:{paddingLeft:N*Dt+8},children:[t.jsx("span",{className:"flex size-4 flex-shrink-0 items-center justify-center",children:o&&(u?t.jsx(ce,{size:"xs",className:"text-muted-foreground"}):x?t.jsx("button",{type:"button","aria-label":"Retry loading",title:"Couldn’t load. Retry",onClick:D=>{D.stopPropagation(),f()},className:"flex items-center justify-center",children:t.jsx(de,{className:"text-destructive size-3.5"})}):A?t.jsx(_e,{className:"text-muted-foreground size-3.5"}):t.jsx(Pe,{className:"text-muted-foreground size-3.5"}))}),o?A?t.jsx(Me,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):t.jsx(ue,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):y.isSymlink===!0?t.jsx(Ae,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}):t.jsx(fe,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),n?t.jsx(Ot,{initialName:y.name,onSubmit:D=>a(y,D),onCancel:h}):t.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.name}),L&&!n&&t.jsx(Le,{"aria-label":"Pinned to the top",className:"text-muted-foreground/60 size-3 flex-shrink-0"}),j&&!n&&t.jsx("span",{className:"text-muted-foreground/70 text-2xs max-w-[45%] flex-shrink-0 truncate tabular-nums",title:I.title??void 0,children:I.label})]});return w?B:t.jsxs(ze,{children:[t.jsx(Ke,{asChild:!0,children:B}),t.jsxs(He,{className:"w-52",children:[t.jsx(K,{onClick:()=>v(c),children:"New file"}),t.jsx(K,{onClick:()=>i(c),children:"New folder"}),t.jsx(q,{}),r&&t.jsx(K,{onClick:()=>d(y),children:r}),t.jsx(K,{movesFocus:!0,onClick:()=>g(y),children:"Add to chat"}),t.jsx(q,{}),t.jsx(K,{onClick:()=>_(y),children:"Copy"}),t.jsx(K,{disabled:!R(c),onClick:()=>O(c),children:"Paste"}),t.jsx(K,{onClick:()=>P(y),children:"Duplicate"}),t.jsx(q,{}),t.jsx(K,{onClick:()=>C(y,"absolute"),children:"Copy path"}),t.jsx(K,{onClick:()=>C(y,"relative"),children:"Copy relative path"}),t.jsx(q,{}),t.jsx(K,{onClick:()=>E(y),children:"Rename"}),t.jsx(K,{variant:"destructive",onClick:()=>T(y),children:"Delete"})]})]})}function Ot({initialName:e,onSubmit:s,onCancel:n}){const x=l.useRef(null),[p,m]=l.useState(e);l.useEffect(()=>{const a=x.current;if(!a)return;a.focus();const h=e.lastIndexOf(".");a.setSelectionRange(0,h>0?h:e.length)},[e]);const f=()=>{const a=p.trim();a&&a!==e?s(a):n()};return t.jsx("input",{ref:x,type:"text",value:p,"aria-label":"New name",onChange:a=>m(a.target.value),onClick:a=>a.stopPropagation(),onBlur:f,onKeyDown:a=>{a.key==="Enter"?f():a.key==="Escape"&&n()},className:"border-border bg-background min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})}const Ft=100,_t=28,Pt=250;function Mt(e){const{rows:s,selectedPath:n,renamingPath:x,errorPaths:p,onSelectPath:m,onRetryDir:f}=e,a=l.useRef(null),h=S(o=>o.setScrollTop),v=S(o=>o.scopeKey),i=l.useCallback(o=>o.type==="dir"?e.onToggle(o):e.onOpen(o),[e]),E=Lt(e,i),T=s.length>Ft,b=$e({count:s.length,getScrollElement:()=>a.current,estimateSize:()=>_t,overscan:12,enabled:T}),M=l.useRef({scope:void 0,done:!1}),_=l.useRef(null);l.useLayoutEffect(()=>{const o=M.current;if(o.scope!==v&&(o.scope=v,o.done=!1),o.done||s.length===0)return;const c=a.current;if(!c)return;const k=S.getState().scrollTop;if(k<=0){o.done=!0;return}T?b.scrollToOffset(k):c.scrollTop=k,_.current=c.scrollTop,c.scrollTop>=k&&(o.done=!0)},[s.length,v,T,b]);const O=l.useRef(null),P=l.useRef(null),R=l.useCallback(()=>{const o=a.current;o&&o.scrollTop!==_.current&&(M.current.done=!0,O.current=o.scrollTop,P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{P.current=null,O.current!==null&&h(O.current)},Pt))},[h]);l.useEffect(()=>()=>{P.current&&clearTimeout(P.current),O.current!==null&&h(O.current)},[h]);const r=l.useRef(void 0);l.useEffect(()=>{var F,L;const o=r.current;if(r.current=n,o===void 0||n===o||n===null)return;const c=s.findIndex(I=>I.entry.path===n);if(c<0)return;const k=a.current;k&&(T?b.scrollToIndex(c,{align:"auto"}):(L=(F=k.querySelector(`[data-row-index="${c}"]`))==null?void 0:F.scrollIntoView)==null||L.call(F,{block:"nearest"}),_.current=k.scrollTop)},[n,s,T,b]);const[d,g]=l.useState(!1),{onCopyInto:C,onMove:w}=e,j=e.readOnly===!0,y=l.useCallback(o=>{j||!pe(o.dataTransfer.types)||(o.preventDefault(),o.dataTransfer.dropEffect=o.altKey?"copy":"move",g(!0))},[j]),N=l.useCallback((o,c)=>{const k=s.find(F=>F.entry.path===o);k&&C({path:o,isDir:k.entry.type==="dir"},c)},[s,C]),A=l.useCallback(o=>{if(g(!1),j)return;const c=he(o.dataTransfer);c!==null&&(o.preventDefault(),o.altKey?N(c,z):w(c,z))},[N,w,j]),u=o=>t.jsx(St,{row:o,selected:o.entry.path===n,renaming:o.entry.path===x,error:o.entry.type==="dir"&&o.expanded&&p.has(o.entry.path),onSelect:c=>m(c.path),onActivate:i,onRetry:()=>f(o.entry.path),onSubmitRename:e.onSubmitRename,onCancelRename:e.onCancelRename,onStartRename:e.onStartRename,onNewFile:e.onNewFile,onNewFolder:e.onNewFolder,onDelete:e.onDelete,onMove:e.onMove,onCopyInto:N,onCopy:e.onCopy,onPaste:e.onPaste,onDuplicate:e.onDuplicate,canPasteInto:e.canPasteInto,revealLabel:e.revealLabel,onReveal:e.onReveal,onAddToChat:e.onAddToChat,onCopyPath:e.onCopyPath,readOnly:e.readOnly,provenance:e.provenance});return t.jsx("div",{ref:a,role:"tree","aria-label":"File explorer",tabIndex:0,onKeyDown:E,onScroll:R,onDragOver:y,onDragLeave:()=>g(!1),onDrop:A,className:ae("focus-visible:ring-ring/40 h-full overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-inset",d&&"ring-ring/60 bg-accent/30 ring-1 ring-inset"),children:T?t.jsx("div",{style:{height:b.getTotalSize()},className:"relative w-full",children:b.getVirtualItems().map(o=>t.jsx("div",{"data-row-index":o.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${o.start}px)`},children:u(s[o.index])},s[o.index].entry.path))}):s.map((o,c)=>t.jsx("div",{"data-row-index":c,children:u(o)},o.entry.path))})}function At(e){return e?e.type==="dir"?e.path:H(e.path):z}function Lt(e,s){const{rows:n,selectedPath:x,renamingPath:p,onSelectPath:m}=e;return l.useCallback(f=>{var v,i,E,T;if(p!==null)return;const a=n.findIndex(b=>b.entry.path===x),h=a>=0?n[a]:void 0;if(f.metaKey||f.ctrlKey){if(e.readOnly===!0)return;const b=f.key.toLowerCase();if(b==="c"&&h){f.preventDefault(),e.onCopy(h.entry);return}if(b==="v"){f.preventDefault(),e.onPaste(At(h==null?void 0:h.entry));return}return}switch(f.key){case"ArrowDown":f.preventDefault(),m(((v=n[Math.min(a+1,n.length-1)])==null?void 0:v.entry.path)??((i=n[0])==null?void 0:i.entry.path));break;case"ArrowUp":f.preventDefault(),m(((E=n[Math.max(a-1,0)])==null?void 0:E.entry.path)??((T=n[0])==null?void 0:T.entry.path));break;case"ArrowRight":(h==null?void 0:h.entry.type)==="dir"&&!h.expanded&&(f.preventDefault(),e.onToggle(h.entry));break;case"ArrowLeft":if(!h)break;if(f.preventDefault(),h.entry.type==="dir"&&h.expanded)e.onToggle(h.entry);else{const b=H(h.entry.path);b&&m(b)}break;case"Enter":h&&(f.preventDefault(),s(h.entry));break;case"F2":h&&e.readOnly!==!0&&(f.preventDefault(),e.onStartRename(h.entry));break;case"Delete":case"Backspace":h&&e.readOnly!==!0&&(f.preventDefault(),e.onDelete(h.entry));break}},[n,x,p,m,e,s])}function It({source:e,className:s}={}){var A;const n=Q(),x=se(u=>u.selectedCwd),p=l.useMemo(()=>x?Tt({transport:n,cwd:x}):null,[n,x]),m=e===void 0?p:e,f=m!==null&&!m.writable,a=Nt(m),{rows:h,rootLoading:v,rootError:i,errorPaths:E}=a,T=S(u=>u.setCommands),b=S(u=>u.selectedPath),M=S(u=>u.setSelectedPath),_=S(u=>u.clipboard),[O,P]=l.useState(null),[R,r]=l.useState(null),[d,g]=l.useState(null),C=l.useCallback(u=>_!==null&&!(_.isDir&&J(u,_.path)),[_]),w=l.useCallback((u,o)=>{a.ensureExpanded(u),r(null),P({parent:u,type:o})},[a]),j=l.useRef({startCreate:w,reload:a.reload});l.useEffect(()=>{j.current={startCreate:w,reload:a.reload}}),l.useEffect(()=>{if(!f)return T({newFile:()=>j.current.startCreate(z,"file"),newFolder:()=>j.current.startCreate(z,"dir"),refresh:()=>j.current.reload()}),()=>T(null)},[T,f]);const y=l.useCallback(async u=>{if(!O)return;const o=O;P(null),await a.createEntry(o.parent,u,o.type)&&M(U(o.parent,u))},[O,a,M]),N=l.useCallback(async(u,o)=>{r(null),await a.renameEntry(u,o)&&M(U(H(u.path),o))},[a,M]);return m===null?e!==void 0?null:t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-6 text-center text-sm",children:"Select a working directory to browse its files."}):t.jsxs("div",{className:ae("flex h-full flex-col",s),children:[t.jsxs("div",{className:"min-h-0 flex-1",children:[O&&t.jsx(zt,{type:O.type,onSubmit:u=>void y(u),onCancel:()=>P(null)}),v&&h.length===0?t.jsx("div",{className:"flex h-20 items-center justify-center",children:t.jsx(ce,{size:"md",className:"text-muted-foreground",label:"Loading files"})}):i&&h.length===0?t.jsxs("div",{className:"text-muted-foreground flex h-20 flex-col items-center justify-center gap-2 text-xs",children:[t.jsx("span",{children:"Couldn’t load files."}),t.jsxs(Y,{variant:"outline",size:"xs",onClick:a.reload,children:[t.jsx(de,{}),"Retry"]})]}):h.length===0&&!O?t.jsx("div",{className:"text-muted-foreground/60 flex h-20 items-center justify-center text-xs",children:"Empty directory"}):t.jsx(Mt,{rows:h,selectedPath:b,renamingPath:R,errorPaths:E,onSelectPath:M,onToggle:a.toggleExpand,onOpen:u=>{m.preview==="inline"?g(u.path):a.openFile(u)},onRetryDir:a.retryDir,onSubmitRename:(u,o)=>void N(u,o),onCancelRename:()=>r(null),onStartRename:u=>r(u.path),onNewFile:u=>w(u,"file"),onNewFolder:u=>w(u,"dir"),onDelete:u=>void a.removeEntry(u),onMove:(u,o)=>void a.moveEntry(u,o),onCopyInto:(u,o)=>void a.copyEntry(u,o),onCopy:a.copyToClipboard,onPaste:u=>{_&&a.copyEntry(_,u)},onDuplicate:u=>void a.copyEntry({path:u.path,isDir:u.type==="dir"},H(u.path)),canPasteInto:C,readOnly:f,provenance:m.provenance,revealLabel:a.revealLabel,onReveal:u=>void a.reveal(u),onAddToChat:a.addToChat,onCopyPath:(u,o)=>void a.copyPath(u,o)})]}),m.preview==="inline"&&t.jsx(dt,{source:m,path:d,onClose:()=>g(null)}),t.jsx(Ye,{open:a.pendingRecursiveDelete!==null,onOpenChange:u=>!u&&a.cancelRecursiveDelete(),children:t.jsxs(Be,{children:[t.jsxs(Qe,{children:[t.jsx(Ue,{children:"Delete this folder?"}),t.jsxs(qe,{children:["“",(A=a.pendingRecursiveDelete)==null?void 0:A.name,"” isn’t empty. Deleting it removes everything inside. This can’t be undone."]})]}),t.jsxs(We,{children:[t.jsx(Ge,{onClick:a.cancelRecursiveDelete,children:"Cancel"}),t.jsx(Ve,{onClick:()=>void a.confirmRecursiveDelete(),className:"bg-destructive hover:bg-destructive/90 text-white",children:"Delete"})]})]})})]})}function zt({type:e,onSubmit:s,onCancel:n}){const x=l.useRef(null),[p,m]=l.useState("");l.useEffect(()=>{var a;(a=x.current)==null||a.focus()},[]);const f=()=>{const a=p.trim();a?s(a):n()};return t.jsxs("div",{className:"flex items-center gap-1 px-3 py-1",children:[e==="dir"?t.jsx(ue,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):t.jsx(fe,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),t.jsx("input",{ref:x,type:"text",value:p,"aria-label":e==="dir"?"New folder name":"New file name",placeholder:e==="dir"?"folder-name":"file-name",onChange:a=>m(a.target.value),onBlur:f,onKeyDown:a=>{a.key==="Enter"?f():a.key==="Escape"&&n()},className:"border-border bg-background min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})]})}function be(){const e=S(x=>x.showHidden),s=S(x=>x.setShowHidden),n=e?"Hide hidden files":"Show hidden files";return t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":n,title:n,onClick:()=>s(!e),children:e?t.jsx(Xe,{className:"text-muted-foreground"}):t.jsx(Ze,{className:"text-muted-foreground"})})}function Kt({cwd:e}){const s=Q(),{data:n}=X({queryKey:["file-explorer","workspace",e],queryFn:()=>s.resolveWorkspace(e),staleTime:6e4});return n!=null&&n.branch?t.jsxs("span",{className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",title:`Workspace ${n.key} on ${n.branch}`,children:[t.jsx(xe,{className:"size-3 flex-shrink-0"}),t.jsx("span",{className:"truncate",children:n.branch})]}):null}function qt(){const e=se(n=>n.selectedCwd),s=S(n=>n.commands);return e?t.jsxs(t.Fragment,{children:[t.jsx(Kt,{cwd:e}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"New file",title:"New file",onClick:()=>s==null?void 0:s.newFile(),children:t.jsx(ht,{className:"text-muted-foreground"})}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"New folder",title:"New folder",onClick:()=>s==null?void 0:s.newFolder(),children:t.jsx(Je,{className:"text-muted-foreground"})}),t.jsx(be,{}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"Refresh",title:"Refresh",onClick:()=>s==null?void 0:s.refresh(),children:t.jsx(et,{className:"text-muted-foreground"})})]}):null}function Ht({roomId:e}){const s=Q(),n=V(),x=X(me(s,e));l.useEffect(()=>ut(n,e,()=>{n.invalidateQueries({queryKey:ee.repoStatus(e)})}),[n,e]);const p=l.useMemo(()=>{var h;return((h=x.data)==null?void 0:h.kind)==="ok"?tt(x.data.status):[]},[x.data]),m=nt(p),f=st(p);if(!f)return null;const a=p.map((h,v)=>`${m[v]}: ${at(h)}`);return t.jsxs("span",{"data-slot":"pending-work-badge",title:a.join(`
|
|
7
|
-
`),className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",children:[t.jsx(
|
|
6
|
+
*/const ge={name:"file-plus",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]};ge.node;const ft=we(ge),pt=[".git",".dork",".claude",".agents","node_modules"];function mt(e){return e.startsWith(".")||pt.includes(e)}const te=["ROOM.md","README.md"];function ne(e){return te.some(s=>s.toLowerCase()===e.toLowerCase())}function xt(e){return e.filter(s=>!mt(s.name))}function gt(e){if(e.reduce((p,x)=>x.type==="file"&&ne(x.name)?p+1:p,0)===0)return e;const n=[],m=[];for(const p of e)p.type==="file"&&ne(p.name)?n.push(p):m.push(p);return n.sort((p,x)=>te.findIndex(h=>h.toLowerCase()===p.name.toLowerCase())-te.findIndex(h=>h.toLowerCase()===x.name.toLowerCase())),[...n,...m]}function G(e,s,n){return["file-explorer","tree",e.scopeKey,s,e.filtersHidden?n:null]}function ye(e,s,n,m){return{queryKey:G(e,s,n),queryFn:()=>e.list(s,{showHidden:n}),staleTime:re.FILE_TREE_STALE_TIME_MS,gcTime:re.FILE_TREE_GC_TIME_MS,placeholderData:p=>p??m.getQueryData(G(e,s,!n))}}const yt=["CONFLICT","COPY_INTO_SELF","DIR_NOT_EMPTY","NOT_FOUND","REFUSE_ROOT","OUTSIDE_BOUNDARY"];function ve(e){const s=le(e);return s!==void 0&&yt.includes(s)?s:void 0}const Ce="Can’t copy a folder into itself",vt={CONFLICT:"That name already exists",COPY_INTO_SELF:Ce,DIR_NOT_EMPTY:"This folder isn’t empty",NOT_FOUND:"That item no longer exists",REFUSE_ROOT:"Can’t modify the working directory root",OUTSIDE_BOUNDARY:"That path is outside the working directory"};function $(e,s){const n=ve(e);W.error(n?vt[n]:s)}const Ct=/ copy(?: \d+)?$/;function bt({name:e,isDir:s,taken:n}){const m=new Set(n);if(!m.has(e))return e;const p=s?-1:e.lastIndexOf("."),x=p>0,h=x?e.slice(p):"",a=(x?e.slice(0,p):e).replace(Ct,"");for(let f=1;;f+=1){const v=f===1?`${a} copy${h}`:`${a} copy ${f}${h}`;if(!m.has(v))return v}}function ie(e,s,n){return{name:s,path:e,type:n,size:0,mtime:Date.now(),isSymlink:!1}}function wt(e){const s=B(),{source:n,showHidden:m,queryClient:p,inFlightRef:x}=e,h=n.cwd??"",[a,f]=l.useState(null),v=l.useCallback(async r=>{x.current+=1;try{return await r()}finally{x.current-=1}},[x]),i=l.useMemo(()=>{const r=d=>G(n,d,m);return{getChildren:d=>{var g;return((g=p.getQueryData(r(d)))==null?void 0:g.entries)??[]},isLoaded:d=>p.getQueryData(r(d))!==void 0,takenNames:async d=>(await s.readFileTree(h,{path:d===z?void 0:d,showHidden:!0})).entries.map(C=>C.name),snapshot:d=>p.getQueryData(r(d)),setChildren:(d,g)=>{p.setQueryData(r(d),C=>({entries:ke(g((C==null?void 0:C.entries)??[]))}))},restore:(d,g)=>{p.setQueryData(r(d),g)},invalidate:d=>{p.invalidateQueries({queryKey:r(d),exact:!0})}}},[p,s,h,n,m]),E=l.useCallback((r,d,g)=>v(async()=>{const C=Q(r,d),w=!i.getChildren(r).some(y=>y.path===C),j=i.snapshot(r);w&&i.setChildren(r,y=>[...y,ie(C,d,g)]);try{return await s.createEntry(h,C,g),!0}catch(y){return w&&i.restore(r,j),$(y,`Couldn’t create ${g==="dir"?"folder":"file"}`),!1}finally{i.invalidate(r)}}),[s,h,i,v]),T=l.useCallback((r,d)=>v(async()=>{if(d===r.name||d.length===0)return!0;const g=H(r.path),C=Q(g,d),w=i.getChildren(g).some(N=>N.path===C),j=i.snapshot(g),y={...r,name:d,path:C};w||i.setChildren(g,N=>N.map(A=>A.path===r.path?y:A));try{return await s.renameEntry(h,r.path,C),S.getState().remapExpandedPaths(r.path,C),!0}catch(N){return w||i.restore(g,j),$(N,"Couldn’t rename"),!1}finally{i.invalidate(g)}}),[s,h,i,v]),b=l.useCallback(r=>v(async()=>{const d=H(r.path),g=i.snapshot(d);i.setChildren(d,C=>C.filter(w=>w.path!==r.path));try{await s.deleteEntry(h,r.path,{recursive:!0}),S.getState().dropExpandedPaths(r.path)}catch(C){i.restore(d,g),$(C,"Couldn’t delete")}finally{i.invalidate(d)}}),[s,h,i,v]),M=l.useCallback(r=>v(async()=>{const d=H(r.path);if(r.type==="file"){const g=i.snapshot(d);i.setChildren(d,C=>C.filter(w=>w.path!==r.path));try{await s.deleteEntry(h,r.path),S.getState().dropExpandedPaths(r.path)}catch(C){i.restore(d,g),$(C,"Couldn’t delete")}finally{i.invalidate(d)}return}try{await s.deleteEntry(h,r.path),i.setChildren(d,g=>g.filter(C=>C.path!==r.path)),S.getState().dropExpandedPaths(r.path),i.invalidate(d)}catch(g){if(ve(g)==="DIR_NOT_EMPTY"){f(r);return}$(g,"Couldn’t delete")}}),[s,h,i,v]),_=l.useCallback(async()=>{const r=a;f(null),r&&await b(r)},[a,b]),O=l.useCallback(()=>f(null),[]),P=l.useCallback((r,d)=>v(async()=>{const g=H(r),C=oe(r),w=Q(d,C);if(d===g||w===r||J(d,r))return;const j=i.getChildren(g).find(c=>c.path===r);if(!j)return;const y=i.isLoaded(d),N=y&&i.getChildren(d).some(c=>c.path===w),A={...j,name:C,path:w},u=i.snapshot(g),o=y?i.snapshot(d):void 0;i.setChildren(g,c=>c.filter(k=>k.path!==r)),y&&!N&&i.setChildren(d,c=>[...c,A]);try{await s.renameEntry(h,r,w),S.getState().remapExpandedPaths(r,w)}catch(c){i.restore(g,u),y&&!N&&i.restore(d,o),$(c,"Couldn’t move")}finally{i.invalidate(g),y&&i.invalidate(d)}}),[s,h,i,v]),R=l.useCallback((r,d)=>v(async()=>{if(r.isDir&&J(d,r.path)){W.error(Ce);return}let g;try{g=await i.takenNames(d)}catch(N){$(N,"Couldn’t copy");return}const C=bt({name:oe(r.path),isDir:r.isDir,taken:g}),w=Q(d,C),j=i.isLoaded(d),y=j?i.snapshot(d):void 0;if(j){const N=i.getChildren(H(r.path)).find(u=>u.path===r.path),A=N?{...N,name:C,path:w}:ie(w,C,r.isDir?"dir":"file");i.setChildren(d,u=>[...u,A])}try{await s.copyEntry(h,r.path,w)}catch(N){j&&i.restore(d,y),$(N,"Couldn’t copy")}finally{i.invalidate(d)}}),[s,h,i,v]);return{createEntry:E,renameEntry:T,removeEntry:M,moveEntry:P,copyEntry:R,pendingRecursiveDelete:a,confirmRecursiveDelete:_,cancelRecursiveDelete:O}}function kt(e){return e!=null&&e.startsWith("darwin")?"Reveal in Finder":e!=null&&e.startsWith("win32")?"Reveal in File Explorer":"Show in File Manager"}function Et(e,s){const n=e.includes("\\")&&!e.includes("/"),m=e.replace(/[\\/]+$/,""),p=n?s.split("/").join("\\"):s;return`${m}${n?"\\":"/"}${p}`}function Rt(e){const s=B(),{data:n}=Ee(),m=l.useMemo(()=>s.supportsReveal?kt(n==null?void 0:n.platform):null,[s.supportsReveal,n==null?void 0:n.platform]),p=l.useCallback(async v=>{if(e)try{await s.revealEntry(e,v.path)}catch(i){$(i,"Couldn’t open the file manager")}},[s,e]),{copy:x}=Re(),h=l.useCallback(async(v,i)=>{const E=i==="absolute"&&e?Et(e,v.path):v.path;await x(E)||W.error("Couldn’t copy to the clipboard")},[e,x]),a=l.useCallback(v=>{je(Ne(v.path))||W.error("Open a chat first to add a file to it")},[]),f=l.useCallback(v=>{S.getState().setClipboard({path:v.path,isDir:v.type==="dir"});try{navigator.clipboard.writeText(v.path).catch(()=>{})}catch{}},[]);return{revealLabel:m,reveal:p,copyPath:h,addToChat:a,copyToClipboard:f}}const jt={scopeKey:"",cwd:null,writable:!1,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list:()=>Promise.resolve({entries:[]})};function Nt(e){var u,o;const s=B(),n=V(),{setTheme:m}=Te(),p=S(c=>c.showHidden),x=S(c=>c.expanded),h=S(c=>c.loadExplorerForCwd),a=S(c=>c.pruneMissing),f=(e==null?void 0:e.scopeKey)??null,v=(e==null?void 0:e.cwd)??null;l.useEffect(()=>{h(f)},[f,h]);const i=l.useMemo(()=>[z,...De(x)],[x]),E=Se({queries:e?i.map(c=>ye(e,c,p,n)):[]}),T=(e==null?void 0:e.filtersHidden)??!0,b=l.useMemo(()=>{const c={};return i.forEach((k,F)=>{var U;const L=E[F];let I=((U=L==null?void 0:L.data)==null?void 0:U.entries)??[];!p&&!T&&(I=xt(I)),k===z&&(I=gt(I)),c[k]={entries:I,loading:(L==null?void 0:L.isLoading)??!1,error:(L==null?void 0:L.isError)??!1}}),c},[i,E,p,T]),M=l.useRef(0),_=l.useRef({});l.useEffect(()=>{M.current>0||i.forEach((c,k)=>{var L,I,U;const F=(I=(L=E[k])==null?void 0:L.data)==null?void 0:I.entries;!F||(U=E[k])!=null&&U.isError||_.current[c]!==F&&(_.current[c]=F,a(c,F.map(D=>D.name)))})},[i,E,a]);const O=l.useMemo(()=>Oe(x,b),[x,b]),P=!!e&&!!((u=b[z])!=null&&u.loading),R=!!e&&!!((o=b[z])!=null&&o.error),r=l.useMemo(()=>{var k;const c=new Set;for(const F of i)F!==z&&((k=b[F])!=null&&k.error)&&c.add(F);return c},[i,b]),d=l.useCallback(c=>{if(c.type!=="dir")return;const k=S.getState();k.setDirExpanded(c.path,!k.expanded[c.path])},[]),g=l.useCallback(c=>{if(c===z)return;const k=S.getState();k.expanded[c]||k.setDirExpanded(c,!0)},[]),C=(e==null?void 0:e.preview)==="canvas",w=l.useCallback(c=>{if(c.type!=="file"||!C)return;const k={getStore:se.getState,setTheme:m,supportsTerminal:s.supportsTerminal};Fe(k,{action:"open_file",sourcePath:c.path},"user")},[C,m,s]),j=l.useCallback(()=>{f!==null&&n.invalidateQueries({queryKey:["file-explorer","tree",f]})},[n,f]),y=l.useCallback(c=>{e!==null&&n.invalidateQueries({queryKey:G(e,c,p),exact:!0})},[n,e,p]);l.useEffect(()=>{if(e!=null&&e.events)return e.events(j)},[e,j]);const N=wt({source:e??jt,showHidden:p,queryClient:n,inFlightRef:M}),A=Rt(v);return{rows:O,rootLoading:P,rootError:R,errorPaths:r,toggleExpand:d,ensureExpanded:g,openFile:w,reload:j,retryDir:y,...N,...A}}function Tt(e){const{transport:s,cwd:n}=e;return{scopeKey:n,cwd:n,writable:!0,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list(m,p){return s.readFileTree(n,{path:m===""?void 0:m,showHidden:p.showHidden})}}}const Dt=12;function St({row:e,selected:s,renaming:n,error:m,onSelect:p,onActivate:x,onRetry:h,onSubmitRename:a,onCancelRename:f,onNewFile:v,onNewFolder:i,onStartRename:E,onDelete:T,onMove:b,onCopyInto:M,onCopy:_,onPaste:O,onDuplicate:P,canPasteInto:R,revealLabel:r,onReveal:d,onAddToChat:g,onCopyPath:C,readOnly:w=!1,provenance:j=!1}){const{entry:y,depth:N,expanded:A,loading:u}=e,o=y.type==="dir",c=o?y.path:H(y.path),[k,F]=l.useState(!1),L=!o&&N===0&&ne(y.name),I=ct(y.lastCommit),U=t.jsxs("div",{role:"treeitem","aria-label":y.name,"aria-expanded":o?A:void 0,"aria-selected":s,tabIndex:-1,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),p(y),x(y))},draggable:!n&&!w,onDragStart:D=>{w||(D.dataTransfer.setData("text/plain",y.path),D.dataTransfer.setData(Ie,y.path),D.dataTransfer.effectAllowed="copyMove")},onDragOver:D=>{D.stopPropagation(),!(w||!o||!pe(D.dataTransfer.types))&&(D.preventDefault(),D.dataTransfer.dropEffect=D.altKey?"copy":"move",F(!0))},onDragLeave:()=>F(!1),onDrop:D=>{if(D.stopPropagation(),w||!o)return;F(!1);const Z=fe(D.dataTransfer);Z!==null&&(D.preventDefault(),D.altKey?M(Z,y.path):b(Z,y.path))},onClick:()=>{p(y),x(y)},className:ae("flex w-full cursor-pointer items-center gap-1 py-1 pr-2 text-sm transition-colors",s?"bg-accent text-foreground":"hover:bg-accent/50",k&&"ring-ring/60 bg-accent ring-1"),style:{paddingLeft:N*Dt+8},children:[t.jsx("span",{className:"flex size-4 flex-shrink-0 items-center justify-center",children:o&&(u?t.jsx(ce,{size:"xs",className:"text-muted-foreground"}):m?t.jsx("button",{type:"button","aria-label":"Retry loading",title:"Couldn’t load. Retry",onClick:D=>{D.stopPropagation(),h()},className:"flex items-center justify-center",children:t.jsx(de,{className:"text-destructive size-3.5"})}):A?t.jsx(_e,{className:"text-muted-foreground size-3.5"}):t.jsx(Pe,{className:"text-muted-foreground size-3.5"}))}),o?A?t.jsx(Me,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):t.jsx(ue,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):y.isSymlink===!0?t.jsx(Ae,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}):t.jsx(he,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),n?t.jsx(Ot,{initialName:y.name,onSubmit:D=>a(y,D),onCancel:f}):t.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.name}),L&&!n&&t.jsx(Le,{"aria-label":"Pinned to the top",className:"text-muted-foreground/60 size-3 flex-shrink-0"}),j&&!n&&t.jsx("span",{className:"text-muted-foreground/70 text-2xs max-w-[45%] flex-shrink-0 truncate tabular-nums",title:I.title??void 0,children:I.label})]});return w?U:t.jsxs(ze,{children:[t.jsx(Ke,{asChild:!0,children:U}),t.jsxs(He,{className:"w-52",children:[t.jsx(K,{onClick:()=>v(c),children:"New file"}),t.jsx(K,{onClick:()=>i(c),children:"New folder"}),t.jsx(q,{}),r&&t.jsx(K,{onClick:()=>d(y),children:r}),t.jsx(K,{movesFocus:!0,onClick:()=>g(y),children:"Add to chat"}),t.jsx(q,{}),t.jsx(K,{onClick:()=>_(y),children:"Copy"}),t.jsx(K,{disabled:!R(c),onClick:()=>O(c),children:"Paste"}),t.jsx(K,{onClick:()=>P(y),children:"Duplicate"}),t.jsx(q,{}),t.jsx(K,{onClick:()=>C(y,"absolute"),children:"Copy path"}),t.jsx(K,{onClick:()=>C(y,"relative"),children:"Copy relative path"}),t.jsx(q,{}),t.jsx(K,{onClick:()=>E(y),children:"Rename"}),t.jsx(K,{variant:"destructive",onClick:()=>T(y),children:"Delete"})]})]})}function Ot({initialName:e,onSubmit:s,onCancel:n}){const m=l.useRef(null),[p,x]=l.useState(e);l.useEffect(()=>{const a=m.current;if(!a)return;a.focus();const f=e.lastIndexOf(".");a.setSelectionRange(0,f>0?f:e.length)},[e]);const h=()=>{const a=p.trim();a&&a!==e?s(a):n()};return t.jsx("input",{ref:m,type:"text",value:p,"aria-label":"New name",onChange:a=>x(a.target.value),onClick:a=>a.stopPropagation(),onBlur:h,onKeyDown:a=>{a.key==="Enter"?h():a.key==="Escape"&&n()},className:"border-border bg-background min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})}const Ft=100,_t=28,Pt=250;function Mt(e){const{rows:s,selectedPath:n,renamingPath:m,errorPaths:p,onSelectPath:x,onRetryDir:h}=e,a=l.useRef(null),f=S(o=>o.setScrollTop),v=S(o=>o.scopeKey),i=l.useCallback(o=>o.type==="dir"?e.onToggle(o):e.onOpen(o),[e]),E=Lt(e,i),T=s.length>Ft,b=$e({count:s.length,getScrollElement:()=>a.current,estimateSize:()=>_t,overscan:12,enabled:T}),M=l.useRef({scope:void 0,done:!1}),_=l.useRef(null);l.useLayoutEffect(()=>{const o=M.current;if(o.scope!==v&&(o.scope=v,o.done=!1),o.done||s.length===0)return;const c=a.current;if(!c)return;const k=S.getState().scrollTop;if(k<=0){o.done=!0;return}T?b.scrollToOffset(k):c.scrollTop=k,_.current=c.scrollTop,c.scrollTop>=k&&(o.done=!0)},[s.length,v,T,b]);const O=l.useRef(null),P=l.useRef(null),R=l.useCallback(()=>{const o=a.current;o&&o.scrollTop!==_.current&&(M.current.done=!0,O.current=o.scrollTop,P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{P.current=null,O.current!==null&&f(O.current)},Pt))},[f]);l.useEffect(()=>()=>{P.current&&clearTimeout(P.current),O.current!==null&&f(O.current)},[f]);const r=l.useRef(void 0);l.useEffect(()=>{var F,L;const o=r.current;if(r.current=n,o===void 0||n===o||n===null)return;const c=s.findIndex(I=>I.entry.path===n);if(c<0)return;const k=a.current;k&&(T?b.scrollToIndex(c,{align:"auto"}):(L=(F=k.querySelector(`[data-row-index="${c}"]`))==null?void 0:F.scrollIntoView)==null||L.call(F,{block:"nearest"}),_.current=k.scrollTop)},[n,s,T,b]);const[d,g]=l.useState(!1),{onCopyInto:C,onMove:w}=e,j=e.readOnly===!0,y=l.useCallback(o=>{j||!pe(o.dataTransfer.types)||(o.preventDefault(),o.dataTransfer.dropEffect=o.altKey?"copy":"move",g(!0))},[j]),N=l.useCallback((o,c)=>{const k=s.find(F=>F.entry.path===o);k&&C({path:o,isDir:k.entry.type==="dir"},c)},[s,C]),A=l.useCallback(o=>{if(g(!1),j)return;const c=fe(o.dataTransfer);c!==null&&(o.preventDefault(),o.altKey?N(c,z):w(c,z))},[N,w,j]),u=o=>t.jsx(St,{row:o,selected:o.entry.path===n,renaming:o.entry.path===m,error:o.entry.type==="dir"&&o.expanded&&p.has(o.entry.path),onSelect:c=>x(c.path),onActivate:i,onRetry:()=>h(o.entry.path),onSubmitRename:e.onSubmitRename,onCancelRename:e.onCancelRename,onStartRename:e.onStartRename,onNewFile:e.onNewFile,onNewFolder:e.onNewFolder,onDelete:e.onDelete,onMove:e.onMove,onCopyInto:N,onCopy:e.onCopy,onPaste:e.onPaste,onDuplicate:e.onDuplicate,canPasteInto:e.canPasteInto,revealLabel:e.revealLabel,onReveal:e.onReveal,onAddToChat:e.onAddToChat,onCopyPath:e.onCopyPath,readOnly:e.readOnly,provenance:e.provenance});return t.jsx("div",{ref:a,role:"tree","aria-label":"File explorer",tabIndex:0,onKeyDown:E,onScroll:R,onDragOver:y,onDragLeave:()=>g(!1),onDrop:A,className:ae("focus-visible:ring-ring/40 h-full overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-inset",d&&"ring-ring/60 bg-accent/30 ring-1 ring-inset"),children:T?t.jsx("div",{style:{height:b.getTotalSize()},className:"relative w-full",children:b.getVirtualItems().map(o=>t.jsx("div",{"data-row-index":o.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${o.start}px)`},children:u(s[o.index])},s[o.index].entry.path))}):s.map((o,c)=>t.jsx("div",{"data-row-index":c,children:u(o)},o.entry.path))})}function At(e){return e?e.type==="dir"?e.path:H(e.path):z}function Lt(e,s){const{rows:n,selectedPath:m,renamingPath:p,onSelectPath:x}=e;return l.useCallback(h=>{var v,i,E,T;if(p!==null)return;const a=n.findIndex(b=>b.entry.path===m),f=a>=0?n[a]:void 0;if(h.metaKey||h.ctrlKey){if(e.readOnly===!0)return;const b=h.key.toLowerCase();if(b==="c"&&f){h.preventDefault(),e.onCopy(f.entry);return}if(b==="v"){h.preventDefault(),e.onPaste(At(f==null?void 0:f.entry));return}return}switch(h.key){case"ArrowDown":h.preventDefault(),x(((v=n[Math.min(a+1,n.length-1)])==null?void 0:v.entry.path)??((i=n[0])==null?void 0:i.entry.path));break;case"ArrowUp":h.preventDefault(),x(((E=n[Math.max(a-1,0)])==null?void 0:E.entry.path)??((T=n[0])==null?void 0:T.entry.path));break;case"ArrowRight":(f==null?void 0:f.entry.type)==="dir"&&!f.expanded&&(h.preventDefault(),e.onToggle(f.entry));break;case"ArrowLeft":if(!f)break;if(h.preventDefault(),f.entry.type==="dir"&&f.expanded)e.onToggle(f.entry);else{const b=H(f.entry.path);b&&x(b)}break;case"Enter":f&&(h.preventDefault(),s(f.entry));break;case"F2":f&&e.readOnly!==!0&&(h.preventDefault(),e.onStartRename(f.entry));break;case"Delete":case"Backspace":f&&e.readOnly!==!0&&(h.preventDefault(),e.onDelete(f.entry));break}},[n,m,p,x,e,s])}function It({source:e,className:s}={}){var A;const n=B(),m=se(u=>u.selectedCwd),p=l.useMemo(()=>m?Tt({transport:n,cwd:m}):null,[n,m]),x=e===void 0?p:e,h=x!==null&&!x.writable,a=Nt(x),{rows:f,rootLoading:v,rootError:i,errorPaths:E}=a,T=S(u=>u.setCommands),b=S(u=>u.selectedPath),M=S(u=>u.setSelectedPath),_=S(u=>u.clipboard),[O,P]=l.useState(null),[R,r]=l.useState(null),[d,g]=l.useState(null),C=l.useCallback(u=>_!==null&&!(_.isDir&&J(u,_.path)),[_]),w=l.useCallback((u,o)=>{a.ensureExpanded(u),r(null),P({parent:u,type:o})},[a]),j=l.useRef({startCreate:w,reload:a.reload});l.useEffect(()=>{j.current={startCreate:w,reload:a.reload}}),l.useEffect(()=>{if(!h)return T({newFile:()=>j.current.startCreate(z,"file"),newFolder:()=>j.current.startCreate(z,"dir"),refresh:()=>j.current.reload()}),()=>T(null)},[T,h]);const y=l.useCallback(async u=>{if(!O)return;const o=O;P(null),await a.createEntry(o.parent,u,o.type)&&M(Q(o.parent,u))},[O,a,M]),N=l.useCallback(async(u,o)=>{r(null),await a.renameEntry(u,o)&&M(Q(H(u.path),o))},[a,M]);return x===null?e!==void 0?null:t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-6 text-center text-sm",children:"Select a working directory to browse its files."}):t.jsxs("div",{className:ae("flex h-full flex-col",s),children:[t.jsxs("div",{className:"min-h-0 flex-1",children:[O&&t.jsx(zt,{type:O.type,onSubmit:u=>void y(u),onCancel:()=>P(null)}),v&&f.length===0?t.jsx("div",{className:"flex h-20 items-center justify-center",children:t.jsx(ce,{size:"md",className:"text-muted-foreground",label:"Loading files"})}):i&&f.length===0?t.jsxs("div",{className:"text-muted-foreground flex h-20 flex-col items-center justify-center gap-2 text-xs",children:[t.jsx("span",{children:"Couldn’t load files."}),t.jsxs(Y,{variant:"outline",size:"xs",onClick:a.reload,children:[t.jsx(de,{}),"Retry"]})]}):f.length===0&&!O?t.jsx("div",{className:"text-muted-foreground/60 flex h-20 items-center justify-center text-xs",children:"Empty directory"}):t.jsx(Mt,{rows:f,selectedPath:b,renamingPath:R,errorPaths:E,onSelectPath:M,onToggle:a.toggleExpand,onOpen:u=>{x.preview==="inline"?g(u.path):a.openFile(u)},onRetryDir:a.retryDir,onSubmitRename:(u,o)=>void N(u,o),onCancelRename:()=>r(null),onStartRename:u=>r(u.path),onNewFile:u=>w(u,"file"),onNewFolder:u=>w(u,"dir"),onDelete:u=>void a.removeEntry(u),onMove:(u,o)=>void a.moveEntry(u,o),onCopyInto:(u,o)=>void a.copyEntry(u,o),onCopy:a.copyToClipboard,onPaste:u=>{_&&a.copyEntry(_,u)},onDuplicate:u=>void a.copyEntry({path:u.path,isDir:u.type==="dir"},H(u.path)),canPasteInto:C,readOnly:h,provenance:x.provenance,revealLabel:a.revealLabel,onReveal:u=>void a.reveal(u),onAddToChat:a.addToChat,onCopyPath:(u,o)=>void a.copyPath(u,o)})]}),x.preview==="inline"&&t.jsx(dt,{source:x,path:d,onClose:()=>g(null)}),t.jsx(Ye,{open:a.pendingRecursiveDelete!==null,onOpenChange:u=>!u&&a.cancelRecursiveDelete(),children:t.jsxs(Ue,{children:[t.jsxs(Be,{children:[t.jsx(Qe,{children:"Delete this folder?"}),t.jsxs(qe,{children:["“",(A=a.pendingRecursiveDelete)==null?void 0:A.name,"” isn’t empty. Deleting it removes everything inside. This can’t be undone."]})]}),t.jsxs(We,{children:[t.jsx(Ge,{onClick:a.cancelRecursiveDelete,children:"Cancel"}),t.jsx(Ve,{onClick:()=>void a.confirmRecursiveDelete(),className:"bg-destructive hover:bg-destructive/90 text-white",children:"Delete"})]})]})})]})}function zt({type:e,onSubmit:s,onCancel:n}){const m=l.useRef(null),[p,x]=l.useState("");l.useEffect(()=>{var a;(a=m.current)==null||a.focus()},[]);const h=()=>{const a=p.trim();a?s(a):n()};return t.jsxs("div",{className:"flex items-center gap-1 px-3 py-1",children:[e==="dir"?t.jsx(ue,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):t.jsx(he,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),t.jsx("input",{ref:m,type:"text",value:p,"aria-label":e==="dir"?"New folder name":"New file name",placeholder:e==="dir"?"folder-name":"file-name",onChange:a=>x(a.target.value),onBlur:h,onKeyDown:a=>{a.key==="Enter"?h():a.key==="Escape"&&n()},className:"border-border bg-background min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})]})}function be(){const e=S(m=>m.showHidden),s=S(m=>m.setShowHidden),n=e?"Hide hidden files":"Show hidden files";return t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":n,title:n,onClick:()=>s(!e),children:e?t.jsx(Xe,{className:"text-muted-foreground"}):t.jsx(Ze,{className:"text-muted-foreground"})})}function Kt({cwd:e}){const s=B(),{data:n}=X({queryKey:["file-explorer","workspace",e],queryFn:()=>s.resolveWorkspace(e),staleTime:6e4});return n!=null&&n.branch?t.jsxs("span",{className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",title:`Workspace ${n.key} on ${n.branch}`,children:[t.jsx(me,{className:"size-3 flex-shrink-0"}),t.jsx("span",{className:"truncate",children:n.branch})]}):null}function qt(){const e=se(n=>n.selectedCwd),s=S(n=>n.commands);return e?t.jsxs(t.Fragment,{children:[t.jsx(Kt,{cwd:e}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"New file",title:"New file",onClick:()=>s==null?void 0:s.newFile(),children:t.jsx(ft,{className:"text-muted-foreground"})}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"New folder",title:"New folder",onClick:()=>s==null?void 0:s.newFolder(),children:t.jsx(Je,{className:"text-muted-foreground"})}),t.jsx(be,{}),t.jsx(Y,{variant:"ghost",size:"icon-xs","aria-label":"Refresh",title:"Refresh",onClick:()=>s==null?void 0:s.refresh(),children:t.jsx(et,{className:"text-muted-foreground"})})]}):null}function Ht({roomId:e}){const s=B(),n=V(),m=X(xe(s,e));l.useEffect(()=>ut(n,e,()=>{n.invalidateQueries({queryKey:ee.repoStatus(e)})}),[n,e]);const p=l.useMemo(()=>{var f;return((f=m.data)==null?void 0:f.kind)==="ok"?tt(m.data.status):[]},[m.data]),x=nt(p),h=st(p);if(!h)return null;const a=p.map((f,v)=>`${x[v]}: ${at(f)}`);return t.jsxs("span",{"data-slot":"pending-work-badge",title:a.join(`
|
|
7
|
+
`),className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",children:[t.jsx(me,{className:"size-3 flex-shrink-0"}),t.jsxs("span",{className:"sr-only",children:["Not merged into the room yet. ",a.join(". "),"."]}),t.jsx("span",{"aria-hidden":"true",className:"truncate",children:h})]})}const $t={added:"added",modified:"changed",deleted:"deleted",untracked:"new"},Yt=new Map([["OPERATOR_ONLY","Only the person who owns this DorkOS can decide what happens to those changes."],["ROOM_FILE_NOT_FOUND","One of those changes is not there any more, so nothing was discarded. The list below has been refreshed."],["MERGE_IN_FLIGHT","Something else is writing to this room’s files right now. Nothing was changed. Try again in a moment."],["MAIN_CHECKOUT_DIRTY","This room’s files are on another branch, which DorkOS will not move for you. Put them back on main yourself."],["ROOM_REPO_GIT_UNAVAILABLE","This computer doesn’t have git installed, and a room’s files are a git repository."],["ROOM_HAS_NO_REPO","This room does not have files of its own any more."],["ROOM_REPOS_DISABLED","Rooms cannot have files of their own on this install right now."]]);function Ut({roomId:e}){var O,P;const s=B(),n=V(),m=X(xe(s,e)),[p,x]=l.useState([]),[h,a]=l.useState(!1),[f,v]=l.useState(null),i=rt({mutationFn:R=>s.repairRoomMain(e,R),onSuccess:()=>{x([]),a(!1),v(null),n.invalidateQueries({queryKey:ee.repoStatus(e)})},onError:R=>{a(!1);const r=Yt.get(le(R)??"");v(r??"That didn’t work. Try again in a moment."),n.invalidateQueries({queryKey:ee.repoStatus(e)})}});if(((O=m.data)==null?void 0:O.kind)==="unavailable")return t.jsx("p",{role:"alert","data-slot":"room-main-warning",className:"border-border/60 text-muted-foreground rounded-lg border px-3 py-2.5 text-xs",children:"DorkOS couldn’t check whether this room’s files are in order. If saving here is refused, this is why. Try again in a moment."});const E=((P=m.data)==null?void 0:P.kind)==="ok"?m.data.status.main:void 0;if(E===void 0||!E.dirty)return null;const T=E.branch!=="main",b=p.filter(R=>E.strays.some(r=>r.path===R)),M=h&&b.length>0,_=R=>x(r=>r.includes(R)?r.filter(d=>d!==R):[...r,R]);return t.jsxs("div",{role:"alert","data-slot":"room-main-warning",className:"border-border/60 bg-muted/40 space-y-3 rounded-lg border px-3 py-2.5 text-sm",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ot,{className:"text-muted-foreground mt-0.5 size-(--size-icon-sm) flex-shrink-0"}),t.jsxs("div",{className:"min-w-0 space-y-1",children:[t.jsx("p",{className:"font-medium",children:"Somebody changed this room’s files outside DorkOS"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:T?`This room’s files are on ${E.branch??"no branch"} instead of main. Nobody can save a file here and no agent can merge into it until they are back on main. DorkOS will not move a branch it did not move, in case there is work on it.`:"Nobody can save a file here, and no agent can merge its work in, until these are dealt with."})]})]}),!T&&t.jsxs(t.Fragment,{children:[t.jsx("ul",{className:"space-y-1.5",children:E.strays.map(R=>t.jsxs("li",{className:"flex items-center gap-2",children:[t.jsx(it,{id:`stray-${e}-${R.path}`,checked:b.includes(R.path),onCheckedChange:()=>_(R.path),disabled:i.isPending}),t.jsx("label",{htmlFor:`stray-${e}-${R.path}`,className:"min-w-0 flex-1 cursor-pointer truncate font-mono text-xs",title:R.path,children:R.path}),t.jsx("span",{className:"text-muted-foreground flex-shrink-0 text-xs",children:$t[R.kind]})]},R.path))}),E.strayCount>E.strays.length&&t.jsxs("p",{className:"text-muted-foreground text-xs",children:["…and ",E.strayCount-E.strays.length," more, not listed here. Keeping them all still keeps every one."]}),M?t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-xs",children:b.length===1?"Throw away that change? It cannot be brought back.":`Throw away those ${b.length} changes? They cannot be brought back.`}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(Y,{type:"button",variant:"ghost",size:"sm",disabled:i.isPending,onClick:()=>a(!1),children:"Cancel"}),t.jsx(Y,{type:"button",variant:"destructive",size:"sm",disabled:i.isPending,onClick:()=>i.mutate({action:"discard",paths:[...b]}),children:"Yes, discard"})]})]}):t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(Y,{type:"button",variant:"outline",size:"sm",disabled:i.isPending,onClick:()=>i.mutate({action:"commit"}),children:"Keep them all"}),t.jsx(Y,{type:"button",variant:"ghost",size:"sm",disabled:i.isPending||b.length===0,onClick:()=>a(!0),children:b.length===0?"Discard…":`Discard ${b.length}`})]})]}),f!==null&&t.jsx("p",{className:"text-destructive text-xs",children:f})]})}function Wt({roomId:e}){const s=B(),n=V(),m=S(v=>v.showHidden),p=l.useMemo(()=>ht({transport:s,queryClient:n,roomId:e}),[s,n,e]),x=X(ye(p,z,m,n)),h=x.isSuccess&&x.data.absent!==!0||x.isError,[a,f]=l.useState(null);return h&&a!==e&&f(e),!h&&a!==e?null:t.jsxs("section",{"aria-label":"Room files",className:"space-y-2",children:[t.jsxs("header",{className:"flex items-center gap-2",children:[t.jsx(lt,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),t.jsx("h3",{className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:"Files"}),t.jsx("div",{className:"min-w-0 flex-1",children:t.jsx(Ht,{roomId:e})}),t.jsx(be,{})]}),t.jsx(Ut,{roomId:e}),t.jsx("div",{"data-slot":"room-files-body",className:"border-border/60 h-72 overflow-hidden rounded-lg border",children:t.jsx(It,{source:p})})]})}export{It as FileExplorer,qt as FileExplorerActions,dt as FilePreviewDialog,pt as HIDDEN_ENTRY_NAMES,be as HiddenEntriesToggle,Xt as NO_PROVENANCE,te as PINNED_ENTRY_NAMES,Zt as ROOM_FILES_REFRESH_INTERVAL_MS,Wt as RoomFilesSection,ht as createRoomFilesSource,Tt as createSessionCwdSource,G as explorerDirQueryKey,ye as explorerDirQueryOptions,mt as isHiddenEntryName,ne as isPinnedEntryName,gt as pinnedFirst,ct as provenanceLine,xe as roomRepoStatusQueryOptions,xt as withoutHidden};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as be,E as $,C as he}from"./index-CA4kPvkQ.js";import{p as Te,s as Pe,t as b,E as xe,e as K,j as Ve,a as ye,L as we,i as ve,f as Xe,O as $e}from"./index--Uyc_XG6.js";import{cssLanguage as J,css as _e}from"./index-DD2mSWO0.js";import{typescriptLanguage as qe,jsxLanguage as Ce,tsxLanguage as ke,javascriptLanguage as M,javascript as Qe}from"./index-D2XIUtpU.js";import"./index-Cg0bm_ag.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,_=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(_);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(_,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(_,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&s<l&&t.next==e.charCodeAt(s-2))s++,o++;else if(s==l&&t.next==X){i>o?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.docum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CloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[gt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&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`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[pt,mt,ft,ct,ut,Ot,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function ie(e,a){let r=Object.create(null);for(let l of e.getChildren(ne)){let t=l.getChild(je),s=l.getChild(A)||l.getChild(se);t&&(r[a.read(t.from,t.to)]=s?s.type.id==A?a.read(s.from+1,s.to-1):a.read(s.from,s.to):"")}return r}function U(e,a){let r=e.getChild(Ie);return r?a.read(r.from,r.to):" "}function q(e,a,r){let l;for(let t of r)if(!t.attrs||t.attrs(l||(l=ie(e.node.parent.firstChild,a))))return{parser:t.parser,bracketed:!0};return null}function ue(e=[],a=[]){let r=[],l=[],t=[],s=[];for(let i of e)(i.tag=="script"?r:i.tag=="style"?l:i.tag=="textarea"?t:s).push(i);let o=a.length?Object.create(null):null;for(let i of a)(o[i.name]||(o[i.name]=[])).push(i);return Te((i,u)=>{let f=i.type.id;if(f==Ue)return q(i,u,r);if(f==Le)return q(i,u,l);if(f==Fe)return q(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],C=["ascii","utf-8","utf-16","latin1","latin1"],k=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":C,autocomplete:["on","off"],enctype:Q,method:k,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return(l==null?void 0:l.children)||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=(m==null?void 0:m.attrs)&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=K(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=t=i,o=u.from}return t.name=="TagName"?t.parent&&/CloseTag$/.test(t.parent.name)?F(r,t,t.from,l):L(r,e,t,t.from,l):t.name=="StartTag"||t.name=="IncompleteTag"?L(r,e,t,l,l):t.name=="StartCloseTag"||t.name=="IncompleteCloseTag"?F(r,t,l,l):t.name=="OpenTag"||t.name=="SelfClosingTag"||t.name=="AttributeName"?Tt(r,e,t,t.name=="AttributeName"?t.from:l,l):t.name=="Is"||t.name=="AttributeValue"||t.name=="UnquotedAttributeValue"?Pt(r,e,t,t.name=="Is"?l:t.from,l):a.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?ht(r,e,t,l):null}function qt(e){return me(y.default,e)}function xt(e){let{extraTags:a,extraGlobalAttributes:r}=e,l=r||a?new y(a,r):y.default;return t=>me(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:qe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ce.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ke.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:J.parser}],ge=[{name:"style",parser:J.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=we.define({name:"html",parser:St.configure({props:[ve.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let a=null,r;for(let l=e.node;;){let t=l.lastChild;if(!t||t.name!="Element"||t.to!=l.to)break;a=l=t}return a&&!((r=a.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(a.from)+e.unit:null}}),Xe.add({Element(e){let a=e.firstChild,r=e.lastChild;return!a||a.name!="OpenTag"?null:{from:a.to,to:r.name=="CloseTag"?r.from:e.to}}}),$e.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function Ct(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new ye(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],Qe().support,_e().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=K(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`</${S}>`;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:Ve.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Ct as html,qt as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage};
|
|
1
|
+
import{L as be,E as $,C as he}from"./index-BL-LFVsO.js";import{p as Te,s as Pe,t as b,E as xe,e as K,j as Ve,a as ye,L as we,i as ve,f as Xe,O as $e}from"./index-BHz_iLMm.js";import{cssLanguage as J,css as _e}from"./index-BPl8DTOI.js";import{typescriptLanguage as qe,jsxLanguage as Ce,tsxLanguage as ke,javascriptLanguage as M,javascript as Qe}from"./index-37p1_k_N.js";import"./index-DyAjYNxU.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,_=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(_);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(_,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(_,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&s<l&&t.next==e.charCodeAt(s-2))s++,o++;else if(s==l&&t.next==X){i>o?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),St=be.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$u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`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[gt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?Mn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[pt,mt,ft,ct,ut,Ot,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function ie(e,a){let r=Object.create(null);for(let l of e.getChildren(ne)){let t=l.getChild(je),s=l.getChild(A)||l.getChild(se);t&&(r[a.read(t.from,t.to)]=s?s.type.id==A?a.read(s.from+1,s.to-1):a.read(s.from,s.to):"")}return r}function U(e,a){let r=e.getChild(Ie);return r?a.read(r.from,r.to):" "}function q(e,a,r){let l;for(let t of r)if(!t.attrs||t.attrs(l||(l=ie(e.node.parent.firstChild,a))))return{parser:t.parser,bracketed:!0};return null}function ue(e=[],a=[]){let r=[],l=[],t=[],s=[];for(let i of e)(i.tag=="script"?r:i.tag=="style"?l:i.tag=="textarea"?t:s).push(i);let o=a.length?Object.create(null):null;for(let i of a)(o[i.name]||(o[i.name]=[])).push(i);return Te((i,u)=>{let f=i.type.id;if(f==Ue)return q(i,u,r);if(f==Le)return q(i,u,l);if(f==Fe)return q(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],C=["ascii","utf-8","utf-16","latin1","latin1"],k=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":C,autocomplete:["on","off"],enctype:Q,method:k,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return(l==null?void 0:l.children)||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=(m==null?void 0:m.attrs)&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=K(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=t=i,o=u.from}return t.name=="TagName"?t.parent&&/CloseTag$/.test(t.parent.name)?F(r,t,t.from,l):L(r,e,t,t.from,l):t.name=="StartTag"||t.name=="IncompleteTag"?L(r,e,t,l,l):t.name=="StartCloseTag"||t.name=="IncompleteCloseTag"?F(r,t,l,l):t.name=="OpenTag"||t.name=="SelfClosingTag"||t.name=="AttributeName"?Tt(r,e,t,t.name=="AttributeName"?t.from:l,l):t.name=="Is"||t.name=="AttributeValue"||t.name=="UnquotedAttributeValue"?Pt(r,e,t,t.name=="Is"?l:t.from,l):a.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?ht(r,e,t,l):null}function qt(e){return me(y.default,e)}function xt(e){let{extraTags:a,extraGlobalAttributes:r}=e,l=r||a?new y(a,r):y.default;return t=>me(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:qe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ce.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ke.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:J.parser}],ge=[{name:"style",parser:J.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=we.define({name:"html",parser:St.configure({props:[ve.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let a=null,r;for(let l=e.node;;){let t=l.lastChild;if(!t||t.name!="Element"||t.to!=l.to)break;a=l=t}return a&&!((r=a.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(a.from)+e.unit:null}}),Xe.add({Element(e){let a=e.firstChild,r=e.lastChild;return!a||a.name!="OpenTag"?null:{from:a.to,to:r.name=="CloseTag"?r.from:e.to}}}),$e.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function Ct(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new ye(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],Qe().support,_e().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=K(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`</${S}>`;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:Ve.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Ct as html,qt as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,b0 as C,b1 as M,a as i,b2 as R,b3 as I,ac as u,b4 as L,b5 as O,b6 as z,b7 as F,b8 as v,r,b9 as q,ba as T,bb as U,bc as _,bd as K,be as V,bf as $,bg as B}from"./index-
|
|
1
|
+
import{j as e,b0 as C,b1 as M,a as i,b2 as R,b3 as I,ac as u,b4 as L,b5 as O,b6 as z,b7 as F,b8 as v,r,b9 as q,ba as T,bb as U,bc as _,bd as K,be as V,bf as $,bg as B}from"./index-DyAjYNxU.js";import{bh as Z,bi as ee,bj as se,bk as te,bl as ne,bm as ae,bn as le,bo as oe,bp as re,bq as ie,br as ce,bs as de,bt as ue}from"./index-DyAjYNxU.js";function G(){return e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-6 text-center",children:[e.jsx("div",{className:"bg-muted flex size-12 items-center justify-center rounded-full",children:e.jsx(C,{className:"text-muted-foreground size-5"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"No agent selected"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Select an agent to view its profile."})]})]})}function H({agentPath:s}){return e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-6 text-center",children:[e.jsx("div",{className:"bg-destructive/10 flex size-12 items-center justify-center rounded-full",children:e.jsx(M,{className:"text-destructive size-5"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Agent not found"}),e.jsx("p",{className:"text-muted-foreground font-mono text-xs break-all",children:s}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"The agent at this path could not be loaded."})]})]})}function J(){return e.jsxs("div",{"data-slot":"profile-dock-skeleton",className:"flex h-full flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 pt-6 pb-4",children:[e.jsx(i,{className:"size-16 rounded-full"}),e.jsx(i,{className:"mt-1 h-4 w-28 rounded"}),e.jsx(i,{className:"h-3 w-16 rounded"}),e.jsx(i,{className:"h-3 w-36 rounded"})]}),e.jsx("div",{className:"space-y-2 px-4",children:["w-full","w-full","w-full"].map((s,f)=>e.jsx(i,{className:`h-8 ${s} rounded`},f))})]})}function W(){var N;const s=R(),f=I(),b=u(t=>t.rightPanelOpen),S=L(),c=O(s??void 0),p=z({enabled:c!==void 0}),l=(N=p.data)==null?void 0:N.members,D=c===void 0||l==null?void 0:l.find(t=>t.id===c),x=S.isFetched&&(c===void 0||p.isFetched),n=D??null,g=F(s),d=v(t=>t.setDockedEntries),m=v(t=>t.clearDockedStacks),E=u(t=>t.setRightPanelOpen),j=u(t=>t.releaseRightPanelRequest),[w,h]=r.useState(!1),a=r.useMemo(()=>n?q(n.id,[...g]):null,[n,g]),P=a===null?null:T(a),o=(P===(n==null?void 0:n.id)?n:l==null?void 0:l.find(t=>t.id===P))??n,y=r.useCallback(t=>{!s||!a||d(s,U(a,t).entries)},[s,a,d]),A=r.useCallback(()=>{!s||!a||d(s,_(a).entries)},[s,a,d]);r.useEffect(()=>{s===null||!x||o!==null||j(s)},[s,x,o,j]);const k=K(o===null?null:{home:"docked",memberId:o.id});return r.useEffect(()=>{if(b)return()=>{if(!u.getState().rightPanelOpen){if(V(k.read()))return h(!0);m()}}},[b,m,k]),s?!n||!a||!o?x?e.jsx(H,{agentPath:s}):e.jsx(J,{}):e.jsxs("div",{"data-slot":"profile-dock",className:"flex h-full min-h-0 flex-col overflow-hidden",children:[e.jsx($,{member:o,roster:l??[],home:"docked",inOwnSession:s===f.agentPath&&o.id===n.id,stack:a,onPush:y,onPop:A}),e.jsx(B,{open:w,onKeep:()=>{h(!1),E(!0)},onDiscard:()=>{h(!1),m()}})]}):e.jsx(G,{})}export{Z as AccountMenu,ee as AccountMenuContainer,se as PROFILE_PANEL_ID,W as ProfileDock,te as ProfilePanel,ne as ProfilePanelContainer,ae as ProfileSheet,le as ProfileSheetContainer,$ as ProfileView,oe as handleErrorMessage,re as identityLinkErrorMessage,q as profileStack,ie as useLegacyProfileLinkRedirect,ce as useProfileDockDeepLink,de as useProfileShortcut,v as useProfileStore,ue as useSetIdentityLinkedToMe};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as s}from"./index-
|
|
1
|
+
import{L as s}from"./index-BL-LFVsO.js";import{s as n,t as r,a as o,L as P,i as Q,c as a,f as i,l as c}from"./index-BHz_iLMm.js";import"./index-DyAjYNxU.js";const g=n({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,", :":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),p=s.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[g],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),T=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(O){if(!(O instanceof SyntaxError))throw O;const e=l(O,t.state.doc);return[{from:e,message:O.message,severity:"error",to:e}]}return[]};function l(t,O){let e;return(e=t.message.match(/at position (\d+)/))?Math.min(+e[1],O.length):(e=t.message.match(/at line (\d+) column (\d+)/))?Math.min(O.line(+e[1]).from+ +e[2]-1,O.length):0}const u=P.define({name:"json",parser:p.configure({props:[Q.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),i.add({"Object Array":c})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function f(){return new o(u)}export{f as json,u as jsonLanguage,T as jsonParseLinter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as T,j as e,aJ as R,aK as $,aG as A,aL as I,aM as z,ag as S,aN as O,B as C,aa as w,aO as P,aP as M,aQ as B,aR as L,aS as _,aT as k,aU as q,aV as h}from"./index-
|
|
1
|
+
import{r as T,j as e,aJ as R,aK as $,aG as A,aL as I,aM as z,ag as S,aN as O,B as C,aa as w,aO as P,aP as M,aQ as B,aR as L,aS as _,aT as k,aU as q,aV as h}from"./index-DyAjYNxU.js";import{aW as G,aX as J,aY as K,aZ as Q,a_ as W,a$ as Z}from"./index-DyAjYNxU.js";const H=new Set(["disabled","discovered","incompatible","invalid"]);function U({extension:t,onToggle:b,isToggling:m,onSetRunApproval:c,isSettingApproval:x}){const{manifest:n,status:i,scope:j,error:o,serverError:p,origin:g,approvedToRun:N}=t,[d,f]=T.useState(!1),u=!H.has(i),s=i==="incompatible",a=i==="invalid",r=i==="compile_error"||i==="activate_error",l=!s&&!a,v=!(g==="core"&&n.canDisable===!1),D=t.hasServerEntry||t.hasDataProxy,y=r?"Error":s?"Incompatible":a?"Invalid":null;return e.jsx(R,{"data-slot":"extension-card","data-testid":`extension-card-${t.id}`,radius:"lg",gap:"none",className:S(r&&"border-amber-500/50",(s||a)&&"opacity-70"),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r&&e.jsx($,{className:"size-4 shrink-0 text-amber-500","aria-hidden":"true"}),(s||a)&&!r&&e.jsx(A,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),!r&&!s&&!a&&e.jsx(I,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"font-medium",children:n.name}),e.jsxs("span",{className:"text-muted-foreground text-sm",children:["v",n.version]})]}),n.description&&e.jsx("p",{className:"text-muted-foreground text-sm",children:n.description}),s&&n.minHostVersion&&e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Requires DorkOS >= ",n.minHostVersion]}),r&&o&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:[i==="compile_error"?"Compilation error: ":"Activation failed: ",o.message]}),o.details&&e.jsxs("button",{type:"button",onClick:()=>f(E=>!E),className:"text-muted-foreground hover:text-foreground flex items-center gap-1 text-xs transition-colors","aria-expanded":d,children:[e.jsx(z,{className:S("size-3 transition-transform",d&&"rotate-180")}),d?"Hide details":"Show details"]}),d&&o.details&&e.jsx("pre",{className:"bg-muted mt-1 max-h-32 overflow-auto rounded-md p-2 text-xs",children:o.details})]}),p&&e.jsxs("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:["Server side failed to rebuild: ",p.message,". The previous version is still running."]}),g==="user"&&(N?e.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-2 text-xs","data-testid":`extension-run-allowed-${t.id}`,children:[e.jsx(O,{className:"size-3.5 shrink-0","aria-hidden":"true"}),e.jsx("span",{children:"You allowed this to run inside DorkOS."}),e.jsx("button",{type:"button",onClick:()=>c(t.id,!1),disabled:x,className:"hover:text-foreground underline underline-offset-2 disabled:opacity-50",children:"Stop it"})]}):e.jsxs("div",{className:"space-y-2 rounded-lg border border-amber-500/40 bg-amber-500/5 p-3","data-testid":`extension-needs-approval-${t.id}`,children:[e.jsx("p",{className:"text-sm font-medium",children:"This extension is waiting for you"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:D?"None of it has run yet. Allowing it lets its code run inside DorkOS, both on this machine, where it can reach anything DorkOS can, and on this page, signed in as you. Allow it only if you trust where it came from.":"None of it has run yet. Allowing it lets its code run on this page, signed in as you, so it can do anything you can do in DorkOS. Allow it only if you trust where it came from."}),e.jsx(C,{size:"sm",onClick:()=>c(t.id,!0),disabled:x,"data-testid":`extension-approve-run-${t.id}`,children:"Allow it to run"})]})),e.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-2 text-xs",children:[e.jsx(w,{variant:"outline",children:j}),y&&e.jsx(w,{variant:y==="Error"?"destructive":"secondary","data-testid":`extension-health-${t.id}`,children:y}),n.author&&e.jsx("span",{children:n.author})]})]}),e.jsx("div",{className:"flex shrink-0 items-center pt-0.5",children:v?e.jsx(P,{checked:u,onCheckedChange:E=>b(t.id,E),disabled:!l||m,"aria-label":`${u?"Disable":"Enable"} ${n.name}`}):e.jsx(w,{variant:"secondary",title:"This extension is required and is always on","data-testid":`extension-required-${t.id}`,children:"Required"})})]})})}function X(){const{data:t=[],isLoading:b}=M(),m=B(),c=L(),x=_(),n=k(!0),i=k(!1),j=new Set([...m.variables?[m.variables]:[],...c.variables?[c.variables]:[]]),o=new Set([...n.isPending&&n.variables?[n.variables]:[],...i.isPending&&i.variables?[i.variables]:[]]);function p(s,a){(a?n:i).mutate(s,{onSuccess:l=>{const v=l.extension.manifest.name;h.success(a?`${v} can now run inside DorkOS`:`${v} has stopped running inside DorkOS`)},onError:l=>{h.error(a?"Couldn’t let it run.":"Couldn’t stop it running.",{description:l.message})}})}async function g(s,a){(a?m:c).mutate(s,{onError:l=>{h.error(a?"Couldn’t turn that on.":"Couldn’t turn that off.",{description:l.message})}})}function N(){x.mutate(void 0,{onSuccess:s=>{h.success(`Reloaded ${s.length} extension${s.length===1?"":"s"}`)},onError:s=>{h.error("Couldn’t reload your extensions.",{description:s.message})}})}if(b)return e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm",children:"Loading extensions…"});const d=t.filter(s=>s.origin==="core"),f=t.filter(s=>s.origin==="user"),u=s=>e.jsx(U,{extension:s,onToggle:g,isToggling:j.has(s.id),onSetRunApproval:p,isSettingApproval:o.has(s.id)},s.id);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Extensions add new UI and capabilities to DorkOS. Core extensions ship with DorkOS; installed extensions live in"," ",e.jsx("code",{className:"bg-muted rounded px-1",children:"~/.dork/extensions/"})," or"," ",e.jsx("code",{className:"bg-muted rounded px-1",children:".dork/extensions/"})," in your project."]}),t.length===0?e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm","data-testid":"no-extensions",children:e.jsx("p",{children:"No extensions installed."})}):e.jsxs(e.Fragment,{children:[d.length>0&&e.jsxs("section",{className:"space-y-3","data-testid":"core-extensions-section",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Core extensions"}),e.jsx("div",{className:"space-y-3",children:d.map(u)})]}),e.jsxs("section",{className:"space-y-3","data-testid":"installed-extensions-section",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Installed extensions"}),f.length>0?e.jsx("div",{className:"space-y-3",children:f.map(u)}):e.jsxs("div",{className:"text-muted-foreground rounded-xl border border-dashed p-4 text-sm","data-testid":"no-installed-extensions",children:["No extensions installed yet. Browse"," ",e.jsx("span",{className:"text-foreground font-medium",children:"Marketplace"})," to add some."]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(C,{variant:"outline",size:"sm",onClick:N,disabled:x.isPending,"data-testid":"reload-extensions-button",children:[e.jsx(q,{className:S("mr-2 size-4",x.isPending&&"animate-spin")}),"Reload extensions"]})})]})}export{G as ExtensionEventBridge,J as ExtensionLoader,K as ExtensionProvider,X as ExtensionsSettingsTab,Q as createExtensionAPI,W as createExtensionEventBridge,Z as useExtensions};
|