@sma1lboy/rove 0.9.171 → 0.9.172

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.
Files changed (146) hide show
  1. package/dist/cli/{chunk-v0zxyqrq.js → chunk-00ehck55.js} +1 -1
  2. package/dist/cli/{chunk-hxv7g8yq.js → chunk-050nmetj.js} +1 -1
  3. package/dist/cli/{chunk-a7wq1cba.js → chunk-05q81ckm.js} +2 -2
  4. package/dist/cli/chunk-0dxzbmc1.js +4 -0
  5. package/dist/cli/{chunk-m0g17ckn.js → chunk-0e49seks.js} +2 -2
  6. package/dist/cli/{chunk-bhdtmwax.js → chunk-0hmdgxr2.js} +3 -3
  7. package/dist/cli/{chunk-k2ckx8zw.js → chunk-0q6h4vt4.js} +1 -1
  8. package/dist/cli/{chunk-7jbap5z2.js → chunk-18wckbjv.js} +1 -1
  9. package/dist/cli/{chunk-3a1fjn0q.js → chunk-1d5g65q9.js} +1 -1
  10. package/dist/cli/{chunk-k68brrpa.js → chunk-1fqxvs60.js} +1 -1
  11. package/dist/cli/{chunk-aqvm6f5v.js → chunk-1kpy8gyg.js} +1 -1
  12. package/dist/cli/{chunk-855rzebn.js → chunk-1mvhz7m8.js} +1 -1
  13. package/dist/cli/{chunk-9xt05etk.js → chunk-1x7xjh3h.js} +1 -1
  14. package/dist/cli/{chunk-2jt0tbte.js → chunk-2fw5yz69.js} +1 -1
  15. package/dist/cli/{chunk-tqat428f.js → chunk-2kb4z64z.js} +1 -1
  16. package/dist/cli/chunk-2mpx0n4h.js +2 -0
  17. package/dist/cli/{chunk-ehhmrcph.js → chunk-3d1t5hpj.js} +4 -4
  18. package/dist/cli/{chunk-j75axe29.js → chunk-3jh78dmc.js} +1 -1
  19. package/dist/cli/{chunk-kj58sv01.js → chunk-3k29k29g.js} +1 -1
  20. package/dist/cli/{chunk-4728688z.js → chunk-3rv72762.js} +1 -1
  21. package/dist/cli/{chunk-k1qe5qqa.js → chunk-46ps4s0d.js} +1 -1
  22. package/dist/cli/{chunk-8wv8526c.js → chunk-4dd0726s.js} +1 -1
  23. package/dist/cli/{chunk-f76j7drr.js → chunk-57mmtmqt.js} +1 -1
  24. package/dist/cli/{chunk-rhsvvdcn.js → chunk-592kjpyz.js} +1 -1
  25. package/dist/cli/{chunk-n4nntq73.js → chunk-5ygc7rce.js} +1 -1
  26. package/dist/cli/chunk-66ay20qj.js +2 -0
  27. package/dist/cli/{chunk-c562kjgk.js → chunk-6bbebknb.js} +1 -1
  28. package/dist/cli/{chunk-g83jaj2y.js → chunk-6vxe08c6.js} +3 -3
  29. package/dist/cli/{chunk-6tfx7mra.js → chunk-6whk3czk.js} +1 -1
  30. package/dist/cli/chunk-6yhtfs6j.js +7 -0
  31. package/dist/cli/{chunk-d4vadrmy.js → chunk-7nndmapz.js} +1 -1
  32. package/dist/cli/chunk-8002w78e.js +2 -0
  33. package/dist/cli/{chunk-mcdv19rs.js → chunk-8cjr5ypt.js} +1 -1
  34. package/dist/cli/{chunk-bpre78rc.js → chunk-8f2ydd8r.js} +2 -2
  35. package/dist/cli/chunk-8nwwftgx.js +2 -0
  36. package/dist/cli/chunk-8xncsx0p.js +2 -0
  37. package/dist/cli/chunk-93b5f093.js +2 -0
  38. package/dist/cli/chunk-9prawccj.js +3 -0
  39. package/dist/cli/{chunk-2hbhmvjw.js → chunk-9xkc34rf.js} +1 -1
  40. package/dist/cli/{chunk-dt51afhh.js → chunk-9ywvpvkv.js} +1 -1
  41. package/dist/cli/{chunk-gv212jx6.js → chunk-a0xdk3pk.js} +1 -1
  42. package/dist/cli/{chunk-6q38ved5.js → chunk-a1ts3rye.js} +2 -2
  43. package/dist/cli/chunk-a74pa16c.js +3 -0
  44. package/dist/cli/chunk-aba7b8y2.js +2 -0
  45. package/dist/cli/{chunk-5wpdpghc.js → chunk-b0gj10y6.js} +1 -1
  46. package/dist/cli/{chunk-jdhhgxgv.js → chunk-b7jsp2bt.js} +3 -3
  47. package/dist/cli/{chunk-hqnephbs.js → chunk-bcf8dhpp.js} +1 -1
  48. package/dist/cli/{chunk-ky9e5s1q.js → chunk-bn5xyt9f.js} +1 -1
  49. package/dist/cli/chunk-bqz0wpjm.js +2 -0
  50. package/dist/cli/chunk-bsc6t6gp.js +2 -0
  51. package/dist/cli/chunk-btrq8tb6.js +2 -0
  52. package/dist/cli/{chunk-511nqhca.js → chunk-c6zhpmf5.js} +1 -1
  53. package/dist/cli/{chunk-51sbegpb.js → chunk-c8qp0sy8.js} +1 -1
  54. package/dist/cli/{chunk-kkx24j75.js → chunk-cj7zscap.js} +1 -1
  55. package/dist/cli/chunk-cqv1m0sk.js +2 -0
  56. package/dist/cli/{chunk-vhhzk3xj.js → chunk-ct2tf2t9.js} +1 -1
  57. package/dist/cli/{chunk-h9mqdxvs.js → chunk-d5r1t2v2.js} +1 -1
  58. package/dist/cli/{chunk-ayhhgfsz.js → chunk-ddcxvbme.js} +1 -1
  59. package/dist/cli/{chunk-3p2e2ry4.js → chunk-dp31b5m4.js} +1 -1
  60. package/dist/cli/{chunk-q86jajp5.js → chunk-e2ka9wkv.js} +1 -1
  61. package/dist/cli/chunk-ed3y8h8k.js +2 -0
  62. package/dist/cli/{chunk-r3903ysy.js → chunk-edz3rt42.js} +1 -1
  63. package/dist/cli/chunk-fch2s1ny.js +3 -0
  64. package/dist/cli/{chunk-qqw3p4fc.js → chunk-fnav06ws.js} +1 -1
  65. package/dist/cli/{chunk-e29hx18x.js → chunk-fxs82dsx.js} +1 -1
  66. package/dist/cli/{chunk-t3z4etp5.js → chunk-fysbm6gg.js} +1 -1
  67. package/dist/cli/chunk-g2e1dmxh.js +4 -0
  68. package/dist/cli/{chunk-0gepyh6e.js → chunk-gj512tzp.js} +1 -1
  69. package/dist/cli/chunk-hfmnhzyv.js +3 -0
  70. package/dist/cli/{chunk-41ahvk51.js → chunk-jpdf97cx.js} +1 -1
  71. package/dist/cli/{chunk-756rtc9n.js → chunk-m3dec6qq.js} +1 -1
  72. package/dist/cli/{chunk-fndegq4p.js → chunk-m3fm78h3.js} +1 -1
  73. package/dist/cli/chunk-m8f8gv2w.js +2 -0
  74. package/dist/cli/{chunk-enct2vtg.js → chunk-msymhxz0.js} +1 -1
  75. package/dist/cli/{chunk-3wj69b0a.js → chunk-ndm62s2f.js} +1 -1
  76. package/dist/cli/{chunk-yqardayk.js → chunk-neveay9r.js} +1 -1
  77. package/dist/cli/chunk-npr56nzw.js +2 -0
  78. package/dist/cli/{chunk-6wpege0h.js → chunk-p4yf9ym8.js} +1 -1
  79. package/dist/cli/chunk-px6axbd9.js +3 -0
  80. package/dist/cli/chunk-pyrtst7c.js +2 -0
  81. package/dist/cli/{chunk-ch9b1d5y.js → chunk-q5jhy3t8.js} +1 -1
  82. package/dist/cli/{chunk-5f80ggc3.js → chunk-qhkag7ad.js} +1 -1
  83. package/dist/cli/{chunk-hxfj85yw.js → chunk-qq7k2ncq.js} +1 -1
  84. package/dist/cli/{chunk-yhwb91e4.js → chunk-r1mp0eb2.js} +1 -1
  85. package/dist/cli/{chunk-jn5dd6bv.js → chunk-r930bpky.js} +1 -1
  86. package/dist/cli/{chunk-bz9mqybr.js → chunk-s4ctpry7.js} +2 -2
  87. package/dist/cli/{chunk-g56kvet6.js → chunk-sb0ns0c7.js} +1 -1
  88. package/dist/cli/chunk-t915by6w.js +3 -0
  89. package/dist/cli/chunk-tf97kkvf.js +2 -0
  90. package/dist/cli/{chunk-phftxm0p.js → chunk-tkdabpev.js} +2 -2
  91. package/dist/cli/{chunk-kbvyv1x2.js → chunk-v61rsz9x.js} +1 -1
  92. package/dist/cli/{chunk-nzscq4yf.js → chunk-v7mrhwk1.js} +1 -1
  93. package/dist/cli/chunk-var92s38.js +2 -0
  94. package/dist/cli/{chunk-ba5a5faq.js → chunk-vj5rbhr0.js} +1 -1
  95. package/dist/cli/chunk-vw81knp0.js +2 -0
  96. package/dist/cli/{chunk-8wrgvzy9.js → chunk-vwjzw4e5.js} +1 -1
  97. package/dist/cli/{chunk-kn3pgymw.js → chunk-w469vwsm.js} +1 -1
  98. package/dist/cli/{chunk-zhbws9n3.js → chunk-w6hx67ty.js} +1 -1
  99. package/dist/cli/{chunk-5agemmmn.js → chunk-wbav9mfa.js} +1 -1
  100. package/dist/cli/{chunk-navjgqby.js → chunk-x0hb6a8p.js} +1 -1
  101. package/dist/cli/{chunk-xhw8s2es.js → chunk-x1gbfpq5.js} +1 -1
  102. package/dist/cli/chunk-x9h1p4a5.js +2 -0
  103. package/dist/cli/chunk-xsrcwcjc.js +4 -0
  104. package/dist/cli/{chunk-msr1xtay.js → chunk-ygtkanm0.js} +1 -1
  105. package/dist/cli/chunk-z0ds727b.js +2 -0
  106. package/dist/cli/{chunk-ap95e417.js → chunk-z1azm6jr.js} +2 -2
  107. package/dist/cli/{chunk-vetk9j99.js → chunk-z6mxqws4.js} +1 -1
  108. package/dist/cli/{chunk-zqfbyq0a.js → chunk-z7c6nap0.js} +1 -1
  109. package/dist/cli/chunk-zvsdz57e.js +2 -0
  110. package/dist/cli/index.js +7 -7
  111. package/dist/cli/kobe-run.js +1 -1
  112. package/dist/cli/kobe.js +1 -1
  113. package/dist/cli/pty-host-node.mjs +51 -32
  114. package/dist/cli/rove-run.js +1 -1
  115. package/dist/cli/rove.js +1 -1
  116. package/package.json +1 -1
  117. package/dist/cli/chunk-044s3zc5.js +0 -4
  118. package/dist/cli/chunk-1fpbk5mj.js +0 -2
  119. package/dist/cli/chunk-2ytd28ng.js +0 -2
  120. package/dist/cli/chunk-38272eqv.js +0 -4
  121. package/dist/cli/chunk-3ppjycfg.js +0 -2
  122. package/dist/cli/chunk-4rabzw5d.js +0 -3
  123. package/dist/cli/chunk-5bbh53hr.js +0 -2
  124. package/dist/cli/chunk-5jw5af60.js +0 -3
  125. package/dist/cli/chunk-655y4wyd.js +0 -2
  126. package/dist/cli/chunk-81ynhhq4.js +0 -2
  127. package/dist/cli/chunk-863fpykn.js +0 -2
  128. package/dist/cli/chunk-9tq6exs5.js +0 -2
  129. package/dist/cli/chunk-bggpzxk2.js +0 -4
  130. package/dist/cli/chunk-bn1ta0qc.js +0 -2
  131. package/dist/cli/chunk-efkpbpkm.js +0 -2
  132. package/dist/cli/chunk-fkwaxx0y.js +0 -2
  133. package/dist/cli/chunk-gfckvx2p.js +0 -7
  134. package/dist/cli/chunk-jb7hgakq.js +0 -2
  135. package/dist/cli/chunk-kwm5x2qr.js +0 -2
  136. package/dist/cli/chunk-mmg7m9x2.js +0 -2
  137. package/dist/cli/chunk-mv7ptt5w.js +0 -3
  138. package/dist/cli/chunk-nxj2t0rq.js +0 -2
  139. package/dist/cli/chunk-p57f5fhw.js +0 -2
  140. package/dist/cli/chunk-skysscx4.js +0 -2
  141. package/dist/cli/chunk-syxg74zr.js +0 -2
  142. package/dist/cli/chunk-t2v3ad8y.js +0 -3
  143. package/dist/cli/chunk-v0rgt7sh.js +0 -2
  144. package/dist/cli/chunk-wc0g8kzq.js +0 -2
  145. package/dist/cli/chunk-wprfqncz.js +0 -2
  146. /package/dist/cli/{chunk-r3k9rbwm.js → chunk-hq4b3fca.js} +0 -0
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{migrateRoveClientStateLayout}from"./chunk-e29hx18x.js";import{LEGACY_KOBE_PRODUCT_NAME,ROVE_PRODUCT_NAME}from"./chunk-g56kvet6.js";import{installRoveEnvCompatibility}from"./chunk-r3k9rbwm.js";var INVOKED_AS_ENV="ROVE_INVOKED_AS";function markRoveInvocation(env=process.env){env[INVOKED_AS_ENV]=ROVE_PRODUCT_NAME}function markKobeInvocation(env=process.env){env[INVOKED_AS_ENV]=LEGACY_KOBE_PRODUCT_NAME}function prepareCliEnvironment(env=process.env){installRoveEnvCompatibility(env)}function prepareCliStateLayout(env=process.env){let result=migrateRoveClientStateLayout(env);for(let warning of result.warnings)console.error(`[rove] state migration will retry: ${warning}`)}function activeCliName(env=process.env){return env[INVOKED_AS_ENV]===ROVE_PRODUCT_NAME?ROVE_PRODUCT_NAME:LEGACY_KOBE_PRODUCT_NAME}
2
+ import{migrateRoveClientStateLayout}from"./chunk-fxs82dsx.js";import{LEGACY_KOBE_PRODUCT_NAME,ROVE_PRODUCT_NAME}from"./chunk-sb0ns0c7.js";import{installRoveEnvCompatibility}from"./chunk-hq4b3fca.js";var INVOKED_AS_ENV="ROVE_INVOKED_AS";function markRoveInvocation(env=process.env){env[INVOKED_AS_ENV]=ROVE_PRODUCT_NAME}function markKobeInvocation(env=process.env){env[INVOKED_AS_ENV]=LEGACY_KOBE_PRODUCT_NAME}function prepareCliEnvironment(env=process.env){installRoveEnvCompatibility(env)}function prepareCliStateLayout(env=process.env){let result=migrateRoveClientStateLayout(env);for(let warning of result.warnings)console.error(`[rove] state migration will retry: ${warning}`)}function activeCliName(env=process.env){return env[INVOKED_AS_ENV]===ROVE_PRODUCT_NAME?ROVE_PRODUCT_NAME:LEGACY_KOBE_PRODUCT_NAME}
3
3
  export{markRoveInvocation,markKobeInvocation,prepareCliEnvironment,prepareCliStateLayout,activeCliName};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{stampResetGate}from"./chunk-3a1fjn0q.js";import{clearFrozenSessions}from"./chunk-t2v3ad8y.js";import{stopLegacyTmux}from"./chunk-dqndd97s.js";import"./chunk-f76j7drr.js";import"./chunk-7q67dz4c.js";import{stopDaemonProcess}from"./chunk-8wv8526c.js";import"./chunk-0gepyh6e.js";import"./chunk-bkvr06xn.js";import"./chunk-mnqxgvyb.js";import"./chunk-j75axe29.js";import"./chunk-ayhhgfsz.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{kvStatePath,legacyKobeKvStatePath,legacyKobeStateDir,roveStateDir}from"./chunk-ch9b1d5y.js";import"./chunk-mv7ptt5w.js";import{activeCliName}from"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import"./chunk-g56kvet6.js";import"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import{defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyFreezeDir,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.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 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(`
