@sma1lboy/rove 0.9.310-next.558 → 0.9.310-next.560
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-03ab55aq.js +15 -0
- package/dist/cli/{chunk-r2m77efz.js → chunk-0kagh193.js} +1 -1
- package/dist/cli/{chunk-zthgakmg.js → chunk-2bawvmhn.js} +1 -1
- package/dist/cli/chunk-2caxfsms.js +4 -0
- package/dist/cli/chunk-2exdah0a.js +2 -0
- package/dist/cli/{chunk-kfd6max1.js → chunk-2kyrfec1.js} +2 -2
- package/dist/cli/{chunk-wsdga2ed.js → chunk-2tjf67y8.js} +1 -1
- package/dist/cli/{chunk-2cf5enj3.js → chunk-31abr2dy.js} +1 -1
- package/dist/cli/{chunk-ke3zvrb8.js → chunk-31ynx34z.js} +5 -3
- package/dist/cli/chunk-34kma0kp.js +3 -0
- package/dist/cli/{chunk-38yze0db.js → chunk-38zkja6q.js} +2 -2
- package/dist/cli/{chunk-qap4h9pe.js → chunk-3b12c4he.js} +1 -1
- package/dist/cli/{chunk-rset5pt8.js → chunk-3p2mr8yr.js} +1 -1
- package/dist/cli/{chunk-bq6p5ayv.js → chunk-3xexp8dz.js} +1 -1
- package/dist/cli/{chunk-6yekgkc3.js → chunk-41anthd5.js} +1 -1
- package/dist/cli/chunk-4yaeg6q8.js +2 -0
- package/dist/cli/{chunk-711051fs.js → chunk-4z13y4yc.js} +1 -1
- package/dist/cli/{chunk-5hb94sx0.js → chunk-50nanwf1.js} +1 -1
- package/dist/cli/{chunk-bgwj8vqr.js → chunk-51677nbx.js} +1 -1
- package/dist/cli/chunk-527kk5yh.js +3 -0
- package/dist/cli/{chunk-461q0qdc.js → chunk-59tqftdq.js} +3 -3
- package/dist/cli/chunk-5p538n7s.js +3 -0
- package/dist/cli/{chunk-a7cyf3zh.js → chunk-5rsp8ncr.js} +1 -1
- package/dist/cli/{chunk-3gqaqbbv.js → chunk-5tr6zt00.js} +1 -1
- package/dist/cli/chunk-5x9zmxbm.js +3 -0
- package/dist/cli/{chunk-j39xe004.js → chunk-5y0wzt07.js} +1 -1
- package/dist/cli/chunk-5z8v6pak.js +5 -0
- package/dist/cli/chunk-6hjt5an9.js +3 -0
- package/dist/cli/chunk-7f49kec6.js +3 -0
- package/dist/cli/{chunk-d1akz0tt.js → chunk-7kb0trqk.js} +1 -1
- package/dist/cli/chunk-7y050wdc.js +2 -0
- package/dist/cli/{chunk-dg0afakq.js → chunk-89r25pb4.js} +1 -1
- package/dist/cli/chunk-8este27x.js +2 -0
- package/dist/cli/{chunk-xke354x5.js → chunk-8hpzvppg.js} +1 -1
- package/dist/cli/chunk-97whk87t.js +2 -0
- package/dist/cli/{chunk-8fq8gjd1.js → chunk-9jd38qp2.js} +1 -1
- package/dist/cli/{chunk-tbd8xqzb.js → chunk-9q7a5w4f.js} +1 -1
- package/dist/cli/{chunk-xebwdapc.js → chunk-ag4bgs6x.js} +1 -1
- package/dist/cli/chunk-amw651y8.js +2 -0
- package/dist/cli/chunk-aw6419ts.js +2 -0
- package/dist/cli/chunk-b5w8skr6.js +2 -0
- package/dist/cli/{chunk-cpfbps4j.js → chunk-ber44awg.js} +2 -2
- package/dist/cli/{chunk-zr135c6p.js → chunk-bf0yk9zc.js} +1 -1
- package/dist/cli/{chunk-9b45n3b9.js → chunk-c3pxrd75.js} +1 -1
- package/dist/cli/chunk-c9jdd0bp.js +2 -0
- package/dist/cli/{chunk-x6b8j5bq.js → chunk-d05jzr3s.js} +1 -1
- package/dist/cli/{chunk-gj5yffm3.js → chunk-dmwb1h6v.js} +1 -1
- package/dist/cli/chunk-e221zk36.js +2 -0
- package/dist/cli/{chunk-3rgmqqtf.js → chunk-e5fj338p.js} +1 -1
- package/dist/cli/{chunk-rpwem1en.js → chunk-e9fkdd77.js} +1 -1
- package/dist/cli/chunk-eag2w0yg.js +44 -0
- package/dist/cli/{chunk-x5yhgnpa.js → chunk-eg3xtzex.js} +1 -1
- package/dist/cli/{chunk-z4ykpfrt.js → chunk-en416dy8.js} +2 -2
- package/dist/cli/{chunk-4smddj8r.js → chunk-ez21t2kp.js} +1 -1
- package/dist/cli/chunk-f60hmm20.js +2 -0
- package/dist/cli/{chunk-gx725v3p.js → chunk-fkpszxch.js} +1 -1
- package/dist/cli/chunk-fryx0yt6.js +2 -0
- package/dist/cli/chunk-fxjkrbj7.js +4 -0
- package/dist/cli/chunk-g9q2rv2t.js +2 -0
- package/dist/cli/chunk-gq8fe1hp.js +2 -0
- package/dist/cli/{chunk-hv2w6ffn.js → chunk-gvq4xasp.js} +1 -1
- package/dist/cli/{chunk-dqwcj1wq.js → chunk-gz1z4yr8.js} +1 -1
- package/dist/cli/{chunk-dg12bky3.js → chunk-h24edpme.js} +1 -1
- package/dist/cli/chunk-hf0k6br2.js +2 -0
- package/dist/cli/chunk-hpay0ax8.js +3 -0
- package/dist/cli/chunk-j0pmn619.js +2 -0
- package/dist/cli/{chunk-g2ne6kve.js → chunk-j4p2728p.js} +1 -1
- package/dist/cli/{chunk-qjxbzxs6.js → chunk-jdt6xbtg.js} +1 -1
- package/dist/cli/{chunk-ssev7ack.js → chunk-jjsvryzx.js} +1 -1
- package/dist/cli/{chunk-p4zwqgcr.js → chunk-jz47rwj0.js} +1 -1
- package/dist/cli/chunk-k8eq4273.js +34 -0
- package/dist/cli/{chunk-y17g6db2.js → chunk-ked6dhpr.js} +2 -2
- package/dist/cli/{chunk-2c6t18vh.js → chunk-kgyj8fn2.js} +5 -5
- package/dist/cli/{chunk-3gjvrcxc.js → chunk-kjhgzzvy.js} +1 -1
- package/dist/cli/chunk-krqxpxn3.js +2 -0
- package/dist/cli/{chunk-yd9q7dx3.js → chunk-kwvk1e7k.js} +1 -1
- package/dist/cli/chunk-kxtv8618.js +2 -0
- package/dist/cli/{chunk-zk07zgek.js → chunk-ky2evy5s.js} +3 -3
- package/dist/cli/{chunk-67p3ea91.js → chunk-mmc7j6va.js} +1 -1
- package/dist/cli/chunk-mytwyyej.js +2 -0
- package/dist/cli/{chunk-1yfcjra2.js → chunk-n70a0qaq.js} +1 -1
- package/dist/cli/chunk-ngae3bw0.js +2 -0
- package/dist/cli/chunk-nr7c9q0j.js +4 -0
- package/dist/cli/chunk-nsdr8ax7.js +2 -0
- package/dist/cli/{chunk-3sv3sg9n.js → chunk-p1j3t3r9.js} +1 -1
- package/dist/cli/{chunk-rnkktk4j.js → chunk-p2y9kkr4.js} +1 -1
- package/dist/cli/chunk-p6gdash6.js +2 -0
- package/dist/cli/{chunk-pama8vzq.js → chunk-pbfkv47b.js} +1 -1
- package/dist/cli/chunk-pcp1q3fc.js +3 -0
- package/dist/cli/{chunk-c47pwqx8.js → chunk-pdqcahqx.js} +1 -1
- package/dist/cli/{chunk-2qvavavx.js → chunk-pwazhwkg.js} +1 -1
- package/dist/cli/chunk-qap2p0jp.js +2 -0
- package/dist/cli/chunk-qtw5157e.js +2 -0
- package/dist/cli/{chunk-972d8ery.js → chunk-qxpg6zba.js} +1 -1
- package/dist/cli/{chunk-bnxgtfbm.js → chunk-r2by8qeq.js} +1 -1
- package/dist/cli/chunk-r4vwq5wv.js +13 -0
- package/dist/cli/{chunk-je7egpqh.js → chunk-rh5024pb.js} +2 -2
- package/dist/cli/{chunk-2c0qv2gs.js → chunk-ryfvgfan.js} +1 -1
- package/dist/cli/{chunk-4nehczca.js → chunk-rzt1yax7.js} +1 -1
- package/dist/cli/chunk-sckqk79z.js +3 -0
- package/dist/cli/{chunk-ygrben5f.js → chunk-sh9mav58.js} +1 -1
- package/dist/cli/chunk-sssebf3y.js +4 -0
- package/dist/cli/{chunk-j2jvxkqe.js → chunk-sxev8fyk.js} +1 -1
- package/dist/cli/{chunk-zwbz437x.js → chunk-tvfsjjdh.js} +1 -1
- package/dist/cli/{chunk-9pw8ed6s.js → chunk-v4d7n06y.js} +1 -1
- package/dist/cli/chunk-v8ms64g1.js +3 -0
- package/dist/cli/{chunk-wadzmj1f.js → chunk-vkbk3j8c.js} +1 -1
- package/dist/cli/{chunk-3v36xe5a.js → chunk-vpk5m2z6.js} +1 -1
- package/dist/cli/{chunk-ndhvd2zs.js → chunk-x4rq6ded.js} +2 -2
- package/dist/cli/{chunk-t29tqvxa.js → chunk-xj2vt2ks.js} +2 -2
- package/dist/cli/{chunk-j0r86veb.js → chunk-xsgx2sze.js} +1 -1
- package/dist/cli/{chunk-1s06xmrt.js → chunk-ydn9jss2.js} +5 -5
- package/dist/cli/{chunk-wnx4c73z.js → chunk-yprn97vs.js} +1 -1
- package/dist/cli/{chunk-nnzfnf9k.js → chunk-z8vhrcnc.js} +1 -1
- package/dist/cli/chunk-zf3bwvmw.js +6 -0
- package/dist/cli/{chunk-zb035vzm.js → chunk-zgfh6zya.js} +1 -1
- package/dist/cli/chunk-zrakbt5x.js +2 -0
- package/dist/cli/{chunk-z4cyqjhb.js → chunk-zs8f9p7d.js} +1 -1
- package/dist/cli/{chunk-vj57076h.js → chunk-zz3zgg43.js} +1 -1
- package/dist/cli/index.js +3 -3
- package/dist/cli/rove.js +1 -1
- package/package.json +1 -1
- package/dist/cli/chunk-0ntq7yac.js +0 -2
- package/dist/cli/chunk-0x62tvdk.js +0 -4
- package/dist/cli/chunk-1aqemtbb.js +0 -3
- package/dist/cli/chunk-2askeete.js +0 -2
- package/dist/cli/chunk-2dxwf8vs.js +0 -2
- package/dist/cli/chunk-2rbvz83d.js +0 -2
- package/dist/cli/chunk-31hmen5m.js +0 -2
- package/dist/cli/chunk-3k17qm0h.js +0 -2
- package/dist/cli/chunk-3qd83ac4.js +0 -2
- package/dist/cli/chunk-64554ad7.js +0 -13
- package/dist/cli/chunk-801hj7ap.js +0 -16
- package/dist/cli/chunk-8a6j4mfx.js +0 -3
- package/dist/cli/chunk-8bh475jg.js +0 -2
- package/dist/cli/chunk-aecrterr.js +0 -2
- package/dist/cli/chunk-c19dfkxn.js +0 -2
- package/dist/cli/chunk-c377x1r2.js +0 -2
- package/dist/cli/chunk-dbn6bz7r.js +0 -34
- package/dist/cli/chunk-ezy8m6kt.js +0 -2
- package/dist/cli/chunk-fhg165dk.js +0 -2
- package/dist/cli/chunk-fkmz1hqe.js +0 -2
- package/dist/cli/chunk-fr9cdq58.js +0 -2
- package/dist/cli/chunk-ft0ba261.js +0 -32
- package/dist/cli/chunk-g3q0dd8w.js +0 -2
- package/dist/cli/chunk-g9ba25q5.js +0 -3
- package/dist/cli/chunk-j1a5d7vz.js +0 -4
- package/dist/cli/chunk-jefa0byp.js +0 -2
- package/dist/cli/chunk-jz1kj4sf.js +0 -3
- package/dist/cli/chunk-m7kvx0k7.js +0 -3
- package/dist/cli/chunk-mgze5g1m.js +0 -3
- package/dist/cli/chunk-mvfg1593.js +0 -2
- package/dist/cli/chunk-ntat6w3n.js +0 -2
- package/dist/cli/chunk-qhgv2hfv.js +0 -2
- package/dist/cli/chunk-s3aym45q.js +0 -2
- package/dist/cli/chunk-sd3jb2an.js +0 -2
- package/dist/cli/chunk-ssbw7gdp.js +0 -2
- package/dist/cli/chunk-sz149hr2.js +0 -6
- package/dist/cli/chunk-t1wfxygz.js +0 -15
- package/dist/cli/chunk-wr56z74q.js +0 -5
- package/dist/cli/chunk-xy849by1.js +0 -6
- package/dist/cli/chunk-ze0kst12.js +0 -2
- /package/dist/cli/{chunk-axc94xxn.js → chunk-78y80xe8.js} +0 -0
- /package/dist/cli/{chunk-j2k6f128.js → chunk-sns4xm7n.js} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{runAsync}from"./chunk-ve196r2v.js";import{REMOTE_WORKSPACE_FILE}from"./chunk-nr7c9q0j.js";import{SSH_SHELL_IS_CMD,SSH_SHELL_PROBE,isWindowsPath,windowsRshScript,windowsRxScript}from"./chunk-r478tzjz.js";import{quoteShellArg,quoteShellArgv}from"./chunk-ptyqj15s.js";import{pathWithin}from"./chunk-pn5ygqn6.js";import{homeDir}from"./chunk-pzbcbmm4.js";import{createHash}from"crypto";import{chmodSync,existsSync,mkdirSync,readFileSync,renameSync,rmSync,rmdirSync,writeFileSync}from"fs";import{basename,dirname,join}from"path";function remoteWorkspacesRoot(home=homeDir()){return join(home,".rove","remote-workspaces")}function remotePathKey(path){return(isWindowsPath(path)?path.replaceAll("\\","/").toLowerCase():path).replace(/(?<=.)\/+$/,"")}function remoteWorkspaceDir(machine,path,name,home=homeDir()){let id=createHash("sha256").update(`${machine}\x00${remotePathKey(path)}`).digest("hex").slice(0,12);return join(remoteWorkspacesRoot(home),id,machine,basename(name.replaceAll("\\","/"))||"workspace")}function readRemoteWorkspace(dir){try{let raw=JSON.parse(readFileSync(join(dir,REMOTE_WORKSPACE_FILE),"utf8"));if(typeof raw.machine!=="string"||typeof raw.taskId!=="string"||typeof raw.path!=="string")return null;return{machine:raw.machine,taskId:raw.taskId,path:raw.path,...typeof raw.branch==="string"?{branch:raw.branch}:{},...typeof raw.repoId==="string"?{repoId:raw.repoId}:{}}}catch{return null}}var isRemoteWorkspace=(dir)=>existsSync(join(dir,REMOTE_WORKSPACE_FILE)),remoteBinDir=(dir)=>join(dir,"bin"),rxPath=(dir)=>join(remoteBinDir(dir),"rx"),SED_QUOTE=`sed "s/'/'\\\\\\\\''/g"`;function rxScript(sshArgv,path){return["#!/bin/sh","# Rove: run one command in this task's workspace on another machine.",`dir=${quoteShellArg(path)}`,`d=$(printf '%s' "$dir" | ${SED_QUOTE})`,`c=$(printf '%s' "$1" | ${SED_QUOTE})`,`exec ${quoteShellArgv(sshArgv)} "cd '$d' && exec \\"\\\${SHELL:-sh}\\" -lc '$c'"`,""].join(`
|
|
3
|
+
`)}function rshScript(sshArgv,path){let[ssh="ssh",...rest]=sshArgv;return["#!/bin/sh","# Rove: open a shell in this task's workspace on another machine.",`dir=${quoteShellArg(path)}`,`d=$(printf '%s' "$dir" | ${SED_QUOTE})`,`exec ${quoteShellArgv([ssh,"-t",...rest])} "cd '$d' && exec \\"\\\${SHELL:-sh}\\" -l"`,""].join(`
|
|
4
|
+
`)}var rshPath=(dir)=>join(remoteBinDir(dir),"rsh");function remoteShellInput(dir){return existsSync(rshPath(dir))?` exec ${quoteShellArg(rshPath(dir))}\r`:""}function linkedWorktree(dir){let ws=dir?readRemoteWorkspace(dir):null;return ws?{machine:ws.machine,taskId:ws.taskId}:void 0}function remoteNotes(ws){return["# This project lives on another machine","",`The project is not in this directory. It is on ${`the machine "${ws.machine}"${ws.system?` (${ws.system})`:""}`}, at \`${ws.path}\`. This directory only links to it.`,"","- Run every command as `rx '<command>'`. It runs in the project root there and passes stdin, output and the exit code through: `rx 'git status'`, `rx 'cat > src/a.ts' <<'EOF'`.","- Each `rx` call starts in the project root; a `cd` does not carry over to the next call.","- Read, search and edit the project's files through commands there. File tools that work on local paths only see this directory.","- git, tests and builds all run there. Nothing of the project is on this machine.",...whereThingsRun(ws,"- Run `rove` without `rx`: Rove and your task are on this machine, so `rove api \u2026` reaches this Rove and takes this machine's paths."),""].join(`
|
|
5
|
+
`)}function whereThingsRun(ws,roveLine){let forwarded=ws.mcp??[];return["","## Which machine runs what","",roveLine,`- Your MCP tools${forwarded.length>0?" not listed below":""}, a browser among them, run on this machine, so \`localhost\` in them is this machine, not the project's.`,forwarded.length>0?`- These MCP servers are ${ws.machine}'s, forwarded here: ${forwarded.map((s)=>`\`${s}\``).join(", ")}. A page served on ${ws.machine} (a dev server you started there) opens in its browser at ${ws.machine}'s own \`localhost\` address; use them for that.`:`- A page served on ${ws.machine} is not at this machine's \`localhost\`. To open it in ${ws.machine}'s own browser, the owner can forward that machine's browser MCP server: \`rove machine mcp ${ws.machine} <name> <url>\`; it shows up in new sessions as \`<name>-${ws.machine}\`.`,`- Earlier sessions in this project that ran from this directory can be resumed here. Sessions that ran natively on ${ws.machine} (the agent there) are stored on ${ws.machine} and cannot be resumed here; to continue one, use \`rove api add --machine ${ws.machine} --engine-there\` or start the session on ${ws.machine}.`]}function projectInstructions(text){return text.trim()?`
|
|
6
|
+
# The project's own instructions
|
|
7
|
+
|
|
8
|
+
${text.trim()}
|
|
9
|
+
`:""}var MARK="@@rove-workspace@@";function writeAtomic(file,text,mode){let tmp=`${file}.${process.pid}.tmp`;if(writeFileSync(tmp,text),mode!==void 0)chmodSync(tmp,mode);renameSync(tmp,file)}async function createRemoteLink(input,home=homeDir()){let{ws}=input,dir=remoteWorkspaceDir(ws.machine,ws.path,input.repo,home),created=!isRemoteWorkspace(dir);if(mkdirSync(remoteBinDir(dir),{recursive:!0}),writeAtomic(join(dir,REMOTE_WORKSPACE_FILE),`${JSON.stringify(ws,null,2)}
|
|
10
|
+
`),isWindowsPath(ws.path)){let shell=await runAsync(input.sshArgv[0]??"ssh",[...input.sshArgv.slice(1),SSH_SHELL_PROBE],{timeoutMs:30000});writeAtomic(rxPath(dir),windowsRxScript(input.sshArgv,ws.path,SSH_SHELL_IS_CMD.test(shell.stdout)),493),writeAtomic(rshPath(dir),windowsRshScript(input.sshArgv,ws.path),493)}else writeAtomic(rxPath(dir),rxScript(input.sshArgv,ws.path),493),writeAtomic(rshPath(dir),rshScript(input.sshArgv,ws.path),493);let probe=await runAsync(rxPath(dir),[`uname -sm; echo ${MARK}; cat AGENTS.md 2>/dev/null || cat CLAUDE.md 2>/dev/null`],{timeoutMs:30000});if(!probe.ok&&!probe.stdout.includes(MARK)){if(created)removeRemoteLink(dir,home);throw Error(`${ws.machine} did not answer at ${ws.path}: ${(probe.stderr||"ssh failed").trim()}`)}let[system="",...rest]=probe.stdout.split(`
|
|
11
|
+
${MARK}
|
|
12
|
+
`),note={...ws,system:system.trim(),...input.mcp?.length?{mcp:input.mcp}:{}},project=projectInstructions(rest.join(`
|
|
13
|
+
${MARK}
|
|
14
|
+
`));writeAtomic(join(dir,"AGENTS.md"),remoteNotes(note)+project);for(let notes of input.engineNotes)writeAtomic(join(dir,notes.file),notes.text(note)+project);return dir}function removeRemoteLink(dir,home=homeDir()){if(!pathWithin(remoteWorkspacesRoot(home),dir)||!isRemoteWorkspace(dir))return;rmSync(dir,{recursive:!0,force:!0});for(let parent of[dirname(dir),dirname(dirname(dir))])try{rmdirSync(parent)}catch{}}
|
|
15
|
+
export{remotePathKey,remoteWorkspaceDir,readRemoteWorkspace,isRemoteWorkspace,remoteBinDir,rxPath,remoteShellInput,linkedWorktree,whereThingsRun,createRemoteLink,removeRemoteLink};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{stampOrigin}from"./chunk-
|
|
2
|
+
import{stampOrigin}from"./chunk-zgfh6zya.js";import{createStateCell}from"./chunk-7b2x6nkj.js";var NO_LIVE={activity:new Map,changes:new Map,tokens:new Map};function decodeMachines(payload){let p=payload;if(!p||!Array.isArray(p.machines)||!Array.isArray(p.tasks)||!p.live||typeof p.live!=="object")return null;let map=(value)=>new Map(value&&typeof value==="object"?Object.entries(value):[]);return{machines:p.machines,tasks:p.tasks,live:{activity:map(p.live.activity),changes:map(p.live.changes),tokens:map(p.live.tokens)}}}class MachineFeed{local;machinesAcc=createStateCell([],"machines.status");remoteTasksAcc=createStateCell(null,"machines.remoteTasks");tasksAcc;merged=null;liveAcc=createStateCell(NO_LIVE,"machines.live");stops;constructor(local){this.local=local;this.tasksAcc=this.mergedTasks();let raw=local.rawChannelSignal("machines"),take=()=>{let next=decodeMachines(raw.get());if(!next)return;this.machinesAcc.set(next.machines),this.liveAcc.set(next.live),this.remoteTasksAcc.set(next.machines.length===0?null:next.tasks)};this.stops=[raw.subscribe(take)],take()}machinesSignal(){return this.machinesAcc}tasksSignal(){return this.tasksAcc}liveSignal(){return this.liveAcc}mergedTasks(){let localTasks=this.local.tasksSignal(),get=()=>{let local=localTasks.get(),remote=this.remoteTasksAcc.get();if(remote===null)return local;if(this.merged?.local!==local||this.merged.remote!==remote){let value=[...local.map((task)=>stampOrigin(task,"local","local")),...remote];this.merged={local,remote,value}}return this.merged.value},state=get;return state.get=get,state.subscribe=(listener)=>{let stopLocal=localTasks.subscribe(listener),stopRemote=this.remoteTasksAcc.subscribe(listener);return()=>{stopLocal(),stopRemote()}},state}dispose(){for(let stop of this.stops)stop()}}
|
|
3
3
|
export{decodeMachines,MachineFeed};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{installSkillErrors,missingSkillNames}from"./chunk-
|
|
2
|
+
import{installSkillErrors,missingSkillNames}from"./chunk-eg3xtzex.js";import{createStateCell}from"./chunk-7b2x6nkj.js";import{installedEngineIds}from"./chunk-2tjf67y8.js";var skillMissing=createStateCell([]),POLL_MS=30000,started=!1;function refreshSkillStatus(){if(!started)return;installedEngineIds().then((installed)=>{let next=missingSkillNames(installed);if(next.join(`
|
|
3
3
|
`)!==skillMissing.get().join(`
|
|
4
4
|
`))skillMissing.set(next)}).catch(()=>{})}function startSkillStatus(){if(started)return;started=!0,refreshSkillStatus(),setInterval(refreshSkillStatus,POLL_MS).unref?.()}function installSkillNow(){let error=installSkillErrors();return refreshSkillStatus(),error}
|
|
5
5
|
export{skillMissing,refreshSkillStatus,startSkillStatus,installSkillNow};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{FREEZE_TTL_MS}from"./chunk-y0skz8j9.js";import{logDaemonInfo}from"./chunk-rxqdw6s5.js";import{probeDaemonSocket,resolveRoveSpawn,testDaemonResponds}from"./chunk-k7tdg6kb.js";import{stopDaemonProcess}from"./chunk-1pmzr8kr.js";import{spawnDetachedDaemon,windowsPowershellPath}from"./chunk-e5jxbd98.js";import{RoveDaemonClient}from"./chunk-84q9hv7m.js";import{isProcessAlive,readPidFile}from"./chunk-tw25g9g5.js";import{defaultPtyFreezeDir,defaultPtyHostLogPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-2z2jwetd.js";import{spawn}from"child_process";import{existsSync}from"fs";import{readdir,rename,rm,stat}from"fs/promises";import{basename,delimiter,dirname,join,resolve}from"path";import{fileURLToPath}from"url";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}var PTY_HOST_START_ARGS=["pty-host"],PTY_HOST_NODE_BUNDLE="pty-host-node.mjs",PTY_HOST_NODE_DEV_CACHE="../../.cache/pty-host-node.mjs",PTY_HOST_NODE_ENTRY="../daemon/pty-host-node-entry.ts";function resolveNodeBinary(env=process.env,exists=existsSync,platform=process.platform){let dirs=(env.PATH??env.Path??"").split(delimiter).filter((dir)=>dir.length>0),suffixes=platform==="win32"?(env.PATHEXT??".EXE;.CMD;.BAT").split(";").filter((ext)=>ext.length>0):[""];for(let dir of dirs)for(let suffix of suffixes){let candidate=join(dir,`node${suffix}`);if(exists(candidate))return candidate}return null}async function bundleWithBun(entry,outFile,io){let{build,rename:move,discard}=io??{build:(config)=>Bun.build(config),rename,discard:(path)=>rm(path,{force:!0})},staging=`${outFile}.${process.pid}.tmp`,built=await build({entrypoints:[entry],outdir:dirname(staging),target:"node",format:"esm",naming:basename(staging),external:["node-pty"]});if(!built.success)return await discard(staging).catch(()=>{}),built;return await move(staging,outFile),built}async function resolveNodePtyHostSpawn(deps={}){let platform=deps.platform??process.platform;if(platform!=="win32")return null;let here=deps.moduleDir??dirname(fileURLToPath(import.meta.url)),exists=deps.exists??existsSync,bundle=deps.bundle??bundleWithBun,node=resolveNodeBinary(deps.env??process.env,exists,platform);if(!node)throw Error("Rove: the Windows PTY host runs under node, but no node was found on PATH. "+"Install Node.js (https://nodejs.org) and restart Rove \u2014 engine and terminal sessions cannot start without it.");let packaged=resolve(here,PTY_HOST_NODE_BUNDLE);if(exists(packaged))return[node,packaged];let entry=resolve(here,PTY_HOST_NODE_ENTRY);if(!exists(entry))throw Error(`Rove: no Windows PTY host found (looked for ${packaged} and ${entry})`);let cache=resolve(here,PTY_HOST_NODE_DEV_CACHE),built=await bundle(entry,cache);if(!built.success)throw Error(`Rove: could not build the Windows PTY host \u2014 ${built.logs.map(String).join("; ")}`);return[node,cache]}var BUSY_PTY_HOST_GRACE_MS=15000,CHILD_PROBE_TIMEOUT_MS=5000;function childProbeCommand(deps={}){let env=deps.env??process.env;if((deps.platform??process.platform)!=="win32")return["ps","-A","-o","ppid="];return[windowsPowershellPath(env,deps.exists??existsSync),"-NoProfile","-NonInteractive","-Command","[Console]::OutputEncoding=[System.Text.Encoding]::UTF8; Get-CimInstance -ClassName Win32_Process -Property ParentProcessId | Select-Object -ExpandProperty ParentProcessId"]}function runChildProbe(command,timeoutMs){return new Promise((done,fail)=>{let proc=spawn(command[0]??"",command.slice(1),{stdio:["ignore","pipe","ignore"]}),out="",finish=(err)=>{clearTimeout(timer);try{proc.kill()}catch{}if(err)fail(err);else done(out)},timer=setTimeout(()=>finish(Error(`did not answer within ${timeoutMs}ms`)),timeoutMs);proc.stdout?.on("data",(chunk)=>{out+=String(chunk)}),proc.on("error",(err)=>finish(err)),proc.on("close",(code,signal)=>finish(code===0&&signal===null?null:Error(`exited with ${signal??`code ${code}`}`)))})}async function liveChildCount(pid,deps={}){let timeoutMs=deps.timeoutMs??CHILD_PROBE_TIMEOUT_MS,command=childProbeCommand(deps),run=deps.run??runChildProbe,text;try{text=await run(command,timeoutMs)}catch{return null}let rows=text.split(`
|
|
3
|
+
`).map((row)=>row.trim()).filter((row)=>row.length>0);if(rows.length===0||rows.some((row)=>!/^\d+$/.test(row)))return null;return rows.filter((row)=>Number(row)===pid).length}async function ensurePtyHostReachable(){let socketPath=defaultPtyHostSocketPath(),firstProbe=await probeDaemonSocket(socketPath);if(firstProbe==="alive")return socketPath;let recordedPid=await readPidFile(defaultPtyHostPidPath()),hostPid=recordedPid!==null&&recordedPid!==process.pid&&isProcessAlive(recordedPid)?recordedPid:null;if(hostPid!==null||firstProbe==="wedged"){let deadline2=Date.now()+BUSY_PTY_HOST_GRACE_MS,state=firstProbe;while(Date.now()<deadline2){if(await new Promise((resolveTimer)=>setTimeout(resolveTimer,250)),state=await probeDaemonSocket(socketPath),state==="alive")return socketPath;if(hostPid===null?state==="absent":!isProcessAlive(hostPid))break}if(hostPid===null&&state==="wedged")throw Error(`rove: the pty host at ${socketPath} accepts connections but is not answering, and no live pid is recorded for it, so Rove cannot tell whether it still holds live sessions \u2014 refusing to restart it, which would kill every engine running in them. Inspect it with \`rove api pty-list\`, run \`rove reset\` to end every session and start fresh, or stop its process yourself once you have accepted losing those sessions.`);if(hostPid!==null&&isProcessAlive(hostPid)){let sessions=await liveChildCount(hostPid);if(sessions===null)throw Error(`rove: the pty host (pid ${hostPid}) is not answering and Rove could not read this machine's process table, so it cannot tell whether the host still holds live sessions \u2014 refusing to restart it, which would kill every engine running in them. Inspect it with \`rove api pty-list\`, or kill ${hostPid} yourself once you have accepted losing those sessions.`);if(sessions>0)throw Error(`rove: the pty host (pid ${hostPid}) is not answering but still holds ${sessions} live session(s) \u2014 refusing to restart it, which would kill every engine running in them. Inspect it with \`rove api pty-list\`, or kill ${hostPid} yourself once you have accepted losing those sessions.`)}}if((await stopDaemonProcess(socketPath,defaultPtyHostPidPath()).catch(()=>{return}))?.method==="refused")throw Error(`rove: the pty host at ${socketPath} still holds live sessions and declined to stop \u2014 not replacing it, which would kill every engine running in them. Inspect it with \`rove api pty-list\`, or run \`rove reset\` to end them and start fresh.`);let[command,...args]=await resolveNodePtyHostSpawn()??resolveRoveSpawn(PTY_HOST_START_ARGS);spawnDetachedDaemon(command??"",args,process.env,defaultPtyHostLogPath());let deadline=Date.now()+5000;while(Date.now()<deadline){if(await testDaemonResponds(socketPath))return socketPath;await new Promise((resolveTimer)=>setTimeout(resolveTimer,100))}throw Error(`rove: pty host did not start (or stayed wedged) at ${socketPath}; check ${defaultPtyHostLogPath()} or run \`rove doctor\``)}async function sweepPtyHostSessions(liveTaskIds,homeDir,aliasedKeys2=()=>[]){let client=new RoveDaemonClient(defaultPtyHostSocketPath(homeDir));try{await client.connect();let{sessions}=await client.request("pty.list"),current;for(let session of sessions){if(!current){let ids=liveTaskIds();if(ids===null)return;current={tasks:new Set(ids),aliased:aliasedKeys2()}}if(current.tasks.has(session.key.split("::")[0]??session.key))continue;if(current.aliased.some((base)=>isUnderKey(session.key,base)))continue;if(!session.generation){logDaemonInfo("pty-sweep",`skipped ${session.key}: host has no session generation; restart it when sessions can be interrupted`);continue}await client.request("pty.kill",{key:session.key,expectedGeneration:session.generation}),current=void 0}}catch{}finally{client.close()}}async function listPtyHostSessions(homeDir){let client=new RoveDaemonClient(defaultPtyHostSocketPath(homeDir));try{await client.connect();let result=await client.request("pty.list");return Array.isArray(result.sessions)?result.sessions:null}catch(err){if(err instanceof Error&&"code"in err&&(err.code==="ENOENT"||err.code==="ECONNREFUSED")){let pid=await readPidFile(defaultPtyHostPidPath(homeDir));return pid!==null&&isProcessAlive(pid)?null:[]}return null}finally{client.close()}}async function hasFrozenPtySessions(homeDir){let dir=defaultPtyFreezeDir(homeDir);try{for(let name of await readdir(dir)){if(!name.endsWith(".json"))continue;let mtimeMs=await stat(join(dir,name)).then((st)=>st.mtimeMs).catch(()=>0);if(Date.now()-mtimeMs<=FREEZE_TTL_MS)return!0}}catch{}return!1}async function ptyHostHasLiveSessions(homeDir){let sessions=await listPtyHostSessions(homeDir);if(!sessions||sessions.some((s)=>typeof s.alive!=="boolean"))return null;return sessions.some((s)=>s.alive)}
|
|
4
|
+
export{aliasKey,isUnderKey,aliasedKeys,teardownScope,ptyScopeFor,unclaimedSessions,hostedKeyFor,resolveNodeBinary,bundleWithBun,resolveNodePtyHostSpawn,childProbeCommand,runChildProbe,liveChildCount,ensurePtyHostReachable,sweepPtyHostSessions,listPtyHostSessions,hasFrozenPtySessions,ptyHostHasLiveSessions};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{NoopHookAdapter,activityHookAdapters,createEngineHookAdapter}from"./chunk-ydn9jss2.js";import"./chunk-2tjf67y8.js";import"./chunk-527kk5yh.js";import"./chunk-f60hmm20.js";import"./chunk-03ab55aq.js";import"./chunk-w7zv47mp.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-5kyajt3q.js";import"./chunk-k7tdg6kb.js";import"./chunk-1pmzr8kr.js";import"./chunk-e5jxbd98.js";import"./chunk-84q9hv7m.js";import"./chunk-96kvwzj8.js";import"./chunk-52stxk43.js";import"./chunk-h8qg9v95.js";import"./chunk-78y80xe8.js";import"./chunk-0zs13rdq.js";import"./chunk-tm6vvy5t.js";import"./chunk-yvg46jh9.js";import"./chunk-nks2q6d9.js";import"./chunk-sxev8fyk.js";import"./chunk-vkbk3j8c.js";import"./chunk-6hjt5an9.js";import"./chunk-ptyqj15s.js";import"./chunk-5rsp8ncr.js";import"./chunk-7f49kec6.js";import"./chunk-sckqk79z.js";import"./chunk-y8hjgmn0.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-0ft4n0t7.js";import"./chunk-n835vmw4.js";import"./chunk-tw25g9g5.js";import"./chunk-yt15y085.js";import"./chunk-2z2jwetd.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{createEngineHookAdapter,activityHookAdapters,NoopHookAdapter};
|
|
@@ -4,5 +4,5 @@ import{generateCompletions,isShellKind,mergeSubVerbs,shippedCompletionsPath}from
|
|
|
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-aw6419ts.js"),import("./chunk-mytwyyej.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-ngae3bw0.js");process.stdout.write(generateCompletions(shell,cliName,mergeSubVerbs(API_VERBS)))}export{runCompletionsSubcommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{getCustomEngineIds,getDisabledEngineIds}from"./chunk-52stxk43.js";import{bypassFlag}from"./chunk-
|
|
2
|
+
import{getCustomEngineIds,getDisabledEngineIds}from"./chunk-52stxk43.js";import{bypassFlag}from"./chunk-78y80xe8.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{JsonHookAdapter,ROVE_HOOK_VERSION,editJsonSettings,hookCommandQuoting,isRoveHook,roveHookArgs}from"./chunk-vkbk3j8c.js";import{roveHookInvocation}from"./chunk-6hjt5an9.js";import{quoteShellArgv}from"./chunk-ptyqj15s.js";import{bobAuthSecretsPath,claudeGlobalConfigPath,codexAuthPath,copilotConfigPath,kimiCredentialsPath,readTextFileSyncBounded,skillsDirUnder,updateSharedJson,updateSharedJsonSync,xdgConfigHome}from"./chunk-5rsp8ncr.js";import{isObject}from"./chunk-a6z2ggxd.js";import{roveStateDir}from"./chunk-pzbcbmm4.js";import{__require}from"./chunk-91sykzqq.js";import{execFile}from"child_process";import{mkdirSync,readFileSync,renameSync,statSync,writeFileSync}from"fs";import{delimiter,dirname,isAbsolute,join}from"path";import{promisify}from"util";var run=promisify(execFile),LIST_TIMEOUT_MS=15000;async function stdoutOf(bin,args){let{stdout}=await run(bin,[...args],{encoding:"utf8",timeout:LIST_TIMEOUT_MS,maxBuffer:4194304});return stdout}var CACHE_TTL_MS=900000;function binaryKey(bin){let dirs=isAbsolute(bin)?[""]:(process.env.PATH??"").split(delimiter);for(let dir of dirs){let candidate=dir?join(dir,bin):bin;try{let s=statSync(candidate);if(s.isFile())return`${candidate}:${s.mtimeMs}:${s.size}`}catch{}}return`${bin}:unknown`}function readCache(key){try{let hit=JSON.parse(readFileSync(join(roveStateDir(),"model-lists.json"),"utf8"))[key];if(!hit||typeof hit.at!=="number"||Date.now()-hit.at>CACHE_TTL_MS)return null;return Array.isArray(hit.models)?hit.models:null}catch{return null}}function writeCache(key,models){let path=join(roveStateDir(),"model-lists.json");try{mkdirSync(dirname(path),{recursive:!0});let all={};try{let parsed=JSON.parse(readFileSync(path,"utf8"));if(parsed&&typeof parsed==="object")all=parsed}catch{}all[key]={at:Date.now(),models};let tmp=`${path}.tmp-${process.pid}`;writeFileSync(tmp,JSON.stringify(all)),renameSync(tmp,path)}catch{}}async function cachedModelList(bin,args,parse){let key=`${bin} ${args.join(" ")} ${binaryKey(bin)}`,hit=readCache(key);if(hit)return hit;let models=parse(await stdoutOf(bin,args));return writeCache(key,models),models}var CLAUDE_MODELS=[{id:"fable"},{id:"opus"},{id:"sonnet"}],CODEX_MODELS=[{id:"gpt-6-astra"},{id:"gpt-5.6-luna"},{id:"gpt-5.6-sol"},{id:"gpt-5.5"}];function isClaudeFamilyModel(model){return/^(claude-|anthropic\/)|^(fable|opus|sonnet|haiku)(\[|$)/i.test(model.trim())}function isOpenAiFamilyModel(model){return/^(gpt-|o\d|codex-|openai\/)/i.test(model.trim())}function parsePiModelTable(stdout){let out=[];for(let line of stdout.split(`
|
|
3
3
|
`)){let cols=line.trim().split(/\s+/);if(cols.length<2)continue;let[provider,model]=cols;if(provider==="provider"&&model==="model")continue;out.push({id:`${provider}/${model}`,label:model})}return out}async function listPiModels(){return cachedModelList("pi",["--list-models"],parsePiModelTable)}function parseOmpModelJson(stdout){let models=JSON.parse(stdout).models;if(!Array.isArray(models))throw Error("omp models --json: no `models` array");let out=[];for(let m of models){if(typeof m.selector!=="string"||!m.selector)continue;out.push({id:m.selector,...typeof m.name==="string"&&m.name?{label:m.name}:{}})}return out}async function listOmpModels(){return cachedModelList("omp",["models","--json"],parseOmpModelJson)}function parseModelLines(stdout){let out=[];for(let line of stdout.split(`
|
|
4
4
|
`)){let[id="",label=""]=line.split("\t").map((c)=>c.trim());if(!id||/\s/.test(id))continue;out.push({id,...label?{label}:{}})}return out}function listModelLines(bin,args){return()=>cachedModelList(bin,args,parseModelLines)}import{homedir as homedir10}from"os";import{join as join10}from"path";import{homedir}from"os";import{join as join2}from"path";function trustAntigravityWorktree(worktreePath,home=homedir()){updateSharedJsonSync(join2(home,".gemini","antigravity-cli","settings.json"),(raw)=>{if(raw===void 0)return{};try{return JSON.parse(raw)}catch{return}},(doc)=>{let existing=Array.isArray(doc.trustedWorkspaces)?doc.trustedWorkspaces:[];if(existing.includes(worktreePath))return;return`${JSON.stringify({...doc,trustedWorkspaces:[...existing,worktreePath]},null,2)}
|
|
5
5
|
`})}var GEMINI={rules:[{state:"blocked",any:["\u2502 apply this change","\u2502 allow execution","waiting for user confirmation"]},{state:"blocked",all:["do you want to proceed"],any:["yes"]},{state:"working",any:["esc to cancel"]}]},OPENCODE={rules:[{state:"blocked",all:["update available","would you like to update now?","skip","confirm"]},{state:"blocked",any:["\u25B3 permission required"]},{state:"blocked",all:["esc dismiss"],any:["enter confirm","enter submit","enter toggle"]},{state:"working",any:["esc interrupt","esc to interrupt","ctrl+c to interrupt","esc again to interrupt"]},{state:"idle",any:["enter send"]}]},CURSOR={rules:[{state:"blocked",any:["press any key to log in"]},{state:"blocked",all:["proceed (y)"]},{state:"blocked",any:["run this command?","waiting for approval","skip (esc or n)","(y) (enter)"]},{state:"working",any:["esc to cancel","ctrl+c to stop"]}]},GROK={rules:[{state:"blocked",any:["\u26A0 action required","ctrl+o:yolo"]},{state:"blocked",all:["\u2503"],lineRegex:["^\\s*\u2503\\s+\\S+\\s+\\(\u25CB\\)"]},{state:"working",any:["[stop]"],lineRegex:["^\\s*[\\u2800-\\u28FF]"]}]},DROID={rules:[{state:"blocked",all:["enter to select","esc to cancel"],any:["> yes, allow","> no, cancel"]},{state:"blocked",all:["enter select","esc cancel"]},{state:"working",any:["esc to stop"]}]},AMP={rules:[{state:"blocked",any:["waiting for approval","run this command?","allow editing file:","allow creating file:","confirm tool call"]},{state:"working",lineRegex:["^\\s*\u2570\\s+\\S+\\s+(thinking|streaming|running tools|waiting)\\s+\u2500"]}]},CLINE={rules:[{state:"blocked",any:["let cline use this tool"]},{state:"blocked",all:["execute command?","yes"],any:["[act mode]","[plan mode]"]},{state:"blocked",all:["use this tool?","yes"],any:["[act mode]","[plan mode]"]}]},KIRO={rules:[{state:"blocked",all:["requires approval"],any:["yes, single permission","trust, always allow","no (tab to edit)","esc to close"]},{state:"blocked",all:["pending from subagents","tool approval"],any:["approve all pending","configure individually","exit (cancel subagents)"]},{state:"working",any:["kiro is working"]},{state:"working",all:["esc to cancel"],lineRegex:["^\\s*[\u25D4\u25D1\u25D5\u25CF]\\s+[A-Za-z]"]}]},MAKI={rules:[{state:"blocked",all:["permission required","y allow","n deny"]},{state:"blocked",all:["permission required"],any:["confirm allow","confirm deny"]},{state:"blocked",all:["permission required","enter deny","esc cancel"]},{state:"blocked",all:["plan complete","enter confirm"],any:["space toggle parallel","edit plan"]},{state:"working",bottomLines:1,lineRegex:["^( [\\u2800-\\u28FF]){1,2} \\[(BUILD|PLAN|BASH)\\]"]},{state:"idle",bottomLines:1,lineRegex:["^ \\[(BUILD|PLAN|BASH)\\]"]}]},ANTIGRAVITY={rules:[{state:"blocked",all:["do you trust the contents of this project?","yes, i trust this folder"]},{state:"blocked",all:["requesting permission for:","do you want to proceed?"]},{state:"blocked",all:["requesting permission for:","tab amend","edit command"]},{state:"working",lineRegex:["^\\s*[\\u2800-\\u28FF]+\\s+[A-Za-z]+\\w*ing\\b"]},{state:"working",bottomLines:5,lineRegex:["\xB7\\s*[1-9][0-9]*\\s+task"]}]},DEVIN={rules:[{state:"blocked",bottomLines:8,all:["do you trust the authors of this directory?","yes, trust "]},{state:"blocked",bottomLines:8,all:["approve once","select","confirm","esc cancel"]},{state:"working",bottomLines:8,all:["running tools","esc to interrupt"]},{state:"working",bottomLines:6,all:["guide devin while it works"]},{state:"working",bottomLines:8,all:["reading shell ","timeout:"]},{state:"idle",bottomLines:8,all:["ask devin to build","features, fix bugs","your code"],lineRegex:["^\\s*\u276D Ask Devin to build"]},{state:"idle",bottomLines:6,all:["context:"],lineRegex:["^\\s*\u276D"]}]},QODERCLI={rules:[{state:"blocked",all:["waiting for user confirmation"],any:["yes","no","allow","reject"]},{state:"blocked",all:["awaiting approval"],any:["allow","reject"]},{state:"blocked",any:["permission required","allow once or always?","asking user","enter your response","review your answers:","shell awaiting input"]},{state:"working",any:["(esc to cancel,"]},{state:"working",lineRegex:["^\\s*[\\u2800-\\u28FF]\\s+.*[A-Za-z]"]}]},HERMES={rules:[{state:"blocked",bottomLines:14,any:["dangerous","approval","allow once","hermes needs your","type your answer","approve once","start a new session","keep going"],lineRegex:["enter\\s+(?:to\\s+)?(?:confirm|send)","press enter","\u2191/\u2193\\s+(?:to\\s+)?select","show full command","type 1/2/3","y/n quick","other \\(type"]},{state:"blocked",bottomLines:14,any:["sudo password","skill setup"]},{state:"blocked",bottomLines:14,all:["\uD83D\uDD11","for "]},{state:"working",bottomLines:5,any:["msg=interrupt","ctrl+c to interrupt","ctrl+c cancel"]}]},KILO={rules:[{state:"blocked",any:["\u25B3 permission required"]},{state:"blocked",all:["esc dismiss"],any:["enter confirm","enter submit","enter toggle"],lineRegex:["\u2191\u2193\\s*select","\u21C6\\s*tab"]},{state:"working",any:["esc interrupt"]}]},MASTRACODE={rules:[]};import{existsSync}from"fs";import{homedir as homedir2}from"os";import{dirname as dirname2,join as join3}from"path";function parseFlatHooks(raw){if(raw===void 0)return{ok:!0,doc:{}};let parsed;try{parsed=JSON.parse(raw)}catch(err){return{ok:!1,reason:`not valid JSON (${err instanceof Error?err.message:String(err)})`}}if(!isObject(parsed))return{ok:!1,reason:"top level is not a JSON object"};if(parsed.hooks===void 0)return{ok:!0,doc:parsed};if(!isObject(parsed.hooks))return{ok:!1,reason:'"hooks" is not an object'};for(let[event,entries]of Object.entries(parsed.hooks))if(!Array.isArray(entries))return{ok:!1,reason:`"hooks.${event}" is not an array`};return{ok:!0,doc:parsed}}function mergeFlatHooks(format,current,install,inv=roveHookInvocation()){let verbs=format.eventMap.map((spec)=>spec.verb),{hooks:rawHooks,...rest}=current,hooks=isObject(rawHooks)?{...rawHooks}:{},quoting=hookCommandQuoting();for(let{event,verb}of format.eventMap){let kept=(Array.isArray(hooks[event])?hooks[event]:[]).filter((entry)=>!isRoveHook(entry,verbs));if(install){let command=quoteShellArgv([...inv,"hook",verb,...roveHookArgs(format.vendor)],quoting);kept.push(format.withType?{type:"command",command}:{command})}if(kept.length>0)hooks[event]=kept;else delete hooks[event]}return{version:1,...rest,hooks}}var CURSOR_HOOK_EVENT_MAP=[{event:"sessionStart",verb:"session-start"}],CURSOR_FORMAT={vendor:"cursor",eventMap:CURSOR_HOOK_EVENT_MAP};function cursorHooksPath(home=homedir2()){let override=process.env.CURSOR_CONFIG_DIR?.trim();return join3(override||join3(home,".cursor"),"hooks.json")}function parseCursorHooks(raw){return parseFlatHooks(raw)}function mergeCursorHooks(current,install,inv=roveHookInvocation()){return mergeFlatHooks(CURSOR_FORMAT,current,install,inv)}class CursorHookAdapter{vendor="cursor";supportsHooks(){return!0}globalSettingsPath(){return cursorHooksPath()}activityDetailFromPayload(){return}cwdFromPayload(payload){let roots=payload.workspace_roots;return Array.isArray(roots)?firstString(...roots):void 0}sessionFromPayload(payload){let sessionId=firstString(payload.session_id,payload.conversation_id);if(!sessionId)return;let transcriptPath=firstString(payload.transcript_path);return{sessionId,...transcriptPath?{transcriptPath}:{}}}async installActivityHooks(settingsFilePath,opts={}){if(!existsSync(dirname2(settingsFilePath)))return{ok:!0};let outcome=await editJsonSettings(settingsFilePath,(cur)=>mergeCursorHooks(cur,!0),parseCursorHooks);if(!outcome.ok&&!opts.quiet)process.stderr.write(`[rove hooks] cursor: skipped ${outcome.file}: ${outcome.reason}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{openDaemonSession,resolveActiveTaskId}from"./chunk-
|
|
2
|
+
import{openDaemonSession,resolveActiveTaskId}from"./chunk-sns4xm7n.js";import"./chunk-k7tdg6kb.js";import"./chunk-1pmzr8kr.js";import"./chunk-e5jxbd98.js";import"./chunk-84q9hv7m.js";import"./chunk-96kvwzj8.js";import"./chunk-y8hjgmn0.js";import"./chunk-pn5ygqn6.js";import"./chunk-tw25g9g5.js";import"./chunk-yt15y085.js";import"./chunk-2z2jwetd.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{resolveActiveTaskId,openDaemonSession};
|