@sma1lboy/rove 0.9.251 → 0.9.252
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-84bmcqyz.js → chunk-07jq0271.js} +1 -1
- package/dist/cli/{chunk-8spmjwwz.js → chunk-0gxa04rx.js} +1 -1
- package/dist/cli/{chunk-d99385f2.js → chunk-17pg88dq.js} +2 -2
- package/dist/cli/chunk-1qge84t7.js +3 -0
- package/dist/cli/{chunk-crdyt04z.js → chunk-1v8y9xtk.js} +1 -1
- package/dist/cli/chunk-1zwp3ase.js +2 -0
- package/dist/cli/{chunk-8ja7jrhc.js → chunk-24dryfqb.js} +1 -1
- package/dist/cli/{chunk-719avf77.js → chunk-25867jnk.js} +1 -1
- package/dist/cli/{chunk-28wjmb9f.js → chunk-2bp01vf2.js} +1 -1
- package/dist/cli/{chunk-zcwgmz5p.js → chunk-2bxts9pp.js} +1 -1
- package/dist/cli/{chunk-dgbcpkr2.js → chunk-2ks86x2d.js} +1 -1
- package/dist/cli/{chunk-ga5f2pyc.js → chunk-2n1n70f2.js} +1 -1
- package/dist/cli/{chunk-ny12rama.js → chunk-2rfyjb3y.js} +1 -1
- package/dist/cli/{chunk-bvqwgrar.js → chunk-2s762g8n.js} +1 -1
- package/dist/cli/{chunk-g5rr5fpn.js → chunk-34468esa.js} +1 -1
- package/dist/cli/{chunk-g872swb8.js → chunk-36pkmg07.js} +4 -4
- package/dist/cli/{chunk-6h0n4b5t.js → chunk-4ays3krf.js} +1 -1
- package/dist/cli/{chunk-5456ttpr.js → chunk-4e1wcgw7.js} +3 -3
- package/dist/cli/{chunk-mf7fb92r.js → chunk-564jgrb3.js} +1 -1
- package/dist/cli/{chunk-mq06xpqr.js → chunk-57wm48dh.js} +1 -1
- package/dist/cli/{chunk-mv0hp5cv.js → chunk-5hhr44fc.js} +1 -1
- package/dist/cli/chunk-5qxp7xx3.js +2 -0
- package/dist/cli/{chunk-nsqsvgry.js → chunk-6a4xqzqf.js} +3 -3
- package/dist/cli/{chunk-qxzrdfh7.js → chunk-7h7270rz.js} +3 -3
- package/dist/cli/{chunk-76n3d9x3.js → chunk-7zxf47xb.js} +1 -1
- package/dist/cli/chunk-8e0nmegv.js +2 -0
- package/dist/cli/{chunk-9v568ape.js → chunk-952aedqm.js} +1 -1
- package/dist/cli/{chunk-x33sm4rp.js → chunk-9dregrj6.js} +1 -1
- package/dist/cli/{chunk-daw4mxq3.js → chunk-9e21z4gn.js} +1 -1
- package/dist/cli/chunk-9mcpqrx8.js +2 -0
- package/dist/cli/{chunk-7z9yfnjd.js → chunk-9sta3ak4.js} +1 -1
- package/dist/cli/chunk-a1wjg2cv.js +3 -0
- package/dist/cli/{chunk-v312167r.js → chunk-axmpjma9.js} +1 -1
- package/dist/cli/{chunk-963er0h4.js → chunk-ayhkcv0w.js} +3 -3
- package/dist/cli/{chunk-e003wm6d.js → chunk-b67pjyyg.js} +1 -1
- package/dist/cli/{chunk-2apszxn2.js → chunk-b7xjhgts.js} +1 -1
- package/dist/cli/{chunk-regtterm.js → chunk-bhm24ne6.js} +4 -4
- package/dist/cli/{chunk-t33z2kdv.js → chunk-c0ksxg3z.js} +1 -1
- package/dist/cli/{chunk-mre9g9vq.js → chunk-cbd6y9at.js} +1 -1
- package/dist/cli/{chunk-w4cpkhzj.js → chunk-ccn7pq03.js} +1 -1
- package/dist/cli/{chunk-mnm9n2vr.js → chunk-cpv1rpc7.js} +1 -1
- package/dist/cli/{chunk-8s0mz115.js → chunk-csdttpme.js} +4 -4
- package/dist/cli/{chunk-86chrjqr.js → chunk-cvrtapqt.js} +1 -1
- package/dist/cli/{chunk-8sbbzs5g.js → chunk-e8pv3b92.js} +1 -1
- package/dist/cli/{chunk-q5bhq11t.js → chunk-ebhbtvhd.js} +1 -1
- package/dist/cli/{chunk-1exaxwyv.js → chunk-fz0xfw86.js} +1 -1
- package/dist/cli/{chunk-4rx3nhvq.js → chunk-h3q3r1py.js} +1 -1
- package/dist/cli/{chunk-sqp33pwr.js → chunk-h89ghyex.js} +1 -1
- package/dist/cli/{chunk-cp5jp5mq.js → chunk-j6t7xvm3.js} +1 -1
- package/dist/cli/{chunk-vwg79maj.js → chunk-jn7vr075.js} +1 -1
- package/dist/cli/{chunk-964z8ccb.js → chunk-jnj2kk2h.js} +1 -1
- package/dist/cli/{chunk-2pen6b1t.js → chunk-jp31bpgp.js} +1 -1
- package/dist/cli/{chunk-ncrr0fa3.js → chunk-jwnhthx9.js} +1 -1
- package/dist/cli/{chunk-ayr5dpgc.js → chunk-kda565xs.js} +1 -1
- package/dist/cli/{chunk-6ms5chc3.js → chunk-ke3t032y.js} +1 -1
- package/dist/cli/{chunk-m4wy9ja5.js → chunk-kqv7t8jk.js} +1 -1
- package/dist/cli/chunk-kx0wzjj4.js +2 -0
- package/dist/cli/chunk-m2t2n474.js +6 -0
- package/dist/cli/{chunk-n52x0ehz.js → chunk-m3bz62v4.js} +1 -1
- package/dist/cli/chunk-my20q579.js +3 -0
- package/dist/cli/chunk-n2xemv4a.js +2 -0
- package/dist/cli/{chunk-v6d6kvmk.js → chunk-n92fz0hn.js} +1 -1
- package/dist/cli/{chunk-mdnrrj16.js → chunk-namxa4wy.js} +1 -1
- package/dist/cli/chunk-npb9xz3y.js +3 -0
- package/dist/cli/{chunk-gp991c3v.js → chunk-nqtvthqg.js} +1 -1
- package/dist/cli/{chunk-w7yg0bbz.js → chunk-nz9nmp4v.js} +1 -1
- package/dist/cli/{chunk-8ezc1ban.js → chunk-pgmv2hwf.js} +1 -1
- package/dist/cli/{chunk-6ahc8w4p.js → chunk-phpt1d3e.js} +1 -1
- package/dist/cli/{chunk-6rrzq5et.js → chunk-pj3gnkfr.js} +1 -1
- package/dist/cli/{chunk-e1xvz3sv.js → chunk-q2fnt7gm.js} +1 -1
- package/dist/cli/{chunk-7vv6160d.js → chunk-qh4y4e27.js} +1 -1
- package/dist/cli/{chunk-apfzdw7g.js → chunk-rc8baevh.js} +1 -1
- package/dist/cli/{chunk-y5dk90tw.js → chunk-resmnaxq.js} +1 -1
- package/dist/cli/{chunk-5r71q63g.js → chunk-rj7fwa30.js} +1 -1
- package/dist/cli/{chunk-kb3zvtkj.js → chunk-rxge7bh5.js} +1 -1
- package/dist/cli/{chunk-rqpwy31f.js → chunk-sbn5pbz9.js} +1 -1
- package/dist/cli/{chunk-mnpewdhd.js → chunk-t3v57v42.js} +2 -2
- package/dist/cli/chunk-t5qayy7m.js +9 -0
- package/dist/cli/chunk-tfqrc2v1.js +31 -0
- package/dist/cli/chunk-trjve2xz.js +3 -0
- package/dist/cli/{chunk-jrdwedn2.js → chunk-va0n5rwm.js} +1 -1
- package/dist/cli/chunk-va5am5n6.js +2 -0
- package/dist/cli/{chunk-rt4tg426.js → chunk-vwpcv7j1.js} +1 -1
- package/dist/cli/{chunk-nep425b6.js → chunk-x8pk5cyf.js} +1 -1
- package/dist/cli/{chunk-rkgnrfga.js → chunk-yt24rrvx.js} +1 -1
- package/dist/cli/{chunk-rhq87p4r.js → chunk-zb5d61xa.js} +1 -1
- package/dist/cli/{chunk-jfnr89qj.js → chunk-zzzm2cfx.js} +1 -1
- package/dist/cli/index.js +5 -5
- package/dist/cli/rove.js +1 -1
- package/dist/completions/rove.bash +1 -1
- package/dist/completions/rove.fish +1 -1
- package/dist/completions/rove.zsh +1 -1
- package/package.json +3 -3
- package/dist/cli/chunk-2dpr8gps.js +0 -2
- package/dist/cli/chunk-3msnqacf.js +0 -2
- package/dist/cli/chunk-88czbfqx.js +0 -3
- package/dist/cli/chunk-dcjxtwdb.js +0 -7
- package/dist/cli/chunk-e1x88j3k.js +0 -3
- package/dist/cli/chunk-f7rmd4zk.js +0 -6
- package/dist/cli/chunk-fsdh66fa.js +0 -2
- package/dist/cli/chunk-h9kzwj14.js +0 -2
- package/dist/cli/chunk-k9spgfmx.js +0 -3
- package/dist/cli/chunk-nxe45n7k.js +0 -17
- package/dist/cli/chunk-q6qhk171.js +0 -2
- package/dist/cli/chunk-qft75bkm.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{GitWorktreeManager}from"./chunk-
|
|
2
|
+
import{GitWorktreeManager}from"./chunk-q2fnt7gm.js";import"./chunk-07jq0271.js";import"./chunk-41x1hrqe.js";import"./chunk-resmnaxq.js";import"./chunk-sak1tphp.js";import"./chunk-catrr0z3.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-6xppe9bj.js";import"./chunk-b7xjhgts.js";import"./chunk-2brn8e1y.js";import"./chunk-7kysxgbq.js";import"./chunk-21ek142k.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-zk5qkkb1.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";export{GitWorktreeManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{existsSync}from"fs";import{join}from"path";function webRoot(){return[join(import.meta.dir,"..","web"),join(import.meta.dir,"..","..","..","rove-web","dist")].find((dir)=>existsSync(join(dir,"index.html")))??null}async function runWebSubcommand(args){let root=webRoot();if(!root)console.error(`${ROVE_PRODUCT_NAME} --web: the browser client is not in this build. From a checkout, run \`bun --filter rove-web build\` first; the npm package ships it in dist/web.`),process.exit(2);let{runBridge}=await import("./chunk-
|
|
2
|
+
import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{existsSync}from"fs";import{join}from"path";function webRoot(){return[join(import.meta.dir,"..","web"),join(import.meta.dir,"..","..","..","rove-web","dist")].find((dir)=>existsSync(join(dir,"index.html")))??null}async function runWebSubcommand(args){let root=webRoot();if(!root)console.error(`${ROVE_PRODUCT_NAME} --web: the browser client is not in this build. From a checkout, run \`bun --filter rove-web build\` first; the npm package ships it in dist/web.`),process.exit(2);let{runBridge}=await import("./chunk-csdttpme.js");await runBridge(args,{name:`${ROVE_PRODUCT_NAME} --web`,web:{root}})}export{runWebSubcommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{BREAKING_VERSIONS,CURRENT_VERSION,compareSemver}from"./chunk-
|
|
2
|
+
import{BREAKING_VERSIONS,CURRENT_VERSION,compareSemver}from"./chunk-j6t7xvm3.js";import{loadStateFile,patchStateFile}from"./chunk-zk5qkkb1.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";var LAST_RUN_VERSION_KEY="app.lastRunVersion";function resetGateBlockers(lastRun,current=CURRENT_VERSION,breaking=BREAKING_VERSIONS){if(typeof lastRun!=="string"||lastRun.length===0)return[];let[lo,hi]=compareSemver(lastRun,current)<=0?[lastRun,current]:[current,lastRun];return breaking.filter((b)=>compareSemver(b,lo)>0&&compareSemver(b,hi)<=0)}function enforceResetGate(){let cliName=ROVE_PRODUCT_NAME,lastRun=loadStateFile()[LAST_RUN_VERSION_KEY],blockers=resetGateBlockers(lastRun);if(blockers.length>0){let from=typeof lastRun==="string"?lastRun:"unknown";console.error([`${cliName} ${CURRENT_VERSION}: cannot start \u2014 version ${blockers.join(", ")} introduced breaking changes`,`(last run: ${from}). Your daemon/session state may be incompatible.`,"","Run:",` ${cliName} reset # stop daemon + PTY host + sessions (tasks kept)`,` ${cliName} reset --hard # additionally wipe the task index + UI state`,"","Then relaunch Rove. Worktrees are never touched."].join(`
|
|
3
3
|
`)),process.exit(1)}if(lastRun!==CURRENT_VERSION)stampResetGate()}function stampResetGate(){try{patchStateFile({[LAST_RUN_VERSION_KEY]:CURRENT_VERSION})}catch{}}
|
|
4
4
|
export{LAST_RUN_VERSION_KEY,enforceResetGate,stampResetGate};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{__require}from"./chunk-91sykzqq.js";var welcomeWrite=Promise.resolve();function trackWelcomeWrite(write){welcomeWrite=write}async function launchTui(){let{startTui}=await import("./chunk-
|
|
2
|
+
import{__require}from"./chunk-91sykzqq.js";var welcomeWrite=Promise.resolve();function trackWelcomeWrite(write){welcomeWrite=write}async function launchTui(){let{startTui}=await import("./chunk-yt24rrvx.js");await startTui(),await welcomeWrite;let{runPendingWelcomeInstalls}=await import("./chunk-cpv1rpc7.js");runPendingWelcomeInstalls()}
|
|
3
3
|
export{trackWelcomeWrite,launchTui};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{__require}from"./chunk-91sykzqq.js";var CHANNEL_LOADERS={weixin:async()=>(await import("./chunk-
|
|
2
|
+
import{__require}from"./chunk-91sykzqq.js";var CHANNEL_LOADERS={weixin:async()=>(await import("./chunk-va0n5rwm.js")).default};async function runChannelCli(id,argv){let load=CHANNEL_LOADERS[id];if(!load)throw Error(`no chat channel "${id}"`);await(await load()).runCli(argv)}async function startChatChannels(ctx){let started=[];for(let[id,load]of Object.entries(CHANNEL_LOADERS))try{let channel=(await load()).createChannel();await channel.start(ctx),started.push(channel)}catch(err){ctx.log("channel",`${id} did not start: ${err instanceof Error?err.message:String(err)}`)}return started}
|
|
3
3
|
export{runChannelCli,startChatChannels};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{PLUGIN_MANIFEST_FILENAMES,currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginCheckoutDir,pluginConfigDir,pluginManifestPath,pluginStateDir,pluginsRootDir,savePluginRegistry,supportsPlatform,upsertPluginEntry}from"./chunk-vd8qqev9.js";import{CURRENT_VERSION,compareSemver}from"./chunk-
|
|
2
|
+
import{PLUGIN_MANIFEST_FILENAMES,currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginCheckoutDir,pluginConfigDir,pluginManifestPath,pluginStateDir,pluginsRootDir,savePluginRegistry,supportsPlatform,upsertPluginEntry}from"./chunk-vd8qqev9.js";import{CURRENT_VERSION,compareSemver}from"./chunk-j6t7xvm3.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(" ")}`);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){savePluginRegistry(upsertPluginEntry(loadPluginRegistry(),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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{interactiveEngineCommand,listPresetIds}from"./chunk-
|
|
2
|
+
import{interactiveEngineCommand,listPresetIds}from"./chunk-cbd6y9at.js";import{engineEntry}from"./chunk-jp31bpgp.js";import{installedEngineIds}from"./chunk-ccn7pq03.js";import{spawnSync}from"child_process";import{statSync}from"fs";import path from"path";function whichOnPath(bin){let bunWhich=globalThis.Bun?.which;if(bunWhich)return bunWhich(bin);let out=spawnSync(process.platform==="win32"?"where":"which",[bin],{encoding:"utf8"});if(out.status!==0)return null;return out.stdout.split(`
|
|
3
3
|
`).map((l)=>l.trim()).find(Boolean)??null}var defaultDeps={which:whichOnPath,command:(vendor)=>interactiveEngineCommand(vendor)};function probeLaunchBinary(argv,which){let bin=argv[0]?.trim();if(!bin)return{found:!1,error:"no launch command"};if(bin.includes(path.sep)||bin.startsWith(".")){try{if(statSync(bin).isFile())return{found:!0,path:bin}}catch{}return{found:!1,error:`not found at ${bin}`}}let found=which(bin);return found?{found:!0,path:found}:{found:!1,error:"not found on PATH"}}async function detectEngineStatus(vendor,over={}){let deps={...defaultDeps,...over},detector=engineEntry(vendor).detectAccount;if(!detector)return{vendor,binary:probeLaunchBinary(deps.command(vendor),deps.which),account:null};let status=await detector(deps.accountDeps),binary=status.binary.found?status.binary:probeLaunchBinary(deps.command(vendor),deps.which);return{vendor,binary,account:status.account,accountError:status.accountError}}function detectEngineStatuses(vendors,over={}){return Promise.all(vendors.map((v)=>detectEngineStatus(v,over)))}function describeAccount(account){if(account===null)return"login not detectable";switch(account.kind){case"oauth":return"email"in account?`logged in (${account.email}${account.organization?`, ${account.organization}`:""})`:"logged in";case"chatgpt":return`logged in (${account.email}${account.plan?`, ${account.plan}`:""})`;case"apikey":return"API key";case"token":return`token (${account.source})`;default:return"no account"}}function engineUsable(status){return status.binary.found&&status.account?.kind!=="none"}async function probeableEngineIds(){return[...new Set([...listPresetIds(),...await installedEngineIds()])]}function summarizeEngines(statuses){let usable=[],signedOut=[];for(let status of statuses)if(engineUsable(status))usable.push(status.vendor);else if(status.binary.found)signedOut.push(status.vendor);return{usable,signedOut}}
|
|
4
4
|
export{detectEngineStatus,detectEngineStatuses,describeAccount,probeableEngineIds,summarizeEngines};
|