@sma1lboy/rove 0.9.171 → 0.9.173

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 (154) hide show
  1. package/dist/cli/{chunk-v0zxyqrq.js → chunk-00ehck55.js} +1 -1
  2. package/dist/cli/{chunk-3a1fjn0q.js → chunk-0pp0rhv7.js} +1 -1
  3. package/dist/cli/{chunk-k2ckx8zw.js → chunk-0q6h4vt4.js} +1 -1
  4. package/dist/cli/{chunk-jn5dd6bv.js → chunk-131wyt96.js} +1 -1
  5. package/dist/cli/{chunk-8wv8526c.js → chunk-1r0342yv.js} +1 -1
  6. package/dist/cli/{chunk-9xt05etk.js → chunk-1x7xjh3h.js} +1 -1
  7. package/dist/cli/{chunk-m0g17ckn.js → chunk-26ta488k.js} +2 -2
  8. package/dist/cli/{chunk-2jt0tbte.js → chunk-2fw5yz69.js} +1 -1
  9. package/dist/cli/{chunk-tqat428f.js → chunk-2kb4z64z.js} +1 -1
  10. package/dist/cli/{chunk-jdhhgxgv.js → chunk-2mj31sxr.js} +3 -3
  11. package/dist/cli/{chunk-kj58sv01.js → chunk-3em3a62d.js} +1 -1
  12. package/dist/cli/{chunk-j75axe29.js → chunk-3jh78dmc.js} +1 -1
  13. package/dist/cli/chunk-3qaksmst.js +2 -0
  14. package/dist/cli/{chunk-4728688z.js → chunk-3rv72762.js} +1 -1
  15. package/dist/cli/{chunk-kkx24j75.js → chunk-4v7jk8k2.js} +1 -1
  16. package/dist/cli/{chunk-zhbws9n3.js → chunk-4z009b9b.js} +1 -1
  17. package/dist/cli/{chunk-rhsvvdcn.js → chunk-592kjpyz.js} +1 -1
  18. package/dist/cli/{chunk-n4nntq73.js → chunk-5ygc7rce.js} +1 -1
  19. package/dist/cli/chunk-66ay20qj.js +2 -0
  20. package/dist/cli/{chunk-6tfx7mra.js → chunk-6eka0h5q.js} +1 -1
  21. package/dist/cli/{chunk-6q38ved5.js → chunk-6hk8zh22.js} +4 -4
  22. package/dist/cli/{chunk-7jbap5z2.js → chunk-6hq8fdce.js} +1 -1
  23. package/dist/cli/{chunk-vetk9j99.js → chunk-6mx234cz.js} +1 -1
  24. package/dist/cli/{chunk-hqnephbs.js → chunk-6sykc7a4.js} +1 -1
  25. package/dist/cli/chunk-6yhtfs6j.js +7 -0
  26. package/dist/cli/chunk-6zmd6ep8.js +2 -0
  27. package/dist/cli/{chunk-f76j7drr.js → chunk-76xcsq7f.js} +1 -1
  28. package/dist/cli/{chunk-d4vadrmy.js → chunk-7nndmapz.js} +1 -1
  29. package/dist/cli/chunk-8002w78e.js +2 -0
  30. package/dist/cli/chunk-8a20qy2b.js +2 -0
  31. package/dist/cli/{chunk-mcdv19rs.js → chunk-8cjr5ypt.js} +1 -1
  32. package/dist/cli/{chunk-0gepyh6e.js → chunk-8f8c02qq.js} +1 -1
  33. package/dist/cli/{chunk-511nqhca.js → chunk-8r7wfw7s.js} +1 -1
  34. package/dist/cli/chunk-9prawccj.js +3 -0
  35. package/dist/cli/{chunk-ba5a5faq.js → chunk-9wk5b8ft.js} +1 -1
  36. package/dist/cli/{chunk-2hbhmvjw.js → chunk-9xkc34rf.js} +1 -1
  37. package/dist/cli/chunk-a74pa16c.js +3 -0
  38. package/dist/cli/{chunk-ky9e5s1q.js → chunk-bn5xyt9f.js} +1 -1
  39. package/dist/cli/{chunk-51sbegpb.js → chunk-c8qp0sy8.js} +1 -1
  40. package/dist/cli/chunk-ccgs5279.js +2 -0
  41. package/dist/cli/{chunk-navjgqby.js → chunk-crcc7z47.js} +1 -1
  42. package/dist/cli/{chunk-vhhzk3xj.js → chunk-ct2tf2t9.js} +1 -1
  43. package/dist/cli/{chunk-h9mqdxvs.js → chunk-cwgz6dan.js} +1 -1
  44. package/dist/cli/{chunk-ayhhgfsz.js → chunk-ddcxvbme.js} +1 -1
  45. package/dist/cli/{chunk-3p2e2ry4.js → chunk-dhct03cv.js} +1 -1
  46. package/dist/cli/chunk-dn16kxx2.js +2 -0
  47. package/dist/cli/chunk-e453dmvm.js +2 -0
  48. package/dist/cli/{chunk-r3903ysy.js → chunk-edz3rt42.js} +1 -1
  49. package/dist/cli/{chunk-ap95e417.js → chunk-f3xp4z3s.js} +2 -2
  50. package/dist/cli/chunk-f9dzb6td.js +2 -0
  51. package/dist/cli/chunk-fch2s1ny.js +3 -0
  52. package/dist/cli/{chunk-5wpdpghc.js → chunk-frpv6dkd.js} +2 -2
  53. package/dist/cli/{chunk-e29hx18x.js → chunk-fxs82dsx.js} +1 -1
  54. package/dist/cli/{chunk-t3z4etp5.js → chunk-fysbm6gg.js} +1 -1
  55. package/dist/cli/chunk-fzvv6185.js +2 -0
  56. package/dist/cli/chunk-g2e1dmxh.js +4 -0
  57. package/dist/cli/chunk-gq81y9jt.js +2 -0
  58. package/dist/cli/{chunk-yqardayk.js → chunk-h7vj9zd9.js} +1 -1
  59. package/dist/cli/{chunk-hxv7g8yq.js → chunk-hq2k2v9y.js} +1 -1
  60. package/dist/cli/chunk-hrrv8y83.js +3 -0
  61. package/dist/cli/{chunk-xhw8s2es.js → chunk-jh6pkxbd.js} +2 -2
  62. package/dist/cli/chunk-jk7gega5.js +2 -0
  63. package/dist/cli/{chunk-855rzebn.js → chunk-jms7de9g.js} +1 -1
  64. package/dist/cli/{chunk-41ahvk51.js → chunk-jpdf97cx.js} +1 -1
  65. package/dist/cli/{chunk-enct2vtg.js → chunk-jywrajew.js} +1 -1
  66. package/dist/cli/chunk-m5zmrtqq.js +2 -0
  67. package/dist/cli/chunk-m8f8gv2w.js +2 -0
  68. package/dist/cli/{chunk-bz9mqybr.js → chunk-nbqetnzt.js} +2 -2
  69. package/dist/cli/{chunk-3wj69b0a.js → chunk-ndm62s2f.js} +1 -1
  70. package/dist/cli/chunk-nk21m1v0.js +4 -0
  71. package/dist/cli/chunk-p12s6mw2.js +2 -0
  72. package/dist/cli/{chunk-5agemmmn.js → chunk-p3m7x4h3.js} +1 -1
  73. package/dist/cli/{chunk-6wpege0h.js → chunk-p4yf9ym8.js} +1 -1
  74. package/dist/cli/chunk-p83cscpm.js +16 -0
  75. package/dist/cli/{chunk-phftxm0p.js → chunk-p94469k0.js} +2 -2
  76. package/dist/cli/chunk-p9meam9p.js +2 -0
  77. package/dist/cli/{chunk-bpre78rc.js → chunk-pmtyjntj.js} +2 -2
  78. package/dist/cli/chunk-px6axbd9.js +3 -0
  79. package/dist/cli/{chunk-ch9b1d5y.js → chunk-q5jhy3t8.js} +1 -1
  80. package/dist/cli/{chunk-qqw3p4fc.js → chunk-q5jw9trj.js} +1 -1
  81. package/dist/cli/{chunk-5f80ggc3.js → chunk-qhkag7ad.js} +1 -1
  82. package/dist/cli/{chunk-a7wq1cba.js → chunk-qqysxv2a.js} +2 -2
  83. package/dist/cli/{chunk-yhwb91e4.js → chunk-r1mp0eb2.js} +1 -1
  84. package/dist/cli/chunk-r9gfh1zz.js +3 -0
  85. package/dist/cli/{chunk-g56kvet6.js → chunk-sb0ns0c7.js} +1 -1
  86. package/dist/cli/chunk-t915by6w.js +3 -0
  87. package/dist/cli/{chunk-dt51afhh.js → chunk-v61s3fps.js} +1 -1
  88. package/dist/cli/{chunk-nzscq4yf.js → chunk-v7mrhwk1.js} +1 -1
  89. package/dist/cli/chunk-var92s38.js +2 -0
  90. package/dist/cli/{chunk-bkvr06xn.js → chunk-vkbq42k2.js} +1 -1
  91. package/dist/cli/{chunk-c562kjgk.js → chunk-vnxg3h0t.js} +1 -1
  92. package/dist/cli/chunk-vra4m3zy.js +4 -0
  93. package/dist/cli/{chunk-8wrgvzy9.js → chunk-vwjzw4e5.js} +1 -1
  94. package/dist/cli/{chunk-kn3pgymw.js → chunk-w469vwsm.js} +1 -1
  95. package/dist/cli/{chunk-kbvyv1x2.js → chunk-x6qyedy8.js} +3 -3
  96. package/dist/cli/{chunk-g83jaj2y.js → chunk-x7386zz9.js} +3 -3
  97. package/dist/cli/chunk-xg48ks8t.js +8 -0
  98. package/dist/cli/{chunk-hxfj85yw.js → chunk-xjnd1hwr.js} +1 -1
  99. package/dist/cli/chunk-xsrcwcjc.js +4 -0
  100. package/dist/cli/chunk-xzargt6y.js +2 -0
  101. package/dist/cli/{chunk-aqvm6f5v.js → chunk-y1ab50re.js} +1 -1
  102. package/dist/cli/chunk-y2etwd1y.js +3 -0
  103. package/dist/cli/chunk-y7231jtb.js +2 -0
  104. package/dist/cli/chunk-y7cvyttm.js +4 -0
  105. package/dist/cli/{chunk-msr1xtay.js → chunk-ygtkanm0.js} +1 -1
  106. package/dist/cli/{chunk-756rtc9n.js → chunk-yha6ps65.js} +1 -1
  107. package/dist/cli/{chunk-gv212jx6.js → chunk-yw4cj66m.js} +1 -1
  108. package/dist/cli/chunk-z0ds727b.js +2 -0
  109. package/dist/cli/{chunk-zqfbyq0a.js → chunk-z7c6nap0.js} +1 -1
  110. package/dist/cli/chunk-zry35cne.js +2 -0
  111. package/dist/cli/{chunk-q86jajp5.js → chunk-zzrtyaq2.js} +4 -4
  112. package/dist/cli/index.js +7 -7
  113. package/dist/cli/kobe-run.js +1 -1
  114. package/dist/cli/kobe.js +1 -1
  115. package/dist/cli/pty-host-node.mjs +51 -32
  116. package/dist/cli/rove-run.js +1 -1
  117. package/dist/cli/rove.js +1 -1
  118. package/dist/skills/rove/references/api-flags.md +11 -3
  119. package/package.json +1 -1
  120. package/dist/cli/chunk-044s3zc5.js +0 -4
  121. package/dist/cli/chunk-1fpbk5mj.js +0 -2
  122. package/dist/cli/chunk-2ytd28ng.js +0 -2
  123. package/dist/cli/chunk-38272eqv.js +0 -4
  124. package/dist/cli/chunk-3ppjycfg.js +0 -2
  125. package/dist/cli/chunk-4rabzw5d.js +0 -3
  126. package/dist/cli/chunk-5bbh53hr.js +0 -2
  127. package/dist/cli/chunk-5jw5af60.js +0 -3
  128. package/dist/cli/chunk-655y4wyd.js +0 -2
  129. package/dist/cli/chunk-81ynhhq4.js +0 -2
  130. package/dist/cli/chunk-863fpykn.js +0 -2
  131. package/dist/cli/chunk-9tq6exs5.js +0 -2
  132. package/dist/cli/chunk-bggpzxk2.js +0 -4
  133. package/dist/cli/chunk-bhdtmwax.js +0 -7
  134. package/dist/cli/chunk-bn1ta0qc.js +0 -2
  135. package/dist/cli/chunk-efkpbpkm.js +0 -2
  136. package/dist/cli/chunk-ehhmrcph.js +0 -16
  137. package/dist/cli/chunk-fkwaxx0y.js +0 -2
  138. package/dist/cli/chunk-fndegq4p.js +0 -3
  139. package/dist/cli/chunk-gfckvx2p.js +0 -7
  140. package/dist/cli/chunk-jb7hgakq.js +0 -2
  141. package/dist/cli/chunk-k1qe5qqa.js +0 -3
  142. package/dist/cli/chunk-k68brrpa.js +0 -4
  143. package/dist/cli/chunk-kwm5x2qr.js +0 -2
  144. package/dist/cli/chunk-mmg7m9x2.js +0 -2
  145. package/dist/cli/chunk-mv7ptt5w.js +0 -3
  146. package/dist/cli/chunk-nxj2t0rq.js +0 -2
  147. package/dist/cli/chunk-p57f5fhw.js +0 -2
  148. package/dist/cli/chunk-skysscx4.js +0 -2
  149. package/dist/cli/chunk-syxg74zr.js +0 -2
  150. package/dist/cli/chunk-t2v3ad8y.js +0 -3
  151. package/dist/cli/chunk-v0rgt7sh.js +0 -2
  152. package/dist/cli/chunk-wc0g8kzq.js +0 -2
  153. package/dist/cli/chunk-wprfqncz.js +0 -2
  154. /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,4 +1,4 @@
