@sma1lboy/rove 0.9.310-nightly.20261128 → 0.9.310
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-rrtbrnsm.js → chunk-06cpc990.js} +1 -1
- package/dist/cli/chunk-0ccgkp9z.js +2 -0
- package/dist/cli/{chunk-qjq62kcb.js → chunk-0mdzphdz.js} +1 -1
- package/dist/cli/chunk-0rfd9c8r.js +9 -0
- package/dist/cli/{chunk-n7wa2g9g.js → chunk-0rfkgmns.js} +1 -1
- package/dist/cli/{chunk-0gdrrkeb.js → chunk-0x3vfkz9.js} +1 -1
- package/dist/cli/chunk-0xn13zhr.js +2 -0
- package/dist/cli/{chunk-aw9y2ecv.js → chunk-11vgtrm4.js} +1 -1
- package/dist/cli/{chunk-7akh6mpq.js → chunk-12qq8r81.js} +1 -1
- package/dist/cli/chunk-140pf8yx.js +77 -0
- package/dist/cli/chunk-152tg65q.js +2 -0
- package/dist/cli/chunk-17b3wpdk.js +2 -0
- package/dist/cli/chunk-1thazzyj.js +2 -0
- package/dist/cli/chunk-1wpwxcg9.js +3 -0
- package/dist/cli/chunk-22knrp3g.js +2 -0
- package/dist/cli/{chunk-xpf5znba.js → chunk-29ftjs96.js} +1 -1
- package/dist/cli/{chunk-v73jr6d3.js → chunk-2vk65d66.js} +1 -1
- package/dist/cli/{chunk-0pd79pqm.js → chunk-361acgxq.js} +1 -1
- package/dist/cli/{chunk-7qqg543d.js → chunk-36qsn2v8.js} +1 -1
- package/dist/cli/{chunk-8vhda57t.js → chunk-39txvrcs.js} +1 -1
- package/dist/cli/{chunk-ndjs6pfx.js → chunk-3d6caevx.js} +1 -1
- package/dist/cli/chunk-3fzrgjxr.js +13 -0
- package/dist/cli/{chunk-vr3hz387.js → chunk-3kraw5fh.js} +1 -1
- package/dist/cli/chunk-3vhhs2ye.js +2 -0
- package/dist/cli/chunk-3wkjeqt5.js +19 -0
- package/dist/cli/{chunk-th94kgx8.js → chunk-3yd8nyv6.js} +2 -2
- package/dist/cli/chunk-451z1265.js +19 -0
- package/dist/cli/chunk-4csg29es.js +3 -0
- package/dist/cli/chunk-4g1466qe.js +2 -0
- package/dist/cli/{chunk-d527kp0a.js → chunk-4y536nwm.js} +1 -1
- package/dist/cli/chunk-599msv9a.js +2 -0
- package/dist/cli/{chunk-94v7fkbx.js → chunk-5jevazzh.js} +2 -2
- package/dist/cli/chunk-5p2hhjje.js +3 -0
- package/dist/cli/{chunk-e5rhtk39.js → chunk-5sb5cgsx.js} +1 -1
- package/dist/cli/{chunk-7za2saew.js → chunk-65nm1v5h.js} +1 -1
- package/dist/cli/{chunk-bccq9wmd.js → chunk-69cqwz53.js} +1 -1
- package/dist/cli/{chunk-t0m58ycm.js → chunk-6f6b9zxx.js} +1 -1
- package/dist/cli/{chunk-f3bfy4jj.js → chunk-6qp32yje.js} +1 -1
- package/dist/cli/{chunk-zren8xsj.js → chunk-6t1yxx9x.js} +1 -1
- package/dist/cli/{chunk-nsscv6nb.js → chunk-76snhsy7.js} +1 -1
- package/dist/cli/{chunk-9avew3w0.js → chunk-7709m234.js} +1 -1
- package/dist/cli/{chunk-br2ehnve.js → chunk-7fw390kp.js} +1 -1
- package/dist/cli/{chunk-9h9kbx1m.js → chunk-7vassnhs.js} +3 -3
- package/dist/cli/chunk-887ysmy5.js +2 -0
- package/dist/cli/{chunk-bp4wst6z.js → chunk-89xz7kc8.js} +1 -1
- package/dist/cli/chunk-8akyzrjc.js +2 -0
- package/dist/cli/chunk-8byrmc70.js +3 -0
- package/dist/cli/{chunk-ys6md651.js → chunk-8ca4esh6.js} +1 -1
- package/dist/cli/{chunk-vf138rbf.js → chunk-8y9de8mg.js} +2 -2
- package/dist/cli/chunk-96wm6gt4.js +7 -0
- package/dist/cli/{chunk-2d0yz3mg.js → chunk-97fhq6zk.js} +1 -1
- package/dist/cli/chunk-9qye1syf.js +3 -0
- package/dist/cli/{chunk-e6wjt3e2.js → chunk-a2m6sk0n.js} +1 -1
- package/dist/cli/chunk-a2rxzyy4.js +2 -0
- package/dist/cli/chunk-asnjgz5a.js +4 -0
- package/dist/cli/chunk-aterhn60.js +3 -0
- package/dist/cli/chunk-ay3c35g5.js +2 -0
- package/dist/cli/{chunk-1kf56h0r.js → chunk-b3nrywgm.js} +1 -1
- package/dist/cli/{chunk-fg8d4z6c.js → chunk-bche07fb.js} +1 -1
- package/dist/cli/{chunk-5nwcwk6x.js → chunk-bsprr76b.js} +1 -1
- package/dist/cli/{chunk-jpc5yh8e.js → chunk-bwgtbaex.js} +1 -1
- package/dist/cli/chunk-bxabhkaq.js +21 -0
- package/dist/cli/{chunk-se483mcw.js → chunk-bz3p5vp1.js} +3 -3
- package/dist/cli/chunk-bzqjk9fb.js +3 -0
- package/dist/cli/chunk-c4c03wnz.js +3 -0
- package/dist/cli/{chunk-kqb8dd6n.js → chunk-cjzyc7cn.js} +12 -10
- package/dist/cli/{chunk-b550dwkd.js → chunk-cq4fym60.js} +1 -1
- package/dist/cli/{chunk-6d49rhme.js → chunk-cqazrkzw.js} +1 -1
- package/dist/cli/{chunk-vnp1k7ek.js → chunk-d3sgpjj6.js} +1 -1
- package/dist/cli/{chunk-rzem07e4.js → chunk-d5gtdecq.js} +1 -1
- package/dist/cli/chunk-de89aagk.js +6 -0
- package/dist/cli/chunk-ecdnw5xe.js +70 -0
- package/dist/cli/{chunk-sgnm8v1a.js → chunk-ehssspvr.js} +1 -1
- package/dist/cli/{chunk-ytrktnmv.js → chunk-emzt8crt.js} +1 -1
- package/dist/cli/{chunk-pnv7anct.js → chunk-ene2k7kb.js} +1 -1
- package/dist/cli/{chunk-a5p8fvpv.js → chunk-ep7abg35.js} +1 -1
- package/dist/cli/{chunk-7h5xfs5r.js → chunk-etj5h8hg.js} +2 -2
- package/dist/cli/chunk-ex2qtjt3.js +3 -0
- package/dist/cli/chunk-expgczbc.js +2 -0
- package/dist/cli/{chunk-9bq5e4fm.js → chunk-ez623zqp.js} +1 -1
- package/dist/cli/chunk-fads90r0.js +2 -0
- package/dist/cli/chunk-fdajxdht.js +2 -0
- package/dist/cli/{chunk-rbfah7j1.js → chunk-fwrpg1q9.js} +1 -1
- package/dist/cli/{chunk-mq9ng0qf.js → chunk-fyxfgkrw.js} +1 -1
- package/dist/cli/{chunk-b8xsf17w.js → chunk-fzc40zx7.js} +1 -1
- package/dist/cli/{chunk-s2wr6rc2.js → chunk-fzkq16qb.js} +1 -1
- package/dist/cli/chunk-g9qssqb7.js +2 -0
- package/dist/cli/{chunk-ekp98v7y.js → chunk-gf37e6ty.js} +1 -1
- package/dist/cli/chunk-gfsgk1n8.js +2 -0
- package/dist/cli/{chunk-8gy5m5s9.js → chunk-gvxchzch.js} +2 -2
- package/dist/cli/chunk-gxwy1r9a.js +382 -0
- package/dist/cli/{chunk-0ceg9qrt.js → chunk-hedp76tw.js} +1 -1
- package/dist/cli/{chunk-xttwk07t.js → chunk-hvz45y6d.js} +1 -1
- package/dist/cli/chunk-hwckecfa.js +2 -0
- package/dist/cli/{chunk-r987rn4r.js → chunk-j0s13v56.js} +1 -1
- package/dist/cli/chunk-j25b1ggg.js +2 -0
- package/dist/cli/{chunk-mapwzp5d.js → chunk-j6g8jmke.js} +2 -2
- package/dist/cli/chunk-j8r8q5z8.js +8 -0
- package/dist/cli/chunk-jgkjfqm9.js +4 -0
- package/dist/cli/{chunk-fexbzt63.js → chunk-jpa26n83.js} +1 -1
- package/dist/cli/chunk-jx3zndsh.js +2 -0
- package/dist/cli/chunk-jykxdtad.js +3 -0
- package/dist/cli/{chunk-73a9kk03.js → chunk-jyrmdx8f.js} +1 -1
- package/dist/cli/{chunk-fkz86c53.js → chunk-k1pk159f.js} +1 -1
- package/dist/cli/{chunk-4q5gbyhd.js → chunk-kmfas00z.js} +1 -1
- package/dist/cli/{chunk-szdzakrk.js → chunk-kpq28cbh.js} +1 -1
- package/dist/cli/chunk-kzcd7vdj.js +189 -0
- package/dist/cli/chunk-m0kprsxc.js +2 -0
- package/dist/cli/chunk-m932h3dx.js +30 -0
- package/dist/cli/{chunk-r5c51qqp.js → chunk-mp535p99.js} +1 -1
- package/dist/cli/chunk-mpmsc9s5.js +2 -0
- package/dist/cli/{chunk-dmb3y33d.js → chunk-n9d40jze.js} +1 -1
- package/dist/cli/{chunk-0b9dhq9b.js → chunk-navavqt2.js} +1 -1
- package/dist/cli/chunk-nf7pks44.js +2 -0
- package/dist/cli/chunk-pgaf0wqj.js +2 -0
- package/dist/cli/chunk-pp771snb.js +3 -0
- package/dist/cli/{chunk-3k56eqyb.js → chunk-pw0fvd64.js} +2 -2
- package/dist/cli/{chunk-55h581rc.js → chunk-qbmdpbdg.js} +1 -1
- package/dist/cli/chunk-qe7m3bwf.js +2 -0
- package/dist/cli/{chunk-6x4h80aw.js → chunk-qsfc7q9h.js} +1 -1
- package/dist/cli/chunk-r9n3asjx.js +2 -0
- package/dist/cli/{chunk-7v2m50tf.js → chunk-rr97z89e.js} +1 -1
- package/dist/cli/{chunk-sae6zcnq.js → chunk-rt4bsvd5.js} +1 -1
- package/dist/cli/chunk-sd3e5htq.js +2 -0
- package/dist/cli/{chunk-rzskspr8.js → chunk-spr6z826.js} +1 -1
- package/dist/cli/{chunk-jmx0vbra.js → chunk-t2f0xqyk.js} +2 -2
- package/dist/cli/chunk-t9vpmnbc.js +7 -0
- package/dist/cli/{chunk-mwnx6dk0.js → chunk-teq8p5rp.js} +4 -4
- package/dist/cli/{chunk-ebd4hnwk.js → chunk-tswzvtsy.js} +1 -1
- package/dist/cli/chunk-tzhfek18.js +34 -0
- package/dist/cli/{chunk-b4fqpvf8.js → chunk-v29v0cgd.js} +1 -1
- package/dist/cli/chunk-v2vs5nzx.js +2 -0
- package/dist/cli/{chunk-brk45qrp.js → chunk-v72qzktg.js} +1 -1
- package/dist/cli/chunk-vg3tyctk.js +2 -0
- package/dist/cli/chunk-vpy8tvfy.js +6 -0
- package/dist/cli/{chunk-eh7gh2nd.js → chunk-w3dpq6aj.js} +3 -3
- package/dist/cli/chunk-w70anvs6.js +3 -0
- package/dist/cli/chunk-wcjpanrw.js +51 -0
- package/dist/cli/{chunk-ay4k354s.js → chunk-wjmte4f0.js} +1 -1
- package/dist/cli/chunk-wth84cjn.js +3 -0
- package/dist/cli/chunk-wx3pr38x.js +2 -0
- package/dist/cli/{chunk-zw0k97mj.js → chunk-xc2zndmb.js} +1 -1
- package/dist/cli/chunk-xff3eqbv.js +2 -0
- package/dist/cli/chunk-xq2tazj5.js +2 -0
- package/dist/cli/{chunk-wdsbprdp.js → chunk-y4bhq88n.js} +1 -1
- package/dist/cli/{chunk-a833bpk3.js → chunk-y6eqz5pa.js} +1 -1
- package/dist/cli/{chunk-mm9rcced.js → chunk-ydxq51g3.js} +1 -1
- package/dist/cli/{chunk-nkgfr338.js → chunk-yg74j7kp.js} +1 -1
- package/dist/cli/{chunk-gpsj28xq.js → chunk-ygdxgp8r.js} +1 -1
- package/dist/cli/{chunk-h9hve3q0.js → chunk-ymmzwv5w.js} +2 -2
- package/dist/cli/{chunk-g883a7np.js → chunk-yn7y3epg.js} +1 -1
- package/dist/cli/chunk-ynwk3ep3.js +2 -0
- package/dist/cli/chunk-ypbh8ra4.js +8 -0
- package/dist/cli/{chunk-243dk7qd.js → chunk-z343ngx6.js} +1 -1
- package/dist/cli/{chunk-tdxr7vsr.js → chunk-z3cje8hk.js} +1 -1
- package/dist/cli/{chunk-q11wjx9d.js → chunk-z4nk2g47.js} +1 -1
- package/dist/cli/{chunk-18jk12bw.js → chunk-z6k53zqj.js} +1 -1
- package/dist/cli/chunk-z7dzpnyt.js +2 -0
- package/dist/cli/{chunk-h3fhg0k6.js → chunk-z98zs1h3.js} +2 -2
- package/dist/cli/chunk-z9c475xb.js +1 -0
- package/dist/cli/chunk-zg76y0bt.js +2 -0
- package/dist/cli/{chunk-sxpb2rv2.js → chunk-zgmnse5q.js} +1 -1
- package/dist/cli/chunk-zknvzer3.js +3 -0
- package/dist/cli/{chunk-1tqdxper.js → chunk-zpwg3eh0.js} +1 -1
- package/dist/cli/{chunk-e62x3fgv.js → chunk-zswn8skz.js} +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/pty-host-node.mjs +1 -1
- package/dist/cli/rove-run.js +1 -1
- package/dist/cli/rove.js +5 -5
- package/dist/completions/rove.bash +5 -3
- package/dist/completions/rove.fish +6 -2
- package/dist/completions/rove.zsh +5 -3
- package/dist/skills/rove/SKILL.md +21 -1
- package/dist/skills/rove/references/api-flags.md +21 -7
- package/dist/web/assets/index-BWayUsdy.css +1 -0
- package/dist/web/assets/index-D7OcIn1Q.js +113 -0
- package/dist/web/assets/term-mount-CSGanVNa.js +94 -0
- package/dist/web/index.html +2 -2
- package/dist/web/relay/index.html +12 -12
- package/dist/web/relay-client/assets/index-B307rVpU.js +264 -0
- package/dist/web/relay-client/assets/index-T6nIyGrP.css +1 -0
- package/dist/web/relay-client/index.html +2 -2
- package/package.json +7 -7
- package/dist/cli/chunk-0ft14bvv.js +0 -2
- package/dist/cli/chunk-0fymskqv.js +0 -2
- package/dist/cli/chunk-0x5c0fps.js +0 -2
- package/dist/cli/chunk-1z684jqw.js +0 -7
- package/dist/cli/chunk-22zaracj.js +0 -2
- package/dist/cli/chunk-35bm2hhp.js +0 -3
- package/dist/cli/chunk-43z1kjw1.js +0 -34
- package/dist/cli/chunk-452h1mje.js +0 -4
- package/dist/cli/chunk-4bje4rs5.js +0 -2
- package/dist/cli/chunk-4nwydt5r.js +0 -70
- package/dist/cli/chunk-5fn27ykb.js +0 -3
- package/dist/cli/chunk-686h761b.js +0 -2
- package/dist/cli/chunk-6ev3tb6p.js +0 -2
- package/dist/cli/chunk-6rpzvsp9.js +0 -2
- package/dist/cli/chunk-6rtxkaq4.js +0 -62
- package/dist/cli/chunk-7q0tgnka.js +0 -2
- package/dist/cli/chunk-7xzsssdb.js +0 -2
- package/dist/cli/chunk-7yx30m9p.js +0 -2
- package/dist/cli/chunk-88c4frwd.js +0 -2
- package/dist/cli/chunk-8jp0h0cb.js +0 -3
- package/dist/cli/chunk-9hkf3fxt.js +0 -2
- package/dist/cli/chunk-9tfh7fm8.js +0 -2
- package/dist/cli/chunk-a1cdvvjj.js +0 -3
- package/dist/cli/chunk-b926z6ts.js +0 -3
- package/dist/cli/chunk-c9c6yczz.js +0 -3
- package/dist/cli/chunk-cq5bvzpw.js +0 -2
- package/dist/cli/chunk-dsqcwtw5.js +0 -5
- package/dist/cli/chunk-e3d8k6yn.js +0 -173
- package/dist/cli/chunk-ea6nmvhb.js +0 -6
- package/dist/cli/chunk-en31v4c6.js +0 -2
- package/dist/cli/chunk-ex4q79hw.js +0 -4
- package/dist/cli/chunk-f7h3mzk0.js +0 -3
- package/dist/cli/chunk-feq3nytk.js +0 -3
- package/dist/cli/chunk-g2brwxbt.js +0 -2
- package/dist/cli/chunk-g6wzch69.js +0 -162
- package/dist/cli/chunk-gpdrhahv.js +0 -2
- package/dist/cli/chunk-h0yvntcq.js +0 -3
- package/dist/cli/chunk-hy1pkmfa.js +0 -2
- package/dist/cli/chunk-jrrq9k1b.js +0 -212
- package/dist/cli/chunk-khfwvz0g.js +0 -2
- package/dist/cli/chunk-kknejavp.js +0 -2
- package/dist/cli/chunk-m00ftggk.js +0 -11
- package/dist/cli/chunk-mktg22yf.js +0 -13
- package/dist/cli/chunk-mxr7n23g.js +0 -2
- package/dist/cli/chunk-nr7gk1r6.js +0 -2
- package/dist/cli/chunk-p90ne1pc.js +0 -4
- package/dist/cli/chunk-pmfkzjj4.js +0 -2
- package/dist/cli/chunk-qwkgksrt.js +0 -2
- package/dist/cli/chunk-r1zy756y.js +0 -2
- package/dist/cli/chunk-rf82fyrx.js +0 -2
- package/dist/cli/chunk-rv0c3aje.js +0 -2
- package/dist/cli/chunk-s0y3qw79.js +0 -2
- package/dist/cli/chunk-tm6vvy5t.js +0 -3
- package/dist/cli/chunk-tsyz1xr8.js +0 -2
- package/dist/cli/chunk-vfc9k4b9.js +0 -5
- package/dist/cli/chunk-wgyhtgeq.js +0 -2
- package/dist/cli/chunk-yecvqy0c.js +0 -2
- package/dist/cli/chunk-yz9erpjc.js +0 -2
- package/dist/cli/chunk-zhjd9pvc.js +0 -2
- package/dist/cli/chunk-zmk4q05h.js +0 -2
- package/dist/cli/chunk-zwbnsf1p.js +0 -8
- package/dist/cli/chunk-zy7m8fm9.js +0 -2
- package/dist/web/assets/index-BJEFhpXi.css +0 -1
- package/dist/web/assets/index-D7VnKpGY.js +0 -100
- package/dist/web/assets/term-mount-DBU4rcMr.js +0 -94
- package/dist/web/relay-client/assets/index-D9PRsWzW.js +0 -251
- package/dist/web/relay-client/assets/index-Dk042dEU.css +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{REPEAT_SEP,VerbArgs,defaultApiRuntime,findVerb,normalizeWebArgv,parseFlags,unknownVerbError,validateAgainstSpec}from"./chunk-cjzyc7cn.js";import{ensurePluginEnginesLoaded}from"./chunk-c4c03wnz.js";import{REPO_HAS_NO_COMMITS_CODE,REPO_HAS_NO_COMMITS_HINT}from"./chunk-8ca4esh6.js";import{cliCaller,requireVerbInstalled,splitDaemonCode}from"./chunk-z0wnws9w.js";import{ApiError}from"./chunk-3vm6e0cf.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";var DAEMON_UNREACHABLE_MESSAGE="the rove daemon is not answering (restarting or stopped); nothing was changed, try again in a moment";function isDaemonUnreachable(err){if(!err||typeof err!=="object"||!("code"in err))return!1;if(err.code==="DAEMON_UNREACHABLE")return!0;return"syscall"in err&&err.syscall==="connect"&&(err.code==="ENOENT"||err.code==="ECONNREFUSED")}function toApiError(err){if(err instanceof ApiError)return err;if(isDaemonUnreachable(err))return new ApiError(DAEMON_UNREACHABLE_MESSAGE,"DAEMON_UNREACHABLE");let message=errorMessage(err);if(/task not found/i.test(message))return new ApiError(message,"TASK_NOT_FOUND",{hint:"that task id does not exist (deleted or mistyped) \u2014 list live tasks and retry with a real id",nextCommandArgs:["api","list"]});if(/unknown daemon request:/i.test(message))return versionSkewError(message);let coded=splitDaemonCode(message);if(coded?.code===REPO_HAS_NO_COMMITS_CODE)return new ApiError(coded.rest,coded.code,{hint:REPO_HAS_NO_COMMITS_HINT});if(coded)return new ApiError(coded.rest,coded.code);return new ApiError(message,"RPC_ERROR")}function versionSkewError(message){return new ApiError(message,"DAEMON_VERSION_SKEW",{hint:"the running daemon is a different build than this CLI, so it does not serve this verb \u2014 restart the daemon to pick up this build, then retry (if the verb is gone for good, `rove api schema` lists what this daemon actually serves)",nextCommandArgs:["daemon","restart"]})}function errorBody(err){return{message:err.message,code:err.code,...err.data}}function successEnvelope(result){return{apiVersion:ROVE_API_VERSION,ok:!0,result}}function errorEnvelope(err){return{apiVersion:ROVE_API_VERSION,ok:!1,error:errorBody(toApiError(err))}}function flagText(name,spec,value){let type=spec?.type;if(typeof value==="string")return value;if(spec?.repeatable&&Array.isArray(value)&&value.every((item)=>typeof item==="string"))return value.join(REPEAT_SEP);if(typeof value==="boolean"&&(type==="bool"||type===void 0))return String(value);if(typeof value==="number"&&(type==="int"||type==="uint"||type===void 0))return String(value);if(Array.isArray(value)&&(type==="csv"||type===void 0)){if(!value.every((item)=>typeof item==="string"&&!item.includes(",")))throw new ApiError(`param ${name} must be a list of strings without ","`,"BAD_FLAG");return value.join(",")}throw new ApiError(`param ${name} does not fit its ${type} flag`,"BAD_FLAG")}function paramsToFlags(verb,params){let flags=new Map;for(let[name,value]of Object.entries(params))flags.set(name,flagText(name,verb.flags.find((f)=>f.name===name),value));return flags}function booleanFlagsOf(verb){return new Set(verb.flags.filter((f)=>f.type==="bool").map((f)=>f.name))}function repeatableFlagsOf(verb){return new Set(verb.flags.filter((f)=>f.repeatable).map((f)=>f.name))}async function callVerb(verb,flags,deps){requireVerbInstalled(verb);let caller=deps.caller??cliCaller();try{return await verb.handler({args:new VerbArgs(verb,flags,caller),caller,client:deps.client,runtime:deps.runtime??defaultApiRuntime})}catch(err){throw toApiError(err)}}async function runVerb(verbName,input,deps){ensurePluginEnginesLoaded();let verb=findVerb(verbName);if(!verb)throw unknownVerbError(verbName);if(verb.cliOnly&&!(deps.caller??cliCaller()).cli)throw new ApiError(`"${verbName}" streams over stdout/stdin, so only \`rove api\` can run it`,"CLI_ONLY_VERB",{hint:"run it as a CLI command on the machine whose daemon you are talking to"});let flags="argv"in input?parseFlags(verb.name==="web"?normalizeWebArgv(input.argv):input.argv,booleanFlagsOf(verb),repeatableFlagsOf(verb)).flags:paramsToFlags(verb,input.params);return validateAgainstSpec(verb,flags),callVerb(verb,flags,deps)}async function executeVerb(verbName,input,deps){try{return successEnvelope(await runVerb(verbName,input,deps))}catch(err){return errorEnvelope(err)}}function argvToParams(verbName,argv){let verb=findVerb(verbName);if(!verb)throw unknownVerbError(verbName);let normalized=verb.name==="web"?normalizeWebArgv(argv):argv,{flags}=parseFlags(normalized,booleanFlagsOf(verb),repeatableFlagsOf(verb));return Object.fromEntries(flags)}
|
|
3
|
+
export{DAEMON_UNREACHABLE_MESSAGE,isDaemonUnreachable,toApiError,errorBody,successEnvelope,errorEnvelope,paramsToFlags,booleanFlagsOf,repeatableFlagsOf,callVerb,runVerb,executeVerb,argvToParams};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ensurePluginEnginesLoaded,loadPluginEngines,registeredEngineIds,reloadPluginEngines}from"./chunk-c4c03wnz.js";import"./chunk-bwgtbaex.js";import"./chunk-ws2q07kb.js";import"./chunk-gxwy1r9a.js";import"./chunk-f60hmm20.js";import"./chunk-w7zv47mp.js";import"./chunk-rr97z89e.js";import"./chunk-03ab55aq.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-navavqt2.js";import"./chunk-w70anvs6.js";import"./chunk-4csg29es.js";import"./chunk-h8qg9v95.js";import"./chunk-0zs13rdq.js";import"./chunk-1wpwxcg9.js";import"./chunk-ypbh8ra4.js";import"./chunk-06cpc990.js";import"./chunk-xc2zndmb.js";import"./chunk-zpwg3eh0.js";import"./chunk-vpy8tvfy.js";import"./chunk-96kvwzj8.js";import"./chunk-78y80xe8.js";import"./chunk-wx77yjhc.js";import"./chunk-12qq8r81.js";import"./chunk-96wm6gt4.js";import"./chunk-6hjt5an9.js";import"./chunk-ptyqj15s.js";import"./chunk-jykxdtad.js";import"./chunk-65nm1v5h.js";import"./chunk-sckqk79z.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.js";import"./chunk-8rxg12aj.js";import"./chunk-bzqjk9fb.js";import"./chunk-4y536nwm.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import"./chunk-gvxchzch.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{reloadPluginEngines,registeredEngineIds,loadPluginEngines,ensurePluginEnginesLoaded};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{PTY_STOP_REFUSED,RoveDaemonClient}from"./chunk-
|
|
2
|
+
import{PTY_STOP_REFUSED,RoveDaemonClient}from"./chunk-vpy8tvfy.js";import{isProcessAlive,readPidFile}from"./chunk-ydxq51g3.js";import{unlink}from"fs/promises";async function stopDaemonProcess(socketPath,pidPath,opts={}){let oldPid=await readPidFile(pidPath),targetPid=oldPid!==null&&oldPid!==process.pid?oldPid:null,wasAlive=targetPid!==null&&isProcessAlive(targetPid),method=wasAlive?"graceful":"absent",client=new RoveDaemonClient(socketPath),refusal=client.request("daemon.stop",{reason:opts.reason??"stop",...opts.force?{force:!0}:{}}).then(()=>!1,(err)=>err instanceof Error&&err.name===PTY_STOP_REFUSED),{promise:stopTimeout,resolve:timedOut}=Promise.withResolvers();setTimeout(()=>timedOut(!1),2000);let refused=await Promise.race([refusal,stopTimeout]);if(client.close(),refused)return{pid:oldPid,method:"refused"};if(wasAlive&&targetPid!==null){let deadline=Date.now()+5000,escalated=!1;while(Date.now()<deadline){if(!isProcessAlive(targetPid))break;if(!escalated&&Date.now()-(deadline-5000)>2000){try{process.kill(targetPid,"SIGTERM")}catch{}method="sigterm",escalated=!0}await new Promise((resolve)=>setTimeout(resolve,50))}if(isProcessAlive(targetPid))try{process.kill(targetPid,"SIGKILL"),method="sigkill",await new Promise((resolve)=>setTimeout(resolve,100))}catch{}}let survivor=await readPidFile(pidPath);if(survivor!==null&&survivor!==process.pid&&isProcessAlive(survivor))return{pid:oldPid,method};return await unlink(socketPath).catch(()=>{}),await unlink(pidPath).catch(()=>{}),{pid:oldPid,method}}
|
|
3
3
|
export{stopDaemonProcess};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{isHomeDir,pathRejection,projectRejection,rejectionReason}from"./chunk-1wpwxcg9.js";import"./chunk-pn5ygqn6.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{rejectionReason,projectRejection,pathRejection,isHomeDir};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{installSkillNow,refreshSkillStatus,skillMissing,startSkillStatus}from"./chunk-39txvrcs.js";import"./chunk-yn7y3epg.js";import"./chunk-gxwy1r9a.js";import"./chunk-f60hmm20.js";import"./chunk-w7zv47mp.js";import"./chunk-rr97z89e.js";import"./chunk-03ab55aq.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-navavqt2.js";import"./chunk-w70anvs6.js";import"./chunk-4csg29es.js";import"./chunk-h8qg9v95.js";import"./chunk-0zs13rdq.js";import"./chunk-1wpwxcg9.js";import"./chunk-ypbh8ra4.js";import"./chunk-06cpc990.js";import"./chunk-xc2zndmb.js";import"./chunk-zpwg3eh0.js";import"./chunk-vpy8tvfy.js";import"./chunk-96kvwzj8.js";import"./chunk-78y80xe8.js";import"./chunk-wx77yjhc.js";import"./chunk-12qq8r81.js";import"./chunk-7b2x6nkj.js";import"./chunk-96wm6gt4.js";import"./chunk-6hjt5an9.js";import"./chunk-ptyqj15s.js";import"./chunk-jykxdtad.js";import"./chunk-65nm1v5h.js";import"./chunk-sckqk79z.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.js";import"./chunk-8rxg12aj.js";import"./chunk-bzqjk9fb.js";import"./chunk-4y536nwm.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import"./chunk-gvxchzch.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{startSkillStatus,skillMissing,refreshSkillStatus,installSkillNow};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{shellQuote,xml}from"./chunk-
|
|
2
|
+
import{shellQuote,xml}from"./chunk-6f6b9zxx.js";import{ensureDaemonReachable,resolveRoveSpawn}from"./chunk-06cpc990.js";import{roveCliInvocation}from"./chunk-6hjt5an9.js";import{defaultDaemonLogPath}from"./chunk-gvxchzch.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import{readRoveHomeDirEnv}from"./chunk-nc46gddg.js";import{spawnSync}from"child_process";import{existsSync,mkdirSync,readFileSync,rmSync,writeFileSync}from"fs";import{homedir}from"os";import{dirname,join}from"path";var CLI_NAME=ROVE_PRODUCT_NAME,LAUNCHD_LABEL="run.rove.daemon",SYSTEMD_UNIT="rove.service",RUN_KEY="HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run",RUN_VALUE="Rove",DAEMON_SERVICE={description:"Rove daemon",launchdLabel:LAUNCHD_LABEL,args:["daemon","start","--resident"],keepAlive:!1};function systemdUnit(ctx,service){return["[Unit]",`Description=${service.description}`,"","[Service]",`ExecStart=${[...ctx.cli,...service.args].map(shellQuote).join(" ")}`,...Object.entries(ctx.env).map(([name,value])=>`Environment=${shellQuote(`${name}=${value}`)}`),`StandardOutput=append:${ctx.logPath}`,`StandardError=append:${ctx.logPath}`,"Restart=on-failure",...service.keepAlive?["RestartSec=10"]:[],"","[Install]","WantedBy=default.target",""].join(`
|
|
3
3
|
`)}function launchdPlist(ctx,service){let args=[...ctx.cli,...service.args].map((a)=>` <string>${xml(a)}</string>`).join(`
|
|
4
4
|
`),env=Object.entries(ctx.env).map(([name,value])=>` <key>${xml(name)}</key>
|
|
5
5
|
<string>${xml(value)}</string>`).join(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{isShellKind,shippedCompletionsPath}from"./chunk-
|
|
2
|
+
import{isShellKind,shippedCompletionsPath}from"./chunk-hedp76tw.js";import{loadStateFile,patchStateFile}from"./chunk-12qq8r81.js";import{t}from"./chunk-z343ngx6.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import{appendFileSync,existsSync,mkdirSync,readFileSync,writeFileSync}from"fs";import{homedir}from"os";import{basename,join}from"path";var PENDING_COMPLETIONS_KEY="welcomePendingCompletions";function detectShell(env=process.env){let shell=basename(env.SHELL??"");return shell==="zsh"||shell==="bash"||shell==="fish"?shell:null}function completionHook(shell,cli,shipped){if(shipped===null)return legacyCompletionHook(shell,cli);return shell==="fish"?`test -f "${shipped}"; and source "${shipped}"`:`[ -f "${shipped}" ] && source "${shipped}"`}function legacyCompletionHook(shell,cli){return shell==="fish"?`${cli} completions fish | source`:`command -v ${cli} >/dev/null && source <(${cli} completions ${shell})`}function shippedScriptFor(shell,cli){let path=shippedCompletionsPath(shell,cli);return existsSync(path)?path:null}function installCompletions(shell,home=homedir(),cli=ROVE_PRODUCT_NAME,shipped=shippedScriptFor(shell,cli)){let hook=completionHook(shell,cli,shipped);if(shell==="fish"){let dir=join(home,".config","fish","completions"),path=join(dir,`${cli}.fish`);return mkdirSync(dir,{recursive:!0}),writeFileSync(path,`${hook}
|
|
3
3
|
`),{path,installed:!0}}let rc=join(home,shell==="zsh"?".zshrc":".bashrc"),existing=existsSync(rc)?readFileSync(rc,"utf8"):"";if(existing.includes(hook))return{path:rc,installed:!1};let legacy=legacyCompletionHook(shell,cli);if(existing.includes(legacy))return writeFileSync(rc,existing.replace(legacy,hook)),{path:rc,installed:!0};if(existing.includes(`${cli} completions`))return{path:rc,installed:!1};return appendFileSync(rc,`
|
|
4
4
|
# ${cli} completions
|
|
5
5
|
${hook}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{tightenFilePermissions}from"./chunk-yt15y085.js";import{isWindowsPipePath}from"./chunk-
|
|
2
|
+
import{tightenFilePermissions}from"./chunk-yt15y085.js";import{isWindowsPipePath}from"./chunk-gvxchzch.js";import{spawnSync}from"child_process";import{readFileSync}from"fs";import{readFile,stat,unlink}from"fs/promises";var DEFAULT_SOCKET_WATCH_MS=5000;async function listenOnUnixSocket(server,socketPath){if(await new Promise((resolve,reject)=>{let evented=server;evented.once("error",reject),server.listen(socketPath,()=>{evented.removeListener("error",reject),resolve()})}),!isWindowsPipePath(socketPath))await tightenFilePermissions(socketPath)}function isZombie(pid){try{if(process.platform==="linux"){let stat2=readFileSync(`/proc/${pid}/stat`,"utf8");return stat2.slice(stat2.lastIndexOf(")")+2).startsWith("Z")}if(process.platform==="win32")return!1;return spawnSync("ps",["-o","stat=","-p",String(pid)],{encoding:"utf8"}).stdout.startsWith("Z")}catch{return!1}}function isProcessAlive(pid){if(!Number.isInteger(pid)||pid<=0)return!1;try{process.kill(pid,0)}catch(err){return err.code!=="ESRCH"}return!isZombie(pid)}async function readPidFile(pidPath){try{let raw=await readFile(pidPath,"utf8"),pid=Number(raw.trim());return Number.isInteger(pid)&&pid>1?pid:null}catch{return null}}function createSocketOwnershipGuard(options){let watchMs=options.watchMs??DEFAULT_SOCKET_WATCH_MS,stamp=null,lost=!1,timer=null,currentStamp=async()=>{try{let s=await stat(options.socketPath);return{dev:s.dev,ino:s.ino}}catch(err){return err.code==="ENOENT"?null:"error"}},stopTimer=()=>{if(timer)clearInterval(timer);timer=null},verify=async()=>{if(stamp===null||lost)return;let now=await currentStamp();if(now==="error")return;if(now===null||now.dev!==stamp.dev||now.ino!==stamp.ino)lost=!0},check=async()=>{if(stamp===null||lost)return;if(await verify(),!lost)return;stopTimer(),options.onLost()};return{async arm(){let now=await currentStamp();if(now===null||now==="error")return;if(stamp=now,watchMs>0)timer=setInterval(()=>void check(),watchMs),timer.unref?.()},async release(server){if(stopTimer(),await verify(),stamp===null||lost){server.unref();return}await new Promise((resolve)=>server.close(()=>resolve())),await unlink(options.socketPath).catch(()=>{}),await unlink(options.pidPath).catch(()=>{})}}}
|
|
3
3
|
export{listenOnUnixSocket,isProcessAlive,readPidFile,createSocketOwnershipGuard};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{readTabsSnapshot}from"./chunk-
|
|
2
|
+
import{readTabsSnapshot}from"./chunk-89xz7kc8.js";import{engineCanFork,engineDisplayName,getEngineProtocol,protocolEntry,sessionProtocol}from"./chunk-9qye1syf.js";import{execHostForWorktreePath}from"./chunk-ygdxgp8r.js";import{supportsStructuredHistory}from"./chunk-gxwy1r9a.js";import{getPersistedString,getPersistedValue}from"./chunk-w70anvs6.js";import{parseNumstatRows}from"./chunk-fxpbaff2.js";import{parsePorcelainRows,unquoteGitPath}from"./chunk-dmzg9zdc.js";import{recordSpawn}from"./chunk-h8qg9v95.js";import{readHeadSha,resolveGitDirs}from"./chunk-kg9kmwt9.js";import{READ_ONLY_GIT_ENV}from"./chunk-9k0r47z3.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{t}from"./chunk-z343ngx6.js";import{rollupPr}from"./chunk-sckqk79z.js";import{isObject}from"./chunk-a6z2ggxd.js";import{acquireSync,releaseSync}from"./chunk-spr6z826.js";import{secretsPath}from"./chunk-pzbcbmm4.js";import{readFile,stat}from"fs/promises";var PER_SESSION=3,SNIPPET_RADIUS=60,READ_BATCH=8,READ_BUDGET_MS=1500;function snippetOf(text,needle){let flat=text.replace(/\s+/g," "),want=needle.replace(/\s+/g," "),at=flat.toLowerCase().indexOf(want.toLowerCase());if(at<0)return null;let start=Math.max(0,at-SNIPPET_RADIUS),end=Math.min(flat.length,at+want.length+SNIPPET_RADIUS);return`${start>0?"\u2026":""}${flat.slice(start,end).trim()}${end<flat.length?"\u2026":""}`}function matchMessages(messages,needle,max){let out=[];for(let m of messages){if(m.role!=="user"&&m.role!=="assistant")continue;for(let b of m.blocks){if(b.type!=="text")continue;let snippet=snippetOf(b.text,needle);if(snippet===null)continue;out.push({role:m.role,at:m.timestamp,snippet});break}if(out.length>=max)break}return out}function prefilterToken(query){return query.split(/["\\\s]+/).reduce((a,b)=>b.length>a.length?b:a,"")}async function candidatesOf(tasks,skipped){let claimed=new Set,pinned=[],unpinned=[],sharedDirs=new Map;for(let t2 of tasks)if(t2.worktreePath)sharedDirs.set(t2.worktreePath,(sharedDirs.get(t2.worktreePath)??0)+1);for(let task of tasks){if(task.origin){skipped.push({taskId:task.id,reason:"other-machine"});continue}let vendor=task.vendor,tabs=(readTabsSnapshot(task.id)?.tabs??[]).filter((t2)=>t2.kind==="engine"),any=!1;for(let tab of tabs){let tabVendor=tab.vendor??vendor;if(!tabVendor||!supportsStructuredHistory(sessionProtocol(tabVendor))||!tab.sessionId)continue;if(claimed.has(tab.sessionId))continue;claimed.add(tab.sessionId);let reader=protocolEntry(tabVendor).history;pinned.push({task,reader,sessionId:tab.sessionId,tabId:tab.id,path:null,mtimeMs:0}),any=!0}if(any)continue;if(!vendor||!supportsStructuredHistory(sessionProtocol(vendor))){skipped.push({taskId:task.id,reason:"engine-unsupported"});continue}let worktree=task.worktreePath;if(worktree&&(sharedDirs.get(worktree)??0)===1)unpinned.push({task,reader:protocolEntry(vendor).history,worktree})}let listed=await Promise.all(unpinned.map(async({task,reader,worktree})=>(await reader.listSessionIdsForWorktree(worktree)).filter((id)=>!claimed.has(id)).map((sessionId)=>({task,reader,sessionId,path:null,mtimeMs:0})))),all=[...pinned,...listed.flat()];return Promise.all(all.map(async(c)=>{let worktree=c.task.worktreePath||c.task.repo,path=await c.reader.transcriptPath(c.sessionId,worktree).catch(()=>null),mtimeMs=path?await stat(path).then((s)=>s.mtimeMs,()=>0):0;return{...c,path,mtimeMs}}))}async function filesContaining(paths,token){if(paths.length===0||token==="")return new Set(paths);let rg=Bun.which("rg");if(rg){let proc=Bun.spawn([rg,"-l","-i","-F","--no-messages","--",token,...paths],{stdout:"pipe",stderr:"ignore"}),out=await new Response(proc.stdout).text();return await proc.exited,new Set(out.split(`
|
|
3
3
|
`).filter(Boolean))}let needle=token.toLowerCase(),hits=new Set;for(let p of paths)if((await readFile(p,"utf8").catch(()=>"")).toLowerCase().includes(needle))hits.add(p);return hits}async function searchTasks(tasks,query,limit,budgetMs=READ_BUDGET_MS){let started=Date.now(),skipped=[],candidates=await candidatesOf(tasks,skipped),withPath=candidates.filter((c)=>c.path!==null).map((c)=>c.path),hits=await filesContaining(withPath,prefilterToken(query)),toRead=candidates.filter((c)=>c.path===null||hits.has(c.path)).sort((a,b)=>b.mtimeMs-a.mtimeMs),matches=[],scanned=0;while(scanned<toRead.length&&matches.length<limit&&Date.now()-started<budgetMs){let batch=toRead.slice(scanned,scanned+READ_BATCH),read=await Promise.all(batch.map((c)=>c.reader.readHistory(c.sessionId).catch(()=>[])));for(let[i,messages]of read.entries()){let c=batch[i];scanned++;for(let m of matchMessages(messages,query,Math.min(PER_SESSION,limit-matches.length)))matches.push({taskId:c.task.id,title:c.task.title,...c.tabId?{tabId:c.tabId}:{},...m});if(matches.length>=limit)break}}return{query,matches,skipped,truncated:scanned<toRead.length}}async function runWorktreeGit(worktreePath,args,options={}){if(!worktreePath)return{stdout:"",stderr:"worktreePath is required",status:-1};let exec=(options.execForPath??execHostForWorktreePath)(worktreePath),controller=options.timeoutMs&&options.timeoutMs>0?new AbortController:null,timedOut=!1,timer=controller?setTimeout(()=>{timedOut=!0,controller.abort()},options.timeoutMs):null,signal=controller&&options.signal?AbortSignal.any([controller.signal,options.signal]):controller?.signal??options.signal,result;try{recordSpawn("worktree.content",["git",...args],worktreePath),result=await exec.run(["git",...args],{cwd:worktreePath,env:READ_ONLY_GIT_ENV,signal})}catch(err){if(timer)clearTimeout(timer);return{stdout:"",stderr:errorMessage(err),status:-1}}if(timer)clearTimeout(timer);if(timedOut&&result.exitCode===-1&&!result.stderr)return{stdout:result.stdout,stderr:`git ${args.join(" ")} timed out after ${options.timeoutMs}ms`,status:-1};return{stdout:result.stdout,stderr:result.stderr,status:result.exitCode}}function readLocalWorktreeHead(worktreePath,deps={}){if(!worktreePath||(deps.execForPath??execHostForWorktreePath)(worktreePath).isRemote)return null;try{let dirs=resolveGitDirs(worktreePath);return dirs?readHeadSha(dirs):null}catch{return null}}function worktreeFilePath(worktreePath,relPath){if(!worktreePath||!relPath)return null;if(/^[/\\]/.test(relPath)||/^[a-zA-Z]:[/\\]/.test(relPath))return null;if(relPath.split(/[/\\]/).some((part)=>part===".."))return null;let parts=relPath.split("/");return`${worktreePath.replace(/\/+$/,"")}/${parts.filter(Boolean).join("/")}`}async function worktreeFileSize(worktreePath,relPath,deps={}){let path=worktreeFilePath(worktreePath,relPath);if(!path)return null;let exec=(deps.execForPath??execHostForWorktreePath)(worktreePath);try{let res=await exec.run(["wc","-c",path]);if(res.exitCode!==0)return null;let n=Number.parseInt(res.stdout.trim().split(/\s+/)[0]??"",10);return Number.isFinite(n)?n:null}catch{return null}}async function readWorktreeFile(worktreePath,relPath,deps={}){let path=worktreeFilePath(worktreePath,relPath);if(!path)return null;let exec=(deps.execForPath??execHostForWorktreePath)(worktreePath);try{return await exec.readFile(path)}catch{return null}}import{readdir}from"fs/promises";import{join}from"path";async function runGit(args,cwd,signal){if(!cwd)throw Error("git(): cwd is required");let result=await runWorktreeGit(cwd,args,{signal}),exitCode=result.status??-1;if(exitCode!==0){let stderr=(result.stderr??"").trim(),stdout=(result.stdout??"").trim();throw Error(`git ${args.join(" ")} (cwd=${cwd}) exited with code ${exitCode}: ${stderr||stdout||"(no output)"}`)}return result.stdout??""}async function listFiles(worktreePath,signal){let out;try{out=await runGit(["ls-files","--cached","--others","--exclude-standard","--full-name"],worktreePath,signal)}catch(err){if(!(err instanceof Error&&err.message.includes("not a git repository"))||execHostForWorktreePath(worktreePath).isRemote)throw err;return listFolderFiles(worktreePath,signal)}let lines=out.split(`
|
|
4
4
|
`).map((l)=>unquoteGitPath(l.replace(/\r$/,""))),set=new Set;for(let line of lines)if(line.length>0)set.add(line);return Array.from(set).sort()}var FOLDER_WALK_CAP=50000,FOLDER_WALK_SKIP=new Set([".git","node_modules"]);async function listFolderFiles(root,signal){let files=[],dirs=[""],seen=0;for(let i=0;i<dirs.length&&seen<FOLDER_WALK_CAP&&!signal?.aborted;i++){let rel=dirs[i],entries=await readdir(rel?join(root,rel):root,{withFileTypes:!0}).catch(()=>[]);for(let entry of entries){seen++;let path=rel?`${rel}/${entry.name}`:entry.name;if(entry.isDirectory()){if(!FOLDER_WALK_SKIP.has(entry.name))dirs.push(path)}else files.push(path)}}return files.sort()}async function statusFiles(worktreePath,signal){let out=await runGit(["status","--porcelain"],worktreePath,signal),entries=parseStatusEntries(out),stats=new Map;try{let diffOut=await runGit(["diff","--no-color","--numstat","-z","HEAD"],worktreePath,signal);stats=new Map(parseNumstat(diffOut).map((n)=>[n.path,{added:n.added,deleted:n.deleted}]))}catch{try{let cachedOut=await runGit(["diff","--no-color","--numstat","-z","--cached"],worktreePath,signal);stats=new Map(parseNumstat(cachedOut).map((n)=>[n.path,{added:n.added,deleted:n.deleted}]))}catch{stats=new Map}}let merged=entries.map((e)=>{let s=stats.get(e.path);if(s)return{...e,added:s.added,deleted:s.deleted};return e});if(merged.some(isUntrackedDir))try{let others=(await runGit(["ls-files","--others","--exclude-standard","--full-name"],worktreePath,signal)).split(`
|
|
5
5
|
`).filter((l)=>l.length>0);attachUntrackedChildren(merged,others)}catch{}let untracked=[];for(let e of merged){if(e.status!=="?")continue;if(e.children)untracked.push(...e.children);else if(e.added==null&&!e.path.endsWith("/"))untracked.push(e)}if(untracked.length>0)await Promise.all(untracked.map(async(e)=>{let added=await countAddedLines(worktreePath,e.path,signal);if(added!=null)e.added=added,e.deleted=0}));for(let e of merged){if(!e.children)continue;let sum=0,counted=!1;for(let c of e.children)if(c.added!=null)sum+=c.added,counted=!0;if(counted)e.added=sum,e.deleted=0}return merged}function isUntrackedDir(e){return e.status==="?"&&e.path.endsWith("/")}function attachUntrackedChildren(entries,others){for(let e of entries){if(!isUntrackedDir(e))continue;e.children=others.filter((p)=>p.startsWith(e.path)).map((p)=>({path:p,status:"?"}))}}var BASE_TTL_MS=300000,baseCache=new Map;async function resolveBase(worktreePath,prBaseRef,signal){if(prBaseRef&&prBaseRef.trim().length>0)return prBaseRef.trim();let hit=baseCache.get(worktreePath);if(hit&&Date.now()-hit.at<BASE_TTL_MS){if(hit.head===void 0)return hit.base;if((readLocalWorktreeHead(worktreePath)??await revParse("HEAD",worktreePath,signal))===hit.head)return hit.base}let resolved=await resolveBaseUncached(worktreePath,signal);if(!signal?.aborted)baseCache.set(worktreePath,{...resolved,at:Date.now()});return resolved.base}async function resolveBaseUncached(worktreePath,signal){try{let head2=(await runGit(["symbolic-ref","--short","refs/remotes/origin/HEAD"],worktreePath,signal)).trim();if(head2.length>0)return{base:head2}}catch{}for(let guess of["origin/main","origin/master"])try{return await runGit(["rev-parse","--verify","--quiet",guess],worktreePath,signal),{base:guess}}catch{}let head=await revParse("HEAD",worktreePath,signal);for(let guess of["main","master"]){let sha=await revParse(guess,worktreePath,signal);if(sha!=null&&sha!==head)return{base:guess,head}}return{base:null,head}}async function revParse(ref,worktreePath,signal){try{let out=(await runGit(["rev-parse","--verify","--quiet",ref],worktreePath,signal)).trim();return out.length>0?out:null}catch{return null}}async function statusFilesBranch(worktreePath,base,signal){let range=`${base}...HEAD`,[nameStatusOut,numstatOut]=await Promise.all([runGit(["diff","--no-color","--name-status",range],worktreePath,signal),runGit(["diff","--no-color","--numstat","-z",range],worktreePath,signal)]),counts=new Map(parseNumstat(numstatOut).map((n)=>[n.path,{added:n.added,deleted:n.deleted}])),entries=[];for(let{status,path}of parseNameStatus(nameStatusOut)){let c=counts.get(path);entries.push({path,status,added:c?.added,deleted:c?.deleted})}return entries}function parseNameStatus(raw){let out=[];for(let rawLine of raw.split(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{getKeychainPassword}from"./chunk-drhwacg1.js";import{LocalExecHost,RemoteExecHost}from"./chunk-wrqv141p.js";import{getRemoteRepoConfig,getRemoteRepos,isRemoteRepoKey}from"./chunk-
|
|
2
|
+
import{getKeychainPassword}from"./chunk-drhwacg1.js";import{LocalExecHost,RemoteExecHost}from"./chunk-wrqv141p.js";import{getRemoteRepoConfig,getRemoteRepos,isRemoteRepoKey}from"./chunk-4csg29es.js";import{homeDir,remoteControlSocketPath}from"./chunk-pzbcbmm4.js";import{existsSync}from"fs";function remoteSpecFromConfig(config){let cfgAuth=config.auth,auth=cfgAuth.kind==="key"?{kind:"key",keyPath:cfgAuth.keyPath}:{kind:"password",getPassword:()=>getKeychainPassword(cfgAuth.keychainRef)};return{host:config.host,user:config.user,port:config.port,auth,controlPath:remoteControlSocketPath(config.host,config.user,config.port)}}var remoteHostCache=new Map;function cachedRemoteHost(config){let spec=remoteSpecFromConfig(config),cached=remoteHostCache.get(spec.controlPath);if(cached)return cached;let host=new RemoteExecHost(spec);return remoteHostCache.set(spec.controlPath,host),host}function execHostForRepo(repoKey){let config=getRemoteRepoConfig(repoKey);if(!config)return new LocalExecHost;return cachedRemoteHost(config)}function execHostForWorktreePath(worktreePath){for(let config of Object.values(getRemoteRepos()))if(worktreePath===config.basePath||worktreePath.startsWith(`${config.basePath}/`))return cachedRemoteHost(config);return new LocalExecHost}function remoteKeyForRepo(repo){return repo&&isRemoteRepoKey(repo)?repo:void 0}function worktreeUsable(worktreePath){return execHostForWorktreePath(worktreePath).isRemote||existsSync(worktreePath)}function localSpawnCwd(worktreePath){return execHostForWorktreePath(worktreePath).isRemote?homeDir():worktreePath}
|
|
3
3
|
export{remoteSpecFromConfig,execHostForRepo,execHostForWorktreePath,remoteKeyForRepo,worktreeUsable,localSpawnCwd};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{booleanFlagsOf,callVerb,errorBody,errorEnvelope,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-
|
|
2
|
+
import{booleanFlagsOf,callVerb,errorBody,errorEnvelope,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-wth84cjn.js";import{VerbArgs,apiUsage,findVerb,normalizeWebArgv,parseFlags,unknownVerbError,validateAgainstSpec,verbHelp}from"./chunk-cjzyc7cn.js";import{ensurePluginEnginesLoaded}from"./chunk-c4c03wnz.js";import{openDaemonSession}from"./chunk-zswn8skz.js";import{requireVerbInstalled,verbInstalled}from"./chunk-z0wnws9w.js";import{AUTO_MACHINE,LOCAL_MACHINE,addStaysHere,forwardVerb,pickMachine,repoHosts,requireMachine,routeTarget,takeIdentityWarning}from"./chunk-t2f0xqyk.js";import{ApiError}from"./chunk-3vm6e0cf.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";import{argvHasFlag}from"./chunk-78y80xe8.js";function takeMachineFlag(argv){let rest=[],machine;for(let i=0;i<argv.length;i++){let arg=argv[i];if(arg==="--machine")machine=argv[i+1],i+=1;else if(arg.startsWith("--machine="))machine=arg.slice(10);else rest.push(arg)}return{machine:machine||void 0,rest}}function forwardParams(verb,flags){if(!flags.has("prompt-file")||!verb.flags.some((f)=>f.name==="prompt"))return Object.fromEntries(flags);let text=new VerbArgs(verb,flags).promptText(),params=Object.fromEntries([...flags].filter(([name])=>name!=="prompt-file"));return text===void 0?params:{...params,prompt:text}}var envelopeMode=!1;function writeJson(value,pretty,stream=process.stdout){stream.write(`${pretty?JSON.stringify(value,null,2):JSON.stringify(value)}
|
|
3
3
|
`)}function emit(value,pretty){let warning=takeIdentityWarning(),payload=warning&&value&&typeof value==="object"&&!Array.isArray(value)?{...value,identityWarning:warning}:value;writeJson(envelopeMode?successEnvelope(payload):payload,pretty)}function fail(message,code,exitCode=1,data){let error=errorBody(new ApiError(message,code,data));if(envelopeMode)writeJson({apiVersion:ROVE_API_VERSION,ok:!1,error},!1);else writeJson({error},!1,process.stderr);process.exit(exitCode)}var USAGE_ERROR_CODES=new Set(["BAD_VERB","UNKNOWN_VERB","BAD_FLAG","MISSING_FLAG","MISSING_VERB","BAD_DAEMON","UNKNOWN_MACHINE"]);async function invokeVerb(verbName,argv,deps){return runVerb(verbName,{argv},deps)}async function runApiSubcommand(argv){let[verbName,...withMachine]=argv,{machine,rest}=takeMachineFlag(withMachine);if(envelopeMode=argvHasFlag(rest,"--envelope"),!verbName||verbName==="--help"||verbName==="-h"||verbName==="help"){if(!verbName)fail(apiUsage(),"MISSING_VERB",2);process.stdout.write(`${apiUsage()}
|
|
4
4
|
`);return}ensurePluginEnginesLoaded();let verb=findVerb(verbName);if(!verb){let err=unknownVerbError(verbName);fail(`${err.message}
|
|
5
|
-
${apiUsage()}`,err.code,2,err.data)}let parsed;try{parsed=parseFlags(
|
|
5
|
+
${apiUsage()}`,err.code,2,err.data)}let parsed;try{let verbArgv=verb.name==="web"?normalizeWebArgv(rest):rest;parsed=parseFlags(verbArgv,booleanFlagsOf(verb),repeatableFlagsOf(verb))}catch(err){if(err instanceof ApiError)fail(err.message,err.code,2,err.data);fail(errorMessage(err),"BAD_FLAG",2)}if(parsed.help){if(!verbInstalled(verb))try{requireVerbInstalled(verb)}catch(err){if(err instanceof ApiError)fail(err.message,err.code,2,err.data)}process.stdout.write(`${verbHelp(verb)}
|
|
6
6
|
`);return}try{validateAgainstSpec(verb,parsed.flags)}catch(err){if(err instanceof ApiError)fail(err.message,err.code,2,err.data);fail(errorMessage(err),"BAD_FLAG",2)}if(machine===AUTO_MACHINE){let picked=await pickMachine(void 0,void 0,repoHosts(forwardParams(verb,parsed.flags))),skipped=picked.skipped?.length?`; not candidates: ${picked.skipped.join(", ")}`:"";process.stderr.write(`rove api: --machine auto \u2192 ${picked.entry?.alias??LOCAL_MACHINE} (load per core: ${Object.entries(picked.loads).map(([name,n])=>`${name} ${n}`).join(", ")}${skipped})
|
|
7
7
|
`);let entry=picked.entry;if(entry&&!keepAddHere(verb,parsed,entry)){await runForwarded(verb,parsed,async()=>entry);return}}else if(machine!==void 0&&machine!==LOCAL_MACHINE){let entry;try{entry=requireMachine(machine)}catch(err){let apiErr=toApiError(err);fail(apiErr.message,apiErr.code,2,apiErr.data)}if(!keepAddHere(verb,parsed,entry)){await runForwarded(verb,parsed,async()=>entry);return}}let session=null;if(!verb.offline)try{session=await openDaemonSession()}catch(err){fail(`could not reach or start the Rove daemon: ${errorMessage(err)}`,"BAD_DAEMON",2,{hint:"check whether the daemon is up (and why it is not), then retry the same command",nextCommandArgs:["daemon","status"]})}let taskId=machine===LOCAL_MACHINE?void 0:parsed.flags.get("task-id"),client=session?.client??null,target=taskId&&client?await machineHolding(taskId,client):null;if(target){session?.close(),await runForwarded(verb,parsed,async()=>target);return}try{let result=await callVerb(verb,parsed.flags,{client:session?.client??null});emit(result,parsed.pretty)}catch(err){if(err instanceof ApiError&&(err.code==="PARTIAL_FANOUT"||err.code==="SKIPPED")){if(envelopeMode)writeJson(errorEnvelope(err),parsed.pretty);else emit(err.data,parsed.pretty);session?.close(),process.exit(3)}let apiErr=toApiError(err);fail(apiErr.message,apiErr.code,USAGE_ERROR_CODES.has(apiErr.code)?2:1,apiErr.data)}finally{session?.close()}}function keepAddHere(verb,parsed,entry){let stays=addStaysHere(verb.name,forwardParams(verb,parsed.flags));if(stays)parsed.flags.set("workspace-on",entry.alias);return parsed.flags.delete("engine-there"),stays}async function machineHolding(taskId,client){try{return await routeTarget({taskId,isLocalTask:async(id)=>{try{return await client.request("task.get",{taskId:id}),!0}catch{return!1}}})}catch(err){let apiErr=toApiError(err);fail(apiErr.message,apiErr.code,1,apiErr.data)}}async function runForwarded(verb,parsed,resolve){let envelope;try{let entry=await resolve();envelope=await forwardVerb(entry,verb.name,forwardParams(verb,parsed.flags))}catch(err){let apiErr=toApiError(err);fail(apiErr.message,apiErr.code,USAGE_ERROR_CODES.has(apiErr.code)?2:1,apiErr.data)}if(envelope.ok){emit(envelope.result,parsed.pretty);return}let{message,code,...data}=envelope.error;if(code==="PARTIAL_FANOUT"||code==="SKIPPED"){if(envelopeMode)writeJson(envelope,parsed.pretty);else emit(data,parsed.pretty);process.exit(3)}fail(message,code,USAGE_ERROR_CODES.has(code)?2:1,data)}export{invokeVerb,runApiSubcommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{engineEntry,identifiableEngineIds}from"./chunk-
|
|
2
|
+
import{engineEntry,identifiableEngineIds}from"./chunk-gxwy1r9a.js";import{existsSync,mkdirSync,readFileSync,readdirSync,writeFileSync}from"fs";import{join,resolve}from"path";import{fileURLToPath}from"url";var ROVE_SKILL_VERSION=145,SKILL_NAME="rove";function bundledSkillDir(){let here=fileURLToPath(import.meta.url);return[resolve(here,"../../../../../.agents/skills/rove"),resolve(here,"../../skills/rove")].find((dir)=>existsSync(join(dir,"SKILL.md")))??null}function parseSkillVersion(content){let m=content.match(/rove-skill-version:\s*(\d+)/);return m?Number.parseInt(m[1],10):null}function readSkillCopy(dir){let text;try{text=readFileSync(join(dir,"SKILL.md"),"utf8")}catch{return{state:"not-installed",version:null}}let version=parseSkillVersion(text);return{state:version!==null&&version>=ROVE_SKILL_VERSION?"installed":"outdated",version}}function engineSkillDir(vendor){let base=engineEntry(vendor).skillsDir?.();return base?join(base,SKILL_NAME):null}function skillTargets(vendors=identifiableEngineIds()){let seen=new Set,out=[];for(let vendor of vendors){let dir=engineSkillDir(vendor);if(!dir||seen.has(dir))continue;seen.add(dir),out.push({vendor,displayName:engineEntry(vendor).displayName,dir,...readSkillCopy(dir)})}return out}function missingSkillNames(installed){return skillTargets(installed).filter((t)=>t.state==="not-installed").map((t)=>t.displayName)}function skillOverview(targets=skillTargets()){return{targets,installed:targets.some((t)=>t.state!=="not-installed"),outdated:targets.filter((t)=>t.state==="outdated")}}function copyTree(src,dest){mkdirSync(dest,{recursive:!0});for(let entry of readdirSync(src,{withFileTypes:!0})){let from=join(src,entry.name),to=join(dest,entry.name);if(entry.isDirectory())copyTree(from,to);else writeFileSync(to,readFileSync(from))}}function installSkill(targets,source=bundledSkillDir()){if(!source)throw Error("this Rove build ships no bundled skill");return targets.map((target)=>{try{return copyTree(source,target.dir),{target,error:null}}catch(error){return{target,error:error instanceof Error?error.message:String(error)}}})}function refreshOutdatedSkills(source=bundledSkillDir()){let outdated=skillOverview().outdated;if(outdated.length===0||!source)return[];return installSkill(outdated,source)}function installSkillErrors(source=bundledSkillDir()){try{let failed=installSkill(skillTargets().filter((t)=>t.state!=="installed"),source).filter((r)=>r.error);return failed.length===0?null:failed.map((r)=>`${r.target.displayName}: ${r.error}`).join("; ")}catch(error){return error instanceof Error?error.message:String(error)}}function installedSkillDiffersFromBundled(dir){let bundled=bundledSkillDir();if(!bundled)return!1;try{return readFileSync(join(bundled,"SKILL.md"),"utf8")!==readFileSync(join(dir,"SKILL.md"),"utf8")}catch{return!1}}
|
|
3
3
|
export{bundledSkillDir,readSkillCopy,engineSkillDir,skillTargets,missingSkillNames,skillOverview,installSkill,refreshOutdatedSkills,installSkillErrors,installedSkillDiffersFromBundled};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{parsePorcelain,pickPushedChanges,readWorktreeChanges,sameWorktreeChanges}from"./chunk-emzt8crt.js";import"./chunk-fxpbaff2.js";import"./chunk-dmzg9zdc.js";import"./chunk-h8qg9v95.js";import"./chunk-9k0r47z3.js";import"./chunk-91sykzqq.js";export{sameWorktreeChanges,readWorktreeChanges,pickPushedChanges,parsePorcelain};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{isJsonlLineWithinBound,readTextFileIfRegular}from"./chunk-bzqjk9fb.js";import{isObject}from"./chunk-a6z2ggxd.js";import{resolveProductHomeDir}from"./chunk-pzbcbmm4.js";var ACP_PROTOCOL_VERSION=1;function extractAcpText(content){if(typeof content==="string")return content;if(!isObject(content))return"";if(typeof content.text==="string")return content.text;if(content.type==="diff"&&typeof content.path==="string"){let newText=typeof content.newText==="string"?content.newText:"";return newText?`${content.path}
|
|
3
|
+
${newText}`:content.path}if(isObject(content.content)&&typeof content.content.text==="string")return content.content.text;return""}function isEmptyPlainObject(value){return isObject(value)&&!Array.isArray(value)&&Object.keys(value).length===0}function extractAcpToolOutput(update){let hasContent=Array.isArray(update.content)?update.content.length>0:update.content!==void 0&&update.content!=="";if(update.rawOutput!==void 0&&!(hasContent&&isEmptyPlainObject(update.rawOutput)))return update.rawOutput;if(update.output!==void 0&&!(hasContent&&isEmptyPlainObject(update.output)))return update.output;if(update.result!==void 0&&!(hasContent&&isEmptyPlainObject(update.result)))return update.result;if(Array.isArray(update.content)){let texts=update.content.map(extractAcpText).filter((t)=>t.length>0);if(texts.length>0)return texts.join(`
|
|
4
|
+
`);return update.content}if(update.content!==void 0)return extractAcpText(update.content)||update.content;return update.rawOutput??""}function activityFromAcpStopReason(stopReason){if(stopReason==="cancelled")return"turn-interrupted";if(stopReason==="error")return"turn-failed";return"turn-complete"}function activityFromAcpUpdate(update){if(update.sessionUpdate==="tool_call"){let call=update;return{kind:"tool-pre",detail:{tool:{...call.name||call.title?{name:call.name??call.title}:{},...call.toolCallId?{id:call.toolCallId}:{}}}}}if(update.sessionUpdate==="tool_call_update"){let progress=update;if(progress.status!=="completed"&&progress.status!=="failed")return null;return{kind:progress.status==="failed"?"tool-failed":"tool-post",detail:{tool:{...progress.name||progress.title?{name:progress.name??progress.title}:{},...progress.toolCallId?{id:progress.toolCallId}:{}}}}}return null}function parseJsonLine(line){if(!isJsonlLineWithinBound(line))return null;let trimmed=line.trim();if(!trimmed)return null;try{let parsed=JSON.parse(trimmed);return isObject(parsed)?parsed:null}catch{return null}}function parseAcpJsonl(raw){let records=[];for(let line of raw.split(`
|
|
5
|
+
`)){let obj=parseJsonLine(line);if(!obj||typeof obj.type!=="string")continue;if(obj.type==="session_meta"&&typeof obj.sessionId==="string"&&typeof obj.cwd==="string")records.push({type:"session_meta",sessionId:obj.sessionId,cwd:obj.cwd,...typeof obj.agentName==="string"?{agentName:obj.agentName}:{},...typeof obj.agentVersion==="string"?{agentVersion:obj.agentVersion}:{},timestamp:typeof obj.timestamp==="string"?obj.timestamp:""});else if(obj.type==="user_message"&&typeof obj.text==="string")records.push({type:"user_message",text:obj.text,timestamp:typeof obj.timestamp==="string"?obj.timestamp:""});else if(obj.type==="session_update"&&isObject(obj.update)&&typeof obj.update.sessionUpdate==="string")records.push({type:"session_update",update:obj.update,timestamp:typeof obj.timestamp==="string"?obj.timestamp:""});else if(obj.type==="turn_end"&&typeof obj.stopReason==="string")records.push({type:"turn_end",stopReason:obj.stopReason,...typeof obj.error==="string"?{error:obj.error}:{},timestamp:typeof obj.timestamp==="string"?obj.timestamp:""})}return records}function normalizeAcpRecords(records,sessionId){let messages=[],assistant=null,userText="",userAt="",flushUser=()=>{if(!userText)return;messages.push({role:"user",blocks:[{type:"text",text:userText}],timestamp:userAt,sessionId}),userText="",userAt=""},flushAssistant=()=>{if(!assistant||assistant.blocks.length===0){assistant=null;return}messages.push({role:"assistant",blocks:assistant.blocks,timestamp:assistant.timestamp,sessionId}),assistant=null},ensureAssistant=(timestamp)=>{if(flushUser(),!assistant)assistant={timestamp,blocks:[],toolIndex:new Map};if(!assistant.timestamp&×tamp)assistant.timestamp=timestamp;return assistant},appendTextBlock=(target,type,delta)=>{if(!delta)return;let last=target.blocks[target.blocks.length-1];if(last&&last.type===type)target.blocks[target.blocks.length-1]={type,text:last.text+delta};else target.blocks.push({type,text:delta})};for(let record of records){if(record.type==="session_meta")continue;if(record.type==="user_message"){if(flushAssistant(),flushUser(),record.text.length>0)messages.push({role:"user",blocks:[{type:"text",text:record.text}],timestamp:record.timestamp,sessionId});continue}if(record.type==="turn_end"){if(flushUser(),flushAssistant(),record.error)messages.push({role:"system",blocks:[{type:"text",text:record.error}],timestamp:record.timestamp,sessionId});continue}let{update,timestamp}=record;if(update.sessionUpdate==="user_message_chunk"){flushAssistant();let delta=extractAcpText(update.content);if(delta){if(!userAt)userAt=timestamp;userText+=delta}continue}if(update.sessionUpdate==="agent_message_chunk"){appendTextBlock(ensureAssistant(timestamp),"text",extractAcpText(update.content));continue}if(update.sessionUpdate==="agent_thought_chunk"){appendTextBlock(ensureAssistant(timestamp),"thinking",extractAcpText(update.content));continue}if(update.sessionUpdate==="tool_call"){let call=update,target=ensureAssistant(timestamp),callId=call.toolCallId||`acp-call-${target.blocks.length}`,name=call.name??call.title??call.kind??"tool",input=call.rawInput??call.input??(call.title&&call.name?call.title:{}),existing=target.toolIndex.get(callId),block={type:"tool_call",callId,name,input};if(existing!==void 0)target.blocks[existing]=block;else target.toolIndex.set(callId,target.blocks.length),target.blocks.push(block);continue}if(update.sessionUpdate==="tool_call_update"){let progress=update,target=ensureAssistant(timestamp),callId=progress.toolCallId;if(!callId)continue;let existing=target.toolIndex.get(callId);if(existing!==void 0){let prev=target.blocks[existing];if(prev&&prev.type==="tool_call"){let nextName=progress.name??progress.title??prev.name,nextInput=progress.rawInput!==void 0?progress.rawInput:prev.input;target.blocks[existing]={type:"tool_call",callId,name:nextName,input:nextInput}}}else if(progress.name||progress.title)target.toolIndex.set(callId,target.blocks.length),target.blocks.push({type:"tool_call",callId,name:progress.name??progress.title??"tool",input:progress.rawInput??{}});if(progress.status==="completed"||progress.status==="failed")target.blocks.push({type:"tool_result",callId,output:extractAcpToolOutput(progress),isError:progress.status==="failed"})}}return flushUser(),flushAssistant(),messages}function latestAcpCompletionMarkerFromJsonl(raw,sourceId="acp",fallbackMtimeMs=0){let latest=null,lineNo=0;for(let line of raw.split(`
|
|
6
|
+
`)){lineNo++;let obj=parseJsonLine(line);if(!obj||obj.type!=="turn_end")continue;let ts=typeof obj.timestamp==="string"?Date.parse(obj.timestamp):Number.NaN,timestampMs=Number.isFinite(ts)?ts:fallbackMtimeMs,marker={id:`acp:${sourceId}:${timestampMs}:${lineNo}`,timestampMs,source:"acp"};if(!latest||marker.timestampMs>=latest.timestampMs)latest=marker}return latest}import{appendFileSync,mkdirSync,realpathSync}from"fs";import{readdir,realpath,stat}from"fs/promises";import{join}from"path";function acpSessionsRoot(homeDir){return join(homeDir??resolveProductHomeDir(),".rove","acp-sessions")}function canonicalWorktreeSync(worktree){try{return realpathSync(worktree)}catch{return worktree}}function encodeAcpWorktree(worktree){return canonicalWorktreeSync(worktree).replace(/[^A-Za-z0-9._-]/g,"_")}function safeSessionId(sessionId){return sessionId.replace(/[^A-Za-z0-9._-]/g,"_")}function acpSessionFilePath(worktree,sessionId,homeDir){return join(acpSessionsRoot(homeDir),encodeAcpWorktree(worktree),`${safeSessionId(sessionId)}.jsonl`)}function appendAcpTranscriptRecord(worktree,sessionId,record,homeDir){let dir=join(acpSessionsRoot(homeDir),encodeAcpWorktree(worktree));mkdirSync(dir,{recursive:!0,mode:448});let file=join(dir,`${safeSessionId(sessionId)}.jsonl`);return appendFileSync(file,`${JSON.stringify(record)}
|
|
7
|
+
`,{encoding:"utf8",mode:384}),file}async function listAcpSessionFilesForWorktree(worktree,homeDir){if(!worktree)return[];let resolved=await realpath(worktree).catch(()=>worktree),dir=join(acpSessionsRoot(homeDir),resolved.replace(/[^A-Za-z0-9._-]/g,"_")),entries;try{entries=await readdir(dir)}catch{return[]}let files=[];for(let name of entries){if(!name.endsWith(".jsonl"))continue;let filePath=join(dir,name),info=await stat(filePath).catch(()=>null);if(!info?.isFile())continue;files.push({sessionId:name.slice(0,-6),path:filePath,mtimeMs:info.mtimeMs})}return files.sort((a,b)=>a.mtimeMs-b.mtimeMs)}async function findAcpSessionFile(sessionId,homeDir){if(!sessionId)return null;let root=acpSessionsRoot(homeDir),target=`${safeSessionId(sessionId)}.jsonl`,dirs;try{dirs=await readdir(root)}catch{return null}for(let bucket of dirs){let candidate=join(root,bucket,target);if((await stat(candidate).catch(()=>null))?.isFile())return candidate}return null}async function readAcpHistory(sessionId,homeDir){let file=await findAcpSessionFile(sessionId,homeDir);if(!file)return[];let raw=await readTextFileIfRegular(file);if(raw===null)return[];return normalizeAcpRecords(parseAcpJsonl(raw),sessionId)}function acpHistoryReaderFor(homeDir){return{async listSessionIdsForWorktree(worktree){return(await listAcpSessionFilesForWorktree(worktree,homeDir)).map((f)=>f.sessionId)},readHistory:(sessionId)=>readAcpHistory(sessionId,homeDir),async transcriptPath(sessionId,worktree){if(worktree){let direct=acpSessionFilePath(worktree,sessionId,homeDir);if((await stat(direct).catch(()=>null))?.isFile())return direct}return findAcpSessionFile(sessionId,homeDir)},async latestTranscriptMtimeForWorktree(worktree){let files=await listAcpSessionFilesForWorktree(worktree,homeDir);return files[files.length-1]?.mtimeMs??0}}}var acpHistoryReader=acpHistoryReaderFor();class AcpTurnDetector{homeDir;vendor="acp";cache=new Map;constructor(homeDir){this.homeDir=homeDir}supportsCompletionMarkers(){return!0}async latestCompletion(worktree){return(await this.latestActivity(worktree)).marker}async scanFile(filePath){let info=await stat(filePath).catch(()=>null);if(!info?.isFile())return this.cache.delete(filePath),null;let key=`${info.dev}:${info.ino}:${info.size}:${info.mtimeMs}:${info.ctimeMs}`,hit=this.cache.get(filePath);if(hit?.key===key)return hit.scan;let raw=await readTextFileIfRegular(filePath);if(raw===null)return this.cache.delete(filePath),null;let scan={marker:latestAcpCompletionMarkerFromJsonl(raw,filePath,info.mtimeMs),mtimeMs:info.mtimeMs};if(this.cache.delete(filePath),this.cache.set(filePath,{key,scan}),this.cache.size>8){let oldest=this.cache.keys().next().value;if(oldest!==void 0)this.cache.delete(oldest)}return scan}async latestActivity(worktree){let files=await listAcpSessionFilesForWorktree(worktree,this.homeDir),mtimeMs=files[files.length-1]?.mtimeMs??0,latest=null;for(let file of files.slice(-4).reverse()){let marker=(await this.scanFile(file.path))?.marker;if(marker&&(!latest||marker.timestampMs>latest.timestampMs))latest=marker}return{marker:latest,mtimeMs}}latestActivityInFile(transcriptPath){return this.scanFile(transcriptPath)}}
|
|
8
|
+
export{ACP_PROTOCOL_VERSION,extractAcpText,activityFromAcpStopReason,activityFromAcpUpdate,acpSessionFilePath,appendAcpTranscriptRecord,acpHistoryReader,AcpTurnDetector};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{createStateCell}from"./chunk-7b2x6nkj.js";import{CATALOGS,DEFAULT_LOCALE,LOCALES}from"./chunk-
|
|
2
|
+
import{createStateCell}from"./chunk-7b2x6nkj.js";import{CATALOGS,DEFAULT_LOCALE,LOCALES}from"./chunk-3fzrgjxr.js";function lookup(catalog,key){let node=catalog;for(let part of key.split("."))if(node&&typeof node==="object"&&part in node)node=node[part];else return;return typeof node==="string"?node:void 0}function interpolate(template,params){if(!params)return template;return template.replace(/\{(\w+)\}/g,(whole,name)=>(name in params)?String(params[name]):whole)}function lookupKeys(catalog,group,key){return catalog.keys[group]?.[key]}var langState=createStateCell(DEFAULT_LOCALE);function setLocaleLang(lang){if(CATALOGS[lang])langState.set(lang)}function currentLang(){return langState.get()}function intlLocale(){return LOCALES.find((locale)=>locale.id===langState.get())?.intl??"en-US"}function localeState(){return langState}var pluginNamespaces=new Set;function registerMessages(namespace,messages){let en=CATALOGS.en,zh=CATALOGS.zh;if(namespace in en&&!pluginNamespaces.has(namespace))throw Error(`i18n namespace "${namespace}" belongs to the host`);if(pluginNamespaces.add(namespace),en[namespace]=messages.en,messages.zh)zh[namespace]=messages.zh;else delete zh[namespace]}function t(key,params){let lang=langState.get(),resolved=lookup(CATALOGS[lang],key)??lookup(CATALOGS.en,key)??key;return interpolate(resolved,params)}function tKeys(group,key){let lang=langState.get();return lookupKeys(CATALOGS[lang],group,key)??lookupKeys(CATALOGS.en,group,key)??key}
|
|
3
3
|
export{setLocaleLang,currentLang,intlLocale,localeState,registerMessages,t,tKeys};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{existsSync}from"fs";import{join}from"path";function webRoot(){return[join(import.meta.dir,"..","web"),join(import.meta.dir,"..","..","..","rove-web","dist")].find((dir)=>existsSync(join(dir,"index.html")))??null}async function runWebSubcommand(args){let{webServiceCommand}=await import("./chunk-
|
|
2
|
+
import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{existsSync}from"fs";import{join}from"path";function webRoot(){return[join(import.meta.dir,"..","web"),join(import.meta.dir,"..","..","..","rove-web","dist")].find((dir)=>existsSync(join(dir,"index.html")))??null}async function runWebSubcommand(args){let{webServiceCommand}=await import("./chunk-3d6caevx.js");try{if(await webServiceCommand(args))return}catch(err){console.error(`${ROVE_PRODUCT_NAME} --web: ${err instanceof Error?err.message:String(err)}`),process.exit(2)}let root=webRoot();if(!root)console.error(`${ROVE_PRODUCT_NAME} --web: the browser client is not in this build. From a checkout, run \`bun --filter rove-web build\` first; the npm package ships it in dist/web.`),process.exit(2);let{runBridge}=await import("./chunk-kzcd7vdj.js");await runBridge(args,{name:`${ROVE_PRODUCT_NAME} --web`,web:{root}})}export{runWebSubcommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{getKeychainPassword,isKeychainSupported,remoteKeychainRef,setKeychainPassword}from"./chunk-drhwacg1.js";import{RemoteExecHost}from"./chunk-wrqv141p.js";import{addRemoteRepo,isRemoteProjectsEnabled}from"./chunk-
|
|
2
|
+
import{getKeychainPassword,isKeychainSupported,remoteKeychainRef,setKeychainPassword}from"./chunk-drhwacg1.js";import{RemoteExecHost}from"./chunk-wrqv141p.js";import"./chunk-w70anvs6.js";import{addRemoteRepo,isRemoteProjectsEnabled}from"./chunk-4csg29es.js";import"./chunk-h8qg9v95.js";import{errorMessage}from"./chunk-0zs13rdq.js";import"./chunk-1wpwxcg9.js";import"./chunk-12qq8r81.js";import"./chunk-ptyqj15s.js";import"./chunk-pn5ygqn6.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import"./chunk-gvxchzch.js";import{remoteControlSocketPath}from"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";import{createInterface}from"readline";var CLI_NAME=ROVE_PRODUCT_NAME,USAGE=`Usage: ${CLI_NAME} add --remote --host <host> --user <user> --path <basePath>
|
|
3
3
|
[--port N] [--key [path] | --password]
|
|
4
4
|
|
|
5
5
|
Register an experimental SSH-backed project. Worktrees are created on <host>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{writeOutdatedCache}from"./chunk-498t9sjd.js";import{PluginCliError,installPlugin}from"./chunk-
|
|
2
|
+
import{writeOutdatedCache}from"./chunk-498t9sjd.js";import{PluginCliError,installPlugin}from"./chunk-kmfas00z.js";import{loadPluginRegistry,removePluginEntry,savePluginRegistry}from"./chunk-bwgtbaex.js";import{pluginCheckoutDir,pluginConfigDir,pluginDataDir,pluginStateDir}from"./chunk-ws2q07kb.js";import"./chunk-w7zv47mp.js";import"./chunk-96kvwzj8.js";import"./chunk-aterhn60.js";import"./chunk-yt15y085.js";import"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";import{execFileSync}from"child_process";import{existsSync,mkdirSync,readdirSync,renameSync}from"fs";import{join}from"path";function gitOut(args,cwd){try{return execFileSync("git",args,{cwd,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return null}}function checkEntry(entry){let repoSpec=entry.source.spec.split("/").slice(0,2).join("/"),localSha=gitOut(["rev-parse","HEAD"],pluginCheckoutDir(entry.id)),remote=gitOut(["ls-remote",`https://github.com/${repoSpec}.git`,"HEAD"]),remoteSha=remote?remote.split(/\s+/)[0]??null:null;return{id:entry.id,spec:entry.source.spec,version:entry.version,localSha,remoteSha,behind:Boolean(localSha&&remoteSha&&localSha!==remoteSha)}}function listOutdated(){let rows=loadPluginRegistry().plugins.filter((p)=>p.source.kind==="github").map(checkEntry);return writeOutdatedCache(rows.filter((r)=>r.behind).map((r)=>r.id)),rows}function printOutdated(){let rows=listOutdated();if(rows.length===0){console.log("no GitHub-installed plugins.");return}for(let r of rows){let status=r.behind?"update available":r.remoteSha===null?"remote unreachable":r.localSha===null?"local sha unreadable":"up to date";console.log(`${r.id} v${r.version} ${status}`)}}function migrateRenamedPlugin(oldId,newId){for(let dirOf of[pluginConfigDir,pluginStateDir]){let from=dirOf(oldId),to=dirOf(newId);if(!existsSync(from))continue;mkdirSync(to,{recursive:!0});for(let entry of readdirSync(from)){if(existsSync(join(to,entry)))continue;renameSync(join(from,entry),join(to,entry))}}savePluginRegistry(removePluginEntry(loadPluginRegistry(),oldId)),console.log(`renamed ${oldId} \u2192 ${newId}: settings and state carried over, old entry unregistered`),console.log(` leftover checkout (safe to remove): ${pluginDataDir(oldId)}`)}async function updatePlugins(ids,opts){let rows=listOutdated(),targets;if(opts.all){if(targets=rows.filter((r)=>r.behind),targets.length===0){console.log("all plugins up to date.");return}}else{if(ids.length===0)throw new PluginCliError("update takes plugin ids or --all");targets=ids.map((id)=>{let row=rows.find((r)=>r.id===id);if(!row)throw new PluginCliError(`\`${id}\` is not a GitHub-installed plugin; see \`${ROVE_PRODUCT_NAME} plugin list\``);return row})}for(let target of targets){if(!target.behind&&!ids.includes(target.id))continue;console.log(`updating ${target.id} (${target.spec})\u2026`);let installedId=await installPlugin(target.spec,{yes:opts.yes});if(installedId!==target.id)migrateRenamedPlugin(target.id,installedId)}listOutdated()}export{updatePlugins,printOutdated};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{machineTasks}from"./chunk-t2f0xqyk.js";import"./chunk-y0e28qha.js";import"./chunk-76snhsy7.js";import"./chunk-wjmte4f0.js";import"./chunk-3vm6e0cf.js";import"./chunk-wrqv141p.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import{dedupeMachines,listMachines}from"./chunk-navavqt2.js";import"./chunk-w70anvs6.js";import"./chunk-4csg29es.js";import"./chunk-h8qg9v95.js";import"./chunk-0zs13rdq.js";import"./chunk-1wpwxcg9.js";import"./chunk-06cpc990.js";import"./chunk-xc2zndmb.js";import"./chunk-zpwg3eh0.js";import"./chunk-vpy8tvfy.js";import"./chunk-96kvwzj8.js";import"./chunk-12qq8r81.js";import"./chunk-ptyqj15s.js";import"./chunk-4y536nwm.js";import"./chunk-pn5ygqn6.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import"./chunk-gvxchzch.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";async function mergeTaskList(local){let machines=dedupeMachines(listMachines());if(machines.length===0)return local;let tasks=(local.tasks??[]).map((task)=>({...task,origin:{machineId:"local",hostLabel:"local"}}));for(let entry of machines){let remote=await machineTasks(entry);if(!remote)continue;let hostLabel=entry.alias;for(let task of remote){let kind=task.kind==="main"?"dir":task.kind;tasks.push({...task,kind,origin:{machineId:entry.alias,hostLabel}})}}return{tasks}}export{mergeTaskList};
|