@sma1lboy/rove 0.9.149 → 0.9.151
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-15k6hqzx.js +2 -0
- package/dist/cli/chunk-1cjd7h8p.js +6 -0
- package/dist/cli/chunk-1vhbnf49.js +2 -0
- package/dist/cli/chunk-2cyzv75r.js +3 -0
- package/dist/cli/{chunk-7m4s0xfa.js → chunk-3zf7mr7r.js} +1 -1
- package/dist/cli/chunk-4d5bph3p.js +2 -0
- package/dist/cli/chunk-4nm1axc3.js +2 -0
- package/dist/cli/{chunk-g1ybdgad.js → chunk-579zz8df.js} +2 -2
- package/dist/cli/{chunk-f9p1gze7.js → chunk-5mr9j201.js} +3 -3
- package/dist/cli/{chunk-q6579rbz.js → chunk-5wzap7r2.js} +1 -1
- package/dist/cli/chunk-6kz81dkc.js +17 -0
- package/dist/cli/{chunk-f6zsej8e.js → chunk-6sp2ags8.js} +1 -1
- package/dist/cli/chunk-7jkf3tvr.js +3 -0
- package/dist/cli/{chunk-v90k9ppb.js → chunk-7tfqaet5.js} +1 -1
- package/dist/cli/chunk-7zmrn4gn.js +3 -0
- package/dist/cli/{chunk-nm6adny4.js → chunk-86bjqmg1.js} +1 -1
- package/dist/cli/{chunk-k3ksts6g.js → chunk-87y9qjcm.js} +1 -1
- package/dist/cli/chunk-8rxg6hs2.js +2 -0
- package/dist/cli/chunk-95e0ks8n.js +2 -0
- package/dist/cli/chunk-98thhbm5.js +9 -0
- package/dist/cli/chunk-9nbg0nzh.js +3 -0
- package/dist/cli/chunk-a3a9gdc4.js +3 -0
- package/dist/cli/{chunk-mrwee8sj.js → chunk-aeq5xmtq.js} +1 -1
- package/dist/cli/chunk-akckb9kw.js +3 -0
- package/dist/cli/chunk-ayagydjk.js +2 -0
- package/dist/cli/chunk-cexxmfva.js +2 -0
- package/dist/cli/chunk-d393z1mj.js +4 -0
- package/dist/cli/{chunk-khfc4rjt.js → chunk-d89r6eqm.js} +1 -1
- package/dist/cli/chunk-dmdqnet6.js +3 -0
- package/dist/cli/chunk-e7t4xpr9.js +36 -0
- package/dist/cli/chunk-e8493db0.js +4 -0
- package/dist/cli/{chunk-66kp3cr1.js → chunk-emm50f4q.js} +1 -1
- package/dist/cli/{chunk-etnxfpx5.js → chunk-fm4q306m.js} +1 -1
- package/dist/cli/{chunk-nceh1q3d.js → chunk-fpjcrjna.js} +1 -1
- package/dist/cli/chunk-fyf7xgaa.js +2 -0
- package/dist/cli/{chunk-e1g9mvww.js → chunk-g47vt3k5.js} +1 -1
- package/dist/cli/chunk-gtkejmxx.js +3 -0
- package/dist/cli/chunk-gzf4dfg6.js +3 -0
- package/dist/cli/chunk-j5r92gh9.js +2 -0
- package/dist/cli/chunk-jfkw009v.js +2 -0
- package/dist/cli/{chunk-zgx27dnc.js → chunk-jq5vp0f7.js} +1 -1
- package/dist/cli/{chunk-me77sx3d.js → chunk-jv5nqjnv.js} +1 -1
- package/dist/cli/chunk-jwv06n3d.js +8 -0
- package/dist/cli/{chunk-5x8ckw1a.js → chunk-jy6nd23p.js} +1 -1
- package/dist/cli/{chunk-zqwksfqh.js → chunk-k1sjc72d.js} +8 -8
- package/dist/cli/chunk-k9skkhzs.js +2 -0
- package/dist/cli/chunk-ktmvmskn.js +4 -0
- package/dist/cli/{chunk-xyy4f9ek.js → chunk-m2xasved.js} +2 -2
- package/dist/cli/chunk-m370e00b.js +4 -0
- package/dist/cli/{chunk-mcqzk9cg.js → chunk-m4my5wna.js} +3 -3
- package/dist/cli/chunk-m57cv76y.js +3 -0
- package/dist/cli/chunk-n4dmwkfa.js +4 -0
- package/dist/cli/chunk-nw91q4x3.js +2 -0
- package/dist/cli/{chunk-me7kkwp7.js → chunk-p9vkwnb8.js} +2 -2
- package/dist/cli/{chunk-856hq7jz.js → chunk-pmt3agbd.js} +1 -1
- package/dist/cli/{chunk-9m1nqceb.js → chunk-q0f6rhex.js} +2 -2
- package/dist/cli/chunk-q4ry13v3.js +2 -0
- package/dist/cli/chunk-r1p9bwja.js +7 -0
- package/dist/cli/{chunk-hg5x2wr0.js → chunk-r2pztgm6.js} +2 -2
- package/dist/cli/chunk-rf2m6f3h.js +5 -0
- package/dist/cli/{chunk-vapjtyv9.js → chunk-rgh49bm3.js} +1 -1
- package/dist/cli/{chunk-8nnmpnxb.js → chunk-rz8247zr.js} +2 -2
- package/dist/cli/chunk-rz8zs7j8.js +3 -0
- package/dist/cli/{chunk-zb56ck5f.js → chunk-s433recg.js} +1 -1
- package/dist/cli/{chunk-a4a4qaa2.js → chunk-s8xyh1bt.js} +1 -1
- package/dist/cli/chunk-sexavazm.js +3 -0
- package/dist/cli/chunk-ssepbf68.js +2 -0
- package/dist/cli/{chunk-jvpzy378.js → chunk-t05pnk6y.js} +1 -1
- package/dist/cli/{chunk-dkxhmj9k.js → chunk-tgxe9ae1.js} +2 -2
- package/dist/cli/{chunk-6zwg6me2.js → chunk-tk8p54f7.js} +1 -1
- package/dist/cli/chunk-tz9e598v.js +2 -0
- package/dist/cli/{chunk-jyv82gf0.js → chunk-w7zv47mp.js} +3 -4
- package/dist/cli/{chunk-mqbjqw85.js → chunk-wc1kk5c0.js} +1 -1
- package/dist/cli/{chunk-cytn2byt.js → chunk-wzyh3fgx.js} +1 -1
- package/dist/cli/{chunk-np07kccr.js → chunk-x39pv7rx.js} +1 -1
- package/dist/cli/{chunk-gbasmvsc.js → chunk-x3gch5nw.js} +1 -1
- package/dist/cli/{chunk-kd1anc9y.js → chunk-x8m1vmyd.js} +1 -1
- package/dist/cli/{chunk-jsss3ze7.js → chunk-xe62kmhp.js} +2 -2
- package/dist/cli/{chunk-adez6hq4.js → chunk-xnr8dga2.js} +3 -3
- package/dist/cli/chunk-xtr7ks02.js +3 -0
- package/dist/cli/{chunk-y2yq6zca.js → chunk-y5hnrx8d.js} +1 -1
- package/dist/cli/{chunk-13s8rnk5.js → chunk-y9ksfpbp.js} +1 -1
- package/dist/cli/{chunk-p7kztgsd.js → chunk-ybsdy2w8.js} +1 -1
- package/dist/cli/{chunk-bj59a9mg.js → chunk-yfg503fr.js} +1 -1
- package/dist/cli/{chunk-b8d162tf.js → chunk-zaxdx0wd.js} +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/kobe.js +1 -1
- package/dist/cli/pty-host-node.mjs +25 -2
- package/dist/cli/rove.js +1 -1
- package/package.json +3 -2
- package/dist/cli/chunk-003tvywc.js +0 -3
- package/dist/cli/chunk-02y7hdy3.js +0 -3
- package/dist/cli/chunk-0kn7xxqm.js +0 -6
- package/dist/cli/chunk-20pt9yqh.js +0 -4
- package/dist/cli/chunk-2jxdzw4r.js +0 -3
- package/dist/cli/chunk-2pqqvse3.js +0 -2
- package/dist/cli/chunk-49s2zc0h.js +0 -8
- package/dist/cli/chunk-5hhvrvgm.js +0 -8
- package/dist/cli/chunk-7nhdvr5v.js +0 -4
- package/dist/cli/chunk-8g456mmt.js +0 -3
- package/dist/cli/chunk-99devyxr.js +0 -2
- package/dist/cli/chunk-9mbvexw2.js +0 -2
- package/dist/cli/chunk-awsawfrm.js +0 -2
- package/dist/cli/chunk-bzz4ta7g.js +0 -17
- package/dist/cli/chunk-cxb93h7m.js +0 -2
- package/dist/cli/chunk-df7qe9y7.js +0 -4
- package/dist/cli/chunk-gjf604bb.js +0 -3
- package/dist/cli/chunk-gm3vj0fv.js +0 -5
- package/dist/cli/chunk-h356efbh.js +0 -2
- package/dist/cli/chunk-h5j8b87f.js +0 -2
- package/dist/cli/chunk-h79zfebh.js +0 -7
- package/dist/cli/chunk-ksd57jm6.js +0 -2
- package/dist/cli/chunk-m6pvaxm7.js +0 -2
- package/dist/cli/chunk-mfqjdpd8.js +0 -2
- package/dist/cli/chunk-ncsgawg7.js +0 -2
- package/dist/cli/chunk-pbqwegjy.js +0 -2
- package/dist/cli/chunk-q7dr9eh6.js +0 -3
- package/dist/cli/chunk-qtke4x42.js +0 -3
- package/dist/cli/chunk-seyk0v2m.js +0 -2
- package/dist/cli/chunk-v5893dx3.js +0 -2
- package/dist/cli/chunk-vwjec3m6.js +0 -3
- package/dist/cli/chunk-vws0j65e.js +0 -4
- package/dist/cli/chunk-w5xy83ze.js +0 -2
- package/dist/cli/chunk-xbc3gcry.js +0 -2
- package/dist/cli/chunk-yhcz2d2r.js +0 -34
- package/dist/cli/chunk-ykvk2546.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{SUBCOMMAND_VERBS,TOP_LEVEL_SUBCOMMANDS}from"./chunk-s76r56rj.js";import{activeCliName}from"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import"./chunk-cb2fpajx.js";import"./chunk-3bfm4hrs.js";import{__require}from"./chunk-wqfp8d9w.js";async function collectSubVerbs(){let{API_VERBS}=await import("./chunk-
|
|
2
|
+
import{SUBCOMMAND_VERBS,TOP_LEVEL_SUBCOMMANDS}from"./chunk-s76r56rj.js";import{activeCliName}from"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import"./chunk-cb2fpajx.js";import"./chunk-3bfm4hrs.js";import{__require}from"./chunk-wqfp8d9w.js";async function collectSubVerbs(){let{API_VERBS}=await import("./chunk-ssepbf68.js"),merged={...SUBCOMMAND_VERBS,api:API_VERBS};return Object.keys(merged).sort().map((command)=>[command,merged[command]??[]])}function completionUsage(cliName){return[`Usage: ${cliName} completions <bash|zsh|fish>`,"",`Generate a shell completion script for ${cliName} and print it to stdout.`,"","Install:",` zsh source <(${cliName} completions zsh) # one-off, or in ~/.zshrc after compinit`," # or the fpath way:",` # ${cliName} completions zsh > ~/.zsh/completions/_${cliName}`," # fpath=(~/.zsh/completions $fpath) # in ~/.zshrc, BEFORE compinit"," # rm -f ~/.zcompdump && exec zsh # rebuild the completion cache",` bash ${cliName} completions bash > ~/.bash_completion.d/${cliName} # source it from ~/.bashrc`,` fish ${cliName} completions fish > ~/.config/fish/completions/${cliName}.fish`,""].join(`
|
|
3
3
|
`)}function generateBashCompletions(cliName,subVerbs){let subcommands=TOP_LEVEL_SUBCOMMANDS.join(" "),fn=`_${cliName}`;return[`# ${cliName} bash completions`,`# Source: ${cliName} completions bash`,"",`${fn}() {`," local cur prev"," COMPREPLY=()",' cur="${COMP_WORDS[COMP_CWORD]}"',' prev="${COMP_WORDS[COMP_CWORD-1]}"'," if [[ ${COMP_CWORD} -eq 1 ]]; then",` COMPREPLY=( $(compgen -W "${subcommands}" -- "\${cur}") )`," return"," fi"," if [[ ${COMP_CWORD} -eq 2 ]]; then",' case "${prev}" in',...subVerbs.map(([command,verbs])=>` ${command}) COMPREPLY=( $(compgen -W "${verbs.join(" ")}" -- "\${cur}") ) ;;`)," esac"," fi","}",`complete -F ${fn} ${cliName}`,""].join(`
|
|
4
4
|
`)}function generateZshCompletions(cliName,subVerbs){let subcommandsList=TOP_LEVEL_SUBCOMMANDS.map((s)=>`"${s}"`).join(" "),fn=`_${cliName}`;return[`#compdef ${cliName}`,`# ${cliName} zsh completions`,`# Source: ${cliName} completions zsh`,"",`${fn}() {`," local -a subcommands verbs",` subcommands=(${subcommandsList})`,""," if (( CURRENT == 2 )); then"," _describe -t commands 'subcommand' subcommands"," return"," fi",""," verbs=()",' case "${words[2]}" in',...subVerbs.map(([command,verbs])=>` ${command}) verbs=(${verbs.map((v)=>`"${v}"`).join(" ")}) ;;`)," esac"," if (( CURRENT == 3 && ${#verbs} > 0 )); then"," _describe -t verbs 'verb' verbs"," fi","}","","# Autoloaded from $fpath -> run as the completion function;","# sourced directly -> register with compdef instead.",`if [ "\${funcstack[1]}" = "${fn}" ]; then`,` ${fn} "$@"`,"elif (( $+functions[compdef] )); then",` compdef ${fn} ${cliName}`,"fi",""].join(`
|
|
5
5
|
`)}function generateFishCompletions(cliName,subVerbs){let lines=[...TOP_LEVEL_SUBCOMMANDS.map((s)=>`complete -c ${cliName} -f -n __fish_use_subcommand -a ${s}`),...subVerbs.map(([command,verbs])=>`complete -c ${cliName} -f -n "__fish_seen_subcommand_from ${command}" -a "${verbs.join(" ")}"`)];return`# ${cliName} fish completions
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{API_SCHEMA_VERSION,API_VERBS,RETIRED_VERBS,VERBS,VERB_GROUPS,VerbArgs,apiUsage,buildCountPlan,defaultApiRuntime,deliverPrompt,findVerb,fullSchema,parseAgentsSpec,parseFlags,schemaIndex,takeIdentityWarning,validateAgainstSpec,verbHelp,verbSchema}from"./chunk-
|
|
2
|
+
import{API_SCHEMA_VERSION,API_VERBS,RETIRED_VERBS,VERBS,VERB_GROUPS,VerbArgs,apiUsage,buildCountPlan,defaultApiRuntime,deliverPrompt,findVerb,fullSchema,parseAgentsSpec,parseFlags,schemaIndex,takeIdentityWarning,validateAgainstSpec,verbHelp,verbSchema}from"./chunk-5mr9j201.js";import{ensurePluginEnginesLoaded}from"./chunk-9nbg0nzh.js";import{openDaemonSession}from"./chunk-1rkb0j1j.js";import"./chunk-aq912vvw.js";import"./chunk-d393z1mj.js";import"./chunk-d89r6eqm.js";import"./chunk-qkehg2c1.js";import"./chunk-0vmrteyg.js";import"./chunk-gtkejmxx.js";import{ApiError,splitDaemonCode}from"./chunk-t05pnk6y.js";import"./chunk-y5hnrx8d.js";import"./chunk-xnr8dga2.js";import"./chunk-hape5vwj.js";import"./chunk-7zmrn4gn.js";import"./chunk-1kktfmtg.js";import"./chunk-e8493db0.js";import"./chunk-gzf4dfg6.js";import"./chunk-jvxh93nz.js";import"./chunk-7q67dz4c.js";import"./chunk-1cjd7h8p.js";import"./chunk-b99tf0jr.js";import"./chunk-s8xyh1bt.js";import"./chunk-zaxdx0wd.js";import"./chunk-sexavazm.js";import"./chunk-sdyzxayr.js";import"./chunk-0sm2k04y.js";import"./chunk-5bn91n19.js";import"./chunk-pdh5w4ht.js";import"./chunk-4wwx51m5.js";import"./chunk-79gqh5p2.js";import"./chunk-3ztek08w.js";import"./chunk-kwe61yx7.js";import"./chunk-x3gch5nw.js";import"./chunk-e7t4xpr9.js";import"./chunk-n4dmwkfa.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-m370e00b.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-87y9qjcm.js";import"./chunk-m57cv76y.js";import"./chunk-dmdqnet6.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import{errorMessage}from"./chunk-2brn8e1y.js";import"./chunk-9c1e5z6a.js";import"./chunk-6dn6h640.js";import"./chunk-h82kzdsn.js";import"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import"./chunk-cb2fpajx.js";import"./chunk-grh6dvfv.js";import"./chunk-pw6yfj10.js";import"./chunk-rxvbm4vt.js";import"./chunk-x760j10f.js";import"./chunk-3bfm4hrs.js";import"./chunk-wqfp8d9w.js";function emit(value,pretty){let warning=takeIdentityWarning(),payload=warning&&value&&typeof value==="object"&&!Array.isArray(value)?{...value,identityWarning:warning}:value,text=pretty?JSON.stringify(payload,null,2):JSON.stringify(payload);process.stdout.write(`${text}
|
|
3
3
|
`)}function fail(message,code,exitCode=1,data){process.stderr.write(`${JSON.stringify({error:{message,code,...data}})}
|
|
4
4
|
`),process.exit(exitCode)}function makeContext(verb,flags,client,runtime){return{args:new VerbArgs(verb,flags),client,runtime}}var SCHEMA_STEP={hint:"list every valid verb + flag as JSON, then retry with a real verb",nextCommandArgs:["api","schema"]};function unknownVerbError(verbName){let retired=RETIRED_VERBS[verbName];if(retired)return new ApiError(`unknown verb: ${verbName} (removed)`,"UNKNOWN_VERB",{hint:retired.hint,nextCommandArgs:[...retired.nextCommandArgs]});return new ApiError(`unknown verb: ${verbName}`,"BAD_VERB",SCHEMA_STEP)}function toApiError(err){if(err instanceof ApiError)return err;let message=errorMessage(err);if(/task not found/i.test(message))return new ApiError(message,"TASK_NOT_FOUND",{hint:"that task id does not exist (deleted or mistyped) \u2014 list live tasks and retry with a real id",nextCommandArgs:["api","list"]});if(/unknown daemon request:/i.test(message))return versionSkewError(message);let coded=splitDaemonCode(message);if(coded)return new ApiError(coded.rest,coded.code);return new ApiError(message,"RPC_ERROR")}function versionSkewError(message){return new ApiError(message,"DAEMON_VERSION_SKEW",{hint:"the running daemon is a different build than this CLI, so it does not serve this verb \u2014 restart the daemon to pick up this build, then retry (if the verb is gone for good, `rove api schema` lists what this daemon actually serves)",nextCommandArgs:["daemon","restart"]})}async function invokeVerb(verbName,argv,deps){let verb=findVerb(verbName);if(!verb)throw unknownVerbError(verbName);let booleanFlags=new Set(verb.flags.filter((f)=>f.type==="bool").map((f)=>f.name)),parsed=parseFlags(argv,booleanFlags);validateAgainstSpec(verb,parsed.flags);try{return await verb.handler(makeContext(verb,parsed.flags,deps.client,deps.runtime??defaultApiRuntime))}catch(err){throw toApiError(err)}}async function runApiSubcommand(argv){let[verbName,...rest]=argv;if(!verbName||verbName==="--help"||verbName==="-h"||verbName==="help"){if(!verbName)fail(apiUsage(),"MISSING_VERB",2);process.stdout.write(`${apiUsage()}
|
|
5
5
|
`);return}ensurePluginEnginesLoaded();let verb=findVerb(verbName);if(!verb){let err=unknownVerbError(verbName);fail(`${err.message}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{interactiveEngineCommand,listPresetIds}from"./chunk-
|
|
2
|
+
import{interactiveEngineCommand,listPresetIds}from"./chunk-gzf4dfg6.js";import{engineEntry}from"./chunk-e7t4xpr9.js";import{installedEngineIds}from"./chunk-n4dmwkfa.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{detectEngineStatuses,describeAccount,probeableEngineIds,summarizeEngines};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{engineEntry,identifiableEngineIds}from"./chunk-
|
|
2
|
+
import{engineEntry,identifiableEngineIds}from"./chunk-e7t4xpr9.js";import{basename}from"path";var WRAPPERS=new Set(["node","bun","npx","deno","sh","zsh","bash","env","script"]);function binaryName(token){return basename(token).replace(/\.(exe|js|mjs|cjs)$/,"")}function executableNameFromArgv(argv){for(let token of argv.slice(0,8)){if(/^[A-Za-z_][A-Za-z0-9_]*=/.test(token))continue;let name=binaryName(token);if(WRAPPERS.has(name))continue;return name||null}return null}function vendorFromArgv(commandLine){let name=executableNameFromArgv(commandLine.trim().split(/\s+/));if(!name)return null;return identifiableEngineIds().find((v)=>{let entry=engineEntry(v);return entry.defaultCommand[0]===name||entry.processNames?.includes(name)===!0})??null}function parsePsSnapshot(text){let rows=[];for(let line of text.split(`
|
|
3
3
|
`)){let m=/^\s*(\d+)\s+(\d+)\s+(\S.*)$/.exec(line);if(m)rows.push({pid:Number(m[1]),ppid:Number(m[2]),args:m[3]})}return rows}function childrenIndex(rows){let kids=new Map;for(let row of rows){let list=kids.get(row.ppid);if(list)list.push(row);else kids.set(row.ppid,[row])}return kids}function hasAncestor(rows,pid,ancestorPid){let parents=new Map(rows.map((r)=>[r.pid,r.ppid])),cur=pid;for(let hops=0;hops<=rows.length;hops++){if(cur===ancestorPid)return!0;let next=parents.get(cur);if(next===void 0||next<=1)return!1;cur=next}return!1}function foregroundEngineIn(rows,rootPid){let kids=childrenIndex(rows),queue=[...kids.get(rootPid)??[]];while(queue.length>0){let row=queue.shift();if(!row)break;let vendor=vendorFromArgv(row.args);if(vendor)return{vendor,argv:row.args,pid:row.pid};queue.push(...kids.get(row.pid)??[])}return null}function engineProcessIn(rows,rootPid,extraLaunch){if(foregroundEngineIn(rows,rootPid))return!0;let expected=extraLaunch?executableNameFromArgv(typeof extraLaunch==="string"?[extraLaunch]:extraLaunch):null;if(!expected)return!1;let kids=childrenIndex(rows),queue=[...kids.get(rootPid)??[]];while(queue.length>0){let row=queue.shift();if(!row)break;if(executableNameFromArgv(row.args.trim().split(/\s+/))===expected)return!0;queue.push(...kids.get(row.pid)??[])}return!1}var psSnapshot=async()=>{let proc=Bun.spawn(["ps","-A","-o","pid=,ppid=,args="],{stdout:"pipe",stderr:"ignore"});return await new Response(proc.stdout).text()};async function foregroundEngine(rootPid,snapshot=psSnapshot){try{return foregroundEngineIn(parsePsSnapshot(await snapshot()),rootPid)}catch{return null}}
|
|
4
4
|
export{vendorFromArgv,parsePsSnapshot,hasAncestor,foregroundEngineIn,engineProcessIn,psSnapshot,foregroundEngine};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{stampResetGate}from"./chunk-
|
|
2
|
+
import{stampResetGate}from"./chunk-jy6nd23p.js";import{stopLegacyTmux}from"./chunk-dqndd97s.js";import"./chunk-gtkejmxx.js";import{stopDaemonProcess}from"./chunk-pdh5w4ht.js";import"./chunk-4wwx51m5.js";import"./chunk-79gqh5p2.js";import"./chunk-3ztek08w.js";import"./chunk-kwe61yx7.js";import"./chunk-m57cv76y.js";import"./chunk-a3a9gdc4.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{kvStatePath,legacyKobeKvStatePath,legacyKobeStateDir,roveStateDir}from"./chunk-6dn6h640.js";import{activeCliName}from"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import"./chunk-cb2fpajx.js";import"./chunk-grh6dvfv.js";import"./chunk-pw6yfj10.js";import{defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-x760j10f.js";import"./chunk-3bfm4hrs.js";import"./chunk-wqfp8d9w.js";import{readFileSync}from"fs";import{unlink}from"fs/promises";import{join}from"path";import{createInterface}from"readline";var CLI_NAME=activeCliName();function printUsage(out){out.write([`Usage: ${CLI_NAME} reset [--hard] [--yes]`,"","Recover a wedged install: stop the daemon, Hosted PTY host, and any pre-v0.8 tmux sessions.","This ends background terminal and engine sessions; the next launch starts fresh.","Never touches your git worktrees.","","Options:"," --hard Also wipe the task index + UI state"," -y, --yes Skip the interactive confirmation"," -h, --help Print this help",""].join(`
|
|
3
3
|
`))}function taskCount(path){try{let parsed=JSON.parse(readFileSync(path,"utf8"));return Array.isArray(parsed.tasks)?parsed.tasks.length:null}catch{return null}}async function confirmTty(prompt){let readline=createInterface({input:process.stdin,output:process.stdout});try{let answer=await new Promise((resolve)=>readline.question(prompt,resolve));return/^y(es)?$/i.test(answer.trim())}finally{readline.close()}}async function removeStateFile(path,label){try{await unlink(path),console.log(` removed ${label} (${path})`)}catch(err){if(err.code==="ENOENT")console.log(` ${label}: already absent`);else throw Error(`failed to remove ${label} (${path}): ${errorMessage(err)}`)}}async function runResetSubcommand(argv){if(argv.some((arg)=>arg==="--help"||arg==="-h"||arg==="help")){printUsage(process.stdout);return}let known=new Set(["--hard","--yes","-y"]),unknown=argv.find((arg)=>!known.has(arg));if(unknown!==void 0)process.stderr.write(`${CLI_NAME} reset: unknown argument "${unknown}"
|
|
4
4
|
|
|
5
5
|
`),printUsage(process.stderr),process.exit(2);let hard=argv.includes("--hard"),yes=argv.includes("--yes")||argv.includes("-y"),daemonSocket=defaultDaemonSocketPath(),tasksPath=join(roveStateDir(),"tasks.json"),legacyTasksPath=join(legacyKobeStateDir(),"tasks.json"),statePath=kvStatePath(),legacyStatePath=legacyKobeKvStatePath();if(console.log(`${CLI_NAME} reset will:`),console.log(" \u2022 stop the Rove daemon (graceful \u2192 SIGTERM \u2192 SIGKILL)"),console.log(` \u2022 remove its socket + pidfile (${daemonSocket})`),console.log(" \u2022 stop the standalone Hosted PTY host and all background terminal/engine sessions"),console.log(" \u2022 stop any pre-v0.8 tmux sessions after SIGTERM-ing their pane process groups"),hard){let count=taskCount(tasksPath)??taskCount(legacyTasksPath);console.log(` \u2022 DELETE the task index${count===null?"":` (${count} task(s))`} \u2014 ${tasksPath}`),console.log(` \u2022 DELETE the UI state \u2014 ${statePath}`),console.log(" \u2022 DELETE the pre-Rove task/UI indexes too, so migration cannot restore reset state")}if(console.log(" \u2022 NOT touch your git worktrees under ~/.rove/worktrees/, ~/.kobe/worktrees/, or repo-local roots"),!hard)console.log(" (your task list & worktrees are kept \u2014 add --hard to also wipe task and UI state)");if(!yes){if(!process.stdin.isTTY){console.log(`
|
|
@@ -4,8 +4,8 @@ import{SUBCOMMAND_VERBS}from"./chunk-s76r56rj.js";import{expandTilde}from"./chun
|
|
|
4
4
|
|
|
5
5
|
`),printUsage(),process.exit(2)}function listThemes(){let lines=[];lines.push("bundled:");for(let name of[...BUNDLED_NAMES].sort())lines.push(` ${name} [built-in]`);let dir=userThemesDir(),userFiles=[];try{userFiles=readdirSync(dir).filter((f)=>f.endsWith(".json")).sort()}catch{}if(lines.push(""),lines.push(`user (${dir}):`),userFiles.length===0)lines.push(" (none)");else for(let f of userFiles){let name=f.slice(0,-5),path=join(dir,f),overridesBundled=BUNDLED_NAMES.includes(name)?" (overrides built-in)":"";lines.push(` ${name}${overridesBundled} ${path}`)}process.stdout.write(`${lines.join(`
|
|
6
6
|
`)}
|
|
7
|
-
`)}async function readSource(source){if(/^https?:\/\//i.test(source)){let res;try{res=await fetch(source)}catch(err){fail(`failed to fetch ${source}: ${errorMessage(err)}`)}if(!res.ok)fail(`failed to fetch ${source}: HTTP ${res.status} ${res.statusText}`);let text2=await res.text(),cleanPath=source.split(/[?#]/)[0]??source,file2=basename(cleanPath)||"theme.json",defaultName2=file2.endsWith(".json")?file2.slice(0,-5):file2;return{text:text2,defaultName:defaultName2}}let abs=resolve(process.cwd(),expandTilde(source)),text;try{text=readFileSync(abs,"utf8")}catch(err){fail(`failed to read ${abs}: ${errorMessage(err)}`)}let file=basename(abs),defaultName=file.endsWith(".json")?file.slice(0,-5):file;return{text,defaultName}}function parseAddArgs(args){let source=null,name,force=!1;for(let i=0;i<args.length;i+=1){let a=args[i];if(a==="--force"||a==="-f"){force=!0;continue}if(a==="--name"||a==="-n"){let next=args[i+1];if(next===void 0)failUsage("--name requires a value");name=next,i+=1;continue}if(a.startsWith("--name=")){name=a.slice(7);continue}if(a.startsWith("--"))failUsage(`unknown flag: ${a}`);if(source===null){source=a;continue}failUsage(`unexpected positional argument: ${a}`)}if(source===null)failUsage("missing <source> (URL or path to theme JSON)");return{source,opts:{name,force}}}async function addTheme(args){let{source,opts}=parseAddArgs(args),{text,defaultName}=await readSource(source),parsed;try{parsed=JSON.parse(text)}catch(err){fail(`source is not valid JSON: ${errorMessage(err)}`)}let result=validateTheme(parsed);if(!result.ok)fail(`source is not a valid Rove theme: ${result.reason}`);let name=opts.name??defaultName
|
|
7
|
+
`)}async function readSource(source){if(/^https?:\/\//i.test(source)){let res;try{res=await fetch(source)}catch(err){fail(`failed to fetch ${source}: ${errorMessage(err)}`)}if(!res.ok)fail(`failed to fetch ${source}: HTTP ${res.status} ${res.statusText}`);let text2=await res.text(),cleanPath=source.split(/[?#]/)[0]??source,file2=basename(cleanPath)||"theme.json",defaultName2=file2.endsWith(".json")?file2.slice(0,-5):file2;return{text:text2,defaultName:defaultName2}}let abs=resolve(process.cwd(),expandTilde(source)),text;try{text=readFileSync(abs,"utf8")}catch(err){fail(`failed to read ${abs}: ${errorMessage(err)}`)}let file=basename(abs),defaultName=file.endsWith(".json")?file.slice(0,-5):file;return{text,defaultName}}function parseAddArgs(args){let source=null,name,force=!1;for(let i=0;i<args.length;i+=1){let a=args[i];if(a==="--force"||a==="-f"){force=!0;continue}if(a==="--name"||a==="-n"){let next=args[i+1];if(next===void 0)failUsage("--name requires a value");name=next,i+=1;continue}if(a.startsWith("--name=")){name=a.slice(7);continue}if(a.startsWith("--"))failUsage(`unknown flag: ${a}`);if(source===null){source=a;continue}failUsage(`unexpected positional argument: ${a}`)}if(source===null)failUsage("missing <source> (URL or path to theme JSON)");return{source,opts:{name,force}}}async function addTheme(args){let{source,opts}=parseAddArgs(args),{text,defaultName}=await readSource(source),parsed;try{parsed=JSON.parse(text)}catch(err){fail(`source is not valid JSON: ${errorMessage(err)}`)}let result=validateTheme(parsed);if(!result.ok)fail(`source is not a valid Rove theme: ${result.reason}`);let name=requireThemeName(opts.name??defaultName),dir=userThemesDir();mkdirSync(dir,{recursive:!0});let dest=join(dir,`${name}.json`);if(existsSync(dest)&&!opts.force)fail(`${dest} already exists (pass --force to overwrite)`);writeFileSync(dest,`${JSON.stringify(result.theme,null,2)}
|
|
8
8
|
`,"utf8"),process.stdout.write(`installed theme "${name}" -> ${dest}
|
|
9
|
-
`)}function
|
|
9
|
+
`)}function requireThemeName(name){if(!name||!/^[a-zA-Z0-9._-]+$/.test(name)||name==="."||name==="..")fail(`invalid theme name "${name}" (use letters, digits, '.', '_', '-')`);return name}function removeTheme(args){if(!args[0])failUsage("missing <name>");if(args.length>1)failUsage(`unexpected extra arguments after "${args[0]}"`);let name=requireThemeName(args[0]);if(BUNDLED_NAMES.includes(name))fail(`"${name}" is a built-in theme and cannot be removed`);let dest=join(userThemesDir(),`${name}.json`);if(!existsSync(dest))fail(`no user theme named "${name}" (looked for ${dest})`);unlinkSync(dest),process.stdout.write(`removed theme "${name}" (${dest})
|
|
10
10
|
`)}function printUsage(out=process.stderr){out.write([`Usage: ${CLI_NAME} theme <command> [args]`,"","Commands:"," list List bundled and user-installed themes"," add <source> [--name <name>] Install a theme from a URL or local path"," Pass --force to overwrite an existing user theme"," remove <name> Remove a user-installed theme","",`User themes live under: ${userThemesDir()}`,"Schema: https://raw.githubusercontent.com/sma1lboy/rove/main/packages/kobe/src/tui/context/theme/theme.schema.json",""].join(`
|
|
11
11
|
`))}async function runThemeSubcommand(args){let[action,...rest]=args;if(!action||action==="--help"||action==="-h"||action==="help"){if(printUsage(action?process.stdout:process.stderr),!action)process.exit(2);return}let verb=THEME_VERB_ALIASES[action]??action;if(!SUBCOMMAND_VERBS.theme.includes(verb))failUsage(`unknown action "${action}" (try ${SUBCOMMAND_VERBS.theme.map((v)=>`"${v}"`).join(", ")})`);if(verb==="list"){if(rest.length>0)failUsage(`"${action}" takes no arguments`);listThemes();return}if(verb==="add"){await addTheme(rest);return}if(verb==="remove"){removeTheme(rest);return}failUsage(`unknown action "${action}"`)}export{runThemeSubcommand};
|