@sma1lboy/rove 0.9.311-next.691 → 0.9.311-next.693
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-6227aw3n.js → chunk-18ypzkax.js} +1 -1
- package/dist/cli/{chunk-pa6h628b.js → chunk-2crft8dt.js} +1 -1
- package/dist/cli/{chunk-0bjdc5zm.js → chunk-2nqbndhw.js} +1 -1
- package/dist/cli/{chunk-4053t6by.js → chunk-2wm0399e.js} +1 -1
- package/dist/cli/{chunk-x239h85s.js → chunk-3g060kh2.js} +1 -1
- package/dist/cli/{chunk-t9a244a0.js → chunk-3vnt1b2g.js} +1 -1
- package/dist/cli/{chunk-9kcegfhr.js → chunk-5mvpgwcj.js} +1 -1
- package/dist/cli/{chunk-6g26w2p5.js → chunk-6fqz3ejd.js} +2 -2
- package/dist/cli/{chunk-esxbn6c4.js → chunk-6rt8xk0m.js} +1 -1
- package/dist/cli/{chunk-cdefzqpy.js → chunk-76cmx6kp.js} +1 -1
- package/dist/cli/{chunk-yv5mtrgf.js → chunk-8t4hzc46.js} +1 -1
- package/dist/cli/{chunk-3ne4t869.js → chunk-8vcptk8t.js} +2 -2
- package/dist/cli/{chunk-ct9047en.js → chunk-8zryexr9.js} +2 -2
- package/dist/cli/{chunk-dj1rab8f.js → chunk-96a6ytt8.js} +1 -1
- package/dist/cli/{chunk-sb3cbwp6.js → chunk-9jtg3vpx.js} +1 -1
- package/dist/cli/{chunk-7ky6v7bq.js → chunk-9kn0wjeh.js} +1 -1
- package/dist/cli/{chunk-cp0pnhtp.js → chunk-a0616kqn.js} +1 -1
- package/dist/cli/{chunk-3q97mtcz.js → chunk-b6r0qgj0.js} +1 -1
- package/dist/cli/{chunk-s92gw0fw.js → chunk-ce98bhdd.js} +1 -1
- package/dist/cli/{chunk-z7hcwyvc.js → chunk-d7dfqrfv.js} +2 -2
- package/dist/cli/{chunk-xt3e8s3s.js → chunk-eesk0d16.js} +1 -1
- package/dist/cli/{chunk-y8s6dfe7.js → chunk-ezkbcf4c.js} +1 -1
- package/dist/cli/{chunk-kna05m2z.js → chunk-fh2063x9.js} +1 -1
- package/dist/cli/{chunk-7ay6ezts.js → chunk-fm2bqbsp.js} +1 -1
- package/dist/cli/{chunk-gg55z3pq.js → chunk-g7axg8j8.js} +1 -1
- package/dist/cli/{chunk-m2r0feb5.js → chunk-h6qehm9p.js} +1 -1
- package/dist/cli/{chunk-zzc3a3gp.js → chunk-hgnpf06b.js} +1 -1
- package/dist/cli/{chunk-dvrzsfe1.js → chunk-j5pgntjq.js} +1 -1
- package/dist/cli/{chunk-z3x4x1fp.js → chunk-jgq5qpny.js} +1 -1
- package/dist/cli/{chunk-8ac9je73.js → chunk-k519v3mn.js} +1 -1
- package/dist/cli/{chunk-1t39c83j.js → chunk-k5maec1m.js} +1 -1
- package/dist/cli/{chunk-cymqrctb.js → chunk-ks1qa607.js} +1 -1
- package/dist/cli/{chunk-1d4wn6wk.js → chunk-pbe6w9cj.js} +1 -1
- package/dist/cli/{chunk-tyne7pqy.js → chunk-qctcwmxv.js} +1 -1
- package/dist/cli/{chunk-mx02hyp0.js → chunk-qs2xbwk4.js} +1 -1
- package/dist/cli/{chunk-3nnzvk4y.js → chunk-rdetx4kn.js} +1 -1
- package/dist/cli/{chunk-a2cmykpp.js → chunk-rdhrvqcj.js} +1 -1
- package/dist/cli/{chunk-h12vxkg4.js → chunk-synnwhks.js} +1 -1
- package/dist/cli/{chunk-c2paa6zs.js → chunk-v63a45xy.js} +1 -1
- package/dist/cli/{chunk-pjq0pvj0.js → chunk-wd47g7dv.js} +1 -1
- package/dist/cli/{chunk-0dmrt1gd.js → chunk-wed0rsky.js} +1 -1
- package/dist/cli/{chunk-5cp8ebgn.js → chunk-wet0s1b2.js} +1 -1
- package/dist/cli/{chunk-rx8j5k8c.js → chunk-wtqgwzt8.js} +1 -1
- package/dist/cli/{chunk-enmvbs68.js → chunk-y9a55a6q.js} +1 -1
- package/dist/cli/{chunk-838mb03p.js → chunk-yxpjv9zs.js} +1 -1
- package/dist/cli/{chunk-j7mjrqbx.js → chunk-z1y03ejg.js} +1 -1
- package/dist/cli/{chunk-2gk2t43q.js → chunk-z9mmn3ja.js} +2 -2
- package/dist/cli/{chunk-kcv1hx2a.js → chunk-ze8gn79a.js} +1 -1
- package/dist/cli/{chunk-df8yzd32.js → chunk-zf2g5jnh.js} +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/rove.js +1 -1
- package/dist/web/assets/{index-CY9_NO8g.js → index-BZGZdGAZ.js} +35 -32
- package/dist/web/assets/{term-mount-_KnNMJyu.js → term-mount-B_7wGBf6.js} +1 -1
- package/dist/web/index.html +1 -1
- package/dist/web/relay/index.html +2 -2
- package/dist/web/relay-client/assets/{index-DbN5ihTr.js → index-BWLERhER.js} +82 -79
- package/dist/web/relay-client/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{API_VERBS,VERBS,VERB_ALIASES,VERB_GROUPS,findVerb,unknownVerbError}from"./chunk-
|
|
2
|
+
import{API_VERBS,VERBS,VERB_ALIASES,VERB_GROUPS,findVerb,unknownVerbError}from"./chunk-9jtg3vpx.js";import"./chunk-bzjef20g.js";import"./chunk-nsza72e4.js";import"./chunk-zsh70aef.js";import"./chunk-wje59khj.js";import"./chunk-8xsnpyer.js";import"./chunk-7fw390kp.js";import"./chunk-h58qkv3b.js";import"./chunk-pyzbrnnp.js";import"./chunk-4kepb278.js";import"./chunk-zcywdm3y.js";import"./chunk-36qsn2v8.js";import"./chunk-8ca4esh6.js";import"./chunk-q8ffd1pc.js";import"./chunk-rh5024pb.js";import"./chunk-hdea2ss8.js";import"./chunk-d1vv8xk6.js";import"./chunk-2bgmby1d.js";import"./chunk-3h9psc5w.js";import"./chunk-5mhvjytn.js";import"./chunk-5p2hhjje.js";import"./chunk-zknvzer3.js";import"./chunk-tv0pxap3.js";import"./chunk-eesk0d16.js";import"./chunk-y9a55a6q.js";import"./chunk-z0wnws9w.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-6t1yxx9x.js";import"./chunk-mdx18vtz.js";import"./chunk-ze8gn79a.js";import"./chunk-dscbf17z.js";import"./chunk-y0e28qha.js";import"./chunk-gze092t3.js";import"./chunk-wjmte4f0.js";import"./chunk-3vm6e0cf.js";import"./chunk-f1csqde7.js";import"./chunk-hy6b9ktj.js";import"./chunk-xtdr7b5h.js";import"./chunk-svtby8tp.js";import"./chunk-69cqwz53.js";import"./chunk-mqfvzdpr.js";import"./chunk-eeajq8px.js";import"./chunk-kpq28cbh.js";import"./chunk-hpay0ax8.js";import"./chunk-tteswdyf.js";import"./chunk-n5zdhshy.js";import"./chunk-ahfvmf90.js";import"./chunk-rxqdw6s5.js";import"./chunk-z9c475xb.js";import"./chunk-tn9gtf18.js";import"./chunk-ygdxgp8r.js";import"./chunk-drhwacg1.js";import"./chunk-wrqv141p.js";import"./chunk-34bf7mnm.js";import"./chunk-2mcgd0ym.js";import"./chunk-f60hmm20.js";import"./chunk-w7zv47mp.js";import"./chunk-rr97z89e.js";import"./chunk-03ab55aq.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-navavqt2.js";import"./chunk-etfh8f4z.js";import"./chunk-ez623zqp.js";import"./chunk-w70anvs6.js";import"./chunk-4csg29es.js";import"./chunk-fxpbaff2.js";import"./chunk-dmzg9zdc.js";import"./chunk-h8qg9v95.js";import"./chunk-kg9kmwt9.js";import"./chunk-9k0r47z3.js";import"./chunk-grbrh92f.js";import"./chunk-0zs13rdq.js";import"./chunk-1wpwxcg9.js";import"./chunk-ypbh8ra4.js";import"./chunk-n6s1sba5.js";import"./chunk-cf0kpsdm.js";import"./chunk-nmt8peyf.js";import"./chunk-k34h9e47.js";import"./chunk-37nrg1nc.js";import"./chunk-pbe6w9cj.js";import"./chunk-78y80xe8.js";import"./chunk-wx77yjhc.js";import"./chunk-12qq8r81.js";import"./chunk-t9n6n7dy.js";import"./chunk-7b2x6nkj.js";import"./chunk-8acw5rmt.js";import"./chunk-96wm6gt4.js";import"./chunk-6hjt5an9.js";import"./chunk-ptyqj15s.js";import"./chunk-jykxdtad.js";import"./chunk-65nm1v5h.js";import"./chunk-sckqk79z.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.js";import"./chunk-8rxg12aj.js";import"./chunk-bzqjk9fb.js";import"./chunk-4y536nwm.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import"./chunk-gvxchzch.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-ksx55wt3.js";import"./chunk-91sykzqq.js";export{unknownVerbError,findVerb,VERB_GROUPS,VERB_ALIASES,VERBS,API_VERBS};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{launchdPlist,systemdUnit}from"./chunk-8jxvxwck.js";import"./chunk-6f6b9zxx.js";import"./chunk-navavqt2.js";import"./chunk-n6s1sba5.js";import"./chunk-cf0kpsdm.js";import"./chunk-nmt8peyf.js";import"./chunk-k34h9e47.js";import"./chunk-37nrg1nc.js";import{argvHasFlag}from"./chunk-78y80xe8.js";import"./chunk-12qq8r81.js";import{roveCliInvocation}from"./chunk-6hjt5an9.js";import"./chunk-4y536nwm.js";import"./chunk-pn5ygqn6.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import{defaultDaemonLogPath}from"./chunk-gvxchzch.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import{readRoveHomeDirEnv}from"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{spawnSync}from"child_process";import{createHash}from"crypto";import{existsSync,mkdirSync,readFileSync,rmSync,writeFileSync}from"fs";import{homedir}from"os";import{dirname,join}from"path";var WEB_SERVICE={description:"Rove web (rove --web)",launchdLabel:"run.rove.web",args:["--web"],keepAlive:!0},withFlags=(flags)=>({...WEB_SERVICE,args:[...WEB_SERVICE.args,...flags]});function serviceNames(roveHome){if(!roveHome)return{label:WEB_SERVICE.launchdLabel,unit:"rove-web.service"};let tag=createHash("sha256").update(roveHome).digest("hex").slice(0,8);return{label:`${WEB_SERVICE.launchdLabel}.${tag}`,unit:`rove-web-${tag}.service`}}var names=()=>serviceNames(readRoveHomeDirEnv());function servicePath(platform){if(platform==="linux")return join(homedir(),".config","systemd","user",names().unit);if(platform==="darwin")return join(homedir(),"Library","LaunchAgents",`${names().label}.plist`);return null}function run(cmd,args){let res=spawnSync(cmd,args,{encoding:"utf8"});return{ok:res.status===0,out:`${res.stdout??""}${res.stderr??""}`.trim()}}function context(){let home=readRoveHomeDirEnv();return{cli:roveCliInvocation({sameInstall:!0}),env:{PATH:process.env.PATH??"",...home?{ROVE_HOME_DIR:home}:{}},logPath:join(dirname(defaultDaemonLogPath()),"bridge","web.log")}}var gui=()=>`gui/${process.getuid?.()??0}`;async function install(platform,flags){let path=servicePath(platform);if(!path)throw Error(`no login service can be written on ${platform}; run \`rove --web\` in a terminal`);let existing=existsSync(path)?readFileSync(path,"utf8"):null;if(existing!==null&&!existing.includes(WEB_SERVICE.launchdLabel)&&!existing.includes(WEB_SERVICE.description))throw Error(`${path} exists and does not run rove --web; move it away first`);let ctx=context(),bridge=await import("./chunk-
|
|
2
|
+
import{launchdPlist,systemdUnit}from"./chunk-8jxvxwck.js";import"./chunk-6f6b9zxx.js";import"./chunk-navavqt2.js";import"./chunk-n6s1sba5.js";import"./chunk-cf0kpsdm.js";import"./chunk-nmt8peyf.js";import"./chunk-k34h9e47.js";import"./chunk-37nrg1nc.js";import{argvHasFlag}from"./chunk-78y80xe8.js";import"./chunk-12qq8r81.js";import{roveCliInvocation}from"./chunk-6hjt5an9.js";import"./chunk-4y536nwm.js";import"./chunk-pn5ygqn6.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import{defaultDaemonLogPath}from"./chunk-gvxchzch.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import{readRoveHomeDirEnv}from"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{spawnSync}from"child_process";import{createHash}from"crypto";import{existsSync,mkdirSync,readFileSync,rmSync,writeFileSync}from"fs";import{homedir}from"os";import{dirname,join}from"path";var WEB_SERVICE={description:"Rove web (rove --web)",launchdLabel:"run.rove.web",args:["--web"],keepAlive:!0},withFlags=(flags)=>({...WEB_SERVICE,args:[...WEB_SERVICE.args,...flags]});function serviceNames(roveHome){if(!roveHome)return{label:WEB_SERVICE.launchdLabel,unit:"rove-web.service"};let tag=createHash("sha256").update(roveHome).digest("hex").slice(0,8);return{label:`${WEB_SERVICE.launchdLabel}.${tag}`,unit:`rove-web-${tag}.service`}}var names=()=>serviceNames(readRoveHomeDirEnv());function servicePath(platform){if(platform==="linux")return join(homedir(),".config","systemd","user",names().unit);if(platform==="darwin")return join(homedir(),"Library","LaunchAgents",`${names().label}.plist`);return null}function run(cmd,args){let res=spawnSync(cmd,args,{encoding:"utf8"});return{ok:res.status===0,out:`${res.stdout??""}${res.stderr??""}`.trim()}}function context(){let home=readRoveHomeDirEnv();return{cli:roveCliInvocation({sameInstall:!0}),env:{PATH:process.env.PATH??"",...home?{ROVE_HOME_DIR:home}:{}},logPath:join(dirname(defaultDaemonLogPath()),"bridge","web.log")}}var gui=()=>`gui/${process.getuid?.()??0}`;async function install(platform,flags){let path=servicePath(platform);if(!path)throw Error(`no login service can be written on ${platform}; run \`rove --web\` in a terminal`);let existing=existsSync(path)?readFileSync(path,"utf8"):null;if(existing!==null&&!existing.includes(WEB_SERVICE.launchdLabel)&&!existing.includes(WEB_SERVICE.description))throw Error(`${path} exists and does not run rove --web; move it away first`);let ctx=context(),bridge=await import("./chunk-9kn0wjeh.js"),configPath=join(dirname(defaultDaemonLogPath()),"bridge","config.json"),saved=existsSync(configPath)?JSON.parse(readFileSync(configPath,"utf8")):{};if(!(saved&&typeof saved==="object"&&("relayServer"in saved)))bridge.saveRelayServer(configPath,bridge.DEFAULT_RELAY_SERVER);mkdirSync(dirname(path),{recursive:!0}),mkdirSync(dirname(ctx.logPath),{recursive:!0,mode:448});let service={...withFlags(flags),launchdLabel:names().label};if(writeFileSync(path,platform==="linux"?systemdUnit(ctx,service):launchdPlist(ctx,service)),platform==="darwin"){run("launchctl",["bootout",`${gui()}/${names().label}`]);let load=run("launchctl",["bootstrap",gui(),path]);if(!load.ok)throw Error(`wrote ${path}, but launchd did not load it: ${load.out}`)}else{let reload=run("systemctl",["--user","daemon-reload"]),enable=reload.ok?run("systemctl",["--user","enable","--now",names().unit]):reload;if(!enable.ok)throw Error(`wrote ${path}, but systemd did not start it: ${enable.out}`)}return`rove --web now runs in the background and starts when you log in (${path}).
|
|
3
3
|
Log: ${ctx.logPath}
|
|
4
4
|
Pair a phone in the page's Settings \u2192 Connectors \u2192 Phone, or from the link in the log.`}function uninstall(platform){let path=servicePath(platform);if(!path||!existsSync(path))return"rove --web is not installed as a login service.";if(platform==="darwin")run("launchctl",["bootout",`${gui()}/${names().label}`]);else run("systemctl",["--user","disable","--now",names().unit]);if(rmSync(path),platform==="linux")run("systemctl",["--user","daemon-reload"]);return`Stopped and removed the rove --web login service (${path}).`}function stop(platform){let path=servicePath(platform);if(!path||!existsSync(path))return"rove --web is not installed as a login service; stop a terminal run with Ctrl-C.";let res=platform==="darwin"?run("launchctl",["bootout",`${gui()}/${names().label}`]):run("systemctl",["--user","stop",names().unit]);if(!res.ok&&!/no such process|not loaded|could not find/i.test(res.out))throw Error(`could not stop it: ${res.out}`);return"Stopped rove --web. It starts again at your next login, or now with `rove --web --start`; `--uninstall` removes it."}function start(platform){let path=servicePath(platform);if(!path||!existsSync(path))return"rove --web is not installed as a login service: run `rove --web --install`.";let res=platform==="darwin"?run("launchctl",["bootstrap",gui(),path]):run("systemctl",["--user","start",names().unit]);if(!res.ok&&!/already|input\/output error/i.test(res.out))throw Error(`could not start it: ${res.out}`);return`rove --web is running. Log: ${context().logPath}`}async function webServiceCommand(args,platform=process.platform){if(argvHasFlag(args,"--uninstall"))return console.log(uninstall(platform)),!0;if(argvHasFlag(args,"--stop"))return console.log(stop(platform)),!0;if(argvHasFlag(args,"--start"))return console.log(start(platform)),!0;if(!argvHasFlag(args,"--install"))return!1;return console.log(await install(platform,args.filter((arg)=>arg!=="--install"))),!0}export{webServiceCommand,serviceNames,WEB_SERVICE};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{__require}from"./chunk-91sykzqq.js";var CONNECTOR_LOADERS={weixin:async()=>(await import("./chunk-
|
|
2
|
+
import{__require}from"./chunk-91sykzqq.js";var CONNECTOR_LOADERS={weixin:async()=>(await import("./chunk-g7axg8j8.js")).default,lark:async()=>(await import("./chunk-6rt8xk0m.js")).default};async function runConnectorCli(id,argv){let load=CONNECTOR_LOADERS[id];if(!load)throw Error(`no chat connector "${id}"`);await(await load()).runCli(argv)}async function startChatConnectors(ctx){let started=[];for(let[id,load]of Object.entries(CONNECTOR_LOADERS))try{let connector=(await load()).createConnector();await connector.start(ctx),started.push(connector)}catch(err){ctx.log("connector",`${id} did not start: ${err instanceof Error?err.message:String(err)}`)}return started}function chatConnectorStatuses(){return Promise.all(Object.entries(CONNECTOR_LOADERS).map(async([id,load])=>{let mod=await load();return{id,connectable:mod.connect!==void 0,...mod.status()}}))}async function moduleOf(id){let load=CONNECTOR_LOADERS[id];if(!load)throw Error(`no chat connector "${id}"`);return await load()}async function disconnectChatConnector(id){return(await moduleOf(id)).disconnect()}async function connectChatConnector(id){let mod=await moduleOf(id);return mod.connect?await mod.connect():{ok:!1,message:`rove ${id} login`}}async function updateChatConnector(id,settings){(await moduleOf(id)).update(settings)}
|
|
3
3
|
export{runConnectorCli,startChatConnectors,chatConnectorStatuses,disconnectChatConnector,connectChatConnector,updateChatConnector};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{updatePluginRegistry}from"./chunk-ky29smpr.js";import{PLUGIN_MANIFEST_FILENAMES,currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginManifestPath,supportsPlatform,upsertPluginEntry}from"./chunk-3h9psc5w.js";import{pluginCheckoutDir,pluginConfigDir,pluginStateDir,pluginsRootDir}from"./chunk-ws2q07kb.js";import{CURRENT_VERSION,compareSemver}from"./chunk-
|
|
2
|
+
import{updatePluginRegistry}from"./chunk-ky29smpr.js";import{PLUGIN_MANIFEST_FILENAMES,currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginManifestPath,supportsPlatform,upsertPluginEntry}from"./chunk-3h9psc5w.js";import{pluginCheckoutDir,pluginConfigDir,pluginStateDir,pluginsRootDir}from"./chunk-ws2q07kb.js";import{CURRENT_VERSION,compareSemver}from"./chunk-pbe6w9cj.js";import{spawn}from"child_process";import{cpSync,existsSync,mkdirSync,readFileSync,renameSync,rmSync}from"fs";import{mkdtempSync}from"fs";import{basename,join,resolve}from"path";import{createInterface}from"readline/promises";var GITHUB_SPEC_RE=/^([A-Za-z0-9-]+)\/([A-Za-z0-9._-]+)(\/.+)?$/;class PluginCliError extends Error{}function fail(message){throw new PluginCliError(message)}function readManifestAt(root){let path=pluginManifestPath(root);if(!path)fail(`no ${PLUGIN_MANIFEST_FILENAMES.join(" or ")} found at ${root}`);let source=readFileSync(path,"utf8");return{...parsePluginManifest(source,basename(path)),manifestPath:path,manifestSource:source}}function checkVersionGate(parsed){let min=parsed.manifest.minRoveVersion;if(compareSemver(CURRENT_VERSION,min)<0)fail(`plugin requires Rove >= ${min} (this is ${CURRENT_VERSION}); update Rove first`)}function commandLines(parsed){let m=parsed.manifest,lines=[];for(let c of m.build)lines.push(`build: ${c.command.join(" ")}`);for(let c of m.startup)lines.push(`startup: ${c.command.join(" ")}`);for(let a of m.actions)lines.push(`action ${a.id}: ${a.command.join(" ")}`);for(let e of m.events)lines.push(`on ${e.on}: ${e.command.join(" ")}`);for(let e of m.engines)if(e.modelsCommand)lines.push(`engine ${e.id} models: ${e.modelsCommand.join(" ")}`);return lines}var CAPTURE_TAIL_BYTES=4096;function run(cmd,args,opts){return new Promise((resolve2)=>{let child=spawn(cmd,args,{cwd:opts.cwd,stdio:opts.inherit?["ignore","inherit","inherit"]:["ignore","pipe","pipe"]}),output="",collect=(chunk)=>{output=`${output}${String(chunk)}`.slice(-CAPTURE_TAIL_BYTES)};child.stdout?.on("data",collect),child.stderr?.on("data",collect),child.on("error",(err)=>resolve2({code:null,output:`${output}${err.message}`})),child.on("close",(code)=>resolve2({code,output}))})}function outputTail(output){let trimmed=output.trim();return trimmed?`: ${trimmed.split(`
|
|
3
3
|
`).slice(-3).join(" / ")}`:""}async function git(args,opts){let{code,output}=await run("git",args,opts);if(code!==0)fail(`git ${args[0]} failed${outputTail(output)}`)}async function runBuildCommands(parsed,root,opts){let platform=currentPluginPlatform();for(let[i,step]of parsed.manifest.build.entries()){if(!supportsPlatform(step,parsed.manifest,platform))continue;let[cmd,...args]=step.command;if(opts.inherit)console.log(`build[${i}]: ${step.command.join(" ")}`);let{code,output}=await run(cmd,args,{cwd:root,inherit:opts.inherit});if(code!==0)fail(`build[${i}] failed (exit ${code??"spawn error"}); plugin not registered${outputTail(output)}`)}}function makeStagingDir(){let root=pluginsRootDir();return mkdirSync(root,{recursive:!0}),mkdtempSync(join(root,".staging-"))}function movePluginTree(from,to){try{renameSync(from,to)}catch(err){if(err.code!=="EXDEV")throw err;cpSync(from,to,{recursive:!0,verbatimSymlinks:!0}),rmSync(from,{recursive:!0,force:!0})}}function register(entry){updatePluginRegistry((registry)=>upsertPluginEntry(registry,entry)),mkdirSync(pluginConfigDir(entry.id),{recursive:!0,mode:448}),mkdirSync(pluginStateDir(entry.id),{recursive:!0,mode:448})}async function preparePluginInstall(spec,opts={}){let match=spec.match(GITHUB_SPEC_RE);if(!match)fail(`install takes GitHub shorthand (owner/repo[/subdir]), got \`${spec}\``);let[,owner,repo,subdirRaw]=match,subdir=subdirRaw?.replace(/^\//,""),inherit=opts.inherit??!1,tmp=makeStagingDir();try{let url=`https://github.com/${owner}/${repo}.git`;if(inherit)console.log(`cloning ${url}${opts.ref?` @ ${opts.ref}`:""}`);if(opts.ref)await git(["clone","--quiet",url,tmp],{inherit}),await git(["checkout","--quiet",opts.ref],{cwd:tmp,inherit});else await git(["clone","--quiet","--depth","1",url,tmp],{inherit});let rootInClone=subdir?join(tmp,subdir):tmp,parsed=readManifestAt(rootInClone);checkVersionGate(parsed);let id=parsed.manifest.id,existing=loadPluginRegistry().plugins.find((p)=>p.id===id);if(existing?.source.kind==="link")fail(`\`${id}\` is locally linked at ${existing.root}; unlink it first`);if(!supportsPlatform({},parsed.manifest,currentPluginPlatform()))fail(`plugin declares platforms [${parsed.manifest.platforms?.join(", ")}]; this machine is unsupported`);return{preview:{id,name:parsed.manifest.name,version:parsed.manifest.version,description:parsed.manifest.description??null,source:`github.com/${owner}/${repo}${subdir?`/${subdir}`:""}`,commands:commandLines(parsed),warnings:parsed.warnings},commit:async()=>{try{await runBuildCommands(parsed,rootInClone,{inherit});let manifestPath=pluginManifestPath(rootInClone);if(!manifestPath)fail("manifest disappeared during build; aborting");if(manifestPath!==parsed.manifestPath)fail("manifest changed during build; aborting");if(readFileSync(manifestPath,"utf8")!==parsed.manifestSource)fail("manifest changed during build; aborting");let checkout=pluginCheckoutDir(id);return rmSync(checkout,{recursive:!0,force:!0}),mkdirSync(join(checkout,".."),{recursive:!0}),movePluginTree(tmp,checkout),register({id,source:{kind:"github",spec},root:subdir?join(checkout,subdir):checkout,enabled:!0,version:parsed.manifest.version,installedAt:Date.now()}),id}finally{rmSync(tmp,{recursive:!0,force:!0})}},discard:()=>rmSync(tmp,{recursive:!0,force:!0})}}catch(err){throw rmSync(tmp,{recursive:!0,force:!0}),err}}function printPreview(preview){console.log(`
|
|
4
4
|
${preview.name} (${preview.id}) v${preview.version} \u2014 ${preview.description??"no description"}`),console.log(`source: ${preview.source}`);for(let line of preview.commands)console.log(` ${line}`);for(let w of preview.warnings)console.log(` warning: ${w}`);console.log("")}async function confirmOrBail(yes){if(yes)return;if(!process.stdin.isTTY)fail("refusing to install without confirmation in a non-interactive terminal; pass --yes");let rl=createInterface({input:process.stdin,output:process.stdout}),answer=(await rl.question("Install this plugin and run its build commands? [y/N] ")).trim().toLowerCase();if(rl.close(),answer!=="y"&&answer!=="yes")fail("aborted")}async function installPlugin(spec,opts){let prepared=await preparePluginInstall(spec,{ref:opts.ref,inherit:!0});printPreview(prepared.preview);try{await confirmOrBail(opts.yes)}catch(err){throw prepared.discard(),err}let id=await prepared.commit();return console.log(`installed ${id} v${prepared.preview.version}`),id}function linkPlugin(dir){let root=resolve(dir);if(!existsSync(root))fail(`no such directory: ${root}`);let parsed=readManifestAt(root);checkVersionGate(parsed);let id=parsed.manifest.id;if(loadPluginRegistry().plugins.find((p)=>p.id===id)?.source.kind==="github")fail(`\`${id}\` is installed from GitHub; uninstall it before linking a local copy`);for(let w of parsed.warnings)console.log(`warning: ${w}`);if(!supportsPlatform({},parsed.manifest,currentPluginPlatform()))console.log(`warning: declares platforms [${parsed.manifest.platforms?.join(", ")}]; nothing will run on this machine`);register({id,source:{kind:"link"},root,enabled:!0,version:parsed.manifest.version,installedAt:Date.now()}),console.log(`linked ${id} v${parsed.manifest.version} \u2192 ${root}`)}
|
|
5
5
|
export{PluginCliError,preparePluginInstall,installPlugin,linkPlugin};
|
|
@@ -5,4 +5,4 @@ import{generateCompletions,isShellKind,mergeSubVerbs,shippedCompletionsPath}from
|
|
|
5
5
|
${usage}`),process.exit(2)};if(rest.some((arg)=>HELP_WORDS.includes(arg))){process.stdout.write(usage);return}let flags=rest.filter((arg)=>arg.startsWith("-")),shells=rest.filter((arg)=>!arg.startsWith("-")),unknownFlag=flags.find((flag)=>flag!=="--path"&&flag!=="--install");if(unknownFlag)fail(`unknown option "${unknownFlag}"`);if(new Set(flags).size>1)fail("--path and --install are different things; pass one");let shell=shells.length===1?shells[0]:void 0;if(!isShellKind(shell))fail(`unknown shell "${shells.join(" ")}"`);let scriptPath=shippedCompletionsPath(shell,cliName,deps.shippedDir),shipped=existsSync(scriptPath)?scriptPath:null;if(flags[0]==="--path"){if(!shipped)fail(`no pre-generated ${shell} script at ${scriptPath}
|
|
6
6
|
${cliName} completions ${shell} # print the script to stdout instead`);process.stdout.write(`${shipped}
|
|
7
7
|
`);return}if(flags[0]==="--install"){let[{installCompletions,settleWelcomeInstall},{t}]=await Promise.all([import("./chunk-ehv87502.js"),import("./chunk-1m10nyas.js")]),completion=installCompletions(shell,deps.home,cliName,shipped);settleWelcomeInstall("completions",shell);let line=completion.installed?"onboarding.appliedCompletions":"onboarding.keptCompletions";process.stdout.write(`${t(line,{path:completion.path})}
|
|
8
|
-
`);return}if(shipped){process.stdout.write(readFileSync(shipped,"utf8"));return}let{API_VERBS}=await import("./chunk-
|
|
8
|
+
`);return}if(shipped){process.stdout.write(readFileSync(shipped,"utf8"));return}let{API_VERBS}=await import("./chunk-18ypzkax.js");process.stdout.write(generateCompletions(shell,cliName,mergeSubVerbs(API_VERBS)))}export{runCompletionsSubcommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ensureMcpForwards,machineMcp}from"./chunk-rr97z89e.js";import{isRemoteWorkspace,readRemoteWorkspace,rxPath}from"./chunk-03ab55aq.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-navavqt2.js";import{CURRENT_VERSION}from"./chunk-
|
|
2
|
+
import{ensureMcpForwards,machineMcp}from"./chunk-rr97z89e.js";import{isRemoteWorkspace,readRemoteWorkspace,rxPath}from"./chunk-03ab55aq.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-navavqt2.js";import{CURRENT_VERSION}from"./chunk-pbe6w9cj.js";import{flagValue}from"./chunk-78y80xe8.js";import"./chunk-12qq8r81.js";import{quoteShellArg}from"./chunk-ptyqj15s.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";import{spawnSync}from"child_process";import{realpathSync}from"fs";import{dirname,resolve}from"path";import{createInterface}from"readline";async function runRemoteWorkspaceSubcommand(args){let dir=flagValue(args,"--dir")??process.cwd();if(!isRemoteWorkspace(dir))return;if(args[0]==="bash-hook")process.stdout.write(bashHookReply(await readAll(process.stdin),rxPath(dir)));else if(args[0]==="file-hook")process.stdout.write(fileHookReply(await readAll(process.stdin),dir));else if(args[0]==="mcp")await serveMcp(rxPath(dir));else if(args[0]==="mcp-hook"){let ws=readRemoteWorkspace(dir);if(ws)ensureMcpForwards(ws.machine,machineMcp(ws.machine))}}async function readAll(stream){let text="";for await(let chunk of stream)text+=chunk;return text}var ROVE_COMMAND=/^\s*(?:[A-Za-z_]\w*=\S*\s+)*(?:\S*\/)?rove(?:\s|$)/;function bashHookReply(payload,rx){let input;try{input=JSON.parse(payload).tool_input??{}}catch{return""}let command=input.command;if(typeof command!=="string"||/^\s*(\S*\/)?rx\s/.test(command)||ROVE_COMMAND.test(command))return"";return JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",updatedInput:{...input,command:`${quoteShellArg(rx)} ${quoteShellArg(command)}`}}})}function fileHookReply(payload,dir){let call;try{call=JSON.parse(payload)}catch{return""}let input=call.tool_input??{},named=[input.file_path,input.notebook_path,input.path].find((p)=>typeof p==="string"&&p),target=resolve(call.cwd??dir,typeof named==="string"?named:"."),ws=readRemoteWorkspace(dir);if(![dir,realPath(dir),...ws?[ws.path]:[]].some((root)=>target===root||target.startsWith(`${root}/`)))return"";let where=ws?`the machine "${ws.machine}", at ${ws.path}`:"another machine";return JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`${target} is in the project, which is on ${where}. This tool only sees this machine. Use the workspace read / write / edit tools for the project's files (paths relative to its root), and the shell to search it (rg, find, ls): shell commands run there.`}})}function realPath(dir){try{return realpathSync(dir)}catch{return dir}}var runThrough=(rx)=>(command,stdin)=>{let res=spawnSync(rx,[command],{input:stdin,encoding:"utf8",maxBuffer:67108864});return{ok:res.status===0,out:res.status===0?res.stdout:(res.stderr||res.stdout||"failed").trim()}},READ_LINES=2000,TOOLS=[{name:"read",description:`Read a file of the project. Returns its text; at most ${READ_LINES} lines unless offset/limit ask for a range.`,inputSchema:{type:"object",properties:{path:{type:"string",description:"Path, relative to the project root or absolute on that machine."},offset:{type:"number",description:"First line to return (1-based)."},limit:{type:"number",description:"How many lines to return."}},required:["path"]}},{name:"write",description:"Create a file of the project or replace its whole content. Parent directories are created.",inputSchema:{type:"object",properties:{path:{type:"string"},content:{type:"string"}},required:["path","content"]}},{name:"edit",description:"Replace old_string with new_string in a file of the project. old_string must match exactly and occur once, unless replace_all is true.",inputSchema:{type:"object",properties:{path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["path","old_string","new_string"]}}];function callWorkspaceTool(run,name,a){let path=typeof a.path==="string"?a.path:"";if(!path)throw Error("path is required");let file=quoteShellArg(path),must=(res)=>{if(!res.ok)throw Error(res.out);return res.out},write=(content)=>must(run(`mkdir -p -- ${quoteShellArg(dirname(path))} && cat > ${file}`,content));if(name==="read"){let from=Math.max(1,Math.trunc(Number(a.offset)||1)),count=Math.max(1,Math.trunc(Number(a.limit)||READ_LINES)),text=must(run(`sed -n '${from},${from+count}p' -- ${file}`)),lines=text.split(`
|
|
3
3
|
`);if(lines.length<=count+1)return text;return`${lines.slice(0,count).join(`
|
|
4
4
|
`)}
|
|
5
5
|
[cut at line ${from+count-1}; pass offset to read on]`}if(name==="write"){if(typeof a.content!=="string")throw Error("content is required");return write(a.content),`wrote ${path}`}if(name==="edit"){let{old_string:from,new_string:to}=a;if(typeof from!=="string"||typeof to!=="string"||!from)throw Error("old_string and new_string are required");let text=must(run(`cat -- ${file}`)),hits=text.split(from).length-1;if(hits===0)throw Error(`old_string not found in ${path}`);if(hits>1&&a.replace_all!==!0)throw Error(`old_string occurs ${hits} times in ${path}; add context to make it unique, or pass replace_all`);return write(text.split(from).join(to)),`edited ${path} (${hits} replacement${hits===1?"":"s"})`}throw Error(`unknown tool: ${name}`)}function mcpReply(run,msg){if(msg.id===void 0||!msg.method)return null;let result=(value)=>({jsonrpc:"2.0",id:msg.id,result:value});if(msg.method==="initialize")return result({protocolVersion:typeof msg.params?.protocolVersion==="string"?msg.params.protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:{name:"rove-workspace",version:CURRENT_VERSION}});if(msg.method==="ping")return result({});if(msg.method==="tools/list")return result({tools:TOOLS});if(msg.method==="tools/call"){let args=msg.params?.arguments??{};try{let text=callWorkspaceTool(run,String(msg.params?.name??""),args);return result({content:[{type:"text",text}]})}catch(err){return result({content:[{type:"text",text:err instanceof Error?err.message:String(err)}],isError:!0})}}return{jsonrpc:"2.0",id:msg.id,error:{code:-32601,message:`method not found: ${msg.method}`}}}async function serveMcp(rx){let run=runThrough(rx);for await(let line of createInterface({input:process.stdin})){if(!line.trim())continue;let msg;try{msg=JSON.parse(line)}catch{continue}let reply=mcpReply(run,msg);if(reply)process.stdout.write(`${JSON.stringify(reply)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{booleanFlagsOf,callVerb,errorBody,errorEnvelope,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-
|
|
2
|
+
import{booleanFlagsOf,callVerb,errorBody,errorEnvelope,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-76cmx6kp.js";import{VerbArgs,apiUsage,findVerb,normalizeWebArgv,parseFlags,unknownVerbError,validateAgainstSpec,verbHelp}from"./chunk-9jtg3vpx.js";import{ensurePluginEnginesLoaded}from"./chunk-nsza72e4.js";import{openDaemonSession}from"./chunk-wje59khj.js";import{requireVerbInstalled,verbInstalled}from"./chunk-z0wnws9w.js";import{AUTO_MACHINE,LOCAL_MACHINE,addStaysHere,forwardVerb,pickMachine,repoHosts,requireMachine,routeTarget,takeIdentityWarning}from"./chunk-dscbf17z.js";import{ApiError}from"./chunk-3vm6e0cf.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{ROVE_API_VERSION}from"./chunk-37nrg1nc.js";import{argvHasFlag}from"./chunk-78y80xe8.js";function takeMachineFlag(argv){let rest=[],machine;for(let i=0;i<argv.length;i++){let arg=argv[i];if(arg==="--machine")machine=argv[i+1],i+=1;else if(arg.startsWith("--machine="))machine=arg.slice(10);else rest.push(arg)}return{machine:machine||void 0,rest}}function forwardParams(verb,flags){if(!flags.has("prompt-file")||!verb.flags.some((f)=>f.name==="prompt"))return Object.fromEntries(flags);let text=new VerbArgs(verb,flags).promptText(),params=Object.fromEntries([...flags].filter(([name])=>name!=="prompt-file"));return text===void 0?params:{...params,prompt:text}}var envelopeMode=!1;function writeJson(value,pretty,stream=process.stdout){stream.write(`${pretty?JSON.stringify(value,null,2):JSON.stringify(value)}
|
|
3
3
|
`)}function emit(value,pretty){let warning=takeIdentityWarning(),payload=warning&&value&&typeof value==="object"&&!Array.isArray(value)?{...value,identityWarning:warning}:value;writeJson(envelopeMode?successEnvelope(payload):payload,pretty)}function fail(message,code,exitCode=1,data){let error=errorBody(new ApiError(message,code,data));if(envelopeMode)writeJson({apiVersion:ROVE_API_VERSION,ok:!1,error},!1);else writeJson({error},!1,process.stderr);process.exit(exitCode)}var USAGE_ERROR_CODES=new Set(["BAD_VERB","UNKNOWN_VERB","BAD_FLAG","MISSING_FLAG","MISSING_VERB","BAD_DAEMON","UNKNOWN_MACHINE"]);async function invokeVerb(verbName,argv,deps){return runVerb(verbName,{argv},deps)}async function runApiSubcommand(argv){let[verbName,...withMachine]=argv,{machine,rest}=takeMachineFlag(withMachine);if(envelopeMode=argvHasFlag(rest,"--envelope"),!verbName||verbName==="--help"||verbName==="-h"||verbName==="help"){if(!verbName)fail(apiUsage(),"MISSING_VERB",2);process.stdout.write(`${apiUsage()}
|
|
4
4
|
`);return}ensurePluginEnginesLoaded();let verb=findVerb(verbName);if(!verb){let err=unknownVerbError(verbName);fail(`${err.message}
|
|
5
5
|
${apiUsage()}`,err.code,2,err.data)}let parsed;try{let verbArgv=verb.name==="web"?normalizeWebArgv(rest):rest;parsed=parseFlags(verbArgv,booleanFlagsOf(verb),repeatableFlagsOf(verb))}catch(err){if(err instanceof ApiError)fail(err.message,err.code,2,err.data);fail(errorMessage(err),"BAD_FLAG",2)}if(parsed.help){if(!verbInstalled(verb))try{requireVerbInstalled(verb)}catch(err){if(err instanceof ApiError)fail(err.message,err.code,2,err.data)}process.stdout.write(`${verbHelp(verb)}
|