1
1
  // @bun
2
- import{BREAKING_VERSIONS,CURRENT_VERSION,compareSemver}from"./chunk-f76j7drr.js";import{loadStateFile,patchStateFile}from"./chunk-j75axe29.js";import{activeCliName}from"./chunk-v0zxyqrq.js";var LAST_RUN_VERSION_KEY="app.lastRunVersion";function resetGateBlockers(lastRun,current=CURRENT_VERSION,breaking=BREAKING_VERSIONS){if(typeof lastRun!=="string"||lastRun.length===0)return[];let[lo,hi]=compareSemver(lastRun,current)<=0?[lastRun,current]:[current,lastRun];return breaking.filter((b)=>compareSemver(b,lo)>0&&compareSemver(b,hi)<=0)}function enforceResetGate(){let cliName=activeCliName(),lastRun=loadStateFile()[LAST_RUN_VERSION_KEY],blockers=resetGateBlockers(lastRun);if(blockers.length>0){let from=typeof lastRun==="string"?lastRun:"unknown";console.error([`${cliName} ${CURRENT_VERSION}: cannot start \u2014 version ${blockers.join(", ")} introduced breaking changes`,`(last run: ${from}). Your daemon/session state may be incompatible.`,"","Run:",` ${cliName} reset # stop daemon + PTY host + sessions (tasks kept)`,` ${cliName} reset --hard # additionally wipe the task index + UI state`,"","Then relaunch Rove. Worktrees are never touched."].join(`
2
+ import{BREAKING_VERSIONS,CURRENT_VERSION,compareSemver}from"./chunk-76xcsq7f.js";import{loadStateFile,patchStateFile}from"./chunk-3jh78dmc.js";import{activeCliName}from"./chunk-00ehck55.js";var LAST_RUN_VERSION_KEY="app.lastRunVersion";function resetGateBlockers(lastRun,current=CURRENT_VERSION,breaking=BREAKING_VERSIONS){if(typeof lastRun!=="string"||lastRun.length===0)return[];let[lo,hi]=compareSemver(lastRun,current)<=0?[lastRun,current]:[current,lastRun];return breaking.filter((b)=>compareSemver(b,lo)>0&&compareSemver(b,hi)<=0)}function enforceResetGate(){let cliName=activeCliName(),lastRun=loadStateFile()[LAST_RUN_VERSION_KEY],blockers=resetGateBlockers(lastRun);if(blockers.length>0){let from=typeof lastRun==="string"?lastRun:"unknown";console.error([`${cliName} ${CURRENT_VERSION}: cannot start \u2014 version ${blockers.join(", ")} introduced breaking changes`,`(last run: ${from}). Your daemon/session state may be incompatible.`,"","Run:",` ${cliName} reset # stop daemon + PTY host + sessions (tasks kept)`,` ${cliName} reset --hard # additionally wipe the task index + UI state`,"","Then relaunch Rove. Worktrees are never touched."].join(`
3
3
  `)),process.exit(1)}if(lastRun!==CURRENT_VERSION)stampResetGate()}function stampResetGate(){try{patchStateFile({[LAST_RUN_VERSION_KEY]:CURRENT_VERSION})}catch{}}
4
4
  export{LAST_RUN_VERSION_KEY,enforceResetGate,stampResetGate};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{DEFAULT_LOG_ROTATE_CAP_BYTES,shouldRotateLog}from"./chunk-pw6yfj10.js";import{defaultClientLogPath}from"./chunk-mcdv19rs.js";import{appendFile,mkdir,rename,stat}from"fs/promises";import{dirname}from"path";var context="client";function setClientLogContext(ctx){context=ctx}function coerceError(err){if(err instanceof Error)return{message:err.message,stack:err.stack};let text;try{text=typeof err==="string"?err:JSON.stringify(err)}catch{text=String(err)}return{message:text}}function formatClientEntry(subsystem,message,now=new Date){return`[${now.toISOString()}] client ${context} [${subsystem}] pid=${process.pid}: ${message}
2
+ import{DEFAULT_LOG_ROTATE_CAP_BYTES,shouldRotateLog}from"./chunk-pw6yfj10.js";import{defaultClientLogPath}from"./chunk-8cjr5ypt.js";import{appendFile,mkdir,rename,stat}from"fs/promises";import{dirname}from"path";var context="client";function setClientLogContext(ctx){context=ctx}function coerceError(err){if(err instanceof Error)return{message:err.message,stack:err.stack};let text;try{text=typeof err==="string"?err:JSON.stringify(err)}catch{text=String(err)}return{message:text}}function formatClientEntry(subsystem,message,now=new Date){return`[${now.toISOString()}] client ${context} [${subsystem}] pid=${process.pid}: ${message}
3
3
  `}var warnedOnce=!1;function warnOnce(){if(warnedOnce)return;warnedOnce=!0;try{process.stderr.write(`[rove] client log write failed; continuing without it
4
4
  `)}catch{}}var writeChain=Promise.resolve();async function rotateClientLogIfNeeded(path){try{let{size}=await stat(path);if(!shouldRotateLog(size,DEFAULT_LOG_ROTATE_CAP_BYTES))return;await rename(path,`${path}.old`)}catch{}}function append(line,logPath){let path=logPath??defaultClientLogPath();writeChain=writeChain.then(async()=>{await rotateClientLogIfNeeded(path);try{await appendFile(path,line)}catch(err){if(err?.code==="ENOENT")await mkdir(dirname(path),{recursive:!0}),await appendFile(path,line);else throw err}}).catch(()=>warnOnce())}function logClient(subsystem,message,logPath){append(formatClientEntry(subsystem,message),logPath)}function logClientError(subsystem,err){let e=coerceError(err);append(formatClientEntry(subsystem,e.stack??e.message))}var onRejection,onException;function installClientCrashHandlers(){if(onRejection||onException)return;onRejection=(reason)=>logClientError("crash-net",reason),onException=(err)=>logClientError("crash-net",err),process.on("unhandledRejection",onRejection),process.on("uncaughtException",onException)}
5
5
  export{setClientLogContext,logClient,logClientError,installClientCrashHandlers};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{engineEntry,identifiableEngineIds}from"./chunk-xhw8s2es.js";import{PsProbeUnavailableError}from"./chunk-pxk2c2vj.js";import{__require}from"./chunk-wqfp8d9w.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(`
2
+ import{engineEntry,identifiableEngineIds}from"./chunk-jh6pkxbd.js";import{PsProbeUnavailableError}from"./chunk-pxk2c2vj.js";import{__require}from"./chunk-wqfp8d9w.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 PS_PROBE_TIMEOUT_MS=5000,bunPsSpawn=()=>{let proc=Bun.spawn(["ps","-A","-o","pid=,ppid=,args="],{stdout:"pipe",stderr:"ignore"});return{text:new Response(proc.stdout).text(),kill:()=>proc.kill()}};async function psSnapshotWith(spawn,timeoutMs=PS_PROBE_TIMEOUT_MS){let proc=spawn(),timer;try{let text=await Promise.race([proc.text,new Promise((_resolve,reject)=>{timer=setTimeout(()=>{try{proc.kill()}catch{}reject(new PsProbeUnavailableError(`ps did not answer within ${timeoutMs}ms`))},timeoutMs)})]);if(parsePsSnapshot(text).length===0)throw new PsProbeUnavailableError("ps returned no usable rows");return text}finally{if(timer)clearTimeout(timer)}}var psSnapshot=async(anchors)=>{if(process.platform!=="win32")return psSnapshotWith(bunPsSpawn);let{defaultWinProcessProbe,winProcessSnapshot}=await import("./chunk-qqxw72nh.js");return winProcessSnapshot(anchors??[],defaultWinProcessProbe())};async function foregroundEngine(rootPid,snapshot=psSnapshot){try{return foregroundEngineIn(parsePsSnapshot(await snapshot([rootPid])),rootPid)}catch{return null}}
4
4
  export{vendorFromArgv,parsePsSnapshot,hasAncestor,foregroundEngineIn,engineProcessIn,PS_PROBE_TIMEOUT_MS,psSnapshotWith,psSnapshot,foregroundEngine};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{KobeDaemonClient}from"./chunk-0gepyh6e.js";import{isProcessAlive,readPidFile}from"./chunk-mv7ptt5w.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 KobeDaemonClient(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}}
2
+ import{KobeDaemonClient}from"./chunk-8f8c02qq.js";import{isProcessAlive,readPidFile}from"./chunk-t915by6w.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 KobeDaemonClient(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};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{buildPluginEnv}from"./chunk-41ahvk51.js";import{currentPluginPlatform,loadPluginRegistry,readPluginManifest,supportsPlatform}from"./chunk-38272eqv.js";import{resolveLoginShell}from"./chunk-b99tf0jr.js";function shq(s){return`'${s.replace(/'/g,"'\\''")}'`}function buildPaneArgv(pluginId,pluginRoot,pane,opts){let env=buildPluginEnv({homeDir:opts.homeDir,socketPath:opts.socketPath,binPath:opts.binPath,pluginId,pluginRoot,extra:{ROVE_PLUGIN_ENTRYPOINT_ID:pane.id,...opts.taskId?{ROVE_PLUGIN_TASK_ID:opts.taskId}:{}}}),pairs=Object.entries(env).filter(([k])=>k.startsWith("ROVE_")||k.startsWith("KOBE_")),command=pane.command.map((a)=>a.replace(/\$\{?(?:ROVE|KOBE)_PLUGIN_ROOT\}?/g,pluginRoot)),script=`exec env ${pairs.map(([k,v])=>shq(`${k}=${v}`)).join(" ")} ${command.map(shq).join(" ")}`;return[resolveLoginShell(),"-ilc",script]}function listPaneLaunches(opts){let platform=currentPluginPlatform(),out=[];for(let entry of loadPluginRegistry(opts.homeDir).plugins){if(!entry.enabled)continue;try{let{manifest}=readPluginManifest(entry.root);if(!supportsPlatform({},manifest,platform))continue;for(let pane of manifest.panes){if(!supportsPlatform(pane,manifest,platform))continue;out.push({pluginId:entry.id,paneId:pane.id,title:pane.title,placement:pane.placement,argv:buildPaneArgv(entry.id,entry.root,pane,opts)})}}catch{}}return out}
2
+ import{buildPluginEnv}from"./chunk-jpdf97cx.js";import{currentPluginPlatform,loadPluginRegistry,readPluginManifest,supportsPlatform}from"./chunk-g2e1dmxh.js";import{resolveLoginShell}from"./chunk-b99tf0jr.js";function shq(s){return`'${s.replace(/'/g,"'\\''")}'`}function buildPaneArgv(pluginId,pluginRoot,pane,opts){let env=buildPluginEnv({homeDir:opts.homeDir,socketPath:opts.socketPath,binPath:opts.binPath,pluginId,pluginRoot,extra:{ROVE_PLUGIN_ENTRYPOINT_ID:pane.id,...opts.taskId?{ROVE_PLUGIN_TASK_ID:opts.taskId}:{}}}),pairs=Object.entries(env).filter(([k])=>k.startsWith("ROVE_")||k.startsWith("KOBE_")),command=pane.command.map((a)=>a.replace(/\$\{?(?:ROVE|KOBE)_PLUGIN_ROOT\}?/g,pluginRoot)),script=`exec env ${pairs.map(([k,v])=>shq(`${k}=${v}`)).join(" ")} ${command.map(shq).join(" ")}`;return[resolveLoginShell(),"-ilc",script]}function listPaneLaunches(opts){let platform=currentPluginPlatform(),out=[];for(let entry of loadPluginRegistry(opts.homeDir).plugins){if(!entry.enabled)continue;try{let{manifest}=readPluginManifest(entry.root);if(!supportsPlatform({},manifest,platform))continue;for(let pane of manifest.panes){if(!supportsPlatform(pane,manifest,platform))continue;out.push({pluginId:entry.id,paneId:pane.id,title:pane.title,placement:pane.placement,argv:buildPaneArgv(entry.id,entry.root,pane,opts)})}}catch{}}return out}
3
3
  export{buildPaneArgv,listPaneLaunches};
@@ -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-vra4m3zy.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\`)
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{readOnlyGitProcessEnv}from"./chunk-6xppe9bj.js";import{quoteShellArg}from"./chunk-2fypr41w.js";import{getPersistedString}from"./chunk-6wpege0h.js";var EDITOR_KINDS=["auto","vim","nvim","nano","emacs","custom"],AUTO_EDITOR_CANDIDATES=["nvim","vim","emacs","nano"],EDITOR_KIND_KEY="editor.kind",EDITOR_CUSTOM_KEY="editor.customCommand",DEFAULT_EDITOR_KIND="auto";function normalizeEditorKind(value){return EDITOR_KINDS.includes(value)?value:"auto"}var FILE_PLACEHOLDER="{file}";function firstToken(cmd){return cmd.trim().split(/\s+/)[0]??""}function buildEditorCommand(kind,customCommand,absPath,envEditor){let file=quoteShellArg(absPath);if(kind==="vim")return{bin:"vim",command:`vim ${file}`};if(kind==="nvim")return{bin:"nvim",command:`nvim ${file}`};if(kind==="nano")return{bin:"nano",command:`nano ${file}`};if(kind==="emacs")return{bin:"emacs",command:`emacs ${file}`};let tmpl=(customCommand.trim()||(envEditor??"").trim()).trim();if(!tmpl)return null;let bin=firstToken(tmpl);if(!bin)return null;let command=tmpl.includes(FILE_PLACEHOLDER)?tmpl.split(FILE_PLACEHOLDER).join(file):`${tmpl} ${file}`;return{bin,command}}function buildNvimDiffCommand(bin,absPath,relPath){let file=quoteShellArg(absPath);return["f=$(mktemp 2>/dev/null)",`if [ -n "$f" ] && git show ${quoteShellArg(`HEAD:./${relPath}`)} > "$f" 2>/dev/null; then`,` ${bin} -d "$f" ${file} -c 'setlocal nomodifiable' -c 'wincmd l'; r=$?`,"else",` ${bin} ${file}; r=$?`,"fi",'rm -f "$f" 2>/dev/null; exit $r'].join(`
2
+ import{readOnlyGitProcessEnv}from"./chunk-6xppe9bj.js";import{quoteShellArg}from"./chunk-2fypr41w.js";import{getPersistedString}from"./chunk-p4yf9ym8.js";var EDITOR_KINDS=["auto","vim","nvim","nano","emacs","custom"],AUTO_EDITOR_CANDIDATES=["nvim","vim","emacs","nano"],EDITOR_KIND_KEY="editor.kind",EDITOR_CUSTOM_KEY="editor.customCommand",DEFAULT_EDITOR_KIND="auto";function normalizeEditorKind(value){return EDITOR_KINDS.includes(value)?value:"auto"}var FILE_PLACEHOLDER="{file}";function firstToken(cmd){return cmd.trim().split(/\s+/)[0]??""}function buildEditorCommand(kind,customCommand,absPath,envEditor){let file=quoteShellArg(absPath);if(kind==="vim")return{bin:"vim",command:`vim ${file}`};if(kind==="nvim")return{bin:"nvim",command:`nvim ${file}`};if(kind==="nano")return{bin:"nano",command:`nano ${file}`};if(kind==="emacs")return{bin:"emacs",command:`emacs ${file}`};let tmpl=(customCommand.trim()||(envEditor??"").trim()).trim();if(!tmpl)return null;let bin=firstToken(tmpl);if(!bin)return null;let command=tmpl.includes(FILE_PLACEHOLDER)?tmpl.split(FILE_PLACEHOLDER).join(file):`${tmpl} ${file}`;return{bin,command}}function buildNvimDiffCommand(bin,absPath,relPath){let file=quoteShellArg(absPath);return["f=$(mktemp 2>/dev/null)",`if [ -n "$f" ] && git show ${quoteShellArg(`HEAD:./${relPath}`)} > "$f" 2>/dev/null; then`,` ${bin} -d "$f" ${file} -c 'setlocal nomodifiable' -c 'wincmd l'; r=$?`,"else",` ${bin} ${file}; r=$?`,"fi",'rm -f "$f" 2>/dev/null; exit $r'].join(`
3
3
  `)}function relativeToWorktree(worktree,absPath){let prefix=worktree.endsWith("/")?worktree:`${worktree}/`;return absPath.startsWith(prefix)?absPath.slice(prefix.length):null}async function resolveEditorCommand(absPath){let kind=normalizeEditorKind(getPersistedString(EDITOR_KIND_KEY)),custom=getPersistedString(EDITOR_CUSTOM_KEY)??"",env=(process.env.VISUAL??process.env.EDITOR??"").trim();if(kind!=="auto")return buildEditorCommand(kind,custom,absPath,env);if(env)return buildEditorCommand("custom","",absPath,env);let file=quoteShellArg(absPath);for(let bin of AUTO_EDITOR_CANDIDATES)if(await binaryAvailable(bin))return{bin,command:`${bin} ${file}`};return null}async function binaryAvailable(bin){try{return await Bun.spawn(["sh","-c",`command -v ${quoteShellArg(bin)} >/dev/null 2>&1`],{stdin:"ignore",stdout:"ignore",stderr:"ignore"}).exited===0}catch{return!1}}async function fileHasDiff(worktree,relPath){try{return await Bun.spawn(["git","diff","--quiet","HEAD","--",relPath],{cwd:worktree,stdin:"ignore",stdout:"ignore",stderr:"ignore",env:readOnlyGitProcessEnv()}).exited===1}catch{return!1}}async function resolveEditorLaunch(worktree,absPath){let resolved=await resolveEditorCommand(absPath);if(!resolved)return null;if(!await binaryAvailable(resolved.bin))return null;return{command:await maybeDiffCommand(resolved,worktree,absPath),label:editorWindowLabel(absPath)}}async function maybeDiffCommand(resolved,worktree,absPath){let{bin,command}=resolved;if(bin!=="nvim"&&bin!=="vim")return command;if(command!==`${bin} ${quoteShellArg(absPath)}`)return command;let rel=relativeToWorktree(worktree,absPath);if(!rel)return command;if(!await fileHasDiff(worktree,rel))return command;return buildNvimDiffCommand(bin,absPath,rel)}function editorWindowLabel(absPath){let base=absPath.slice(absPath.lastIndexOf("/")+1).trim();return base.length>0?base:"edit"}
4
4
  export{EDITOR_KINDS,EDITOR_KIND_KEY,EDITOR_CUSTOM_KEY,DEFAULT_EDITOR_KIND,normalizeEditorKind,resolveEditorCommand,binaryAvailable,resolveEditorLaunch};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{loadStateFile,patchStateFile}from"./chunk-j75axe29.js";var LAST_ACTIVE_TASK_KEY="lastActive.taskId";function readLastActiveTaskId(){let value=loadStateFile()[LAST_ACTIVE_TASK_KEY];return typeof value==="string"&&value?value:null}function writeLastActiveTaskId(id){patchStateFile({[LAST_ACTIVE_TASK_KEY]:id})}
2
+ import{loadStateFile,patchStateFile}from"./chunk-3jh78dmc.js";var LAST_ACTIVE_TASK_KEY="lastActive.taskId";function readLastActiveTaskId(){let value=loadStateFile()[LAST_ACTIVE_TASK_KEY];return typeof value==="string"&&value?value:null}function writeLastActiveTaskId(id){patchStateFile({[LAST_ACTIVE_TASK_KEY]:id})}
3
3
  export{readLastActiveTaskId,writeLastActiveTaskId};