2
+ import{stampResetGate}from"./chunk-1d5g65q9.js";import{clearFrozenSessions}from"./chunk-fch2s1ny.js";import{stopLegacyTmux}from"./chunk-dqndd97s.js";import"./chunk-57mmtmqt.js";import"./chunk-7q67dz4c.js";import{stopDaemonProcess}from"./chunk-4dd0726s.js";import"./chunk-gj512tzp.js";import"./chunk-bkvr06xn.js";import"./chunk-mnqxgvyb.js";import"./chunk-3jh78dmc.js";import"./chunk-ddcxvbme.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{kvStatePath,legacyKobeKvStatePath,legacyKobeStateDir,roveStateDir}from"./chunk-q5jhy3t8.js";import"./chunk-t915by6w.js";import"./chunk-9prawccj.js";import{activeCliName}from"./chunk-00ehck55.js";import"./chunk-fxs82dsx.js";import"./chunk-sb0ns0c7.js";import"./chunk-0q6h4vt4.js";import"./chunk-pw6yfj10.js";import{defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyFreezeDir,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-8cjr5ypt.js";import"./chunk-hq4b3fca.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 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(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 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/, ~/.kobe/worktrees/, or 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,5 +1,5 @@
1
1
  // @bun
2
- import{applyFixes,daemonRestartFix,defaultFixRuntime,engineTabsManualFix,humanOnlyFix,killOrphansManualFix,noEngineFix,probeEngines,probeGit,reinstallManualFix,resetManualFix,skillInstallFix,spawnHelperFix}from"./chunk-855rzebn.js";import{formatBytes}from"./chunk-my20q579.js";import"./chunk-3p2e2ry4.js";import"./chunk-ehhmrcph.js";import"./chunk-044s3zc5.js";import"./chunk-rz8zs7j8.js";import"./chunk-41ahvk51.js";import{kobeSkillState,skillInstallCommand}from"./chunk-m0g17ckn.js";import{inspectLegacyTmux,legacyTmuxDoctorLines}from"./chunk-dqndd97s.js";import"./chunk-4rabzw5d.js";import"./chunk-h4n8ffqy.js";import"./chunk-vyb5a2rh.js";import"./chunk-r2pztgm6.js";import"./chunk-38272eqv.js";import"./chunk-5f80ggc3.js";import{CURRENT_VERSION,package_default}from"./chunk-f76j7drr.js";import{resolveNodeBinary}from"./chunk-zhbws9n3.js";import"./chunk-qqw3p4fc.js";import{formatDaemonInfo}from"./chunk-rcyasw34.js";import"./chunk-b99tf0jr.js";import"./chunk-5agemmmn.js";import{t}from"./chunk-rxh74abe.js";import"./chunk-pthtyzcs.js";import"./chunk-sdyzxayr.js";import"./chunk-w25b7xxz.js";import"./chunk-jvxh93nz.js";import{isStaleInstallError,resolveKobeSpawn}from"./chunk-h9mqdxvs.js";import"./chunk-8wv8526c.js";import{KobeDaemonClient}from"./chunk-0gepyh6e.js";import{isForeignDaemonHome}from"./chunk-bkvr06xn.js";import"./chunk-mnqxgvyb.js";import"./chunk-jn5dd6bv.js";import{createEngineHookAdapter}from"./chunk-xhw8s2es.js";import"./chunk-khj0apc7.js";import"./chunk-nzscq4yf.js";import"./chunk-w7zv47mp.js";import{parseHookSettings}from"./chunk-dt51afhh.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import{readableLegacyIndexPath}from"./chunk-k1qe5qqa.js";import"./chunk-xy8be792.js";import"./chunk-6wpege0h.js";import"./chunk-j75axe29.js";import"./chunk-ayhhgfsz.js";import"./chunk-2brn8e1y.js";import{ALL_VENDORS}from"./chunk-bq3fyc0p.js";import"./chunk-3wj69b0a.js";import{homeDir,kvStatePath,roveStateDir}from"./chunk-ch9b1d5y.js";import{readPidFile}from"./chunk-mv7ptt5w.js";import{activeCliName}from"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import{LEGACY_KOBE_STATE_DIR_BASENAME}from"./chunk-g56kvet6.js";import"./chunk-pxk2c2vj.js";import"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import{defaultDaemonLogPath,defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyHostLogPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.js";import{__require}from"./chunk-wqfp8d9w.js";import{existsSync,readFileSync as readFileSync3,statSync as statSync2}from"fs";import{join as join2}from"path";import{readFileSync}from"fs";function hookConfigIssues(){let issues=[];for(let vendor of ALL_VENDORS){let adapter=createEngineHookAdapter(vendor);if(!adapter.supportsHooks())continue;let file=adapter.globalSettingsPath();if(!file||!file.endsWith(".json"))continue;let raw;try{raw=readFileSync(file,"utf8")}catch{continue}let parsed=parseHookSettings(raw);if(!parsed.ok)issues.push({file,reason:parsed.reason})}return issues}var MIN_BUN_VERSION=package_default.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0";function parseBunVersion(raw){return raw.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function isBunAtLeast(raw,minimum=MIN_BUN_VERSION){let found=parseBunVersion(raw),floor=parseBunVersion(minimum);if(!found||!floor)return!0;let a=found.split(".").map(Number),b=floor.split(".").map(Number);for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(av!==bv)return av>bv}return!0}function classifyHookChannel(input){let total=0,hooked=0;for(let tabs of Object.values(input.tabs))for(let entry of Object.values(tabs))if(total++,entry.source==="hook")hooked++;if(total===0)return{kind:"no-tabs"};if(hooked===0)return{kind:"down",totalTabs:total};return{kind:"live",hookTabs:hooked,totalTabs:total}}function hookChannelDoctorLines(verdict,input,cliName){let configLines=(input.configIssues??[]).flatMap((issue)=>[` \u26A0 hook install skipped: ${issue.file}`,` ${issue.reason} \u2014 fix the file, then relaunch Rove`]);if(verdict.kind==="no-tabs")return["hooks: \u2014 no engine tabs yet (nothing to check)",...configLines];if(verdict.kind==="live")return[`hooks: \u2713 engine hook channel live (${verdict.hookTabs}/${verdict.totalTabs} tab(s) hook-sourced)`,...configLines];let out=[`hooks: \u2717 NO hook events reaching the daemon (0/${verdict.totalTabs} tab(s) hook-sourced)`," badges fall back to a ~10s poll, so activity looks seconds late",` daemon socket: ${input.socketPath}`,...configLines];return out.push(' \u2192 compare with an engine tab\'s own path: `ps eww -p <engine-pid> | tr " " "\\n" | grep DAEMON_SOCKET_PATH`',` \u2192 restart the engine tabs (they may hold a stale socket path), or run \`${cliName} daemon restart\``,` \u2192 debug one hook directly: \`KOBE_HOOK_DEBUG=1 echo '{}' | ${cliName} hook turn-start --engine claude\``),out}import{readdirSync,statSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";function installedSpawnHelpers(){let pkg;try{pkg=dirname(createRequire(import.meta.url).resolve("node-pty/package.json"))}catch{return[]}let prebuilds=join(pkg,"prebuilds"),arches;try{arches=readdirSync(prebuilds).filter((name)=>name.startsWith("darwin-"))}catch{return[]}let helpers=[];for(let arch of arches){let path=join(prebuilds,arch,"spawn-helper");try{helpers.push({path,executable:(statSync(path).mode&64)!==0})}catch{}}return helpers}function spawnHelperDoctorLines(helpers){let broken=helpers.filter((helper)=>!helper.executable).map((helper)=>helper.path);if(helpers.length===0)return{lines:["node-pty: ? no darwin spawn-helper found next to node-pty"],broken};if(broken.length===0)return{lines:[`node-pty: \u2713 spawn-helper executable (${helpers.length} arch)`],broken};return{lines:["node-pty: \u2717 spawn-helper is not executable \u2014 every node-pty PTY spawn fails",...broken.map((path)=>` ${path}`),` \u2192 chmod 755 ${broken.join(" ")}`],broken}}import{appendFileSync,readFileSync as readFileSync2}from"fs";var PTY_MARKER="KOBE_TERMINAL_PTY=1",run=async(argv)=>{try{let proc=Bun.spawn([...argv],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),[stdout,code]=await Promise.all([new Response(proc.stdout).text().catch(()=>""),proc.exited]);return{code,stdout}}catch{return{code:127,stdout:""}}};function parsePsRows(output){let rows=[];for(let line of output.split(`
2
+ import{applyFixes,daemonRestartFix,defaultFixRuntime,engineTabsManualFix,humanOnlyFix,killOrphansManualFix,noEngineFix,probeEngines,probeGit,reinstallManualFix,resetManualFix,skillInstallFix,spawnHelperFix}from"./chunk-1mvhz7m8.js";import{formatBytes}from"./chunk-my20q579.js";import"./chunk-dp31b5m4.js";import"./chunk-3d1t5hpj.js";import"./chunk-px6axbd9.js";import"./chunk-rz8zs7j8.js";import"./chunk-xsrcwcjc.js";import"./chunk-jpdf97cx.js";import{kobeSkillState,skillInstallCommand}from"./chunk-0e49seks.js";import{inspectLegacyTmux,legacyTmuxDoctorLines}from"./chunk-dqndd97s.js";import"./chunk-a74pa16c.js";import"./chunk-h4n8ffqy.js";import"./chunk-vyb5a2rh.js";import"./chunk-r2pztgm6.js";import"./chunk-g2e1dmxh.js";import"./chunk-qhkag7ad.js";import{CURRENT_VERSION,package_default}from"./chunk-57mmtmqt.js";import{resolveNodeBinary}from"./chunk-w6hx67ty.js";import"./chunk-fnav06ws.js";import{formatDaemonInfo}from"./chunk-rcyasw34.js";import"./chunk-b99tf0jr.js";import"./chunk-wbav9mfa.js";import{t}from"./chunk-rxh74abe.js";import"./chunk-pthtyzcs.js";import"./chunk-sdyzxayr.js";import"./chunk-w25b7xxz.js";import"./chunk-jvxh93nz.js";import{isStaleInstallError,resolveKobeSpawn}from"./chunk-d5r1t2v2.js";import"./chunk-4dd0726s.js";import{KobeDaemonClient}from"./chunk-gj512tzp.js";import{isForeignDaemonHome}from"./chunk-bkvr06xn.js";import"./chunk-mnqxgvyb.js";import"./chunk-r930bpky.js";import{createEngineHookAdapter}from"./chunk-x1gbfpq5.js";import"./chunk-khj0apc7.js";import"./chunk-v7mrhwk1.js";import"./chunk-w7zv47mp.js";import{parseHookSettings}from"./chunk-9ywvpvkv.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import{readableLegacyIndexPath}from"./chunk-46ps4s0d.js";import"./chunk-xy8be792.js";import"./chunk-p4yf9ym8.js";import"./chunk-3jh78dmc.js";import"./chunk-ddcxvbme.js";import"./chunk-2brn8e1y.js";import{ALL_VENDORS}from"./chunk-bq3fyc0p.js";import"./chunk-ndm62s2f.js";import{homeDir,kvStatePath,roveStateDir}from"./chunk-q5jhy3t8.js";import{readPidFile}from"./chunk-t915by6w.js";import"./chunk-9prawccj.js";import{activeCliName}from"./chunk-00ehck55.js";import"./chunk-fxs82dsx.js";import{LEGACY_KOBE_STATE_DIR_BASENAME}from"./chunk-sb0ns0c7.js";import"./chunk-pxk2c2vj.js";import"./chunk-0q6h4vt4.js";import"./chunk-pw6yfj10.js";import{defaultDaemonLogPath,defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyHostLogPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-8cjr5ypt.js";import"./chunk-hq4b3fca.js";import{__require}from"./chunk-wqfp8d9w.js";import{existsSync,readFileSync as readFileSync3,statSync as statSync2}from"fs";import{join as join2}from"path";import{readFileSync}from"fs";function hookConfigIssues(){let issues=[];for(let vendor of ALL_VENDORS){let adapter=createEngineHookAdapter(vendor);if(!adapter.supportsHooks())continue;let file=adapter.globalSettingsPath();if(!file||!file.endsWith(".json"))continue;let raw;try{raw=readFileSync(file,"utf8")}catch{continue}let parsed=parseHookSettings(raw);if(!parsed.ok)issues.push({file,reason:parsed.reason})}return issues}var MIN_BUN_VERSION=package_default.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0";function parseBunVersion(raw){return raw.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function isBunAtLeast(raw,minimum=MIN_BUN_VERSION){let found=parseBunVersion(raw),floor=parseBunVersion(minimum);if(!found||!floor)return!0;let a=found.split(".").map(Number),b=floor.split(".").map(Number);for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(av!==bv)return av>bv}return!0}function classifyHookChannel(input){let total=0,hooked=0;for(let tabs of Object.values(input.tabs))for(let entry of Object.values(tabs))if(total++,entry.source==="hook")hooked++;if(total===0)return{kind:"no-tabs"};if(hooked===0)return{kind:"down",totalTabs:total};return{kind:"live",hookTabs:hooked,totalTabs:total}}function hookChannelDoctorLines(verdict,input,cliName){let configLines=(input.configIssues??[]).flatMap((issue)=>[` \u26A0 hook install skipped: ${issue.file}`,` ${issue.reason} \u2014 fix the file, then relaunch Rove`]);if(verdict.kind==="no-tabs")return["hooks: \u2014 no engine tabs yet (nothing to check)",...configLines];if(verdict.kind==="live")return[`hooks: \u2713 engine hook channel live (${verdict.hookTabs}/${verdict.totalTabs} tab(s) hook-sourced)`,...configLines];let out=[`hooks: \u2717 NO hook events reaching the daemon (0/${verdict.totalTabs} tab(s) hook-sourced)`," badges fall back to a ~10s poll, so activity looks seconds late",` daemon socket: ${input.socketPath}`,...configLines];return out.push(' \u2192 compare with an engine tab\'s own path: `ps eww -p <engine-pid> | tr " " "\\n" | grep DAEMON_SOCKET_PATH`',` \u2192 restart the engine tabs (they may hold a stale socket path), or run \`${cliName} daemon restart\``,` \u2192 debug one hook directly: \`KOBE_HOOK_DEBUG=1 echo '{}' | ${cliName} hook turn-start --engine claude\``),out}import{readdirSync,statSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";function installedSpawnHelpers(){let pkg;try{pkg=dirname(createRequire(import.meta.url).resolve("node-pty/package.json"))}catch{return[]}let prebuilds=join(pkg,"prebuilds"),arches;try{arches=readdirSync(prebuilds).filter((name)=>name.startsWith("darwin-"))}catch{return[]}let helpers=[];for(let arch of arches){let path=join(prebuilds,arch,"spawn-helper");try{helpers.push({path,executable:(statSync(path).mode&64)!==0})}catch{}}return helpers}function spawnHelperDoctorLines(helpers){let broken=helpers.filter((helper)=>!helper.executable).map((helper)=>helper.path);if(helpers.length===0)return{lines:["node-pty: ? no darwin spawn-helper found next to node-pty"],broken};if(broken.length===0)return{lines:[`node-pty: \u2713 spawn-helper executable (${helpers.length} arch)`],broken};return{lines:["node-pty: \u2717 spawn-helper is not executable \u2014 every node-pty PTY spawn fails",...broken.map((path)=>` ${path}`),` \u2192 chmod 755 ${broken.join(" ")}`],broken}}import{appendFileSync,readFileSync as readFileSync2}from"fs";var PTY_MARKER="KOBE_TERMINAL_PTY=1",run=async(argv)=>{try{let proc=Bun.spawn([...argv],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),[stdout,code]=await Promise.all([new Response(proc.stdout).text().catch(()=>""),proc.exited]);return{code,stdout}}catch{return{code:127,stdout:""}}};function parsePsRows(output){let rows=[];for(let line of output.split(`
3
3
  `)){let parts=line.trim().split(/\s+/);if(parts.length<6)continue;let[pid,ppid,pgid]=[parts[0],parts[1],parts[2]].map((value)=>Number.parseInt(value??"",10)),rssKb=Number.parseInt(parts[4]??"",10);if(!Number.isFinite(pid)||!Number.isFinite(ppid)||!Number.isFinite(pgid)||!Number.isFinite(rssKb))continue;rows.push({pid,ppid,pgid,etime:parts[3]??"",rssKb,command:parts.slice(5).join(" ")})}return rows}function pidAlive(pid,rows){return rows.some((row)=>row.pid===pid)}function orphanCandidates(rows,selfPgid,liveSessionPids){return rows.filter((row)=>row.ppid===1&&row.pgid!==selfPgid&&!liveSessionPids.has(row.pgid)&&!pidAlive(row.pgid,rows))}async function markedPids(pids,deps={}){let runProbe=deps.run??run,readEnviron=deps.readEnviron??((pid)=>readFileSync2(`/proc/${pid}/environ`,"utf8")),marked=new Set;if(pids.length===0)return{marked,failed:null};if((deps.platform??process.platform)==="linux"){let refused=null;for(let pid of pids)try{if(readEnviron(pid).split("\x00").includes(PTY_MARKER))marked.add(pid)}catch(err){let code=err.code;if(code!=="ENOENT"&&code!=="ESRCH")refused??=`/proc/${pid}/environ: ${code??"unreadable"}`}return{marked,failed:refused}}let result=await runProbe(["ps","eww","-o","pid=,command=","-p",pids.join(",")]);if(result.code!==0)return{marked,failed:`ps eww exited ${result.code}`};let marker=new RegExp(`(^|\\s)${PTY_MARKER}(\\s|$)`);for(let line of result.stdout.split(`
4
4
  `)){let pid=Number.parseInt(line.trim().split(/\s+/)[0]??"",10);if(Number.isFinite(pid)&&marker.test(line))marked.add(pid)}return{marked,failed:null}}async function ownPgid(runProbe){let result=await runProbe(["ps","-o","pgid=","-p",String(process.pid)]),pgid=Number.parseInt(result.stdout.trim(),10);return Number.isFinite(pgid)?pgid:-1}async function collectOrphans(liveSessionPids,deps={}){let runProbe=deps.run??run;if((deps.platform??process.platform)==="win32")return{orphans:[],error:null};let ps=await runProbe(["ps","-A","-o","pid=,ppid=,pgid=,etime=,rss=,command="]);if(ps.code!==0)return{orphans:[],error:`could not read the process table \u2014 ps exited ${ps.code}`};let rows=parsePsRows(ps.stdout),candidates=orphanCandidates(rows,await ownPgid(runProbe),liveSessionPids),{marked,failed}=await markedPids(candidates.map((row)=>row.pid),deps);if(failed)return{orphans:[],error:`could not read process environments \u2014 ${failed}`};return{orphans:candidates.filter((row)=>marked.has(row.pid)),error:null}}function formatMb(rssKb){return`${(rssKb/1024).toFixed(0)} MB`}function orphanDoctorLines(orphans,error,cliName,killing=!1){if(error)return[`orphans: \u2717 ${error}`];if(orphans.length===0)return["orphans: \u2713 none \u2014 no processes left behind by a dead PTY session"];let totalMb=orphans.reduce((sum,row)=>sum+row.rssKb,0)/1024,lines=[`orphans: \u26A0 ${orphans.length} process(es) outlived the PTY session that spawned them (${totalMb.toFixed(0)} MB RSS)`," each is reparented to init, carries Rove's PTY marker, and its process"," group leader is gone \u2014 no live task owns them"];for(let row of[...orphans].sort((a,b)=>b.rssKb-a.rssKb))lines.push(` pid ${row.pid} (group ${row.pgid}) up ${row.etime}, ${formatMb(row.rssKb)}: ${row.command.slice(0,90)}`);if(!killing)lines.push(` \u2192 \`${cliName} doctor --kill-orphans\` ends those process groups (SIGTERM, then SIGKILL)`," read the list first: something you backgrounded from a Rove terminal and then"," closed the tab on looks exactly like a leak, and doctor cannot tell them apart");return lines}var GROUP_EXIT_GRACE_MS=2000,GROUP_POLL_MS=100;function logOrphanKill(pgid,signal,logPath=defaultDaemonLogPath()){try{appendFileSync(logPath,formatDaemonInfo("doctor-kill-orphans",`${signal} process group ${pgid}`))}catch{}}function groupAlive(pgid){try{return process.kill(-pgid,0),!0}catch(err){return err.code!=="ESRCH"}}async function killOrphanGroups(orphans){let groups=[...new Set(orphans.map((row)=>row.pgid))];for(let pgid of groups)try{process.kill(-pgid,"SIGTERM"),logOrphanKill(pgid,"SIGTERM")}catch{}let deadline=Date.now()+GROUP_EXIT_GRACE_MS,survivors=groups.filter(groupAlive);while(survivors.length>0&&Date.now()<deadline)await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),survivors=survivors.filter(groupAlive);for(let pgid of survivors)try{process.kill(-pgid,"SIGKILL"),logOrphanKill(pgid,"SIGKILL")}catch{}return await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),{groups,survivors:survivors.filter(groupAlive)}}function multiplexerLabel(env){if(env.TMUX)return"tmux";if(env.ZELLIJ)return"zellij";if(env.STY)return"screen";return"no"}function terminalEnvLines(env){let show=(v)=>v&&v.length>0?v:"(unset)",program=env.TERM_PROGRAM?`${env.TERM_PROGRAM}${env.TERM_PROGRAM_VERSION?` v${env.TERM_PROGRAM_VERSION}`:""}`:"(unset)";return[`terminal: TERM=${show(env.TERM)} TERM_PROGRAM=${program} COLORTERM=${show(env.COLORTERM)}`,` running inside a multiplexer: ${multiplexerLabel(env)}`]}function parseKittyProbeReply(data){let kitty=data.match(/\x1b\[\?(\d+)u/);if(kitty?.[1]!==void 0)return{kind:"supported",flags:Number.parseInt(kitty[1],10)};if(/\x1b\[\?[\d;]*c/.test(data))return{kind:"unsupported"};return null}function kittyProbeLine(result){switch(result.kind){case"supported":return` kitty keyboard protocol: \u2713 answered (flags=${result.flags})`;case"unsupported":return[" kitty keyboard protocol: \u2717 not supported \u2014 legacy key path"," (ctrl+h/ctrl+j arrive as C0 backspace/linefeed bytes; the"," split chords ctrl+\\ and ctrl+= cannot be encoded at all)"].join(`
5
5
  `);case"no-response":return" kitty keyboard protocol: ? no reply (terminal ignored both the kitty query and DA1)";case"skipped":return` kitty keyboard protocol: skipped (${result.reason})`}}async function probeKittyKeyboard(timeoutMs=300){let stdin=process.stdin;if(!stdin.isTTY||!process.stdout.isTTY)return{kind:"skipped",reason:"not an interactive terminal"};let wasRaw=stdin.isRaw===!0,buffer="";return await new Promise((resolve)=>{let done=!1,finish=(result)=>{if(done)return;if(done=!0,clearTimeout(timer),stdin.off("data",onData),stdin.pause(),!wasRaw)stdin.setRawMode(!1);resolve(result)},onData=(chunk)=>{buffer+=chunk.toString("latin1");let decided=parseKittyProbeReply(buffer);if(decided)finish(decided)},timer=setTimeout(()=>finish({kind:"no-response"}),timeoutMs);stdin.setRawMode(!0),stdin.resume(),stdin.on("data",onData),process.stdout.write("\x1B[?u\x1B[c")})}async function terminalDoctorLines(){return[...terminalEnvLines(process.env),kittyProbeLine(await probeKittyKeyboard())]}var CLI_NAME=activeCliName();function isProcessAlive(pid){try{return process.kill(pid,0),!0}catch(err){return err.code==="EPERM"}}async function requestIfReachable(socketPath,name){let client=new KobeDaemonClient(socketPath);try{return await client.request(name,{})}catch{return null}finally{client.close()}}function fmtDuration(ms){let seconds=Math.floor(ms/1000);if(seconds<60)return`${seconds}s`;let minutes=Math.floor(seconds/60);if(minutes<60)return`${minutes}m ${seconds%60}s`;return`${Math.floor(minutes/60)}h ${minutes%60}m`}function describeFile(path){try{let stat=statSync2(path);return`present (${formatBytes(stat.size)}, modified ${stat.mtime.toISOString()})`}catch{return"absent"}}function taskCount(path){try{let parsed=JSON.parse(readFileSync3(path,"utf8"));return Array.isArray(parsed.tasks)?parsed.tasks.length:null}catch{return null}}function tailFile(path,count){try{return readFileSync3(path,"utf8").split(`
@@ -14,5 +14,5 @@ Usage: ${CLI_NAME} doctor [--report] [--fix] [--kill-orphans]
14
14
  `),process.exit(2);let{lines,fixes,orphans}=await collectDoctor();if(!fix&&fixes.length>0)lines.push("",t("doctor.fix.hint",{count:fixes.length,command:`${CLI_NAME} doctor --fix`}));if(console.log(lines.join(`
15
15
  `)),kill)console.log(`
16
16
  ${(await sweepOrphans(orphans)).join(`
17
- `)}`);if(fix)await applyFixes(fixes,defaultFixRuntime());if(report){let{writeReportBundle}=await import("./chunk-4728688z.js"),path=writeReportBundle(lines);console.log(`
17
+ `)}`);if(fix)await applyFixes(fixes,defaultFixRuntime());if(report){let{writeReportBundle}=await import("./chunk-3rv72762.js"),path=writeReportBundle(lines);console.log(`
18
18
  report written: ${path}`),console.log("attach this file to a bug report \u2014 it includes recent daemon + pty-host logs and env.")}}export{runDoctorSubcommand};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{installedSkillDirs}from"./chunk-0e49seks.js";import{CLAUDE_HOOK_EVENT_MAP,claudeSettingsPath,hasKobeActivityHooks,isObject}from"./chunk-9ywvpvkv.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-46ps4s0d.js";import"./chunk-xy8be792.js";import"./chunk-p4yf9ym8.js";import"./chunk-3jh78dmc.js";import"./chunk-ddcxvbme.js";import"./chunk-bq3fyc0p.js";import"./chunk-ndm62s2f.js";import"./chunk-q5jhy3t8.js";import"./chunk-t915by6w.js";import"./chunk-9prawccj.js";import"./chunk-00ehck55.js";import"./chunk-fxs82dsx.js";import"./chunk-sb0ns0c7.js";import"./chunk-0q6h4vt4.js";import"./chunk-pw6yfj10.js";import"./chunk-8cjr5ypt.js";import"./chunk-hq4b3fca.js";import"./chunk-wqfp8d9w.js";import{readFileSync}from"fs";import{homedir}from"os";var PLUGIN_NAME="rove";function readSettings(path){try{let parsed=JSON.parse(readFileSync(path,"utf8"));return isObject(parsed)?parsed:null}catch{return null}}function isRovePluginEnabled(settingsFilePath=claudeSettingsPath()){let settings=readSettings(settingsFilePath);if(!settings||!isObject(settings.enabledPlugins))return!1;return Object.entries(settings.enabledPlugins).some(([key,on])=>on===!0&&key.split("@")[0]===PLUGIN_NAME)}function detectLegacyInstalls(opts={}){let settingsFilePath=opts.settingsFilePath??claudeSettingsPath(),home=opts.home??homedir(),settings=readSettings(settingsFilePath),legacyHooks=settings!==null&&(hasKobeActivityHooks(settings,CLAUDE_HOOK_EVENT_MAP)||settingsHasWorktreeWatch(settings)),legacySkillDirs=installedSkillDirs(home);return{legacyHooks,legacySkillDirs}}function settingsHasWorktreeWatch(settings){let hooks=isObject(settings.hooks)?settings.hooks:{};return Object.values(hooks).some((groups)=>Array.isArray(groups)&&groups.some((g)=>isObject(g)&&Array.isArray(g.hooks)&&g.hooks.some((h)=>isObject(h)&&typeof h.command==="string"&&h.command.includes("worktree-created")&&!h.command.includes("CLAUDE_PLUGIN_ROOT"))))}function migrationHint(findings,cliName){if(!findings.legacyHooks&&findings.legacySkillDirs.length===0)return null;let lines=[`${cliName}: the Rove Claude Code plugin is enabled, but legacy installs remain:`];if(findings.legacyHooks)lines.push(" \u2022 ~/.claude/settings.json still has the settings-managed Rove hooks (every event fires TWICE).",` Run \`${cliName} hook cleanup\` to remove them (only Rove's own entries are touched).`);for(let dir of findings.legacySkillDirs)lines.push(` \u2022 legacy skill copy at ${dir} (the plugin bundles the skill \u2014 two copies double-register).`," Remove that directory to keep the plugin's copy only.");return lines.push(" Reading this inside a session? Just ask your agent to run the cleanup for you."),`${lines.join(`
3
+ `)}
4
+ `}export{migrationHint,isRovePluginEnabled,detectLegacyInstalls};
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import{getPersistedString,setPersistedString}from"./chunk-6wpege0h.js";import{activeCliName}from"./chunk-v0zxyqrq.js";import{ROVE_PRODUCT_NAME}from"./chunk-g56kvet6.js";import{__require}from"./chunk-wqfp8d9w.js";import{accessSync,existsSync,constants as fsConstants,readFileSync,statSync}from"fs";import{homedir}from"os";import{delimiter,dirname,join,resolve}from"path";import{fileURLToPath}from"url";var KOBE_SKILL_VERSION=42,ROVE_SKILL_REL_PATHS=[".agents/skills/rove/SKILL.md",".claude/skills/rove/SKILL.md"],LEGACY_SKILL_REL_PATHS=[".agents/skills/kobe/SKILL.md",".claude/skills/kobe/SKILL.md"],SKILL_REL_PATHS=[...ROVE_SKILL_REL_PATHS,...LEGACY_SKILL_REL_PATHS];function skillInstallCommand(env=process.env){return`${activeCliName(env)} skill install`}var SKILL_SOURCE_SLUG="Sma1lboy/rove";function bundledSkillDir(){let here=fileURLToPath(import.meta.url);return[resolve(here,"../../../../../.agents/skills/kobe"),resolve(here,"../../skills/rove")].find((dir)=>existsSync(join(dir,"SKILL.md")))??null}function npxSkillsArgv(opts={}){let source=opts.source!==void 0?opts.source:bundledSkillDir(),agents=opts.agent===void 0?[]:typeof opts.agent==="string"?[opts.agent]:opts.agent;return["skills","add",source??SKILL_SOURCE_SLUG,"--skill",ROVE_PRODUCT_NAME,...opts.global===!1?[]:["--global"],...agents.flatMap((a)=>["--agent",a])]}function npxSkillsCommand(opts={}){return`npx ${npxSkillsArgv(opts).join(" ")}`}var NPX_MISSING_EXIT=127;function isNpxMissing(){let parts=(process.env.PATH??"").split(delimiter).filter(Boolean);if(parts.length===0)return!1;return!parts.some((dir)=>{try{return accessSync(join(dir,"npx"),fsConstants.X_OK),!0}catch{return!1}})}function npxMissingMessage(){return`${activeCliName()} skill install needs \`npx\` (part of Node.js), which isn't on your PATH.
2
+ import{getPersistedString,setPersistedString}from"./chunk-p4yf9ym8.js";import{activeCliName}from"./chunk-00ehck55.js";import{ROVE_PRODUCT_NAME}from"./chunk-sb0ns0c7.js";import{__require}from"./chunk-wqfp8d9w.js";import{accessSync,existsSync,constants as fsConstants,readFileSync,statSync}from"fs";import{homedir}from"os";import{delimiter,dirname,join,resolve}from"path";import{fileURLToPath}from"url";var KOBE_SKILL_VERSION=42,ROVE_SKILL_REL_PATHS=[".agents/skills/rove/SKILL.md",".claude/skills/rove/SKILL.md"],LEGACY_SKILL_REL_PATHS=[".agents/skills/kobe/SKILL.md",".claude/skills/kobe/SKILL.md"],SKILL_REL_PATHS=[...ROVE_SKILL_REL_PATHS,...LEGACY_SKILL_REL_PATHS];function skillInstallCommand(env=process.env){return`${activeCliName(env)} skill install`}var SKILL_SOURCE_SLUG="Sma1lboy/rove";function bundledSkillDir(){let here=fileURLToPath(import.meta.url);return[resolve(here,"../../../../../.agents/skills/kobe"),resolve(here,"../../skills/rove")].find((dir)=>existsSync(join(dir,"SKILL.md")))??null}function npxSkillsArgv(opts={}){let source=opts.source!==void 0?opts.source:bundledSkillDir(),agents=opts.agent===void 0?[]:typeof opts.agent==="string"?[opts.agent]:opts.agent;return["skills","add",source??SKILL_SOURCE_SLUG,"--skill",ROVE_PRODUCT_NAME,...opts.global===!1?[]:["--global"],...agents.flatMap((a)=>["--agent",a])]}function npxSkillsCommand(opts={}){return`npx ${npxSkillsArgv(opts).join(" ")}`}var NPX_MISSING_EXIT=127;function isNpxMissing(){let parts=(process.env.PATH??"").split(delimiter).filter(Boolean);if(parts.length===0)return!1;return!parts.some((dir)=>{try{return accessSync(join(dir,"npx"),fsConstants.X_OK),!0}catch{return!1}})}function npxMissingMessage(){return`${activeCliName()} skill install needs \`npx\` (part of Node.js), which isn't on your PATH.
3
3
  Install Node.js (https://nodejs.org) and run it again \u2014 the Rove installer only installs Bun and Rove.`}async function runNpxSkillsInstall(agent,global){if(isNpxMissing())return process.stderr.write(`
4
4
  ${npxMissingMessage()}
5
5
 
6
- `),NPX_MISSING_EXIT;return await Bun.spawn(["npx",...npxSkillsArgv({...agent===void 0?{}:{agent},global})],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited}var HINT_SEEN_KEY="skillHintSeen";function markSkillHintSeen(){setPersistedString(HINT_SEEN_KEY,"1")}function kobeSkillPaths(opts={}){let home=opts.home??homedir(),cwd=opts.cwd??process.cwd();return[home,cwd].flatMap((root)=>SKILL_REL_PATHS.map((rel)=>join(root,rel)))}function parseSkillVersion(content){let m=content.match(/(?:rove|kobe)-skill-version:\s*(\d+)/);return m?Number.parseInt(m[1],10):null}function skillVersionAt(path){try{return parseSkillVersion(readFileSync(path,"utf8"))}catch{return null}}function inodeKey(path){try{let stat=statSync(path);return`${stat.dev}:${stat.ino}`}catch{return path}}function distinctSkillFiles(roots,rels){let seen=new Set,out=[];for(let root of roots)for(let rel of rels){let path=join(root,rel);if(!existsSync(path))continue;let key=inodeKey(path);if(seen.has(key))continue;seen.add(key),out.push(path)}return out}function installedSkillDirs(home=homedir()){return distinctSkillFiles([home],SKILL_REL_PATHS).map((path)=>dirname(path))}function kobeSkillState(opts={}){let roots=[opts.home??homedir(),opts.cwd??process.cwd()],roveCopies=distinctSkillFiles(roots,ROVE_SKILL_REL_PATHS).map((path)=>({path,version:skillVersionAt(path)})),legacy=distinctSkillFiles(roots,LEGACY_SKILL_REL_PATHS).map((path)=>({path,version:skillVersionAt(path)})),best=[...roveCopies].sort((a,b)=>(b.version??-1)-(a.version??-1))[0]??legacy[0];if(!best)return{installed:!1,installedVersion:null,currentVersion:KOBE_SKILL_VERSION,stale:!1,legacyCopies:[]};let stale=best.version===null||best.version<KOBE_SKILL_VERSION;return{installed:!0,installedVersion:best.version,currentVersion:KOBE_SKILL_VERSION,stale,legacyCopies:legacy.filter((copy)=>copy.path!==best.path)}}function describeLegacyCopies(copies){return copies.map((c)=>`${c.path}${c.version===null?"":` (v${c.version})`}`).join(", ")}function promptLine(){return new Promise((resolve2)=>{process.stdin.resume(),process.stdin.once("data",(d)=>{process.stdin.pause(),resolve2(String(d))})})}async function maybeHintSkillInstall(io={}){let{isRovePluginEnabled}=await import("./chunk-bggpzxk2.js");if(isRovePluginEnabled())return;let cliName=activeCliName(),installCommand=skillInstallCommand(),state=kobeSkillState();if(!state.installed){if(getPersistedString(HINT_SEEN_KEY)==="1")return;setPersistedString(HINT_SEEN_KEY,"1"),process.stderr.write(`
6
+ `),NPX_MISSING_EXIT;return await Bun.spawn(["npx",...npxSkillsArgv({...agent===void 0?{}:{agent},global})],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited}var HINT_SEEN_KEY="skillHintSeen";function markSkillHintSeen(){setPersistedString(HINT_SEEN_KEY,"1")}function kobeSkillPaths(opts={}){let home=opts.home??homedir(),cwd=opts.cwd??process.cwd();return[home,cwd].flatMap((root)=>SKILL_REL_PATHS.map((rel)=>join(root,rel)))}function parseSkillVersion(content){let m=content.match(/(?:rove|kobe)-skill-version:\s*(\d+)/);return m?Number.parseInt(m[1],10):null}function skillVersionAt(path){try{return parseSkillVersion(readFileSync(path,"utf8"))}catch{return null}}function inodeKey(path){try{let stat=statSync(path);return`${stat.dev}:${stat.ino}`}catch{return path}}function distinctSkillFiles(roots,rels){let seen=new Set,out=[];for(let root of roots)for(let rel of rels){let path=join(root,rel);if(!existsSync(path))continue;let key=inodeKey(path);if(seen.has(key))continue;seen.add(key),out.push(path)}return out}function installedSkillDirs(home=homedir()){return distinctSkillFiles([home],SKILL_REL_PATHS).map((path)=>dirname(path))}function kobeSkillState(opts={}){let roots=[opts.home??homedir(),opts.cwd??process.cwd()],roveCopies=distinctSkillFiles(roots,ROVE_SKILL_REL_PATHS).map((path)=>({path,version:skillVersionAt(path)})),legacy=distinctSkillFiles(roots,LEGACY_SKILL_REL_PATHS).map((path)=>({path,version:skillVersionAt(path)})),best=[...roveCopies].sort((a,b)=>(b.version??-1)-(a.version??-1))[0]??legacy[0];if(!best)return{installed:!1,installedVersion:null,currentVersion:KOBE_SKILL_VERSION,stale:!1,legacyCopies:[]};let stale=best.version===null||best.version<KOBE_SKILL_VERSION;return{installed:!0,installedVersion:best.version,currentVersion:KOBE_SKILL_VERSION,stale,legacyCopies:legacy.filter((copy)=>copy.path!==best.path)}}function describeLegacyCopies(copies){return copies.map((c)=>`${c.path}${c.version===null?"":` (v${c.version})`}`).join(", ")}function promptLine(){return new Promise((resolve2)=>{process.stdin.resume(),process.stdin.once("data",(d)=>{process.stdin.pause(),resolve2(String(d))})})}async function maybeHintSkillInstall(io={}){let{isRovePluginEnabled}=await import("./chunk-0dxzbmc1.js");if(isRovePluginEnabled())return;let cliName=activeCliName(),installCommand=skillInstallCommand(),state=kobeSkillState();if(!state.installed){if(getPersistedString(HINT_SEEN_KEY)==="1")return;setPersistedString(HINT_SEEN_KEY,"1"),process.stderr.write(`
7
7
  ${cliName}: the Rove agent skill isn't installed \u2014 install it so your coding agent can drive Rove via \`${cliName} api\`:
8
8
  ${installCommand}
9
9
  (wraps \`${npxSkillsCommand()}\`; check anytime with \`${cliName} doctor\`)