@sma1lboy/rove 0.9.273 → 0.9.276
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/cli/chunk-0d7517kk.js +6 -0
- package/dist/cli/{chunk-55ajzrj6.js → chunk-0r1jf8m9.js} +1 -1
- package/dist/cli/{chunk-sap4tggv.js → chunk-1ca2j9w6.js} +2 -2
- package/dist/cli/chunk-1eef3z5v.js +3 -0
- package/dist/cli/{chunk-655kt3e1.js → chunk-1jjqk7sq.js} +1 -1
- package/dist/cli/chunk-1n03wzx4.js +3 -0
- package/dist/cli/{chunk-9trbc3kj.js → chunk-22rgewg0.js} +2 -2
- package/dist/cli/{chunk-jwedmkm8.js → chunk-283vd9h7.js} +1 -1
- package/dist/cli/chunk-2kqxz9a4.js +5 -0
- package/dist/cli/chunk-2xsxcdp6.js +3 -0
- package/dist/cli/{chunk-bj6sa371.js → chunk-372g44dg.js} +1 -1
- package/dist/cli/{chunk-4dxc29mm.js → chunk-387w0db1.js} +1 -1
- package/dist/cli/{chunk-bm0qe5gy.js → chunk-3xkhcfet.js} +2 -2
- package/dist/cli/{chunk-qvnr8c18.js → chunk-3y9xzbqh.js} +1 -1
- package/dist/cli/chunk-4117kgmx.js +2 -0
- package/dist/cli/chunk-4a05fgdh.js +2 -0
- package/dist/cli/chunk-4dt1gfb3.js +3 -0
- package/dist/cli/{chunk-ycd28edp.js → chunk-4xvmrg86.js} +3 -4
- package/dist/cli/{chunk-jbdg5ggt.js → chunk-511103e8.js} +1 -1
- package/dist/cli/chunk-59p3h5e9.js +2 -0
- package/dist/cli/{chunk-80t9z2b2.js → chunk-5e9y8aw5.js} +1 -1
- package/dist/cli/chunk-5nvg3ek8.js +3 -0
- package/dist/cli/chunk-5yfffvqe.js +2 -0
- package/dist/cli/{chunk-nyn1j7cf.js → chunk-63cwjceg.js} +1 -1
- package/dist/cli/{chunk-jwta8rp8.js → chunk-6mtfafaw.js} +1 -1
- package/dist/cli/{chunk-bmg5y8eh.js → chunk-6xga1a2d.js} +1 -1
- package/dist/cli/{chunk-wqvmvgaf.js → chunk-745pg3xm.js} +1 -1
- package/dist/cli/{chunk-adj65prq.js → chunk-81thm1eb.js} +4 -4
- package/dist/cli/chunk-82apkcrk.js +5 -0
- package/dist/cli/chunk-84pvn784.js +2 -0
- package/dist/cli/{chunk-1exwrmjd.js → chunk-883fyezq.js} +1 -1
- package/dist/cli/{chunk-63t3sh8c.js → chunk-8dd60adw.js} +1 -1
- package/dist/cli/{chunk-qfe1wf5c.js → chunk-91tcwxph.js} +1 -1
- package/dist/cli/{chunk-fkn6z4yq.js → chunk-9c3brkb3.js} +1 -1
- package/dist/cli/chunk-9gh8kgjs.js +2 -0
- package/dist/cli/{chunk-h8t4xg1p.js → chunk-9rj2fx6v.js} +1 -1
- package/dist/cli/{chunk-qsqde2kj.js → chunk-a4r45qdn.js} +1 -1
- package/dist/cli/{chunk-p6jw0zcd.js → chunk-agvtzads.js} +1 -1
- package/dist/cli/{chunk-gcg5h667.js → chunk-awh7np6x.js} +1 -1
- package/dist/cli/chunk-b035pej7.js +20 -0
- package/dist/cli/{chunk-ez438kn3.js → chunk-b95q6zhk.js} +1 -1
- package/dist/cli/chunk-brgfsm5v.js +2 -0
- package/dist/cli/chunk-bw98jn7g.js +18 -0
- package/dist/cli/{chunk-bexnp6g4.js → chunk-c63vgbkw.js} +1 -1
- package/dist/cli/{chunk-8sggyn8y.js → chunk-c6fy8xew.js} +1 -1
- package/dist/cli/chunk-c7mz2aq0.js +2 -0
- package/dist/cli/{chunk-ec7f3wcm.js → chunk-cbrt4s7m.js} +2 -2
- package/dist/cli/chunk-ccwe9n56.js +19 -0
- package/dist/cli/chunk-cfzg8q3e.js +4 -0
- package/dist/cli/{chunk-387ecqb8.js → chunk-d0hpes59.js} +1 -1
- package/dist/cli/{chunk-edrxs4cy.js → chunk-d7f022eb.js} +5 -5
- package/dist/cli/{chunk-fy4eyzbt.js → chunk-d7xbm9jp.js} +1 -1
- package/dist/cli/{chunk-3v9s3bcz.js → chunk-d9643dwf.js} +1 -1
- package/dist/cli/{chunk-x20bs6bs.js → chunk-dgx02565.js} +1 -1
- package/dist/cli/{chunk-ecrw211n.js → chunk-dt676ks9.js} +1 -1
- package/dist/cli/{chunk-vw34sdkk.js → chunk-e3cd4qd2.js} +2 -2
- package/dist/cli/chunk-e3t1zbv1.js +5 -0
- package/dist/cli/{chunk-0rrmz6k6.js → chunk-eege1x0a.js} +1 -1
- package/dist/cli/{chunk-t34kjg5y.js → chunk-ehm9abge.js} +4 -3
- package/dist/cli/{chunk-mmq6922s.js → chunk-eq7vey2j.js} +2 -2
- package/dist/cli/chunk-eyvw70yb.js +2 -0
- package/dist/cli/{chunk-jcrg7pjv.js → chunk-f76gzvq3.js} +1 -1
- package/dist/cli/{chunk-xkmdxcjg.js → chunk-fn7ffyam.js} +1 -1
- package/dist/cli/chunk-g4dtqbrj.js +2 -0
- package/dist/cli/chunk-g9ba25q5.js +3 -0
- package/dist/cli/{chunk-22d4fjjb.js → chunk-gafkp74h.js} +1 -1
- package/dist/cli/chunk-gctqthxq.js +97 -0
- package/dist/cli/{chunk-f6hgkc7g.js → chunk-gq57he03.js} +1 -1
- package/dist/cli/chunk-h2gznz46.js +2 -0
- package/dist/cli/{chunk-03rbg95q.js → chunk-h64rsbrx.js} +5 -5
- package/dist/cli/{chunk-5dd7trgf.js → chunk-h7vwn62z.js} +1 -1
- package/dist/cli/chunk-hcvp84b3.js +4 -0
- package/dist/cli/chunk-hhcmzs67.js +78 -0
- package/dist/cli/chunk-hmjg1qh3.js +2 -0
- package/dist/cli/{chunk-jd7p0y5x.js → chunk-j9b285x6.js} +1 -1
- package/dist/cli/{chunk-k5k2jpxk.js → chunk-jckx79gk.js} +3 -3
- package/dist/cli/{chunk-a4x8h7zv.js → chunk-je80r59s.js} +1 -1
- package/dist/cli/{chunk-1n7tcq6a.js → chunk-jfcn77n9.js} +1 -1
- package/dist/cli/chunk-jn10xeft.js +2 -0
- package/dist/cli/{chunk-g263457v.js → chunk-k1pwp155.js} +1 -1
- package/dist/cli/chunk-k235z3ct.js +2 -0
- package/dist/cli/{chunk-ms92andd.js → chunk-m2a19yt4.js} +1 -1
- package/dist/cli/{chunk-x7yxf5b5.js → chunk-m73x5nry.js} +3 -3
- package/dist/cli/chunk-ma21srvx.js +3 -0
- package/dist/cli/chunk-mdc7b01e.js +3 -0
- package/dist/cli/{chunk-kgs56yns.js → chunk-mkfc9a09.js} +1 -1
- package/dist/cli/{chunk-xgm43xm3.js → chunk-mq88bvj6.js} +1 -1
- package/dist/cli/chunk-mqfvzdpr.js +3 -0
- package/dist/cli/{chunk-98s0fhmv.js → chunk-mz1ffkqb.js} +3 -3
- package/dist/cli/{chunk-1rjq808h.js → chunk-n0rdn2fn.js} +1 -1
- package/dist/cli/{chunk-sza3tyhs.js → chunk-n6marmjn.js} +1 -1
- package/dist/cli/chunk-n8t4y0bj.js +10 -0
- package/dist/cli/chunk-nbpq1tkx.js +98 -0
- package/dist/cli/{chunk-x6xevrtz.js → chunk-ne6x6g2c.js} +1 -1
- package/dist/cli/{chunk-fexzfgd1.js → chunk-nr7e3e82.js} +1 -1
- package/dist/cli/chunk-ns35rdyk.js +3 -0
- package/dist/cli/chunk-pap7k3b4.js +3 -0
- package/dist/cli/chunk-pdq3ya2e.js +3 -0
- package/dist/cli/chunk-q8ffd1pc.js +3 -0
- package/dist/cli/{chunk-39sfhppm.js → chunk-qna1s1r4.js} +1 -1
- package/dist/cli/{chunk-tjj9bt7n.js → chunk-qqr4tfhk.js} +1 -1
- package/dist/cli/chunk-r7kmn4js.js +2 -0
- package/dist/cli/chunk-r7ntkd6y.js +15 -0
- package/dist/cli/{chunk-rtpa8hg3.js → chunk-rjfdzjhj.js} +1 -1
- package/dist/cli/chunk-syfs63r2.js +2 -0
- package/dist/cli/{chunk-4hnz77xf.js → chunk-syn0tfwy.js} +1 -1
- package/dist/cli/chunk-t4qr9sv4.js +4 -0
- package/dist/cli/{chunk-6jk2khme.js → chunk-t52gzaeb.js} +1 -1
- package/dist/cli/chunk-teh40faw.js +1 -1
- package/dist/cli/{chunk-gqh6atvp.js → chunk-tjhw09bz.js} +1 -1
- package/dist/cli/chunk-tq0h3vy6.js +3 -0
- package/dist/cli/{chunk-snqa07h6.js → chunk-tvdrvgen.js} +1 -1
- package/dist/cli/chunk-tz373e5w.js +3 -0
- package/dist/cli/chunk-v1r83m3n.js +3 -0
- package/dist/cli/chunk-vp171as9.js +65 -0
- package/dist/cli/chunk-vtcr71fs.js +8 -0
- package/dist/cli/{chunk-zaw71cf4.js → chunk-vz0f8e8q.js} +1 -1
- package/dist/cli/chunk-w77s2df8.js +3 -0
- package/dist/cli/chunk-w7v4jzwy.js +3 -0
- package/dist/cli/chunk-wvqn1t55.js +2 -0
- package/dist/cli/{chunk-r40aj7z6.js → chunk-x1ghdmp1.js} +1 -1
- package/dist/cli/{chunk-zxkjpfp5.js → chunk-x3n4y5sp.js} +1 -1
- package/dist/cli/{chunk-qnaxnx5w.js → chunk-xb3p11g0.js} +1 -1
- package/dist/cli/{chunk-yzkhwn31.js → chunk-xd93fm1k.js} +1 -1
- package/dist/cli/chunk-xn2f56tg.js +3 -0
- package/dist/cli/chunk-xv3217yv.js +2 -0
- package/dist/cli/chunk-yhytkwpv.js +2 -0
- package/dist/cli/{chunk-hfdk7j28.js → chunk-yk9b8zgn.js} +1 -1
- package/dist/cli/chunk-zat16a83.js +2 -0
- package/dist/cli/chunk-zcrs4sm2.js +3 -0
- package/dist/cli/{chunk-kx53jjee.js → chunk-zkp6nty3.js} +8 -6
- package/dist/cli/index.js +5 -5
- package/dist/cli/pty-host-node.mjs +258 -29
- package/dist/cli/rove-run.js +1 -1
- package/dist/cli/rove.js +1 -1
- package/dist/completions/rove.bash +2 -2
- package/dist/completions/rove.fish +2 -2
- package/dist/completions/rove.zsh +2 -2
- package/dist/skills/rove/SKILL.md +23 -9
- package/dist/skills/rove/references/api-flags.md +20 -11
- package/dist/web/assets/index-C5t3gibI.css +1 -0
- package/dist/web/assets/index-Djp7M6r8.js +122 -0
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +52 -0
- package/package.json +3 -3
- package/dist/cli/chunk-0ppkvphp.js +0 -2
- package/dist/cli/chunk-11wyec8z.js +0 -2
- package/dist/cli/chunk-15fp4p9v.js +0 -15
- package/dist/cli/chunk-1ffqacz9.js +0 -3
- package/dist/cli/chunk-1h1ejknz.js +0 -2
- package/dist/cli/chunk-4d50eg3p.js +0 -97
- package/dist/cli/chunk-5c4vr45n.js +0 -4
- package/dist/cli/chunk-5zsdjrgz.js +0 -4
- package/dist/cli/chunk-64f3ncxx.js +0 -2
- package/dist/cli/chunk-68wpp5y8.js +0 -20
- package/dist/cli/chunk-6d3espha.js +0 -10
- package/dist/cli/chunk-6h4qdckd.js +0 -3
- package/dist/cli/chunk-6jj82bej.js +0 -2
- package/dist/cli/chunk-783d1ba0.js +0 -3
- package/dist/cli/chunk-78v1q5mz.js +0 -2
- package/dist/cli/chunk-7z463zkx.js +0 -3
- package/dist/cli/chunk-8zw085pc.js +0 -3
- package/dist/cli/chunk-97m9nyw7.js +0 -2
- package/dist/cli/chunk-9bae7f3m.js +0 -4
- package/dist/cli/chunk-9eqh0yph.js +0 -2
- package/dist/cli/chunk-ajad94vy.js +0 -2
- package/dist/cli/chunk-b5c7p22a.js +0 -2
- package/dist/cli/chunk-b5pytfgm.js +0 -2
- package/dist/cli/chunk-b68dd36h.js +0 -3
- package/dist/cli/chunk-bbksmb5a.js +0 -3
- package/dist/cli/chunk-bp0en3f7.js +0 -2
- package/dist/cli/chunk-cyzp2btw.js +0 -63
- package/dist/cli/chunk-e01321zn.js +0 -5
- package/dist/cli/chunk-f5fk30x1.js +0 -2
- package/dist/cli/chunk-fvvb0072.js +0 -3
- package/dist/cli/chunk-g53yqr82.js +0 -78
- package/dist/cli/chunk-k67vbszb.js +0 -3
- package/dist/cli/chunk-k9zarq1x.js +0 -96
- package/dist/cli/chunk-m1n1rszx.js +0 -2
- package/dist/cli/chunk-n2ejvjrd.js +0 -3
- package/dist/cli/chunk-nf3kg9rz.js +0 -25
- package/dist/cli/chunk-q9zgj6kw.js +0 -3
- package/dist/cli/chunk-qd72kqg9.js +0 -20
- package/dist/cli/chunk-ra18rjj4.js +0 -20
- package/dist/cli/chunk-rkn2fby6.js +0 -3
- package/dist/cli/chunk-rzef6szc.js +0 -3
- package/dist/cli/chunk-sqxdfzdq.js +0 -5
- package/dist/cli/chunk-sz2xs0a2.js +0 -4
- package/dist/cli/chunk-vjp7drne.js +0 -2
- package/dist/cli/chunk-w2xdmnnf.js +0 -2
- package/dist/cli/chunk-xmqv1zx6.js +0 -2
- package/dist/cli/chunk-xn7bk4f9.js +0 -3
- package/dist/cli/chunk-zybjm7d5.js +0 -2
- package/dist/web/assets/index-Bc0LgdLr.js +0 -113
- package/dist/web/assets/index-sA2EEQJw.css +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{protocolEntry}from"./chunk-
|
|
2
|
+
import{readTabsSnapshot}from"./chunk-pdq3ya2e.js";import{protocolEntry,sessionProtocol}from"./chunk-1n03wzx4.js";import{execHostForWorktreePath}from"./chunk-895yqjjz.js";import{supportsStructuredHistory}from"./chunk-d7f022eb.js";import{getPersistedString,getPersistedValue}from"./chunk-rfp0ayra.js";import{parseNumstatRows}from"./chunk-t7j8g9f6.js";import{parsePorcelainRows,unquoteGitPath}from"./chunk-dmzg9zdc.js";import{recordSpawn}from"./chunk-40dgv828.js";import{readHeadSha,resolveGitDirs}from"./chunk-kg9kmwt9.js";import{READ_ONLY_GIT_ENV}from"./chunk-6xppe9bj.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{t}from"./chunk-372g44dg.js";import{rollupPr}from"./chunk-cbrt4s7m.js";import{isObject}from"./chunk-7ghwdjdc.js";import{acquireSync,releaseSync}from"./chunk-bejhca6z.js";import{secretsPath}from"./chunk-z1nj22va.js";import{readFile,stat}from"fs/promises";var PER_SESSION=3,SNIPPET_RADIUS=60,READ_BATCH=8,READ_BUDGET_MS=1500;function snippetOf(text,needle){let flat=text.replace(/\s+/g," "),at=flat.toLowerCase().indexOf(needle.toLowerCase());if(at<0)return null;let start=Math.max(0,at-SNIPPET_RADIUS),end=Math.min(flat.length,at+needle.length+SNIPPET_RADIUS);return`${start>0?"\u2026":""}${flat.slice(start,end).trim()}${end<flat.length?"\u2026":""}`}function matchMessages(messages,needle,max){let out=[];for(let m of messages){if(m.role!=="user"&&m.role!=="assistant")continue;for(let b of m.blocks){if(b.type!=="text")continue;let snippet=snippetOf(b.text,needle);if(snippet===null)continue;out.push({role:m.role,at:m.timestamp,snippet});break}if(out.length>=max)break}return out}function prefilterToken(query){return query.split(/["\\\s]+/).reduce((a,b)=>b.length>a.length?b:a,"")}async function candidatesOf(tasks,skipped){let claimed=new Set,pinned=[],unpinned=[],sharedDirs=new Map;for(let t2 of tasks)if(t2.worktreePath)sharedDirs.set(t2.worktreePath,(sharedDirs.get(t2.worktreePath)??0)+1);for(let task of tasks){if(task.origin){skipped.push({taskId:task.id,reason:"other-machine"});continue}let vendor=task.vendor,tabs=(readTabsSnapshot(task.id)?.tabs??[]).filter((t2)=>t2.kind==="engine"),any=!1;for(let tab of tabs){let tabVendor=tab.vendor??vendor;if(!tabVendor||!supportsStructuredHistory(sessionProtocol(tabVendor))||!tab.sessionId)continue;if(claimed.has(tab.sessionId))continue;claimed.add(tab.sessionId);let reader=protocolEntry(tabVendor).history;pinned.push({task,reader,sessionId:tab.sessionId,tabId:tab.id,path:null,mtimeMs:0}),any=!0}if(any)continue;if(!vendor||!supportsStructuredHistory(sessionProtocol(vendor))){skipped.push({taskId:task.id,reason:"engine-unsupported"});continue}let worktree=task.worktreePath;if(worktree&&(sharedDirs.get(worktree)??0)===1)unpinned.push({task,reader:protocolEntry(vendor).history,worktree})}let listed=await Promise.all(unpinned.map(async({task,reader,worktree})=>(await reader.listSessionIdsForWorktree(worktree)).filter((id)=>!claimed.has(id)).map((sessionId)=>({task,reader,sessionId,path:null,mtimeMs:0})))),all=[...pinned,...listed.flat()];return Promise.all(all.map(async(c)=>{let worktree=c.task.worktreePath||c.task.repo,path=await c.reader.transcriptPath(c.sessionId,worktree).catch(()=>null),mtimeMs=path?await stat(path).then((s)=>s.mtimeMs,()=>0):0;return{...c,path,mtimeMs}}))}async function filesContaining(paths,token){if(paths.length===0||token==="")return new Set(paths);let rg=Bun.which("rg");if(rg){let proc=Bun.spawn([rg,"-l","-i","-F","--no-messages","--",token,...paths],{stdout:"pipe",stderr:"ignore"}),out=await new Response(proc.stdout).text();return await proc.exited,new Set(out.split(`
|
|
3
|
+
`).filter(Boolean))}let needle=token.toLowerCase(),hits=new Set;for(let p of paths)if((await readFile(p,"utf8").catch(()=>"")).toLowerCase().includes(needle))hits.add(p);return hits}async function searchTasks(tasks,query,limit,budgetMs=READ_BUDGET_MS){let started=Date.now(),skipped=[],candidates=await candidatesOf(tasks,skipped),withPath=candidates.filter((c)=>c.path!==null).map((c)=>c.path),hits=await filesContaining(withPath,prefilterToken(query)),toRead=candidates.filter((c)=>c.path===null||hits.has(c.path)).sort((a,b)=>b.mtimeMs-a.mtimeMs),matches=[],next=0;while(next<toRead.length&&matches.length<limit&&Date.now()-started<budgetMs){let batch=toRead.slice(next,next+READ_BATCH);next+=batch.length;let read=await Promise.all(batch.map((c)=>c.reader.readHistory(c.sessionId).catch(()=>[])));for(let[i,messages]of read.entries()){let c=batch[i];for(let m of matchMessages(messages,query,Math.min(PER_SESSION,limit-matches.length)))matches.push({taskId:c.task.id,title:c.task.title,...c.tabId?{tabId:c.tabId}:{},...m});if(matches.length>=limit)break}}return{query,matches,skipped,truncated:next<toRead.length}}async function runWorktreeGit(worktreePath,args,options={}){if(!worktreePath)return{stdout:"",stderr:"worktreePath is required",status:-1};let exec=(options.execForPath??execHostForWorktreePath)(worktreePath),controller=options.timeoutMs&&options.timeoutMs>0?new AbortController:null,timedOut=!1,timer=controller?setTimeout(()=>{timedOut=!0,controller.abort()},options.timeoutMs):null,signal=controller&&options.signal?AbortSignal.any([controller.signal,options.signal]):controller?.signal??options.signal,result;try{recordSpawn("worktree.content",["git",...args],worktreePath),result=await exec.run(["git",...args],{cwd:worktreePath,env:READ_ONLY_GIT_ENV,signal})}catch(err){if(timer)clearTimeout(timer);return{stdout:"",stderr:errorMessage(err),status:-1}}if(timer)clearTimeout(timer);if(timedOut&&result.exitCode===-1&&!result.stderr)return{stdout:result.stdout,stderr:`git ${args.join(" ")} timed out after ${options.timeoutMs}ms`,status:-1};return{stdout:result.stdout,stderr:result.stderr,status:result.exitCode}}function readLocalWorktreeHead(worktreePath,deps={}){if(!worktreePath||(deps.execForPath??execHostForWorktreePath)(worktreePath).isRemote)return null;try{let dirs=resolveGitDirs(worktreePath);return dirs?readHeadSha(dirs):null}catch{return null}}function worktreeFilePath(worktreePath,relPath){if(!worktreePath||!relPath)return null;if(/^[/\\]/.test(relPath)||/^[a-zA-Z]:[/\\]/.test(relPath))return null;if(relPath.split(/[/\\]/).some((part)=>part===".."))return null;let parts=relPath.split("/");return`${worktreePath.replace(/\/+$/,"")}/${parts.filter(Boolean).join("/")}`}async function worktreeFileSize(worktreePath,relPath,deps={}){let path=worktreeFilePath(worktreePath,relPath);if(!path)return null;let exec=(deps.execForPath??execHostForWorktreePath)(worktreePath);try{let res=await exec.run(["wc","-c",path]);if(res.exitCode!==0)return null;let n=Number.parseInt(res.stdout.trim().split(/\s+/)[0]??"",10);return Number.isFinite(n)?n:null}catch{return null}}async function readWorktreeFile(worktreePath,relPath,deps={}){let path=worktreeFilePath(worktreePath,relPath);if(!path)return null;let exec=(deps.execForPath??execHostForWorktreePath)(worktreePath);try{return await exec.readFile(path)}catch{return null}}function filetypeOf(relPath,firstLine){let leaf=relPath.slice(relPath.lastIndexOf("/")+1),dot=leaf.lastIndexOf(".");if(dot<=0)return firstLine===void 0?void 0:shebangFiletype(firstLine);switch(leaf.slice(dot+1).toLowerCase()){case"ts":case"tsx":case"mts":case"cts":return"typescript";case"js":case"jsx":case"mjs":case"cjs":return"javascript";case"md":case"markdown":return"markdown";case"zig":return"zig";default:return}}var SHEBANG_INTERPRETERS=new Map([["node","javascript"],["nodejs","javascript"],["bun","typescript"],["deno","typescript"],["tsx","typescript"],["ts-node","typescript"]]);function shebangFiletype(line){if(!line.startsWith("#!"))return;let words=line.slice(2).trim().split(/\s+/),first=words[0]??"",program=first.slice(first.lastIndexOf("/")+1);if(program==="env"){let i=1;for(;i<words.length;i++){let word=words[i]??"";if(word==="--"){i++;break}if(["-u","--unset","-C","--chdir","-P","-a","--argv0"].includes(word)){i++;continue}if(!word.startsWith("-")&&!word.includes("="))break}let command=words[i]??"";program=command.slice(command.lastIndexOf("/")+1)}return SHEBANG_INTERPRETERS.get(program)}function patchFirstLine(patch){let lines=patch.split(`
|
|
3
4
|
`),at=lines.findIndex((l)=>/^@@ -\d+(?:,\d+)? \+1(?:,\d+)? @@/.test(l));if(at<0)return;return lines.slice(at+1).find((l)=>l.startsWith(" ")||l.startsWith("+"))?.slice(1)}function contentFirstLine(text){let nl=text.indexOf(`
|
|
4
5
|
`);return nl<0?text:text.slice(0,nl)}function isCombinedPathspec(relPath){return relPath==="."||relPath.endsWith("/")}function hunklessPatchNote(patch){if(/^@@/m.test(patch))return null;let binary=!1,from,to,renameFrom,renameTo,emptyChange;for(let line of patch.split(`
|
|
5
6
|
`))if(line.startsWith("old mode "))from=line.slice(9).trim();else if(line.startsWith("new mode "))to=line.slice(9).trim();else if(line.startsWith("rename from "))renameFrom=unquoteGitPath(line.slice(12));else if(line.startsWith("rename to "))renameTo=unquoteGitPath(line.slice(10));else if(line.startsWith("new file mode "))emptyChange="added";else if(line.startsWith("deleted file mode "))emptyChange="deleted";else if(line.startsWith("Binary files ")||line.startsWith("GIT binary patch"))binary=!0;if(binary)return{kind:"binary"};if(renameFrom!=null&&renameTo!=null)return{kind:"rename",from:renameFrom,to:renameTo};if(emptyChange)return{kind:"empty-file",change:emptyChange};if(from!=null&&to!=null)return{kind:"mode",from,to};return null}function sidePath(field){let raw=field.replace(/\t[\s\S]*$/,"");if(raw==="/dev/null")return null;let path=unquoteGitPath(raw);return path.startsWith("a/")||path.startsWith("b/")?path.slice(2):path}function headerPath(header){if(header.startsWith('"'))return sidePath(unquoteGitPath(header))??header;for(let i=header.indexOf(" b/");i>=0;i=header.indexOf(" b/",i+1)){let a=sidePath(header.slice(0,i)),b=sidePath(header.slice(i+1));if(a!=null&&a===b)return b}let last=header.lastIndexOf(" b/");return(last>=0?sidePath(header.slice(last+1)):null)??header}function unifiedDiffFiles(text){let files=[],current=null,push=()=>{if(!current)return;let patch=`${current.lines.join(`
|
|
6
7
|
`)}
|
|
7
8
|
`,path=current.plus??current.minus??current.path,note=hunklessPatchNote(patch);files.push({path,text:patch,lines:current.rows,...note?{note}:{}})};for(let line of text.split(`
|
|
8
|
-
`)){if(line.startsWith("diff --git ")){push(),current={path:headerPath(line.slice(11)),lines:[line],rows:0};continue}if(!current)continue;if(current.lines.push(line),line.startsWith("rename to "))current.path=unquoteGitPath(line.slice(10));else if(line.startsWith("copy to "))current.path=unquoteGitPath(line.slice(8));else if(line.startsWith("+++ "))current.plus=sidePath(line.slice(4))??void 0;else if(line.startsWith("--- "))current.minus=sidePath(line.slice(4))??void 0;else if(/^[ +-]/.test(line))current.rows+=1}return push(),files}var IMAGE_EXTS=new Set(["png","jpg","jpeg","gif","webp","bmp","ico","tif","tiff","avif","heic"]);function isImagePath(relPath){return IMAGE_EXTS.has(relPath.slice(relPath.lastIndexOf(".")+1).toLowerCase())}function looksBinaryText(text){return text.slice(0,8192).includes("\x00")}async function pairRename(worktree,spec,relPath){let listed=await runWorktreeGit(worktree,["diff",spec,"--name-status","--find-renames","-z"]);if(listed.status!==0)return null;let fields=listed.stdout.split("\x00");for(let i=0;i<fields.length;i+=1){let code=fields[i];if(code==null||!/^[RC]\d*$/.test(code))continue;let orig=fields[i+1],neu=fields[i+2];if(i+=2,orig==null||neu!==relPath)continue;let paired=await runWorktreeGit(worktree,["--literal-pathspecs","diff",spec,"--",relPath,orig]);if(paired.status!==0||paired.stdout.trim().length===0)return null;return{text:paired.stdout,origPath:orig}}return null}async function loadPreviewData(worktree,relPath,range){if(isImagePath(relPath))return{kind:"binary",image:!0,sizeBytes:await worktreeFileSize(worktree,relPath)};let spec=range?`${range.base}...HEAD`:"HEAD",res=await runWorktreeGit(worktree,["--literal-pathspecs","diff",spec,"--",relPath]);if(res.status!==0&&(range||isCombinedPathspec(relPath)))return{kind:"error",message:(res.stderr??"").trim()||`git diff ${spec} exited with code ${res.status??-1}`};let diff=res.status===0?res.stdout:"",origPath;if(diff.trim().length>0){if(!isCombinedPathspec(relPath)){if(/^new file mode /m.test(diff)){let paired=await pairRename(worktree,spec,relPath);if(paired)diff=paired.text,origPath=paired.origPath}let note=hunklessPatchNote(diff);if(note)return{kind:"patch-note",note,sizeBytes:await worktreeFileSize(worktree,relPath)}}return{kind:"diff",text:diff,...origPath?{origPath}:{}}}if(isCombinedPathspec(relPath))return{kind:"empty"};let text=await readWorktreeFile(worktree,relPath);if(text===null)return{kind:"error",message:t("ops.preview.readFailed",{path:relPath})};if(looksBinaryText(text))return{kind:"binary",image:!1,sizeBytes:await worktreeFileSize(worktree,relPath)};return{kind:"code",text}}async function runGit(args,cwd,signal){if(!cwd)throw Error("git(): cwd is required");let result=await runWorktreeGit(cwd,args,{signal}),exitCode=result.status??-1;if(exitCode!==0){let stderr=(result.stderr??"").trim(),stdout=(result.stdout??"").trim();throw Error(`git ${args.join(" ")} (cwd=${cwd}) exited with code ${exitCode}: ${stderr||stdout||"(no output)"}`)}return result.stdout??""}async function listFiles(worktreePath,signal){let lines=(await runGit(["ls-files","--cached","--others","--exclude-standard","--full-name"],worktreePath,signal)).split(`
|
|
9
|
+
`)){if(line.startsWith("diff --git ")){push(),current={path:headerPath(line.slice(11)),lines:[line],rows:0};continue}if(!current)continue;if(current.lines.push(line),line.startsWith("rename to "))current.path=unquoteGitPath(line.slice(10));else if(line.startsWith("copy to "))current.path=unquoteGitPath(line.slice(8));else if(line.startsWith("+++ "))current.plus=sidePath(line.slice(4))??void 0;else if(line.startsWith("--- "))current.minus=sidePath(line.slice(4))??void 0;else if(/^[ +-]/.test(line))current.rows+=1}return push(),files}var IMAGE_EXTS=new Set(["png","jpg","jpeg","gif","webp","bmp","ico","tif","tiff","avif","heic"]);function isImagePath(relPath){return IMAGE_EXTS.has(relPath.slice(relPath.lastIndexOf(".")+1).toLowerCase())}function looksBinaryText(text){return text.slice(0,8192).includes("\x00")}async function pairRename(worktree,spec,relPath){let listed=await runWorktreeGit(worktree,["diff",spec,"--name-status","--find-renames","-z"]);if(listed.status!==0)return null;let fields=listed.stdout.split("\x00");for(let i=0;i<fields.length;i+=1){let code=fields[i];if(code==null||!/^[RC]\d*$/.test(code))continue;let orig=fields[i+1],neu=fields[i+2];if(i+=2,orig==null||neu!==relPath)continue;let paired=await runWorktreeGit(worktree,["--literal-pathspecs","diff",spec,"--",relPath,orig]);if(paired.status!==0||paired.stdout.trim().length===0)return null;return{text:paired.stdout,origPath:orig}}return null}var UNTRACKED_DIFF_LIMIT=200;async function untrackedAdditions(worktree,relPath){let listed=await runWorktreeGit(worktree,["--literal-pathspecs","ls-files","--others","--exclude-standard","-z","--",relPath]);if(listed.status!==0)return"";let files=listed.stdout.split("\x00").filter(Boolean).slice(0,UNTRACKED_DIFF_LIMIT),out="";for(let file of files){let added=await runWorktreeGit(worktree,["diff","--no-index","--","/dev/null",file]);if(added.status===0||added.status===1)out+=added.stdout}return out}async function loadPreviewData(worktree,relPath,range){if(isImagePath(relPath))return{kind:"binary",image:!0,sizeBytes:await worktreeFileSize(worktree,relPath)};let spec=range?`${range.base}...HEAD`:"HEAD",res=await runWorktreeGit(worktree,["--literal-pathspecs","diff",spec,"--",relPath]);if(res.status!==0&&(range||isCombinedPathspec(relPath)))return{kind:"error",message:(res.stderr??"").trim()||`git diff ${spec} exited with code ${res.status??-1}`};let diff=res.status===0?res.stdout:"";if(!range&&isCombinedPathspec(relPath))diff+=await untrackedAdditions(worktree,relPath);let origPath;if(diff.trim().length>0){if(!isCombinedPathspec(relPath)){if(/^new file mode /m.test(diff)){let paired=await pairRename(worktree,spec,relPath);if(paired)diff=paired.text,origPath=paired.origPath}let note=hunklessPatchNote(diff);if(note)return{kind:"patch-note",note,sizeBytes:await worktreeFileSize(worktree,relPath)}}return{kind:"diff",text:diff,...origPath?{origPath}:{}}}if(isCombinedPathspec(relPath))return{kind:"empty"};let text=await readWorktreeFile(worktree,relPath);if(text===null)return{kind:"error",message:t("ops.preview.readFailed",{path:relPath})};if(looksBinaryText(text))return{kind:"binary",image:!1,sizeBytes:await worktreeFileSize(worktree,relPath)};return{kind:"code",text}}async function runGit(args,cwd,signal){if(!cwd)throw Error("git(): cwd is required");let result=await runWorktreeGit(cwd,args,{signal}),exitCode=result.status??-1;if(exitCode!==0){let stderr=(result.stderr??"").trim(),stdout=(result.stdout??"").trim();throw Error(`git ${args.join(" ")} (cwd=${cwd}) exited with code ${exitCode}: ${stderr||stdout||"(no output)"}`)}return result.stdout??""}async function listFiles(worktreePath,signal){let lines=(await runGit(["ls-files","--cached","--others","--exclude-standard","--full-name"],worktreePath,signal)).split(`
|
|
9
10
|
`).map((l)=>unquoteGitPath(l.replace(/\r$/,""))),set=new Set;for(let line of lines)if(line.length>0)set.add(line);return Array.from(set).sort()}async function statusFiles(worktreePath,signal){let out=await runGit(["status","--porcelain"],worktreePath,signal),entries=parseStatusEntries(out),stats=new Map;try{let diffOut=await runGit(["diff","--no-color","--numstat","-z","HEAD"],worktreePath,signal);stats=new Map(parseNumstat(diffOut).map((n)=>[n.path,{added:n.added,deleted:n.deleted}]))}catch{try{let cachedOut=await runGit(["diff","--no-color","--numstat","-z","--cached"],worktreePath,signal);stats=new Map(parseNumstat(cachedOut).map((n)=>[n.path,{added:n.added,deleted:n.deleted}]))}catch{stats=new Map}}let merged=entries.map((e)=>{let s=stats.get(e.path);if(s)return{...e,added:s.added,deleted:s.deleted};return e});if(merged.some(isUntrackedDir))try{let others=(await runGit(["ls-files","--others","--exclude-standard","--full-name"],worktreePath,signal)).split(`
|
|
10
11
|
`).filter((l)=>l.length>0);attachUntrackedChildren(merged,others)}catch{}let untracked=[];for(let e of merged){if(e.status!=="?")continue;if(e.children)untracked.push(...e.children);else if(e.added==null&&!e.path.endsWith("/"))untracked.push(e)}if(untracked.length>0)await Promise.all(untracked.map(async(e)=>{let added=await countAddedLines(worktreePath,e.path,signal);if(added!=null)e.added=added,e.deleted=0}));for(let e of merged){if(!e.children)continue;let sum=0,counted=!1;for(let c of e.children)if(c.added!=null)sum+=c.added,counted=!0;if(counted)e.added=sum,e.deleted=0}return merged}function isUntrackedDir(e){return e.status==="?"&&e.path.endsWith("/")}function attachUntrackedChildren(entries,others){for(let e of entries){if(!isUntrackedDir(e))continue;e.children=others.filter((p)=>p.startsWith(e.path)).map((p)=>({path:p,status:"?"}))}}var BASE_TTL_MS=300000,baseCache=new Map;async function resolveBase(worktreePath,prBaseRef,signal){if(prBaseRef&&prBaseRef.trim().length>0)return prBaseRef.trim();let hit=baseCache.get(worktreePath);if(hit&&Date.now()-hit.at<BASE_TTL_MS){if(hit.head===void 0)return hit.base;if((readLocalWorktreeHead(worktreePath)??await revParse("HEAD",worktreePath,signal))===hit.head)return hit.base}let resolved=await resolveBaseUncached(worktreePath,signal);if(!signal?.aborted)baseCache.set(worktreePath,{...resolved,at:Date.now()});return resolved.base}async function resolveBaseUncached(worktreePath,signal){try{let head2=(await runGit(["symbolic-ref","--short","refs/remotes/origin/HEAD"],worktreePath,signal)).trim();if(head2.length>0)return{base:head2}}catch{}for(let guess of["origin/main","origin/master"])try{return await runGit(["rev-parse","--verify","--quiet",guess],worktreePath,signal),{base:guess}}catch{}let head=await revParse("HEAD",worktreePath,signal);for(let guess of["main","master"]){let sha=await revParse(guess,worktreePath,signal);if(sha!=null&&sha!==head)return{base:guess,head}}return{base:null,head}}async function revParse(ref,worktreePath,signal){try{let out=(await runGit(["rev-parse","--verify","--quiet",ref],worktreePath,signal)).trim();return out.length>0?out:null}catch{return null}}async function statusFilesBranch(worktreePath,base,signal){let range=`${base}...HEAD`,[nameStatusOut,numstatOut]=await Promise.all([runGit(["diff","--no-color","--name-status",range],worktreePath,signal),runGit(["diff","--no-color","--numstat","-z",range],worktreePath,signal)]),counts=new Map(parseNumstat(numstatOut).map((n)=>[n.path,{added:n.added,deleted:n.deleted}])),entries=[];for(let{status,path}of parseNameStatus(nameStatusOut)){let c=counts.get(path);entries.push({path,status,added:c?.added,deleted:c?.deleted})}return entries}function parseNameStatus(raw){let out=[];for(let rawLine of raw.split(`
|
|
11
12
|
`)){let line=rawLine.replace(/\r$/,"");if(line.length===0)continue;let tab1=line.indexOf("\t");if(tab1<0)continue;let code=line[0],path;if(code==="R"||code==="C"){let tab2=line.indexOf("\t",tab1+1);path=unquoteGitPath(tab2<0?line.slice(tab1+1):line.slice(tab2+1))}else path=unquoteGitPath(line.slice(tab1+1));if(path.length===0||path.endsWith("/"))continue;let status=code==="M"||code==="A"||code==="D"||code==="T"?code:code==="R"?"R":code==="C"?"C":null;if(status)out.push({status,path})}return out}async function countAddedLines(worktreePath,relPath,signal){if(signal?.aborted)return null;let text=await readWorktreeFile(worktreePath,relPath);if(text==null)return null;if(text.includes("\x00"))return null;if(text.length===0)return 0;let count=0;for(let i=0;i<text.length;i++)if(text[i]===`
|
|
@@ -22,4 +23,4 @@ import{protocolEntry}from"./chunk-rzef6szc.js";import{execHostForWorktreePath}fr
|
|
|
22
23
|
- **\u75C7\u72B6\u5E26\u6761\u4EF6\u3001\u4E0D\u7A33\u5B9A\u590D\u73B0\u3001\u6CA1\u6709\u4EFB\u4F55\u731C\u6D4B**\uFF1A\u300C\u6709\u65F6\u5019\u4F1A\u8DD1\u5230\u5C4F\u5E55\u5916\uFF0C\u591A\u5C4F\u60C5\u51B5\u4E0B\u300D\u300C\u611F\u89C9\u5361\u4E00\u4E0B\u300D\u300Cresults feel stale\u300D\u300C\u8D85\u8FC7 200 \u884C\u5C31\u7A7A\u767D\u300D\u2014\u2014\u5148\u8981\u627E\u5230\u89E6\u53D1\u6761\u4EF6\u624D\u6709\u76EE\u6807\u3002`,\u{8fb9}\u{754c}:"\u548C standard \u7684\u5206\u754C\uFF1A\u7528\u6237\u6709\u6CA1\u6709\u8BF4\u8981\u505A\u6210\u4EC0\u4E48\uFF1F\u6CA1\u6709 \u2192 deep\u3002\u4F46 deep \u8BF4\u7684\u662F\u300C\u8981\u5148\u8C03\u67E5\u624D\u77E5\u9053\u505A\u6210\u4EC0\u4E48\u6837\u300D\uFF0C\u4E0D\u662F\u300C\u8FD9\u53E5\u8BDD\u91CC\u6CA1\u6709\u6D3B\u300D\u3002\u4E00\u53E5\u5DF2\u7ECF\u5B8C\u6574\u3001\u53EF\u4EE5\u76F4\u63A5\u56DE\u7B54\u7684\u8BDD\u4E0D\u662F deep\uFF0C\u662F swift\u3002"}},examples:[{task:"\u80FD\u4E0D\u80FD\u8C03\u67E5\u4E00\u4E0B\u4E3A\u4EC0\u4E48\u5BA1\u8BA1\u65E5\u5FD7\u8868\u6700\u8FD1\u6DA8\u5F97\u8FD9\u4E48\u5FEB",tier:"deep"},{task:"\u641C\u7D22\u7ED3\u679C\u70B9\u8FDB\u53BB\u7ECF\u5E38\u662F\u6B7B\u94FE,404,\u9EBB\u70E6\u67E5\u4E00\u4E0B\u662F\u4E0D\u662F\u6784\u5EFA\u7684\u65F6\u5019\u8DEF\u7531\u6CA1\u540C\u6B65",tier:"standard"},{task:"\u6DF1\u8272\u6A21\u5F0F\u4EE3\u7801\u5757\u80CC\u666F\u8272\u8DDF\u6B63\u6587\u80CC\u666F\u4E00\u4E2A\u989C\u8272 \u770B\u4E0D\u51FA\u533A\u522B",tier:"swift"},{task:"Tooltip \u5728 iframe \u91CC\u5B9A\u4F4D\u5B8C\u5168\u662F\u9519\u7684",tier:"swift"},{task:"Table \u7EC4\u4EF6\u8868\u5934\u56FA\u5B9A\u4E4B\u540E\u6A2A\u5411\u6EDA\u52A8\u6761\u6D88\u5931\u4E86",tier:"standard"},{task:"Preferences window doesn't remember size after quit\n\n`PreferencesWindowController.swift` never persists its frame via `setFrameAutosaveName`. Add an autosave name and call it in `windowDidLoad`, so resizing the window sticks across relaunches like the main status window already does.",tier:"swift"},{task:"what would it take to add keyboard-only card creation (no mouse) to the board view?",tier:"deep"},{task:"Add a `--json` flag to the `board list` command\n\nRight now `board list` only prints an ASCII table (src/commands/list.ts). Add a `--json` flag that dumps the same data as JSON to stdout instead, and update the `--help` text in `cli.ts` to document it. Useful for piping into `jq` in scripts.",tier:"swift"},{task:"Scheduled job leaks DB connections\n\n`ReportGenerationJob.java` opens a `Connection` manually in `run()` but never closes it in the catch block when an exception is thrown mid-query. Under load this exhausts the HikariCP pool within a couple hours. Wrap it in try-with-resources and add a test that simulates a query failure and asserts pool size returns to baseline.",tier:"swift"},{task:"\u8DD1\u5927\u8868\u7684\u65F6\u5019\u62A5\u4E86\u4E2A\u5185\u5B58\u9519\u8BEF\n```\nMemoryError: Unable to allocate 3.2 GiB for an array\n```\n\u770B\u770B\u80FD\u4E0D\u80FD\u6D41\u5F0F\u5904\u7406\u4E0D\u8981\u4E00\u6B21\u8BFB\u5168\u90E8",tier:"standard"},{task:`\u89D2\u8272\u6743\u9650\u7F13\u5B58\u6CA1\u6709\u5931\u6548\u673A\u5236
|
|
23
24
|
|
|
24
25
|
PermissionCacheService.java \u7528 Guava Cache \u5B58\u6743\u9650,\u6CA1\u8BBE TTL,\u7BA1\u7406\u5458\u5728\u540E\u53F0\u6539\u4E86\u67D0\u4E2A\u89D2\u8272\u7684\u6743\u9650\u4E4B\u540E,\u5DF2\u7ECF\u767B\u5F55\u7684\u7528\u6237\u90A3\u8FB9\u8FD8\u662F\u8BFB\u5230\u65E7\u7684\u7F13\u5B58\u503C,\u8981\u91CD\u542F\u670D\u52A1\u624D\u4F1A\u5237\u65B0\u3002\u60F3\u52A0\u4E24\u5757:\u4E00\u662F\u7ED9\u7F13\u5B58\u52A0\u4E2A\u5408\u7406\u7684 TTL \u515C\u5E95,\u4E8C\u662F\u5728 RoleController.updateRole \u4FDD\u5B58\u6210\u529F\u4E4B\u540E\u4E3B\u52A8\u8C03\u7528\u4E00\u6B21\u7F13\u5B58\u5931\u6548,\u628A\u6539\u52A8\u7ACB\u523B\u751F\u6548\u3002\u987A\u4FBF\u8865\u4E00\u4E2A\u8986\u76D6\u8FD9\u4E2A\u5931\u6548\u903B\u8F91\u7684\u5355\u6D4B\u3002`,tier:"swift"},{task:"any chance we could speed up the parquet export path? it feels way slower than the csv one for the same row count",tier:"deep"},{task:"could we support opening files in $EDITOR from the file manager instead of always using vi?",tier:"deep"},{task:"\u6253\u602A\u6389\u94B1\u7684\u51E0\u7387\u597D\u50CF\u592A\u9AD8\u4E86,\u80FD\u4E0D\u80FD\u914D\u7F6E\u5316",tier:"standard"},{task:"\u7535\u91CF\u56FE\u6807\u5728\u5145\u6EE1\u7535\u4E4B\u540E\u6CA1\u6709\u53D8\u7EFF,\u770B\u4E0B",tier:"standard"},{task:"any ideas on how to make undo/redo work across card moves, not just edits?",tier:"deep"},{task:"Getting this on startup after bumping api-version in plugin.yml:\n```\njava.lang.NoSuchMethodError: 'void org.bukkit.entity.Player.sendActionBar(net.md_5.bungee.api.chat.BaseComponent)'\n```\nLooks like a Paper API compat issue, please fix.",tier:"standard"},{task:"is there a way to make the Select component support async options loading?",tier:"deep"},{task:"websocket \u4EE3\u7406\u8001\u662F\u65AD\u8FDE,http \u7684\u6CA1\u95EE\u9898,\u662F\u4E0D\u662F upstream \u7684 timeout \u8BBE\u7F6E\u592A\u77ED\u4E86",tier:"standard"},{task:"OrderController \u7684\u5206\u9875\u63A5\u53E3,pageSize \u4F20\u8D85\u8FC7 1000 \u4F1A\u76F4\u63A5 OOM,\u52A0\u4E2A max pageSize \u6821\u9A8C,\u8D85\u8FC7\u5C31 400,\u987A\u4FBF\u628A error message \u91CC\u90A3\u53E5\u82F1\u6587\u6539\u6210\u4E2D\u6587",tier:"swift"},{task:"\u8BBE\u7F6E\u9762\u677F\u91CC\u52A0\u4E00\u4E2A\u300C\u5F00\u673A\u81EA\u542F\u300D\u7684\u5F00\u5173,\u7528 SMAppService \u90A3\u5957\u65B0 API(macOS 13+),\u72B6\u6001\u5B58\u8FDB UserDefaults \u7684 launchAtLogin \u952E,UI \u7167\u6284\u73B0\u5728\u300C\u663E\u793A\u79D2\u6570\u300D\u90A3\u4E2A toggle \u7684\u6837\u5F0F\u5C31\u884C",tier:"swift"},{task:"\u611F\u89C9\u542F\u52A8\u901F\u5EA6\u53EF\u4EE5\u518D\u5FEB\u70B9,\u8C03\u67E5\u4E00\u4E0B\u74F6\u9888\u5728\u54EA",tier:"deep"},{task:"\u6587\u4EF6\u6811\u6EDA\u52A8\u7684\u65F6\u5019\u611F\u89C9\u5361\u4E00\u4E0B \u80FD\u4E0D\u80FD\u67E5\u4E00\u4E0B\u662F\u4E0D\u662F\u91CD\u7ED8\u7684\u95EE\u9898",tier:"deep"},{task:"health check \u7684 interval \u73B0\u5728\u5199\u6B7B 5s,\u80FD\u4E0D\u80FD\u505A\u6210\u6BCF\u4E2A upstream \u53EF\u914D\u7F6E?",tier:"standard"}]};var JEV_ENDPOINT="https://api.typesafe.ai/v1/systemone",PROMPT_LIMIT=1200,DEFAULT_THRESHOLD=0.5,DEFAULT_TIMEOUT_MS=4000,DEFAULT_MODEL="jev-latest",DEFAULT_KEY_ENV="TYPESAFE_API_KEY";function stringAt2(get,key){let raw=get(key);return typeof raw==="string"&&raw.trim()?raw.trim():void 0}function numberAt(get,key,fallback,min,max){let raw=get(key);if(typeof raw==="string"&&!raw.trim())return fallback;let n=typeof raw==="number"?raw:Number(typeof raw==="string"?raw:Number.NaN);if(!Number.isFinite(n)||n<min||n>max)return fallback;return n}function isLoopback(hostname){let host=hostname.replace(/^\[|\]$/g,"").toLowerCase();return host==="localhost"||host.endsWith(".localhost")||host==="::1"||/^127\.\d+\.\d+\.\d+$/.test(host)}function endpointMode(raw){let url;try{url=new URL(raw)}catch{return{kind:"off"}}if(url.protocol==="https:")return{kind:"url",url:raw};if(url.protocol!=="http:")return{kind:"off"};if(isLoopback(url.hostname))return{kind:"url",url:raw};return{kind:"refused",why:`http:// is only accepted for a loopback address; use https:// for ${url.hostname}`}}function readClassifierConfig(get=getPersistedValue){let raw=stringAt2(get,"autoRouting.classifier")??"off",mode=raw==="jev"?{kind:"jev"}:raw==="off"?{kind:"off"}:endpointMode(raw),keyEnv=mode.kind==="jev"?stringAt2(get,"autoRouting.classifierKeyEnv")??DEFAULT_KEY_ENV:stringAt2(get,"autoRouting.classifierCustomKeyEnv");return{mode,threshold:numberAt(get,"autoRouting.classifierThreshold",DEFAULT_THRESHOLD,0,1),timeoutMs:numberAt(get,"autoRouting.classifierTimeoutMs",DEFAULT_TIMEOUT_MS,200,60000),model:stringAt2(get,"autoRouting.classifierModel")??DEFAULT_MODEL,...keyEnv?{keyEnv}:{}}}var declined=(reason,detail)=>({kind:"declined",reason,...detail?{detail}:{}});async function classifyTier(text,config,deps={}){if(config.mode.kind==="off")return declined("off");if(config.mode.kind==="refused")return declined("refused",config.mode.why);let prompt=text.trim().slice(0,PROMPT_LIMIT);if(!prompt)return declined("blank");let env=deps.env??process.env,key=config.keyEnv?(deps.readSecret??resolveSecret)(config.keyEnv,env):void 0;if(config.mode.kind==="jev"&&!key)return declined("no-key",`no ${config.keyEnv} in the environment or ~/.rove/secrets.json`);let doFetch=deps.fetch??globalThis.fetch,controller=new AbortController,timer=setTimeout(()=>controller.abort(),config.timeoutMs);try{let request=config.mode.kind==="jev"?{url:JEV_ENDPOINT,body:jevRequest(prompt,config.model,deps.rubric??DEFAULT_TIER_RUBRIC)}:{url:config.mode.url,body:{text:prompt}},res=await doFetch(request.url,{method:"POST",headers:{"content-type":"application/json",...key?{authorization:`Bearer ${key}`}:{}},body:JSON.stringify(request.body),signal:controller.signal,redirect:"error"});if(!res.ok)return declined("failed",describeHttpFailure(res));let payload=await res.json(),verdict=config.mode.kind==="jev"?readJevAnswer(payload):readPlainAnswer(payload);if(!verdict.ok)return declined("failed",verdict.why);if(verdict.value.confidence<config.threshold)return declined("low-confidence",`${verdict.value.tier} at ${verdict.value.confidence.toFixed(2)}`);return{kind:"picked",verdict:verdict.value}}catch(err){let why=err instanceof Error&&err.name==="AbortError"?`timed out after ${config.timeoutMs}ms`:String(err);return declined("failed",why)}finally{clearTimeout(timer)}}function describeHttpFailure(res){let status=`HTTP ${res.status}`;if(res.status!==429)return status;let after=res.headers?.get?.("retry-after"),when=after?`, retry-after ${after}`:"";return`${status} \u2014 upstream pool rate limit, not necessarily your quota${when}`}function jevRequest(prompt,model,rubric){return{model,state:{task_text:prompt,labelled_examples:rubric.examples.map((e)=>({task:e.task,tier:e.tier}))},questions:{verdict:{type:"choice",criteria:rubric.criteria,instructions:{role:rubric.role,criterion:rubric.criterion}}}}}var TASK_GROUPS=["waiting-on-you","landing","ready-for-review","working","idle","unknown"];function taskGroupRank(group){return TASK_GROUPS.indexOf(group)}var ERROR_SETTLE_MS=20000,DEAD_SETTLE_MS=60000;function actedOn(task){if(task.status==="done"||task.status==="canceled")return!0;let lifecycle=rollupPr(task)?.lifecycle;return lifecycle==="merged"||lifecycle==="closed"}function autoResumes(task,now){let at=task.quotaResume?.resumeAt;if(!at)return!1;let ms=Date.parse(at);return!Number.isNaN(ms)&&ms>now}function deriveTaskGroup(input){let{task,now}=input,activity=input.activity??null,state=activity?.state,age=activity?Math.max(0,now-activity.at):0;if(task.deletion?.phase==="error")return"waiting-on-you";if(state==="permission_needed")return"waiting-on-you";if(state==="rate_limited"&&!autoResumes(task,now))return"waiting-on-you";if(state==="error"&&age>=ERROR_SETTLE_MS)return"waiting-on-you";if(activity&&!task.report&&age>=DEAD_SETTLE_MS&&(state==="dead"||input.tabAlive===!1))return"waiting-on-you";if(state==="running"&&input.tabAlive!==!1)return"working";if(state==="rate_limited")return"working";let pr=rollupPr(task);if((pr?.lifecycle==="open"||pr?.lifecycle==="ready_to_merge")&&(pr.reviewDecision??"").toUpperCase()==="APPROVED")return"landing";if((task.report!==void 0||state==="turn_complete")&&!actedOn(task))return"ready-for-review";return activity?"idle":"unknown"}function taskGroupOf(input){let group=deriveTaskGroup(input);return{group,rank:taskGroupRank(group)}}
|
|
25
|
-
export{classifyScreen,screenErrorLine,secretStatus,writeSecret,AUTO_ROUTING_TIERS,isAutoRoutingTier,autoRoutingKey,readAutoRoutingTable,tierBlock,describeTierBlock,readClassifierConfig,classifyTier,taskGroupRank,deriveTaskGroup,taskGroupOf,worktreeFilePath,filetypeOf,patchFirstLine,contentFirstLine,isCombinedPathspec,unifiedDiffFiles,isImagePath,loadPreviewData,listFiles,statusFiles,resolveBase,statusFilesBranch};
|
|
26
|
+
export{classifyScreen,screenErrorLine,secretStatus,writeSecret,AUTO_ROUTING_TIERS,isAutoRoutingTier,autoRoutingKey,readAutoRoutingTable,tierBlock,describeTierBlock,readClassifierConfig,classifyTier,taskGroupRank,deriveTaskGroup,taskGroupOf,PER_SESSION,searchTasks,worktreeFilePath,filetypeOf,patchFirstLine,contentFirstLine,isCombinedPathspec,unifiedDiffFiles,isImagePath,loadPreviewData,listFiles,statusFiles,resolveBase,statusFilesBranch};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{PROJECT_DIR_TOKEN,WORKTREE_BASE_KEY,defaultLocalWorktreesRoot,legacyLocalWorktreesRoot,managedWorktreeRootsFor,normalizeWorktreeBase,worktreeRootFor}from"./chunk-gq36nzg8.js";import{execHostForRepo}from"./chunk-895yqjjz.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{getRemoteRepoConfig,isRemoteRepoKey}from"./chunk-rfp0ayra.js";import{loadStateFile}from"./chunk-32j6y5d1.js";import{pathWithin}from"./chunk-pn5ygqn6.js";class IllegalTransitionError extends Error{from;to;taskId;constructor(from,to,taskId){super(`illegal transition for task ${taskId}: ${from} -> ${to}`);this.from=from;this.to=to;this.taskId=taskId;this.name="IllegalTransitionError"}}class TaskNotFoundError extends Error{constructor(taskId){super(`task not found: ${taskId}`);this.name="TaskNotFoundError"}}class CannotDeleteMainTaskError extends Error{constructor(){super("cannot delete a main task; remove the repo from saved repos instead");this.name="CannotDeleteMainTaskError"}}var DIRTY_WORKTREE_CODE="DIRTY_WORKTREE";function describeDirtyWorktreeWork(ignored,dirty=[]){if(dirty.length>0)return`uncommitted or untracked changes: ${namePaths(dirty)}`;return ignored==="unknown"?"gitignored work this check could not read (git status --ignored failed) \u2014 nothing here can confirm it is empty":ignored.length>0?`gitignored work git status cannot see: ${ignored.join(", ")}`:"uncommitted or untracked changes"}var DIRTY_PATHS_SHOWN=10;function namePaths(paths){let shown=paths.slice(0,DIRTY_PATHS_SHOWN).join(", "),more=paths.length-DIRTY_PATHS_SHOWN;return more>0?`${shown} (+${more} more)`:shown}function dirtyRefusalReason(err){let message=errorMessage(err),at=message.indexOf(DIRTY_WORKTREE_CODE);if(at<0)return null;return message.slice(at+DIRTY_WORKTREE_CODE.length).replace(/^:\s*/,"")}class DirtyWorktreeError extends Error{taskId;ignored;dirty;repo;also;constructor(taskId,ignored=[],dirty=[],repo,also=[]){let where=repo?` (${repo})`:"",rest=also.map((f)=>`; also ${f.repo}: ${describeDirtyWorktreeWork(f.ignored,f.dirty)}`).join("");super(`${DIRTY_WORKTREE_CODE}: task ${taskId} worktree${where} has ${describeDirtyWorktreeWork(ignored,dirty)}${rest}`);this.taskId=taskId;this.ignored=ignored;this.dirty=dirty;this.repo=repo;this.also=also;this.name="DirtyWorktreeError"}}class WorktreeRemoveFailedError extends Error{taskId;cause;constructor(taskId,cause){super(`failed to remove worktree for task ${taskId}: ${errorMessage(cause)}`);this.taskId=taskId;this.cause=cause;this.name="WorktreeRemoveFailedError"}}var TASK_DELETING_CODE="TASK_DELETING";class TaskDeletingError extends Error{taskId;constructor(taskId){super(`${TASK_DELETING_CODE}: task ${taskId} is being deleted`);this.taskId=taskId;this.name="TaskDeletingError"}}var MAIN_CHECKOUT_DIRTY_CODE="MAIN_CHECKOUT_DIRTY";class MainCheckoutDirtyError extends Error{repo;dir;constructor(repo,dir){super(`${MAIN_CHECKOUT_DIRTY_CODE}: base checkout at ${dir} has uncommitted changes; commit them before landing (never git stash \u2014 the stash stack is shared by every worktree of this repo)`);this.repo=repo;this.dir=dir;this.name="MainCheckoutDirtyError"}}var EMPTY_BRANCH_CODE="EMPTY_BRANCH";class EmptyBranchError extends Error{branch;landedOn;constructor(branch,landedOn){super(`${EMPTY_BRANCH_CODE}: '${branch}' has no commits ahead of '${landedOn}' \u2014 landing it would be a no-op (the worker may not have delivered anything)`);this.branch=branch;this.landedOn=landedOn;this.name="EmptyBranchError"}}var EMPTY_BRANCH_DIRTY_WORKTREE_CODE="EMPTY_BRANCH_DIRTY_WORKTREE";class EmptyBranchDirtyWorktreeError extends Error{branch;landedOn;worktreePath;files;constructor(branch,landedOn,worktreePath,files){let list=files.length>0?files.join(", "):"(none reported)";super(`${EMPTY_BRANCH_DIRTY_WORKTREE_CODE}: '${branch}' has no commits ahead of '${landedOn}' but its worktree ${worktreePath} has uncommitted changes (${list}) \u2014 commit them in the worktree first, then land again`);this.branch=branch;this.landedOn=landedOn;this.worktreePath=worktreePath;this.files=files;this.name="EmptyBranchDirtyWorktreeError"}}var MISSING_REF_CODE="MISSING_REF";class MissingRefError extends Error{branch;landedOn;dir;constructor(branch,landedOn,dir){super(`${MISSING_REF_CODE}: '${branch}' does not resolve in the base repo at ${dir} (comparing against '${landedOn}') \u2014 the branch was renamed or deleted outside Rove; re-point the task with \`rove api update --branch\` or recreate the branch`);this.branch=branch;this.landedOn=landedOn;this.dir=dir;this.name="MissingRefError"}}var LAND_CONFLICT_CODE="LAND_CONFLICT";class LandConflictError extends Error{taskId;branch;files;constructor(taskId,branch,files){let list=files.length>0?files.join(", "):"(none reported)";super(`${LAND_CONFLICT_CODE}: merging '${branch}' hit conflicts, merge aborted \u2014 conflicted files: ${list}`);this.taskId=taskId;this.branch=branch;this.files=files;this.name="LandConflictError"}}var GIT_COMMAND_FAILED_CODE="GIT_COMMAND_FAILED";class GitCommandFailedError extends Error{command;stderr;constructor(command,stderr,hint){let detail=stderr.trim()||"(git printed nothing on stderr)";super(`${GIT_COMMAND_FAILED_CODE}: \`git ${command}\` failed \u2014 ${detail}${hint?`; ${hint}`:""}`);this.command=command;this.stderr=stderr;this.name="GitCommandFailedError"}}var WORKTREE_NAME_TAKEN_CODE="WORKTREE_NAME_TAKEN";class WorktreeNameTakenError extends Error{worktreeName;constructor(worktreeName){super(`${WORKTREE_NAME_TAKEN_CODE}: worktree name '${worktreeName}' is already in use in this repo \u2014 pick another, or omit --worktree-name for a generated one`);this.worktreeName=worktreeName;this.name="WorktreeNameTakenError"}}var INVALID_WORKTREE_NAME_CODE="INVALID_WORKTREE_NAME";class InvalidWorktreeNameError extends Error{worktreeName;constructor(worktreeName){super(`${INVALID_WORKTREE_NAME_CODE}: worktree name '${worktreeName}' must be a single path segment of letters, digits, '.', '_' or '-' (no '/', no '..', not starting with '.')`);this.worktreeName=worktreeName;this.name="InvalidWorktreeNameError"}}var NOT_A_GIT_REPO_CODE="NOT_A_GIT_REPO";class NotAGitRepoError extends Error{dir;constructor(dir){super(`${NOT_A_GIT_REPO_CODE}: ${dir} is not inside a git repository, so a child cannot get its own worktree \u2014 pass --no-worktree to share the directory`);this.dir=dir;this.name="NotAGitRepoError"}}var NOT_A_LINKED_REPO_CODE="NOT_A_LINKED_REPO";class NotALinkedRepoError extends Error{link;available;constructor(link,available){super(`${NOT_A_LINKED_REPO_CODE}: '${link}' is not a top-level symlink to a git checkout in the parent workspace (linked repos: ${available.length>0?available.join(", "):"none"})`);this.link=link;this.available=available;this.name="NotALinkedRepoError"}}var REMOTE_PARENT_UNSUPPORTED_CODE="REMOTE_PARENT_UNSUPPORTED";class RemoteParentUnsupportedError extends Error{taskId;constructor(taskId){super(`${REMOTE_PARENT_UNSUPPORTED_CODE}: task ${taskId} lives on a remote project \u2014 spawn from that machine's rove`);this.taskId=taskId;this.name="RemoteParentUnsupportedError"}}class ReparentRefusedError extends Error{code;constructor(code,detail){super(`${code}: ${detail}`);this.code=code;this.name="ReparentRefusedError"}}var TOO_MANY_REPOS_CODE="TOO_MANY_REPOS";class TooManyReposError extends Error{constructor(count,cap){super(`${TOO_MANY_REPOS_CODE}: ${count} repos exceed the cap of ${cap} per task (the first is the primary)`);this.name="TooManyReposError"}}var REPO_DUPLICATE_CODE="REPO_DUPLICATE";class RepoDuplicateError extends Error{repo;constructor(repo){super(`${REPO_DUPLICATE_CODE}: ${repo} is listed more than once (a subdirectory resolves to its repo root)`);this.repo=repo;this.name="RepoDuplicateError"}}var REMOTE_EXTRA_UNSUPPORTED_CODE="REMOTE_EXTRA_UNSUPPORTED";class RemoteExtraUnsupportedError extends Error{repo;constructor(repo){super(`${REMOTE_EXTRA_UNSUPPORTED_CODE}: ${repo} is a remote project \u2014 a task spanning several repos must keep all of them local`);this.repo=repo;this.name="RemoteExtraUnsupportedError"}}class ExtraRepoNotGitError extends Error{repo;constructor(repo){super(`${NOT_A_GIT_REPO_CODE}: ${repo} is not a git repository \u2014 every repo of a task needs one to cut its worktree and branch from`);this.repo=repo;this.name="ExtraRepoNotGitError"}}import fs from"fs";import path from"path";var WORKTREE_BASE_CUSTOM_KEY="worktree.basePath.custom",PROJECT_SIBLING_BASE=`${PROJECT_DIR_TOKEN}/..`;function worktreeBaseKindOf(raw){let trimmed=raw.trim();if(!trimmed)return"default";if(trimmed.replace(/\/+$/,"")===PROJECT_SIBLING_BASE)return"nextToProject";return"custom"}function getWorktreeBaseOverride(projectDir){let value=loadStateFile()[WORKTREE_BASE_KEY];return normalizeWorktreeBase(typeof value==="string"?value:null,projectDir)}function worktreeRootFor2(repo){return worktreeRootFor(repo,getWorktreeBaseOverride(repo))}function managedWorktreeRootsFor2(repo){return managedWorktreeRootsFor(repo,getWorktreeBaseOverride(repo))}function worktreePathFor(repo,slug){if(!slug||/[/\\\0]/.test(slug))throw Error(`worktreePathFor: invalid slug: ${JSON.stringify(slug)}`);return path.join(worktreeRootFor2(repo),slug)}async function listWorktreeDirNames(repo){if(isRemoteRepoKey(repo)){let basePath=getRemoteRepoConfig(repo)?.basePath;if(!basePath)return[];let names2=new Set,host=execHostForRepo(repo),entries=await Promise.all(remoteManagedWorktreeRootsFor(basePath).map((root)=>host.readdir(root)));for(let list of entries)for(let name of list)names2.add(name);return[...names2]}let names=new Set;for(let root of managedWorktreeRootsFor2(repo))try{for(let e of fs.readdirSync(root,{withFileTypes:!0}))if(e.isDirectory())names.add(e.name)}catch{}return[...names]}function managedWorktreeRootForPath(repo,candidate){if(!path.isAbsolute(repo)||!path.isAbsolute(candidate))return null;let target=canonicalize(candidate);for(let rootPath of managedWorktreeRootsFor2(repo)){let root=canonicalize(rootPath),rel=pathWithin(root,target);if(rel!==null&&rel!=="")return rootPath}return null}function isRoveManagedPath(repo,candidate){return managedWorktreeRootForPath(repo,candidate)!==null}function isUnderManagedWorktreesRoot(candidate,projectDir){if(!path.isAbsolute(candidate))return!1;let target=canonicalize(candidate),roots=[getWorktreeBaseOverride(projectDir)??"",defaultLocalWorktreesRoot(),legacyLocalWorktreesRoot()];for(let rootPath of roots){if(!rootPath)continue;let root=canonicalize(rootPath),rel=pathWithin(root,target);if(rel===null)continue;if(rel.split("/").filter(Boolean).length===2)return!0}return!1}function remoteWorktreeRootFor(basePath){return`${stripTrailingSlash(basePath)}/.rove/worktrees`}function remoteManagedWorktreeRootsFor(basePath){let base=stripTrailingSlash(basePath);return[`${base}/.rove/worktrees`,`${base}/.rove/worktrees`]}function remoteWorktreePathFor(basePath,slug){if(!slug||/[/\\\0]/.test(slug))throw Error(`remoteWorktreePathFor: invalid slug: ${JSON.stringify(slug)}`);return`${remoteWorktreeRootFor(basePath)}/${slug}`}function remoteManagedRootForPath(basePath,candidate){for(let root of remoteManagedWorktreeRootsFor(basePath))if(candidate===root||candidate.startsWith(`${root}/`))return root;return null}function stripTrailingSlash(p){return p.length>1&&p.endsWith("/")?p.replace(/\/+$/,""):p}function requireAbsolute(name,value){if(!value||!path.isAbsolute(value))throw Error(`${name} must be an absolute path, got: ${JSON.stringify(value)}`)}function canonicalize(p){try{return fs.realpathSync(p)}catch{return path.resolve(p)}}
|
|
3
|
-
export{IllegalTransitionError,TaskNotFoundError,CannotDeleteMainTaskError,DIRTY_WORKTREE_CODE,describeDirtyWorktreeWork,dirtyRefusalReason,DirtyWorktreeError,WorktreeRemoveFailedError,TASK_DELETING_CODE,TaskDeletingError,MainCheckoutDirtyError,EmptyBranchError,EMPTY_BRANCH_DIRTY_WORKTREE_CODE,EmptyBranchDirtyWorktreeError,MissingRefError,LandConflictError,GitCommandFailedError,WorktreeNameTakenError,InvalidWorktreeNameError,NotAGitRepoError,NotALinkedRepoError,REMOTE_PARENT_UNSUPPORTED_CODE,RemoteParentUnsupportedError,ReparentRefusedError,TooManyReposError,RepoDuplicateError,RemoteExtraUnsupportedError,ExtraRepoNotGitError,WORKTREE_BASE_CUSTOM_KEY,PROJECT_SIBLING_BASE,worktreeBaseKindOf,worktreePathFor,listWorktreeDirNames,managedWorktreeRootForPath,isRoveManagedPath,isUnderManagedWorktreesRoot,remoteWorktreePathFor,remoteManagedRootForPath,requireAbsolute,canonicalize};
|
|
2
|
+
import{PROJECT_DIR_TOKEN,WORKTREE_BASE_KEY,defaultLocalWorktreesRoot,legacyLocalWorktreesRoot,managedWorktreeRootsFor,normalizeWorktreeBase,worktreeRootFor}from"./chunk-gq36nzg8.js";import{execHostForRepo}from"./chunk-895yqjjz.js";import{getRemoteRepoConfig,isRemoteRepoKey}from"./chunk-rfp0ayra.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{loadStateFile}from"./chunk-32j6y5d1.js";import{pathWithin}from"./chunk-pn5ygqn6.js";class IllegalTransitionError extends Error{from;to;taskId;constructor(from,to,taskId){super(`illegal transition for task ${taskId}: ${from} -> ${to}`);this.from=from;this.to=to;this.taskId=taskId;this.name="IllegalTransitionError"}}class TaskNotFoundError extends Error{constructor(taskId){super(`task not found: ${taskId}`);this.name="TaskNotFoundError"}}class CannotDeleteMainTaskError extends Error{constructor(){super("cannot delete a main task; remove the repo from saved repos instead");this.name="CannotDeleteMainTaskError"}}var DIRTY_WORKTREE_CODE="DIRTY_WORKTREE";function describeDirtyWorktreeWork(ignored,dirty=[]){if(dirty.length>0)return`uncommitted or untracked changes: ${namePaths(dirty)}`;return ignored==="unknown"?"gitignored work this check could not read (git status --ignored failed) \u2014 nothing here can confirm it is empty":ignored.length>0?`gitignored work git status cannot see: ${ignored.join(", ")}`:"uncommitted or untracked changes"}var DIRTY_PATHS_SHOWN=10;function namePaths(paths){let shown=paths.slice(0,DIRTY_PATHS_SHOWN).join(", "),more=paths.length-DIRTY_PATHS_SHOWN;return more>0?`${shown} (+${more} more)`:shown}function dirtyRefusalReason(err){let message=errorMessage(err),at=message.indexOf(DIRTY_WORKTREE_CODE);if(at<0)return null;return message.slice(at+DIRTY_WORKTREE_CODE.length).replace(/^:\s*/,"")}class DirtyWorktreeError extends Error{taskId;ignored;dirty;repo;also;constructor(taskId,ignored=[],dirty=[],repo,also=[]){let where=repo?` (${repo})`:"",rest=also.map((f)=>`; also ${f.repo}: ${describeDirtyWorktreeWork(f.ignored,f.dirty)}`).join("");super(`${DIRTY_WORKTREE_CODE}: task ${taskId} worktree${where} has ${describeDirtyWorktreeWork(ignored,dirty)}${rest}`);this.taskId=taskId;this.ignored=ignored;this.dirty=dirty;this.repo=repo;this.also=also;this.name="DirtyWorktreeError"}}class WorktreeRemoveFailedError extends Error{taskId;cause;constructor(taskId,cause){super(`failed to remove worktree for task ${taskId}: ${errorMessage(cause)}`);this.taskId=taskId;this.cause=cause;this.name="WorktreeRemoveFailedError"}}var TASK_DELETING_CODE="TASK_DELETING";class TaskDeletingError extends Error{taskId;constructor(taskId){super(`${TASK_DELETING_CODE}: task ${taskId} is being deleted`);this.taskId=taskId;this.name="TaskDeletingError"}}var MAIN_CHECKOUT_DIRTY_CODE="MAIN_CHECKOUT_DIRTY";class MainCheckoutDirtyError extends Error{repo;dir;constructor(repo,dir){super(`${MAIN_CHECKOUT_DIRTY_CODE}: base checkout at ${dir} has uncommitted changes; commit them before landing (never git stash \u2014 the stash stack is shared by every worktree of this repo)`);this.repo=repo;this.dir=dir;this.name="MainCheckoutDirtyError"}}var EMPTY_BRANCH_CODE="EMPTY_BRANCH";class EmptyBranchError extends Error{branch;landedOn;constructor(branch,landedOn){super(`${EMPTY_BRANCH_CODE}: '${branch}' has no commits ahead of '${landedOn}' \u2014 landing it would be a no-op (the worker may not have delivered anything)`);this.branch=branch;this.landedOn=landedOn;this.name="EmptyBranchError"}}var EMPTY_BRANCH_DIRTY_WORKTREE_CODE="EMPTY_BRANCH_DIRTY_WORKTREE";class EmptyBranchDirtyWorktreeError extends Error{branch;landedOn;worktreePath;files;constructor(branch,landedOn,worktreePath,files){let list=files.length>0?files.join(", "):"(none reported)";super(`${EMPTY_BRANCH_DIRTY_WORKTREE_CODE}: '${branch}' has no commits ahead of '${landedOn}' but its worktree ${worktreePath} has uncommitted changes (${list}) \u2014 commit them in the worktree first, then land again`);this.branch=branch;this.landedOn=landedOn;this.worktreePath=worktreePath;this.files=files;this.name="EmptyBranchDirtyWorktreeError"}}var MISSING_REF_CODE="MISSING_REF";class MissingRefError extends Error{branch;landedOn;dir;constructor(branch,landedOn,dir){super(`${MISSING_REF_CODE}: '${branch}' does not resolve in the base repo at ${dir} (comparing against '${landedOn}') \u2014 the branch was renamed or deleted outside Rove; re-point the task with \`rove api update --branch\` or recreate the branch`);this.branch=branch;this.landedOn=landedOn;this.dir=dir;this.name="MissingRefError"}}var LAND_CONFLICT_CODE="LAND_CONFLICT";class LandConflictError extends Error{taskId;branch;files;constructor(taskId,branch,files){let list=files.length>0?files.join(", "):"(none reported)";super(`${LAND_CONFLICT_CODE}: merging '${branch}' hit conflicts, merge aborted \u2014 conflicted files: ${list}`);this.taskId=taskId;this.branch=branch;this.files=files;this.name="LandConflictError"}}var GIT_COMMAND_FAILED_CODE="GIT_COMMAND_FAILED";class GitCommandFailedError extends Error{command;stderr;constructor(command,stderr,hint){let detail=stderr.trim()||"(git printed nothing on stderr)";super(`${GIT_COMMAND_FAILED_CODE}: \`git ${command}\` failed \u2014 ${detail}${hint?`; ${hint}`:""}`);this.command=command;this.stderr=stderr;this.name="GitCommandFailedError"}}var WORKTREE_NAME_TAKEN_CODE="WORKTREE_NAME_TAKEN";class WorktreeNameTakenError extends Error{worktreeName;constructor(worktreeName){super(`${WORKTREE_NAME_TAKEN_CODE}: worktree name '${worktreeName}' is already in use in this repo \u2014 pick another, or omit --worktree-name for a generated one`);this.worktreeName=worktreeName;this.name="WorktreeNameTakenError"}}var INVALID_WORKTREE_NAME_CODE="INVALID_WORKTREE_NAME";class InvalidWorktreeNameError extends Error{worktreeName;constructor(worktreeName){super(`${INVALID_WORKTREE_NAME_CODE}: worktree name '${worktreeName}' must be a single path segment of letters, digits, '.', '_' or '-' (no '/', no '..', not starting with '.')`);this.worktreeName=worktreeName;this.name="InvalidWorktreeNameError"}}var NOT_A_GIT_REPO_CODE="NOT_A_GIT_REPO";class NotAGitRepoError extends Error{dir;constructor(dir){super(`${NOT_A_GIT_REPO_CODE}: ${dir} is not inside a git repository, so a child cannot get its own worktree \u2014 pass --no-worktree to share the directory`);this.dir=dir;this.name="NotAGitRepoError"}}var NOT_A_LINKED_REPO_CODE="NOT_A_LINKED_REPO";class NotALinkedRepoError extends Error{link;available;constructor(link,available){super(`${NOT_A_LINKED_REPO_CODE}: '${link}' is not a top-level symlink to a git checkout in the parent workspace (linked repos: ${available.length>0?available.join(", "):"none"})`);this.link=link;this.available=available;this.name="NotALinkedRepoError"}}var REMOTE_PARENT_UNSUPPORTED_CODE="REMOTE_PARENT_UNSUPPORTED";class RemoteParentUnsupportedError extends Error{taskId;constructor(taskId){super(`${REMOTE_PARENT_UNSUPPORTED_CODE}: task ${taskId} lives on a remote project \u2014 add the child from that machine's rove`);this.taskId=taskId;this.name="RemoteParentUnsupportedError"}}class ReparentRefusedError extends Error{code;constructor(code,detail){super(`${code}: ${detail}`);this.code=code;this.name="ReparentRefusedError"}}var TOO_MANY_REPOS_CODE="TOO_MANY_REPOS";class TooManyReposError extends Error{constructor(count,cap){super(`${TOO_MANY_REPOS_CODE}: ${count} repos exceed the cap of ${cap} per task (the first is the primary)`);this.name="TooManyReposError"}}var REPO_DUPLICATE_CODE="REPO_DUPLICATE";class RepoDuplicateError extends Error{repo;constructor(repo){super(`${REPO_DUPLICATE_CODE}: ${repo} is listed more than once (a subdirectory resolves to its repo root)`);this.repo=repo;this.name="RepoDuplicateError"}}var REMOTE_EXTRA_UNSUPPORTED_CODE="REMOTE_EXTRA_UNSUPPORTED";class RemoteExtraUnsupportedError extends Error{repo;constructor(repo){super(`${REMOTE_EXTRA_UNSUPPORTED_CODE}: ${repo} is a remote project \u2014 a task spanning several repos must keep all of them local`);this.repo=repo;this.name="RemoteExtraUnsupportedError"}}class ExtraRepoNotGitError extends Error{repo;constructor(repo){super(`${NOT_A_GIT_REPO_CODE}: ${repo} is not a git repository \u2014 every repo of a task needs one to cut its worktree and branch from`);this.repo=repo;this.name="ExtraRepoNotGitError"}}var FORK_UNSUPPORTED_CODE="FORK_UNSUPPORTED";class ForkUnsupportedError extends Error{constructor(reason){super(`${FORK_UNSUPPORTED_CODE}: ${reason}`);this.name="ForkUnsupportedError"}}import fs from"fs";import path from"path";var WORKTREE_BASE_CUSTOM_KEY="worktree.basePath.custom",PROJECT_SIBLING_BASE=`${PROJECT_DIR_TOKEN}/..`;function worktreeBaseKindOf(raw){let trimmed=raw.trim();if(!trimmed)return"default";if(trimmed.replace(/\/+$/,"")===PROJECT_SIBLING_BASE)return"nextToProject";return"custom"}function getWorktreeBaseOverride(projectDir){let value=loadStateFile()[WORKTREE_BASE_KEY];return normalizeWorktreeBase(typeof value==="string"?value:null,projectDir)}function worktreeRootFor2(repo){return worktreeRootFor(repo,getWorktreeBaseOverride(repo))}function managedWorktreeRootsFor2(repo){return managedWorktreeRootsFor(repo,getWorktreeBaseOverride(repo))}function worktreePathFor(repo,slug){if(!slug||/[/\\\0]/.test(slug))throw Error(`worktreePathFor: invalid slug: ${JSON.stringify(slug)}`);return path.join(worktreeRootFor2(repo),slug)}async function listWorktreeDirNames(repo){if(isRemoteRepoKey(repo)){let basePath=getRemoteRepoConfig(repo)?.basePath;if(!basePath)return[];let names2=new Set,host=execHostForRepo(repo),entries=await Promise.all(remoteManagedWorktreeRootsFor(basePath).map((root)=>host.readdir(root)));for(let list of entries)for(let name of list)names2.add(name);return[...names2]}let names=new Set;for(let root of managedWorktreeRootsFor2(repo))try{for(let e of fs.readdirSync(root,{withFileTypes:!0}))if(e.isDirectory())names.add(e.name)}catch{}return[...names]}function managedWorktreeRootForPath(repo,candidate){if(!path.isAbsolute(repo)||!path.isAbsolute(candidate))return null;let target=canonicalize(candidate);for(let rootPath of managedWorktreeRootsFor2(repo)){let root=canonicalize(rootPath),rel=pathWithin(root,target);if(rel!==null&&rel!=="")return rootPath}return null}function isRoveManagedPath(repo,candidate){return managedWorktreeRootForPath(repo,candidate)!==null}function isUnderManagedWorktreesRoot(candidate,projectDir){if(!path.isAbsolute(candidate))return!1;let target=canonicalize(candidate),roots=[getWorktreeBaseOverride(projectDir)??"",defaultLocalWorktreesRoot(),legacyLocalWorktreesRoot()];for(let rootPath of roots){if(!rootPath)continue;let root=canonicalize(rootPath),rel=pathWithin(root,target);if(rel===null)continue;if(rel.split("/").filter(Boolean).length===2)return!0}return!1}function remoteWorktreeRootFor(basePath){return`${stripTrailingSlash(basePath)}/.rove/worktrees`}function remoteManagedWorktreeRootsFor(basePath){let base=stripTrailingSlash(basePath);return[`${base}/.rove/worktrees`,`${base}/.rove/worktrees`]}function remoteWorktreePathFor(basePath,slug){if(!slug||/[/\\\0]/.test(slug))throw Error(`remoteWorktreePathFor: invalid slug: ${JSON.stringify(slug)}`);return`${remoteWorktreeRootFor(basePath)}/${slug}`}function remoteManagedRootForPath(basePath,candidate){for(let root of remoteManagedWorktreeRootsFor(basePath))if(candidate===root||candidate.startsWith(`${root}/`))return root;return null}function stripTrailingSlash(p){return p.length>1&&p.endsWith("/")?p.replace(/\/+$/,""):p}function requireAbsolute(name,value){if(!value||!path.isAbsolute(value))throw Error(`${name} must be an absolute path, got: ${JSON.stringify(value)}`)}function canonicalize(p){try{return fs.realpathSync(p)}catch{return path.resolve(p)}}
|
|
3
|
+
export{IllegalTransitionError,TaskNotFoundError,CannotDeleteMainTaskError,DIRTY_WORKTREE_CODE,describeDirtyWorktreeWork,dirtyRefusalReason,DirtyWorktreeError,WorktreeRemoveFailedError,TASK_DELETING_CODE,TaskDeletingError,MainCheckoutDirtyError,EmptyBranchError,EMPTY_BRANCH_DIRTY_WORKTREE_CODE,EmptyBranchDirtyWorktreeError,MissingRefError,LandConflictError,GitCommandFailedError,WorktreeNameTakenError,InvalidWorktreeNameError,NotAGitRepoError,NotALinkedRepoError,REMOTE_PARENT_UNSUPPORTED_CODE,RemoteParentUnsupportedError,ReparentRefusedError,TooManyReposError,RepoDuplicateError,RemoteExtraUnsupportedError,ExtraRepoNotGitError,FORK_UNSUPPORTED_CODE,ForkUnsupportedError,WORKTREE_BASE_CUSTOM_KEY,PROJECT_SIBLING_BASE,worktreeBaseKindOf,worktreePathFor,listWorktreeDirNames,managedWorktreeRootForPath,isRoveManagedPath,isUnderManagedWorktreesRoot,remoteWorktreePathFor,remoteManagedRootForPath,requireAbsolute,canonicalize};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{publishRoveTerminalTitle}from"./chunk-3aqhytyy.js";import{ensureGlobalRoveHooks}from"./chunk-nr7e3e82.js";import{LAST_RUN_VERSION_KEY,enforceResetGate}from"./chunk-1jjqk7sq.js";import"./chunk-17e2tgyg.js";import"./chunk-2bgmby1d.js";import"./chunk-n0rdn2fn.js";import"./chunk-j1z9kgyd.js";import"./chunk-d7f022eb.js";import"./chunk-h64rsbrx.js";import"./chunk-w7zv47mp.js";import"./chunk-2tfnscxk.js";import"./chunk-rfp0ayra.js";import"./chunk-40dgv828.js";import{CURRENT_VERSION,compareSemver}from"./chunk-a4r45qdn.js";import"./chunk-zsfyj36g.js";import"./chunk-d0hpes59.js";import"./chunk-mkfc9a09.js";import"./chunk-syn0tfwy.js";import"./chunk-2brn8e1y.js";import"./chunk-7mwvvj46.js";import{detectShell}from"./chunk-n8t4y0bj.js";import"./chunk-eege1x0a.js";import"./chunk-qqr4tfhk.js";import{loadStateFile,patchStateFile}from"./chunk-32j6y5d1.js";import"./chunk-372g44dg.js";import"./chunk-1eef3z5v.js";import"./chunk-cmp64q4j.js";import"./chunk-n6marmjn.js";import"./chunk-96kvwzj8.js";import"./chunk-2kqxz9a4.js";import"./chunk-e3t1zbv1.js";import"./chunk-7kysxgbq.js";import"./chunk-w7v4jzwy.js";import"./chunk-cbrt4s7m.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-z1nj22va.js";import"./chunk-br8r72bf.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-0g4wc808.js";import"./chunk-pn5ygqn6.js";import"./chunk-eqdbfgq5.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";var WELCOMED_KEY="welcomed";function shouldWelcome(state){if(state[WELCOMED_KEY]===!0)return!1;return typeof state[LAST_RUN_VERSION_KEY]!=="string"}function takeWelcome(){if(!shouldWelcome(loadStateFile()))return null;try{patchStateFile({[WELCOMED_KEY]:!0})}catch{}return{shell:detectShell()}}var WHATS_NEW_SEEN_KEY="app.whatsNewSeenVersion";function whatsNewFromVersion(state,current=CURRENT_VERSION){let stamped=state[WHATS_NEW_SEEN_KEY]??state[LAST_RUN_VERSION_KEY];if(typeof stamped!=="string"||stamped.length===0)return null;return compareSemver(current,stamped)>0?stamped:null}function takeWhatsNew(){let from=whatsNewFromVersion(loadStateFile());try{patchStateFile({[WHATS_NEW_SEEN_KEY]:CURRENT_VERSION})}catch{}return from}async function startTui(){let whatsNewFrom=takeWhatsNew(),welcome=takeWelcome();enforceResetGate(),publishRoveTerminalTitle(),await ensureGlobalRoveHooks();let{loadPluginEngines}=await import("./chunk-h2gznz46.js");loadPluginEngines();let{startSkillStatus}=await import("./chunk-r7kmn4js.js");startSkillStatus();let{startWorkspaceHost}=await import("./chunk-gctqthxq.js");await startWorkspaceHost({whatsNewFrom,welcome})}export{startTui};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{REPEAT_SEP,VerbArgs,defaultApiRuntime,findVerb,parseFlags,unknownVerbError,validateAgainstSpec}from"./chunk-
|
|
2
|
+
import{REPEAT_SEP,VerbArgs,defaultApiRuntime,findVerb,parseFlags,unknownVerbError,validateAgainstSpec}from"./chunk-bw98jn7g.js";import{ensurePluginEnginesLoaded}from"./chunk-283vd9h7.js";import{ApiError,cliCaller,requireVerbInstalled,splitDaemonCode}from"./chunk-r5j8fycq.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";function toApiError(err){if(err instanceof ApiError)return err;let message=errorMessage(err);if(/task not found/i.test(message))return new ApiError(message,"TASK_NOT_FOUND",{hint:"that task id does not exist (deleted or mistyped) \u2014 list live tasks and retry with a real id",nextCommandArgs:["api","list"]});if(/unknown daemon request:/i.test(message))return versionSkewError(message);let coded=splitDaemonCode(message);if(coded)return new ApiError(coded.rest,coded.code);return new ApiError(message,"RPC_ERROR")}function versionSkewError(message){return new ApiError(message,"DAEMON_VERSION_SKEW",{hint:"the running daemon is a different build than this CLI, so it does not serve this verb \u2014 restart the daemon to pick up this build, then retry (if the verb is gone for good, `rove api schema` lists what this daemon actually serves)",nextCommandArgs:["daemon","restart"]})}function errorBody(err){return{message:err.message,code:err.code,...err.data}}function successEnvelope(result){return{apiVersion:ROVE_API_VERSION,ok:!0,result}}function errorEnvelope(err){return{apiVersion:ROVE_API_VERSION,ok:!1,error:errorBody(toApiError(err))}}function flagText(name,spec,value){let type=spec?.type;if(typeof value==="string")return value;if(spec?.repeatable&&Array.isArray(value)&&value.every((item)=>typeof item==="string"))return value.join(REPEAT_SEP);if(typeof value==="boolean"&&(type==="bool"||type===void 0))return String(value);if(typeof value==="number"&&(type==="int"||type==="uint"||type===void 0))return String(value);if(Array.isArray(value)&&(type==="csv"||type===void 0)){if(!value.every((item)=>typeof item==="string"&&!item.includes(",")))throw new ApiError(`param ${name} must be a list of strings without ","`,"BAD_FLAG");return value.join(",")}throw new ApiError(`param ${name} does not fit its ${type} flag`,"BAD_FLAG")}function paramsToFlags(verb,params){let flags=new Map;for(let[name,value]of Object.entries(params))flags.set(name,flagText(name,verb.flags.find((f)=>f.name===name),value));return flags}function booleanFlagsOf(verb){return new Set(verb.flags.filter((f)=>f.type==="bool").map((f)=>f.name))}function repeatableFlagsOf(verb){return new Set(verb.flags.filter((f)=>f.repeatable).map((f)=>f.name))}async function callVerb(verb,flags,deps){requireVerbInstalled(verb);let caller=deps.caller??cliCaller();try{return await verb.handler({args:new VerbArgs(verb,flags,caller),caller,client:deps.client,runtime:deps.runtime??defaultApiRuntime})}catch(err){throw toApiError(err)}}async function runVerb(verbName,input,deps){ensurePluginEnginesLoaded();let verb=findVerb(verbName);if(!verb)throw unknownVerbError(verbName);if(verb.cliOnly&&!(deps.caller??cliCaller()).cli)throw new ApiError(`"${verbName}" streams over stdout/stdin, so only \`rove api\` can run it`,"CLI_ONLY_VERB",{hint:"run it as a CLI command on the machine whose daemon you are talking to"});let flags="argv"in input?parseFlags(input.argv,booleanFlagsOf(verb),repeatableFlagsOf(verb)).flags:paramsToFlags(verb,input.params);return validateAgainstSpec(verb,flags),callVerb(verb,flags,deps)}async function executeVerb(verbName,input,deps){try{return successEnvelope(await runVerb(verbName,input,deps))}catch(err){return errorEnvelope(err)}}function argvToParams(verbName,argv){let verb=findVerb(verbName);if(!verb)throw unknownVerbError(verbName);let{flags}=parseFlags(argv,booleanFlagsOf(verb),repeatableFlagsOf(verb));return Object.fromEntries(flags)}
|
|
3
3
|
export{toApiError,errorBody,successEnvelope,errorEnvelope,paramsToFlags,booleanFlagsOf,repeatableFlagsOf,callVerb,runVerb,executeVerb,argvToParams};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{interactiveEngineCommand,listPresetIds}from"./chunk-
|
|
2
|
+
import{interactiveEngineCommand,listPresetIds}from"./chunk-1n03wzx4.js";import{engineEntry}from"./chunk-d7f022eb.js";import{installedEngineIds}from"./chunk-h64rsbrx.js";import{spawnSync}from"child_process";import{statSync}from"fs";import path from"path";function whichOnPath(bin){let bunWhich=globalThis.Bun?.which;if(bunWhich)return bunWhich(bin);let out=spawnSync(process.platform==="win32"?"where":"which",[bin],{encoding:"utf8"});if(out.status!==0)return null;return out.stdout.split(`
|
|
3
3
|
`).map((l)=>l.trim()).find(Boolean)??null}var defaultDeps={which:whichOnPath,command:(vendor)=>interactiveEngineCommand(vendor)};function probeLaunchBinary(argv,which){let bin=argv[0]?.trim();if(!bin)return{found:!1,error:"no launch command"};if(bin.includes(path.sep)||bin.startsWith(".")){try{if(statSync(bin).isFile())return{found:!0,path:bin}}catch{}return{found:!1,error:`not found at ${bin}`}}let found=which(bin);return found?{found:!0,path:found}:{found:!1,error:"not found on PATH"}}async function detectEngineStatus(vendor,over={}){let deps={...defaultDeps,...over},detector=engineEntry(vendor).detectAccount;if(!detector)return{vendor,binary:probeLaunchBinary(deps.command(vendor),deps.which),account:null};let status=await detector(deps.accountDeps),binary=status.binary.found?status.binary:probeLaunchBinary(deps.command(vendor),deps.which);return{vendor,binary,account:status.account,accountError:status.accountError}}function detectEngineStatuses(vendors,over={}){return Promise.all(vendors.map((v)=>detectEngineStatus(v,over)))}function describeAccount(account){if(account===null)return"login not detectable";switch(account.kind){case"oauth":return"email"in account?`logged in (${account.email}${account.organization?`, ${account.organization}`:""})`:"logged in";case"chatgpt":return`logged in (${account.email}${account.plan?`, ${account.plan}`:""})`;case"apikey":return"API key";case"token":return`token (${account.source})`;default:return"no account"}}function engineUsable(status){return status.binary.found&&status.account?.kind!=="none"}async function probeableEngineIds(){return[...new Set([...listPresetIds(),...await installedEngineIds()])]}function summarizeEngines(statuses){let usable=[],signedOut=[];for(let status of statuses)if(engineUsable(status))usable.push(status.vendor);else if(status.binary.found)signedOut.push(status.vendor);return{usable,signedOut}}
|
|
4
4
|
export{detectEngineStatus,detectEngineStatuses,describeAccount,probeableEngineIds,summarizeEngines};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{MachineFeed,decodeMachines}from"./chunk-je80r59s.js";import"./chunk-v1r83m3n.js";import"./chunk-tz373e5w.js";import"./chunk-6xr1prk6.js";import"./chunk-atn06ncf.js";import"./chunk-vz0f8e8q.js";import"./chunk-sq6zj3fb.js";import"./chunk-y1xnjx8x.js";import"./chunk-0r1jf8m9.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-40dgv828.js";import"./chunk-6xppe9bj.js";import"./chunk-a4r45qdn.js";import"./chunk-d0hpes59.js";import"./chunk-mkfc9a09.js";import"./chunk-syn0tfwy.js";import"./chunk-32j6y5d1.js";import"./chunk-cmp64q4j.js";import"./chunk-n6marmjn.js";import"./chunk-96kvwzj8.js";import"./chunk-7kysxgbq.js";import"./chunk-xy8be792.js";import"./chunk-bejhca6z.js";import"./chunk-z1nj22va.js";import"./chunk-br8r72bf.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-0g4wc808.js";import"./chunk-pn5ygqn6.js";import"./chunk-eqdbfgq5.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{decodeMachines,MachineFeed};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var aliasKey=(alias)=>`${alias.taskId}::${alias.tabId}`;function isUnderKey(key,base){return key===base||key.startsWith(`${base}::`)}function aliasedKeys(tasks){return tasks.flatMap((task)=>task.ptyAlias?[aliasKey(task.ptyAlias)]:[])}function teardownScope(tasks,taskId,leaving){let spare=tasks.filter((t)=>t.ptyAlias?.taskId===taskId&&!leaving.has(t.id)&&!t.deletion).map((t)=>aliasKey(t.ptyAlias)),own=tasks.find((t)=>t.id===taskId)?.ptyAlias;return{spare,also:own&&own.taskId!==taskId?[aliasKey(own)]:[]}}function ptyScopeFor(tasks,taskId){let alias=tasks.find((t)=>t.id===taskId)?.ptyAlias;return{...alias?{alias}:{},claimed:aliasedKeys(tasks)}}function unclaimedSessions(sessions,scope){let own=scope?.alias?aliasKey(scope.alias):void 0,foreign=(scope?.claimed??[]).filter((base)=>base!==own);return sessions.filter((s)=>!foreign.some((base)=>isUnderKey(s.key,base)))}function hostedKeyFor(taskId,tabId,scope){if(scope?.alias&&scope.alias.tabId===tabId)return aliasKey(scope.alias);let key=`${taskId}::${tabId}`;return unclaimedSessions([{key}],scope).length>0?key:null}
|
|
3
|
+
export{aliasKey,isUnderKey,aliasedKeys,teardownScope,ptyScopeFor,unclaimedSessions,hostedKeyFor};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{TaskIndexStore}from"./chunk-
|
|
2
|
+
import{TaskIndexStore}from"./chunk-yk9b8zgn.js";import"./chunk-qkehg2c1.js";import"./chunk-w7v4jzwy.js";import"./chunk-cbrt4s7m.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-0g4wc808.js";import"./chunk-pn5ygqn6.js";import"./chunk-eqdbfgq5.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{TaskIndexStore};
|