@sma1lboy/rove 0.9.248 → 0.9.250
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-frtdk8ha.js → chunk-06d596z0.js} +1 -1
- package/dist/cli/{chunk-sxtxxd65.js → chunk-09y4jh6p.js} +1 -1
- package/dist/cli/chunk-191gy3f0.js +2 -0
- package/dist/cli/{chunk-ztcxkm24.js → chunk-21xgqgmv.js} +1 -1
- package/dist/cli/{chunk-n4f4xxhr.js → chunk-2kshjtcs.js} +1 -1
- package/dist/cli/{chunk-1rhham18.js → chunk-2r696a8v.js} +1 -1
- package/dist/cli/{chunk-kcb75khv.js → chunk-38s9e8dh.js} +1 -1
- package/dist/cli/{chunk-hfjd4j5b.js → chunk-3dey6b3r.js} +1 -1
- package/dist/cli/{chunk-e6w94amk.js → chunk-3hcsvyeq.js} +1 -1
- package/dist/cli/{chunk-twa07m8w.js → chunk-41r8zj46.js} +1 -1
- package/dist/cli/{chunk-ekknb5ft.js → chunk-5fft208x.js} +1 -1
- package/dist/cli/{chunk-wvwkmj3t.js → chunk-66r43sfd.js} +1 -1
- package/dist/cli/{chunk-knpr38z6.js → chunk-6axpatfy.js} +1 -1
- package/dist/cli/{chunk-nra5y7r7.js → chunk-78kh1fet.js} +1 -1
- package/dist/cli/{chunk-ha09kd22.js → chunk-79hrybcd.js} +1 -1
- package/dist/cli/{chunk-dmecdp9c.js → chunk-7s67c0kw.js} +1 -1
- package/dist/cli/{chunk-89ag6mab.js → chunk-7xttx9m1.js} +11 -11
- package/dist/cli/{chunk-7mxd2n7q.js → chunk-8gmxg77t.js} +1 -1
- package/dist/cli/{chunk-hdbj5yaz.js → chunk-8kx2k2s8.js} +2 -2
- package/dist/cli/{chunk-dk3g9ynd.js → chunk-8m5crcy5.js} +20 -19
- package/dist/cli/{chunk-jjwxx8yp.js → chunk-8mfpv3fh.js} +1 -1
- package/dist/cli/{chunk-5nfdpc9j.js → chunk-8n19nb0s.js} +1 -1
- package/dist/cli/{chunk-761w6mbm.js → chunk-93r6tgf1.js} +1 -1
- package/dist/cli/{chunk-xpt1rabn.js → chunk-9853bbb9.js} +2 -2
- package/dist/cli/{chunk-k4374n9t.js → chunk-99n8qsw9.js} +2 -2
- package/dist/cli/{chunk-ecdhqwsj.js → chunk-a4hsqj1b.js} +1 -1
- package/dist/cli/{chunk-3y2tv956.js → chunk-ap3r73bm.js} +3 -3
- package/dist/cli/{chunk-ncxhtx5a.js → chunk-asy33vdy.js} +1 -1
- package/dist/cli/{chunk-09y7gspe.js → chunk-bvqazrbz.js} +1 -1
- package/dist/cli/{chunk-9d2p1h1b.js → chunk-c01899mr.js} +1 -1
- package/dist/cli/{chunk-x6gpzj4t.js → chunk-ce16ecse.js} +1 -1
- package/dist/cli/{chunk-jxyvk9c0.js → chunk-cmss5e88.js} +1 -1
- package/dist/cli/{chunk-8shm2q5k.js → chunk-d5xc67hp.js} +1 -1
- package/dist/cli/{chunk-2rve8y8t.js → chunk-e8d5951a.js} +1 -1
- package/dist/cli/chunk-fe7kwz48.js +3 -0
- package/dist/cli/{chunk-5xh7ee2k.js → chunk-fxm1cmp9.js} +1 -1
- package/dist/cli/{chunk-mxag13a6.js → chunk-fxqp6zt5.js} +1 -1
- package/dist/cli/{chunk-0vpn32r6.js → chunk-fz17c524.js} +1 -1
- package/dist/cli/{chunk-q2177zrc.js → chunk-g4k86vkr.js} +1 -1
- package/dist/cli/{chunk-ehs0wh6y.js → chunk-g8fjjbnj.js} +1 -1
- package/dist/cli/{chunk-fs3p13ah.js → chunk-gc77ewk2.js} +1 -1
- package/dist/cli/{chunk-hmm0z8x9.js → chunk-gcdm2jke.js} +1 -1
- package/dist/cli/{chunk-32zj8r86.js → chunk-gpb49qs3.js} +1 -1
- package/dist/cli/{chunk-nz1436cx.js → chunk-hhvvcwjq.js} +1 -1
- package/dist/cli/{chunk-dhnbgfhh.js → chunk-hm6qe86k.js} +1 -1
- package/dist/cli/{chunk-taa06w9e.js → chunk-hzfq0sst.js} +1 -1
- package/dist/cli/{chunk-jj640vvr.js → chunk-j3c4kygc.js} +1 -1
- package/dist/cli/{chunk-y79j580z.js → chunk-j4cqwqnc.js} +1 -1
- package/dist/cli/{chunk-v1ban2hc.js → chunk-jh11snb1.js} +1 -1
- package/dist/cli/{chunk-ncxkn8gy.js → chunk-jk8knad0.js} +2 -2
- package/dist/cli/{chunk-mra8t9tk.js → chunk-k39sf30b.js} +1 -1
- package/dist/cli/{chunk-55rpt311.js → chunk-kecy2zcc.js} +4 -4
- package/dist/cli/{chunk-ysfe09dd.js → chunk-knfnbv60.js} +2 -2
- package/dist/cli/{chunk-043hdsx6.js → chunk-kqc0kym1.js} +1 -1
- package/dist/cli/{chunk-ppj32x3a.js → chunk-m3sq1vgk.js} +1 -1
- package/dist/cli/{chunk-fd260eye.js → chunk-mn6qth54.js} +1 -1
- package/dist/cli/{chunk-cbhzyn31.js → chunk-ntrwd6ks.js} +1 -1
- package/dist/cli/{chunk-9wfdzbnr.js → chunk-pkk9j80z.js} +2 -2
- package/dist/cli/{chunk-shdzs3kz.js → chunk-r07zjer5.js} +1 -1
- package/dist/cli/{chunk-91gkmv3b.js → chunk-rjxj5tf4.js} +1 -1
- package/dist/cli/{chunk-esz0pj68.js → chunk-rtdr5bm8.js} +1 -1
- package/dist/cli/{chunk-30fygd49.js → chunk-rvqse0aa.js} +1 -1
- package/dist/cli/{chunk-y7xzcxb3.js → chunk-vb2tzcde.js} +1 -1
- package/dist/cli/{chunk-5ftfwgnj.js → chunk-vt6ghz8y.js} +1 -1
- package/dist/cli/{chunk-kxzv662p.js → chunk-vt7bc8d6.js} +1 -1
- package/dist/cli/{chunk-ypjca5g3.js → chunk-w594v1n8.js} +1 -1
- package/dist/cli/{chunk-bqthw6ce.js → chunk-wkt6h5cf.js} +1 -1
- package/dist/cli/{chunk-b27fyc2m.js → chunk-wnwzj8am.js} +1 -1
- package/dist/cli/{chunk-89ze9jc2.js → chunk-wtdj8n93.js} +1 -1
- package/dist/cli/chunk-x33sm4rp.js +5 -0
- package/dist/cli/{chunk-v4fa5ycf.js → chunk-y2bga5cw.js} +3 -3
- package/dist/cli/{chunk-0qh9w2sc.js → chunk-y7mg74jx.js} +1 -1
- package/dist/cli/{chunk-wy7qtcym.js → chunk-yjs6d5w1.js} +2 -2
- package/dist/cli/{chunk-empeprq2.js → chunk-z0ewb9k9.js} +1 -1
- package/dist/cli/{chunk-3b52kybr.js → chunk-zh30b87y.js} +1 -1
- package/dist/cli/{chunk-62wgn4br.js → chunk-zwq8cb8p.js} +1 -1
- package/dist/cli/index.js +4 -4
- package/dist/cli/pty-host-node.mjs +1 -0
- package/dist/cli/rove.js +1 -1
- package/dist/web/assets/{index-BC558ZDT.js → index-DaovU92T.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +3 -3
- package/dist/cli/chunk-b9t4vq5j.js +0 -3
- package/dist/cli/chunk-zkmsvjtd.js +0 -2
- package/dist/cli/chunk-znjcesdr.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{SUBCOMMAND_VERBS}from"./chunk-e1x88j3k.js";import{NPX_MISSING_EXIT,bundledSkillDir,installedSkillDiffersFromBundled,npxSkillsCommand,roveSkillPaths,roveSkillState,runNpxSkillsInstall}from"./chunk-
|
|
2
|
+
import{SUBCOMMAND_VERBS}from"./chunk-e1x88j3k.js";import{NPX_MISSING_EXIT,bundledSkillDir,installedSkillDiffersFromBundled,npxSkillsCommand,roveSkillPaths,roveSkillState,runNpxSkillsInstall}from"./chunk-rvqse0aa.js";import"./chunk-h9cg0j3a.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-7q43tysm.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-wqfp8d9w.js";import{existsSync,readFileSync}from"fs";import{join}from"path";var CLI_NAME=ROVE_PRODUCT_NAME,SKILL_VERBS=SUBCOMMAND_VERBS.skill;function skillUsage(){return[`usage: ${CLI_NAME} skill <verb>`,"","verbs:"," install [--global|-g | --project|-p] [--agent NAME]\u2026 Install the Rove agent skill (wraps `npx skills add`)"," status Show whether the skill is installed"," command [--global|-g | --project|-p] [--agent NAME]\u2026 Print the underlying npx command without running it",` print Print the bundled SKILL.md (also: \`${CLI_NAME} --skill\`)`,"",`The skill teaches a coding agent how to drive \`${CLI_NAME} api\`. Installs are`,"global (user-level) by default; --global/-g says so explicitly, --project/-p","installs into the current project instead. With no --agent, the agent-skills","CLI detects your installed agents and asks; repeat --agent to name them","(e.g. --agent claude-code --agent codex)."].join(`
|
|
3
3
|
`)}function parseInstallFlags(rest){let global=!0,agents=[];for(let i=0;i<rest.length;i++){let arg=rest[i];if(arg==="--project"||arg==="-p")global=!1;else if(arg==="--global"||arg==="-g")global=!0;else if(arg==="--agent"){let v=rest[i+1];if(!v||v.startsWith("--"))process.stderr.write(`${CLI_NAME} skill: --agent requires a value
|
|
4
4
|
`),process.exit(2);agents.push(v),i++}else if(arg.startsWith("--agent="))agents.push(arg.slice(8));else process.stderr.write(`${CLI_NAME} skill: unknown flag "${arg}"
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ ${skillUsage()}
|
|
|
11
11
|
|
|
12
12
|
${skillUsage()}
|
|
13
13
|
`),process.exit(2);if(verb==="print"){let bundled2=bundledSkillDir(),path=bundled2?join(bundled2,"SKILL.md"):roveSkillPaths().find((p)=>existsSync(p));if(!path)process.stderr.write(`${CLI_NAME} skill: no SKILL.md found (not bundled, not installed) \u2014 run \`${CLI_NAME} skill install\`
|
|
14
|
-
`),process.exit(1);process.stdout.write(readFileSync(path,"utf8"));return}if(verb==="status"){let{isRovePluginEnabled}=await import("./chunk-
|
|
14
|
+
`),process.exit(1);process.stdout.write(readFileSync(path,"utf8"));return}if(verb==="status"){let{isRovePluginEnabled}=await import("./chunk-8mfpv3fh.js"),state=roveSkillState(),paths=roveSkillPaths(),pluginNote=isRovePluginEnabled()?` note: the Rove Claude Code plugin is enabled \u2014 for Claude Code the skill ships
|
|
15
15
|
inside the plugin and versions with it (staleness prompts are suppressed).
|
|
16
16
|
`:"",head=!state.installed?"\u2717 not installed":state.stale?`\u26A0 out of date (installed ${state.installedVersion===null?"unstamped":`v${state.installedVersion}`}, this Rove wants v${state.currentVersion})`:`\u2713 installed (v${state.installedVersion})`,contentDrift=state.installed&&!state.stale&&!!state.path&&installedSkillDiffersFromBundled(state.path);process.stdout.write([`${CLI_NAME} skill: ${head}`,...contentDrift?[" \u26A0 content differs from the copy bundled with this Rove at the same version \u2014",` run \`${CLI_NAME} --skill > ${state.path}\` to refresh it`]:[],` looked in: ${paths.join(`
|
|
17
17
|
`)}`,state.installed&&!state.stale?"":` \u2192 run \`${CLI_NAME} skill install\` to install / refresh`,""].join(`
|
|
@@ -21,5 +21,5 @@ ${bundled?"":`${CLI_NAME} skill: no bundled skill found \u2014 falling back to a
|
|
|
21
21
|
`}`);let code=await runNpxSkillsInstall(agents,global);if(code!==0){if(code!==NPX_MISSING_EXIT)process.stderr.write(`
|
|
22
22
|
${CLI_NAME} skill install failed (npx exited ${code}).
|
|
23
23
|
You can run it yourself: ${npxSkillsCommand({agent:agents,global})}
|
|
24
|
-
`);process.exit(code||1)}if(global){let{settleWelcomeInstall}=await import("./chunk-
|
|
24
|
+
`);process.exit(code||1)}if(global){let{settleWelcomeInstall}=await import("./chunk-2kshjtcs.js");settleWelcomeInstall("skill")}process.stdout.write(`${CLI_NAME} skill: installed.
|
|
25
25
|
`)}export{runSkillSubcommand};
|
|
@@ -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-kecy2zcc.js";import"./chunk-yjs6d5w1.js";import"./chunk-21xgqgmv.js";import"./chunk-fxqp6zt5.js";import"./chunk-8gqkrbyr.js";import"./chunk-06d596z0.js";import"./chunk-hbn1t161.js";import"./chunk-3dey6b3r.js";import"./chunk-17e2tgyg.js";import"./chunk-cbc1h345.js";import"./chunk-4xns5j33.js";import"./chunk-4hestsjp.js";import"./chunk-q8q22wq3.js";import"./chunk-2bgmby1d.js";import"./chunk-86tw1190.js";import"./chunk-41x1hrqe.js";import"./chunk-5mhvjytn.js";import"./chunk-atn06ncf.js";import"./chunk-qkehg2c1.js";import"./chunk-k39sf30b.js";import"./chunk-09y4jh6p.js";import"./chunk-z0ewb9k9.js";import"./chunk-cbjh43yc.js";import"./chunk-2apszxn2.js";import"./chunk-sak1tphp.js";import"./chunk-93r6tgf1.js";import"./chunk-rxqdw6s5.js";import"./chunk-4250pw6r.js";import"./chunk-hhvvcwjq.js";import"./chunk-vjvkkrzc.js";import"./chunk-pdvyfz3n.js";import"./chunk-gcxcq22q.js";import"./chunk-hpay0ax8.js";import"./chunk-catrr0z3.js";import"./chunk-ntrwd6ks.js";import"./chunk-7xttx9m1.js";import"./chunk-99n8qsw9.js";import"./chunk-w7zv47mp.js";import"./chunk-2tfnscxk.js";import"./chunk-etfh8f4z.js";import"./chunk-6xppe9bj.js";import"./chunk-f7zjggfv.js";import"./chunk-zsfyj36g.js";import"./chunk-gc77ewk2.js";import"./chunk-ce16ecse.js";import"./chunk-jh11snb1.js";import"./chunk-ag3txfg2.js";import"./chunk-2brn8e1y.js";import"./chunk-y7mg74jx.js";import"./chunk-x33sm4rp.js";import"./chunk-7kysxgbq.js";import"./chunk-qzsahxd9.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-tdhk4dz8.js";import"./chunk-fe7kwz48.js";import"./chunk-h9cg0j3a.js";import"./chunk-40dgv828.js";import"./chunk-3342qzve.js";import"./chunk-7q43tysm.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import"./chunk-prqeddy7.js";import"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-66r43sfd.js";import"./chunk-cmss5e88.js";import"./chunk-nhakrm1f.js";import"./chunk-pxk2c2vj.js";import"./chunk-fz17c524.js";import"./chunk-x8fd9y51.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-wqfp8d9w.js";export{unknownVerbError,findVerb,VERB_GROUPS,VERB_ALIASES,VERBS,API_VERBS};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t}from"./chunk-
|
|
2
|
+
import{t}from"./chunk-66r43sfd.js";function failureHint(error,cliName="rove"){let details=typeof error==="object"&&error!==null?error:null,hint=details&&"hint"in details&&typeof details.hint==="string"?details.hint:null,args=details&&"nextCommandArgs"in details?details.nextCommandArgs:null,command=Array.isArray(args)&&args.length>0&&args.every((arg)=>typeof arg==="string")?[cliName,...args].map((arg)=>/^[\w./:@=-]+$/.test(arg)?arg:`'${arg.replaceAll("'","'\\''")}'`).join(" "):null;return[hint,command].filter(Boolean).join(`
|
|
3
3
|
`)||t("common.failureHint",{command:`${cliName} doctor`})}
|
|
4
4
|
export{failureHint};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{stopLegacyTmux}from"./chunk-gkdfct7t.js";import{clearFrozenSessions}from"./chunk-0y4qgnby.js";import"./chunk-4250pw6r.js";import{stopDaemonProcess}from"./chunk-
|
|
2
|
+
import{stopLegacyTmux}from"./chunk-gkdfct7t.js";import{clearFrozenSessions}from"./chunk-0y4qgnby.js";import"./chunk-4250pw6r.js";import{stopDaemonProcess}from"./chunk-ce16ecse.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{stampResetGate}from"./chunk-78kh1fet.js";import"./chunk-fe7kwz48.js";import"./chunk-7q43tysm.js";import"./chunk-mw0ysrpd.js";import"./chunk-a7kq09ke.js";import{kvStatePath,legacyRoveKvStatePath,legacyRoveStateDir,roveStateDir}from"./chunk-prqeddy7.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-yt15y085.js";import"./chunk-fz17c524.js";import"./chunk-x8fd9y51.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import{defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyFreezeDir,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.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=ROVE_PRODUCT_NAME;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 DELETE the task index and the whole settings file"," (saved projects, custom engines, theme, language, onboarding)"," -y, --yes Skip the interactive confirmation. REQUIRED without a terminal;"," a non-interactive run without it exits 2 and changes nothing."," -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}}function stateSummary(path){let parsed;try{parsed=JSON.parse(readFileSync(path,"utf8"))}catch{return[]}let count=(key)=>Array.isArray(parsed[key])?parsed[key].length:0,lines=[` saved projects: ${count("savedRepos")}`,` custom engines: ${count("customEngineIds")} (their launch commands live here and nowhere else)`],present=[["activeTheme","theme"],["defaultVendor","default engine"],["locale","language"],["onboarded","onboarding (the wizard runs again)"]].filter(([key])=>parsed[key]!==void 0).map(([,label])=>label);if(present.length>0)lines.push(` also set: ${present.join(", ")}`);return lines.push(` ${Object.keys(parsed).length} setting(s) in total`),lines}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(legacyRoveStateDir(),"tasks.json"),statePath=kvStatePath(),legacyStatePath=legacyRoveKvStatePath();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 whole settings file \u2014 ${statePath}`);for(let line of stateSummary(statePath))console.log(line);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/ or existing repo-local roots"),!hard)console.log(" (your task list, settings & worktrees are kept \u2014 add --hard to also delete the task index and settings file)");if(!yes){if(!process.stdin.isTTY){console.log(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{isProcessAlive,readPidFile}from"./chunk-a7kq09ke.js";import{RoveDaemonClient}from"./chunk-
|
|
2
|
+
import{isProcessAlive,readPidFile}from"./chunk-a7kq09ke.js";import{RoveDaemonClient}from"./chunk-fz17c524.js";import{unlink}from"fs/promises";async function stopDaemonProcess(socketPath,pidPath,opts={}){let oldPid=await readPidFile(pidPath),targetPid=oldPid!==null&&oldPid!==process.pid?oldPid:null,wasAlive=targetPid!==null&&isProcessAlive(targetPid),method=wasAlive?"graceful":"absent",client=new RoveDaemonClient(socketPath),stopRequest=client.request("daemon.stop",{reason:opts.reason??"stop"}).catch(()=>{return}),stopTimeout=new Promise((resolve)=>setTimeout(resolve,2000));if(await Promise.race([stopRequest,stopTimeout]),client.close(),wasAlive&&targetPid!==null){let deadline=Date.now()+5000,escalated=!1;while(Date.now()<deadline){try{process.kill(targetPid,0)}catch{break}if(!escalated&&Date.now()-(deadline-5000)>2000){try{process.kill(targetPid,"SIGTERM")}catch{}method="sigterm",escalated=!0}await new Promise((resolve)=>setTimeout(resolve,50))}try{process.kill(targetPid,0),process.kill(targetPid,"SIGKILL"),method="sigkill",await new Promise((resolve)=>setTimeout(resolve,100))}catch{}}let survivor=await readPidFile(pidPath);if(survivor!==null&&survivor!==process.pid&&isProcessAlive(survivor))return{pid:oldPid,method};return await unlink(socketPath).catch(()=>{}),await unlink(pidPath).catch(()=>{}),{pid:oldPid,method}}
|
|
3
3
|
export{stopDaemonProcess};
|