@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{errorMessage}from"./chunk-0zs13rdq.js";import{loadStateFile}from"./chunk-12qq8r81.js";import{createStateCell}from"./chunk-7b2x6nkj.js";import{isObject}from"./chunk-a6z2ggxd.js";import{isDev,keybindingsConfigPath}from"./chunk-pzbcbmm4.js";import{__commonJS,__require}from"./chunk-91sykzqq.js";var require_identity=__commonJS((exports)=>{var ALIAS=Symbol.for("yaml.alias"),DOC=Symbol.for("yaml.document"),MAP=Symbol.for("yaml.map"),PAIR=Symbol.for("yaml.pair"),SCALAR=Symbol.for("yaml.scalar"),SEQ=Symbol.for("yaml.seq"),NODE_TYPE=Symbol.for("yaml.node.type"),isAlias=(node)=>!!node&&typeof node==="object"&&node[NODE_TYPE]===ALIAS,isDocument=(node)=>!!node&&typeof node==="object"&&node[NODE_TYPE]===DOC,isMap=(node)=>!!node&&typeof node==="object"&&node[NODE_TYPE]===MAP,isPair=(node)=>!!node&&typeof node==="object"&&node[NODE_TYPE]===PAIR,isScalar=(node)=>!!node&&typeof node==="object"&&node[NODE_TYPE]===SCALAR,isSeq=(node)=>!!node&&typeof node==="object"&&node[NODE_TYPE]===SEQ;function isCollection(node){if(node&&typeof node==="object")switch(node[NODE_TYPE]){case MAP:case SEQ:return!0}return!1}function isNode(node){if(node&&typeof node==="object")switch(node[NODE_TYPE]){case ALIAS:case MAP:case SCALAR:case SEQ:return!0}return!1}var hasAnchor=(node)=>(isScalar(node)||isCollection(node))&&!!node.anchor;exports.ALIAS=ALIAS;exports.DOC=DOC;exports.MAP=MAP;exports.NODE_TYPE=NODE_TYPE;exports.PAIR=PAIR;exports.SCALAR=SCALAR;exports.SEQ=SEQ;exports.hasAnchor=hasAnchor;exports.isAlias=isAlias;exports.isCollection=isCollection;exports.isDocument=isDocument;exports.isMap=isMap;exports.isNode=isNode;exports.isPair=isPair;exports.isScalar=isScalar;exports.isSeq=isSeq});var require_visit=__commonJS((exports)=>{var identity=require_identity(),BREAK=Symbol("break visit"),SKIP=Symbol("skip children"),REMOVE=Symbol("remove node");function visit(node,visitor){let visitor_=initVisitor(visitor);if(identity.isDocument(node)){if(visit_(null,node.contents,visitor_,Object.freeze([node]))===REMOVE)node.contents=null}else visit_(null,node,visitor_,Object.freeze([]))}visit.BREAK=BREAK;visit.SKIP=SKIP;visit.REMOVE=REMOVE;function visit_(key,node,visitor,path){let ctrl=callVisitor(key,node,visitor,path);if(identity.isNode(ctrl)||identity.isPair(ctrl))return replaceNode(key,path,ctrl),visit_(key,ctrl,visitor,path);if(typeof ctrl!=="symbol"){if(identity.isCollection(node)){path=Object.freeze(path.concat(node));for(let i=0;i<node.items.length;++i){let ci=visit_(i,node.items[i],visitor,path);if(typeof ci==="number")i=ci-1;else if(ci===BREAK)return BREAK;else if(ci===REMOVE)node.items.splice(i,1),i-=1}}else if(identity.isPair(node)){path=Object.freeze(path.concat(node));let ck=visit_("key",node.key,visitor,path);if(ck===BREAK)return BREAK;else if(ck===REMOVE)node.key=null;let cv=visit_("value",node.value,visitor,path);if(cv===BREAK)return BREAK;else if(cv===REMOVE)node.value=null}}return ctrl}async function visitAsync(node,visitor){let visitor_=initVisitor(visitor);if(identity.isDocument(node)){if(await visitAsync_(null,node.contents,visitor_,Object.freeze([node]))===REMOVE)node.contents=null}else await visitAsync_(null,node,visitor_,Object.freeze([]))}visitAsync.BREAK=BREAK;visitAsync.SKIP=SKIP;visitAsync.REMOVE=REMOVE;async function visitAsync_(key,node,visitor,path){let ctrl=await callVisitor(key,node,visitor,path);if(identity.isNode(ctrl)||identity.isPair(ctrl))return replaceNode(key,path,ctrl),visitAsync_(key,ctrl,visitor,path);if(typeof ctrl!=="symbol"){if(identity.isCollection(node)){path=Object.freeze(path.concat(node));for(let i=0;i<node.items.length;++i){let ci=await visitAsync_(i,node.items[i],visitor,path);if(typeof ci==="number")i=ci-1;else if(ci===BREAK)return BREAK;else if(ci===REMOVE)node.items.splice(i,1),i-=1}}else if(identity.isPair(node)){path=Object.freeze(path.concat(node));let ck=await visitAsync_("key",node.key,visitor,path);if(ck===BREAK)return BREAK;else if(ck===REMOVE)node.key=null;let cv=await visitAsync_("value",node.value,visitor,path);if(cv===BREAK)return BREAK;else if(cv===REMOVE)node.value=null}}return ctrl}function initVisitor(visitor){if(typeof visitor==="object"&&(visitor.Collection||visitor.Node||visitor.Value))return Object.assign({Alias:visitor.Node,Map:visitor.Node,Scalar:visitor.Node,Seq:visitor.Node},visitor.Value&&{Map:visitor.Value,Scalar:visitor.Value,Seq:visitor.Value},visitor.Collection&&{Map:visitor.Collection,Seq:visitor.Collection},visitor);return visitor}function callVisitor(key,node,visitor,path){if(typeof visitor==="function")return visitor(key,node,path);if(identity.isMap(node))return visitor.Map?.(key,node,path);if(identity.isSeq(node))return visitor.Seq?.(key,node,path);if(identity.isPair(node))return visitor.Pair?.(key,node,path);if(identity.isScalar(node))return visitor.Scalar?.(key,node,path);if(identity.isAlias(node))return visitor.Alias?.(key,node,path);return}function replaceNode(key,path,node){let parent=path[path.length-1];if(identity.isCollection(parent))parent.items[key]=node;else if(identity.isPair(parent))if(key==="key")parent.key=node;else parent.value=node;else if(identity.isDocument(parent))parent.contents=node;else{let pt=identity.isAlias(parent)?"alias":"scalar";throw Error(`Cannot replace node with ${pt} parent`)}}exports.visit=visit;exports.visitAsync=visitAsync});var require_directives=__commonJS((exports)=>{var identity=require_identity(),visit=require_visit(),escapeChars={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},escapeTagName=(tn)=>tn.replace(/[!,[\]{}]/g,(ch)=>escapeChars[ch]);class Directives{constructor(yaml,tags){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Directives.defaultYaml,yaml),this.tags=Object.assign({},Directives.defaultTags,tags)}clone(){let copy=new Directives(this.yaml,this.tags);return copy.docStart=this.docStart,copy}atDocument(){let res=new Directives(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Directives.defaultTags);break}return res}add(line,onError){if(this.atNextDocument)this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Directives.defaultTags),this.atNextDocument=!1;let parts=line.trim().split(/[ \t]+/),name=parts.shift();switch(name){case"%TAG":{if(parts.length!==2){if(onError(0,"%TAG directive should contain exactly two parts"),parts.length<2)return!1}let[handle,prefix]=parts;return this.tags[handle]=prefix,!0}case"%YAML":{if(this.yaml.explicit=!0,parts.length!==1)return onError(0,"%YAML directive should contain exactly one part"),!1;let[version]=parts;if(version==="1.1"||version==="1.2")return this.yaml.version=version,!0;else{let isValid=/^\d+\.\d+$/.test(version);return onError(6,`Unsupported YAML version ${version}`,isValid),!1}}default:return onError(0,`Unknown directive ${name}`,!0),!1}}tagName(source,onError){if(source==="!")return"!";if(source[0]!=="!")return onError(`Not a valid tag: ${source}`),null;if(source[1]==="<"){let verbatim=source.slice(2,-1);if(verbatim==="!"||verbatim==="!!")return onError(`Verbatim tags aren't resolved, so ${source} is invalid.`),null;if(source[source.length-1]!==">")onError("Verbatim tags must end with a >");return verbatim}let[,handle,suffix]=source.match(/^(.*!)([^!]*)$/s);if(!suffix)onError(`The ${source} tag has no suffix`);let prefix=this.tags[handle];if(prefix)try{return prefix+decodeURIComponent(suffix)}catch(error){return onError(String(error)),null}if(handle==="!")return source;return onError(`Could not resolve tag: ${source}`),null}tagString(tag){for(let[handle,prefix]of Object.entries(this.tags))if(tag.startsWith(prefix))return handle+escapeTagName(tag.substring(prefix.length));return tag[0]==="!"?tag:`!<${tag}>`}toString(doc){let lines=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],tagEntries=Object.entries(this.tags),tagNames;if(doc&&tagEntries.length>0&&identity.isNode(doc.contents)){let tags={};visit.visit(doc.contents,(_key,node)=>{if(identity.isNode(node)&&node.tag)tags[node.tag]=!0}),tagNames=Object.keys(tags)}else tagNames=[];for(let[handle,prefix]of tagEntries){if(handle==="!!"&&prefix==="tag:yaml.org,2002:")continue;if(!doc||tagNames.some((tn)=>tn.startsWith(prefix)))lines.push(`%TAG ${handle} ${prefix}`)}return lines.join(`
|
|
3
3
|
`)}}Directives.defaultYaml={explicit:!1,version:"1.2"};Directives.defaultTags={"!!":"tag:yaml.org,2002:"};exports.Directives=Directives});var require_anchors=__commonJS((exports)=>{var identity=require_identity(),visit=require_visit();function anchorIsValid(anchor){if(/[\x00-\x19\s,[\]{}]/.test(anchor)){let msg=`Anchor must not contain whitespace or control characters: ${JSON.stringify(anchor)}`;throw Error(msg)}return!0}function anchorNames(root){let anchors=new Set;return visit.visit(root,{Value(_key,node){if(node.anchor)anchors.add(node.anchor)}}),anchors}function findNewAnchor(prefix,exclude){for(let i=1;;++i){let name=`${prefix}${i}`;if(!exclude.has(name))return name}}function createNodeAnchors(doc,prefix){let aliasObjects=[],sourceObjects=new Map,prevAnchors=null;return{onAnchor:(source)=>{aliasObjects.push(source),prevAnchors??(prevAnchors=anchorNames(doc));let anchor=findNewAnchor(prefix,prevAnchors);return prevAnchors.add(anchor),anchor},setAnchors:()=>{for(let source of aliasObjects){let ref=sourceObjects.get(source);if(typeof ref==="object"&&ref.anchor&&(identity.isScalar(ref.node)||identity.isCollection(ref.node)))ref.node.anchor=ref.anchor;else{let error=Error("Failed to resolve repeated object (this should not happen)");throw error.source=source,error}}},sourceObjects}}exports.anchorIsValid=anchorIsValid;exports.anchorNames=anchorNames;exports.createNodeAnchors=createNodeAnchors;exports.findNewAnchor=findNewAnchor});var require_applyReviver=__commonJS((exports)=>{function applyReviver(reviver,obj,key,val){if(val&&typeof val==="object")if(Array.isArray(val))for(let i=0,len=val.length;i<len;++i){let v0=val[i],v1=applyReviver(reviver,val,String(i),v0);if(v1===void 0)delete val[i];else if(v1!==v0)val[i]=v1}else if(val instanceof Map)for(let k of Array.from(val.keys())){let v0=val.get(k),v1=applyReviver(reviver,val,k,v0);if(v1===void 0)val.delete(k);else if(v1!==v0)val.set(k,v1)}else if(val instanceof Set)for(let v0 of Array.from(val)){let v1=applyReviver(reviver,val,v0,v0);if(v1===void 0)val.delete(v0);else if(v1!==v0)val.delete(v0),val.add(v1)}else for(let[k,v0]of Object.entries(val)){let v1=applyReviver(reviver,val,k,v0);if(v1===void 0)delete val[k];else if(v1!==v0)val[k]=v1}return reviver.call(obj,key,val)}exports.applyReviver=applyReviver});var require_toJS=__commonJS((exports)=>{var identity=require_identity();function toJS(value,arg,ctx){if(Array.isArray(value))return value.map((v,i)=>toJS(v,String(i),ctx));if(value&&typeof value.toJSON==="function"){if(!ctx||!identity.hasAnchor(value))return value.toJSON(arg,ctx);let data={aliasCount:0,count:1,res:void 0};ctx.anchors.set(value,data),ctx.onCreate=(res2)=>{data.res=res2,delete ctx.onCreate};let res=value.toJSON(arg,ctx);if(ctx.onCreate)ctx.onCreate(res);return res}if(typeof value==="bigint"&&!ctx?.keep)return Number(value);return value}exports.toJS=toJS});var require_Node=__commonJS((exports)=>{var applyReviver=require_applyReviver(),identity=require_identity(),toJS=require_toJS();class NodeBase{constructor(type){Object.defineProperty(this,identity.NODE_TYPE,{value:type})}clone(){let copy=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)copy.range=this.range.slice();return copy}toJS(doc,{mapAsMap,maxAliasCount,onAnchor,reviver}={}){if(!identity.isDocument(doc))throw TypeError("A document argument is required");let ctx={anchors:new Map,doc,keep:!0,mapAsMap:mapAsMap===!0,mapKeyWarned:!1,maxAliasCount:typeof maxAliasCount==="number"?maxAliasCount:100},res=toJS.toJS(this,"",ctx);if(typeof onAnchor==="function")for(let{count,res:res2}of ctx.anchors.values())onAnchor(res2,count);return typeof reviver==="function"?applyReviver.applyReviver(reviver,{"":res},"",res):res}}exports.NodeBase=NodeBase});var require_Alias=__commonJS((exports)=>{var anchors=require_anchors(),visit=require_visit(),identity=require_identity(),Node=require_Node(),toJS=require_toJS();class Alias extends Node.NodeBase{constructor(source){super(identity.ALIAS);this.source=source,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(doc,ctx){if(ctx?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let nodes;if(ctx?.aliasResolveCache)nodes=ctx.aliasResolveCache;else if(nodes=[],visit.visit(doc,{Node:(_key,node)=>{if(identity.isAlias(node)||identity.hasAnchor(node))nodes.push(node)}}),ctx)ctx.aliasResolveCache=nodes;let found=void 0;for(let node of nodes){if(node===this)break;if(node.anchor===this.source)found=node}if(found&&ctx){let{anchors:anchors2,doc:doc2,maxAliasCount}=ctx,data=anchors2.get(found);if(!data)toJS.toJS(found,null,ctx),data=anchors2.get(found);if(data?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(maxAliasCount>=0){if(data.count+=1,data.aliasCount===0)data.aliasCount=getAliasCount(doc2,found,anchors2);if(data.count*data.aliasCount>maxAliasCount)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}}return found}toJSON(_arg,ctx){if(!ctx)return{source:this.source};let source=this.resolve(ctx.doc,ctx);if(!source){let msg=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(msg)}return ctx.anchors.get(source).res}toString(ctx,_onComment,_onChompKeep){let src=`*${this.source}`;if(ctx){if(anchors.anchorIsValid(this.source),ctx.options.verifyAliasOrder&&!ctx.anchors.has(this.source)){let msg=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(msg)}if(ctx.implicitKey)return`${src} `}return src}}function getAliasCount(doc,node,anchors2){if(identity.isAlias(node)){let source=node.resolve(doc),anchor=anchors2&&source&&anchors2.get(source);return anchor?anchor.count*anchor.aliasCount:0}else if(identity.isCollection(node)){let count=0;for(let item of node.items){let c=getAliasCount(doc,item,anchors2);if(c>count)count=c}return count}else if(identity.isPair(node)){let kc=getAliasCount(doc,node.key,anchors2),vc=getAliasCount(doc,node.value,anchors2);return Math.max(kc,vc)}return 1}exports.Alias=Alias});var require_Scalar=__commonJS((exports)=>{var identity=require_identity(),Node=require_Node(),toJS=require_toJS(),isScalarValue=(value)=>!value||typeof value!=="function"&&typeof value!=="object";class Scalar extends Node.NodeBase{constructor(value){super(identity.SCALAR);this.value=value}toJSON(arg,ctx){return ctx?.keep?this.value:toJS.toJS(this.value,arg,ctx)}toString(){return String(this.value)}}Scalar.BLOCK_FOLDED="BLOCK_FOLDED";Scalar.BLOCK_LITERAL="BLOCK_LITERAL";Scalar.PLAIN="PLAIN";Scalar.QUOTE_DOUBLE="QUOTE_DOUBLE";Scalar.QUOTE_SINGLE="QUOTE_SINGLE";exports.Scalar=Scalar;exports.isScalarValue=isScalarValue});var require_createNode=__commonJS((exports)=>{var Alias=require_Alias(),identity=require_identity(),Scalar=require_Scalar(),defaultTagPrefix="tag:yaml.org,2002:";function findTagObject(value,tagName,tags){if(tagName){let match=tags.filter((t)=>t.tag===tagName),tagObj=match.find((t)=>!t.format)??match[0];if(!tagObj)throw Error(`Tag ${tagName} not found`);return tagObj}return tags.find((t)=>t.identify?.(value)&&!t.format)}function createNode(value,tagName,ctx){if(identity.isDocument(value))value=value.contents;if(identity.isNode(value))return value;if(identity.isPair(value)){let map=ctx.schema[identity.MAP].createNode?.(ctx.schema,null,ctx);return map.items.push(value),map}if(value instanceof String||value instanceof Number||value instanceof Boolean||typeof BigInt<"u"&&value instanceof BigInt)value=value.valueOf();let{aliasDuplicateObjects,onAnchor,onTagObj,schema,sourceObjects}=ctx,ref=void 0;if(aliasDuplicateObjects&&value&&typeof value==="object")if(ref=sourceObjects.get(value),ref)return ref.anchor??(ref.anchor=onAnchor(value)),new Alias.Alias(ref.anchor);else ref={anchor:null,node:null},sourceObjects.set(value,ref);if(tagName?.startsWith("!!"))tagName=defaultTagPrefix+tagName.slice(2);let tagObj=findTagObject(value,tagName,schema.tags);if(!tagObj){if(value&&typeof value.toJSON==="function")value=value.toJSON();if(!value||typeof value!=="object"){let node2=new Scalar.Scalar(value);if(ref)ref.node=node2;return node2}tagObj=value instanceof Map?schema[identity.MAP]:(Symbol.iterator in Object(value))?schema[identity.SEQ]:schema[identity.MAP]}if(onTagObj)onTagObj(tagObj),delete ctx.onTagObj;let node=tagObj?.createNode?tagObj.createNode(ctx.schema,value,ctx):typeof tagObj?.nodeClass?.from==="function"?tagObj.nodeClass.from(ctx.schema,value,ctx):new Scalar.Scalar(value);if(tagName)node.tag=tagName;else if(!tagObj.default)node.tag=tagObj.tag;if(ref)ref.node=node;return node}exports.createNode=createNode});var require_Collection=__commonJS((exports)=>{var createNode=require_createNode(),identity=require_identity(),Node=require_Node();function collectionFromPath(schema,path,value){let v=value;for(let i=path.length-1;i>=0;--i){let k=path[i];if(typeof k==="number"&&Number.isInteger(k)&&k>=0){let a=[];a[k]=v,v=a}else v=new Map([[k,v]])}return createNode.createNode(v,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema,sourceObjects:new Map})}var isEmptyPath=(path)=>path==null||typeof path==="object"&&!!path[Symbol.iterator]().next().done;class Collection extends Node.NodeBase{constructor(type,schema){super(type);Object.defineProperty(this,"schema",{value:schema,configurable:!0,enumerable:!1,writable:!0})}clone(schema){let copy=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(schema)copy.schema=schema;if(copy.items=copy.items.map((it)=>identity.isNode(it)||identity.isPair(it)?it.clone(schema):it),this.range)copy.range=this.range.slice();return copy}addIn(path,value){if(isEmptyPath(path))this.add(value);else{let[key,...rest]=path,node=this.get(key,!0);if(identity.isCollection(node))node.addIn(rest,value);else if(node===void 0&&this.schema)this.set(key,collectionFromPath(this.schema,rest,value));else throw Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`)}}deleteIn(path){let[key,...rest]=path;if(rest.length===0)return this.delete(key);let node=this.get(key,!0);if(identity.isCollection(node))return node.deleteIn(rest);else throw Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`)}getIn(path,keepScalar){let[key,...rest]=path,node=this.get(key,!0);if(rest.length===0)return!keepScalar&&identity.isScalar(node)?node.value:node;else return identity.isCollection(node)?node.getIn(rest,keepScalar):void 0}hasAllNullValues(allowScalar){return this.items.every((node)=>{if(!identity.isPair(node))return!1;let n=node.value;return n==null||allowScalar&&identity.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(path){let[key,...rest]=path;if(rest.length===0)return this.has(key);let node=this.get(key,!0);return identity.isCollection(node)?node.hasIn(rest):!1}setIn(path,value){let[key,...rest]=path;if(rest.length===0)this.set(key,value);else{let node=this.get(key,!0);if(identity.isCollection(node))node.setIn(rest,value);else if(node===void 0&&this.schema)this.set(key,collectionFromPath(this.schema,rest,value));else throw Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`)}}}exports.Collection=Collection;exports.collectionFromPath=collectionFromPath;exports.isEmptyPath=isEmptyPath});var require_stringifyComment=__commonJS((exports)=>{var stringifyComment=(str)=>str.replace(/^(?!$)(?: $)?/gm,"#");function indentComment(comment,indent){if(/^\n+$/.test(comment))return comment.substring(1);return indent?comment.replace(/^(?! *$)/gm,indent):comment}var lineComment=(str,indent,comment)=>str.endsWith(`
|
|
4
4
|
`)?indentComment(comment,indent):comment.includes(`
|
|
5
5
|
`)?`
|
|
@@ -135,7 +135,7 @@ ${end.comment}`:end.comment}this.doc.range[2]=end.offset;break}default:this.erro
|
|
|
135
135
|
`)+1;while(nl!==0)this.onNewLine(this.offset+nl),nl=this.source.indexOf(`
|
|
136
136
|
`,nl)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(map){let it=map.items[map.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,it.value){let end="end"in it.value?it.value.end:void 0;if((Array.isArray(end)?end[end.length-1]:void 0)?.type==="comment")end?.push(this.sourceToken);else map.items.push({start:[this.sourceToken]})}else if(it.sep)it.sep.push(this.sourceToken);else it.start.push(this.sourceToken);return;case"space":case"comment":if(it.value)map.items.push({start:[this.sourceToken]});else if(it.sep)it.sep.push(this.sourceToken);else{if(this.atIndentedComment(it.start,map.indent)){let end=map.items[map.items.length-2]?.value?.end;if(Array.isArray(end)){arrayPushArray(end,it.start),end.push(this.sourceToken),map.items.pop();return}}it.start.push(this.sourceToken)}return}if(this.indent>=map.indent){let atMapIndent=!this.onKeyLine&&this.indent===map.indent,atNextItem=atMapIndent&&(it.sep||it.explicitKey)&&this.type!=="seq-item-ind",start=[];if(atNextItem&&it.sep&&!it.value){let nl=[];for(let i=0;i<it.sep.length;++i){let st=it.sep[i];switch(st.type){case"newline":nl.push(i);break;case"space":break;case"comment":if(st.indent>map.indent)nl.length=0;break;default:nl.length=0}}if(nl.length>=2)start=it.sep.splice(nl[1])}switch(this.type){case"anchor":case"tag":if(atNextItem||it.value)start.push(this.sourceToken),map.items.push({start}),this.onKeyLine=!0;else if(it.sep)it.sep.push(this.sourceToken);else it.start.push(this.sourceToken);return;case"explicit-key-ind":if(!it.sep&&!it.explicitKey)it.start.push(this.sourceToken),it.explicitKey=!0;else if(atNextItem||it.value)start.push(this.sourceToken),map.items.push({start,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(it.explicitKey)if(!it.sep)if(includesToken(it.start,"newline"))Object.assign(it,{key:null,sep:[this.sourceToken]});else{let start2=getFirstKeyStartProps(it.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:start2,key:null,sep:[this.sourceToken]}]})}else if(it.value)map.items.push({start:[],key:null,sep:[this.sourceToken]});else if(includesToken(it.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start,key:null,sep:[this.sourceToken]}]});else if(isFlowToken(it.key)&&!includesToken(it.sep,"newline")){let start2=getFirstKeyStartProps(it.start),key=it.key,sep=it.sep;sep.push(this.sourceToken),delete it.key,delete it.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:start2,key,sep}]})}else if(start.length>0)it.sep=it.sep.concat(start,this.sourceToken);else it.sep.push(this.sourceToken);else if(!it.sep)Object.assign(it,{key:null,sep:[this.sourceToken]});else if(it.value||atNextItem)map.items.push({start,key:null,sep:[this.sourceToken]});else if(includesToken(it.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else it.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let fs=this.flowScalar(this.type);if(atNextItem||it.value)map.items.push({start,key:fs,sep:[]}),this.onKeyLine=!0;else if(it.sep)this.stack.push(fs);else Object.assign(it,{key:fs,sep:[]}),this.onKeyLine=!0;return}default:{let bv=this.startBlockValue(map);if(bv){if(bv.type==="block-seq"){if(!it.explicitKey&&it.sep&&!includesToken(it.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(atMapIndent)map.items.push({start});this.stack.push(bv);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(seq){let it=seq.items[seq.items.length-1];switch(this.type){case"newline":if(it.value){let end="end"in it.value?it.value.end:void 0;if((Array.isArray(end)?end[end.length-1]:void 0)?.type==="comment")end?.push(this.sourceToken);else seq.items.push({start:[this.sourceToken]})}else it.start.push(this.sourceToken);return;case"space":case"comment":if(it.value)seq.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(it.start,seq.indent)){let end=seq.items[seq.items.length-2]?.value?.end;if(Array.isArray(end)){arrayPushArray(end,it.start),end.push(this.sourceToken),seq.items.pop();return}}it.start.push(this.sourceToken)}return;case"anchor":case"tag":if(it.value||this.indent<=seq.indent)break;it.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==seq.indent)break;if(it.value||includesToken(it.start,"seq-item-ind"))seq.items.push({start:[this.sourceToken]});else it.start.push(this.sourceToken);return}if(this.indent>seq.indent){let bv=this.startBlockValue(seq);if(bv){this.stack.push(bv);return}}yield*this.pop(),yield*this.step()}*flowCollection(fc){let it=fc.items[fc.items.length-1];if(this.type==="flow-error-end"){let top;do yield*this.pop(),top=this.peek(1);while(top?.type==="flow-collection")}else if(fc.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!it||it.sep)fc.items.push({start:[this.sourceToken]});else it.start.push(this.sourceToken);return;case"map-value-ind":if(!it||it.value)fc.items.push({start:[],key:null,sep:[this.sourceToken]});else if(it.sep)it.sep.push(this.sourceToken);else Object.assign(it,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!it||it.value)fc.items.push({start:[this.sourceToken]});else if(it.sep)it.sep.push(this.sourceToken);else it.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let fs=this.flowScalar(this.type);if(!it||it.value)fc.items.push({start:[],key:fs,sep:[]});else if(it.sep)this.stack.push(fs);else Object.assign(it,{key:fs,sep:[]});return}case"flow-map-end":case"flow-seq-end":fc.end.push(this.sourceToken);return}let bv=this.startBlockValue(fc);if(bv)this.stack.push(bv);else yield*this.pop(),yield*this.step()}else{let parent=this.peek(2);if(parent.type==="block-map"&&(this.type==="map-value-ind"&&parent.indent===fc.indent||this.type==="newline"&&!parent.items[parent.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&parent.type!=="flow-collection"){let prev=getPrevProps(parent),start=getFirstKeyStartProps(prev);fixFlowSeqItems(fc);let sep=fc.end.splice(1,fc.end.length);sep.push(this.sourceToken);let map={type:"block-map",offset:fc.offset,indent:fc.indent,items:[{start,key:fc,sep}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=map}else yield*this.lineEnd(fc)}}flowScalar(type){if(this.onNewLine){let nl=this.source.indexOf(`
|
|
137
137
|
`)+1;while(nl!==0)this.onNewLine(this.offset+nl),nl=this.source.indexOf(`
|
|
138
|
-
`,nl)+1}return{type,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(parent){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let prev=getPrevProps(parent),start=getFirstKeyStartProps(prev);return start.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let prev=getPrevProps(parent),start=getFirstKeyStartProps(prev);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(start,indent){if(this.type!=="comment")return!1;if(this.indent<=indent)return!1;return start.every((st)=>st.type==="newline"||st.type==="space")}*documentEnd(docEnd){if(this.type!=="doc-mode"){if(docEnd.end)docEnd.end.push(this.sourceToken);else docEnd.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(token){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(token.end)token.end.push(this.sourceToken);else token.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}exports.Parser=Parser});var require_public_api=__commonJS((exports)=>{var composer=require_composer(),Document=require_Document(),errors=require_errors(),log=require_log(),identity=require_identity(),lineCounter=require_line_counter(),parser=require_parser();function parseOptions(options){let prettyErrors=options.prettyErrors!==!1;return{lineCounter:options.lineCounter||prettyErrors&&new lineCounter.LineCounter||null,prettyErrors}}function parseAllDocuments(source,options={}){let{lineCounter:lineCounter2,prettyErrors}=parseOptions(options),parser$1=new parser.Parser(lineCounter2?.addNewLine),composer$1=new composer.Composer(options),docs=Array.from(composer$1.compose(parser$1.parse(source)));if(prettyErrors&&lineCounter2)for(let doc of docs)doc.errors.forEach(errors.prettifyError(source,lineCounter2)),doc.warnings.forEach(errors.prettifyError(source,lineCounter2));if(docs.length>0)return docs;return Object.assign([],{empty:!0},composer$1.streamInfo())}function parseDocument(source,options={}){let{lineCounter:lineCounter2,prettyErrors}=parseOptions(options),parser$1=new parser.Parser(lineCounter2?.addNewLine),composer$1=new composer.Composer(options),doc=null;for(let _doc of composer$1.compose(parser$1.parse(source),!0,source.length))if(!doc)doc=_doc;else if(doc.options.logLevel!=="silent"){doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(prettyErrors&&lineCounter2)doc.errors.forEach(errors.prettifyError(source,lineCounter2)),doc.warnings.forEach(errors.prettifyError(source,lineCounter2));return doc}function parse(src,reviver,options){let _reviver=void 0;if(typeof reviver==="function")_reviver=reviver;else if(options===void 0&&reviver&&typeof reviver==="object")options=reviver;let doc=parseDocument(src,options);if(!doc)return null;if(doc.warnings.forEach((warning)=>log.warn(doc.options.logLevel,warning)),doc.errors.length>0)if(doc.options.logLevel!=="silent")throw doc.errors[0];else doc.errors=[];return doc.toJS(Object.assign({reviver:_reviver},options))}function stringify(value,replacer,options){let _replacer=null;if(typeof replacer==="function"||Array.isArray(replacer))_replacer=replacer;else if(options===void 0&&replacer)options=replacer;if(typeof options==="string")options=options.length;if(typeof options==="number"){let indent=Math.round(options);options=indent<1?void 0:indent>8?{indent:8}:{indent}}if(value===void 0){let{keepUndefined}=options??replacer??{};if(!keepUndefined)return}if(identity.isDocument(value)&&!_replacer)return value.toString(options);return new Document.Document(value,_replacer,options).toString(options)}exports.parse=parse;exports.parseAllDocuments=parseAllDocuments;exports.parseDocument=parseDocument;exports.stringify=stringify});function hasReachableBinding(snapshot,predicate){for(let i=snapshot.length-1;i>=0;i--){let cfg=snapshot[i]?.config();if(!cfg||cfg.enabled===!1)continue;if(cfg.bindings.some(predicate))return!0;if(cfg.modal)return!1}return!1}var prefixReachable=(snapshot)=>hasReachableBinding(snapshot,(binding)=>binding.prefix===!0),inputPassthroughReachable=(snapshot)=>hasReachableBinding(snapshot,(binding)=>binding.passthrough===!0);function scanReachability(snapshot){let directIds=new Set,prefixIds=new Set,prefixReachable2=!1,inputPassthrough=!1,yieldedDirectIds=new Set,prefixOptions=[],seenPrefixKeys=new Set;for(let i=snapshot.length-1;i>=0;i--){let cfg=snapshot[i]?.config();if(!cfg||cfg.enabled===!1)continue;for(let binding of cfg.bindings){if(binding.passthrough)inputPassthrough=!0;if(binding.prefix===!0){if(prefixReachable2=!0,binding.id)prefixIds.add(binding.id);if(!seenPrefixKeys.has(binding.key))seenPrefixKeys.add(binding.key),prefixOptions.push({stroke:binding.key,action:binding.id??binding.key})}else if(binding.id){if(directIds.add(binding.id),binding.yieldToPassthrough)yieldedDirectIds.add(binding.id)}}if(cfg.modal)break}if(inputPassthrough)for(let id of yieldedDirectIds)directIds.delete(id);return{prefixReachable:prefixReachable2,inputPassthrough,prefixOptions,directIds,prefixIds}}function bindingReachability(snapshot){let{directIds,prefixIds,inputPassthrough}=scanReachability(snapshot);return{direct:directIds,prefix:prefixIds,inputPassthrough}}var KITTY_MODIFIER_KEY_NAMES=["leftshift","leftctrl","leftalt","leftsuper","lefthyper","leftmeta","rightshift","rightctrl","rightalt","rightsuper","righthyper","rightmeta","iso_level3_shift","iso_level5_shift"],KITTY_MODIFIER_KEYS=new Set(KITTY_MODIFIER_KEY_NAMES);function isKittyModifierKeyName(name){return name!==void 0&&KITTY_MODIFIER_KEYS.has(name)}function isKittyModifierKeyEvent(event){return isKittyModifierKeyName(event.name)}function isCtrlModifierKeyName(name){return name==="leftctrl"||name==="rightctrl"}var PREFIX_HUD_TTL_MS=4000,PREFIX_GUIDE_DELAY_MS=180;var MAX_ENTRIES=3,realClock={now:()=>Date.now(),schedule:(fn,ms)=>{let timer=setTimeout(fn,ms);return()=>clearTimeout(timer)}},clock=realClock;function prefixHudClock(){return clock}var cell=createStateCell({guide:null,entries:[]}),nextEntryId=1,prefixHudState=cell;function prefixHudSetArmed(armed,options=[],armedAt=null){cell.update((current)=>{if(!armed)return current.guide?.kind==="prefix"?{...current,guide:null}:current;return{...current,guide:{kind:"prefix",armedAt:armedAt??clock.now(),options}}})}function prefixHudShowDirect(options){cell.update((current)=>({...current,guide:{kind:"direct",options}}))}function prefixHudHideDirect(){cell.update((current)=>current.guide?.kind==="direct"?{...current,guide:null}:current)}function prefixHudPush(entry){cell.update((current)=>({...current,guide:null,entries:[...current.entries,{...entry,id:nextEntryId++}].slice(-MAX_ENTRIES)}))}function matchKey(evt){let base=[],name=evt.name;if(name)base.push(name);if(name==="return")base.push("enter");if(name==="enter")base.push("return");if(name==="backspace"&&evt.raw==="\b"&&!evt.meta&&!evt.option)base.push("ctrl+h");if(name==="linefeed"&&!evt.meta&&!evt.option)base.push("ctrl+j");let mods=[];if(evt.ctrl)mods.push("ctrl");if(evt.meta||evt.super)mods.push("cmd");if(evt.option)mods.push("alt");let bareShiftChar=evt.shift&&name!==void 0&&name.length===1&&mods.length===0;if(evt.shift&&name&&name.length>1)mods.push("shift");if(mods.length===0){if(bareShiftChar)return[...base.map((n)=>`shift+${n}`),...base];return base}let prefix=`${mods.join("+")}+`,prefixed=base.map((n)=>prefix+n);if(evt.shift&&name!==void 0&&name.length===1&&evt.source==="kitty")return[...base.map((n)=>`${mods.join("+")}+shift+${n}`),...prefixed];return prefixed}function prefixAction(run){return{run}}function insertRegistration(stack,reg){if(reg.modalOwner!==void 0){let firstMember=stack.findIndex((r)=>r.modalMember===reg.modalOwner);if(firstMember>=0){stack.splice(firstMember,0,reg);return}}stack.push(reg)}var dispatching=!1,DEFAULT_PREFIX_CONFIGURATION={key:"ctrl+a",timeoutMs:5000},prefixConfiguration={...DEFAULT_PREFIX_CONFIGURATION},prefixArmedAt=null,prefixArmedKey="",prefixArmedOnPassthrough=!1,prefixArmedOptions=[],prefixTimer=null;function configurePrefix(next){prefixConfiguration={...next},resetPrefixState()}function resetPrefixConfiguration(){prefixConfiguration={...DEFAULT_PREFIX_CONFIGURATION},resetPrefixState()}function currentPrefixConfiguration(){return prefixConfiguration}function prefixFirstStrokes(config=prefixConfiguration){if(config.key===null)return[];return[config.key,...config.extraKeys??[]]}function resetPrefixState(){if(prefixTimer!==null)clearTimeout(prefixTimer);prefixTimer=null,prefixArmedAt=null,prefixArmedOnPassthrough=!1,prefixArmedOptions=[],prefixHudSetArmed(!1)}function armPrefix(now,options,inputPassthrough,armedKey=prefixConfiguration.key??""){resetPrefixState(),prefixArmedAt=now,prefixArmedKey=armedKey,prefixArmedOnPassthrough=inputPassthrough,prefixArmedOptions=options.slice(),prefixTimer=setTimeout(resetPrefixState,prefixConfiguration.timeoutMs),prefixHudSetArmed(!0,options,now)}function armPrefixNow(snapshot,now=Date.now()){if(prefixConfiguration.key===null)return!1;let reach=scanReachability(snapshot);if(!reach.prefixReachable)return!1;return armPrefix(now,reach.prefixOptions,reach.inputPassthrough),!0}function invokeArmedPrefixAction(bindingStack,actionId,stroke,now=Date.now()){if(dispatching||prefixArmedAt===null)return!1;let snapshot=bindingStack.slice(),armedPrefixKey=prefixArmedKey,validOption=prefixArmedOptions.some((option)=>option.action===actionId&&option.stroke===stroke),expired=now-prefixArmedAt>prefixConfiguration.timeoutMs,crossedBoundary=inputPassthroughReachable(snapshot)!==prefixArmedOnPassthrough;if(!validOption||expired||crossedBoundary)return resetPrefixState(),!1;let hit=null;for(let i=snapshot.length-1;i>=0;i--){let reg=snapshot[i];if(!reg)continue;let cfg=reg.config();if(cfg.enabled===!1)continue;let candidate=cfg.bindings.find((binding)=>binding.prefix===!0&&binding.key===stroke);if(candidate){if(candidate.id===actionId)hit=candidate;break}if(cfg.modal)break}if(!hit?.action)return resetPrefixState(),!1;resetPrefixState(),dispatching=!0;try{return hit.action.run(),prefixHudPush({prefixKey:armedPrefixKey,stroke,action:actionId,at:now}),!0}finally{dispatching=!1}}var shadowWarned=new Set;function warnShadowedMatch(snapshot,hitIndex,candidates,prefix){for(let j=hitIndex-1;j>=0;j--){let cfg=snapshot[j]?.config();if(!cfg||cfg.enabled===!1)continue;let shadowed=cfg.bindings.find((b)=>Boolean(b.prefix)===prefix&&candidates.includes(b.key));if(shadowed){if(!shadowWarned.has(shadowed.key))shadowWarned.add(shadowed.key),console.error(`[rove keymap] "${shadowed.key}" matched two ENABLED bindings \u2014 the lower one is shadowed by LIFO order. Gate one of them off (see tui-react/lib/keymap.ts header).`);return}if(cfg.modal)return}}function dispatchMode(snapshot,evt,candidates,prefix,runCmd){for(let i=snapshot.length-1;i>=0;i--){let reg=snapshot[i];if(!reg)continue;let cfg=reg.config();if(cfg.enabled===!1)continue;let hit;for(let candidate of candidates)if(hit=cfg.bindings.find((binding)=>Boolean(binding.prefix)===prefix&&binding.key===candidate),hit)break;if(hit){if(hit.yieldToPassthrough&&inputPassthroughReachable(snapshot))continue;if(!cfg.modal&&isDev())warnShadowedMatch(snapshot,i,candidates,prefix);return runCmd(()=>hit.cmd(evt,hit.slot)),hit}if(cfg.modal)return null}return null}function dispatchKeyEvent(bindingStack,evt,now=Date.now(),opts){if(evt.defaultPrevented||dispatching)return!1;if(isKittyModifierKeyName(evt.name))return evt.preventDefault(),!0;let snapshot=bindingStack.slice(),candidates=matchKey(evt),runCmd=opts?.flushSync??((fn)=>fn());dispatching=!0;try{if(prefixArmedAt!==null&&inputPassthroughReachable(snapshot)!==prefixArmedOnPassthrough)resetPrefixState();if(prefixArmedAt!==null){let armedPrefixKey=prefixArmedKey,expired=now-prefixArmedAt>prefixConfiguration.timeoutMs;if(prefixArmedAt=null,expired)resetPrefixState();else{if(candidates.includes("escape"))return resetPrefixState(),evt.preventDefault(),!0;resetPrefixState();let hit=dispatchMode(snapshot,evt,candidates,!0,runCmd);return prefixHudPush({prefixKey:armedPrefixKey,stroke:candidates[0]??"",action:hit?hit.id??hit.key:null,at:now}),evt.preventDefault(),!0}}let firstStroke=prefixFirstStrokes().find((key)=>candidates.includes(key));if(firstStroke!==void 0){if(prefixReachable(snapshot)){let reach=scanReachability(snapshot);return armPrefix(now,reach.prefixOptions,reach.inputPassthrough,firstStroke),evt.preventDefault(),!0}}let direct=dispatchMode(snapshot,evt,candidates,!1,runCmd);if(direct){if(direct.id&&direct.key.includes("+")&&!direct.key.startsWith("shift+"))prefixHudPush({prefixKey:"",stroke:direct.key,action:direct.id??direct.key,at:now});return evt.preventDefault(),!0}return!1}finally{dispatching=!1}}async function restoreTerminal(renderer){if(!renderer)return;try{if(renderer.destroy(),!renderer.closed)return;await Promise.race([renderer.closed,new Promise((resolve)=>setTimeout(resolve,2000))])}catch(err){console.error("Rove: terminal restore failed:",err)}}var MOD_ALIASES={ctrl:"ctrl",control:"ctrl",ctl:"ctrl",cmd:"cmd",command:"cmd",meta:"cmd",super:"cmd",win:"cmd",alt:"alt",option:"alt",opt:"alt",shift:"shift"},KEY_ALIASES={esc:"escape",spacebar:"space",pgup:"pageup",pgdn:"pagedown",pgdown:"pagedown"},KNOWN_NAMED_KEYS=new Set(["up","down","left","right","pageup","pagedown","home","end","insert","delete","backspace","tab","space","escape","enter","return",...Array.from({length:12},(_,i)=>`f${i+1}`)]),MOD_ORDER=["ctrl","cmd","alt","shift"];function normalizeChord(raw){let rawTrimmed=raw.trim(),upperLetterKey=rawTrimmed.length===1&&rawTrimmed>="A"&&rawTrimmed<="Z",trimmed=raw.trim().toLowerCase();if(!trimmed)return{error:"empty chord"};let parts=trimmed.split("+"),key=parts.pop()??"";if(key===""&&parts.length>0&&parts[parts.length-1]==="")key="+",parts.pop();if(!key)return{error:`"${raw}": no key after the modifiers`};let mods=new Set;for(let part of parts){let mod=MOD_ALIASES[part];if(!mod)return{error:`"${raw}": unknown modifier "${part}" (use ctrl / cmd / alt / shift)`};mods.add(mod)}if(key=KEY_ALIASES[key]??key,upperLetterKey)mods.add("shift");if(mods.has("shift")&&mods.size>1&&key.length===1)return{error:`"${raw}": shift with other modifiers on a single character can never match \u2014 legacy terminals send the same byte with and without shift`};let prefix=MOD_ORDER.filter((m)=>mods.has(m)).join("+"),chord=prefix?`${prefix}+${key}`:key;if(key.length>1&&!KNOWN_NAMED_KEYS.has(key))return{chord,warning:`"${raw}": unrecognized key name "${key}" \u2014 the chord may never fire`};return{chord}}function platformSectionNames(platform){if(platform==="darwin")return["darwin","macos","mac"];if(platform==="win32")return["win32","windows"];return[platform]}function extractBindingsMap(section){if(!isObject(section))return null;let nested=section.bindings;if(isObject(nested))return nested;return section}function extractKeybindingOverrides(doc,platform){let warnings=[];if(doc===null||doc===void 0)return{entries:[],prefixEntries:[],warnings};if(!isObject(doc))return{entries:[],prefixEntries:[],warnings:["config root must be a YAML mapping (e.g. a top-level `bindings:` key)"]};let merged=new Map,prefixMerged=new Map,layers=[];if(doc.bindings!==void 0)if(isObject(doc.bindings))layers.push(doc.bindings);else warnings.push("`bindings:` must be a mapping of id \u2192 chord(s)");for(let name of platformSectionNames(platform)){let section=doc[name];if(section===void 0)continue;let map=extractBindingsMap(section);if(map)layers.push(map);else warnings.push(`\`${name}:\` must be a mapping (or contain a \`bindings:\` mapping)`)}for(let layer of layers)for(let[id,value]of Object.entries(layer)){let modeValues=isObject(value)&&(("direct"in value)||("prefix"in value))?[[merged,value.direct],[prefixMerged,value.prefix]]:[[merged,value]];for(let[target,modeValue]of modeValues){if(modeValue===void 0)continue;if(modeValue===null||modeValue===!1||Array.isArray(modeValue)&&modeValue.length===0){target.set(id,[]);continue}let rawChords=typeof modeValue==="string"?[modeValue]:Array.isArray(modeValue)?modeValue:null;if(!rawChords){warnings.push(`${id}: expected a chord string, a list of chords, or null \u2014 got ${typeof modeValue}`);continue}let chords=[],anyError=!1;for(let rawChord of rawChords){if(typeof rawChord!=="string"){warnings.push(`${id}: chord entries must be strings`),anyError=!0;continue}let result=normalizeChord(rawChord);if("error"in result){warnings.push(`${id}: ${result.error}`),anyError=!0;continue}if(result.warning)warnings.push(`${id}: ${result.warning}`);if(!chords.includes(result.chord))chords.push(result.chord)}if(chords.length===0&&anyError){warnings.push(`${id}: no valid chords \u2014 keeping the default`);continue}target.set(id,chords)}}return{entries:Array.from(merged,([id,keys])=>({id,keys})),prefixEntries:Array.from(prefixMerged,([id,keys])=>({id,keys})),warnings}}function pairContract(first,second){let layout=`alternating [${first}, ${second}] pairs`;return{layout,slots:[first,second],validateCount:(count)=>count>=2&&count%2===0?null:`needs ${layout} (an even number of chords \u2014 got ${count})`}}var SLOT_CONTRACTS={"sidebar.goto":pairContract("top (double-tap)","bottom"),"sidebar.nav":pairContract("down","up"),"files.nav":pairContract("down","up"),"diff.review.cursor":pairContract("down","up"),"sidebar.search.nav":pairContract("down","up"),"files.search.nav":pairContract("down","up"),"files.hierarchy":pairContract("collapse","expand"),"files.tab":pairContract("previous tab","next tab"),"app.quit":{layout:"[quit confirm, hard exit] (second chord optional)",validateCount:(count)=>count<=2?null:`needs [quit confirm, hard exit] (1 or 2 chords \u2014 got ${count})`}};function recordSlotLabels(id){return SLOT_CONTRACTS[id]?.slots??[]}var NO_BARE_LETTER_SCOPES=new Set(["global","workspace","terminal"]);function scopesOverlap(a,b){return a===b||a==="global"||b==="global"}function applyKeymapOverrides(keymap,entries){let warnings=[],applied=[];for(let entry of entries){let row=keymap.find((b)=>b.id===entry.id);if(!row){warnings.push(`${entry.id}: unknown binding id (press F1 in Rove for the full list)`);continue}if(row.keys.length===0&&row.prefixKeys===void 0){warnings.push(`${entry.id}: not customizable \u2014 the key is handled outside the keymap (doc-only row)`);continue}let contract=SLOT_CONTRACTS[entry.id];if(contract&&entry.keys.length>0){let problem=contract.validateCount(entry.keys.length);if(problem){warnings.push(`${entry.id}: ${problem} \u2014 keeping the default`);continue}}let keys=entry.keys.filter((chord)=>{if((chord.length===1||chord.startsWith("shift+")&&chord.length===7)&&!row.bareKeys&&NO_BARE_LETTER_SCOPES.has(row.scope))return warnings.push(`${entry.id}: "${chord}" dropped \u2014 a bare character on a ${row.scope}-scope binding would steal typed input (add a modifier)`),!1;return!0});if(keys.length===0&&entry.keys.length>0){warnings.push(`${entry.id}: no chords survived validation \u2014 keeping the default`);continue}if(contract&&keys.length!==entry.keys.length){warnings.push(`${entry.id}: a dropped chord would shift the slot layout (${contract.layout}) \u2014 keeping the default`);continue}let defaultKeys=row.keys,mutable=row;if(mutable.keys=keys,row.hint)if(keys.length===0)mutable.hint=void 0;else row.hint.keys=keys.join("/");applied.push({id:entry.id,keys,defaultKeys})}for(let change of applied)for(let chord of change.keys){let owner=keymap.find((b)=>b.id===change.id);if(!owner)continue;for(let other of keymap){if(other.id===change.id)continue;if(!other.keys.includes(chord))continue;if(!scopesOverlap(owner.scope,other.scope))continue;warnings.push(`${change.id}: "${chord}" also fires ${other.id} (${other.scope} scope) \u2014 last registration wins; consider a different chord`)}}return{applied,warnings}}var PLATFORM_SECTIONS={darwin:["darwin","macos","mac"],linux:["linux"],win32:["win32","windows"]},VALUE_RE=/^(pane|action):\s*([A-Za-z0-9][A-Za-z0-9._:-]*\.[A-Za-z0-9][A-Za-z0-9_:-]*)$/;function sectionOf(doc,key){if(typeof doc!=="object"||doc===null)return null;let section=doc[key];if(typeof section!=="object"||section===null||Array.isArray(section))return null;return section}function collect(section,into,warnings){for(let[rawChord,rawValue]of Object.entries(section)){if(typeof rawValue!=="string"){warnings.push(`plugins: ${rawChord}: value must be a "pane:<id>" or "action:<id>" string`);continue}let match=rawValue.trim().match(VALUE_RE);if(!match){warnings.push(`plugins: ${rawChord}: \`${rawValue}\` is not pane:<plugin-id>.<local-id> or action:<...>`);continue}let chord=normalizeChord(rawChord);if("error"in chord){warnings.push(`plugins: ${rawChord}: ${chord.error}`);continue}if(chord.warning)warnings.push(`plugins: ${rawChord}: ${chord.warning}`);into.set(chord.chord,{chord:chord.chord,kind:match[1],target:match[2].trim()})}}function extractPluginKeybindings(doc,platform){let warnings=[],byChord=new Map,base=sectionOf(doc,"plugins");if(base)collect(base,byChord,warnings);for(let alias of PLATFORM_SECTIONS[platform]??[]){let overlaySection=sectionOf(doc,alias),overlay=overlaySection?sectionOf(overlaySection,"plugins"):null;if(overlay)collect(overlay,byChord,warnings)}return{entries:[...byChord.values()],warnings}}function platformKeys(platform){if(platform==="darwin")return["darwin","macos","mac"];if(platform==="win32")return["win32","windows"];return[platform]}function collectEntries(source,warnings){let out=new Map;if(source===void 0)return out;if(!isObject(source))return warnings.push("prefix.bindings must be a mapping of binding id to chord(s)"),out;for(let[id,raw]of Object.entries(source)){if(raw===null||Array.isArray(raw)&&raw.length===0){out.set(id,[]);continue}let rawKeys=typeof raw==="string"?[raw]:Array.isArray(raw)?raw:null;if(!rawKeys||rawKeys.some((key)=>typeof key!=="string")){warnings.push(`prefix.bindings.${id} must be a chord string, a string list, null, or []`);continue}let keys=[],anyError=!1;for(let rawKey of rawKeys){let normalized=normalizeChord(rawKey);if("error"in normalized){warnings.push(`prefix.bindings.${id}: ${normalized.error}`),anyError=!0;continue}if(!keys.includes(normalized.chord))keys.push(normalized.chord);if(normalized.warning)warnings.push(`prefix.bindings.${id}: ${normalized.warning}`)}if(keys.length===0&&anyError){warnings.push(`prefix.bindings.${id}: no valid chords \u2014 keeping the default`);continue}out.set(id,keys)}return out}function prefixChord(raw,warnings){let normalized=normalizeChord(raw);if("error"in normalized)warnings.push(`prefix.key: ${normalized.error}`);else if(!normalized.chord.includes("+"))warnings.push("prefix.key must include a modifier");else return normalized.chord;return null}function mergePrefixKey(raw,configuration,warnings){if(raw===null||Array.isArray(raw)&&raw.length===0){configuration.key=null,configuration.extraKeys=void 0;return}let rawKeys=typeof raw==="string"?[raw]:Array.isArray(raw)?raw:null;if(!rawKeys||rawKeys.some((key)=>typeof key!=="string")){warnings.push("prefix.key must be a modifier chord, a list of them, or null");return}let keys=[];for(let rawKey of rawKeys){let chord=prefixChord(rawKey,warnings);if(chord!==null&&!keys.includes(chord))keys.push(chord)}let[primary,...extra]=keys;if(primary===void 0)return;if(configuration.key=primary,extra.length>0)configuration.extraKeys=extra;else configuration.extraKeys=void 0}function mergePrefixBlock(raw,configuration,entries,warnings){if(raw===void 0)return;if(!isObject(raw)){warnings.push("prefix must be a mapping");return}if("key"in raw)mergePrefixKey(raw.key,configuration,warnings);if("timeoutMs"in raw)if(typeof raw.timeoutMs!=="number"||!Number.isInteger(raw.timeoutMs)||raw.timeoutMs<100||raw.timeoutMs>1e4)warnings.push("prefix.timeoutMs must be an integer from 100 to 10000");else configuration.timeoutMs=raw.timeoutMs;for(let[id,keys]of collectEntries(raw.bindings,warnings))entries.set(id,keys)}function extractPrefixKeybindings(doc,platform){let configuration={},warnings=[],entries=new Map;if(!isObject(doc)){if(doc!==null&&doc!==void 0)warnings.push("keybindings document must be a mapping");return{configuration,entries:[],warnings}}mergePrefixBlock(doc.prefix,configuration,entries,warnings);for(let key of platformKeys(platform)){let overlay=doc[key];if(isObject(overlay))mergePrefixBlock(overlay.prefix,configuration,entries,warnings)}return{configuration,entries:[...entries].map(([id,keys])=>({id,keys})),warnings}}function applyPrefixKeymapOverrides(keymap,entries){let applied=[],warnings=[];for(let entry of entries){let row=keymap.find((candidate)=>candidate.id===entry.id);if(!row){warnings.push(`${entry.id}: unknown binding id`);continue}let mutable=row,defaultKeys=[...row.prefixKeys??[]];mutable.prefixKeys=[...entry.keys],applied.push({id:entry.id,keys:[...entry.keys],defaultKeys})}return{applied,warnings}}function resolveUserKeybindings(file,keymap,platform){if(!file.exists)return{report:{path:file.path,exists:!1,applied:[],plugins:[],warnings:[]},prefix:{...DEFAULT_PREFIX_CONFIGURATION}};let warnings=[...file.warnings],extracted=extractKeybindingOverrides(file.doc,platform);warnings.push(...extracted.warnings);let prefix=extractPrefixKeybindings(file.doc,platform);warnings.push(...prefix.warnings);let prefixConfiguration2={...DEFAULT_PREFIX_CONFIGURATION,...prefix.configuration},result=applyKeymapOverrides(keymap,extracted.entries);warnings.push(...result.warnings);let applied=[...result.applied],customPrefix=prefix.configuration.key===void 0?[]:prefixFirstStrokes(prefixConfiguration2);for(let prefixKey of customPrefix){let directOwner=keymap.find((row)=>row.keys.includes(prefixKey));if(directOwner)warnings.push(`prefix.key "${prefixKey}" collides with direct binding ${directOwner.id}`)}let prefixResult=applyPrefixKeymapOverrides(keymap,[...extracted.prefixEntries,...prefix.entries]);warnings.push(...prefixResult.warnings),applied.push(...prefixResult.applied);let plugins=extractPluginKeybindings(file.doc,platform);warnings.push(...plugins.warnings);for(let p of plugins.entries){let owner=keymap.find((row)=>row.keys.includes(p.chord));if(owner)warnings.push(`plugins: ${p.chord} shadows ${owner.id}`)}return{report:{path:file.path,exists:!0,applied,plugins:plugins.entries,warnings},prefix:prefixConfiguration2}}import{existsSync,readFileSync}from"fs";var cached=null;function resetKeybindingsFileCache(){cached=null}function resolveConfigFile(){let canonical=keybindingsConfigPath();if(existsSync(canonical))return{canonical,found:canonical};let yml=canonical.replace(/\.yaml$/,".yml");if(existsSync(yml))return{canonical,found:yml};return{canonical,found:null}}function readKeybindingsFile(){if(cached)return cached;let{canonical,found}=resolveConfigFile();if(!found)return cached={path:canonical,exists:!1,source:null,doc:null,warnings:[]},cached;let warnings=[],doc=null;try{let text=readFileSync(found,"utf8");doc=Bun.YAML.parse(text)}catch(err){let msg=errorMessage(err);warnings.push(`could not read/parse ${found}: ${msg}`)}return cached={path:canonical,exists:!0,source:found,doc,warnings},cached}var CHAT_BINDINGS=[{id:"chat.tab.new",scope:"workspace",keys:["ctrl+t"],category:"Workspace",description:"New chat tab",hint:{keys:"ctrl+t"},presentation:"onePress"},{id:"chat.tab.chooseEngine",scope:"workspace",keys:["ctrl+e"],category:"Workspace",description:"New conversation \u2014 engine/shell picker with destination + context toggles",hint:{keys:"ctrl+e"},presentation:"onePress"},{id:"chat.tab.fork",scope:"workspace",keys:[],prefixKeys:["c"],category:"Workspace",description:"Fork this chat into a new tab (same Task directory, keeps the conversation)",hint:{keys:"ctrl+a c"}},{id:"chat.fork.new",scope:"workspace",keys:[],prefixKeys:["f"],category:"Workspace",description:"Quick-fork: create child task seeded with current repo/branch/model",hint:{keys:"ctrl+a f"}},{id:"chat.tab.close",scope:"workspace",keys:["ctrl+w"],prefixKeys:["w"],category:"Workspace",description:"Close chat tab",hint:{keys:"ctrl+w"},presentation:"onePress"},{id:"workspace.reopenSession",scope:"workspace",keys:["return"],category:"Workspace",description:"Reopen a session in a task whose tabs are all closed",hint:{keys:"enter"},presentation:"onePress"},{id:"chat.tab.rename",scope:"workspace",keys:["f2"],category:"Workspace",description:"Rename active chat tab",hint:{keys:"f2"},presentation:"onePress"},{id:"chat.tab.cycle-next",scope:"workspace",keys:["ctrl+]"],category:"Workspace",description:"Next chat tab",hint:{keys:"ctrl+]"},presentation:"onePress"},{id:"chat.tab.cycle-prev",scope:"workspace",keys:["ctrl+["],category:"Workspace",description:"Previous chat tab",hint:{keys:"ctrl+["},presentation:"onePress"},{id:"chat.tab.goto",scope:"workspace",keys:["1","2","3","4","5","6","7","8","9"].map((digit)=>`ctrl+${digit}`),category:"Workspace",description:"Go to chat tab N",hint:{keys:"ctrl+1-9"},presentation:"onePress"},{id:"workspace.split.right",scope:"workspace",keys:["ctrl+\\"],category:"Workspace",description:"Split right",hint:{keys:"ctrl+\\"},presentation:"onePress"},{id:"workspace.split.down",scope:"workspace",keys:["ctrl+="],category:"Workspace",description:"Split down",hint:{keys:"ctrl+="},presentation:"onePress"},{id:"workspace.split.focus-next",scope:"workspace",keys:["f3"],category:"Workspace",description:"Focus next split",hint:{keys:"f3"},presentation:"onePress"},{id:"workspace.split.close",scope:"workspace",keys:["ctrl+w"],prefixKeys:["w"],category:"Workspace",description:"Close active split (tab when unsplit)",hint:{keys:"ctrl+w"},presentation:"onePress"},{id:"workspace.split.rename",scope:"workspace",keys:["f2"],category:"Workspace",description:"Rename active split (tab when unsplit)",hint:{keys:"f2"},presentation:"onePress"}];var FILES_BINDINGS=[{id:"files.nav",scope:"files",keys:["j","k","down","up"],category:"Files",description:"Move cursor up/down",hint:{keys:"j/k"}},{id:"files.hierarchy",scope:"files",keys:["h","l","left","right"],category:"Files",description:"Collapse / expand tree level",hint:{keys:"h/l"}},{id:"files.open",scope:"files",keys:["return"],category:"Files",description:"Open file in configured editor (diff when supported)",hint:{keys:"enter"}},{id:"files.tab",scope:"files",keys:["[","]"],category:"Files",description:"Switch tab (cycle All / Changes)",hint:{keys:"[/]"}},{id:"files.refresh",scope:"files",keys:["r"],category:"Files",description:"Refresh",hint:{keys:"r"}},{id:"files.scope",scope:"files",keys:["b"],category:"Files",description:"Toggle Changes scope (working \u2194 branch vs base)",hint:{keys:"b"}},{id:"files.diff",scope:"files",keys:["d"],category:"Files",description:"Open read-only diff in a workspace tab",hint:{keys:"d"}},{id:"files.diffAll",scope:"files",keys:["shift+d"],category:"Files",description:"Open the whole worktree's diff in one workspace tab",hint:{keys:"D"}},{id:"files.openExternal",scope:"files",keys:["o"],category:"Files",description:"Open file in system default app (audio / video / pdf preview)",hint:{keys:"o"}},{id:"files.mention",scope:"files",keys:["a"],category:"Files",description:"Inject @<path> mention into the engine pane",hint:{keys:"a"}},{id:"files.search.enter",scope:"files",keys:["/"],category:"Files",description:"Search file names and text",hint:{keys:"/"}},{id:"files.search.nav",scope:"files",keys:["down","up"],category:"Files",description:"Move highlight in file search results"},{id:"files.search.submit",scope:"files",keys:["return"],category:"Files",description:"Open the highlighted search result"},{id:"files.search.cancel",scope:"files",keys:["escape"],category:"Files",description:"Close file search"},{id:"files.createPR",scope:"global",keys:[],prefixKeys:["p","shift+p"],category:"Files",description:"Ask the agent to create a PR from the current task"},{id:"files.fixChecks",scope:"global",keys:[],prefixKeys:["k"],category:"Files",description:"Ask the agent to fix the failing PR checks"},{id:"files.syncBase",scope:"global",keys:[],prefixKeys:["u"],category:"Files",description:"Merge the base branch into this task's worktree"},{id:"diff.review.cursor",scope:"workspace",keys:["j","k","down","up"],bareKeys:!0,category:"Diff review",description:"Move the line cursor over the diff",hint:{keys:"j/k"}},{id:"diff.review.range",scope:"workspace",keys:["v"],bareKeys:!0,category:"Diff review",description:"Toggle range anchor at the cursor",hint:{keys:"v"}},{id:"diff.review.note",scope:"workspace",keys:["c"],bareKeys:!0,category:"Diff review",description:"Add a review note at the cursor",hint:{keys:"c"}},{id:"diff.review.send",scope:"workspace",keys:["s"],bareKeys:!0,category:"Diff review",description:"Send all unsent review notes to the engine",hint:{keys:"s"}},{id:"diff.review.drop",scope:"workspace",keys:["x"],bareKeys:!0,category:"Diff review",description:"Drop the review note the cursor sits inside",hint:{keys:"x"}},{id:"diff.review.reload",scope:"workspace",keys:["r"],bareKeys:!0,category:"Diff review",description:"Reload the previewed file from disk",hint:{keys:"r"}}];var INBOX_BINDINGS=[{id:"inbox.show",scope:"global",keys:[],prefixKeys:["i"],category:"Global",description:"Open Inbox"},{id:"inbox.nav",scope:"inbox",keys:["j","k","down","up"],category:"Inbox",description:"Move cursor up/down",hint:{keys:"j/k"}},{id:"inbox.open",scope:"inbox",keys:["return"],category:"Inbox",description:"Open the selected Task and Terminal Tab",hint:{keys:"enter"}},{id:"inbox.delete",scope:"inbox",keys:["d"],category:"Inbox",description:"Ack the selected Inbox item",hint:{keys:"d"}},{id:"inbox.deleteAll",scope:"inbox",keys:["shift+d"],category:"Inbox",description:"Ack every ATTENTION item",hint:{keys:"D"}}];var SIDEBAR_BINDINGS=[{id:"sidebar.nav",scope:"sidebar",keys:["j","k","down","up"],category:"Sidebar",description:"Move cursor up/down",hint:{keys:"j/k"}},{id:"sidebar.select",scope:"sidebar",keys:["return"],category:"Sidebar",description:"Open the selected task",hint:{keys:"enter"}},{id:"sidebar.tree.open",scope:"sidebar",keys:["l","space"],category:"Sidebar",description:"Open the row under the cursor (a tab row enters its chat)",hint:{keys:"l"}},{id:"sidebar.goto",scope:"sidebar",keys:["g","shift+g"],category:"Sidebar",description:"Top / bottom of list (gg or shift-G)"},{id:"sidebar.rename",scope:"sidebar",keys:["r"],category:"Sidebar",description:"Rename task",hint:{keys:"r"}},{id:"sidebar.localMerge",scope:"sidebar",keys:["shift+m"],category:"Sidebar",description:"Reorder row (Shift+M, then j/k)",hint:{keys:"M"}},{id:"sidebar.pin",scope:"sidebar",keys:["shift+p"],category:"Sidebar",description:"Pin / unpin task at top (Shift+P)",hint:{keys:"P"}},{id:"sidebar.sort",scope:"sidebar",keys:["t"],category:"Sidebar",description:"Cycle task sort (default \u2192 recent \u2192 attention \u2192 name)",hint:{keys:"t"}},{id:"sidebar.delete",scope:"sidebar",keys:["d"],category:"Sidebar",description:"Remove session (with confirm)",hint:{keys:"d"}},{id:"sidebar.search.enter",scope:"sidebar",keys:["/"],category:"Sidebar",description:"Search tasks (fuzzy filter)",hint:{keys:"/"}},{id:"sidebar.search.nav",scope:"sidebar",keys:["down","up"],category:"Sidebar",description:"Move highlight in search results"},{id:"sidebar.search.submit",scope:"sidebar",keys:["return"],category:"Sidebar",description:"Select search match and exit search"},{id:"sidebar.search.cancel",scope:"sidebar",keys:["escape"],category:"Sidebar",description:"Cancel search (restore prior selection)"},{id:"tasks.openWorktree",scope:"sidebar",keys:["o"],category:"Tasks pane",description:"Open selected Task directory in your editor",hint:{keys:"o"}},{id:"tasks.renameBranch",scope:"sidebar",keys:["b"],category:"Tasks pane",description:"Rename the selected task's git branch",hint:{keys:"b"}},{id:"tasks.cycleEngine",scope:"sidebar",keys:["v"],category:"Tasks pane",description:"Cycle engine vendor \u2014 applies on reopen",hint:{keys:"v"}},{id:"tasks.update",scope:"sidebar",keys:["u"],category:"Tasks pane",description:"Open the update page \u2014 version check + release notes",hint:{keys:"u"}},{id:"tasks.focusEngine",scope:"sidebar",keys:["right"],category:"Tasks pane",description:"Focus the engine pane of the current window",hint:{keys:"\u2192"}}];var RoveKeymap=[{id:"palette.open",scope:"global",keys:[],prefixKeys:["/"],category:"Global",description:"Search commands"},{id:"help.open",scope:"global",keys:["f1"],category:"Global",description:"Show keybindings help",hint:{keys:"F1"},presentation:"onePress"},{id:"task.new",scope:"sidebar",keys:["n"],category:"Sidebar",description:"New task",hint:{keys:"n"}},{id:"task.new.global",scope:"global",keys:[],prefixKeys:["n"],category:"Global",description:"New task"},{id:"task.openEditor",scope:"global",keys:[],prefixKeys:["o"],category:"Global",description:"Open active Task directory in editor"},{id:"task.moveMode",scope:"global",keys:[],prefixKeys:["m"],category:"Global",description:"Reorder sidebar rows (then j/k)"},{id:"settings.open",scope:"global",keys:[],prefixKeys:[","],category:"Global",description:"Open settings"},{id:"app.refresh",scope:"global",keys:[],prefixKeys:["r"],category:"Global",description:"Refresh Rove onto the installed build (after an update)"},{id:"settings.open.sidebar",scope:"sidebar",keys:["s"],category:"Sidebar",description:"Open settings",hint:{keys:"s"}},{id:"worktrees.open.sidebar",scope:"sidebar",keys:["x"],category:"Sidebar",description:"Open worktrees",hint:{keys:"x"}},{id:"kanban.open",scope:"global",keys:[],prefixKeys:["1"],category:"Global",description:"Open kanban (issues board)"},{id:"automations.open",scope:"global",keys:[],prefixKeys:["2"],category:"Global",description:"Open routines (scheduled tasks)"},{id:"workItems.open",scope:"global",keys:[],prefixKeys:["3"],category:"Global",description:"Open GitHub issues (external tracker)"},{id:"app.quit",scope:"sidebar",keys:["q","ctrl+q"],category:"Sidebar",description:"Quit (with confirm)",hint:{keys:"q"}},{id:"focus.sidebar",scope:"workspace",keys:["ctrl+q"],prefixKeys:["q"],category:"Workspace",description:"Back to sidebar (tasks)",hint:{keys:"ctrl+q"},presentation:"onePress"},{id:"focus.previous",scope:"global",keys:[],prefixKeys:["h"],category:"Navigation",description:"Focus previous pane (files \u2192 workspace \u2192 sidebar)"},{id:"focus.next",scope:"global",keys:["f4"],prefixKeys:["l"],category:"Navigation",description:"Focus next pane (sidebar \u2192 workspace \u2192 files)",hint:{keys:"f4"},presentation:"onePress"},{id:"attention.next",scope:"global",keys:["f7"],category:"Navigation",description:"Jump to the next available Inbox item",hint:{keys:"f7"},presentation:"onePress"},{id:"task.previous",scope:"global",keys:[],prefixKeys:["tab"],category:"Navigation",description:"Back to the previous task"},{id:"workspace.filesToggle",scope:"global",keys:[],prefixKeys:["z"],category:"Navigation",description:"Show or hide the Files pane"},{id:"view.redraw",scope:"global",keys:[],prefixKeys:["r"],category:"Global",description:"Redraw the screen"},...SIDEBAR_BINDINGS,...CHAT_BINDINGS,...FILES_BINDINGS,...INBOX_BINDINGS,{id:"terminal.scroll-up",scope:"terminal",keys:["ctrl+pageup"],category:"Terminal",description:"Scroll scrollback up",hint:{keys:"ctrl+pgup"}},{id:"terminal.scroll-down",scope:"terminal",keys:["ctrl+pagedown"],category:"Terminal",description:"Scroll scrollback down"},{id:"terminal.reset",scope:"terminal",keys:["f5"],category:"Terminal",description:"Reset terminal \u2014 kill the current shell and respawn",hint:{keys:"f5"},presentation:"onePress"}];var KEYMAP_DEFAULTS=new Map(RoveKeymap.map((b)=>[b.id,{keys:[...b.keys],prefixKeys:b.prefixKeys&&[...b.prefixKeys],hint:b.hint?{...b.hint}:void 0}]));function defaultKeymapCopy(){return RoveKeymap.map((row)=>{let def=KEYMAP_DEFAULTS.get(row.id);return{id:row.id,scope:row.scope,category:row.category,...row.bareKeys?{bareKeys:!0}:{},keys:[...def?.keys??[]],...def?.prefixKeys?{prefixKeys:[...def.prefixKeys]}:{},...def?.hint?{hint:{...def.hint}}:{}}})}function defaultChordsOf(id){return KEYMAP_DEFAULTS.get(id)?.keys??[]}function resetKeymapToDefaults(){for(let row of RoveKeymap){let def=KEYMAP_DEFAULTS.get(row.id);if(!def)continue;let mutable=row;mutable.keys=[...def.keys],mutable.prefixKeys=def.prefixKeys&&[...def.prefixKeys],mutable.hint=def.hint?{...def.hint}:void 0}}var keymapVersionValue=0,keymapVersionListeners=new Set;function keymapVersion(){return keymapVersionValue}function subscribeKeymapVersion(listener){return keymapVersionListeners.add(listener),()=>{keymapVersionListeners.delete(listener)}}function bumpKeymapVersion(){keymapVersionValue+=1;for(let listener of[...keymapVersionListeners])listener()}var KEYMAP_BY_ID=new Map(RoveKeymap.map((b)=>[b.id,b]));function findBinding(id){return KEYMAP_BY_ID.get(id)}function bindByIds(handlers){let out=[];for(let id in handlers){let handler=handlers[id];if(!handler)continue;let action=typeof handler==="function"?void 0:handler,cmd=typeof handler==="function"?handler:()=>handler.run(),binding=findBinding(id),chords=binding?.keys??[],prefixChords=binding?.prefixKeys??[];if(chords.length===0&&prefixChords.length===0){console.warn(`[rove/keybindings] bindByIds: id="${id}" has no chords (or doesn't exist in RoveKeymap)`);continue}chords.forEach((key,slot)=>out.push({key,cmd,action,slot,id,yieldToPassthrough:binding?.yieldToPassthrough})),prefixChords.forEach((key,slot)=>out.push({key,prefix:!0,cmd,action,slot,id}))}return out}import{mkdirSync as mkdirSync2,readFileSync as readFileSync2,writeFileSync as writeFileSync2}from"fs";import{dirname as dirname2}from"path";import{existsSync as existsSync2,mkdirSync,writeFileSync}from"fs";import{dirname}from"path";var KEYBINDINGS_STARTER=`# Rove keybindings \u2014 every line below is an example, commented out.
|
|
138
|
+
`,nl)+1}return{type,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(parent){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let prev=getPrevProps(parent),start=getFirstKeyStartProps(prev);return start.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let prev=getPrevProps(parent),start=getFirstKeyStartProps(prev);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(start,indent){if(this.type!=="comment")return!1;if(this.indent<=indent)return!1;return start.every((st)=>st.type==="newline"||st.type==="space")}*documentEnd(docEnd){if(this.type!=="doc-mode"){if(docEnd.end)docEnd.end.push(this.sourceToken);else docEnd.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(token){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(token.end)token.end.push(this.sourceToken);else token.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}exports.Parser=Parser});var require_public_api=__commonJS((exports)=>{var composer=require_composer(),Document=require_Document(),errors=require_errors(),log=require_log(),identity=require_identity(),lineCounter=require_line_counter(),parser=require_parser();function parseOptions(options){let prettyErrors=options.prettyErrors!==!1;return{lineCounter:options.lineCounter||prettyErrors&&new lineCounter.LineCounter||null,prettyErrors}}function parseAllDocuments(source,options={}){let{lineCounter:lineCounter2,prettyErrors}=parseOptions(options),parser$1=new parser.Parser(lineCounter2?.addNewLine),composer$1=new composer.Composer(options),docs=Array.from(composer$1.compose(parser$1.parse(source)));if(prettyErrors&&lineCounter2)for(let doc of docs)doc.errors.forEach(errors.prettifyError(source,lineCounter2)),doc.warnings.forEach(errors.prettifyError(source,lineCounter2));if(docs.length>0)return docs;return Object.assign([],{empty:!0},composer$1.streamInfo())}function parseDocument(source,options={}){let{lineCounter:lineCounter2,prettyErrors}=parseOptions(options),parser$1=new parser.Parser(lineCounter2?.addNewLine),composer$1=new composer.Composer(options),doc=null;for(let _doc of composer$1.compose(parser$1.parse(source),!0,source.length))if(!doc)doc=_doc;else if(doc.options.logLevel!=="silent"){doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(prettyErrors&&lineCounter2)doc.errors.forEach(errors.prettifyError(source,lineCounter2)),doc.warnings.forEach(errors.prettifyError(source,lineCounter2));return doc}function parse(src,reviver,options){let _reviver=void 0;if(typeof reviver==="function")_reviver=reviver;else if(options===void 0&&reviver&&typeof reviver==="object")options=reviver;let doc=parseDocument(src,options);if(!doc)return null;if(doc.warnings.forEach((warning)=>log.warn(doc.options.logLevel,warning)),doc.errors.length>0)if(doc.options.logLevel!=="silent")throw doc.errors[0];else doc.errors=[];return doc.toJS(Object.assign({reviver:_reviver},options))}function stringify(value,replacer,options){let _replacer=null;if(typeof replacer==="function"||Array.isArray(replacer))_replacer=replacer;else if(options===void 0&&replacer)options=replacer;if(typeof options==="string")options=options.length;if(typeof options==="number"){let indent=Math.round(options);options=indent<1?void 0:indent>8?{indent:8}:{indent}}if(value===void 0){let{keepUndefined}=options??replacer??{};if(!keepUndefined)return}if(identity.isDocument(value)&&!_replacer)return value.toString(options);return new Document.Document(value,_replacer,options).toString(options)}exports.parse=parse;exports.parseAllDocuments=parseAllDocuments;exports.parseDocument=parseDocument;exports.stringify=stringify});function hasReachableBinding(snapshot,predicate){for(let i=snapshot.length-1;i>=0;i--){let cfg=snapshot[i]?.config();if(!cfg||cfg.enabled===!1)continue;if(cfg.bindings.some(predicate))return!0;if(cfg.modal)return!1}return!1}var prefixReachable=(snapshot)=>hasReachableBinding(snapshot,(binding)=>binding.prefix===!0),inputPassthroughReachable=(snapshot)=>hasReachableBinding(snapshot,(binding)=>binding.passthrough===!0);function scanReachability(snapshot){let directIds=new Set,prefixIds=new Set,prefixReachable2=!1,inputPassthrough=!1,yieldedDirectIds=new Set,prefixOptions=[],seenPrefixKeys=new Set;for(let i=snapshot.length-1;i>=0;i--){let cfg=snapshot[i]?.config();if(!cfg||cfg.enabled===!1)continue;for(let binding of cfg.bindings){if(binding.passthrough)inputPassthrough=!0;if(binding.prefix===!0){if(prefixReachable2=!0,binding.id)prefixIds.add(binding.id);if(!seenPrefixKeys.has(binding.key))seenPrefixKeys.add(binding.key),prefixOptions.push({stroke:binding.key,action:binding.id??binding.key})}else if(binding.id){if(directIds.add(binding.id),binding.yieldToPassthrough)yieldedDirectIds.add(binding.id)}}if(cfg.modal)break}if(inputPassthrough)for(let id of yieldedDirectIds)directIds.delete(id);return{prefixReachable:prefixReachable2,inputPassthrough,prefixOptions,directIds,prefixIds}}function bindingReachability(snapshot){let{directIds,prefixIds,inputPassthrough}=scanReachability(snapshot);return{direct:directIds,prefix:prefixIds,inputPassthrough}}var KITTY_MODIFIER_KEY_NAMES=["leftshift","leftctrl","leftalt","leftsuper","lefthyper","leftmeta","rightshift","rightctrl","rightalt","rightsuper","righthyper","rightmeta","iso_level3_shift","iso_level5_shift"],KITTY_MODIFIER_KEYS=new Set(KITTY_MODIFIER_KEY_NAMES);function isKittyModifierKeyName(name){return name!==void 0&&KITTY_MODIFIER_KEYS.has(name)}function isKittyModifierKeyEvent(event){return isKittyModifierKeyName(event.name)}function isCtrlModifierKeyName(name){return name==="leftctrl"||name==="rightctrl"}var PREFIX_HUD_TTL_MS=4000,PREFIX_GUIDE_DELAY_MS=180;var MAX_ENTRIES=3,realClock={now:()=>Date.now(),schedule:(fn,ms)=>{let timer=setTimeout(fn,ms);return()=>clearTimeout(timer)}},clock=realClock;function prefixHudClock(){return clock}var cell=createStateCell({guide:null,entries:[]}),nextEntryId=1,prefixHudState=cell;function prefixHudSetArmed(armed,options=[],armedAt=null){cell.update((current)=>{if(!armed)return current.guide?.kind==="prefix"?{...current,guide:null}:current;return{...current,guide:{kind:"prefix",armedAt:armedAt??clock.now(),options}}})}function prefixHudShowDirect(options){cell.update((current)=>({...current,guide:{kind:"direct",options}}))}function prefixHudHideDirect(){cell.update((current)=>current.guide?.kind==="direct"?{...current,guide:null}:current)}function prefixHudPush(entry){cell.update((current)=>({...current,guide:null,entries:[...current.entries,{...entry,id:nextEntryId++}].slice(-MAX_ENTRIES)}))}function matchKey(evt){let base=[],name=evt.name;if(name)base.push(name);if(name==="return")base.push("enter");if(name==="enter")base.push("return");if(name==="backspace"&&evt.raw==="\b"&&!evt.meta&&!evt.option)base.push("ctrl+h");if(name==="linefeed"&&!evt.meta&&!evt.option)base.push("ctrl+j");let mods=[];if(evt.ctrl)mods.push("ctrl");if(evt.meta||evt.super)mods.push("cmd");if(evt.option)mods.push("alt");let bareShiftChar=evt.shift&&name!==void 0&&name.length===1&&mods.length===0;if(evt.shift&&name&&name.length>1)mods.push("shift");if(mods.length===0){if(bareShiftChar)return[...base.map((n)=>`shift+${n}`),...base];return base}let prefix=`${mods.join("+")}+`,prefixed=base.map((n)=>prefix+n);if(evt.shift&&name!==void 0&&name.length===1&&evt.source==="kitty")return[...base.map((n)=>`${mods.join("+")}+shift+${n}`),...prefixed];return prefixed}function prefixAction(run){return{run}}function insertRegistration(stack,reg){if(reg.modalOwner!==void 0){let firstMember=stack.findIndex((r)=>r.modalMember===reg.modalOwner);if(firstMember>=0){stack.splice(firstMember,0,reg);return}}stack.push(reg)}var dispatching=!1,DEFAULT_PREFIX_CONFIGURATION={key:"ctrl+a",timeoutMs:5000},prefixConfiguration={...DEFAULT_PREFIX_CONFIGURATION},prefixArmedAt=null,prefixArmedKey="",prefixArmedOnPassthrough=!1,prefixArmedOptions=[],prefixTimer=null;function configurePrefix(next){prefixConfiguration={...next},resetPrefixState()}function resetPrefixConfiguration(){prefixConfiguration={...DEFAULT_PREFIX_CONFIGURATION},resetPrefixState()}function currentPrefixConfiguration(){return prefixConfiguration}function prefixFirstStrokes(config=prefixConfiguration){if(config.key===null)return[];return[config.key,...config.extraKeys??[]]}function resetPrefixState(){if(prefixTimer!==null)clearTimeout(prefixTimer);prefixTimer=null,prefixArmedAt=null,prefixArmedOnPassthrough=!1,prefixArmedOptions=[],prefixHudSetArmed(!1)}function armPrefix(now,options,inputPassthrough,armedKey=prefixConfiguration.key??""){resetPrefixState(),prefixArmedAt=now,prefixArmedKey=armedKey,prefixArmedOnPassthrough=inputPassthrough,prefixArmedOptions=options.slice(),prefixTimer=setTimeout(resetPrefixState,prefixConfiguration.timeoutMs),prefixHudSetArmed(!0,options,now)}function armPrefixNow(snapshot,now=Date.now()){if(prefixConfiguration.key===null)return!1;let reach=scanReachability(snapshot);if(!reach.prefixReachable)return!1;return armPrefix(now,reach.prefixOptions,reach.inputPassthrough),!0}function invokeArmedPrefixAction(bindingStack,actionId,stroke,now=Date.now()){if(dispatching||prefixArmedAt===null)return!1;let snapshot=bindingStack.slice(),armedPrefixKey=prefixArmedKey,validOption=prefixArmedOptions.some((option)=>option.action===actionId&&option.stroke===stroke),expired=now-prefixArmedAt>prefixConfiguration.timeoutMs,crossedBoundary=inputPassthroughReachable(snapshot)!==prefixArmedOnPassthrough;if(!validOption||expired||crossedBoundary)return resetPrefixState(),!1;let hit=null;for(let i=snapshot.length-1;i>=0;i--){let reg=snapshot[i];if(!reg)continue;let cfg=reg.config();if(cfg.enabled===!1)continue;let candidate=cfg.bindings.find((binding)=>binding.prefix===!0&&binding.key===stroke);if(candidate){if(candidate.id===actionId)hit=candidate;break}if(cfg.modal)break}if(!hit?.action)return resetPrefixState(),!1;resetPrefixState(),dispatching=!0;try{return hit.action.run(),prefixHudPush({prefixKey:armedPrefixKey,stroke,action:actionId,at:now}),!0}finally{dispatching=!1}}var shadowWarned=new Set;function warnShadowedMatch(snapshot,hitIndex,candidates,prefix){for(let j=hitIndex-1;j>=0;j--){let cfg=snapshot[j]?.config();if(!cfg||cfg.enabled===!1)continue;let shadowed=cfg.bindings.find((b)=>Boolean(b.prefix)===prefix&&candidates.includes(b.key));if(shadowed){if(!shadowWarned.has(shadowed.key))shadowWarned.add(shadowed.key),console.error(`[rove keymap] "${shadowed.key}" matched two ENABLED bindings \u2014 the lower one is shadowed by LIFO order. Gate one of them off (see tui-react/lib/keymap.ts header).`);return}if(cfg.modal)return}}function dispatchMode(snapshot,evt,candidates,prefix,runCmd){for(let i=snapshot.length-1;i>=0;i--){let reg=snapshot[i];if(!reg)continue;let cfg=reg.config();if(cfg.enabled===!1)continue;let hit;for(let candidate of candidates)if(hit=cfg.bindings.find((binding)=>Boolean(binding.prefix)===prefix&&binding.key===candidate),hit)break;if(hit){if(hit.yieldToPassthrough&&inputPassthroughReachable(snapshot))continue;if(!cfg.modal&&isDev())warnShadowedMatch(snapshot,i,candidates,prefix);return runCmd(()=>hit.cmd(evt,hit.slot)),hit}if(cfg.modal)return null}return null}function dispatchKeyEvent(bindingStack,evt,now=Date.now(),opts){if(evt.defaultPrevented||dispatching)return!1;if(isKittyModifierKeyName(evt.name))return evt.preventDefault(),!0;let snapshot=bindingStack.slice(),candidates=matchKey(evt),runCmd=opts?.flushSync??((fn)=>fn());dispatching=!0;try{if(prefixArmedAt!==null&&inputPassthroughReachable(snapshot)!==prefixArmedOnPassthrough)resetPrefixState();if(prefixArmedAt!==null){let armedPrefixKey=prefixArmedKey,expired=now-prefixArmedAt>prefixConfiguration.timeoutMs;if(prefixArmedAt=null,expired)resetPrefixState();else{if(candidates.includes("escape"))return resetPrefixState(),evt.preventDefault(),!0;resetPrefixState();let hit=dispatchMode(snapshot,evt,candidates,!0,runCmd);return prefixHudPush({prefixKey:armedPrefixKey,stroke:candidates[0]??"",action:hit?hit.id??hit.key:null,at:now}),evt.preventDefault(),!0}}let firstStroke=prefixFirstStrokes().find((key)=>candidates.includes(key));if(firstStroke!==void 0){if(prefixReachable(snapshot)){let reach=scanReachability(snapshot);return armPrefix(now,reach.prefixOptions,reach.inputPassthrough,firstStroke),evt.preventDefault(),!0}}let direct=dispatchMode(snapshot,evt,candidates,!1,runCmd);if(direct){if(direct.id&&direct.key.includes("+")&&!direct.key.startsWith("shift+"))prefixHudPush({prefixKey:"",stroke:direct.key,action:direct.id??direct.key,at:now});return evt.preventDefault(),!0}return!1}finally{dispatching=!1}}async function restoreTerminal(renderer){if(!renderer)return;try{if(renderer.destroy(),!renderer.closed)return;await Promise.race([renderer.closed,new Promise((resolve)=>setTimeout(resolve,2000))])}catch(err){console.error("Rove: terminal restore failed:",err)}}var MOD_ALIASES={ctrl:"ctrl",control:"ctrl",ctl:"ctrl",cmd:"cmd",command:"cmd",meta:"cmd",super:"cmd",win:"cmd",alt:"alt",option:"alt",opt:"alt",shift:"shift"},KEY_ALIASES={esc:"escape",spacebar:"space",pgup:"pageup",pgdn:"pagedown",pgdown:"pagedown"},KNOWN_NAMED_KEYS=new Set(["up","down","left","right","pageup","pagedown","home","end","insert","delete","backspace","tab","space","escape","enter","return",...Array.from({length:12},(_,i)=>`f${i+1}`)]),MOD_ORDER=["ctrl","cmd","alt","shift"];function normalizeChord(raw){let rawTrimmed=raw.trim(),upperLetterKey=rawTrimmed.length===1&&rawTrimmed>="A"&&rawTrimmed<="Z",trimmed=raw.trim().toLowerCase();if(!trimmed)return{error:"empty chord"};let parts=trimmed.split("+"),key=parts.pop()??"";if(key===""&&parts.length>0&&parts[parts.length-1]==="")key="+",parts.pop();if(!key)return{error:`"${raw}": no key after the modifiers`};let mods=new Set;for(let part of parts){let mod=MOD_ALIASES[part];if(!mod)return{error:`"${raw}": unknown modifier "${part}" (use ctrl / cmd / alt / shift)`};mods.add(mod)}if(key=KEY_ALIASES[key]??key,upperLetterKey)mods.add("shift");if(mods.has("shift")&&mods.size>1&&key.length===1)return{error:`"${raw}": shift with other modifiers on a single character can never match \u2014 legacy terminals send the same byte with and without shift`};let prefix=MOD_ORDER.filter((m)=>mods.has(m)).join("+"),chord=prefix?`${prefix}+${key}`:key;if(key.length>1&&!KNOWN_NAMED_KEYS.has(key))return{chord,warning:`"${raw}": unrecognized key name "${key}" \u2014 the chord may never fire`};return{chord}}function platformSectionNames(platform){if(platform==="darwin")return["darwin","macos","mac"];if(platform==="win32")return["win32","windows"];return[platform]}function extractBindingsMap(section){if(!isObject(section))return null;let nested=section.bindings;if(isObject(nested))return nested;return section}function extractKeybindingOverrides(doc,platform){let warnings=[];if(doc===null||doc===void 0)return{entries:[],prefixEntries:[],warnings};if(!isObject(doc))return{entries:[],prefixEntries:[],warnings:["config root must be a YAML mapping (e.g. a top-level `bindings:` key)"]};let merged=new Map,prefixMerged=new Map,layers=[];if(doc.bindings!==void 0)if(isObject(doc.bindings))layers.push(doc.bindings);else warnings.push("`bindings:` must be a mapping of id \u2192 chord(s)");for(let name of platformSectionNames(platform)){let section=doc[name];if(section===void 0)continue;let map=extractBindingsMap(section);if(map)layers.push(map);else warnings.push(`\`${name}:\` must be a mapping (or contain a \`bindings:\` mapping)`)}for(let layer of layers)for(let[id,value]of Object.entries(layer)){let modeValues=isObject(value)&&(("direct"in value)||("prefix"in value))?[[merged,value.direct],[prefixMerged,value.prefix]]:[[merged,value]];for(let[target,modeValue]of modeValues){if(modeValue===void 0)continue;if(modeValue===null||modeValue===!1||Array.isArray(modeValue)&&modeValue.length===0){target.set(id,[]);continue}let rawChords=typeof modeValue==="string"?[modeValue]:Array.isArray(modeValue)?modeValue:null;if(!rawChords){warnings.push(`${id}: expected a chord string, a list of chords, or null \u2014 got ${typeof modeValue}`);continue}let chords=[],anyError=!1;for(let rawChord of rawChords){if(typeof rawChord!=="string"){warnings.push(`${id}: chord entries must be strings`),anyError=!0;continue}let result=normalizeChord(rawChord);if("error"in result){warnings.push(`${id}: ${result.error}`),anyError=!0;continue}if(result.warning)warnings.push(`${id}: ${result.warning}`);if(!chords.includes(result.chord))chords.push(result.chord)}if(chords.length===0&&anyError){warnings.push(`${id}: no valid chords \u2014 keeping the default`);continue}target.set(id,chords)}}return{entries:Array.from(merged,([id,keys])=>({id,keys})),prefixEntries:Array.from(prefixMerged,([id,keys])=>({id,keys})),warnings}}function pairContract(first,second){let layout=`alternating [${first}, ${second}] pairs`;return{layout,slots:[first,second],validateCount:(count)=>count>=2&&count%2===0?null:`needs ${layout} (an even number of chords \u2014 got ${count})`}}var SLOT_CONTRACTS={"sidebar.goto":pairContract("top (double-tap)","bottom"),"sidebar.nav":pairContract("down","up"),"files.nav":pairContract("down","up"),"diff.review.cursor":pairContract("down","up"),"sidebar.search.nav":pairContract("down","up"),"files.search.nav":pairContract("down","up"),"files.hierarchy":pairContract("collapse","expand"),"files.tab":pairContract("previous tab","next tab"),"app.quit":{layout:"[quit confirm, hard exit] (second chord optional)",validateCount:(count)=>count<=2?null:`needs [quit confirm, hard exit] (1 or 2 chords \u2014 got ${count})`}};function recordSlotLabels(id){return SLOT_CONTRACTS[id]?.slots??[]}var NO_BARE_LETTER_SCOPES=new Set(["global","workspace","terminal"]);function scopesOverlap(a,b){return a===b||a==="global"||b==="global"}function applyKeymapOverrides(keymap,entries){let warnings=[],applied=[];for(let entry of entries){let row=keymap.find((b)=>b.id===entry.id);if(!row){warnings.push(`${entry.id}: unknown binding id (press F1 in Rove for the full list)`);continue}if(row.keys.length===0&&row.prefixKeys===void 0){warnings.push(`${entry.id}: not customizable \u2014 the key is handled outside the keymap (doc-only row)`);continue}let contract=SLOT_CONTRACTS[entry.id];if(contract&&entry.keys.length>0){let problem=contract.validateCount(entry.keys.length);if(problem){warnings.push(`${entry.id}: ${problem} \u2014 keeping the default`);continue}}let keys=entry.keys.filter((chord)=>{if((chord.length===1||chord.startsWith("shift+")&&chord.length===7)&&!row.bareKeys&&NO_BARE_LETTER_SCOPES.has(row.scope))return warnings.push(`${entry.id}: "${chord}" dropped \u2014 a bare character on a ${row.scope}-scope binding would steal typed input (add a modifier)`),!1;return!0});if(keys.length===0&&entry.keys.length>0){warnings.push(`${entry.id}: no chords survived validation \u2014 keeping the default`);continue}if(contract&&keys.length!==entry.keys.length){warnings.push(`${entry.id}: a dropped chord would shift the slot layout (${contract.layout}) \u2014 keeping the default`);continue}let defaultKeys=row.keys,mutable=row;if(mutable.keys=keys,row.hint)if(keys.length===0)mutable.hint=void 0;else row.hint.keys=keys.join("/");applied.push({id:entry.id,keys,defaultKeys})}for(let change of applied)for(let chord of change.keys){let owner=keymap.find((b)=>b.id===change.id);if(!owner)continue;for(let other of keymap){if(other.id===change.id)continue;if(!other.keys.includes(chord))continue;if(!scopesOverlap(owner.scope,other.scope))continue;warnings.push(`${change.id}: "${chord}" also fires ${other.id} (${other.scope} scope) \u2014 last registration wins; consider a different chord`)}}return{applied,warnings}}var PLATFORM_SECTIONS={darwin:["darwin","macos","mac"],linux:["linux"],win32:["win32","windows"]},VALUE_RE=/^(pane|action):\s*([A-Za-z0-9][A-Za-z0-9._:-]*\.[A-Za-z0-9][A-Za-z0-9_:-]*)$/;function sectionOf(doc,key){if(typeof doc!=="object"||doc===null)return null;let section=doc[key];if(typeof section!=="object"||section===null||Array.isArray(section))return null;return section}function collect(section,into,warnings){for(let[rawChord,rawValue]of Object.entries(section)){if(typeof rawValue!=="string"){warnings.push(`plugins: ${rawChord}: value must be a "pane:<id>" or "action:<id>" string`);continue}let match=rawValue.trim().match(VALUE_RE);if(!match){warnings.push(`plugins: ${rawChord}: \`${rawValue}\` is not pane:<plugin-id>.<local-id> or action:<...>`);continue}let chord=normalizeChord(rawChord);if("error"in chord){warnings.push(`plugins: ${rawChord}: ${chord.error}`);continue}if(chord.warning)warnings.push(`plugins: ${rawChord}: ${chord.warning}`);into.set(chord.chord,{chord:chord.chord,kind:match[1],target:match[2].trim()})}}function extractPluginKeybindings(doc,platform){let warnings=[],byChord=new Map,base=sectionOf(doc,"plugins");if(base)collect(base,byChord,warnings);for(let alias of PLATFORM_SECTIONS[platform]??[]){let overlaySection=sectionOf(doc,alias),overlay=overlaySection?sectionOf(overlaySection,"plugins"):null;if(overlay)collect(overlay,byChord,warnings)}return{entries:[...byChord.values()],warnings}}function platformKeys(platform){if(platform==="darwin")return["darwin","macos","mac"];if(platform==="win32")return["win32","windows"];return[platform]}function collectEntries(source,warnings){let out=new Map;if(source===void 0)return out;if(!isObject(source))return warnings.push("prefix.bindings must be a mapping of binding id to chord(s)"),out;for(let[id,raw]of Object.entries(source)){if(raw===null||Array.isArray(raw)&&raw.length===0){out.set(id,[]);continue}let rawKeys=typeof raw==="string"?[raw]:Array.isArray(raw)?raw:null;if(!rawKeys||rawKeys.some((key)=>typeof key!=="string")){warnings.push(`prefix.bindings.${id} must be a chord string, a string list, null, or []`);continue}let keys=[],anyError=!1;for(let rawKey of rawKeys){let normalized=normalizeChord(rawKey);if("error"in normalized){warnings.push(`prefix.bindings.${id}: ${normalized.error}`),anyError=!0;continue}if(!keys.includes(normalized.chord))keys.push(normalized.chord);if(normalized.warning)warnings.push(`prefix.bindings.${id}: ${normalized.warning}`)}if(keys.length===0&&anyError){warnings.push(`prefix.bindings.${id}: no valid chords \u2014 keeping the default`);continue}out.set(id,keys)}return out}function prefixChord(raw,warnings){let normalized=normalizeChord(raw);if("error"in normalized)warnings.push(`prefix.key: ${normalized.error}`);else if(!normalized.chord.includes("+"))warnings.push("prefix.key must include a modifier");else return normalized.chord;return null}function mergePrefixKey(raw,configuration,warnings){if(raw===null||Array.isArray(raw)&&raw.length===0){configuration.key=null,configuration.extraKeys=void 0;return}let rawKeys=typeof raw==="string"?[raw]:Array.isArray(raw)?raw:null;if(!rawKeys||rawKeys.some((key)=>typeof key!=="string")){warnings.push("prefix.key must be a modifier chord, a list of them, or null");return}let keys=[];for(let rawKey of rawKeys){let chord=prefixChord(rawKey,warnings);if(chord!==null&&!keys.includes(chord))keys.push(chord)}let[primary,...extra]=keys;if(primary===void 0)return;if(configuration.key=primary,extra.length>0)configuration.extraKeys=extra;else configuration.extraKeys=void 0}function mergePrefixBlock(raw,configuration,entries,warnings){if(raw===void 0)return;if(!isObject(raw)){warnings.push("prefix must be a mapping");return}if("key"in raw)mergePrefixKey(raw.key,configuration,warnings);if("timeoutMs"in raw)if(typeof raw.timeoutMs!=="number"||!Number.isInteger(raw.timeoutMs)||raw.timeoutMs<100||raw.timeoutMs>1e4)warnings.push("prefix.timeoutMs must be an integer from 100 to 10000");else configuration.timeoutMs=raw.timeoutMs;for(let[id,keys]of collectEntries(raw.bindings,warnings))entries.set(id,keys)}function extractPrefixKeybindings(doc,platform){let configuration={},warnings=[],entries=new Map;if(!isObject(doc)){if(doc!==null&&doc!==void 0)warnings.push("keybindings document must be a mapping");return{configuration,entries:[],warnings}}mergePrefixBlock(doc.prefix,configuration,entries,warnings);for(let key of platformKeys(platform)){let overlay=doc[key];if(isObject(overlay))mergePrefixBlock(overlay.prefix,configuration,entries,warnings)}return{configuration,entries:[...entries].map(([id,keys])=>({id,keys})),warnings}}function applyPrefixKeymapOverrides(keymap,entries){let applied=[],warnings=[];for(let entry of entries){let row=keymap.find((candidate)=>candidate.id===entry.id);if(!row){warnings.push(`${entry.id}: unknown binding id`);continue}let mutable=row,defaultKeys=[...row.prefixKeys??[]];mutable.prefixKeys=[...entry.keys],applied.push({id:entry.id,keys:[...entry.keys],defaultKeys})}return{applied,warnings}}function resolveUserKeybindings(file,keymap,platform){if(!file.exists)return{report:{path:file.path,exists:!1,applied:[],plugins:[],warnings:[]},prefix:{...DEFAULT_PREFIX_CONFIGURATION}};let warnings=[...file.warnings],extracted=extractKeybindingOverrides(file.doc,platform);warnings.push(...extracted.warnings);let prefix=extractPrefixKeybindings(file.doc,platform);warnings.push(...prefix.warnings);let prefixConfiguration2={...DEFAULT_PREFIX_CONFIGURATION,...prefix.configuration},result=applyKeymapOverrides(keymap,extracted.entries);warnings.push(...result.warnings);let applied=[...result.applied],customPrefix=prefix.configuration.key===void 0?[]:prefixFirstStrokes(prefixConfiguration2);for(let prefixKey of customPrefix){let directOwner=keymap.find((row)=>row.keys.includes(prefixKey));if(directOwner)warnings.push(`prefix.key "${prefixKey}" collides with direct binding ${directOwner.id}`)}let prefixResult=applyPrefixKeymapOverrides(keymap,[...extracted.prefixEntries,...prefix.entries]);warnings.push(...prefixResult.warnings),applied.push(...prefixResult.applied);let plugins=extractPluginKeybindings(file.doc,platform);warnings.push(...plugins.warnings);for(let p of plugins.entries){let owner=keymap.find((row)=>row.keys.includes(p.chord));if(owner)warnings.push(`plugins: ${p.chord} shadows ${owner.id}`)}return{report:{path:file.path,exists:!0,applied,plugins:plugins.entries,warnings},prefix:prefixConfiguration2}}import{existsSync,readFileSync}from"fs";var cached=null;function resetKeybindingsFileCache(){cached=null}function resolveConfigFile(){let canonical=keybindingsConfigPath();if(existsSync(canonical))return{canonical,found:canonical};let yml=canonical.replace(/\.yaml$/,".yml");if(existsSync(yml))return{canonical,found:yml};return{canonical,found:null}}function readKeybindingsFile(){if(cached)return cached;let{canonical,found}=resolveConfigFile();if(!found)return cached={path:canonical,exists:!1,source:null,doc:null,warnings:[]},cached;let warnings=[],doc=null;try{let text=readFileSync(found,"utf8");doc=Bun.YAML.parse(text)}catch(err){let msg=errorMessage(err);warnings.push(`could not read/parse ${found}: ${msg}`)}return cached={path:canonical,exists:!0,source:found,doc,warnings},cached}var CHAT_BINDINGS=[{id:"chat.tab.new",scope:"workspace",keys:["ctrl+t"],category:"Workspace",description:"New chat tab",hint:{keys:"ctrl+t"},presentation:"onePress"},{id:"chat.tab.chooseEngine",scope:"workspace",keys:["ctrl+e"],category:"Workspace",description:"New conversation \u2014 engine/shell picker with destination + context toggles",hint:{keys:"ctrl+e"},presentation:"onePress"},{id:"chat.tab.fork",scope:"workspace",keys:[],prefixKeys:["c"],category:"Workspace",description:"Fork this chat into a new tab (same Task directory, keeps the conversation)",hint:{keys:"ctrl+a c"}},{id:"chat.fork.new",scope:"workspace",keys:[],prefixKeys:["f"],category:"Workspace",description:"Quick-fork: create child task seeded with current repo/branch/model",hint:{keys:"ctrl+a f"}},{id:"chat.tab.close",scope:"workspace",keys:["ctrl+w"],prefixKeys:["w"],category:"Workspace",description:"Close chat tab",hint:{keys:"ctrl+w"},presentation:"onePress"},{id:"workspace.reopenSession",scope:"workspace",keys:["return"],category:"Workspace",description:"Reopen a session in a task whose tabs are all closed",hint:{keys:"enter"},presentation:"onePress"},{id:"chat.tab.rename",scope:"workspace",keys:["f2"],category:"Workspace",description:"Rename active chat tab",hint:{keys:"f2"},presentation:"onePress"},{id:"chat.tab.cycle-next",scope:"workspace",keys:["ctrl+]"],category:"Workspace",description:"Next chat tab",hint:{keys:"ctrl+]"},presentation:"onePress"},{id:"chat.tab.cycle-prev",scope:"workspace",keys:["ctrl+["],category:"Workspace",description:"Previous chat tab",hint:{keys:"ctrl+["},presentation:"onePress"},{id:"chat.tab.goto",scope:"workspace",keys:["1","2","3","4","5","6","7","8","9"].map((digit)=>`ctrl+${digit}`),category:"Workspace",description:"Go to chat tab N",hint:{keys:"ctrl+1-9"},presentation:"onePress"},{id:"workspace.split.right",scope:"workspace",keys:["ctrl+\\"],category:"Workspace",description:"Split right",hint:{keys:"ctrl+\\"},presentation:"onePress"},{id:"workspace.split.down",scope:"workspace",keys:["ctrl+="],category:"Workspace",description:"Split down",hint:{keys:"ctrl+="},presentation:"onePress"},{id:"workspace.split.focus-next",scope:"workspace",keys:["f3"],category:"Workspace",description:"Focus next split",hint:{keys:"f3"},presentation:"onePress"},{id:"workspace.split.close",scope:"workspace",keys:["ctrl+w"],prefixKeys:["w"],category:"Workspace",description:"Close active split (tab when unsplit)",hint:{keys:"ctrl+w"},presentation:"onePress"},{id:"workspace.split.rename",scope:"workspace",keys:["f2"],category:"Workspace",description:"Rename active split (tab when unsplit)",hint:{keys:"f2"},presentation:"onePress"}];var FILES_BINDINGS=[{id:"files.nav",scope:"files",keys:["j","k","down","up"],category:"Files",description:"Move cursor up/down",hint:{keys:"j/k"}},{id:"files.hierarchy",scope:"files",keys:["h","l","left","right"],category:"Files",description:"Collapse / expand tree level",hint:{keys:"h/l"}},{id:"files.open",scope:"files",keys:["return"],category:"Files",description:"Open file in configured editor (diff when supported)",hint:{keys:"enter"}},{id:"files.tab",scope:"files",keys:["[","]"],category:"Files",description:"Switch tab (cycle All / Changes)",hint:{keys:"[/]"}},{id:"files.refresh",scope:"files",keys:["r"],category:"Files",description:"Refresh",hint:{keys:"r"}},{id:"files.scope",scope:"files",keys:["b"],category:"Files",description:"Toggle Changes scope (working \u2194 branch vs base)",hint:{keys:"b"}},{id:"files.diff",scope:"files",keys:["d"],category:"Files",description:"Open read-only diff in a workspace tab",hint:{keys:"d"}},{id:"files.diffAll",scope:"files",keys:["shift+d"],category:"Files",description:"Open the whole worktree's diff in one workspace tab",hint:{keys:"D"}},{id:"files.openExternal",scope:"files",keys:["o"],category:"Files",description:"Open file in system default app (audio / video / pdf preview)",hint:{keys:"o"}},{id:"files.mention",scope:"files",keys:["a"],category:"Files",description:"Inject @<path> mention into the engine pane",hint:{keys:"a"}},{id:"files.search.enter",scope:"files",keys:["/"],category:"Files",description:"Search file names and text",hint:{keys:"/"}},{id:"files.hidden",scope:"files",keys:["."],category:"Files",description:"Show or hide dot files and folders on the All tab",hint:{keys:"."}},{id:"files.changesView",scope:"files",keys:["t"],category:"Files",description:"Show Changes as a folder tree or a flat list",hint:{keys:"t"}},{id:"files.search.nav",scope:"files",keys:["down","up"],category:"Files",description:"Move highlight in file search results"},{id:"files.search.submit",scope:"files",keys:["return"],category:"Files",description:"Open the highlighted search result"},{id:"files.search.cancel",scope:"files",keys:["escape"],category:"Files",description:"Close file search"},{id:"files.createPR",scope:"global",keys:[],prefixKeys:["p","shift+p"],category:"Files",description:"Ask the agent to create a PR from the current task"},{id:"files.fixChecks",scope:"global",keys:[],prefixKeys:["k"],category:"Files",description:"Ask the agent to fix the failing PR checks"},{id:"files.syncBase",scope:"global",keys:[],prefixKeys:["u"],category:"Files",description:"Merge the base branch into this task's worktree"},{id:"diff.review.cursor",scope:"workspace",keys:["j","k","down","up"],bareKeys:!0,category:"Diff review",description:"Move the line cursor over the diff",hint:{keys:"j/k"}},{id:"diff.review.range",scope:"workspace",keys:["v"],bareKeys:!0,category:"Diff review",description:"Toggle range anchor at the cursor",hint:{keys:"v"}},{id:"diff.review.note",scope:"workspace",keys:["c"],bareKeys:!0,category:"Diff review",description:"Add a review note at the cursor",hint:{keys:"c"}},{id:"diff.review.send",scope:"workspace",keys:["s"],bareKeys:!0,category:"Diff review",description:"Send all unsent review notes to the engine",hint:{keys:"s"}},{id:"diff.review.drop",scope:"workspace",keys:["x"],bareKeys:!0,category:"Diff review",description:"Drop the review note the cursor sits inside",hint:{keys:"x"}},{id:"diff.review.reload",scope:"workspace",keys:["r"],bareKeys:!0,category:"Diff review",description:"Reload the previewed file from disk",hint:{keys:"r"}}];var INBOX_BINDINGS=[{id:"inbox.show",scope:"global",keys:[],prefixKeys:["i"],category:"Global",description:"Open Inbox"},{id:"inbox.nav",scope:"inbox",keys:["j","k","down","up"],category:"Inbox",description:"Move cursor up/down",hint:{keys:"j/k"}},{id:"inbox.open",scope:"inbox",keys:["return"],category:"Inbox",description:"Open the selected Task and Terminal Tab",hint:{keys:"enter"}},{id:"inbox.delete",scope:"inbox",keys:["d"],category:"Inbox",description:"Ack the selected Inbox item",hint:{keys:"d"}},{id:"inbox.deleteAll",scope:"inbox",keys:["shift+d"],category:"Inbox",description:"Ack every ATTENTION item",hint:{keys:"D"}}];var SIDEBAR_BINDINGS=[{id:"sidebar.nav",scope:"sidebar",keys:["j","k","down","up"],category:"Sidebar",description:"Move cursor up/down",hint:{keys:"j/k"}},{id:"sidebar.select",scope:"sidebar",keys:["return"],category:"Sidebar",description:"Open the selected task",hint:{keys:"enter"}},{id:"sidebar.tree.open",scope:"sidebar",keys:["l","space"],category:"Sidebar",description:"Open the row under the cursor (a tab row enters its chat)",hint:{keys:"l"}},{id:"sidebar.goto",scope:"sidebar",keys:["g","shift+g"],category:"Sidebar",description:"Top / bottom of list (gg or shift-G)"},{id:"sidebar.rename",scope:"sidebar",keys:["r"],category:"Sidebar",description:"Rename task",hint:{keys:"r"}},{id:"sidebar.localMerge",scope:"sidebar",keys:["shift+m"],category:"Sidebar",description:"Reorder row (Shift+M, then j/k)",hint:{keys:"M"}},{id:"sidebar.pin",scope:"sidebar",keys:["shift+p"],category:"Sidebar",description:"Pin / unpin task at top (Shift+P)",hint:{keys:"P"}},{id:"sidebar.sort",scope:"sidebar",keys:["t"],category:"Sidebar",description:"Cycle task sort (default \u2192 recent \u2192 attention \u2192 name)",hint:{keys:"t"}},{id:"sidebar.delete",scope:"sidebar",keys:["d"],category:"Sidebar",description:"Remove session (with confirm)",hint:{keys:"d"}},{id:"sidebar.search.enter",scope:"sidebar",keys:["/"],category:"Sidebar",description:"Search tasks (fuzzy filter)",hint:{keys:"/"}},{id:"sidebar.search.nav",scope:"sidebar",keys:["down","up"],category:"Sidebar",description:"Move highlight in search results"},{id:"sidebar.search.submit",scope:"sidebar",keys:["return"],category:"Sidebar",description:"Select search match and exit search"},{id:"sidebar.search.cancel",scope:"sidebar",keys:["escape"],category:"Sidebar",description:"Cancel search (restore prior selection)"},{id:"tasks.openWorktree",scope:"sidebar",keys:["o"],category:"Tasks pane",description:"Open selected Task directory in your editor",hint:{keys:"o"}},{id:"tasks.renameBranch",scope:"sidebar",keys:["b"],category:"Tasks pane",description:"Rename the selected task's git branch",hint:{keys:"b"}},{id:"tasks.cycleEngine",scope:"sidebar",keys:["v"],category:"Tasks pane",description:"Cycle engine vendor \u2014 applies on reopen",hint:{keys:"v"}},{id:"tasks.update",scope:"sidebar",keys:["u"],category:"Tasks pane",description:"Open the update page \u2014 version check + release notes",hint:{keys:"u"}},{id:"tasks.focusEngine",scope:"sidebar",keys:["right"],category:"Tasks pane",description:"Focus the engine pane of the current window",hint:{keys:"\u2192"}}];var RoveKeymap=[{id:"palette.open",scope:"global",keys:[],prefixKeys:["/"],category:"Global",description:"Search commands"},{id:"help.open",scope:"global",keys:["f1"],category:"Global",description:"Show keybindings help",hint:{keys:"F1"},presentation:"onePress"},{id:"task.new",scope:"sidebar",keys:["n"],category:"Sidebar",description:"New task",hint:{keys:"n"}},{id:"task.new.global",scope:"global",keys:[],prefixKeys:["n"],category:"Global",description:"New task"},{id:"task.openEditor",scope:"global",keys:[],prefixKeys:["o"],category:"Global",description:"Open active Task directory in editor"},{id:"task.moveMode",scope:"global",keys:[],prefixKeys:["m"],category:"Global",description:"Reorder sidebar rows (then j/k)"},{id:"settings.open",scope:"global",keys:[],prefixKeys:[","],category:"Global",description:"Open settings"},{id:"app.refresh",scope:"global",keys:[],prefixKeys:["r"],category:"Global",description:"Refresh Rove onto the installed build (after an update)"},{id:"settings.open.sidebar",scope:"sidebar",keys:["s"],category:"Sidebar",description:"Open settings",hint:{keys:"s"}},{id:"worktrees.open.sidebar",scope:"sidebar",keys:["x"],category:"Sidebar",description:"Open worktrees",hint:{keys:"x"}},{id:"kanban.open",scope:"global",keys:[],prefixKeys:["1"],category:"Global",description:"Open kanban (issues board)"},{id:"automations.open",scope:"global",keys:[],prefixKeys:["2"],category:"Global",description:"Open routines (scheduled tasks)"},{id:"workItems.open",scope:"global",keys:[],prefixKeys:["3"],category:"Global",description:"Open GitHub issues (external tracker)"},{id:"app.quit",scope:"sidebar",keys:["q","ctrl+q"],category:"Sidebar",description:"Quit (with confirm)",hint:{keys:"q"}},{id:"focus.sidebar",scope:"workspace",keys:["ctrl+q"],prefixKeys:["q"],category:"Workspace",description:"Back to sidebar (tasks)",hint:{keys:"ctrl+q"},presentation:"onePress"},{id:"focus.previous",scope:"global",keys:[],prefixKeys:["h"],category:"Navigation",description:"Focus previous pane (files \u2192 workspace \u2192 sidebar)"},{id:"focus.next",scope:"global",keys:["f4"],prefixKeys:["l"],category:"Navigation",description:"Focus next pane (sidebar \u2192 workspace \u2192 files)",hint:{keys:"f4"},presentation:"onePress"},{id:"attention.next",scope:"global",keys:["f7"],category:"Navigation",description:"Jump to the next available Inbox item",hint:{keys:"f7"},presentation:"onePress"},{id:"task.previous",scope:"global",keys:[],prefixKeys:["tab"],category:"Navigation",description:"Back to the previous task"},{id:"workspace.filesToggle",scope:"global",keys:[],prefixKeys:["z"],category:"Navigation",description:"Show or hide the Files pane"},{id:"view.redraw",scope:"global",keys:[],prefixKeys:["r"],category:"Global",description:"Redraw the screen"},...SIDEBAR_BINDINGS,...CHAT_BINDINGS,...FILES_BINDINGS,...INBOX_BINDINGS,{id:"terminal.scroll-up",scope:"terminal",keys:["ctrl+pageup"],category:"Terminal",description:"Scroll scrollback up",hint:{keys:"ctrl+pgup"}},{id:"terminal.scroll-down",scope:"terminal",keys:["ctrl+pagedown"],category:"Terminal",description:"Scroll scrollback down"},{id:"terminal.reset",scope:"terminal",keys:["f5"],category:"Terminal",description:"Reset terminal \u2014 kill the current shell and respawn",hint:{keys:"f5"},presentation:"onePress"}];var KEYMAP_DEFAULTS=new Map(RoveKeymap.map((b)=>[b.id,{keys:[...b.keys],prefixKeys:b.prefixKeys&&[...b.prefixKeys],hint:b.hint?{...b.hint}:void 0}]));function defaultKeymapCopy(){return RoveKeymap.map((row)=>{let def=KEYMAP_DEFAULTS.get(row.id);return{id:row.id,scope:row.scope,category:row.category,...row.bareKeys?{bareKeys:!0}:{},keys:[...def?.keys??[]],...def?.prefixKeys?{prefixKeys:[...def.prefixKeys]}:{},...def?.hint?{hint:{...def.hint}}:{}}})}function defaultChordsOf(id){return KEYMAP_DEFAULTS.get(id)?.keys??[]}function resetKeymapToDefaults(){for(let row of RoveKeymap){let def=KEYMAP_DEFAULTS.get(row.id);if(!def)continue;let mutable=row;mutable.keys=[...def.keys],mutable.prefixKeys=def.prefixKeys&&[...def.prefixKeys],mutable.hint=def.hint?{...def.hint}:void 0}}var keymapVersionValue=0,keymapVersionListeners=new Set;function keymapVersion(){return keymapVersionValue}function subscribeKeymapVersion(listener){return keymapVersionListeners.add(listener),()=>{keymapVersionListeners.delete(listener)}}function bumpKeymapVersion(){keymapVersionValue+=1;for(let listener of[...keymapVersionListeners])listener()}var KEYMAP_BY_ID=new Map(RoveKeymap.map((b)=>[b.id,b]));function findBinding(id){return KEYMAP_BY_ID.get(id)}function bindByIds(handlers){let out=[];for(let id in handlers){let handler=handlers[id];if(!handler)continue;let action=typeof handler==="function"?void 0:handler,cmd=typeof handler==="function"?handler:()=>handler.run(),binding=findBinding(id),chords=binding?.keys??[],prefixChords=binding?.prefixKeys??[];if(chords.length===0&&prefixChords.length===0){console.warn(`[rove/keybindings] bindByIds: id="${id}" has no chords (or doesn't exist in RoveKeymap)`);continue}chords.forEach((key,slot)=>out.push({key,cmd,action,slot,id,yieldToPassthrough:binding?.yieldToPassthrough})),prefixChords.forEach((key,slot)=>out.push({key,prefix:!0,cmd,action,slot,id}))}return out}import{mkdirSync as mkdirSync2,readFileSync as readFileSync2,writeFileSync as writeFileSync2}from"fs";import{dirname as dirname2}from"path";import{existsSync as existsSync2,mkdirSync,writeFileSync}from"fs";import{dirname}from"path";var KEYBINDINGS_STARTER=`# Rove keybindings \u2014 every line below is an example, commented out.
|
|
139
139
|
# Uncomment what you want; changes reload live, no restart.
|
|
140
140
|
# Press F1 in Rove for the live keymap with every binding id.
|
|
141
141
|
#
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{getGlobalDefaultVendor,getLastActiveVendor,resolvePreferredVendor,setGlobalDefaultVendor,setLastActiveVendor}from"./chunk-ez623zqp.js";import"./chunk-w70anvs6.js";import"./chunk-4csg29es.js";import"./chunk-h8qg9v95.js";import"./chunk-1wpwxcg9.js";import"./chunk-12qq8r81.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.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";export{setLastActiveVendor,setGlobalDefaultVendor,resolvePreferredVendor,getLastActiveVendor,getGlobalDefaultVendor};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{stampOrigin}from"./chunk-
|
|
2
|
+
import{stampOrigin}from"./chunk-0x3vfkz9.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};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var PROVIDER_ID_PATTERN=/^[a-z0-9][a-z0-9_-]{0,63}$/,ENV_VAR_PATTERN=/^[A-Za-z_][A-Za-z0-9_]*$/,FORBIDDEN_CONFIG_KEY_NAMES=new Set(["apikey","api_key","secret","token","password","auth"]),FORBIDDEN_HEADER_NAMES=new Set(["authorization","x-api-key","api-key","proxy-authorization"]),DEFAULT_PROVIDER_GATEWAY_CONFIG={enabled:!1,host:"127.0.0.1",port:0,injectMode:"headless",cooldownMs:60000,maxCooldownMs:300000,requestTimeoutMs:120000,providers:[]};function isPlainObject(value){return Boolean(value)&&typeof value==="object"&&!Array.isArray(value)}function isLoopbackHostname(hostname){let bare=hostname.toLowerCase().replace(/^\[|\]$/g,"");return bare==="127.0.0.1"||bare==="::1"||bare==="localhost"}function validateProviderBaseUrl(raw){let trimmed=raw.trim();if(!trimmed)return{ok:!1,error:"baseUrl is required"};let parsed;try{parsed=new URL(trimmed)}catch{return{ok:!1,error:`baseUrl is not a valid URL: "${trimmed}"`}}if(parsed.username||parsed.password)return{ok:!1,error:"baseUrl must not contain embedded credentials"};if(parsed.protocol==="https:")return{ok:!0,url:trimmed.replace(/\/+$/,"")};if(parsed.protocol==="http:"){if(!isLoopbackHostname(parsed.hostname))return{ok:!1,error:`plain http:// baseUrl is only permitted for loopback hosts (got "${parsed.hostname}")`};return{ok:!0,url:trimmed.replace(/\/+$/,"")}}return{ok:!1,error:`baseUrl must use https:// (or http:// on loopback), got "${parsed.protocol}"`}}function validateBindHost(raw){if(raw==="127.0.0.1"||raw==="::1")return raw;return null}function validateProviderId(raw){return PROVIDER_ID_PATTERN.test(raw)}function clampInt(raw,fallback,min,max){if(typeof raw!=="number"||!Number.isFinite(raw))return fallback;let rounded=Math.round(raw);return Math.max(min,Math.min(max,rounded))}function parseProviderEntry(raw,index,seenIds,warnings){if(!isPlainObject(raw))return warnings.push(`providerGateway.providers[${index}] must be an object`),null;for(let key of Object.keys(raw))if(FORBIDDEN_CONFIG_KEY_NAMES.has(key.toLowerCase()))return warnings.push(`providerGateway.providers[${index}] contains forbidden credential field "${key}" \u2014 store keys in OS Keychain or use apiKeyEnv`),null;let id=typeof raw.id==="string"?raw.id.trim():"";if(!validateProviderId(id))return warnings.push(`providerGateway.providers[${index}] has invalid id "${id}" (use lowercase letters, digits, -, _)`),null;if(seenIds.has(id))return warnings.push(`providerGateway.providers[${index}] duplicates provider id "${id}"`),null;let protocol=raw.protocol;if(protocol!=="anthropic"&&protocol!=="openai")return warnings.push(`provider "${id}" has invalid protocol "${String(protocol)}" (expected "anthropic" or "openai")`),null;let urlCheck=typeof raw.baseUrl==="string"?validateProviderBaseUrl(raw.baseUrl):{ok:!1,error:"baseUrl is required"};if(!urlCheck.ok)return warnings.push(`provider "${id}": ${urlCheck.error}`),null;let rawModels=Array.isArray(raw.models)?raw.models.filter((m)=>typeof m==="string"&&m.trim().length>0).map((m)=>m.trim()):[];if(rawModels.length===0)return warnings.push(`provider "${id}" must list at least one model (or "*")`),null;let priority=typeof raw.priority==="number"&&Number.isFinite(raw.priority)?Math.round(raw.priority):100,enabled=typeof raw.enabled==="boolean"?raw.enabled:!0,modelMap;if(isPlainObject(raw.modelMap)){modelMap={};for(let[from,to]of Object.entries(raw.modelMap))if(typeof to==="string"&&from.trim()&&to.trim())modelMap[from.trim()]=to.trim();if(Object.keys(modelMap).length===0)modelMap=void 0}let extraHeaders;if(isPlainObject(raw.extraHeaders)){extraHeaders={};for(let[name,value]of Object.entries(raw.extraHeaders)){if(typeof value!=="string"||!name.trim())continue;if(FORBIDDEN_HEADER_NAMES.has(name.trim().toLowerCase())){warnings.push(`provider "${id}" ignored forbidden auth header "${name}" in extraHeaders`);continue}extraHeaders[name.trim()]=value}if(Object.keys(extraHeaders).length===0)extraHeaders=void 0}let apiKeyEnv;if(typeof raw.apiKeyEnv==="string"&&raw.apiKeyEnv.trim()){let candidate=raw.apiKeyEnv.trim();if(ENV_VAR_PATTERN.test(candidate))apiKeyEnv=candidate;else warnings.push(`provider "${id}" ignored invalid apiKeyEnv "${candidate}"`)}let keychainAccount=typeof raw.keychainAccount==="string"&&raw.keychainAccount.trim()?raw.keychainAccount.trim():void 0;return seenIds.add(id),{id,protocol,baseUrl:urlCheck.url,priority,models:rawModels,...modelMap?{modelMap}:{},...keychainAccount?{keychainAccount}:{},...apiKeyEnv?{apiKeyEnv}:{},enabled,...extraHeaders?{extraHeaders}:{}}}function parseProviderGatewayConfig(raw){if(raw===void 0||raw===null)return{config:DEFAULT_PROVIDER_GATEWAY_CONFIG,warnings:[]};let warnings=[];if(!isPlainObject(raw))return warnings.push("providerGateway must be an object; falling back to disabled"),{config:DEFAULT_PROVIDER_GATEWAY_CONFIG,warnings};let enabled=typeof raw.enabled==="boolean"?raw.enabled:!1,host="127.0.0.1";if(raw.host!==void 0){let validHost=validateBindHost(raw.host);if(validHost)host=validHost;else warnings.push(`providerGateway.host "${String(raw.host)}" is not a literal loopback IP ("127.0.0.1" or "::1"); forcing "127.0.0.1"`)}let port=0;if(raw.port!==void 0)if(typeof raw.port==="number"&&Number.isInteger(raw.port)&&raw.port>=0&&raw.port<=65535)port=raw.port;else warnings.push(`providerGateway.port "${String(raw.port)}" must be an integer 0..65535; using 0 (ephemeral)`);let injectMode="headless";if(raw.injectMode!==void 0)if(raw.injectMode==="headless"||raw.injectMode==="off")injectMode=raw.injectMode;else warnings.push(`providerGateway.injectMode "${String(raw.injectMode)}" must be "headless" or "off"; using "headless"`);let cooldownMs=clampInt(raw.cooldownMs,60000,1000,3600000),maxCooldownMs=Math.max(cooldownMs,clampInt(raw.maxCooldownMs,300000,1000,3600000)),requestTimeoutMs=clampInt(raw.requestTimeoutMs,120000,1000,600000),providers=[],seenIds=new Set;if(Array.isArray(raw.providers))for(let i=0;i<raw.providers.length;i++){let entry=parseProviderEntry(raw.providers[i],i,seenIds,warnings);if(entry)providers.push(entry)}else if(raw.providers!==void 0)warnings.push("providerGateway.providers must be an array");return{config:{enabled,host,port,injectMode,cooldownMs,maxCooldownMs,requestTimeoutMs,providers},warnings}}function validateProviderInput(input){let id=input.id.trim();if(!validateProviderId(id))return{ok:!1,error:`invalid provider id "${id}" \u2014 use lowercase letters, digits, "-" and "_"`};if(input.protocol!=="anthropic"&&input.protocol!=="openai")return{ok:!1,error:`invalid protocol "${input.protocol}" \u2014 expected "anthropic" or "openai"`};let urlCheck=validateProviderBaseUrl(input.baseUrl);if(!urlCheck.ok)return{ok:!1,error:urlCheck.error};let models=input.models.map((m)=>m.trim()).filter(Boolean);if(models.length===0)return{ok:!1,error:'at least one model pattern is required (or "*")'};let priority=input.priority===void 0?100:Math.round(input.priority);if(!Number.isFinite(priority))return{ok:!1,error:"priority must be a finite integer"};let apiKeyEnv=input.apiKeyEnv?.trim()||void 0;if(apiKeyEnv&&!ENV_VAR_PATTERN.test(apiKeyEnv))return{ok:!1,error:`invalid apiKeyEnv "${apiKeyEnv}" \u2014 expected an environment variable name`};let modelMap=input.modelMap&&Object.keys(input.modelMap).length>0?{...input.modelMap}:void 0;return{ok:!0,provider:{id,protocol:input.protocol,baseUrl:urlCheck.url,priority,models,...modelMap?{modelMap}:{},...apiKeyEnv?{apiKeyEnv}:{},enabled:!0}}}
|
|
3
|
+
export{DEFAULT_PROVIDER_GATEWAY_CONFIG,validateBindHost,validateProviderId,parseProviderGatewayConfig,validateProviderInput};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{RoveDaemonClient}from"./chunk-
|
|
2
|
+
import{RoveDaemonClient}from"./chunk-vpy8tvfy.js";import{defaultDaemonSocketPath,defaultPtyHostSocketPath}from"./chunk-gvxchzch.js";import{spawn}from"child_process";import{existsSync}from"fs";import{join}from"path";var LAUNCH_CMD_ENV="ROVE_LAUNCH_CMD",LAUNCH_LOG_ENV="ROVE_LAUNCH_LOG",WIN_DETACHED_LAUNCHER_PS=`
|
|
3
3
|
$ErrorActionPreference = 'Stop'
|
|
4
4
|
$cmd = $env:${LAUNCH_CMD_ENV}
|
|
5
5
|
$log = $env:${LAUNCH_LOG_ENV}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{connectIfRunning,connectOrStartDaemon}from"./chunk-
|
|
2
|
+
import{connectIfRunning,connectOrStartDaemon}from"./chunk-06cpc990.js";async function openDaemonSession(opts={}){let client=opts.mode==="require-running"?await connectIfRunning():await connectOrStartDaemon();if(!client)return null;return{client,close:()=>client.close()}}async function resolveActiveTaskId(client){let activeId=null,off=client.onChannel("active-task",(payload)=>{activeId=payload.taskId});try{await client.subscribe()}finally{off()}return activeId}
|
|
3
3
|
export{openDaemonSession,resolveActiveTaskId};
|
package/dist/cli/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{isPathLikeArg}from"./chunk-
|
|
4
|
-
`)}var bridge=()=>import("./chunk-
|
|
5
|
-
`);async function runAddSubcommand(rest){let arg=rest[0];if(arg==="--help"||arg==="-h"||arg==="help"){process.stdout.write(ADD_USAGE);return}if(arg==="--remote"){let{runAddRemote}=await import("./chunk-
|
|
3
|
+
import{isPathLikeArg}from"./chunk-etj5h8hg.js";import{matchPathGlob}from"./chunk-kg11c1py.js";import{expandTilde}from"./chunk-grbrh92f.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{rejectionReason}from"./chunk-1wpwxcg9.js";import{CURRENT_VERSION}from"./chunk-aterhn60.js";import{switchFlag}from"./chunk-78y80xe8.js";import{BUILTIN_VENDORS,coerceVendorId,isBuiltinVendor}from"./chunk-8q0nmdh3.js";import"./chunk-pn5ygqn6.js";import"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{resolve}from"path";var DYNAMIC_COMMANDS=new Map([["_acp-bridge",async(args)=>{let{runAcpBridgeSubcommand}=await import("./chunk-451z1265.js");await runAcpBridgeSubcommand(args)}],["_trust-claude-worktree",async(paths)=>{let{trustClaudeWorktree}=await import("./chunk-v2vs5nzx.js");for(let path of paths)try{trustClaudeWorktree(path)}catch{}}],["completions",async(args)=>{let{runCompletionsSubcommand}=await import("./chunk-bz3p5vp1.js");await runCompletionsSubcommand(args)}],["export",async(args)=>{let{runExportSubcommand}=await import("./chunk-bche07fb.js");await runExportSubcommand(args)}],["repo",async(args)=>{let{runRepoSubcommand}=await import("./chunk-5jevazzh.js");await runRepoSubcommand(args)}],["api",async(args)=>{let{runApiSubcommand}=await import("./chunk-expgczbc.js");await runApiSubcommand(args)}],["update",async(args)=>{let{runUpdateSubcommand}=await import("./chunk-j6g8jmke.js");await runUpdateSubcommand(args)}],["theme",async(args)=>{let{runThemeSubcommand}=await import("./chunk-3wkjeqt5.js");await runThemeSubcommand(args)}],["feedback",async(args)=>{let{runFeedbackSubcommand}=await import("./chunk-k1pk159f.js");await runFeedbackSubcommand(args)}],["daemon",async(args)=>{let{runDaemonSubcommand}=await import("./chunk-7vassnhs.js");await runDaemonSubcommand(args)}],["gateway",async(args)=>{let{runGatewaySubcommand}=await import("./chunk-bxabhkaq.js");await runGatewaySubcommand(args)}],["machine",async(args)=>{let{runMachineSubcommand}=await import("./chunk-teq8p5rp.js");await runMachineSubcommand(args)}],["weixin",async(args)=>{let{runConnectorCli}=await import("./chunk-ene2k7kb.js");await runConnectorCli("weixin",args)}],["lark",async(args)=>{let{runConnectorCli}=await import("./chunk-ene2k7kb.js");await runConnectorCli("lark",args)}],["inbox",async(args)=>{let{runInboxSubcommand}=await import("./chunk-m932h3dx.js");await runInboxSubcommand(args)}],["doctor",async(args)=>{let{runDoctorSubcommand}=await import("./chunk-3yd8nyv6.js");await runDoctorSubcommand(args)}],["config",async(args)=>{let{runConfigSubcommand}=await import("./chunk-t9vpmnbc.js");await runConfigSubcommand(args)}],["reset",async(args)=>{let{runResetSubcommand}=await import("./chunk-mp535p99.js");await runResetSubcommand(args)}],["pty-host",async(args)=>{let{runPtyHostSubcommand}=await import("./chunk-6qp32yje.js");await runPtyHostSubcommand(args)}],["skill",async(args)=>{let{runSkillSubcommand}=await import("./chunk-rt4bsvd5.js");await runSkillSubcommand(args)}],["plugin",async(args)=>{let{runPluginSubcommand}=await import("./chunk-w3dpq6aj.js");await runPluginSubcommand(args)}],["remote-workspace",async(args)=>{let{runRemoteWorkspaceSubcommand}=await import("./chunk-cqazrkzw.js");await runRemoteWorkspaceSubcommand(args)}],["hook",async(args)=>{let{runHookSubcommand}=await import("./chunk-4g1466qe.js");await runHookSubcommand(args)}]]);function topLevelUsage(cliName=ROVE_PRODUCT_NAME){return[`${cliName} ${CURRENT_VERSION}`,"",`Usage: ${cliName} [command] [options]`,"","Run with no command to launch PureTUI.",`Run \`${cliName} .\` (or \`${cliName} <path>\`) to open a directory as a standalone task.`,"","Commands:"," completions <shell> Generate shell completion script (bash/zsh/fish)"," add [path] Save a repo path for the new-task picker"," remove [path] Forget a saved project (inverse of add; non-destructive)"," adopt [glob] Import existing git worktrees as tasks"," export [--csv|--json] Print the task list (json/csv/table; daemon-free)"," repo <verb> Per-repo init script + first prompt (show|set|unset)",` api <verb> Scriptable RPC surface for agents (see \`${cliName} api --help\`)`," daemon <verb> Manage the daemon (start|stop|status|restart|autostart)"," gateway <verb> Optional local loopback provider gateway (status|enable|add|set-key|\u2026)"," machine <verb> Other computers running Rove (add|doctor|remove|list)"," weixin <verb> Talk to Rove from WeChat (login|logout|status|allow|deny|send|agent)"," lark <verb> Talk to Rove from Lark (connect|disconnect|status|allow|deny|tone)"," inbox <verb> Encrypted inbox outside agents post to (token|rotate|send)"," doctor [--report|--fix] Diagnose daemon/PTY/engines/git; --fix walks the remedies",` config [--path] Open ${cliName}'s config file (state.json) in your editor`," reset [--hard] Stop runtimes; optionally wipe task/UI state"," theme <verb> Manage user themes (list|add|import|remove)",` skill <verb> Install the ${cliName} agent skill (install|status|command|print)`," plugin <verb> Install and run plugins (install|link|list|action|\u2026)"," feedback File a GitHub issue on the Rove repo",` update [version|channel|list] Self-update ${cliName}, switch channel, or list versions`,"","Options:"," -v, --version Print version"," -h, --help Print this help"," --skill Print the agent skill file and exit"," --web [bridge flags] Serve the browser client on 127.0.0.1 and print its link"].join(`
|
|
4
|
+
`)}var bridge=()=>import("./chunk-887ysmy5.js"),CLI_NAME=ROVE_PRODUCT_NAME,ADD_USAGE=[`Usage: ${CLI_NAME} add [path]`,` ${CLI_NAME} add --remote --host <host> --user <user> --path <basePath> [--port N] [--key [path] | --password]`,"","Save a repo for the new-task picker. With --remote, register an SSH-backed","project whose worktrees live on <host>; engine launch over SSH is pending.",""].join(`
|
|
5
|
+
`);async function runAddSubcommand(rest){let arg=rest[0];if(arg==="--help"||arg==="-h"||arg==="help"){process.stdout.write(ADD_USAGE);return}if(arg==="--remote"){let{runAddRemote}=await import("./chunk-z4nk2g47.js");await runAddRemote(rest.slice(1));return}if(arg?.startsWith("-"))process.stderr.write(`${CLI_NAME} add: unknown flag "${arg}"
|
|
6
6
|
|
|
7
|
-
${ADD_USAGE}`),process.exit(2);let target=resolve(process.cwd(),expandTilde(arg&&arg.length>0?arg:".")),{addSavedRepo}=await import("./chunk-
|
|
7
|
+
${ADD_USAGE}`),process.exit(2);let target=resolve(process.cwd(),expandTilde(arg&&arg.length>0?arg:".")),{addSavedRepo}=await import("./chunk-599msv9a.js"),result=addSavedRepo(target);if(result.rejected)process.stderr.write(`${CLI_NAME} add: "${arg&&arg.length>0?arg:"."}" cannot be a project \u2014 ${rejectionReason(result.rejected)} (resolved to ${result.path}).
|
|
8
8
|
`),process.exit(1);if(result.added)console.log(`added ${result.path} (${result.total} saved repo${result.total===1?"":"s"} total)`);else console.log(`already saved: ${result.path}`);await adoptAllWorktrees(result.path)}var PURGE_FLAG="--purge-credentials",REMOVE_USAGE=[`Usage: ${CLI_NAME} remove [path] [--purge-credentials]`,"","Forget a saved project (drop it from the new-task picker). Non-destructive:","the repo's files, worktrees, branches and tasks all stay on disk. A remote","(ssh://) project also has its stored connection config dropped.",""," path defaults to the current directory. Pass an exact saved entry (e.g. a"," remote `ssh://user@host` key) to remove it verbatim. Run with no match to"," print the current saved projects.",""," --purge-credentials also delete the remote project's SSH password from"," the OS keychain. Off by default: forgetting a project"," should not silently destroy a stored secret.",""].join(`
|
|
9
9
|
`);async function runRemoveSubcommand(rest){let purgeCredentials=switchFlag(rest,PURGE_FLAG),arg=rest.filter((a)=>a!==PURGE_FLAG&&!a.startsWith(`${PURGE_FLAG}=`))[0];if(arg==="--help"||arg==="-h"||arg==="help"){process.stdout.write(REMOVE_USAGE);return}if(purgeCredentials===void 0)process.stderr.write(`${CLI_NAME} remove: ${PURGE_FLAG} takes true or false
|
|
10
10
|
|
|
11
11
|
${REMOVE_USAGE}`),process.exit(2);if(arg?.startsWith("-"))process.stderr.write(`${CLI_NAME} remove: unknown flag "${arg}"
|
|
12
12
|
|
|
13
|
-
${REMOVE_USAGE}`),process.exit(2);let{getRemoteRepoConfig,getSavedRepos,resolveRepoRoot}=await import("./chunk-
|
|
13
|
+
${REMOVE_USAGE}`),process.exit(2);let{getRemoteRepoConfig,getSavedRepos,resolveRepoRoot}=await import("./chunk-599msv9a.js"),saved=getSavedRepos();if(saved.length===0){console.log("no saved projects to remove.");return}let raw=arg&&arg.length>0?arg:".",target=saved.includes(raw)?raw:(()=>{let abs=resolve(process.cwd(),expandTilde(raw)),top=resolveRepoRoot(abs);if(saved.includes(top))return top;if(saved.includes(abs))return abs;return null})();if(target===null){process.stderr.write(`${CLI_NAME} remove: "${raw}" is not a saved project.
|
|
14
14
|
|
|
15
15
|
Saved projects:
|
|
16
16
|
`);for(let p of saved)process.stderr.write(` ${p}
|
|
@@ -19,8 +19,8 @@ Saved projects:
|
|
|
19
19
|
|
|
20
20
|
${ADOPT_USAGE}
|
|
21
21
|
`),process.exit(2)}async function runAdoptSubcommand(args){let glob,repoArg,vendorArg,yes=!1;for(let i=0;i<args.length;i++){let a=args[i];if(a==="--help"||a==="-h"||a==="help"){process.stdout.write(`${ADOPT_USAGE}
|
|
22
|
-
`);return}if(a==="--repo"){if(repoArg=args[++i],repoArg===void 0)adoptUsageError("--repo requires a value")}else if(a==="--vendor"){if(vendorArg=args[++i],vendorArg===void 0)adoptUsageError("--vendor requires a value")}else if(a==="--yes"||a==="-y")yes=!0;else if(a&&!a.startsWith("-")&&glob===void 0)glob=a;else adoptUsageError(`unexpected argument "${a}"`)}let{getCustomEngineIds,resolveRepoRoot}=await import("./chunk-
|
|
22
|
+
`);return}if(a==="--repo"){if(repoArg=args[++i],repoArg===void 0)adoptUsageError("--repo requires a value")}else if(a==="--vendor"){if(vendorArg=args[++i],vendorArg===void 0)adoptUsageError("--vendor requires a value")}else if(a==="--yes"||a==="-y")yes=!0;else if(a&&!a.startsWith("-")&&glob===void 0)glob=a;else adoptUsageError(`unexpected argument "${a}"`)}let{getCustomEngineIds,resolveRepoRoot}=await import("./chunk-599msv9a.js"),repo=resolveRepoRoot(resolve(process.cwd(),expandTilde(repoArg&&repoArg.length>0?repoArg:"."))),typed=vendorArg?.trim();if(typed&&!isBuiltinVendor(typed)&&!getCustomEngineIds().includes(typed)){let known=[...BUILTIN_VENDORS,...getCustomEngineIds()].join(", ");adoptUsageError(`unknown engine "${typed}" \u2014 no task was created. Known engines: ${known}`)}let vendor=coerceVendorId(vendorArg),orch=await(await bridge()).openLocalOrchestrator(),worktrees=await orch.discoverAdoptableWorktrees(repo);if(worktrees.length===0){console.log(`no adoptable worktrees for ${repo} \u2014 every git worktree here is already a task`);return}let isMatch=(w)=>!glob||matchPathGlob(glob,w.path);console.log(`adoptable worktrees in ${repo}:`);for(let w of worktrees){let hit=glob?isMatch(w)?"*":" ":"-",tags=[w.dirty===!0?"dirty":w.dirty===null?"dirty?":"",w.roveManaged?"":"external"].filter(Boolean).join(",");console.log(` ${hit} ${w.branch} ${w.path}${tags?` (${tags})`:""}`)}if(!glob){console.log(`
|
|
23
23
|
pass a path glob to adopt, e.g. ${CLI_NAME} adopt '${repo}/*' --yes`);return}let matched=worktrees.filter(isMatch);if(matched.length===0){console.log(`
|
|
24
24
|
no worktrees match glob ${JSON.stringify(glob)}`);return}if(!yes){console.log(`
|
|
25
25
|
${matched.length} worktree(s) match \u2014 re-run with --yes to adopt them`);return}await adoptWorktreesInto(orch,repo,matched,vendor),console.log(`done \u2014 adopted ${matched.length} worktree(s)`)}function printTopLevelUsage(out){out.write(`${topLevelUsage()}
|
|
26
|
-
`)}var COMMANDS=new Map([["add",runAddSubcommand],["remove",runRemoveSubcommand],["adopt",runAdoptSubcommand],...DYNAMIC_COMMANDS]);async function main(){let[,,...rawArgs]=process.argv,[subcommand,...rest]=rawArgs;if(subcommand==="--version"||subcommand==="-v"||subcommand==="version"){let{CURRENT_VERSION:CURRENT_VERSION2}=await import("./chunk-
|
|
26
|
+
`)}var COMMANDS=new Map([["add",runAddSubcommand],["remove",runRemoveSubcommand],["adopt",runAdoptSubcommand],...DYNAMIC_COMMANDS]);async function main(){let[,,...rawArgs]=process.argv,[subcommand,...rest]=rawArgs;if(subcommand==="--version"||subcommand==="-v"||subcommand==="version"){let{CURRENT_VERSION:CURRENT_VERSION2}=await import("./chunk-v29v0cgd.js");console.log(`${CLI_NAME} ${CURRENT_VERSION2}`);return}if(subcommand==="--help"||subcommand==="-h"||subcommand==="help"){printTopLevelUsage(process.stdout);return}if(subcommand==="--skill"){let{runSkillSubcommand}=await import("./chunk-rt4bsvd5.js");await runSkillSubcommand(["print"]);return}if(subcommand==="--web"){let{runWebSubcommand}=await import("./chunk-z3cje8hk.js");await runWebSubcommand(rest);return}let handler=subcommand!==void 0?COMMANDS.get(subcommand):void 0;if(handler){await handler(rest);return}if(subcommand!==void 0&&isPathLikeArg(subcommand)){let{runOpenDirectory}=await import("./chunk-0mdzphdz.js");await runOpenDirectory(subcommand);return}if(subcommand!==void 0)console.error(`${CLI_NAME}: unknown command '${subcommand}'`),printTopLevelUsage(process.stderr),process.exit(2);let{publishRoveTerminalTitle}=await import("./chunk-g8wrdp7n.js");publishRoveTerminalTitle();let{launchTui}=await import("./chunk-ep7abg35.js");await launchTui()}var cliDone=main().catch(async(err)=>{let{formatCliFailure}=await import("./chunk-7709m234.js");console.error(formatCliFailure(err,{cliName:CLI_NAME,argv:process.argv,cwd:process.cwd(),env:process.env})),process.exit(1)});export{cliDone};
|
|
@@ -756,7 +756,6 @@ async function ensureOwnerOnlyDir(dir) {
|
|
|
756
756
|
function ensureOwnerOnlyStateDir(homeDir) {
|
|
757
757
|
return ensureOwnerOnlyDir(join5(homeDir, ROVE_STATE_DIR_BASENAME));
|
|
758
758
|
}
|
|
759
|
-
|
|
760
759
|
// ../rove-daemon/src/daemon/automation-contracts.ts
|
|
761
760
|
var ROUTINE_RESPONSE_WINDOW_MS = 2 * 60 * 60000;
|
|
762
761
|
// ../rove-daemon/src/daemon/delivery-contracts.ts
|
|
@@ -815,6 +814,7 @@ var BLOCKING_RPCS = new Set([
|
|
|
815
814
|
"task.land",
|
|
816
815
|
"workitem.start",
|
|
817
816
|
"automation.runNow",
|
|
817
|
+
"automation.emitEvent",
|
|
818
818
|
"task.startScheduledNow",
|
|
819
819
|
"task.resumeQuota",
|
|
820
820
|
"pr.rerunFailedChecks",
|
package/dist/cli/rove-run.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{updateStateFile}from"./chunk-
|
|
3
|
+
import{updateStateFile}from"./chunk-12qq8r81.js";import{migrateRoveClientStateLayout}from"./chunk-8rxg12aj.js";import{isObject}from"./chunk-a6z2ggxd.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import"./chunk-gvxchzch.js";import{kvStatePath}from"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{readFileSync}from"fs";var RENAMED_KEY_PREFIXES=[{from:"autoEffort.",to:"autoRouting."}],NOTHING={moved:0,superseded:0};function legacyRename(key){for(let{from,to}of RENAMED_KEY_PREFIXES)if(key.startsWith(from))return`${to}${key.slice(from.length)}`;return}function isStateObject(text){try{let parsed=JSON.parse(text);return isObject(parsed)}catch{return!1}}function migrateRenamedStateKeys(){let text;try{text=readFileSync(kvStatePath(),"utf8")}catch{return NOTHING}if(!RENAMED_KEY_PREFIXES.some(({from})=>text.includes(`"${from}`)))return NOTHING;if(!isStateObject(text))return NOTHING;let moved=0,superseded=0;try{updateStateFile((state)=>{for(let[key,value]of Object.entries(state)){let renamed=legacyRename(key);if(renamed===void 0)continue;if(renamed in state)superseded+=1;else state[renamed]=value,moved+=1;delete state[key]}return moved+superseded>0})}catch{return NOTHING}return{moved,superseded}}function prepareCliStateLayout(env=process.env){let result=migrateRoveClientStateLayout(env);for(let warning of result.warnings)console.error(`[rove] state migration will retry: ${warning}. Check the source/destination permissions, then relaunch Rove.`);migrateRenamedStateKeys()}prepareCliStateLayout();await import("./index.js");
|
package/dist/cli/rove.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{join as u}from"node:path";import{createInterface as a}from"node:readline/promises";import{pathToFileURL as ss}from"node:url";import{spawnSync as z}from"node:child_process";import{constants as O,accessSync as P}from"node:fs";import{homedir as V}from"node:os";import{basename as R,delimiter as I,dirname as U,join as W}from"node:path";import{fileURLToPath as j}from"node:url";var
|
|
3
|
-
`)[0]?.trim()??""};function k(s){return s.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function $(s,t=v){let c=k(s),b=k(t);if(!c||!b)return!0;let r=c.split(".").map(Number),i=b.split(".").map(Number);for(let g=0;g<3;g++){let y=r[g]??0,p=i[g]??0;if(y!==p)return y>p}return!0}function d(s=process.env){return s[C]==="1"}function H(s={}){let t=s.env??process.env,c=s.platform??process.platform,b=s.home??t.HOME??t.USERPROFILE??V(),r=B(c),i=[],g=t[x]?.trim();if(g)i.push(g);for(let
|
|
4
|
-
`)}function
|
|
2
|
+
import{join as u}from"node:path";import{createInterface as a}from"node:readline/promises";import{pathToFileURL as ss}from"node:url";import{spawnSync as z}from"node:child_process";import{constants as O,accessSync as P}from"node:fs";import{homedir as V}from"node:os";import{basename as R,delimiter as I,dirname as U,join as W}from"node:path";import{fileURLToPath as j}from"node:url";var Y="rove";var o=Y;var Z={$schema:"https://json.schemastore.org/package.json",name:"@sma1lboy/rove",version:"0.9.310",description:"Rove: all your coding agents, in one place. An agentic development environment (ADE) for your terminal: Claude Code, Codex, Copilot and more, side by side in isolated worktrees, handing tasks to each other.",keywords:["terminal","tui","cli","ade","agentic-development-environment","multiplexer","ai-agents","coding-agent","ai-coding-assistant","agentic-ai","parallel-agents","git-worktree","claude-code","codex","llm","developer-tools"],type:"module",packageManager:"bun@1.3.13",bin:{rove:"dist/cli/rove.js"},files:["dist/cli","dist/completions","dist/web","dist/web-ui","dist/skills","dist/voice","dist/*.wav","README.md","LICENSE"],publishConfig:{access:"public"},repository:{type:"git",url:"git+https://github.com/Sma1lboy/rove.git"},homepage:"https://rove.run",bugs:{url:"https://github.com/Sma1lboy/rove/issues"},engines:{bun:">=1.3.11"},scripts:{dev:"ROVE_DEV=1 bun --conditions=browser ./src/cli/rove.ts","dev:mock":"ROVE_DEV=1 bun ./src/tui-react/mock/host.tsx","dev:sandbox":"bun run scripts/dev-sandbox.ts run","dev:sandbox:reset":"bun run scripts/dev-sandbox.ts reset",build:"bun run scripts/build.ts","build:rubric":"bun run scripts/build-tier-rubric.ts",compile:"bun run scripts/compile.ts",typecheck:"tsc --noEmit","check-i18n":"bun run scripts/check-i18n.ts",test:"bun run test:fast && bun run test:socket","perf:golden":"bun scripts/perf-golden.ts","rove-bench":"bun --conditions=browser scripts/rove-bench.ts","pty:soak":"bun scripts/pty-soak.ts","test:fast":"vitest run --passWithNoTests --minWorkers=1 --maxWorkers=8","test:socket":"ROVE_INCLUDE_SOCKET=1 vitest run test/daemon --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:socket:coverage":"ROVE_INCLUDE_SOCKET=1 ROVE_COVERAGE_DAEMON=1 vitest run test/daemon --coverage --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:behavior":"ROVE_INCLUDE_BEHAVIOR=1 vitest run test/behavior --pool forks --minWorkers=1 --maxWorkers=1 --retry=2 --passWithNoTests","test:render":"bun scripts/render-track.mjs",coverage:"vitest run --coverage --passWithNoTests",bench:"vitest bench --run",lint:"biome check .",knip:"knip-bun","check:preview-deps":"bun run scripts/check-preview-deps.ts",prepublishOnly:"bun run typecheck && bun run build","plugin-sandbox":"bun run scripts/plugin-sandbox.ts"},"//":"biome.json + bunfig.toml live at the monorepo root since they apply repo-wide; bun.lock also lives at root (workspace-shared).",dependencies:{"@ansi-tools/parser":"^1.0.15","@opentui/core":"0.8.4","@opentui/react":"0.8.4","@xterm/addon-serialize":"^0.14.0","@xterm/addon-unicode11":"^0.9.0","@xterm/headless":"^6.0.0",react:"^19.2.8","smol-toml":"^1.7.1",ws:"^8.21.3",yaml:"^2.9.0"},optionalDependencies:{"@sma1lboy/opentui-rove-darwin-arm64":"0.8.4-rove.1","@sma1lboy/opentui-rove-linux-x64":"0.8.4-rove.1","node-pty":"^1.1.0"},devDependencies:{"@biomejs/biome":"1.9.4","@sma1lboy/rove-api":"0.0.1","@sma1lboy/rove-client":"0.0.1","@sma1lboy/rove-core":"0.0.1","@sma1lboy/rove-daemon":"0.7.23","@tsconfig/bun":"1.0.11","@types/bun":"1.3.14","@types/node":"25.6.2","@types/react":"^19.2.0","@vitest/coverage-v8":"2.1.9",knip:"^6.14.2","react-devtools-core":"^7.0.1","rove-bridge":"0.0.71","rove-lark":"0.0.6","rove-weixin":"0.0.71",typescript:"5.8.2",vitest:"2.1.9"},trustedDependencies:[]};var x="ROVE_BUN",_="ROVE_NO_BUN_BOOTSTRAP",C="ROVE_SKIP_BUN_CHECK",v=Z.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0",G=(s)=>{try{return P(s,O.X_OK),!0}catch{return!1}},B=(s)=>s==="win32"?"bun.exe":"bun",f=(s)=>{let t=z(s,["--version"],{encoding:"utf8",timeout:5000});if(t.error||t.status!==0)return null;return t.stdout?.split(`
|
|
3
|
+
`)[0]?.trim()??""};function k(s){return s.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function $(s,t=v){let c=k(s),b=k(t);if(!c||!b)return!0;let r=c.split(".").map(Number),i=b.split(".").map(Number);for(let g=0;g<3;g++){let y=r[g]??0,p=i[g]??0;if(y!==p)return y>p}return!0}function d(s=process.env){return s[C]==="1"}function H(s={}){let t=s.env??process.env,c=s.platform??process.platform,b=s.home??t.HOME??t.USERPROFILE??V(),r=B(c),i=[],g=t[x]?.trim();if(g)i.push(g);for(let X of(t.PATH??t.Path??"").split(I))if(X)i.push(W(X,r));let y=t.BUN_INSTALL?.trim();if(y)i.push(W(y,"bin",r));if(b)i.push(W(b,".bun","bin",r));let p=s.launcherDir;if(p)i.push(W(p,"..","..","node_modules","bun","bin",r)),i.push(W(p,"..","..","..","bun","bin",r));return i}function N(s={}){let t=s.isExecutable??G;return H(s).find((c)=>t(c))??null}function J(s={}){let t=s.isExecutable??G,c=s.bunVersionOf??f;if(d(s.env??process.env))return{bun:N(s),stale:null,unusable:null};let b=null,r=null;for(let i of H(s)){if(!t(i))continue;let g=c(i);if(g===null){r??=i;continue}if($(g))return{bun:i,stale:b,unusable:r};b??={path:i,version:k(g)??g}}return{bun:null,stale:b,unusable:r}}function m(s){return U(j(s))}function q(s){return R(j(s)).replace(/\.[cm]?[jt]s$/,"")}function n(s=process.platform){return s==="win32"?["powershell","-NoProfile","-Command","irm bun.sh/install.ps1 | iex"]:["bash","-c","curl -fsSL https://bun.sh/install | bash"]}function A(s=o,t=process.platform){let c=t==="win32"?'powershell -c "irm bun.sh/install.ps1 | iex"':"curl -fsSL https://bun.sh/install | bash";return[`${s}: Rove runs on the Bun runtime, and no Bun was found on this machine.`,"","Install Bun, then run this command again:",` ${c}`," npm install -g bun # any platform, if you already have npm","","Or install Bun and Rove together in one step:"," curl -fsSL https://rove.run/install.sh | sh","",`Already have Bun somewhere unusual? Point Rove at it: ${x}=/path/to/bun`,""].join(`
|
|
4
|
+
`)}function Q(s,t,c=o){return[`${c}: this machine's Bun is too old for Rove — found ${t} at ${s}, need ${v} or newer.`,"","Rove's terminals are built on Bun's PTY API. An older Bun ignores it silently,","so every terminal and engine tab would open empty and stay empty.","","Upgrade Bun, then run this command again:"," bun upgrade # Bun installed itself (~/.bun)"," brew upgrade bun # Homebrew"," npm install -g bun@latest # npm-managed Bun","",`Have a newer Bun elsewhere? Point Rove at it: ${x}=/path/to/bun`,`Run on this one anyway (unsupported, terminals will be blank): ${C}=1`,""].join(`
|
|
5
5
|
`)}function K(s,t=o){return[`${t}: the Bun at ${s} could not be run — \`${s} --version\` failed or never returned.`,"","Rove skipped it rather than starting through it, which would hang or fail","with a message from that binary instead of this one.","","Reinstall Bun, then run this command again:"," curl -fsSL https://bun.sh/install | bash","",`Have a working Bun elsewhere? Point Rove at it: ${x}=/path/to/bun`,""].join(`
|
|
6
|
-
`)}function T(s=process.env,t=process.stdin,c=process.stdout){if(s[_]==="1")return!1;if(s.CI==="true"||s.CI==="1")return!1;return Boolean(t.isTTY&&c.isTTY)}function F(s={},t=z){let c=s.platform??process.platform,[b,...r]=n(c);if(!b)return null;let i=t(b,r,{stdio:"inherit"});if(i.error||i.status!==0)return null;return
|
|
7
|
-
`),1;return l(r)}var M=m(import.meta.url),e=q(import.meta.url),D=u(M,`${e}-run.js`);async function ts(s){let t=a({input:process.stdin,output:process.stdout});try{let c=(await t.question(s)).trim().toLowerCase();return c===""||c==="y"||c==="yes"}finally{t.close()}}async function cs(){let s={launcherDir:M},t=
|
|
6
|
+
`)}function T(s=process.env,t=process.stdin,c=process.stdout){if(s[_]==="1")return!1;if(s.CI==="true"||s.CI==="1")return!1;return Boolean(t.isTTY&&c.isTTY)}function F(s={},t=z){let c=s.platform??process.platform,[b,...r]=n(c);if(!b)return null;let i=t(b,r,{stdio:"inherit"});if(i.error||i.status!==0)return null;return J(s).bun}function l(s){if(typeof s.status==="number")return s.status;if(s.signal)return 128+(Object.hasOwn(h,s.signal)?h[s.signal]:0);return 1}var h={SIGINT:2,SIGQUIT:3,SIGKILL:9,SIGTERM:15};function L(s,t,c,b=z){let r=b(s,[t,...c],{stdio:"inherit"});if(r.error)return process.stderr.write(`rove: could not start Bun at ${s}: ${r.error.message}. Check that this path is executable, or reinstall Bun from https://bun.sh.
|
|
7
|
+
`),1;return l(r)}var M=m(import.meta.url),e=q(import.meta.url),D=u(M,`${e}-run.js`);async function ts(s){let t=a({input:process.stdin,output:process.stdout});try{let c=(await t.question(s)).trim().toLowerCase();return c===""||c==="y"||c==="yes"}finally{t.close()}}async function cs(){let s={launcherDir:M},t=J(s);if(t.bun||!T())return t;let c=t.stale?`${e}: Bun ${t.stale.version} is too old for Rove (needs ${v}+). Install the latest Bun now? [Y/n] `:`${e}: Rove runs on the Bun runtime, and none is installed. Install Bun now? [Y/n] `;if(!await ts(c))return t;return{bun:F(s),stale:t.stale,unusable:t.unusable}}var w=globalThis.Bun;if(w){let s=w.version;if(s&&!d()&&!$(s))process.stderr.write(Q(process.execPath,s,e)),process.exit(1);await import(ss(D).href)}else{let{bun:s,stale:t,unusable:c}=await cs();if(!s){let b=t?Q(t.path,t.version,e):c?K(c,e):A(e);process.stderr.write(b),process.exit(1)}process.exit(L(s,D,process.argv.slice(2)))}
|