@sma1lboy/rove 0.9.274 → 0.9.277-next.1
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-kgs56yns.js → chunk-0a65j1zj.js} +1 -1
- package/dist/cli/{chunk-55ajzrj6.js → chunk-0r1jf8m9.js} +1 -1
- package/dist/cli/{chunk-q6septaj.js → chunk-0rvydb9q.js} +1 -1
- package/dist/cli/chunk-1g6vhgfe.js +14 -0
- package/dist/cli/{chunk-mmq6922s.js → chunk-1vxtd8rh.js} +2 -2
- package/dist/cli/chunk-1wwqf6kx.js +3 -0
- package/dist/cli/{chunk-8h437k1q.js → chunk-2kbzb24j.js} +1 -1
- package/dist/cli/chunk-2kt0mfvf.js +2 -0
- package/dist/cli/{chunk-m4dvx7bd.js → chunk-2vph030z.js} +3 -3
- package/dist/cli/chunk-2xsxcdp6.js +3 -0
- package/dist/cli/{chunk-fexzfgd1.js → chunk-2y70y8na.js} +1 -1
- package/dist/cli/{chunk-tw9w8pzg.js → chunk-36eyrv4r.js} +3 -3
- package/dist/cli/chunk-37fas9aj.js +2 -0
- package/dist/cli/chunk-3dhv5n19.js +2 -0
- package/dist/cli/{chunk-kx53jjee.js → chunk-3x5g06mw.js} +8 -6
- package/dist/cli/{chunk-8sggyn8y.js → chunk-3y0z478f.js} +1 -1
- package/dist/cli/chunk-4dt1gfb3.js +3 -0
- package/dist/cli/chunk-4w4tpsqx.js +2 -0
- package/dist/cli/chunk-5apxck3d.js +97 -0
- package/dist/cli/chunk-5vrg6h71.js +3 -0
- package/dist/cli/chunk-5xpvd182.js +2 -0
- package/dist/cli/chunk-5yfffvqe.js +2 -0
- package/dist/cli/{chunk-gryq2vgw.js → chunk-5yh5trgy.js} +1 -1
- package/dist/cli/chunk-61cn88e7.js +15 -0
- package/dist/cli/{chunk-g9yba5vh.js → chunk-671ak750.js} +2 -2
- package/dist/cli/chunk-676f3tva.js +5 -0
- package/dist/cli/chunk-6hcyvg0m.js +3 -0
- package/dist/cli/chunk-6mg5zp8y.js +2 -0
- package/dist/cli/chunk-6q4br0pt.js +2 -0
- package/dist/cli/chunk-6wfhq8xd.js +4 -0
- package/dist/cli/{chunk-ypd337d0.js → chunk-748656h7.js} +3 -3
- package/dist/cli/chunk-7bakcyes.js +5 -0
- package/dist/cli/{chunk-hfdk7j28.js → chunk-7kgcy89w.js} +1 -1
- package/dist/cli/chunk-8qkyd589.js +5 -0
- package/dist/cli/chunk-9ckvdy0j.js +3 -0
- package/dist/cli/{chunk-egpcaxwb.js → chunk-9fdy8vne.js} +1 -1
- package/dist/cli/{chunk-h8t4xg1p.js → chunk-9rj2fx6v.js} +1 -1
- package/dist/cli/chunk-9x2xd1rz.js +2 -0
- package/dist/cli/{chunk-r77pfw4m.js → chunk-9zswhjkv.js} +1 -1
- package/dist/cli/{chunk-p6jw0zcd.js → chunk-agvtzads.js} +1 -1
- package/dist/cli/chunk-aq4j8ar4.js +2 -0
- package/dist/cli/{chunk-ecrw211n.js → chunk-aqwckba5.js} +1 -1
- package/dist/cli/{chunk-rzef6szc.js → chunk-atg13xab.js} +1 -1
- package/dist/cli/{chunk-ez438kn3.js → chunk-b95q6zhk.js} +1 -1
- package/dist/cli/chunk-bagwgxsg.js +2 -0
- package/dist/cli/{chunk-4hnz77xf.js → chunk-bcyex84w.js} +1 -1
- package/dist/cli/chunk-bv050ssb.js +8 -0
- package/dist/cli/chunk-bykqhbvy.js +2 -0
- package/dist/cli/{chunk-29s67j3k.js → chunk-ca4x8s96.js} +4 -4
- package/dist/cli/chunk-cakyme4s.js +2 -0
- package/dist/cli/{chunk-16ttm9x6.js → chunk-ccmke5sx.js} +1 -1
- package/dist/cli/chunk-cf3vpsm5.js +3 -0
- package/dist/cli/chunk-d552cvb2.js +2 -0
- package/dist/cli/{chunk-gcg5h667.js → chunk-dsdtq087.js} +1 -1
- package/dist/cli/{chunk-387ecqb8.js → chunk-e58kj4gm.js} +1 -1
- package/dist/cli/chunk-ee314raa.js +2 -0
- package/dist/cli/{chunk-0rrmz6k6.js → chunk-eege1x0a.js} +1 -1
- package/dist/cli/{chunk-m6yy3qc1.js → chunk-fgtc1xq9.js} +1 -1
- package/dist/cli/{chunk-5dd7trgf.js → chunk-fq2pefc5.js} +1 -1
- package/dist/cli/chunk-g4p5znv1.js +2 -0
- package/dist/cli/chunk-g9ba25q5.js +3 -0
- package/dist/cli/{chunk-qe7xb4rm.js → chunk-g9xknhjq.js} +2 -2
- package/dist/cli/chunk-gbd5j3dv.js +2 -0
- package/dist/cli/{chunk-ycd28edp.js → chunk-ggjmcqpt.js} +3 -4
- package/dist/cli/chunk-hv79ys32.js +1 -1
- package/dist/cli/chunk-hz1x3hak.js +3 -0
- package/dist/cli/{chunk-03rbg95q.js → chunk-hzz020xx.js} +5 -5
- package/dist/cli/chunk-j1qy79fd.js +3 -0
- package/dist/cli/chunk-j9tsdn1d.js +2 -0
- package/dist/cli/chunk-jejmt4k0.js +140 -0
- package/dist/cli/chunk-jj5f4n51.js +1 -1
- package/dist/cli/{chunk-nzbq51h9.js → chunk-k225696b.js} +1 -1
- package/dist/cli/{chunk-by6fjf7m.js → chunk-kag7cfbr.js} +1 -1
- package/dist/cli/{chunk-jwedmkm8.js → chunk-kdnk8m5j.js} +1 -1
- package/dist/cli/{chunk-yzkhwn31.js → chunk-kxp04jnp.js} +1 -1
- package/dist/cli/chunk-m4z6kepz.js +3 -0
- package/dist/cli/chunk-mdc7b01e.js +3 -0
- package/dist/cli/{chunk-bj6sa371.js → chunk-mjyhy152.js} +1 -1
- package/dist/cli/chunk-mqfvzdpr.js +3 -0
- package/dist/cli/chunk-mqvkd2g1.js +2 -0
- package/dist/cli/chunk-mvtqstte.js +4 -0
- package/dist/cli/{chunk-qs1r0tqr.js → chunk-mxx0y791.js} +1 -1
- package/dist/cli/{chunk-1rjq808h.js → chunk-n0rdn2fn.js} +1 -1
- package/dist/cli/{chunk-3v9s3bcz.js → chunk-n2zgej1a.js} +1 -1
- package/dist/cli/chunk-n94vzkbe.js +3 -0
- package/dist/cli/chunk-njncqdwf.js +2 -0
- package/dist/cli/{chunk-6jk2khme.js → chunk-nw092jak.js} +1 -1
- package/dist/cli/{chunk-22d4fjjb.js → chunk-pfagrkt6.js} +1 -1
- package/dist/cli/{chunk-sa48rtjz.js → chunk-pnrftncm.js} +1 -1
- package/dist/cli/{chunk-mxgtz5vz.js → chunk-pqr6td4z.js} +1 -1
- package/dist/cli/chunk-q8ffd1pc.js +3 -0
- package/dist/cli/{chunk-snqa07h6.js → chunk-qcjkactr.js} +1 -1
- package/dist/cli/{chunk-tjj9bt7n.js → chunk-qqr4tfhk.js} +1 -1
- package/dist/cli/chunk-qs359899.js +3 -0
- package/dist/cli/{chunk-sza3tyhs.js → chunk-qzzmd63x.js} +2 -3
- package/dist/cli/{chunk-xkmdxcjg.js → chunk-r2bb8b11.js} +1 -1
- package/dist/cli/{chunk-rtpa8hg3.js → chunk-rjfdzjhj.js} +1 -1
- package/dist/cli/chunk-rjy900p4.js +4 -0
- package/dist/cli/chunk-rmsdybs3.js +20 -0
- package/dist/cli/{chunk-y5axx6ev.js → chunk-rztqccs3.js} +1 -1
- package/dist/cli/chunk-s1308b3d.js +63 -0
- package/dist/cli/{chunk-b492aee1.js → chunk-se00fc8v.js} +1 -1
- package/dist/cli/chunk-shtm72c0.js +3 -0
- package/dist/cli/{chunk-dpq60qph.js → chunk-t9vjj8sy.js} +1 -1
- package/dist/cli/chunk-ta1p2nwa.js +6 -0
- package/dist/cli/chunk-teh40faw.js +1 -1
- package/dist/cli/{chunk-gqh6atvp.js → chunk-tjhw09bz.js} +1 -1
- package/dist/cli/chunk-tnatqcy7.js +2 -0
- package/dist/cli/chunk-tq0h3vy6.js +3 -0
- package/dist/cli/{chunk-9er68n24.js → chunk-tt58819p.js} +1 -1
- package/dist/cli/chunk-tw9tfs1d.js +3 -0
- package/dist/cli/chunk-v6dz59gy.js +2 -0
- package/dist/cli/chunk-v6v272b3.js +3 -0
- package/dist/cli/chunk-vkv1v3xn.js +56 -0
- package/dist/cli/chunk-vkz6kkmm.js +24 -0
- package/dist/cli/chunk-vp29jgbt.js +4 -0
- package/dist/cli/chunk-vpsarakj.js +2 -0
- package/dist/cli/{chunk-xbwq4bc0.js → chunk-vr2r2ncm.js} +1 -1
- package/dist/cli/{chunk-qvnr8c18.js → chunk-vvqwgcge.js} +1 -1
- package/dist/cli/{chunk-5gzpq34w.js → chunk-vwpf55cr.js} +3 -3
- package/dist/cli/{chunk-zaw71cf4.js → chunk-vytrhm50.js} +1 -1
- package/dist/cli/chunk-w77s2df8.js +3 -0
- package/dist/cli/{chunk-bexnp6g4.js → chunk-w7v71t7e.js} +1 -1
- package/dist/cli/chunk-wfgrn8p2.js +4 -0
- package/dist/cli/chunk-wzss4pzh.js +3 -0
- package/dist/cli/chunk-x1ghdmp1.js +2 -0
- package/dist/cli/chunk-x1jxxmtc.js +3 -0
- package/dist/cli/{chunk-edrxs4cy.js → chunk-x83xbzjd.js} +5 -5
- package/dist/cli/{chunk-9trbc3kj.js → chunk-x85rcep5.js} +2 -2
- package/dist/cli/{chunk-jd7p0y5x.js → chunk-x89zw7br.js} +1 -1
- package/dist/cli/chunk-xg42e2ff.js +19 -0
- package/dist/cli/{chunk-sbds7zx4.js → chunk-xte4phd1.js} +1 -1
- package/dist/cli/chunk-y8b2p44q.js +1 -1
- package/dist/cli/chunk-ys6v36ph.js +2 -0
- package/dist/cli/chunk-yzdrhytj.js +10 -0
- package/dist/cli/{chunk-39sfhppm.js → chunk-z3qz6enf.js} +1 -1
- package/dist/cli/chunk-z3wrbtcq.js +22 -0
- package/dist/cli/chunk-z43e08kw.js +4 -0
- package/dist/cli/{chunk-t34kjg5y.js → chunk-zpwvjt14.js} +7 -4
- package/dist/cli/chunk-zrf93zrx.js +2 -0
- package/dist/cli/index.js +9 -12
- package/dist/cli/pty-host-node.mjs +259 -32
- 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 +25 -10
- package/dist/skills/rove/references/api-flags.md +30 -14
- package/dist/web/assets/index-BVQbpUea.css +1 -0
- package/dist/web/assets/index-Cn_7vMHX.js +152 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-600-normal-8K4wrrwR.woff +0 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- package/dist/web/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-greek-600-normal-mc2nkWzM.woff +0 -0
- package/dist/web/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/web/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
- package/dist/web/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-600-normal-DObL3zCW.woff +0 -0
- package/dist/web/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- package/dist/web/assets/jetbrains-mono-vietnamese-600-normal-OWROknRo.woff +0 -0
- package/dist/web/index.html +2 -2
- package/dist/web/relay/index.html +34 -0
- package/dist/web/sw.js +52 -0
- package/dist/web-ui/assets/{harness-pEyVtWV4.js → harness-C7ciHx2w.js} +2 -2
- package/dist/web-ui/assets/{index-Dyg-qcgB.js → index-B1FLht5L.js} +2 -2
- package/dist/web-ui/assets/{index-Bsn8NuKa.css → index-BDIkPexK.css} +1 -1
- package/dist/web-ui/index.html +2 -2
- package/package.json +3 -3
- package/dist/cli/chunk-033k4ap7.js +0 -2
- package/dist/cli/chunk-0g3sjn8z.js +0 -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-1exwrmjd.js +0 -3
- package/dist/cli/chunk-1ffqacz9.js +0 -3
- package/dist/cli/chunk-2v68zaaa.js +0 -2
- package/dist/cli/chunk-2y29zrm1.js +0 -2
- package/dist/cli/chunk-4d1v6066.js +0 -3
- package/dist/cli/chunk-4dxc29mm.js +0 -2
- package/dist/cli/chunk-5zsdjrgz.js +0 -4
- package/dist/cli/chunk-68wpp5y8.js +0 -20
- 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-97m9nyw7.js +0 -2
- package/dist/cli/chunk-9bae7f3m.js +0 -4
- 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-cpf78z3x.js +0 -4
- package/dist/cli/chunk-cyzp2btw.js +0 -63
- package/dist/cli/chunk-d9e4ssy7.js +0 -12
- package/dist/cli/chunk-e01321zn.js +0 -5
- package/dist/cli/chunk-ec7f3wcm.js +0 -3
- package/dist/cli/chunk-erx7x9xg.js +0 -97
- package/dist/cli/chunk-ewqqwtrj.js +0 -2
- package/dist/cli/chunk-fmbv4m3y.js +0 -25
- package/dist/cli/chunk-fs51wx31.js +0 -3
- package/dist/cli/chunk-fvvb0072.js +0 -3
- package/dist/cli/chunk-g263457v.js +0 -2
- package/dist/cli/chunk-g3tv8kht.js +0 -2
- package/dist/cli/chunk-g53yqr82.js +0 -78
- package/dist/cli/chunk-k67vbszb.js +0 -3
- package/dist/cli/chunk-kyt9ytz2.js +0 -20
- package/dist/cli/chunk-n2ejvjrd.js +0 -3
- package/dist/cli/chunk-p4s826r2.js +0 -96
- package/dist/cli/chunk-p6334e7v.js +0 -2
- package/dist/cli/chunk-q9zgj6kw.js +0 -3
- package/dist/cli/chunk-qfe1wf5c.js +0 -2
- package/dist/cli/chunk-r40aj7z6.js +0 -2
- package/dist/cli/chunk-sqxdfzdq.js +0 -5
- package/dist/cli/chunk-sz2xs0a2.js +0 -4
- package/dist/cli/chunk-t5y8k772.js +0 -2
- package/dist/cli/chunk-vht2e44j.js +0 -10
- package/dist/cli/chunk-vjp7drne.js +0 -2
- package/dist/cli/chunk-vm551pxs.js +0 -2
- package/dist/cli/chunk-w09356fj.js +0 -20
- package/dist/cli/chunk-w9cdc97q.js +0 -3
- package/dist/cli/chunk-x20bs6bs.js +0 -3
- 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-C9vaSoIJ.js +0 -113
- package/dist/web/assets/index-sA2EEQJw.css +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{readFirstNonEmptyRepoFile}from"./chunk-catrr0z3.js";var DEFAULT_CI_PROMPT_TEMPLATE=`CI is failing on this branch and the user wants it green.
|
|
3
|
+
|
|
4
|
+
The current branch is {{branch}}.
|
|
5
|
+
{{prSentence}}
|
|
6
|
+
{{jobsSentence}}
|
|
7
|
+
|
|
8
|
+
{{logs}}
|
|
9
|
+
|
|
10
|
+
Follow these steps:
|
|
11
|
+
|
|
12
|
+
- Read the log excerpts above and name the actual failure before changing anything \u2014 a job can fail for a reason its last line does not state.
|
|
13
|
+
- Reproduce it locally where you can. Prefer the same command the job ran.
|
|
14
|
+
- Fix the cause, not the symptom, and do not weaken a gate to make it pass.
|
|
15
|
+
- Re-run the local equivalent of the failing job before pushing.
|
|
16
|
+
|
|
17
|
+
If the log excerpt is empty or does not explain the failure, say so and ask the user for help rather than guessing.`;function prSentence(prNumber){return prNumber===void 0?"There is no PR number recorded.":`The pull request is #${prNumber}.`}function jobsSentence(state){let names=state.checks.map((check)=>`${check.jobName} (${check.conclusion.toLowerCase()})`);if(names.length===0)return"No failing job was reported.";let total=state.totalFailing??names.length,extra=total>names.length?` ${total-names.length} further failing check(s) are not shown.`:"";return`${names.length===1?`The failing job is ${names[0]}.`:`The failing jobs are ${names.join(", ")}.`}${extra}`}function logs(checks){if(checks.length===0)return"";return checks.map((check)=>{let header=check.url?`### ${check.jobName} \u2014 ${check.url}`:`### ${check.jobName}`,body=check.tail.length>0?`\`\`\`
|
|
18
|
+
${check.tail}
|
|
19
|
+
\`\`\``:"(no log available \u2014 open the job in a browser to read it)";return`${header}
|
|
20
|
+
|
|
21
|
+
${body}`}).join(`
|
|
22
|
+
|
|
23
|
+
`)}function renderCIPrompt(template,state){let replacements={branch:state.branch,prSentence:prSentence(state.prNumber),jobsSentence:jobsSentence(state),logs:logs(state.checks)};return template.replace(/\{\{([a-zA-Z][a-zA-Z0-9_]*)\}\}/g,(match,key)=>Object.hasOwn(replacements,key)?replacements[key]:match)}var CI_INSTRUCTION_FILENAME="ci-instructions.md";function loadTemplate(worktree){return readFirstNonEmptyRepoFile(worktree,CI_INSTRUCTION_FILENAME)??DEFAULT_CI_PROMPT_TEMPLATE}async function buildCIPromptForWorktree(worktree,state){return renderCIPrompt(loadTemplate(worktree),state)}
|
|
24
|
+
export{buildCIPromptForWorktree};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{managedWorktreeRootsFor,readWorktreeBaseOverride}from"./chunk-gq36nzg8.js";import{pathIdentity,pathSyntax,pathWithin,samePath}from"./chunk-pn5ygqn6.js";import{existsSync}from"fs";import{homedir}from"os";import path from"path";function ownerFirst(a,b){let rank=(t)=>t.sharesWorkspaceOf?1:0;return rank(a)-rank(b)||(a.id<b.id?-1:a.id>b.id?1:0)}function resolvePtyOwner(tasks,taskId,tabId){if(!tabId)return taskId;return tasks.find((t)=>t.ptyAlias?.taskId===taskId&&t.ptyAlias.tabId===tabId)?.id??taskId}function crossesRepoBoundary(wt,cwd){let syntax=pathSyntax(cwd);for(let dir=cwd;!samePath(dir,wt);dir=syntax.dirname(dir)){if(existsSync(syntax.join(dir,".git")))return!0;if(samePath(dir,syntax.dirname(dir)))break}return!1}function worktreesOf(t){return[t.worktreePath,...(t.extraRepos??[]).map((x)=>x.worktreePath)].filter((p)=>!!p)}function matchTaskByCwd(tasks,cwd){let target=pathIdentity(cwd),best,bestWt="";for(let t of tasks)for(let worktree of worktreesOf(t)){let wt=pathIdentity(worktree);if(pathWithin(wt,target)===null)continue;if(samePath(wt,homedir())&&!samePath(wt,target))continue;if(!best||wt.length>bestWt.length||wt.length===bestWt.length&&ownerFirst(t,best)<0)best=t,bestWt=wt}if(best&&crossesRepoBoundary(bestWt,target))return;return best?.id}function tasksAtWorktreePath(tasks,worktreePath){let target=pathIdentity(worktreePath);return tasks.filter((t)=>worktreesOf(t).some((wt)=>pathIdentity(wt)===target)).sort(ownerFirst).map((t)=>t.id)}function findAdoptableWorktree(tasks,cwd){let target=pathIdentity(cwd),repos=new Set,known=new Set;for(let t of tasks){if(t.repo&&path.isAbsolute(t.repo))repos.add(pathIdentity(t.repo));for(let wt of worktreesOf(t))known.add(pathIdentity(wt))}for(let repo of repos)for(let root of managedWorktreeRootsFor(repo,readWorktreeBaseOverride(repo)).map(pathIdentity)){let prefix=root.endsWith("/")?root:`${root}/`,rest=pathWithin(root,target);if(!rest)continue;let name=rest.split("/")[0];if(!name)continue;let worktreePath=`${prefix}${name}`;if(known.has(worktreePath))return;return{repo,worktreePath}}return}var DISPATCH_PROMPT_HEAD_CHARS=160;var SETTLED=new Set(["done","failed"]);function next(status,state){if(state==="error"||state==="dead")return"failed";if(state==="running"&&(status==="delivered"||status==="asking"))return"working";if(state==="permission_needed"&&(status==="delivered"||status==="working"))return"asking";if((state==="turn_complete"||state==="idle")&&(status==="working"||status==="asking"))return"done";return}class DispatchLedger{bus;rows=[];seq=1;rev=0;expiry=null;relayed=new Set;off;now;constructor(bus,now){this.bus=bus;this.now=now??Date.now,this.off=bus.onPublish((event)=>{if(event.channel==="engine-state")this.take(event.payload);else if(event.channel==="machines")this.takeRelayed(event.payload)})}list(){return{rows:this.rows,rev:this.rev}}record(input){let at=this.now(),row={id:`x-${this.seq++}`,kind:input.kind,from:input.from,...input.routine?{routine:input.routine}:{},to:input.to,promptHead:input.promptHead.replace(/\s+/g," ").trim().slice(0,160),at,status:input.delivered?"delivered":"failed",statusAt:at,...input.reason?{reason:input.reason}:{},...input.deliveryId?{deliveryId:input.deliveryId}:{}};return this.rows=[...this.rows,row],this.publish(),row}close(){this.off(),this.clearExpiry()}take(payload){let p=payload;if(typeof p.taskId!=="string"||typeof p.state!=="string")return;let tabId=typeof p.tabId==="string"&&p.tabId?p.tabId:null,at=typeof p.at==="number"?p.at:this.now(),changed=!1;if(this.rows=this.rows.map((row)=>{if(SETTLED.has(row.status)||row.to.taskId!==p.taskId||at<row.at)return row;if(row.to.tabId!==null&&tabId!==null&&row.to.tabId!==tabId)return row;let status=next(row.status,p.state);if(!status)return row;return changed=!0,{...row,to:row.to.tabId===null&&tabId!==null?{...row.to,tabId}:row.to,status,statusAt:at,...status==="failed"?{reason:p.state}:{}}}),changed)this.publish()}takeRelayed(payload){let activity=payload?.live?.activity;if(!activity||typeof activity!=="object")return;let seen=new Set;for(let[taskId,reading]of Object.entries(activity)){if(!reading||typeof reading!=="object")continue;seen.add(taskId),this.take({...reading,taskId})}for(let taskId of this.relayed)if(!seen.has(taskId))this.take({taskId,state:"idle",at:this.now()});this.relayed=seen}publish(){this.rows=prune(this.rows,this.now()),this.rev+=1,this.bus.publish("dispatch.snapshot",this.list()),this.scheduleExpiry()}scheduleExpiry(){this.clearExpiry();let open=this.rows.filter((r)=>!SETTLED.has(r.status));if(open.length===0)return;let due=Math.min(...open.map((r)=>r.statusAt))+21600000;this.expiry=setTimeout(()=>{if(this.expiry=null,prune(this.rows,this.now()).length!==this.rows.length)this.publish();else this.scheduleExpiry()},Math.max(0,due-this.now())),this.expiry.unref?.()}clearExpiry(){if(this.expiry)clearTimeout(this.expiry);this.expiry=null}}function prune(rows,now){let open=rows.filter((r)=>!SETTLED.has(r.status)&&now-r.statusAt<21600000).slice(-100),settled=rows.filter((r)=>SETTLED.has(r.status)).slice(-40),keep=new Set([...open,...settled]);return rows.filter((r)=>keep.has(r))}import{spawnSync}from"child_process";import{existsSync as existsSync2}from"fs";function normalizeRemoteUrl(url){let u=url.trim();return u=u.replace(/^[a-z+]+:\/\//i,""),u=u.replace(/^[^@/]+@/,""),u=u.replace(/^([^/:]+):(?!\d+\/)/,"$1/"),u=u.replace(/^([^/:]+):\d+\//,"$1/"),u=u.replace(/\/+$/,"").replace(/\.git$/i,""),u=u.replace(/^ssh\.github\.com\//i,"github.com/"),u.toLowerCase()}function git(cwd,args){let res=spawnSync("git",["-C",cwd,...args],{encoding:"utf8",timeout:5000,windowsHide:!0});return res.status===0?res.stdout.trim():null}function computeRepoId(path2){let origin=git(path2,["remote","get-url","origin"]);if(origin)return normalizeRemoteUrl(origin);let root=git(path2,["rev-list","--max-parents=0","HEAD"])?.split(`
|
|
3
|
+
`).filter(Boolean).sort()[0];return root?`root:${root}`:void 0}var memo=new Map;function repoIdOf(path2){if(!path2)return;if(memo.has(path2))return memo.get(path2);if(!existsSync2(path2))return;let id=computeRepoId(path2);return memo.set(path2,id),id}
|
|
4
|
+
export{resolvePtyOwner,matchTaskByCwd,tasksAtWorktreePath,findAdoptableWorktree,DISPATCH_PROMPT_HEAD_CHARS,DispatchLedger,normalizeRemoteUrl,repoIdOf};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{argvToParams,booleanFlagsOf,callVerb,errorBody,errorEnvelope,executeVerb,paramsToFlags,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-fgtc1xq9.js";import"./chunk-z3wrbtcq.js";import"./chunk-zpwvjt14.js";import"./chunk-kdnk8m5j.js";import"./chunk-qcjkactr.js";import"./chunk-rjfdzjhj.js";import"./chunk-r2bb8b11.js";import"./chunk-agvtzads.js";import"./chunk-pm91e38v.js";import"./chunk-2xsxcdp6.js";import"./chunk-17e2tgyg.js";import"./chunk-1vxtd8rh.js";import"./chunk-q8ffd1pc.js";import"./chunk-4hestsjp.js";import"./chunk-qgrg9a5n.js";import"./chunk-2bgmby1d.js";import"./chunk-n0rdn2fn.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import"./chunk-tt58819p.js";import"./chunk-ta1p2nwa.js";import"./chunk-vytrhm50.js";import"./chunk-vp29jgbt.js";import"./chunk-gq36nzg8.js";import"./chunk-sq6zj3fb.js";import"./chunk-qkehg2c1.js";import"./chunk-shtm72c0.js";import"./chunk-j1qy79fd.js";import"./chunk-z43e08kw.js";import"./chunk-w77s2df8.js";import"./chunk-mqfvzdpr.js";import"./chunk-cf3vpsm5.js";import"./chunk-rxqdw6s5.js";import"./chunk-kxp04jnp.js";import"./chunk-tw9tfs1d.js";import"./chunk-61cn88e7.js";import"./chunk-atg13xab.js";import"./chunk-r5j8fycq.js";import"./chunk-xfgqae9t.js";import"./chunk-j1z9kgyd.js";import"./chunk-g9ba25q5.js";import"./chunk-ggnq2vvk.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import"./chunk-mdc7b01e.js";import"./chunk-tn9gtf18.js";import"./chunk-895yqjjz.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-e58kj4gm.js";import"./chunk-0a65j1zj.js";import"./chunk-bcyex84w.js";import"./chunk-vvqwgcge.js";import"./chunk-x83xbzjd.js";import"./chunk-2tfnscxk.js";import"./chunk-hzz020xx.js";import"./chunk-w7zv47mp.js";import"./chunk-etfh8f4z.js";import"./chunk-9rj2fx6v.js";import"./chunk-rfp0ayra.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-40dgv828.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import"./chunk-9ckvdy0j.js";import"./chunk-zsfyj36g.js";import"./chunk-2r1fgng9.js";import"./chunk-2brn8e1y.js";import"./chunk-7mwvvj46.js";import"./chunk-32j6y5d1.js";import"./chunk-mjyhy152.js";import"./chunk-wzss4pzh.js";import"./chunk-cmp64q4j.js";import"./chunk-qzzmd63x.js";import"./chunk-96kvwzj8.js";import"./chunk-7bakcyes.js";import"./chunk-8qkyd589.js";import"./chunk-7kysxgbq.js";import"./chunk-hz1x3hak.js";import"./chunk-x1jxxmtc.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-7ghwdjdc.js";import"./chunk-8t7qbr1e.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import"./chunk-z1nj22va.js";import"./chunk-zt7wfnva.js";import"./chunk-0g4wc808.js";import"./chunk-pn5ygqn6.js";import"./chunk-eqdbfgq5.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-pxk2c2vj.js";import"./chunk-91sykzqq.js";export{toApiError,successEnvelope,runVerb,repeatableFlagsOf,paramsToFlags,executeVerb,errorEnvelope,errorBody,callVerb,booleanFlagsOf,argvToParams};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{submitFeedback}from"./chunk-
|
|
2
|
+
import{submitFeedback}from"./chunk-tt58819p.js";import"./chunk-9ckvdy0j.js";import"./chunk-z1nj22va.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";import{readFileSync}from"fs";var CLI_NAME=ROVE_PRODUCT_NAME,FEEDBACK_USAGE=[`Usage: ${CLI_NAME} feedback --title <text> (--body <text> | --body-file <path>) [--category <slug>]`,"","Create a GitHub Discussion in the Rove repository using the GitHub CLI.","","Requires:"," gh auth login","","Options:"," --title <text> Discussion title"," --body <text> Discussion body"," --body-file <path> Read the Discussion body from a file; use - for stdin"," --category <slug> Discussion category slug (default: feedback)"," -h, --help Print this help",""].join(`
|
|
3
3
|
`);function usageError(message){process.stderr.write(`${CLI_NAME} feedback: ${message}
|
|
4
4
|
|
|
5
5
|
${FEEDBACK_USAGE}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{engineEntry,identifiableEngineIds}from"./chunk-
|
|
2
|
+
import{engineEntry,identifiableEngineIds}from"./chunk-x83xbzjd.js";import{recordSpawn}from"./chunk-40dgv828.js";import{loadStateFile}from"./chunk-32j6y5d1.js";import{PsProbeUnavailableError}from"./chunk-pxk2c2vj.js";import{__require}from"./chunk-91sykzqq.js";import{basename}from"path";var WRAPPERS=new Set(["node","bun","npx","deno","sh","zsh","bash","env","script"]);function binaryName(token){return basename(token).replace(/\.(exe|js|mjs|cjs)$/,"")}function executableNameFromArgv(argv){for(let token of argv.slice(0,8)){if(/^[A-Za-z_][A-Za-z0-9_]*=/.test(token))continue;let name=binaryName(token);if(WRAPPERS.has(name))continue;return name||null}return null}function vendorFromArgv(commandLine){let name=executableNameFromArgv(commandLine.trim().split(/\s+/));if(!name)return null;return identifiableEngineIds().find((v)=>{let entry=engineEntry(v);return entry.defaultCommand[0]===name||entry.processNames?.includes(name)===!0})??null}function parsePsSnapshot(text){let rows=[];for(let line of text.split(`
|
|
3
3
|
`)){let m=/^\s*(\d+)\s+(\d+)\s+(\S.*)$/.exec(line);if(m)rows.push({pid:Number(m[1]),ppid:Number(m[2]),args:m[3]})}return rows}function childrenIndex(rows){let kids=new Map;for(let row of rows){let list=kids.get(row.ppid);if(list)list.push(row);else kids.set(row.ppid,[row])}return kids}function hasAncestor(rows,pid,ancestorPid){let parents=new Map(rows.map((r)=>[r.pid,r.ppid])),cur=pid;for(let hops=0;hops<=rows.length;hops++){if(cur===ancestorPid)return!0;let next=parents.get(cur);if(next===void 0||next<=1)return!1;cur=next}return!1}function customEngineBinaries(){let state=loadStateFile(),ids=state.customEngineIds,out=new Map;if(!Array.isArray(ids))return out;for(let id of ids){if(typeof id!=="string"||id.trim().length===0)continue;let command=state[`engineCommand.${id}`],argv=typeof command==="string"&&command.trim().length>0?command.trim().split(/\s+/):[id],name=executableNameFromArgv(argv);if(name)out.set(name,id)}return out}function findDescendant(rows,rootPid,pick){let kids=childrenIndex(rows),queue=[...kids.get(rootPid)??[]],visited=new Set;while(queue.length>0){let row=queue.shift();if(!row)break;if(visited.has(row.pid))continue;visited.add(row.pid);let hit=pick(row);if(hit!==null)return hit;queue.push(...kids.get(row.pid)??[])}return null}function walkDescendants(rows,rootPid,identify){return findDescendant(rows,rootPid,(row)=>{let vendor=identify(row.args);return vendor?{vendor,argv:row.args,pid:row.pid}:null})}function foregroundEngineIn(rows,rootPid){let builtin=walkDescendants(rows,rootPid,vendorFromArgv);if(builtin)return builtin;let custom=customEngineBinaries();if(custom.size===0)return null;return walkDescendants(rows,rootPid,(args)=>custom.get(executableNameFromArgv(args.trim().split(/\s+/))??"")??null)}function engineProcessIn(rows,rootPid,extraLaunch){if(foregroundEngineIn(rows,rootPid))return!0;let expected=extraLaunch?executableNameFromArgv(typeof extraLaunch==="string"?[extraLaunch]:extraLaunch):null;if(!expected)return!1;return findDescendant(rows,rootPid,(row)=>executableNameFromArgv(row.args.trim().split(/\s+/))===expected?!0:null)===!0}var PS_PROBE_TIMEOUT_MS=5000,bunPsSpawn=()=>{recordSpawn("engine.foregroundWalk",["ps","-A","-o","pid=,ppid=,args="]);let proc=Bun.spawn(["ps","-A","-o","pid=,ppid=,args="],{stdout:"pipe",stderr:"ignore"});return{text:new Response(proc.stdout).text(),kill:()=>proc.kill()}};async function psSnapshotWith(spawn,timeoutMs=PS_PROBE_TIMEOUT_MS){let proc=spawn(),timer;try{let text=await Promise.race([proc.text,new Promise((_resolve,reject)=>{timer=setTimeout(()=>{try{proc.kill()}catch{}reject(new PsProbeUnavailableError(`ps did not answer within ${timeoutMs}ms`))},timeoutMs)})]);if(parsePsSnapshot(text).length===0)throw new PsProbeUnavailableError("ps returned no usable rows");return text}finally{if(timer)clearTimeout(timer)}}var psSnapshot=async(anchors)=>{if(process.platform!=="win32")return psSnapshotWith(bunPsSpawn);let{defaultWinProcessProbe,winProcessSnapshot}=await import("./chunk-14f459aa.js");return winProcessSnapshot(anchors??[],defaultWinProcessProbe())};async function foregroundEngine(rootPid,snapshot=psSnapshot){try{return foregroundEngineIn(parsePsSnapshot(await snapshot([rootPid])),rootPid)}catch{return null}}
|
|
4
4
|
export{vendorFromArgv,parsePsSnapshot,hasAncestor,foregroundEngineIn,engineProcessIn,PS_PROBE_TIMEOUT_MS,psSnapshotWith,psSnapshot,foregroundEngine};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{generateCompletions,isShellKind,mergeSubVerbs,shippedCompletionsPath}from"./chunk-
|
|
2
|
+
import{generateCompletions,isShellKind,mergeSubVerbs,shippedCompletionsPath}from"./chunk-eege1x0a.js";import"./chunk-qqr4tfhk.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{existsSync,readFileSync}from"fs";var HELP_WORDS=["--help","-h","help"];function completionUsage(cliName){return[`Usage: ${cliName} completions <bash|zsh|fish> [--path|--install]`,"",`Print a shell completion script for ${cliName}, or locate the copy shipped`,"with this install.","",` ${cliName} completions zsh --path print the shipped script's path`,` ${cliName} completions zsh --install hook it into your shell config`,"","Install:",` zsh source <(${cliName} completions zsh) # one-off, or in ~/.zshrc after compinit`," # with no process start per shell \u2014 what the first-run wizard writes:",` # ${cliName} completions zsh --install`,` bash ${cliName} completions bash --install # appends to ~/.bashrc`,` fish ${cliName} completions fish --install # writes ~/.config/fish/completions/${cliName}.fish`," # the manual way, any shell:",` # ${cliName} completions zsh > ~/.zsh/completions/_${cliName}`," # fpath=(~/.zsh/completions $fpath) # in ~/.zshrc, BEFORE compinit"," # rm -f ~/.zcompdump && exec zsh # rebuild the completion cache",""].join(`
|
|
3
3
|
`)}async function runCompletionsSubcommand(rest,cliName=ROVE_PRODUCT_NAME,deps={}){let usage=completionUsage(cliName),fail=(message)=>{process.stderr.write(`${cliName} completions: ${message}
|
|
4
4
|
|
|
5
5
|
${usage}`),process.exit(2)};if(rest.some((arg)=>HELP_WORDS.includes(arg))){process.stdout.write(usage);return}let flags=rest.filter((arg)=>arg.startsWith("-")),shells=rest.filter((arg)=>!arg.startsWith("-")),unknownFlag=flags.find((flag)=>flag!=="--path"&&flag!=="--install");if(unknownFlag)fail(`unknown option "${unknownFlag}"`);if(new Set(flags).size>1)fail("--path and --install are different things; pass one");let shell=shells.length===1?shells[0]:void 0;if(!isShellKind(shell))fail(`unknown shell "${shells.join(" ")}"`);let scriptPath=shippedCompletionsPath(shell,cliName,deps.shippedDir),shipped=existsSync(scriptPath)?scriptPath:null;if(flags[0]==="--path"){if(!shipped)fail(`no pre-generated ${shell} script at ${scriptPath}
|
|
6
6
|
${cliName} completions ${shell} # print the script to stdout instead`);process.stdout.write(`${shipped}
|
|
7
|
-
`);return}if(flags[0]==="--install"){let[{installCompletions,settleWelcomeInstall},{t}]=await Promise.all([import("./chunk-
|
|
8
|
-
`);return}if(shipped){process.stdout.write(readFileSync(shipped,"utf8"));return}let{API_VERBS}=await import("./chunk-
|
|
7
|
+
`);return}if(flags[0]==="--install"){let[{installCompletions,settleWelcomeInstall},{t}]=await Promise.all([import("./chunk-zrf93zrx.js"),import("./chunk-z3qz6enf.js")]),completion=installCompletions(shell,deps.home,cliName,shipped);settleWelcomeInstall("completions",shell);let line=completion.installed?"onboarding.appliedCompletions":"onboarding.keptCompletions";process.stdout.write(`${t(line,{path:completion.path})}
|
|
8
|
+
`);return}if(shipped){process.stdout.write(readFileSync(shipped,"utf8"));return}let{API_VERBS}=await import("./chunk-9x2xd1rz.js");process.stdout.write(generateCompletions(shell,cliName,mergeSubVerbs(API_VERBS)))}export{runCompletionsSubcommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{PreambleStripper}from"./chunk-sq6zj3fb.js";import{shQuote}from"./chunk-y1xnjx8x.js";import{loadStateFile,updateStateFile}from"./chunk-32j6y5d1.js";import{
|
|
2
|
+
import{PreambleStripper}from"./chunk-sq6zj3fb.js";import{shQuote}from"./chunk-y1xnjx8x.js";import{loadStateFile,updateStateFile}from"./chunk-32j6y5d1.js";import{RoveDaemonClient}from"./chunk-qzzmd63x.js";import{homeDir}from"./chunk-z1nj22va.js";import{logClientError}from"./chunk-0g4wc808.js";import{shortHomeTag}from"./chunk-eqdbfgq5.js";import{PRE_RENAME_VERSION_KEY}from"./chunk-f8gg8cqh.js";import{spawn as spawn3}from"child_process";import{mkdirSync as mkdirSync3,rmSync as rmSync2}from"fs";import{connect as netConnect}from"net";import{tmpdir}from"os";import{join}from"path";var LOCAL_MACHINE_ID="local",ALIAS_RE=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function isValidMachineAlias(alias){return alias!==LOCAL_MACHINE_ID&&alias.length<=64&&ALIAS_RE.test(alias)}function parseSshTarget(target){let trimmed=target.trim();if(!trimmed)return null;let at=trimmed.lastIndexOf("@"),user=at>=0?trimmed.slice(0,at):void 0,rest=at>=0?trimmed.slice(at+1):trimmed;if(at>=0&&!user)return null;let bracketed=/^\[([^\]]+)\](?::(\d{1,5}))?$/.exec(rest),portMatch=bracketed?null:/^([^:]*):(\d{1,5})$/.exec(rest),host=bracketed?bracketed[1]??"":portMatch?portMatch[1]??"":rest,rawPort=bracketed?bracketed[2]:portMatch?.[2],port=rawPort?Number(rawPort):void 0;if(!host||/\s/.test(host))return null;if(port!==void 0&&(port<1||port>65535))return null;return{host,...user?{user}:{},...port?{port}:{}}}function defaultMachineAlias(args){let source=!args.typedUser&&args.port===void 0&&!isIpLiteral(args.typedHost)?args.typedHost:args.remoteHostname||args.typedHost;return sanitizeAlias(source)}function isIpLiteral(host){return host.includes(":")||/^\d{1,3}(\.\d{1,3}){3}$/.test(host)}function sanitizeAlias(raw){return(raw.split(".")[0]??raw).replace(/[^A-Za-z0-9._-]/g,"-").slice(0,64)}function sshTargetOf(config){return config.user?`${config.user}@${config.host}`:config.host}function readMachines(state){let raw=state.machines;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function listMachines(){let machines=readMachines(loadStateFile());return Object.entries(machines).map(([alias,config])=>({alias,...config}))}function getMachine(alias){return readMachines(loadStateFile())[alias]??null}function addMachine(alias,config){let added=!1;return updateStateFile((state)=>{let machines={...readMachines(state)};added=machines[alias]===void 0,machines[alias]={...config,addedAt:config.addedAt??machines[alias]?.addedAt??new Date().toISOString()},state.machines=machines;return}),{added}}function updateMachine(alias,patch){updateStateFile((state)=>{let machines={...readMachines(state)},existing=machines[alias];if(!existing)return!1;machines[alias]={...existing,...patch},state.machines=machines;return})}function setMachineIdentity(alias,identity){updateMachine(alias,{identity})}function removeMachine(alias){let removed=!1;return updateStateFile((state)=>{let machines={...readMachines(state)};if(removed=machines[alias]!==void 0,!removed)return!1;delete machines[alias],state.machines=machines;return}),removed}function dedupeMachines(entries){let kept=[],seen=[];for(let entry of entries){let identity=entry.identity;if(identity){if(seen.some((other)=>sameMachine(other,identity)))continue;seen.push(identity)}kept.push(entry)}return kept}function sameMachine(a,b){return a.hostname===b.hostname&&a.homeDir===b.homeDir&&a.daemonPid===b.daemonPid}function duplicateAliasOf(machines,self,identity){for(let[alias,config]of Object.entries(machines)){if(alias===self)continue;let other=config.identity;if(!other)continue;if(other.hostname===identity.hostname&&other.homeDir===identity.homeDir&&other.daemonPid===identity.daemonPid)return alias}return null}var CONTROL_PERSIST_SECONDS=300;function machineSocketDir(alias,home=homeDir()){let natural=join(home,".rove","machines",alias);if(Buffer.byteLength(join(natural,"daemon.sock"),"utf8")<=SOCKET_PATH_LIMIT)return natural;return join(tmpdir(),`rove-m-${shortHomeTag(home)}-${shortHomeTag(alias)}`)}var SOCKET_PATH_LIMIT=100;function localDaemonSocketPath(alias,home=homeDir()){return join(machineSocketDir(alias,home),"daemon.sock")}function localPtySocketPath(alias,home=homeDir()){return join(machineSocketDir(alias,home),"pty.sock")}function controlPath(alias,home=homeDir()){return join(machineSocketDir(alias,home),"cm")}function machineSshArgs(alias,config,opts={}){let argv=["ssh"];if(opts.batch!==!1)argv.push("-o","BatchMode=yes");if(opts.mux!==!1&&process.platform!=="win32")argv.push("-o","ControlMaster=auto","-o",`ControlPath=${controlPath(alias,opts.home)}`,"-o",`ControlPersist=${CONTROL_PERSIST_SECONDS}`);if(argv.push("-o","StrictHostKeyChecking=accept-new"),config.port)argv.push("-p",String(config.port));if(config.auth.kind==="key"&&config.auth.keyPath)argv.push("-i",config.auth.keyPath);return argv.push(sshTargetOf(config)),argv}import{spawn as spawn2}from"child_process";import{mkdirSync as mkdirSync2,rmSync}from"fs";import{createServer}from"net";import{spawn}from"child_process";import{mkdirSync}from"fs";import{posix}from"path";function isWindowsPath(path){return/^[A-Za-z]:[\\/]/.test(path)||/^\\\\[.?]\\/.test(path)}function isWindowsMachine(config){if(config.sockets&&(isWindowsPath(config.sockets.daemon)||isWindowsPath(config.sockets.pty)))return!0;return config.roveBin!==void 0&&isWindowsPath(config.roveBin)}function psQuote(value){return`'${value.replaceAll("'","''")}'`}function powershellCommand(script){return`powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand ${Buffer.from(script,"utf16le").toString("base64")}`}function windowsRoveCommand(roveBin,args){return powershellCommand(`& ${psQuote(roveBin)} ${args.map(psQuote).join(" ")}; exit $LASTEXITCODE`)}var WINDOWS_LOCATE_SCRIPT=['$dirs = @("$env:APPDATA\\npm", "$env:USERPROFILE\\.bun\\bin", "$env:LOCALAPPDATA\\pnpm", $env:NVM_SYMLINK)',"$dirs += [Environment]::GetEnvironmentVariable('Path', 'User') -split ';'","foreach ($d in $dirs) { if (-not $d) { continue }",` foreach ($n in 'rove.cmd', 'rove.exe') { $p = Join-Path $d $n; if (Test-Path -LiteralPath $p) { "ROVE_BIN=$p"; exit 0 } } }`,"exit 1"].join(`
|
|
3
3
|
`),WINDOWS_LOCATE_ROVE=powershellCommand(WINDOWS_LOCATE_SCRIPT),WINDOWS_ROVE_MISSING=/'(?:[^'\r\n]*[\\/])?rove(?:\.cmd|\.exe|\.ps1)?' is not recognized as (?:an internal or external command|(?:the|a) name of a cmdlet)/i,WINDOWS_SCRIPTS_DISABLED=/rove\.ps1 cannot be loaded because running scripts is disabled/i;function windowsNoRoveMessage(alias,output){if(WINDOWS_SCRIPTS_DISABLED.test(output))return[`${alias}'s ssh sessions run Windows PowerShell, whose execution policy refuses npm's rove.ps1, and no rove.cmd was found to use instead.`,`On ${alias}, either allow scripts for your user: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`,'or make ssh use PowerShell 7 (elevated): New-ItemProperty -Path HKLM:\\SOFTWARE\\OpenSSH -Name DefaultShell -Value "$env:ProgramFiles\\PowerShell\\7\\pwsh.exe" -PropertyType String -Force'].join(`
|
|
4
4
|
`);return[`Rove is not on the PATH of ssh sessions on ${alias} (Windows), nor in %APPDATA%\\npm, ~\\.bun\\bin or the user PATH.`,"Install it there in a PowerShell: npm install -g @sma1lboy/rove",`If it is installed elsewhere, add that folder to your user PATH on ${alias}, then restart sshd (elevated: Restart-Service sshd) so new sessions see it.`].join(`
|
|
5
5
|
`)}var WINDOWS_SSHD_BANNER=/remote software version OpenSSH_for_Windows/i,WINDOWS_SSHD_STEPS=["Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0","Set-Service sshd -StartupType Automatic; Start-Service sshd","if (-not (Get-NetFirewallRule -Name OpenSSH-Server-In-TCP -ErrorAction SilentlyContinue)) { New-NetFirewallRule -Name OpenSSH-Server-In-TCP -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 }"];function windowsAuthorizeKeySteps(publicKey){let key=psQuote(publicKey.trim());return["# Administrator account (elevated PowerShell):",`Add-Content -Path "$env:ProgramData\\ssh\\administrators_authorized_keys" -Value ${key}`,'icacls.exe "$env:ProgramData\\ssh\\administrators_authorized_keys" /inheritance:r /grant "*S-1-5-32-544:F" /grant "SYSTEM:F"',"# Standard account (normal PowerShell):",`New-Item -ItemType Directory -Force "$HOME\\.ssh" | Out-Null; Add-Content -Path "$HOME\\.ssh\\authorized_keys" -Value ${key}`]}var PATTERNS=[["host-key-changed",/REMOTE HOST IDENTIFICATION HAS CHANGED|Host key for .* has changed/i],["host-key-unverified",/Host key verification failed|No .*host key is known for/i],["auth-denied",/Permission denied \(|Too many authentication failures|no matching host key type/i],["unresolved",/Could not resolve hostname|Name or service not known|nodename nor servname/i],["refused",/Connection refused/i],["timeout",/timed out|Operation timed out|No route to host|Network is unreachable/i]];function classifySshFailure(stderr){for(let[kind,pattern]of PATTERNS)if(pattern.test(stderr))return kind;return"unknown"}function sshFailureRemedy(kind,target,windows=!1){if(windows&&(kind==="refused"||kind==="timeout"))return[`${target} (Windows) ${kind==="refused"?"refused the connection: its OpenSSH Server is not running":"did not answer on the ssh port: its OpenSSH Server is off, or the firewall drops it"}.`,"In an elevated PowerShell there:",...WINDOWS_SSHD_STEPS.map((step)=>` ${step}`)].join(`
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{DEFAULT_TERMINAL_COLORS,KittyTransmits,freshModeTrack,normalizeTerminalModes,replayStart,scanTerminalModes}from"./chunk-mqfvzdpr.js";import{OWNER_ONLY_DIR_MODE,OWNER_ONLY_FILE_MODE,tightenDirPermissionsSync,tightenFilePermissionsSync}from"./chunk-yt15y085.js";import{defaultPtyFreezeDir}from"./chunk-eqdbfgq5.js";import{randomUUID}from"crypto";import{mkdirSync,readFileSync,readdirSync,renameSync,rmSync,statSync,writeFileSync}from"fs";import{join}from"path";import{StringDecoder}from"string_decoder";var FREEZE_VERSION=1;function freezeSession(session,now=new Date){let ring=Buffer.concat(session.chunks);return{v:FREEZE_VERSION,key:session.key,cwd:session.cwd,command:[...session.command],cols:session.cols,rows:session.rows,title:session.title,totalBytes:session.totalBytes,exit:session.exit,ringB64:ring.subarray(session.ringModes?replayStart(session.ringModes,ring):0).toString("base64"),...session.ringModes?{ringModes:session.ringModes.modes}:{},updatedAt:now.toISOString()}}function thawRing(record,cap){let ring;try{ring=Buffer.from(record.ringB64,"base64")}catch{return null}let cut=Math.max(0,ring.byteLength-cap),trimmed=ring.subarray(cut),ringModes=freshModeTrack(normalizeTerminalModes(record.ringModes));if(cut>0)scanTerminalModes(ringModes,ring.subarray(0,cut).toString("latin1"));return{chunks:trimmed.byteLength>0?[trimmed]:[],bytes:trimmed.byteLength,ringModes}}function thawSession(record,cap){let ring=thawRing(record,cap);if(!ring)return null;let modes=freshModeTrack({...ring.ringModes.modes});for(let chunk of ring.chunks)scanTerminalModes(modes,chunk.toString("latin1"));return{key:record.key,generation:randomUUID(),cwd:record.cwd,proc:null,alive:!1,chunks:[...ring.chunks],bytes:ring.bytes,totalBytes:Math.max(record.totalBytes,ring.bytes),cols:record.cols,rows:record.rows,command:record.command,title:record.title,titleCarry:"",titleDecoder:new StringDecoder("utf8"),colorQueryCarry:"",defaultColors:DEFAULT_TERMINAL_COLORS,modes,ringModes:ring.ringModes,kitty:new KittyTransmits,sinks:new Map,emulatorSinks:new Set,parked:!1,parkedScreenBytes:0,exit:record.exit,restored:record.exit===null,lastFreezeAtMs:0}}function recordFile(dir,key){return join(dir,`${encodeURIComponent(key)}.json`)}function parseRecord(raw){try{let parsed=JSON.parse(raw);if(parsed?.v!==FREEZE_VERSION)return null;if(typeof parsed.key!=="string"||parsed.key.length===0)return null;if(parsed.key.startsWith("::"))return null;if(typeof parsed.cwd!=="string"||!Array.isArray(parsed.command))return null;if(typeof parsed.ringB64!=="string"||typeof parsed.totalBytes!=="number")return null;return parsed}catch{return null}}var FREEZE_TTL_MS=1209600000,FREEZE_RESTORE_MAX_BYTES=67108864;function updatedAtMs(record){let t=Date.parse(record.updatedAt);return Number.isFinite(t)?t:0}function loadFrozenSessions(dir=defaultPtyFreezeDir(),now=Date.now(),report){let names;try{names=readdirSync(dir)}catch{return[]}let entries=[];for(let name of names){if(!name.endsWith(".json"))continue;try{let st=statSync(join(dir,name));entries.push({name,size:st.size,mtimeMs:st.mtimeMs})}catch{}}entries.sort((a,b)=>b.mtimeMs-a.mtimeMs);let kept=[],stale=[],bytesRead=0,deferred=0,unreadable=0;for(let entry of entries){if(now-entry.mtimeMs>FREEZE_TTL_MS){stale.push(entry.name);continue}if(bytesRead+entry.size>FREEZE_RESTORE_MAX_BYTES&&kept.length>0){deferred++;continue}let record=null;try{record=parseRecord(readFileSync(join(dir,entry.name),"utf8"))}catch{}if(bytesRead+=entry.size,!record){unreadable++;continue}if(now-updatedAtMs(record)>FREEZE_TTL_MS)stale.push(entry.name);else kept.push(record)}for(let name of stale)try{rmSync(join(dir,name),{force:!0})}catch{}return kept.sort((a,b)=>updatedAtMs(b)-updatedAtMs(a)),report?.({restored:kept.length,bytesRead,deferred,expired:stale.length,unreadable}),kept}function tightenExistingPermissions(dir){tightenDirPermissionsSync(dir);let names;try{names=readdirSync(dir)}catch{return}for(let name of names)if(name.endsWith(".json"))tightenFilePermissionsSync(join(dir,name))}function fileFreezeSink(dir=defaultPtyFreezeDir()){return tightenExistingPermissions(dir),{save(record){try{mkdirSync(dir,{recursive:!0,mode:OWNER_ONLY_DIR_MODE});let target=recordFile(dir,record.key),staging=`${target}.${process.pid}.tmp`;writeFileSync(staging,JSON.stringify(record),{encoding:"utf8",mode:OWNER_ONLY_FILE_MODE}),renameSync(staging,target)}catch{}},drop(key){try{rmSync(recordFile(dir,key),{force:!0})}catch{}}}}function clearFrozenSessions(dir=defaultPtyFreezeDir()){try{rmSync(dir,{recursive:!0,force:!0})}catch{}}
|
|
3
|
+
export{freezeSession,thawSession,FREEZE_TTL_MS,FREEZE_RESTORE_MAX_BYTES,loadFrozenSessions,fileFreezeSink,clearFrozenSessions};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{binaryAvailable,resolveEditorCommand}from"./chunk-
|
|
2
|
+
import{binaryAvailable,resolveEditorCommand}from"./chunk-agvtzads.js";import"./chunk-rfp0ayra.js";import"./chunk-40dgv828.js";import"./chunk-6xppe9bj.js";import"./chunk-7mwvvj46.js";import"./chunk-32j6y5d1.js";import"./chunk-7kysxgbq.js";import"./chunk-bejhca6z.js";import"./chunk-br8r72bf.js";import"./chunk-yt15y085.js";import{kvStatePath}from"./chunk-z1nj22va.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-pn5ygqn6.js";import"./chunk-eqdbfgq5.js";import"./chunk-f8gg8cqh.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";import{existsSync,mkdirSync,writeFileSync}from"fs";import{dirname}from"path";var CLI_NAME=ROVE_PRODUCT_NAME;function printUsage(out){out.write([`Usage: ${CLI_NAME} config [--path]`,"","Open Rove's user config (state.json \u2014 theme, locale, engine + editor prefs)","in your editor. The editor is your configured one (Settings \u2192 General \u2192","Editor); left on Auto it is $VISUAL / $EDITOR, else the first of","nvim / vim / emacs / nano.","Rove re-reads the file on its next launch.","","Options:"," --path Print the config file path and exit (don't open an editor)"," -h, --help Print this help",""].join(`
|
|
3
3
|
`))}async function runConfigSubcommand(argv=[]){if(argv.some((a)=>a==="-h"||a==="--help"||a==="help")){printUsage(process.stdout);return}let path=kvStatePath();if(argv.some((a)=>a==="--path"||a==="path")){console.log(path);return}let unknown=argv.find((a)=>a.length>0);if(unknown!==void 0)process.stderr.write(`${CLI_NAME} config: unexpected argument "${unknown}"
|
|
4
4
|
`),printUsage(process.stderr),process.exit(2);if(!existsSync(path))mkdirSync(dirname(path),{recursive:!0}),writeFileSync(path,`{}
|
|
5
5
|
`);let resolved=await resolveEditorCommand(path);if(!resolved||!await binaryAvailable(resolved.bin))process.stderr.write(`${CLI_NAME} config: no editor found \u2014 set $EDITOR (or Settings \u2192 General \u2192 Editor), or edit directly:
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{userThemesDir,validateTheme}from"./chunk-kxp04jnp.js";import{existsSync,mkdirSync,writeFileSync}from"fs";import{join}from"path";var HOSTED_THEMES=["catppuccin","dracula","everforest","gruvbox","kanagawa","nord","opencode","osaka-jade","rose-pine","solarized"],hostedThemeUrl=(name)=>`https://rove.run/themes/${name}.json`;class ThemeInstallError extends Error{}function parseTheme(text){let parsed;try{parsed=JSON.parse(text)}catch(err){throw new ThemeInstallError(`source is not valid JSON: ${err instanceof Error?err.message:String(err)}`)}let result=validateTheme(parsed);if(!result.ok)throw new ThemeInstallError(`source is not a valid Rove theme: ${result.reason}`);return result.theme}function isThemeName(name){return!!name&&/^[a-zA-Z0-9._-]+$/.test(name)&&name!=="."&&name!==".."}function writeUserTheme(name,theme,force){if(!isThemeName(name))throw new ThemeInstallError(`invalid theme name "${name}" (use letters, digits, '.', '_', '-')`);let dir=userThemesDir();mkdirSync(dir,{recursive:!0});let dest=join(dir,`${name}.json`);if(existsSync(dest)&&!force)throw new ThemeInstallError(`${dest} already exists (pass --force to overwrite)`);return writeFileSync(dest,`${JSON.stringify(theme,null,2)}
|
|
3
|
+
`,"utf8"),dest}
|
|
4
|
+
export{HOSTED_THEMES,hostedThemeUrl,ThemeInstallError,parseTheme,isThemeName,writeUserTheme};
|