PageSourceSearch

https://www.007icu.top/assets/device-C93cnKgk.js

js 007icu.top collected 2026-10-09 04:33:20 UTC 10,100 bytes, 1 lines download raw bytes

1import{n as e}from"./rolldown-runtime-CMxvf4Kt.js";import{O as t,S as n,w as r,x as i}from"../vendor/vendor-data-runtime-nLFaCKB0.js";import{a,c as ee,l as te,o as ne,s as re,u as ie}from"./agent-Doq2Q6Wt.js";import{g as ae}from"./app-const-BzFqCjOv.js";import{r as o,s,t as c}from"./swr-C_leGIiU.js";import{P as oe,h as l,j as u}from"./keys-BAizXMAH.js";import{n as d,s as f}from"./client-DUGXaJW2.js";import{n as se,t as ce}from"./ipc-XkRXMd72.js";var p,m,h=e((()=>{se(),p=class{get ipc(){return ce()}async detectRepoType(e){return this.ipc.git.detectRepoType(e)}async getGitBranch(e){return this.ipc.git.getGitBranch(e)}async getLinkedPullRequest(e){return this.ipc.git.getLinkedPullRequest(e)}async listGitBranches(e){return this.ipc.git.listGitBranches(e)}async listGitRemoteBranches(e){return this.ipc.git.listGitRemoteBranches(e)}async listGitWorktrees(e){return this.ipc.git.listGitWorktrees(e)}async getGitWorkingTreeStatus(e){return this.ipc.git.getGitWorkingTreeStatus(e)}async getGitWorkingTreeFiles(e){return this.ipc.git.getGitWorkingTreeFiles(e)}async getGitWorkingTreePatches(e){return this.ipc.git.getGitWorkingTreePatches(e)}async getGitBranchDiff(e){return this.ipc.git.getGitBranchDiff(e)}async getGitAheadBehind(e){return this.ipc.git.getGitAheadBehind(e)}async checkoutGitBranch(e){return this.ipc.git.checkoutGitBranch(e)}async pullGitBranch(e){return this.ipc.git.pullGitBranch(e)}async pushGitBranch(e){return this.ipc.git.pushGitBranch(e)}async revertGitFile(e){return this.ipc.git.revertGitFile(e)}async renameGitBranch(e){return this.ipc.git.renameGitBranch(e)}async deleteGitBranch(e){return this.ipc.git.deleteGitBranch(e)}async removeGitWorktree(e){return this.ipc.git.removeGitWorktree(e)}async addGitWorktree(e){return this.ipc.git.addGitWorktree(e)}},m=new p})),g,_,v=e((()=>{d(),h(),g=class{listGitBranches({deviceId:e,path:t}){return e?f.device.listGitBranches.query({deviceId:e,path:t}):m.listGitBranches(t)}checkoutGitBranch({branch:e,create:t,deviceId:n,path:r}){return n?f.device.checkoutGitBranch.mutate({branch:e,create:t,deviceId:n,path:r}):m.checkoutGitBranch({branch:e,create:t,path:r})}renameGitBranch({deviceId:e,from:t,path:n,to:r}){return e?f.device.renameGitBranch.mutate({deviceId:e,from:t,path:n,to:r}):m.renameGitBranch({from:t,path:n,to:r})}deleteGitBranch({branch:e,deviceId:t,path:n}){return t?f.device.deleteGitBranch.mutate({branch:e,deviceId:t,path:n}):m.deleteGitBranch({branch:e,path:n})}removeGitWorktree({deviceId:e,path:t,worktreePath:n}){return e?f.device.removeGitWorktree.mutate({deviceId:e,path:t,worktreePath:n}):m.removeGitWorktree({path:t,worktreePath:n})}addGitWorktree({branch:e,deviceId:t,path:n,worktreePath:r}){return t?f.device.addGitWorktree.mutate({branch:e,deviceId:t,path:n}):m.addGitWorktree({branch:e,path:n,worktreePath:r})}pullGitBranch({deviceId:e,path:t}){return e?f.device.pullGitBranch.mutate({deviceId:e,path:t}):m.pullGitBranch({path:t})}pushGitBranch({deviceId:e,path:t}){return e?f.device.pushGitBranch.mutate({deviceId:e,path:t}):m.pushGitBranch({path:t})}async getGitBranch({deviceId:e,path:t}){let n=e?await f.device.gitBranch.query({deviceId:e,path:t}):await m.getGitBranch(t);return{branch:n?.branch,detached:n?.detached,upstream:n?.upstream}}async getLinkedPullRequest({branch:e,deviceId:t,path:n,pullRequestNumber:r}){let i=t?await f.device.gitLinkedPullRequest.query({branch:e,deviceId:t,path:n,pullRequestNumber:r}):await m.getLinkedPullRequest({branch:e,path:n,pullRequestNumber:r});if(i)return{extraCount:i.extraCount,ghMissing:i.status===`gh-missing`,pullRequest:i.pullRequest,pullRequestStatus:i.status,upstream:i.upstream}}async getGitWorkingTreeStatus({deviceId:e,path:t}){return e?await f.device.gitWorkingTreeStatus.query({deviceId:e,path:t})??void 0:m.getGitWorkingTreeStatus(t)}async getGitAheadBehind({deviceId:e,path:t}){return e?await f.device.gitAheadBehind.query({deviceId:e,path:t})??void 0:m.getGitAheadBehind(t)}async getGitWorkingTreePatches({deviceId:e,path:t}){return e?await f.device.getGitWorkingTreePatches.query({deviceId:e,path:t})??void 0:m.getGitWorkingTreePatches(t)}async getGitWorkingTreeFiles({deviceId:e,path:t}){return e?await f.device.getGitWorkingTreeFiles.query({deviceId:e,path:t})??void 0:m.getGitWorkingTreeFiles(t)}async getGitBranchDiff({baseRef:e,deviceId:t,path:n}){return t?await f.device.getGitBranchDiff.query({baseRef:e,deviceId:t,path:n})??void 0:m.getGitBranchDiff({baseRef:e,path:n})}listGitRemoteBranches({deviceId:e,path:t}){return e?f.device.listGitRemoteBranches.query({deviceId:e,path:t}):m.listGitRemoteBranches(t)}listGitWorktrees({deviceId:e,path:t}){return e?f.device.listGitWorktrees.query({deviceId:e,path:t}):m.listGitWorktrees(t)}revertGitFile({deviceId:e,filePath:t,path:n}){return e?f.device.revertGitFile.mutate({deviceId:e,filePath:t,path:n}):m.revertGitFile({filePath:t,path:n})}},_=new g})),y,b,x=e((()=>{y=(e,t=[],n=20)=>{let r=e.path.trim();if(!r)return[...t];let i=t.find(e=>e.path===r),a={...e,path:r};return!a.workspace&&i?.workspace&&(a.workspace=i.workspace),!a.workspaceScannedAt&&i?.workspaceScannedAt&&(a.workspaceScannedAt=i.workspaceScannedAt),[a,...t.filter(e=>e.path!==r)].slice(0,n)},b=(e,t=[])=>t.filter(t=>t.path!==e)})),S,C,w,T,E,D,O,k,A,j,M,N,le,P,F,I=e((()=>{ae(),c(),u(),v(),S=10*1e3,C=30*1e3,w=(e,t)=>!!t&&(!!e||!1),T=async(e,t)=>{let n=await _.getGitWorkingTreePatches({deviceId:t,path:e});return{mode:`unstaged`,patches:n?.patches??[],submodules:n?.submodules}},E=async(e,t,n)=>{let r=await _.getGitBranchDiff({baseRef:t,deviceId:n,path:e});return{baseRef:r?.baseRef,headRef:r?.headRef,mode:`branch`,patches:r?.patches??[],submodules:r?.submodules}},D=(e,t)=>t?e===`branch`?C:S:0,O=({baseRef:e,deviceId:t,dirPath:n,mode:r})=>n?l.gitReviewPatches(t??`local`,n,r,e??``):null,k=async({baseRef:e,deviceId:t,dirPath:n,mode:r})=>{if(!n)return;let i=t??`local`;
1await Promise.all([s(l.gitReviewPatches(i,n,r,e??``)),s(l.gitWorkingTreeStatus(i,n)),s(l.gitAheadBehind(i,n)),s(oe.gitWorkingTreeFiles(t,n))])},A=(e,t,n,r,i=!0)=>o(i&&e?O({baseRef:n,deviceId:r,dirPath:e,mode:t}):null,()=>t===`branch`?E(e,n,r):T(e,r),{focusThrottleInterval:t===`branch`?30*1e3:5*1e3,refreshInterval:D(t,i),refreshWhenHidden:!1,revalidateOnFocus:!0,revalidateOnReconnect:!0,shouldRetryOnError:!1}),j=(e,t)=>o(w(e,t)?l.gitBranch(e??`local`,t):null,()=>_.getGitBranch({deviceId:e,path:t}),{dedupingInterval:2*1e3,shouldRetryOnError:!1}),M=(e,t,n,r=!1)=>o(r&&n&&w(e,t)?l.gitLinkedPR(e??`local`,t,n):null,()=>_.getLinkedPullRequest({branch:n,deviceId:e,path:t}),{dedupingInterval:60*1e3,focusThrottleInterval:60*1e3,shouldRetryOnError:!1}),N=(e,t)=>o(w(e,t)?l.gitWorkingTreeStatus(e??`local`,t):null,()=>_.getGitWorkingTreeStatus({deviceId:e,path:t}),{focusThrottleInterval:5*1e3,revalidateOnFocus:!0,shouldRetryOnError:!1}),le=(e,t)=>o(w(e,t)?l.gitAheadBehind(e??`local`,t):null,()=>_.getGitAheadBehind({deviceId:e,path:t}),{focusThrottleInterval:5*1e3,revalidateOnFocus:!0,shouldRetryOnError:!1}),P=(e,t)=>o(w(e,t)?l.gitWorktrees(e??`local`,t):null,()=>_.listGitWorktrees({deviceId:e,path:t}),{focusThrottleInterval:5*1e3,revalidateOnFocus:!0,shouldRetryOnError:!1}),F=(e,t,n)=>o(t&&e?l.gitRemoteBranches(n??`local`,e):null,()=>_.listGitRemoteBranches({deviceId:n,path:e}),{revalidateOnFocus:!1,shouldRetryOnError:!1})})),L,R,z,B,V,H=e((()=>{L=e=>e.devices,R=e=>t=>e?t.devices.find(t=>t.deviceId===e):void 0,z=e=>t=>R(e)(t)?.defaultCwd??void 0,B=e=>t=>R(e)(t)?.workingDirs??[],V={deviceList:L,getDeviceById:R,getDeviceDefaultCwd:z,getDeviceWorkingDirs:B}})),U,W,G=e((()=>{d(),U=class{listDevices(){return f.device.listDevices.query()}updateDevice(e){return f.device.updateDevice.mutate(e)}statPath(e,t){return f.device.statPath.query({deviceId:e,path:t})}checkCapability(e){return f.device.checkCapability.query(e)}getAgentProfile(e){return f.device.getAgentProfile.query(e)}},W=new U})),K,q,ue=e((()=>{c(),u(),G(),x(),K=(e,t,n)=>new q(e,t,n),q=class{#e;#t;constructor(e,t,n){this.#t=e,this.#e=t}updateDeviceCwd=async(e,t,n={})=>{let r=t.path.trim();if(!r)return;let i=n.setDefault??!0,a=y(t,this.#e().devices.find(t=>t.deviceId===e)?.workingDirs??[]);this.#t({devices:this.#e().devices.map(t=>t.deviceId===e?{...t,...i?{defaultCwd:r}:{},workingDirs:a}:t)},!1,`updateDeviceCwd`);try{await W.updateDevice({deviceId:e,...i?{defaultCwd:r}:{},workingDirs:a})}finally{await s(l.listDevices())}};clearDeviceDefaultCwd=async e=>{let t=this.#e().devices.find(t=>t.deviceId===e);if(!t?.defaultCwd)return;let n=t.defaultCwd;this.#t({devices:this.#e().devices.map(t=>t.deviceId===e?{...t,defaultCwd:null}:t)},!1,`clearDeviceDefaultCwd`);try{await W.updateDevice({defaultCwd:null,deviceId:e})}catch(t){throw this.#t({devices:this.#e().devices.map(t=>t.deviceId===e?{...t,defaultCwd:n}:t)},!1,`clearDeviceDefaultCwd/error`),t}finally{await s(l.listDevices())}};migrateLocalRecentsToDevice=async(e,t)=>{if(t.length===0)return;let n=this.#e().devices.find(t=>t.deviceId===e)?.workingDirs??[],r=new Set(n.map(e=>e.path)),i=[...n,...t.filter(e=>!r.has(e.path))].slice(0,20);this.#t({devices:this.#e().devices.map(t=>t.deviceId===e?{...t,workingDirs:i}:t)},!1,`migrateLocalRecents`);try{await W.updateDevice({deviceId:e,workingDirs:i})}finally{await s(l.listDevices())}};removeDeviceWorkingDir=async(e,t)=>{let n=this.#e().devices.find(t=>t.deviceId===e);if(!n)return;let r=b(t,n.workingDirs??[]);this.#t({devices:this.#e().devices.map(t=>t.deviceId===e?{...t,workingDirs:r}:t)},!1,`removeDeviceWorkingDir`);try{await W.updateDevice({deviceId:e,workingDirs:r})}finally{await s(l.listDevices())}};useFetchDevices=(e=!1)=>o(e?l.listDevices():null,()=>W.listDevices(),{fallbackData:[],onSuccess:e=>{this.#t({devices:e,isDevicesInit:!0},!1,`fetchDevices`)}})}})),J,de=e((()=>{J={devices:[],isDevicesInit:!1}})),Y,X,Z,Q,$=e((()=>{r(),n(),ie(),ee(),ne(),ue(),de(),Y=(...e)=>({...J,...a([K(...e)])}),X=te(`device`),Z=i()(X(Y),t),re(`device`,Z),Q=()=>Z.getState()})),fe=e((()=>{x(),I(),H(),$()}));export{h as C,m as S,A as _,W as a,_ as b,H as c,le as d,j as f,F as g,P as h,Z as i,I as l,N as m,Q as n,G as o,M as p,$ as r,V as s,fe as t,k as u,x as v,v as x,y};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.