@sma1lboy/rove 0.9.302-next.413 → 0.9.305-next.430

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 (128) hide show
  1. package/dist/cli/{chunk-d6nhhxmh.js → chunk-06vsvvtr.js} +1 -1
  2. package/dist/cli/{chunk-k6wxbh9e.js → chunk-0s7j1xps.js} +1 -1
  3. package/dist/cli/{chunk-0dwn2emg.js → chunk-19n8y9xp.js} +5 -5
  4. package/dist/cli/{chunk-e4gepsz1.js → chunk-1bertmzz.js} +3 -3
  5. package/dist/cli/{chunk-rw890y60.js → chunk-1et3gskx.js} +1 -1
  6. package/dist/cli/chunk-29e7x3qx.js +2 -0
  7. package/dist/cli/{chunk-pbc7wz8k.js → chunk-2agspgfq.js} +5 -5
  8. package/dist/cli/{chunk-jpjabj96.js → chunk-2gpr5dm4.js} +1 -1
  9. package/dist/cli/{chunk-e0fgmktj.js → chunk-2nddryb2.js} +1 -1
  10. package/dist/cli/{chunk-q6qmv2jq.js → chunk-37g0yabr.js} +1 -1
  11. package/dist/cli/{chunk-9vmd0bhr.js → chunk-3da0g8md.js} +2 -2
  12. package/dist/cli/{chunk-06kf5yg7.js → chunk-3jh1cfdj.js} +2 -2
  13. package/dist/cli/{chunk-7qxvdms8.js → chunk-3t3fp5h4.js} +1 -1
  14. package/dist/cli/{chunk-r9c7txh5.js → chunk-4nzf8w3e.js} +2 -2
  15. package/dist/cli/{chunk-r2ez4ker.js → chunk-4whghfgg.js} +1 -1
  16. package/dist/cli/chunk-59ff10tt.js +2 -0
  17. package/dist/cli/{chunk-hmfqyvet.js → chunk-5dv7pw3w.js} +2 -2
  18. package/dist/cli/{chunk-kbqgzx65.js → chunk-6azsw0ry.js} +11 -11
  19. package/dist/cli/{chunk-s29k086j.js → chunk-6b852k6c.js} +1 -1
  20. package/dist/cli/{chunk-vpm8dfyg.js → chunk-6cggsxpr.js} +1 -1
  21. package/dist/cli/{chunk-p9an6jcq.js → chunk-6jxe4f13.js} +1 -1
  22. package/dist/cli/{chunk-4ayp6znk.js → chunk-6wzb9c2x.js} +1 -1
  23. package/dist/cli/chunk-750rk2xz.js +16 -0
  24. package/dist/cli/{chunk-qnjnb133.js → chunk-7c89khwg.js} +1 -1
  25. package/dist/cli/chunk-7dah6dc9.js +2 -0
  26. package/dist/cli/{chunk-hykerb6a.js → chunk-7ezpcrkf.js} +1 -1
  27. package/dist/cli/{chunk-9dyc2wh8.js → chunk-7gk8g1ae.js} +1 -1
  28. package/dist/cli/{chunk-xjf4k0xf.js → chunk-7yhekmvy.js} +1 -1
  29. package/dist/cli/{chunk-x6w8cdbk.js → chunk-7z2bmv13.js} +1 -1
  30. package/dist/cli/{chunk-xzhb4qs8.js → chunk-8ag7qs90.js} +1 -1
  31. package/dist/cli/{chunk-8d6xcvar.js → chunk-8nbvsger.js} +1 -1
  32. package/dist/cli/chunk-8wejvvsz.js +2 -0
  33. package/dist/cli/chunk-8xdhw922.js +13 -0
  34. package/dist/cli/chunk-9892j1n1.js +2 -0
  35. package/dist/cli/{chunk-wh147k4t.js → chunk-9b42t2wf.js} +1 -1
  36. package/dist/cli/{chunk-r4q693ge.js → chunk-9tke0g8m.js} +1 -1
  37. package/dist/cli/{chunk-8z73wx8z.js → chunk-a5pd9fk3.js} +1 -1
  38. package/dist/cli/{chunk-nb99x2kt.js → chunk-a6s52zm5.js} +2 -5
  39. package/dist/cli/{chunk-j3zj2gm6.js → chunk-a8j2x5pf.js} +1 -1
  40. package/dist/cli/chunk-aejb41e3.js +2 -0
  41. package/dist/cli/{chunk-m1dgjq5f.js → chunk-am70fwd0.js} +1 -1
  42. package/dist/cli/{chunk-nwz00nba.js → chunk-b7rxn7c9.js} +1 -1
  43. package/dist/cli/{chunk-mkbyb8d1.js → chunk-b8hd91nv.js} +3 -3
  44. package/dist/cli/chunk-cs7m5f61.js +2 -0
  45. package/dist/cli/{chunk-s00wwj3a.js → chunk-cvcp1aye.js} +1 -1
  46. package/dist/cli/chunk-cw9h73h5.js +12 -0
  47. package/dist/cli/{chunk-gwnxv2rz.js → chunk-d35ctfpd.js} +1 -1
  48. package/dist/cli/{chunk-24v4zec6.js → chunk-dab3kttb.js} +1 -1
  49. package/dist/cli/{chunk-6h8sxpmj.js → chunk-ejs6dnxf.js} +1 -1
  50. package/dist/cli/{chunk-gz3sxsp7.js → chunk-er4mc36m.js} +1 -1
  51. package/dist/cli/{chunk-sqcntdty.js → chunk-etz8f2ny.js} +1 -1
  52. package/dist/cli/{chunk-r79n2ebq.js → chunk-fmhnw1nz.js} +2 -2
  53. package/dist/cli/{chunk-gej20ab5.js → chunk-g70rcpsp.js} +1 -1
  54. package/dist/cli/{chunk-px91psgc.js → chunk-ga448pv8.js} +1 -1
  55. package/dist/cli/{chunk-0et8q8pm.js → chunk-gafj4yp3.js} +5 -5
  56. package/dist/cli/{chunk-rmmetv42.js → chunk-ggjg0h5c.js} +1 -1
  57. package/dist/cli/{chunk-1wnjq6ej.js → chunk-gvs8sbp2.js} +1 -1
  58. package/dist/cli/{chunk-zc7e78mv.js → chunk-gz0x179r.js} +1 -1
  59. package/dist/cli/chunk-h2xantkm.js +2 -0
  60. package/dist/cli/{chunk-f69jsv6b.js → chunk-hct98wxq.js} +1 -1
  61. package/dist/cli/{chunk-d11v35wg.js → chunk-kvwneanp.js} +1 -1
  62. package/dist/cli/chunk-m5ddrj6q.js +2 -0
  63. package/dist/cli/{chunk-gqkpq2hm.js → chunk-mavyyarb.js} +1 -1
  64. package/dist/cli/chunk-me70fpec.js +2 -0
  65. package/dist/cli/{chunk-z9wneamr.js → chunk-n15p38e5.js} +1 -1
  66. package/dist/cli/{chunk-2v2t1a03.js → chunk-nhsem71y.js} +1 -1
  67. package/dist/cli/{chunk-rnrja9fy.js → chunk-nyr8zxgd.js} +3 -3
  68. package/dist/cli/{chunk-gx3j06wx.js → chunk-p4rhkv3k.js} +1 -1
  69. package/dist/cli/{chunk-r0p3qshx.js → chunk-pf3nzz87.js} +1 -1
  70. package/dist/cli/chunk-qaznc1bg.js +20 -0
  71. package/dist/cli/{chunk-633beahm.js → chunk-qwqa75g1.js} +1 -1
  72. package/dist/cli/{chunk-2h58p581.js → chunk-r8xt34nn.js} +1 -1
  73. package/dist/cli/chunk-ragdpajw.js +6 -0
  74. package/dist/cli/{chunk-bp3edwby.js → chunk-rnmj5c45.js} +1 -1
  75. package/dist/cli/{chunk-5ff40r8a.js → chunk-s129kc10.js} +1 -1
  76. package/dist/cli/{chunk-fphcr46j.js → chunk-s2eezz0a.js} +1 -1
  77. package/dist/cli/{chunk-37we82a4.js → chunk-s6wqbs6y.js} +1 -1
  78. package/dist/cli/{chunk-rz5sspn8.js → chunk-sffdpzfv.js} +1 -1
  79. package/dist/cli/{chunk-w2k5rw0q.js → chunk-sggsdk9s.js} +11 -7
  80. package/dist/cli/{chunk-vn0rnzyt.js → chunk-t4reqv8m.js} +1 -1
  81. package/dist/cli/{chunk-hafbyy9x.js → chunk-t7qj639x.js} +2 -2
  82. package/dist/cli/{chunk-z9tgh00y.js → chunk-t8gt3kq8.js} +1 -1
  83. package/dist/cli/{chunk-486j02v4.js → chunk-vat1vjkk.js} +1 -1
  84. package/dist/cli/{chunk-63ktckgj.js → chunk-vd9670dy.js} +1 -1
  85. package/dist/cli/chunk-vjejmwzj.js +2 -0
  86. package/dist/cli/{chunk-bwcyr929.js → chunk-weah9492.js} +1 -1
  87. package/dist/cli/{chunk-mwbs7818.js → chunk-x5ybfyja.js} +1 -1
  88. package/dist/cli/{chunk-1a9b3pv2.js → chunk-xhtzck2v.js} +1 -1
  89. package/dist/cli/{chunk-bpvx5c14.js → chunk-xj3034s1.js} +1 -1
  90. package/dist/cli/chunk-yk3we30f.js +2 -0
  91. package/dist/cli/chunk-yzz6vx5j.js +2 -0
  92. package/dist/cli/{chunk-zye0b9c0.js → chunk-z1fpd4k2.js} +1 -1
  93. package/dist/cli/chunk-zc67sqet.js +6 -0
  94. package/dist/cli/{chunk-nmfcvtxk.js → chunk-zp4efbtb.js} +1 -1
  95. package/dist/cli/{chunk-2pc4wpm4.js → chunk-zqftyn6w.js} +1 -1
  96. package/dist/cli/{chunk-fpecy1fw.js → chunk-zze1pw22.js} +1 -1
  97. package/dist/cli/index.js +3 -3
  98. package/dist/cli/rove.js +1 -1
  99. package/dist/completions/rove.bash +1 -1
  100. package/dist/completions/rove.fish +1 -1
  101. package/dist/completions/rove.zsh +1 -1
  102. package/dist/web/assets/index-7xgjby6F.js +84 -0
  103. package/dist/web/assets/index-CdiGbCTZ.css +1 -0
  104. package/dist/web/assets/{term-mount-BMZoD8Pz.js → term-mount-OMVJnrk8.js} +1 -1
  105. package/dist/web/index.html +2 -2
  106. package/dist/web/relay/index.html +4 -4
  107. package/package.json +3 -3
  108. package/dist/cli/chunk-0fp12xka.js +0 -2
  109. package/dist/cli/chunk-0qxqk8cr.js +0 -2
  110. package/dist/cli/chunk-22w1w79j.js +0 -2
  111. package/dist/cli/chunk-5qhcp29a.js +0 -2
  112. package/dist/cli/chunk-7108m3qy.js +0 -6
  113. package/dist/cli/chunk-96jqrzcp.js +0 -2
  114. package/dist/cli/chunk-9g86yj8d.js +0 -2
  115. package/dist/cli/chunk-abrs0bnr.js +0 -15
  116. package/dist/cli/chunk-bz0zm1kd.js +0 -2
  117. package/dist/cli/chunk-czyyrxmf.js +0 -2
  118. package/dist/cli/chunk-e99pbfjx.js +0 -2
  119. package/dist/cli/chunk-han0d078.js +0 -4
  120. package/dist/cli/chunk-j7k15ems.js +0 -2
  121. package/dist/cli/chunk-jc32k4kz.js +0 -20
  122. package/dist/cli/chunk-q8brjhze.js +0 -6
  123. package/dist/cli/chunk-s889e8z0.js +0 -2
  124. package/dist/cli/chunk-vy5ja578.js +0 -2
  125. package/dist/cli/chunk-wxrf9ca8.js +0 -2
  126. package/dist/cli/chunk-yv86xb1s.js +0 -13
  127. package/dist/web/assets/index-DSdc8V8J.css +0 -1
  128. package/dist/web/assets/index-yhJ5VDGJ.js +0 -84
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import{generateCompletions,isShellKind,mergeSubVerbs,shippedCompletionsPath}from"./chunk-mwbs7818.js";import"./chunk-p9an6jcq.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{existsSync,readFileSync}from"fs";var HELP_WORDS=["--help","-h","help"];function completionUsage(cliName){return[`Usage: ${cliName} completions <bash|zsh|fish> [--path|--install]`,"",`Print a shell completion script for ${cliName}, or locate the copy shipped`,"with this install.","",` ${cliName} completions zsh --path print the shipped script's path`,` ${cliName} completions zsh --install hook it into your shell config`,"","Install:",` zsh source <(${cliName} completions zsh) # one-off, or in ~/.zshrc after compinit`," # with no process start per shell \u2014 what the first-run wizard writes:",` # ${cliName} completions zsh --install`,` bash ${cliName} completions bash --install # appends to ~/.bashrc`,` fish ${cliName} completions fish --install # writes ~/.config/fish/completions/${cliName}.fish`," # the manual way, any shell:",` # ${cliName} completions zsh > ~/.zsh/completions/_${cliName}`," # fpath=(~/.zsh/completions $fpath) # in ~/.zshrc, BEFORE compinit"," # rm -f ~/.zcompdump && exec zsh # rebuild the completion cache",""].join(`
2
+ import{generateCompletions,isShellKind,mergeSubVerbs,shippedCompletionsPath}from"./chunk-x5ybfyja.js";import"./chunk-6jxe4f13.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{existsSync,readFileSync}from"fs";var HELP_WORDS=["--help","-h","help"];function completionUsage(cliName){return[`Usage: ${cliName} completions <bash|zsh|fish> [--path|--install]`,"",`Print a shell completion script for ${cliName}, or locate the copy shipped`,"with this install.","",` ${cliName} completions zsh --path print the shipped script's path`,` ${cliName} completions zsh --install hook it into your shell config`,"","Install:",` zsh source <(${cliName} completions zsh) # one-off, or in ~/.zshrc after compinit`," # with no process start per shell \u2014 what the first-run wizard writes:",` # ${cliName} completions zsh --install`,` bash ${cliName} completions bash --install # appends to ~/.bashrc`,` fish ${cliName} completions fish --install # writes ~/.config/fish/completions/${cliName}.fish`," # the manual way, any shell:",` # ${cliName} completions zsh > ~/.zsh/completions/_${cliName}`," # fpath=(~/.zsh/completions $fpath) # in ~/.zshrc, BEFORE compinit"," # rm -f ~/.zcompdump && exec zsh # rebuild the completion cache",""].join(`
3
3
  `)}async function runCompletionsSubcommand(rest,cliName=ROVE_PRODUCT_NAME,deps={}){let usage=completionUsage(cliName),fail=(message)=>{process.stderr.write(`${cliName} completions: ${message}
4
4
 
5
5
  ${usage}`),process.exit(2)};if(rest.some((arg)=>HELP_WORDS.includes(arg))){process.stdout.write(usage);return}let flags=rest.filter((arg)=>arg.startsWith("-")),shells=rest.filter((arg)=>!arg.startsWith("-")),unknownFlag=flags.find((flag)=>flag!=="--path"&&flag!=="--install");if(unknownFlag)fail(`unknown option "${unknownFlag}"`);if(new Set(flags).size>1)fail("--path and --install are different things; pass one");let shell=shells.length===1?shells[0]:void 0;if(!isShellKind(shell))fail(`unknown shell "${shells.join(" ")}"`);let scriptPath=shippedCompletionsPath(shell,cliName,deps.shippedDir),shipped=existsSync(scriptPath)?scriptPath:null;if(flags[0]==="--path"){if(!shipped)fail(`no pre-generated ${shell} script at ${scriptPath}
6
6
  ${cliName} completions ${shell} # print the script to stdout instead`);process.stdout.write(`${shipped}
7
- `);return}if(flags[0]==="--install"){let[{installCompletions,settleWelcomeInstall},{t}]=await Promise.all([import("./chunk-7qxvdms8.js"),import("./chunk-1a9b3pv2.js")]),completion=installCompletions(shell,deps.home,cliName,shipped);settleWelcomeInstall("completions",shell);let line=completion.installed?"onboarding.appliedCompletions":"onboarding.keptCompletions";process.stdout.write(`${t(line,{path:completion.path})}
8
- `);return}if(shipped){process.stdout.write(readFileSync(shipped,"utf8"));return}let{API_VERBS}=await import("./chunk-5qhcp29a.js");process.stdout.write(generateCompletions(shell,cliName,mergeSubVerbs(API_VERBS)))}export{runCompletionsSubcommand};
7
+ `);return}if(flags[0]==="--install"){let[{installCompletions,settleWelcomeInstall},{t}]=await Promise.all([import("./chunk-3t3fp5h4.js"),import("./chunk-xhtzck2v.js")]),completion=installCompletions(shell,deps.home,cliName,shipped);settleWelcomeInstall("completions",shell);let line=completion.installed?"onboarding.appliedCompletions":"onboarding.keptCompletions";process.stdout.write(`${t(line,{path:completion.path})}
8
+ `);return}if(shipped){process.stdout.write(readFileSync(shipped,"utf8"));return}let{API_VERBS}=await import("./chunk-yzz6vx5j.js");process.stdout.write(generateCompletions(shell,cliName,mergeSubVerbs(API_VERBS)))}export{runCompletionsSubcommand};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{recommendedGlobalInstallCommand}from"./chunk-fphcr46j.js";import{resolveLoginShell}from"./chunk-tn9gtf18.js";function updaterShell(deps={}){let platform=deps.platform??process.platform;if(platform!=="win32")return"sh";return resolveLoginShell({fallback:"/bin/sh",platform,env:deps.env,exists:deps.exists})}function updaterShellFailureHint(deps={}){if((deps.platform??process.platform)!=="win32")return null;return["The update script is POSIX shell. Rove runs it through Git for Windows'","bash \u2014 the same shell every engine and terminal tab launches through.","Install Git for Windows (https://git-scm.com/download/win), or update","by hand:",` ${recommendedGlobalInstallCommand()}`,""].join(`
2
+ import{recommendedGlobalInstallCommand}from"./chunk-s2eezz0a.js";import{resolveLoginShell}from"./chunk-tn9gtf18.js";function updaterShell(deps={}){let platform=deps.platform??process.platform;if(platform!=="win32")return"sh";return resolveLoginShell({fallback:"/bin/sh",platform,env:deps.env,exists:deps.exists})}function updaterShellFailureHint(deps={}){if((deps.platform??process.platform)!=="win32")return null;return["The update script is POSIX shell. Rove runs it through Git for Windows'","bash \u2014 the same shell every engine and terminal tab launches through.","Install Git for Windows (https://git-scm.com/download/win), or update","by hand:",` ${recommendedGlobalInstallCommand()}`,""].join(`
3
3
  `)}
4
4
  export{updaterShell,updaterShellFailureHint};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ensureGlobalRoveHooks}from"./chunk-nhsem71y.js";import{publishRoveTerminalTitle}from"./chunk-3aqhytyy.js";import{LAST_RUN_VERSION_KEY,enforceResetGate}from"./chunk-ggjg0h5c.js";import"./chunk-17e2tgyg.js";import"./chunk-2bgmby1d.js";import"./chunk-psxhek7n.js";import{CURRENT_VERSION,compareSemver}from"./chunk-s2eezz0a.js";import{detectShell}from"./chunk-er4mc36m.js";import"./chunk-x5ybfyja.js";import"./chunk-6jxe4f13.js";import"./chunk-ws2q07kb.js";import"./chunk-5dv7pw3w.js";import"./chunk-2bapg0v2.js";import"./chunk-750rk2xz.js";import"./chunk-w7zv47mp.js";import"./chunk-cw9h73h5.js";import"./chunk-37g0yabr.js";import"./chunk-nw48bskt.js";import"./chunk-k7tdg6kb.js";import"./chunk-1pmzr8kr.js";import"./chunk-e5jxbd98.js";import"./chunk-84q9hv7m.js";import"./chunk-96kvwzj8.js";import"./chunk-07665jz6.js";import"./chunk-40dgv828.js";import"./chunk-zsfyj36g.js";import"./chunk-9gctbddn.js";import"./chunk-mg1cas61.js";import"./chunk-yvg46jh9.js";import{loadStateFile,patchStateFile}from"./chunk-xasg8z9e.js";import"./chunk-8xdhw922.js";import"./chunk-cmp64q4j.js";import"./chunk-j152pk57.js";import"./chunk-c4dfktv2.js";import"./chunk-bdmbevk8.js";import"./chunk-7kysxgbq.js";import"./chunk-g755p68b.js";import"./chunk-tcmzq86w.js";import"./chunk-y8hjgmn0.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-m5nd44st.js";import"./chunk-rxb0hw1e.js";import"./chunk-tw25g9g5.js";import"./chunk-yt15y085.js";import"./chunk-2z2jwetd.js";import"./chunk-8143k3t6.js";import"./chunk-zt7wfnva.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";var WELCOMED_KEY="welcomed";function shouldWelcome(state){if(state[WELCOMED_KEY]===!0)return!1;return typeof state[LAST_RUN_VERSION_KEY]!=="string"}function takeWelcome(){if(!shouldWelcome(loadStateFile()))return null;try{patchStateFile({[WELCOMED_KEY]:!0})}catch{}return{shell:detectShell()}}var WHATS_NEW_SEEN_KEY="app.whatsNewSeenVersion";function whatsNewFromVersion(state,current=CURRENT_VERSION){let stamped=state[WHATS_NEW_SEEN_KEY]??state[LAST_RUN_VERSION_KEY];if(typeof stamped!=="string"||stamped.length===0)return null;return compareSemver(current,stamped)>0?stamped:null}function takeWhatsNew(){let from=whatsNewFromVersion(loadStateFile());try{patchStateFile({[WHATS_NEW_SEEN_KEY]:CURRENT_VERSION})}catch{}return from}async function startTui(){let whatsNewFrom=takeWhatsNew(),welcome=takeWelcome();enforceResetGate(),publishRoveTerminalTitle(),await ensureGlobalRoveHooks();let{loadPluginEngines}=await import("./chunk-vwynmap6.js");loadPluginEngines();let{startSkillStatus}=await import("./chunk-vjejmwzj.js");startSkillStatus();let{startWorkspaceHost}=await import("./chunk-6azsw0ry.js");await startWorkspaceHost({whatsNewFrom,welcome})}export{startTui};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{readOutdatedCache}from"./chunk-498t9sjd.js";import{hookConfigIssues}from"./chunk-633beahm.js";import{tightenPluginPermissions}from"./chunk-xzk96zfj.js";import{engineSkillDir,readSkillCopy}from"./chunk-s00wwj3a.js";import{PREFIX_KEY_ID,defaultKeymapCopy,findBinding}from"./chunk-mkbyb8d1.js";import{AUTO_ROUTING_TIERS}from"./chunk-vn0rnzyt.js";import{reloadPluginEngines}from"./chunk-8hfkcjxm.js";import{ENGINE_ACTIVITY_KINDS}from"./chunk-17e2tgyg.js";import{currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginManifestPath,qualifiedActionId,readPluginManifest,savePluginRegistry,supportsPlatform}from"./chunk-psxhek7n.js";import{machineDaemonSocket}from"./chunk-7108m3qy.js";import{readOnlyGitProcessEnv}from"./chunk-6xppe9bj.js";import{THEME_MODE_PREFERENCES,ensureContrast,inkAtHue,oklchCusp,relativeLuminance,toOklch}from"./chunk-r2ez4ker.js";import{expandHome}from"./chunk-hafbyy9x.js";import{pluginConfigDir,pluginLogPath}from"./chunk-ws2q07kb.js";import{readFirstNonEmptyRepoFile}from"./chunk-catrr0z3.js";import{activityHookAdapters,engineEntry,maybeStartScheduledRun,spawnCapture}from"./chunk-hmfqyvet.js";import{RoveDaemonClient}from"./chunk-84q9hv7m.js";import{recordSpawn}from"./chunk-40dgv828.js";import{tildify}from"./chunk-1feav1w3.js";import{errorMessage,isDiskFull}from"./chunk-9gctbddn.js";import{loadStateFile}from"./chunk-xasg8z9e.js";import{LOCALES,t}from"./chunk-yv86xb1s.js";import{createStateCell}from"./chunk-cmp64q4j.js";import{ROVE_HOOK_VERSION}from"./chunk-c4dfktv2.js";import{pathIdentity,pathSyntax}from"./chunk-pn5ygqn6.js";import{OWNER_ONLY_DIR_MODE,OWNER_ONLY_FILE_MODE}from"./chunk-yt15y085.js";import{promptAttachmentsDir}from"./chunk-8143k3t6.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import{readRoveEnv}from"./chunk-nc46gddg.js";var pluginPageErrorState=createStateCell([],"plugin-page-errors");function pluginPageErrors(){return pluginPageErrorState.get()}var WORKING_BORDER_KEY="appearance.workingBorder",WORKING_BORDERS=["flow","still"],DEFAULT_WORKING_BORDER="flow";function normalizeWorkingBorder(raw){return WORKING_BORDERS.includes(raw)?raw:"flow"}var SCROLLBACK_ROWS_KEY="terminal.scrollbackRows",DEFAULT_SCROLLBACK_ROWS=1000,SCROLLBACK_ROWS_MIN=100,SCROLLBACK_ROWS_MAX=1e5;function normalizeScrollbackRows(value){let n=typeof value==="number"?Math.floor(value):typeof value==="string"?Number.parseInt(value.trim(),10):Number.NaN;if(!Number.isFinite(n))return DEFAULT_SCROLLBACK_ROWS;return Math.min(SCROLLBACK_ROWS_MAX,Math.max(SCROLLBACK_ROWS_MIN,n))}function persistedScrollbackRows(){return normalizeScrollbackRows(loadStateFile()[SCROLLBACK_ROWS_KEY])}function relativeBuckets(absMs){let minutes=Math.floor(absMs/60000),hours=Math.floor(minutes/60);return{minutes,hours,days:Math.floor(hours/24)}}function relativeAge(ms,nowMs=Date.now()){let delta=Math.max(0,nowMs-ms),secs=Math.floor(delta/1000);if(secs<60)return`${secs}s`;let{minutes,hours,days}=relativeBuckets(delta);if(minutes<60)return`${minutes}m`;if(hours<24)return`${hours}h`;return`${days}d`}import{randomBytes}from"crypto";import{existsSync,mkdirSync,writeFileSync}from"fs";import{isAbsolute,join}from"path";var ATTACHMENT_EXTENSION_REGEX=/\.(png|jpe?g|gif|webp|pdf)$/i,PDF_EXTENSION_REGEX=/\.pdf$/i;function removeOuterQuotes(text){if(text.startsWith('"')&&text.endsWith('"')||text.startsWith("'")&&text.endsWith("'"))return text.slice(1,-1);return text}function stripBackslashEscapes(path){let placeholder=`__DOUBLE_BACKSLASH_${randomBytes(8).toString("hex")}__`;return path.replace(/\\\\/g,placeholder).replace(/\\(.)/g,"$1").replaceAll(placeholder,"\\")}function asAttachmentPath(text,exists=existsSync){let cleaned=stripBackslashEscapes(removeOuterQuotes(text.trim()));if(!ATTACHMENT_EXTENSION_REGEX.test(cleaned))return null;if(!isAbsolute(cleaned))return null;return exists(cleaned)?cleaned:null}function asAttachmentPaths(pasted,exists=existsSync){let lines=pasted.split(`
2
+ import{readOutdatedCache}from"./chunk-498t9sjd.js";import{hookConfigIssues}from"./chunk-qwqa75g1.js";import{tightenPluginPermissions}from"./chunk-xzk96zfj.js";import{engineSkillDir,readSkillCopy}from"./chunk-cvcp1aye.js";import{PREFIX_KEY_ID,defaultKeymapCopy,findBinding}from"./chunk-b8hd91nv.js";import{AUTO_ROUTING_TIERS}from"./chunk-t4reqv8m.js";import{reloadPluginEngines}from"./chunk-8hfkcjxm.js";import{ENGINE_ACTIVITY_KINDS}from"./chunk-17e2tgyg.js";import{currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginManifestPath,qualifiedActionId,readPluginManifest,savePluginRegistry,supportsPlatform}from"./chunk-psxhek7n.js";import{machineDaemonSocket}from"./chunk-zc67sqet.js";import{readOnlyGitProcessEnv}from"./chunk-6xppe9bj.js";import{THEME_MODE_PREFERENCES,ensureContrast,inkAtHue,oklchCusp,relativeLuminance,toOklch}from"./chunk-4whghfgg.js";import{expandHome}from"./chunk-t7qj639x.js";import{pluginConfigDir,pluginLogPath}from"./chunk-ws2q07kb.js";import{readFirstNonEmptyRepoFile}from"./chunk-catrr0z3.js";import{activityHookAdapters,engineEntry,maybeStartScheduledRun,spawnCapture}from"./chunk-5dv7pw3w.js";import{RoveDaemonClient}from"./chunk-84q9hv7m.js";import{recordSpawn}from"./chunk-40dgv828.js";import{tildify}from"./chunk-1feav1w3.js";import{errorMessage,isDiskFull}from"./chunk-9gctbddn.js";import{loadStateFile}from"./chunk-xasg8z9e.js";import{LOCALES,t}from"./chunk-8xdhw922.js";import{createStateCell}from"./chunk-cmp64q4j.js";import{ROVE_HOOK_VERSION}from"./chunk-c4dfktv2.js";import{pathIdentity,pathSyntax}from"./chunk-pn5ygqn6.js";import{OWNER_ONLY_DIR_MODE,OWNER_ONLY_FILE_MODE}from"./chunk-yt15y085.js";import{promptAttachmentsDir}from"./chunk-8143k3t6.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import{readRoveEnv}from"./chunk-nc46gddg.js";var pluginPageErrorState=createStateCell([],"plugin-page-errors");function pluginPageErrors(){return pluginPageErrorState.get()}var WORKING_BORDER_KEY="appearance.workingBorder",WORKING_BORDERS=["flow","still"],DEFAULT_WORKING_BORDER="flow";function normalizeWorkingBorder(raw){return WORKING_BORDERS.includes(raw)?raw:"flow"}var SCROLLBACK_ROWS_KEY="terminal.scrollbackRows",DEFAULT_SCROLLBACK_ROWS=1000,SCROLLBACK_ROWS_MIN=100,SCROLLBACK_ROWS_MAX=1e5;function normalizeScrollbackRows(value){let n=typeof value==="number"?Math.floor(value):typeof value==="string"?Number.parseInt(value.trim(),10):Number.NaN;if(!Number.isFinite(n))return DEFAULT_SCROLLBACK_ROWS;return Math.min(SCROLLBACK_ROWS_MAX,Math.max(SCROLLBACK_ROWS_MIN,n))}function persistedScrollbackRows(){return normalizeScrollbackRows(loadStateFile()[SCROLLBACK_ROWS_KEY])}function relativeBuckets(absMs){let minutes=Math.floor(absMs/60000),hours=Math.floor(minutes/60);return{minutes,hours,days:Math.floor(hours/24)}}function relativeAge(ms,nowMs=Date.now()){let delta=Math.max(0,nowMs-ms),secs=Math.floor(delta/1000);if(secs<60)return`${secs}s`;let{minutes,hours,days}=relativeBuckets(delta);if(minutes<60)return`${minutes}m`;if(hours<24)return`${hours}h`;return`${days}d`}import{randomBytes}from"crypto";import{existsSync,mkdirSync,writeFileSync}from"fs";import{isAbsolute,join}from"path";var ATTACHMENT_EXTENSION_REGEX=/\.(png|jpe?g|gif|webp|pdf)$/i,PDF_EXTENSION_REGEX=/\.pdf$/i;function removeOuterQuotes(text){if(text.startsWith('"')&&text.endsWith('"')||text.startsWith("'")&&text.endsWith("'"))return text.slice(1,-1);return text}function stripBackslashEscapes(path){let placeholder=`__DOUBLE_BACKSLASH_${randomBytes(8).toString("hex")}__`;return path.replace(/\\\\/g,placeholder).replace(/\\(.)/g,"$1").replaceAll(placeholder,"\\")}function asAttachmentPath(text,exists=existsSync){let cleaned=stripBackslashEscapes(removeOuterQuotes(text.trim()));if(!ATTACHMENT_EXTENSION_REGEX.test(cleaned))return null;if(!isAbsolute(cleaned))return null;return exists(cleaned)?cleaned:null}function asAttachmentPaths(pasted,exists=existsSync){let lines=pasted.split(`
3
3
  `).map((l)=>l.trim()).filter((l)=>l.length>0);if(lines.length===0)return null;let paths=[];for(let line of lines){let p=asAttachmentPath(line,exists);if(!p)return null;paths.push(p)}return paths}function attachmentLabel(path,index){if(PDF_EXTENSION_REGEX.test(path))return`pdf[${index}]`;return ATTACHMENT_EXTENSION_REGEX.test(path)?`images[${index}]`:`files[${index}]`}function appendAttachmentRefs(prompt,attachments){if(attachments.length===0)return prompt;let refs=attachments.map((p,i)=>`${attachmentLabel(p,i)}: ${p}`).join(`
4
4
  `);return`${prompt}
5
5
 
@@ -7,11 +7,11 @@ ${refs}`}async function capture(cmd){try{let proc=Bun.spawn(cmd,{stdin:"ignore",
7
7
  `)}function issueProjectPrompt(issue,api){return[...promptHeader(issue),"You are working directly in the project checkout \u2014 no dedicated worktree or branch was created. Keep changes reviewable and do not switch branches unless asked.","Before finishing, verify the acceptance criteria implied by the story and summarize what changed plus any verification still needed.",`When the work lands, run: ${api} issue-update --repo . --id ${issue.id} --status done`].join(`
8
8
  `)}function displayProductName(){return ROVE_PRODUCT_NAME.charAt(0).toUpperCase()+ROVE_PRODUCT_NAME.slice(1)}function nextPlaceholderIndex(body){let max=-1;for(let m of body.matchAll(/^(?:images|pdf|files)\[(\d+)\]:/gm)){let n=Number.parseInt(m[1],10);if(n>max)max=n}return max+1}function withImagePlaceholders(body,paths){let next=body.replace(/\s+$/,""),index=nextPlaceholderIndex(body);for(let path of paths){let line=`${attachmentLabel(path,index)}: ${path}`;next=next.length>0?`${next}
9
9
  ${line}`:line,index+=1}return next}var ISSUE_CHAT_PLACEMENTS=["worktree","project"];function issueChatTaskTitle(issue){return`#${issue.id} ${issue.title}`}function issueWorktreePrompt2(issue,api="rove api"){return issueWorktreePrompt(issue,api,displayProductName())}function issueProjectPrompt2(issue,api="rove api"){return issueProjectPrompt(issue,api)}import{spawnSync}from"child_process";import*as fs from"fs";var DEFAULT_BASE_REF="main";function notAGitRepoReason(path){return`This folder isn't a git repository yet, and a task needs a git branch to work in. To fix it, turn ${path} into a repo: git init && git add -A && git commit -m "init" \u2014 then create the task again. (Working in non-git folders is coming soon.)`}function gitMissingReason(){return t("workspace.welcome.gitMissing")}function isBinaryMissing(out){return out.error!==void 0&&out.error.code==="ENOENT"}function git(repo,args){try{recordSpawn("tui.gitSnapshot",["git",...args],repo);let out=spawnSync("git",args,{cwd:repo,encoding:"utf-8",timeout:2000,stdio:["ignore","pipe","ignore"]});return{status:out.status??1,stdout:out.stdout??"",missing:isBinaryMissing(out),spawned:!0}}catch{return{status:1,stdout:"",missing:!1,spawned:!1}}}function noCommitsReason(path){return`This repository has no commits yet, and a task branches off an existing commit. To fix it, make one in ${path}: git add -A && git commit -m "init" \u2014 then create the task again.`}function hasNoCommits(repo){return isUnborn(git(repo,["rev-parse","--verify","HEAD"]))}function validateRepoPath(repo){let trimmed=repo.trim(),early=pathProblem(trimmed);if(early!==void 0)return early;let repoCheck=git(trimmed,["rev-parse","--git-dir"]);return repoProblem(trimmed,repoCheck,()=>hasNoCommits(trimmed))}function pathProblem(trimmed){if(!trimmed)return"repo path is required";let stat;try{stat=fs.statSync(trimmed)}catch{return`path does not exist: ${trimmed}`}return stat.isDirectory()?void 0:`not a directory: ${trimmed}`}function repoProblem(trimmed,repoCheck,unborn){if(repoCheck.missing)return gitMissingReason();if(repoCheck.status!==0)return notAGitRepoReason(trimmed);return unborn()?noCommitsReason(trimmed):null}function isUnborn(out){return out.spawned&&!out.missing&&out.status!==0}function getCurrentBranch(repo){if(!repo)return null;return branchOf(git(repo,["rev-parse","--abbrev-ref","HEAD"]))}function branchOf(out){if(out.status!==0)return null;let name=out.stdout.trim();return!name||name==="HEAD"?null:name}function listLocalBranches(repo){if(!repo)return[];return branchesOf(git(repo,["for-each-ref","--format=%(refname:short)","refs/heads/"]))}function branchesOf(out){if(out.status!==0)return[];return out.stdout.split(`
10
- `).map((s)=>s.trim()).filter(Boolean).sort((a,b)=>{let score=(n)=>n==="main"?0:n==="master"?1:n==="develop"?2:3,sa=score(a),sb=score(b);if(sa!==sb)return sa-sb;return a.localeCompare(b)})}function truncateEnd(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`${points.slice(0,Math.max(0,max-1)).join("")}\u2026`}function truncateEndCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let total=0;for(let ch of s)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let ch of s){let w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out+=ch}return`${out}\u2026`}function truncateStart(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`\u2026${points.slice(points.length-Math.max(0,max-1)).join("")}`}function truncateStartCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let points=[...s],total=0;for(let ch of points)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let i=points.length-1;i>=0;i--){let ch=points[i],w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out=ch+out}return`\u2026${out}`}function reconcileStableRows(prev,next,keyOf,equals,opts={}){if(prev.length===0)return next;let prevByKey=new Map;for(let row of prev)prevByKey.set(keyOf(row),row);let allReused=prev.length===next.length,out=Array(next.length);for(let i=0;i<next.length;i++){let fresh=next[i],old=prevByKey.get(keyOf(fresh));if(old&&equals(old,fresh)&&(!opts.samePosition||prev[i]===old)){if(out[i]=old,allReused&&prev[i]!==old)allReused=!1}else out[i]=fresh,allReused=!1}return allReused?prev:out}function compareNewest(a,b){let byTime=Date.parse(b.createdAt)-Date.parse(a.createdAt);if(Number.isFinite(byTime)&&byTime!==0)return byTime;return String(b.id).localeCompare(String(a.id))}function compareRecent(a,b){let byTime=taskTime(b)-taskTime(a);if(byTime!==0)return byTime;return String(b.id).localeCompare(String(a.id))}var nameCollator=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function compareName(a,b){let byName=nameCollator.compare(a.title.trim(),b.title.trim());if(byName!==0)return byName;return String(a.id).localeCompare(String(b.id))}function taskTime(task){let parsed=Date.parse(task.updatedAt||task.createdAt);return Number.isFinite(parsed)?parsed:0}function repoBasename(repo){return pathSyntax(repo).basename(repo)||repo}function sidebarProjectKey(repo,machineId="local"){let path=pathIdentity(repo.trim())||repo;return machineId==="local"?path:`${machineId}\x00${path}`}function sidebarProjectKeyOfTask(task){return sidebarProjectKey(task.repo,task.origin?.machineId??"local")}function isLocalTask(task){return(task.origin?.machineId??"local")==="local"}function isNoProjectTask(task){return task.kind==="dir"&&(task.scratch===!0||task.noProject===!0)}function sidebarProjectKeyResolver(tasks){let counted=tasks.filter((task)=>{let phase=task.deletion?.phase;if(phase==="queued"||phase==="running")return!1;return!isNoProjectTask(task)}),repoIdOf=new Map;for(let task of counted){if(!task.repoId)continue;let key=sidebarProjectKeyOfTask(task);if(!repoIdOf.has(key))repoIdOf.set(key,task.repoId)}if(repoIdOf.size===0)return sidebarProjectKeyOfTask;let home=new Map;for(let task of counted){let key=sidebarProjectKeyOfTask(task),id=repoIdOf.get(key);if(!id)continue;let rank=isLocalTask(task)?0:1,current=home.get(id);if(!current||rank<current.rank)home.set(id,{key,rank})}return(task)=>{let key=sidebarProjectKeyOfTask(task),id=repoIdOf.get(key);return id&&home.get(id)?.key||key}}function repoIdTail(id){return id.startsWith("root:")?null:id.split("/").slice(-2).join("/")}function sidebarRepoLabel(project,all){let base=repoBasename(project.repo),others=all.filter((other)=>other!==project&&repoBasename(other.repo)===base);if(others.length===0)return base;let id=project.repoId,tail=id?repoIdTail(id):null;if(id&&tail)return others.some((other)=>other.repoId&&other.repoId!==id&&repoIdTail(other.repoId)===tail)?id:tail;return sidebarProjectLabel(project.repo,others.map((other)=>other.repo))}function sidebarProjectLabel(repo,repos,hostLabel){let base=repoBasename(repo),host=hostLabel??"",collisions=repos.map((entry)=>typeof entry==="string"?{repo:entry}:entry).filter((entry)=>entry.repo!==repo||(entry.hostLabel??"")!==host).filter((entry)=>repoBasename(entry.repo)===base);if(collisions.length===0)return base;if(collisions.some((entry)=>(entry.hostLabel??"")===host)){let tail=pathTail(repo);return collisions.some((entry)=>(entry.hostLabel??"")!==host&&pathTail(entry.repo)===tail)&&host?`${host}:${tail}`:tail}return host?`${host}:${base}`:base}function pathTail(repo){let syntax=pathSyntax(repo);return syntax.normalize(repo).split(syntax.sep).filter(Boolean).slice(-2).join("/")}var EVENT_FEED_LIMIT=12,FRAGMENT_MAX=40;function str(value){return typeof value==="string"?value:""}function detailFragment(event){let detail=event.detail;if(!detail)return"";let{tool,compact,subagent}=detail,fragment=str(tool?.name)||str(compact?.trigger)||str(subagent?.type)||str(detail.note);return truncateEnd(fragment,FRAGMENT_MAX)}function eventRows(events,nowMs,limit=EVENT_FEED_LIMIT){return events.slice(-limit).reverse().map((event,index)=>{let tail=[detailFragment(event),str(event.vendor)].filter((part)=>part.length>0);return{key:`${event.at}:${index}`,age:relativeAge(event.at,nowMs),kind:event.kind,tail:tail.join(" \xB7 ")}})}function fuzzyMatch(query,haystack){if(!query)return!0;let q=query.toLowerCase(),h=haystack.toLowerCase(),qi=0;for(let hi=0;hi<h.length&&qi<q.length;hi++)if(h.charCodeAt(hi)===q.charCodeAt(qi))qi++;return qi===q.length}function groupBindings(keymap){let grouped=[],index=new Map;for(let b of keymap){let rows=index.get(b.category);if(!rows)rows=[],index.set(b.category,rows),grouped.push({category:b.category,rows});rows.push(b)}return grouped}function capOf(row){return row.hint?.keys??row.keys[0]}function legendCap(id){let row=findBinding(id);if(!row)return null;let cap=capOf(row);return cap&&cap.length>0?cap:null}function directCap(row){if(row.keys.length>0)return row.hint?.keys??row.keys[0]??null;return row.prefixKeys?.length?null:row.hint?.keys??null}function availableOn(row,surface){if(row.scope==="global")return!0;if(surface===null)return!1;if(row.scope===surface)return!0;return surface==="terminal"&&row.scope==="workspace"}function grammarHelpSections(keymap,surface,prefixKey,reachability){let here=[],direct=[],prefix=[],other=new Map;for(let binding of keymap){let cap=directCap(binding),staticallyAvailable=availableOn(binding,surface),directAvailable=reachability?reachability.direct.has(binding.id):staticallyAvailable,prefixAvailable=reachability?reachability.prefix.has(binding.id):staticallyAvailable;if(cap){let row={binding,primary:cap,aliases:binding.keys.filter((key)=>key!==cap)};if(directAvailable&&(staticallyAvailable||binding.presentation==="onePress"))if(binding.presentation==="onePress")direct.push(row);else here.push(row);else if(!staticallyAvailable&&binding.scope!=="global"){let rows=other.get(binding.scope);if(rows)rows.push(row);else other.set(binding.scope,[row])}}if(prefixKey&&prefixAvailable&&binding.prefixKeys?.length)prefix.push({binding,primary:`${prefixKey} + ${binding.prefixKeys[0]}`,aliases:binding.prefixKeys.slice(1).map((key)=>`${prefixKey} + ${key}`)})}let sections=[];if(here.length)sections.push({kind:"here",scope:surface??void 0,rows:here});if(direct.length)sections.push({kind:"direct",rows:direct});if(prefix.length)sections.push({kind:"prefix",rows:prefix});for(let[scope,rows]of other)sections.push({kind:"other",scope,rows});return sections}var SCOPE_CATEGORY={global:"Global",sidebar:"Sidebar",workspace:"Workspace",files:"Files",inbox:"Inbox",terminal:"Terminal"};function scopeCategory(scope){return scope?SCOPE_CATEGORY[scope]:"Global"}function guideCategory(action){if(["kanban.open","automations.open","workItems.open"].includes(action))return"Views";if(action.startsWith("focus."))return"Navigation";if(action.startsWith("inbox.")||action.startsWith("attention."))return"Attention";if(action.startsWith("chat.tab.")||action.startsWith("chat.session."))return"Sessions";if(action.startsWith("chat.fork.")||action.startsWith("task."))return"Tasks";if(action.startsWith("settings.")||action==="workspace.zenToggle")return"Tools";return findBinding(action)?.category??"Global"}function matchesHelpAction(query,name,chord){let trimmed=query.trim();return fuzzyMatch(trimmed,name)||fuzzyMatch(trimmed,chord)}var PREFIX_TAP_PRESENTATION_KEY="hints.keyboard.prefixTapPresentation",PREFIX_TAP_PRESENTATIONS=["local","guide"],DEFAULT_PREFIX_TAP_PRESENTATION="local";function normalizePrefixTapPresentation(raw){return raw==="guide"?"guide":"local"}var SPLIT_STYLE_KEY="appearance.splitStyle",SPLIT_STYLES=["box","line","rail","rule"];function normalizeSplitStyle(value){return SPLIT_STYLES.includes(value)?value:"line"}var TASK_COLORS_KEY="appearance.taskColors",TASK_COLORS=["on","off"],DEFAULT_TASK_COLORS="on";function normalizeTaskColors(raw){return TASK_COLORS.includes(raw)?raw:"on"}var DARK_HUES=[[0,93],[139,157],[201,359]],LIGHT_HUES=[[195,330]],SEMANTIC_GUARD_DEG=25,GUARD_SLACK_DEG=2,GREY_CHROMA=0.03,GREY_ACCENT_CHROMA_SHARE=0.7,MIN_CHROMA=0.05,MAX_CHROMA=0.21,DARK_MIN_LIGHTNESS=0.65,DARK_MAX_LIGHTNESS=0.88,MIN_CONTRAST=3;function hueDistance(a,b){let d=Math.abs(a-b)%360;return Math.min(d,360-d)}function hueOf(color){if(color.intent!=="rgb")return;let{c,h}=toOklch(color);if(c<GREY_CHROMA)return;return(h*180/Math.PI%360+360)%360}function hash(text){let h=5381;for(let i=0;i<text.length;i++)h=((h<<5)+h^text.charCodeAt(i))>>>0;return h=Math.imul(h^h>>>16,2246822507),h=Math.imul(h^h>>>13,3266489909),(h^h>>>16)>>>0}function taskHue(taskId,arcs,semantic){let all=arcs.flatMap(([from,to])=>Array.from({length:to-from+1},(_,i)=>from+i)),clear=all.filter((h)=>semantic.every((s)=>hueDistance(h,s)>=SEMANTIC_GUARD_DEG+GUARD_SLACK_DEG)),hues=clear.length>0?clear:all;return hues[hash(taskId)%hues.length]??0}function computeTaskColor(taskId,theme){let accent=theme.accent,[r,g,b]=theme.background.toInts(),light=relativeLuminance([r,g,b])>0.5,semantic=[theme.success,theme.warning,theme.error].map(hueOf).filter((h)=>h!==void 0),hue=taskHue(taskId,light?LIGHT_HUES:DARK_HUES,semantic),target=oklchCusp(hue),accentHue=hueOf(accent),lightness=target.l,share=GREY_ACCENT_CHROMA_SHARE;if(accentHue!==void 0){let{l,c}=toOklch(accent),source=oklchCusp(accentHue);lightness=l<=source.l?l/source.l*target.l:target.l+(l-source.l)/(1-source.l)*(1-target.l),share=c/source.c}let chroma=Math.min(MAX_CHROMA,Math.max(MIN_CHROMA,share*target.c));if(!light)lightness=Math.min(DARK_MAX_LIGHTNESS,Math.max(DARK_MIN_LIGHTNESS,lightness));return ensureContrast(inkAtHue(hue,lightness,chroma,accent.toInts()[3]),theme.background,MIN_CONTRAST)}var cache=new Map,CACHE_LIMIT=256;function taskColor(taskId,theme){if(theme.accent.intent!=="rgb")return theme.accent;let key=[taskId,theme.accent,theme.background,theme.success,theme.warning,theme.error].map((part)=>typeof part==="string"?part:part.toInts().join()).join("|"),hit=cache.get(key);if(hit)return hit;let color=computeTaskColor(taskId,theme);if(cache.size>=CACHE_LIMIT)cache.clear();return cache.set(key,color),color}import{spawnSync as spawnSync2}from"child_process";function planSelfRefresh(inputs){if(inputs.staleInstall)return{kind:"unavailable",reason:"install-gone"};let stale=!!inputs.daemonVersion&&inputs.daemonVersion!==inputs.clientVersion;if(inputs.daemonRestarting)return{kind:"refresh",restartDaemon:!1};if(stale)return{kind:"refresh",restartDaemon:!0};return{kind:"current"}}function selfRelaunchArgv(proc){return[proc.execPath,...proc.execArgv,...proc.argv.slice(1)]}function relaunchSelf(opts){try{opts.renderer?.destroy()}catch(err){console.error("Rove: renderer.destroy() failed during refresh:",err)}let argv=selfRelaunchArgv(opts.proc??process),[command,...args]=argv;if(opts.notice)process.stdout.write(`
10
+ `).map((s)=>s.trim()).filter(Boolean).sort((a,b)=>{let score=(n)=>n==="main"?0:n==="master"?1:n==="develop"?2:3,sa=score(a),sb=score(b);if(sa!==sb)return sa-sb;return a.localeCompare(b)})}function truncateEnd(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`${points.slice(0,Math.max(0,max-1)).join("")}\u2026`}function truncateEndCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let total=0;for(let ch of s)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let ch of s){let w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out+=ch}return`${out}\u2026`}function truncateStart(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`\u2026${points.slice(points.length-Math.max(0,max-1)).join("")}`}function truncateStartCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let points=[...s],total=0;for(let ch of points)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let i=points.length-1;i>=0;i--){let ch=points[i],w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out=ch+out}return`\u2026${out}`}function reconcileStableRows(prev,next,keyOf,equals,opts={}){if(prev.length===0)return next;let prevByKey=new Map;for(let row of prev)prevByKey.set(keyOf(row),row);let allReused=prev.length===next.length,out=Array(next.length);for(let i=0;i<next.length;i++){let fresh=next[i],old=prevByKey.get(keyOf(fresh));if(old&&equals(old,fresh)&&(!opts.samePosition||prev[i]===old)){if(out[i]=old,allReused&&prev[i]!==old)allReused=!1}else out[i]=fresh,allReused=!1}return allReused?prev:out}function compareNewest(a,b){let byTime=Date.parse(b.createdAt)-Date.parse(a.createdAt);if(Number.isFinite(byTime)&&byTime!==0)return byTime;return String(b.id).localeCompare(String(a.id))}function compareRecent(a,b){let byTime=taskTime(b)-taskTime(a);if(byTime!==0)return byTime;return String(b.id).localeCompare(String(a.id))}var nameCollator=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function compareName(a,b){let byName=nameCollator.compare(a.title.trim(),b.title.trim());if(byName!==0)return byName;return String(a.id).localeCompare(String(b.id))}function taskTime(task){let parsed=Date.parse(task.updatedAt||task.createdAt);return Number.isFinite(parsed)?parsed:0}function repoBasename(repo){return pathSyntax(repo).basename(repo)||repo}function sidebarProjectKey(repo,machineId="local"){let path=pathIdentity(repo.trim())||repo;return machineId==="local"?path:`${machineId}\x00${path}`}function sidebarProjectKeyOfTask(task){return sidebarProjectKey(task.repo,task.origin?.machineId??"local")}function isLocalTask(task){return(task.origin?.machineId??"local")==="local"}function isNoProjectTask(task){return task.kind==="dir"&&(task.scratch===!0||task.noProject===!0)}function sidebarProjectKeyResolver(tasks){let counted=tasks.filter((task)=>{let phase=task.deletion?.phase;if(phase==="queued"||phase==="running")return!1;return!isNoProjectTask(task)}),repoIdOf=new Map;for(let task of counted){if(!task.repoId)continue;let key=sidebarProjectKeyOfTask(task);if(!repoIdOf.has(key))repoIdOf.set(key,task.repoId)}if(repoIdOf.size===0)return sidebarProjectKeyOfTask;let home=new Map;for(let task of counted){let key=sidebarProjectKeyOfTask(task),id=repoIdOf.get(key);if(!id)continue;let rank=isLocalTask(task)?0:1,current=home.get(id);if(!current||rank<current.rank)home.set(id,{key,rank})}return(task)=>{let key=sidebarProjectKeyOfTask(task),id=repoIdOf.get(key);return id&&home.get(id)?.key||key}}function repoIdTail(id){return id.startsWith("root:")?null:id.split("/").slice(-2).join("/")}function sidebarRepoLabel(project,all){let base=repoBasename(project.repo),others=all.filter((other)=>other!==project&&repoBasename(other.repo)===base);if(others.length===0)return base;let id=project.repoId,tail=id?repoIdTail(id):null;if(id&&tail)return others.some((other)=>other.repoId&&other.repoId!==id&&repoIdTail(other.repoId)===tail)?id:tail;return sidebarProjectLabel(project.repo,others.map((other)=>other.repo))}function sidebarProjectLabel(repo,repos,hostLabel){let base=repoBasename(repo),host=hostLabel??"",collisions=repos.map((entry)=>typeof entry==="string"?{repo:entry}:entry).filter((entry)=>entry.repo!==repo||(entry.hostLabel??"")!==host).filter((entry)=>repoBasename(entry.repo)===base);if(collisions.length===0)return base;if(collisions.some((entry)=>(entry.hostLabel??"")===host)){let tail=pathTail(repo);return collisions.some((entry)=>(entry.hostLabel??"")!==host&&pathTail(entry.repo)===tail)&&host?`${host}:${tail}`:tail}return host?`${host}:${base}`:base}function pathTail(repo){let syntax=pathSyntax(repo);return syntax.normalize(repo).split(syntax.sep).filter(Boolean).slice(-2).join("/")}var EVENT_FEED_LIMIT=12,FRAGMENT_MAX=40;function str(value){return typeof value==="string"?value:""}function detailFragment(event){let detail=event.detail;if(!detail)return"";let{tool,compact,subagent}=detail,fragment=str(tool?.name)||str(compact?.trigger)||str(subagent?.type)||str(detail.note);return truncateEnd(fragment,FRAGMENT_MAX)}function eventRows(events,nowMs,limit=EVENT_FEED_LIMIT){return events.slice(-limit).reverse().map((event,index)=>{let tail=[detailFragment(event),str(event.vendor)].filter((part)=>part.length>0);return{key:`${event.at}:${index}`,age:relativeAge(event.at,nowMs),kind:event.kind,tail:tail.join(" \xB7 ")}})}function fuzzyMatch(query,haystack){if(!query)return!0;let q=query.toLowerCase(),h=haystack.toLowerCase(),qi=0;for(let hi=0;hi<h.length&&qi<q.length;hi++)if(h.charCodeAt(hi)===q.charCodeAt(qi))qi++;return qi===q.length}function groupBindings(keymap){let grouped=[],index=new Map;for(let b of keymap){let rows=index.get(b.category);if(!rows)rows=[],index.set(b.category,rows),grouped.push({category:b.category,rows});rows.push(b)}return grouped}function capOf(row){return row.hint?.keys??row.keys[0]}function legendCap(id){let row=findBinding(id);if(!row)return null;let cap=capOf(row);return cap&&cap.length>0?cap:null}function directCap(row){if(row.keys.length>0)return row.hint?.keys??row.keys[0]??null;return row.prefixKeys?.length?null:row.hint?.keys??null}function availableOn(row,surface){if(row.scope==="global")return!0;if(surface===null)return!1;if(row.scope===surface)return!0;return surface==="terminal"&&row.scope==="workspace"}function grammarHelpSections(keymap,surface,prefixKey,reachability){let here=[],direct=[],prefix=[],other=new Map;for(let binding of keymap){let cap=directCap(binding),staticallyAvailable=availableOn(binding,surface),directAvailable=reachability?reachability.direct.has(binding.id):staticallyAvailable,prefixAvailable=reachability?reachability.prefix.has(binding.id):staticallyAvailable;if(cap){let row={binding,primary:cap,aliases:binding.keys.filter((key)=>key!==cap)};if(directAvailable&&(staticallyAvailable||binding.presentation==="onePress"))if(binding.presentation==="onePress")direct.push(row);else here.push(row);else if(!staticallyAvailable&&binding.scope!=="global"){let rows=other.get(binding.scope);if(rows)rows.push(row);else other.set(binding.scope,[row])}}if(prefixKey&&prefixAvailable&&binding.prefixKeys?.length)prefix.push({binding,primary:`${prefixKey} + ${binding.prefixKeys[0]}`,aliases:binding.prefixKeys.slice(1).map((key)=>`${prefixKey} + ${key}`)})}let sections=[];if(here.length)sections.push({kind:"here",scope:surface??void 0,rows:here});if(direct.length)sections.push({kind:"direct",rows:direct});if(prefix.length)sections.push({kind:"prefix",rows:prefix});for(let[scope,rows]of other)sections.push({kind:"other",scope,rows});return sections}var SCOPE_CATEGORY={global:"Global",sidebar:"Sidebar",workspace:"Workspace",files:"Files",inbox:"Inbox",terminal:"Terminal"};function scopeCategory(scope){return scope?SCOPE_CATEGORY[scope]:"Global"}function guideCategory(action){if(["kanban.open","automations.open","workItems.open"].includes(action))return"Views";if(action.startsWith("focus."))return"Navigation";if(action.startsWith("inbox.")||action.startsWith("attention."))return"Attention";if(action.startsWith("chat.tab.")||action.startsWith("chat.session."))return"Sessions";if(action.startsWith("chat.fork.")||action.startsWith("task."))return"Tasks";if(action.startsWith("settings.")||action==="workspace.filesToggle")return"Tools";return findBinding(action)?.category??"Global"}function matchesHelpAction(query,name,chord){let trimmed=query.trim();return fuzzyMatch(trimmed,name)||fuzzyMatch(trimmed,chord)}var PREFIX_TAP_PRESENTATION_KEY="hints.keyboard.prefixTapPresentation",PREFIX_TAP_PRESENTATIONS=["local","guide"],DEFAULT_PREFIX_TAP_PRESENTATION="local";function normalizePrefixTapPresentation(raw){return raw==="guide"?"guide":"local"}var SPLIT_STYLE_KEY="appearance.splitStyle",SPLIT_STYLES=["box","line","rail","rule"];function normalizeSplitStyle(value){return SPLIT_STYLES.includes(value)?value:"line"}var TASK_COLORS_KEY="appearance.taskColors",TASK_COLORS=["on","off"],DEFAULT_TASK_COLORS="on";function normalizeTaskColors(raw){return TASK_COLORS.includes(raw)?raw:"on"}var DARK_HUES=[[0,93],[139,157],[201,359]],LIGHT_HUES=[[195,330]],SEMANTIC_GUARD_DEG=25,GUARD_SLACK_DEG=2,GREY_CHROMA=0.03,GREY_ACCENT_CHROMA_SHARE=0.7,MIN_CHROMA=0.05,MAX_CHROMA=0.21,DARK_MIN_LIGHTNESS=0.65,DARK_MAX_LIGHTNESS=0.88,MIN_CONTRAST=3;function hueDistance(a,b){let d=Math.abs(a-b)%360;return Math.min(d,360-d)}function hueOf(color){if(color.intent!=="rgb")return;let{c,h}=toOklch(color);if(c<GREY_CHROMA)return;return(h*180/Math.PI%360+360)%360}function hash(text){let h=5381;for(let i=0;i<text.length;i++)h=((h<<5)+h^text.charCodeAt(i))>>>0;return h=Math.imul(h^h>>>16,2246822507),h=Math.imul(h^h>>>13,3266489909),(h^h>>>16)>>>0}function taskHue(taskId,arcs,semantic){let all=arcs.flatMap(([from,to])=>Array.from({length:to-from+1},(_,i)=>from+i)),clear=all.filter((h)=>semantic.every((s)=>hueDistance(h,s)>=SEMANTIC_GUARD_DEG+GUARD_SLACK_DEG)),hues=clear.length>0?clear:all;return hues[hash(taskId)%hues.length]??0}function computeTaskColor(taskId,theme){let accent=theme.accent,[r,g,b]=theme.background.toInts(),light=relativeLuminance([r,g,b])>0.5,semantic=[theme.success,theme.warning,theme.error].map(hueOf).filter((h)=>h!==void 0),hue=taskHue(taskId,light?LIGHT_HUES:DARK_HUES,semantic),target=oklchCusp(hue),accentHue=hueOf(accent),lightness=target.l,share=GREY_ACCENT_CHROMA_SHARE;if(accentHue!==void 0){let{l,c}=toOklch(accent),source=oklchCusp(accentHue);lightness=l<=source.l?l/source.l*target.l:target.l+(l-source.l)/(1-source.l)*(1-target.l),share=c/source.c}let chroma=Math.min(MAX_CHROMA,Math.max(MIN_CHROMA,share*target.c));if(!light)lightness=Math.min(DARK_MAX_LIGHTNESS,Math.max(DARK_MIN_LIGHTNESS,lightness));return ensureContrast(inkAtHue(hue,lightness,chroma,accent.toInts()[3]),theme.background,MIN_CONTRAST)}var cache=new Map,CACHE_LIMIT=256;function taskColor(taskId,theme){if(theme.accent.intent!=="rgb")return theme.accent;let key=[taskId,theme.accent,theme.background,theme.success,theme.warning,theme.error].map((part)=>typeof part==="string"?part:part.toInts().join()).join("|"),hit=cache.get(key);if(hit)return hit;let color=computeTaskColor(taskId,theme);if(cache.size>=CACHE_LIMIT)cache.clear();return cache.set(key,color),color}import{spawnSync as spawnSync2}from"child_process";function planSelfRefresh(inputs){if(inputs.staleInstall)return{kind:"unavailable",reason:"install-gone"};let stale=!!inputs.daemonVersion&&inputs.daemonVersion!==inputs.clientVersion;if(inputs.daemonRestarting)return{kind:"refresh",restartDaemon:!1};if(stale)return{kind:"refresh",restartDaemon:!0};return{kind:"current"}}function selfRelaunchArgv(proc){return[proc.execPath,...proc.execArgv,...proc.argv.slice(1)]}function relaunchSelf(opts){try{opts.renderer?.destroy()}catch(err){console.error("Rove: renderer.destroy() failed during refresh:",err)}let argv=selfRelaunchArgv(opts.proc??process),[command,...args]=argv;if(opts.notice)process.stdout.write(`
11
11
  ${opts.notice}
12
12
  `);let execve=process.execve;if(execve)try{execve(command,argv,opts.env??process.env)}catch{}let result=spawnSync2(command,args,{stdio:"inherit",env:opts.env??process.env});if(result.error)process.stderr.write(`
13
13
  rove: could not relaunch (${result.error.message}). Start rove again from your shell; run rove doctor if it still fails.
14
- `),process.exit(1);process.exit(result.status??0)}var GLYPH_SET_KEY="appearance.glyphSet",GLYPH_SET_NAMES=["braille","starburst","ascii"],DEFAULT_GLYPH_SET="braille";function normalizeGlyphSet(raw){return GLYPH_SET_NAMES.includes(raw)?raw:"braille"}var COLORBLIND_KEY="appearance.colorblind",COLORBLIND_MODES=["off","on"],DEFAULT_COLORBLIND="off";function normalizeColorblind(raw){return COLORBLIND_MODES.includes(raw)?raw:"off"}var USAGE_SHOW_KEY="usage.show",USAGE_SHOWS=["used","left"];function normalizeUsageShow(raw){return raw==="left"?"left":"used"}function shownPercent(usedPercent,show){return show==="left"?100-Math.min(100,Math.max(0,usedPercent)):usedPercent}var RUNNING_TITLE_KEY="appearance.runningTitle",RUNNING_TITLES=["shimmer","still"],DEFAULT_RUNNING_TITLE="shimmer";function normalizeRunningTitle(raw){return RUNNING_TITLES.includes(raw)?raw:"shimmer"}var APPEARANCE_SETTINGS=["theme","themeMode","transparent","focusAccent","splitStyle","railFold","workingBorder","taskColors","glyphSet","colorblind","runningTitle"];function appearanceChoices(setting,themes){switch(setting){case"theme":return themes.map((value)=>({kind:setting,value}));case"themeMode":return THEME_MODE_PREFERENCES.map((value)=>({kind:setting,value}));case"transparent":return[!1,!0].map((value)=>({kind:setting,value}));case"focusAccent":return["primary","success","info"].map((value)=>({kind:setting,value}));case"splitStyle":return SPLIT_STYLES.map((value)=>({kind:setting,value}));case"railFold":return["glyphs","initials","hairline"].map((value)=>({kind:setting,value}));case"workingBorder":return WORKING_BORDERS.map((value)=>({kind:setting,value}));case"taskColors":return TASK_COLORS.map((value)=>({kind:setting,value}));case"glyphSet":return GLYPH_SET_NAMES.map((value)=>({kind:setting,value}));case"colorblind":return COLORBLIND_MODES.map((value)=>({kind:setting,value}));case"runningTitle":return RUNNING_TITLES.map((value)=>({kind:setting,value}))}}function applyAppearanceChoice(current,choice){switch(choice.kind){case"theme":return{...current,themeName:choice.value};case"themeMode":return{...current,themeMode:choice.value};case"transparent":return{...current,transparentBackground:choice.value};case"focusAccent":return{...current,focusAccent:choice.value};case"splitStyle":return{...current,splitStyle:choice.value};case"railFold":return{...current,railFoldStyle:choice.value};case"workingBorder":return{...current,workingBorder:choice.value};case"taskColors":return{...current,taskColors:choice.value};case"glyphSet":return{...current,glyphSet:choice.value};case"colorblind":return{...current,colorblind:choice.value};case"runningTitle":return{...current,runningTitle:choice.value}}}function currentAppearanceChoice(current,setting){switch(setting){case"theme":return{kind:setting,value:current.themeName};case"themeMode":return{kind:setting,value:current.themeMode};case"transparent":return{kind:setting,value:current.transparentBackground};case"focusAccent":return{kind:setting,value:current.focusAccent};case"splitStyle":return{kind:setting,value:current.splitStyle};case"railFold":return{kind:setting,value:current.railFoldStyle};case"workingBorder":return{kind:setting,value:current.workingBorder};case"taskColors":return{kind:setting,value:current.taskColors};case"glyphSet":return{kind:setting,value:current.glyphSet};case"colorblind":return{kind:setting,value:current.colorblind};case"runningTitle":return{kind:setting,value:current.runningTitle}}}var TAB_STRIP_MODE_KEY="chat.tabStrip.mode",TAB_STRIP_MODES=["always","multipleOnly","never"];var TAB_STRIP_HIDE_SINGLE_KEY="chat.tabStrip.hideSingle";function resolveTabStripMode(stored,legacyHideSingle){if(typeof stored==="string"&&TAB_STRIP_MODES.includes(stored))return stored;if(legacyHideSingle===!0)return"multipleOnly";if(legacyHideSingle===!1)return"always";return"never"}function tabStripVisible(mode,tabCount){if(mode==="never")return!1;if(mode==="multipleOnly")return tabCount>=2;return!0}import{spawn}from"child_process";import{existsSync as existsSync2}from"fs";import{basename,delimiter,isAbsolute as isAbsolute2,join as join2}from"path";var CLI_CANDIDATES=[{id:"code",label:"VS Code",command:"code"},{id:"cursor",label:"Cursor",command:"cursor"},{id:"windsurf",label:"Windsurf",command:"windsurf"},{id:"zed",label:"Zed",command:"zed"}],MAC_APP_CANDIDATES=[{id:"vscode.app",label:"VS Code",appName:"Visual Studio Code",paths:["/Applications/Visual Studio Code.app"]},{id:"cursor.app",label:"Cursor",appName:"Cursor",paths:["/Applications/Cursor.app","/System/Applications/Cursor.app"]},{id:"windsurf.app",label:"Windsurf",appName:"Windsurf",paths:["/Applications/Windsurf.app"]},{id:"zed.app",label:"Zed",appName:"Zed",paths:["/Applications/Zed.app"]}];function executableOnPath(command,env,exists){if(isAbsolute2(command))return exists(command);let pathEnv=env.PATH??"";for(let dir of pathEnv.split(delimiter)){if(!dir)continue;if(exists(join2(dir,command)))return!0}return!1}function labelForOverride(command){let name=basename(command);if(name==="code")return"VS Code";if(name==="cursor")return"Cursor";if(name==="windsurf")return"Windsurf";if(name==="zed")return"Zed";return name||command}function detectWorktreeOpener(deps={}){let env=deps.env??process.env,platform=deps.platform??process.platform,exists=deps.exists??existsSync2,override=readRoveEnv("OPEN_EDITOR",env)?.trim();if(override)return{id:"env",label:labelForOverride(override),command:override,args:[]};for(let c of CLI_CANDIDATES)if(executableOnPath(c.command,env,exists))return{id:c.id,label:c.label,command:c.command,args:[]};if(platform==="darwin"&&executableOnPath("open",env,exists)){for(let app of MAC_APP_CANDIDATES)if(app.paths.some((path)=>exists(path)))return{id:app.id,label:app.label,command:"open",args:["-a",app.appName]};return{id:"mac-open",label:"Finder",command:"open",args:[]}}if(platform==="linux"&&executableOnPath("xdg-open",env,exists))return{id:"xdg-open",label:"Open",command:"xdg-open",args:[]};return null}function buildOpenWorktreeCommand(worktreePath,opener){return[opener.command,[...opener.args,worktreePath]]}function openWorktree(worktreePath,opener,deps={}){if(!worktreePath)return!1;let spawnFn=deps.spawn??spawn,[command,args]=buildOpenWorktreeCommand(worktreePath,opener);try{let child=spawnFn(command,args,{detached:!0,stdio:"ignore"});if(child.pid===void 0)return!1;return child.unref(),!0}catch{return!1}}var changeListeners=new Set;function subscribeBackgroundPolls(listener){return changeListeners.add(listener),()=>{changeListeners.delete(listener)}}function notifyChanged(){for(let listener of changeListeners)try{listener()}catch{}}function createBackgroundPoller(cfg){let entries=new Map,equals=cfg.equals??((a,b)=>a===b);function entryFor(key){let entry=entries.get(key);if(!entry){let current=cfg.initial;entry={read:()=>current,write:(next)=>{if(equals(current,next))return;current=next,notifyChanged()},inFlight:!1,nextAllowedAt:0},entries.set(key,entry)}return entry}return{read(key){if(!key)return cfg.initial;return entryFor(key).read()},poll(key){if(!key)return;let entry=entryFor(key);maybeStartScheduledRun(entry,cfg,(signal)=>cfg.run(key,signal),(value)=>entry.write(value))},reset(){entries.clear()}}}var GIT_TIMEOUT_MS=5000,DEFAULT_PR_PROMPT_TEMPLATE=`The user likes the current state of the code.
14
+ `),process.exit(1);process.exit(result.status??0)}var COLORBLIND_KEY="appearance.colorblind",COLORBLIND_MODES=["off","on"],DEFAULT_COLORBLIND="off";function normalizeColorblind(raw){return COLORBLIND_MODES.includes(raw)?raw:"off"}var USAGE_SHOW_KEY="usage.show",USAGE_SHOWS=["used","left"];function normalizeUsageShow(raw){return raw==="left"?"left":"used"}function shownPercent(usedPercent,show){return show==="left"?100-Math.min(100,Math.max(0,usedPercent)):usedPercent}var GLYPH_SET_KEY="appearance.glyphSet",GLYPH_SET_NAMES=["braille","starburst","ascii"],DEFAULT_GLYPH_SET="braille";function normalizeGlyphSet(raw){return GLYPH_SET_NAMES.includes(raw)?raw:"braille"}var RUNNING_TITLE_KEY="appearance.runningTitle",RUNNING_TITLES=["shimmer","still"],DEFAULT_RUNNING_TITLE="shimmer";function normalizeRunningTitle(raw){return RUNNING_TITLES.includes(raw)?raw:"shimmer"}var APPEARANCE_SETTINGS=["theme","themeMode","transparent","focusAccent","splitStyle","railFold","workingBorder","taskColors","glyphSet","colorblind","runningTitle"];function appearanceChoices(setting,themes){switch(setting){case"theme":return themes.map((value)=>({kind:setting,value}));case"themeMode":return THEME_MODE_PREFERENCES.map((value)=>({kind:setting,value}));case"transparent":return[!1,!0].map((value)=>({kind:setting,value}));case"focusAccent":return["primary","success","info"].map((value)=>({kind:setting,value}));case"splitStyle":return SPLIT_STYLES.map((value)=>({kind:setting,value}));case"railFold":return["glyphs","initials","hairline"].map((value)=>({kind:setting,value}));case"workingBorder":return WORKING_BORDERS.map((value)=>({kind:setting,value}));case"taskColors":return TASK_COLORS.map((value)=>({kind:setting,value}));case"glyphSet":return GLYPH_SET_NAMES.map((value)=>({kind:setting,value}));case"colorblind":return COLORBLIND_MODES.map((value)=>({kind:setting,value}));case"runningTitle":return RUNNING_TITLES.map((value)=>({kind:setting,value}))}}function applyAppearanceChoice(current,choice){switch(choice.kind){case"theme":return{...current,themeName:choice.value};case"themeMode":return{...current,themeMode:choice.value};case"transparent":return{...current,transparentBackground:choice.value};case"focusAccent":return{...current,focusAccent:choice.value};case"splitStyle":return{...current,splitStyle:choice.value};case"railFold":return{...current,railFoldStyle:choice.value};case"workingBorder":return{...current,workingBorder:choice.value};case"taskColors":return{...current,taskColors:choice.value};case"glyphSet":return{...current,glyphSet:choice.value};case"colorblind":return{...current,colorblind:choice.value};case"runningTitle":return{...current,runningTitle:choice.value}}}function currentAppearanceChoice(current,setting){switch(setting){case"theme":return{kind:setting,value:current.themeName};case"themeMode":return{kind:setting,value:current.themeMode};case"transparent":return{kind:setting,value:current.transparentBackground};case"focusAccent":return{kind:setting,value:current.focusAccent};case"splitStyle":return{kind:setting,value:current.splitStyle};case"railFold":return{kind:setting,value:current.railFoldStyle};case"workingBorder":return{kind:setting,value:current.workingBorder};case"taskColors":return{kind:setting,value:current.taskColors};case"glyphSet":return{kind:setting,value:current.glyphSet};case"colorblind":return{kind:setting,value:current.colorblind};case"runningTitle":return{kind:setting,value:current.runningTitle}}}var TAB_STRIP_MODE_KEY="chat.tabStrip.mode",TAB_STRIP_MODES=["always","multipleOnly","never"];var TAB_STRIP_HIDE_SINGLE_KEY="chat.tabStrip.hideSingle";function resolveTabStripMode(stored,legacyHideSingle){if(typeof stored==="string"&&TAB_STRIP_MODES.includes(stored))return stored;if(legacyHideSingle===!0)return"multipleOnly";if(legacyHideSingle===!1)return"always";return"never"}function tabStripVisible(mode,tabCount){if(mode==="never")return!1;if(mode==="multipleOnly")return tabCount>=2;return!0}import{spawn}from"child_process";import{existsSync as existsSync2}from"fs";import{basename,delimiter,isAbsolute as isAbsolute2,join as join2}from"path";var CLI_CANDIDATES=[{id:"code",label:"VS Code",command:"code"},{id:"cursor",label:"Cursor",command:"cursor"},{id:"windsurf",label:"Windsurf",command:"windsurf"},{id:"zed",label:"Zed",command:"zed"}],MAC_APP_CANDIDATES=[{id:"vscode.app",label:"VS Code",appName:"Visual Studio Code",paths:["/Applications/Visual Studio Code.app"]},{id:"cursor.app",label:"Cursor",appName:"Cursor",paths:["/Applications/Cursor.app","/System/Applications/Cursor.app"]},{id:"windsurf.app",label:"Windsurf",appName:"Windsurf",paths:["/Applications/Windsurf.app"]},{id:"zed.app",label:"Zed",appName:"Zed",paths:["/Applications/Zed.app"]}];function executableOnPath(command,env,exists){if(isAbsolute2(command))return exists(command);let pathEnv=env.PATH??"";for(let dir of pathEnv.split(delimiter)){if(!dir)continue;if(exists(join2(dir,command)))return!0}return!1}function labelForOverride(command){let name=basename(command);if(name==="code")return"VS Code";if(name==="cursor")return"Cursor";if(name==="windsurf")return"Windsurf";if(name==="zed")return"Zed";return name||command}function detectWorktreeOpener(deps={}){let env=deps.env??process.env,platform=deps.platform??process.platform,exists=deps.exists??existsSync2,override=readRoveEnv("OPEN_EDITOR",env)?.trim();if(override)return{id:"env",label:labelForOverride(override),command:override,args:[]};for(let c of CLI_CANDIDATES)if(executableOnPath(c.command,env,exists))return{id:c.id,label:c.label,command:c.command,args:[]};if(platform==="darwin"&&executableOnPath("open",env,exists)){for(let app of MAC_APP_CANDIDATES)if(app.paths.some((path)=>exists(path)))return{id:app.id,label:app.label,command:"open",args:["-a",app.appName]};return{id:"mac-open",label:"Finder",command:"open",args:[]}}if(platform==="linux"&&executableOnPath("xdg-open",env,exists))return{id:"xdg-open",label:"Open",command:"xdg-open",args:[]};return null}function buildOpenWorktreeCommand(worktreePath,opener){return[opener.command,[...opener.args,worktreePath]]}function openWorktree(worktreePath,opener,deps={}){if(!worktreePath)return!1;let spawnFn=deps.spawn??spawn,[command,args]=buildOpenWorktreeCommand(worktreePath,opener);try{let child=spawnFn(command,args,{detached:!0,stdio:"ignore"});if(child.pid===void 0)return!1;return child.unref(),!0}catch{return!1}}var changeListeners=new Set;function subscribeBackgroundPolls(listener){return changeListeners.add(listener),()=>{changeListeners.delete(listener)}}function notifyChanged(){for(let listener of changeListeners)try{listener()}catch{}}function createBackgroundPoller(cfg){let entries=new Map,equals=cfg.equals??((a,b)=>a===b);function entryFor(key){let entry=entries.get(key);if(!entry){let current=cfg.initial;entry={read:()=>current,write:(next)=>{if(equals(current,next))return;current=next,notifyChanged()},inFlight:!1,nextAllowedAt:0},entries.set(key,entry)}return entry}return{read(key){if(!key)return cfg.initial;return entryFor(key).read()},poll(key){if(!key)return;let entry=entryFor(key);maybeStartScheduledRun(entry,cfg,(signal)=>cfg.run(key,signal),(value)=>entry.write(value))},reset(){entries.clear()}}}var GIT_TIMEOUT_MS=5000,DEFAULT_PR_PROMPT_TEMPLATE=`The user likes the current state of the code.
15
15
 
16
16
  {{dirtyCountSentence}}
17
17
  The current branch is {{branch}}.
@@ -29,7 +29,7 @@ Follow these steps to create a PR:
29
29
  - Use \`gh pr create --base {{targetBranch}}\` to create a PR onto the target branch. Keep the title under 80 characters. If the repository has a pull request template, fill it in. Describe every change since the branch diverged from the target, not only the ones made in this session.
30
30
 
31
31
  If any of these steps fail, ask the user for help.`;async function git2(cwd,args){let controller=new AbortController,timer=setTimeout(()=>controller.abort(),GIT_TIMEOUT_MS);try{recordSpawn("tui.prPrompt",["git",...args],cwd);let out=await spawnCapture("git",args,{cwd,env:readOnlyGitProcessEnv(),signal:controller.signal});if(controller.signal.aborted)return null;if(out.status!==0)return null;return out.stdout.trim()}finally{clearTimeout(timer)}}async function currentBranch(cwd){return await git2(cwd,["rev-parse","--abbrev-ref","HEAD"])||"HEAD"}async function targetBranch(cwd){let out=await git2(cwd,["symbolic-ref","refs/remotes/origin/HEAD","--short"]);if(!out)return"main";return out.startsWith("origin/")?out.slice(7):out}async function hasUpstream(cwd){let out=await git2(cwd,["rev-parse","--abbrev-ref","@{u}"]);return out!==null&&out.length>0}async function dirtyCount(cwd){let out=await git2(cwd,["status","--porcelain"]);if(!out)return 0;return out.split(`
32
- `).filter((line)=>line.length>0).length}async function gatherPRPromptState(worktree){let[branch,target,upstream,dirty]=await Promise.all([currentBranch(worktree),targetBranch(worktree),hasUpstream(worktree),dirtyCount(worktree)]);return{branch,targetBranch:target,hasUpstream:upstream,dirtyCount:dirty}}function dirtyCountSentence(n){if(n<=0)return"There are no uncommitted changes.";if(n===1)return"There is 1 uncommitted change.";return`There are ${n} uncommitted changes.`}function upstreamSentence(hasUpstreamValue){return hasUpstreamValue?"The current branch tracks an upstream.":"There is no upstream branch yet."}function renderPRPrompt(template,state){let replacements={branch:state.branch,targetBranch:state.targetBranch,dirtyCountSentence:dirtyCountSentence(state.dirtyCount),upstreamSentence:upstreamSentence(state.hasUpstream)};return template.replace(/\{\{([a-zA-Z][a-zA-Z0-9_]*)\}\}/g,(match,key)=>Object.hasOwn(replacements,key)?replacements[key]:match)}var PR_INSTRUCTION_FILENAME="pr-instructions.md";function loadTemplate(worktree){return readFirstNonEmptyRepoFile(worktree,PR_INSTRUCTION_FILENAME)??DEFAULT_PR_PROMPT_TEMPLATE}async function buildPRPrompt(worktree,state){let resolved=state??await gatherPRPromptState(worktree);return renderPRPrompt(loadTemplate(worktree),resolved)}import{closeSync,openSync,readSync}from"fs";import{basename as basename2}from"path";var PART_BYTES=1048576;async function sendFileToMachine(entry,localPath){let socket=await machineDaemonSocket(entry);if(!socket)throw Error(`machine ${entry.alias} cannot be reached`);let client=new RoveDaemonClient(socket),fd=openSync(localPath,"r");try{let part=Buffer.alloc(PART_BYTES),path="";for(let offset=0;;){let read=readSync(fd,part,0,PART_BYTES,offset);if(read===0&&offset>0)return path;if(path=(await client.request("attachment.append",{name:basename2(localPath),offset,data:part.subarray(0,read).toString("base64")})).path,offset+=read,read<PART_BYTES)return path}}catch(err){if(/unknown daemon request/.test(errorMessage(err)))throw Error(`Rove on ${entry.alias} is too old to receive files: run rove machine update ${entry.alias}`);throw err}finally{closeSync(fd),client.close()}}import{spawn as spawn2}from"child_process";function spawnDetached(cmd,args,opts={}){try{let child=spawn2(cmd,args,{detached:!0,stdio:"ignore"});return child.on("error",(err)=>opts.onError?.(err)),child.unref(),!0}catch(err){if(opts.onError&&err instanceof Error)opts.onError(err);return!1}}import{spawn as spawn3}from"child_process";import{existsSync as existsSync3}from"fs";import{platform}from"os";import{dirname}from"path";function openExternally(absPath){if(!absPath)return;let plat=platform();if(plat==="linux"){if(existsSync3("/proc/sys/fs/binfmt_misc/WSLInterop")||process.env.WSL_DISTRO_NAME){spawnDetachedWithFallback("wslview",[absPath],()=>{let child=spawn3("wslpath",["-w",absPath],{stdio:["ignore","pipe","ignore"]}),out="";child.stdout?.on("data",(b)=>{out+=b.toString()}),child.on("close",(code)=>{if(code===0)spawnDetachedWithFallback("explorer.exe",[out.trim()])})});return}spawnDetachedWithFallback("xdg-open",[absPath]);return}if(plat==="darwin"){spawnDetachedWithFallback("open",[absPath]);return}if(plat==="win32"){spawnDetachedWithFallback("cmd.exe",["/c","start","",absPath]);return}}function revealInFileManager(absPath){if(!absPath)return;if(platform()==="darwin")spawnDetachedWithFallback("open",["-R",absPath]);else openExternally(dirname(absPath))}function spawnDetachedWithFallback(cmd,args,onError){spawnDetached(cmd,args,{onError:onError?()=>onError():void 0})}import{homedir}from"os";var PATH_LABEL_MAX=24;function rowLiveBranchPath(task){if(task.kind!=="dir")return"";return task.worktreePath||task.repo||""}function conversationTitleOf(task,tabsByTask){let alias=task.ptyAlias,tabs=tabsByTask.get(alias?.taskId??task.id);if(!tabs)return;if(alias)return tabs.find((tab)=>tab.id===alias.tabId)?.title;return tabs.find((tab)=>tab.engine===!0&&tab.title!==void 0)?.title}var AUTO_DIR_TITLE=/^\S+-[0-9a-z]{4}$/;function isNamedDir(task){let title=task.title.trim();return task.kind==="dir"&&title!==repoBasename(task.repo)&&!AUTO_DIR_TITLE.test(title)}function worktreeRowLabel(task,opts={}){let live=opts.liveTitle?.trim();if(live)return live;let title=task.title.trim(),namedDir=isNamedDir(task);if(title&&(task.parentTaskId!==void 0||task.kind==="task"||namedDir))return title;let branch=(opts.liveBranch??task.branch)||task.branch;if(branch)return branch;if(task.kind!=="dir"&&task.title)return task.title;let path=task.worktreePath||task.repo;if(path){let home=opts.home??homedir(),tildified=tildify(path,home);return truncateStart(tildified,PATH_LABEL_MAX)}return task.title||"scratch"}import{readFileSync}from"fs";var VERB_ALTERNATION=ENGINE_ACTIVITY_KINDS.join("|"),HOOK_CALL=new RegExp(String.raw`\bhook\s+(?:${VERB_ALTERNATION})\b([^"'\n]*)`,"g"),VERSION_FLAG=/--hook-version[ =]+(\d+)/,EXTENSION_VERSION=/ROVE_HOOK_VERSION=(\d+)/,EXTENSION_BANNER=/Rove activity hook/;function readHookInstallState(text,current=ROVE_HOOK_VERSION){let stamped=EXTENSION_VERSION.exec(text);if(stamped)return Number(stamped[1])===current?"installed":"outdated";if(EXTENSION_BANNER.test(text))return"outdated";let found=!1;for(let match of text.matchAll(HOOK_CALL)){found=!0;let version=VERSION_FLAG.exec(match[1]??"");if(!version||Number(version[1])!==current)return"outdated"}return found?"installed":"not-installed"}function integrationFor(vendor,adapter,issues){let entry=engineEntry(vendor),hooksSupported=adapter!==void 0,hookFile=adapter?.globalSettingsPath()??"",hookState="not-installed";if(hookFile)try{hookState=readHookInstallState(readFileSync(hookFile,"utf8"))}catch{}let configIssue=hookFile?issues.get(hookFile):void 0,skillDir=engineSkillDir(vendor)??"";return{vendor,hooksSupported,...adapter?.setupCommand?{setupCommand:adapter.setupCommand}:{},hookState,hookFile,markers:entry.createTurnDetector().supportsCompletionMarkers(),screen:entry.screenManifest!==void 0,...configIssue?{configIssue}:{},skillDir,skillState:skillDir?readSkillCopy(skillDir).state:"not-installed"}}function engineIntegrations(vendors){let issues=new Map(hookConfigIssues().map((issue)=>[issue.file,issue.reason])),adapters=new Map(activityHookAdapters().map((adapter)=>[adapter.vendor,adapter]));return vendors.map((vendor)=>integrationFor(vendor,adapters.get(vendor),issues))}function enginesNeedingHookInstall(rows){return rows.filter((row)=>row.hooksSupported&&row.hookState!=="installed").map((row)=>row.vendor)}function enginesWithHooksInstalled(rows){return rows.filter((row)=>row.hooksSupported&&row.hookState!=="not-installed").map((row)=>row.vendor)}import{spawn as spawn4}from"child_process";import*as fs2 from"fs";import*as path from"path";function deriveFolderName(url){let trimmed=url.trim().replace(/\/+$/,"");if(!trimmed)return"";let lastSlash=trimmed.lastIndexOf("/"),lastColon=trimmed.lastIndexOf(":"),cutAt=Math.max(lastSlash,lastColon);return(cutAt>=0?trimmed.slice(cutAt+1):trimmed).replace(/\.git$/i,"")}function validateGitUrl(url){let trimmed=url.trim();if(!trimmed)return t("newTask.error.gitUrlRequired");let hasProtocol=trimmed.includes("://"),hasScpSep=trimmed.includes("@")&&trimmed.includes(":"),hasPathSep=trimmed.includes("/");if(!hasProtocol&&!hasScpSep&&!hasPathSep)return t("newTask.error.gitUrlInvalid",{url:trimmed});return null}function validateCloneTarget(parentDir,folder){let folderTrimmed=folder.trim();if(!folderTrimmed)return t("newTask.error.folderRequired");if(folderTrimmed.includes("/")||folderTrimmed.includes("\\"))return t("newTask.error.folderHasSeparator");let parentTrimmed=parentDir.trim();if(!parentTrimmed)return t("newTask.error.parentRequired");let parentExpanded=expandHome(parentTrimmed),parentStat;try{parentStat=fs2.statSync(parentExpanded)}catch{return t("newTask.error.parentNotFound",{path:parentExpanded})}if(!parentStat.isDirectory())return t("newTask.error.parentNotDir",{path:parentExpanded});let target=path.join(parentExpanded,folderTrimmed);if(fs2.existsSync(target))return t("newTask.error.targetExists",{path:target});return null}function resolveCloneTarget(parentDir,folder){return path.join(expandHome(parentDir.trim()),folder.trim())}function findAvailableFolderName(parentDir,base){let trimmed=base.trim();if(!trimmed)return base;let parentExpanded=expandHome(parentDir.trim());if(!parentExpanded)return base;try{if(!fs2.statSync(parentExpanded).isDirectory())return base}catch{return base}if(!fs2.existsSync(path.join(parentExpanded,trimmed)))return trimmed;for(let n=2;n<1000;n++){let candidate=`${trimmed}-${n}`;if(!fs2.existsSync(path.join(parentExpanded,candidate)))return candidate}return trimmed}function cloneRepo(url,target,onProgress){return new Promise((resolve)=>{let stderrBuf="";try{let child=spawn4("git",["clone","--progress",url,target],{stdio:["ignore","ignore","pipe"],env:{...process.env,GIT_TERMINAL_PROMPT:"0",GIT_ASKPASS:""}});child.stderr?.setEncoding("utf-8"),child.stderr?.on("data",(chunk)=>{if(stderrBuf+=chunk,onProgress){let lines=chunk.split(/[\r\n]+/).filter((s)=>s.trim().length>0),last=lines[lines.length-1];if(last)onProgress(last)}}),child.on("error",(err)=>{resolve({ok:!1,error:err.message})}),child.on("close",(code)=>{if(code===0){resolve({ok:!0,path:target});return}let lines=stderrBuf.split(/[\r\n]+/).filter((s)=>s.trim().length>0);resolve({ok:!1,error:lines.find(isDiskFull)??lines.pop()??`git clone exited with ${code}`})})}catch(err){resolve({ok:!1,error:errorMessage(err)})}})}function editableBindings(){let editable=defaultKeymapCopy().filter((row)=>row.keys.length>0||row.prefixKeys!==void 0);return groupBindings(editable).flatMap((group)=>[...group.rows])}var SECTIONS=[{id:"general",label:"General",group:"preferences"},{id:"keys",label:"Keybindings",group:"preferences"},{id:"engines",label:"Engines",group:"agents"},{id:"autoRouting",label:"Auto routing",group:"agents"},{id:"plugins",label:"Plugins",group:"agents"},{id:"marketplace",label:"Marketplace",group:"agents"},{id:"feedback",label:"Feedback",group:"more"},{id:"dev",label:"Dev",group:"more"}];function languageRowId(locale){return`language:${locale}`}function engineRowId(vendor){return`engine:${vendor}`}function autoRoutingRowId(tier){return`auto-routing:${tier}`}function prefixTapPresentationRowId(presentation){return`prefix-tap:${presentation}`}function pluginRowId(pluginId){return`plugin:${pluginId}`}function pluginSettingRowId(pluginId,key){return`plugin:${pluginId}:${key}`}function marketplaceRowId(ref){return`market:${ref}`}function generalRows(){return[...LOCALES.map((l)=>({id:languageRowId(l.id),kind:"language",locale:l.id})),...APPEARANCE_SETTINGS.map((setting)=>({id:`appearance:${setting}`,kind:"appearance",setting})),{id:"toast",kind:"toast"},{id:"sound",kind:"sound"},{id:"sound-volume",kind:"soundVolume"},{id:"cross-task",kind:"crossTask"},{id:"finished-alerts",kind:"finishedAlerts"},{id:"key-hints",kind:"keyHints"},{id:"zen-default-on",kind:"zenDefaultOn"},{id:"update-channel",kind:"updateChannel"},{id:"update-notify",kind:"updateNotify"},{id:"update-check",kind:"updateCheck"},{id:"editor-kind",kind:"editorKind"},{id:"editor-custom",kind:"editorCustom"},{id:"worktree-base",kind:"worktreeBase"},{id:"worktree-custom",kind:"worktreeCustom"},{id:"scrollback-rows",kind:"scrollbackRows"},{id:"tab-strip-hide-single",kind:"tabStripHideSingle"},{id:"usage-show",kind:"usageShow"}]}function engineRows(engineList){return[...engineList.map((vendor)=>({id:engineRowId(vendor),kind:"engine",vendor})),{id:"add-engine",kind:"engineAdd"},{id:"install-hooks",kind:"engineHooksInstall"},{id:"uninstall-hooks",kind:"engineHooksUninstall"},{id:"install-skill",kind:"engineSkillInstall"}]}function pluginRows(plugins){return plugins.flatMap(({id,settingKeys})=>[{id:pluginRowId(id),kind:"pluginToggle",pluginId:id},...settingKeys.map((key)=>({id:pluginSettingRowId(id,key),kind:"pluginSetting",pluginId:id,key}))])}function marketplaceRows(refs){return refs.map((ref)=>({id:marketplaceRowId(ref),kind:"pluginInstall",ref}))}function autoRoutingRows(){return[...AUTO_ROUTING_TIERS.map((tier)=>({id:autoRoutingRowId(tier),kind:"autoRoutingTier",tier})),{id:"auto-routing-classifier",kind:"autoRoutingClassifier"},{id:"auto-routing-endpoint",kind:"autoRoutingClassifierEndpoint"},{id:"auto-routing-threshold",kind:"autoRoutingClassifierThreshold"},{id:"auto-routing-key",kind:"autoRoutingClassifierKey"}]}function displayEndpoint(kind,storedMode,remembered){if(kind==="url")return storedMode||remembered;if(kind==="refused")return storedMode;return remembered}function feedbackRows(){return[{id:"feedback-title",kind:"feedbackTitle"},{id:"feedback-body",kind:"feedbackBody"},{id:"feedback-send",kind:"feedbackSend"}]}var keybindingRowId=(bindingId)=>`key:${bindingId}`;function keybindingRows(){return[...PREFIX_TAP_PRESENTATIONS.map((presentation)=>({id:prefixTapPresentationRowId(presentation),kind:"prefixTapPresentation",presentation})),...[PREFIX_KEY_ID,...editableBindings().map((row)=>row.id)].map((bindingId)=>({id:keybindingRowId(bindingId),kind:"keybinding",bindingId}))]}function devRows(hasDaemon){return[{id:"dev-reset",kind:"devReset"},...hasDaemon?[{id:"dev-restart",kind:"devRestartDaemon"}]:[],{id:"dev-reload",kind:"devReloadSettings"},{id:"remote-projects",kind:"devRemoteProjects"},{id:"auto-status",kind:"devAutoStatus"},{id:"dispatcher",kind:"devDispatcher"}]}function sectionRows(section,input){switch(section){case"general":return generalRows();case"engines":return engineRows(input.engineList);case"autoRouting":return autoRoutingRows();case"keys":return keybindingRows();case"plugins":return pluginRows(input.plugins);case"marketplace":return marketplaceRows(input.marketplace);case"feedback":return feedbackRows();case"dev":return devRows(input.hasDaemon)}}function rowIndex(rows,id){return rows.findIndex((row)=>row.id===id)}function rowAt(rows,index){return rows[index]}var SECTIONS_SIDEBAR_WIDTH=14,SECTIONS_COLUMN_GAP=2,ROW_PADDING_X=2,LABEL_COLUMN_MAX=30,LABEL_NATURAL_MAX=24,HINT_MIN_CELLS=18;function generalLabelLayout(width,dialogPadX){let rowCells=width-dialogPadX*2-SECTIONS_SIDEBAR_WIDTH-SECTIONS_COLUMN_GAP-ROW_PADDING_X;if(rowCells>=LABEL_COLUMN_MAX+HINT_MIN_CELLS)return{labelColumn:LABEL_COLUMN_MAX,showHint:!0};if(rowCells>=LABEL_NATURAL_MAX+HINT_MIN_CELLS)return{labelColumn:rowCells-HINT_MIN_CELLS,showHint:!0};return{labelColumn:0,showHint:!1}}import{randomUUID}from"crypto";import{existsSync as existsSync5}from"fs";import{join as join4}from"path";function fenceFor(text){let longest=Math.max(0,...(text.match(/`+/g)??[]).map((run)=>run.length));return"`".repeat(Math.max(3,longest+1))}function formatDiffComment(c,stale=!1){let escaped=c.body.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\r/g,"\\r").replace(/\n/g,"\\n"),location=c.startLine!==void 0&&c.startLine!==c.line?`Lines: ${c.startLine}-${c.line}`:`Line: ${c.line}`,staleNote=stale?["Note: this path is no longer in the branch \u2014 it was renamed or deleted after the note was written."]:[],fence=c.code?fenceFor(c.code):"",quoted=c.code?["Code:",`${fence}diff`,c.code,fence]:[];return[`File: ${c.filePath}`,location,...staleNote,...quoted,`User comment: "${escaped}"`].join(`
32
+ `).filter((line)=>line.length>0).length}async function gatherPRPromptState(worktree){let[branch,target,upstream,dirty]=await Promise.all([currentBranch(worktree),targetBranch(worktree),hasUpstream(worktree),dirtyCount(worktree)]);return{branch,targetBranch:target,hasUpstream:upstream,dirtyCount:dirty}}function dirtyCountSentence(n){if(n<=0)return"There are no uncommitted changes.";if(n===1)return"There is 1 uncommitted change.";return`There are ${n} uncommitted changes.`}function upstreamSentence(hasUpstreamValue){return hasUpstreamValue?"The current branch tracks an upstream.":"There is no upstream branch yet."}function renderPRPrompt(template,state){let replacements={branch:state.branch,targetBranch:state.targetBranch,dirtyCountSentence:dirtyCountSentence(state.dirtyCount),upstreamSentence:upstreamSentence(state.hasUpstream)};return template.replace(/\{\{([a-zA-Z][a-zA-Z0-9_]*)\}\}/g,(match,key)=>Object.hasOwn(replacements,key)?replacements[key]:match)}var PR_INSTRUCTION_FILENAME="pr-instructions.md";function loadTemplate(worktree){return readFirstNonEmptyRepoFile(worktree,PR_INSTRUCTION_FILENAME)??DEFAULT_PR_PROMPT_TEMPLATE}async function buildPRPrompt(worktree,state){let resolved=state??await gatherPRPromptState(worktree);return renderPRPrompt(loadTemplate(worktree),resolved)}import{closeSync,openSync,readSync}from"fs";import{basename as basename2}from"path";var PART_BYTES=1048576;async function sendFileToMachine(entry,localPath){let socket=await machineDaemonSocket(entry);if(!socket)throw Error(`machine ${entry.alias} cannot be reached`);let client=new RoveDaemonClient(socket),fd=openSync(localPath,"r");try{let part=Buffer.alloc(PART_BYTES),path="";for(let offset=0;;){let read=readSync(fd,part,0,PART_BYTES,offset);if(read===0&&offset>0)return path;if(path=(await client.request("attachment.append",{name:basename2(localPath),offset,data:part.subarray(0,read).toString("base64")})).path,offset+=read,read<PART_BYTES)return path}}catch(err){if(/unknown daemon request/.test(errorMessage(err)))throw Error(`Rove on ${entry.alias} is too old to receive files: run rove machine update ${entry.alias}`);throw err}finally{closeSync(fd),client.close()}}import{spawn as spawn2}from"child_process";function spawnDetached(cmd,args,opts={}){try{let child=spawn2(cmd,args,{detached:!0,stdio:"ignore"});return child.on("error",(err)=>opts.onError?.(err)),child.unref(),!0}catch(err){if(opts.onError&&err instanceof Error)opts.onError(err);return!1}}import{spawn as spawn3}from"child_process";import{existsSync as existsSync3}from"fs";import{platform}from"os";import{dirname}from"path";function openExternally(absPath){if(!absPath)return;let plat=platform();if(plat==="linux"){if(existsSync3("/proc/sys/fs/binfmt_misc/WSLInterop")||process.env.WSL_DISTRO_NAME){spawnDetachedWithFallback("wslview",[absPath],()=>{let child=spawn3("wslpath",["-w",absPath],{stdio:["ignore","pipe","ignore"]}),out="";child.stdout?.on("data",(b)=>{out+=b.toString()}),child.on("close",(code)=>{if(code===0)spawnDetachedWithFallback("explorer.exe",[out.trim()])})});return}spawnDetachedWithFallback("xdg-open",[absPath]);return}if(plat==="darwin"){spawnDetachedWithFallback("open",[absPath]);return}if(plat==="win32"){spawnDetachedWithFallback("cmd.exe",["/c","start","",absPath]);return}}function revealInFileManager(absPath){if(!absPath)return;if(platform()==="darwin")spawnDetachedWithFallback("open",["-R",absPath]);else openExternally(dirname(absPath))}function spawnDetachedWithFallback(cmd,args,onError){spawnDetached(cmd,args,{onError:onError?()=>onError():void 0})}import{homedir}from"os";var PATH_LABEL_MAX=24;function rowLiveBranchPath(task){if(task.kind!=="dir")return"";return task.worktreePath||task.repo||""}function conversationTitleOf(task,tabsByTask){let alias=task.ptyAlias,tabs=tabsByTask.get(alias?.taskId??task.id);if(!tabs)return;if(alias)return tabs.find((tab)=>tab.id===alias.tabId)?.title;return tabs.find((tab)=>tab.engine===!0&&tab.title!==void 0)?.title}var AUTO_DIR_TITLE=/^\S+-[0-9a-z]{4}$/;function isNamedDir(task){let title=task.title.trim();return task.kind==="dir"&&title!==repoBasename(task.repo)&&!AUTO_DIR_TITLE.test(title)}function worktreeRowLabel(task,opts={}){let live=opts.liveTitle?.trim();if(live)return live;let title=task.title.trim(),namedDir=isNamedDir(task);if(title&&(task.parentTaskId!==void 0||task.kind==="task"||namedDir))return title;let branch=(opts.liveBranch??task.branch)||task.branch;if(branch)return branch;if(task.kind!=="dir"&&task.title)return task.title;let path=task.worktreePath||task.repo;if(path){let home=opts.home??homedir(),tildified=tildify(path,home);return truncateStart(tildified,PATH_LABEL_MAX)}return task.title||"scratch"}import{readFileSync}from"fs";var VERB_ALTERNATION=ENGINE_ACTIVITY_KINDS.join("|"),HOOK_CALL=new RegExp(String.raw`\bhook\s+(?:${VERB_ALTERNATION})\b([^"'\n]*)`,"g"),VERSION_FLAG=/--hook-version[ =]+(\d+)/,EXTENSION_VERSION=/ROVE_HOOK_VERSION=(\d+)/,EXTENSION_BANNER=/Rove activity hook/;function readHookInstallState(text,current=ROVE_HOOK_VERSION){let stamped=EXTENSION_VERSION.exec(text);if(stamped)return Number(stamped[1])===current?"installed":"outdated";if(EXTENSION_BANNER.test(text))return"outdated";let found=!1;for(let match of text.matchAll(HOOK_CALL)){found=!0;let version=VERSION_FLAG.exec(match[1]??"");if(!version||Number(version[1])!==current)return"outdated"}return found?"installed":"not-installed"}function integrationFor(vendor,adapter,issues){let entry=engineEntry(vendor),hooksSupported=adapter!==void 0,hookFile=adapter?.globalSettingsPath()??"",hookState="not-installed";if(hookFile)try{hookState=readHookInstallState(readFileSync(hookFile,"utf8"))}catch{}let configIssue=hookFile?issues.get(hookFile):void 0,skillDir=engineSkillDir(vendor)??"";return{vendor,hooksSupported,...adapter?.setupCommand?{setupCommand:adapter.setupCommand}:{},hookState,hookFile,markers:entry.createTurnDetector().supportsCompletionMarkers(),screen:entry.screenManifest!==void 0,...configIssue?{configIssue}:{},skillDir,skillState:skillDir?readSkillCopy(skillDir).state:"not-installed"}}function engineIntegrations(vendors){let issues=new Map(hookConfigIssues().map((issue)=>[issue.file,issue.reason])),adapters=new Map(activityHookAdapters().map((adapter)=>[adapter.vendor,adapter]));return vendors.map((vendor)=>integrationFor(vendor,adapters.get(vendor),issues))}function enginesNeedingHookInstall(rows){return rows.filter((row)=>row.hooksSupported&&row.hookState!=="installed").map((row)=>row.vendor)}function enginesWithHooksInstalled(rows){return rows.filter((row)=>row.hooksSupported&&row.hookState!=="not-installed").map((row)=>row.vendor)}import{spawn as spawn4}from"child_process";import*as fs2 from"fs";import*as path from"path";function deriveFolderName(url){let trimmed=url.trim().replace(/\/+$/,"");if(!trimmed)return"";let lastSlash=trimmed.lastIndexOf("/"),lastColon=trimmed.lastIndexOf(":"),cutAt=Math.max(lastSlash,lastColon);return(cutAt>=0?trimmed.slice(cutAt+1):trimmed).replace(/\.git$/i,"")}function validateGitUrl(url){let trimmed=url.trim();if(!trimmed)return t("newTask.error.gitUrlRequired");let hasProtocol=trimmed.includes("://"),hasScpSep=trimmed.includes("@")&&trimmed.includes(":"),hasPathSep=trimmed.includes("/");if(!hasProtocol&&!hasScpSep&&!hasPathSep)return t("newTask.error.gitUrlInvalid",{url:trimmed});return null}function validateCloneTarget(parentDir,folder){let folderTrimmed=folder.trim();if(!folderTrimmed)return t("newTask.error.folderRequired");if(folderTrimmed.includes("/")||folderTrimmed.includes("\\"))return t("newTask.error.folderHasSeparator");let parentTrimmed=parentDir.trim();if(!parentTrimmed)return t("newTask.error.parentRequired");let parentExpanded=expandHome(parentTrimmed),parentStat;try{parentStat=fs2.statSync(parentExpanded)}catch{return t("newTask.error.parentNotFound",{path:parentExpanded})}if(!parentStat.isDirectory())return t("newTask.error.parentNotDir",{path:parentExpanded});let target=path.join(parentExpanded,folderTrimmed);if(fs2.existsSync(target))return t("newTask.error.targetExists",{path:target});return null}function resolveCloneTarget(parentDir,folder){return path.join(expandHome(parentDir.trim()),folder.trim())}function findAvailableFolderName(parentDir,base){let trimmed=base.trim();if(!trimmed)return base;let parentExpanded=expandHome(parentDir.trim());if(!parentExpanded)return base;try{if(!fs2.statSync(parentExpanded).isDirectory())return base}catch{return base}if(!fs2.existsSync(path.join(parentExpanded,trimmed)))return trimmed;for(let n=2;n<1000;n++){let candidate=`${trimmed}-${n}`;if(!fs2.existsSync(path.join(parentExpanded,candidate)))return candidate}return trimmed}function cloneRepo(url,target,onProgress){return new Promise((resolve)=>{let stderrBuf="";try{let child=spawn4("git",["clone","--progress",url,target],{stdio:["ignore","ignore","pipe"],env:{...process.env,GIT_TERMINAL_PROMPT:"0",GIT_ASKPASS:""}});child.stderr?.setEncoding("utf-8"),child.stderr?.on("data",(chunk)=>{if(stderrBuf+=chunk,onProgress){let lines=chunk.split(/[\r\n]+/).filter((s)=>s.trim().length>0),last=lines[lines.length-1];if(last)onProgress(last)}}),child.on("error",(err)=>{resolve({ok:!1,error:err.message})}),child.on("close",(code)=>{if(code===0){resolve({ok:!0,path:target});return}let lines=stderrBuf.split(/[\r\n]+/).filter((s)=>s.trim().length>0);resolve({ok:!1,error:lines.find(isDiskFull)??lines.pop()??`git clone exited with ${code}`})})}catch(err){resolve({ok:!1,error:errorMessage(err)})}})}function editableBindings(){let editable=defaultKeymapCopy().filter((row)=>row.keys.length>0||row.prefixKeys!==void 0);return groupBindings(editable).flatMap((group)=>[...group.rows])}var SECTIONS=[{id:"general",label:"General",group:"preferences"},{id:"keys",label:"Keybindings",group:"preferences"},{id:"engines",label:"Engines",group:"agents"},{id:"autoRouting",label:"Auto routing",group:"agents"},{id:"plugins",label:"Plugins",group:"agents"},{id:"marketplace",label:"Marketplace",group:"agents"},{id:"feedback",label:"Feedback",group:"more"},{id:"dev",label:"Dev",group:"more"}];function languageRowId(locale){return`language:${locale}`}function engineRowId(vendor){return`engine:${vendor}`}function autoRoutingRowId(tier){return`auto-routing:${tier}`}function prefixTapPresentationRowId(presentation){return`prefix-tap:${presentation}`}function pluginRowId(pluginId){return`plugin:${pluginId}`}function pluginSettingRowId(pluginId,key){return`plugin:${pluginId}:${key}`}function marketplaceRowId(ref){return`market:${ref}`}function generalRows(){return[...LOCALES.map((l)=>({id:languageRowId(l.id),kind:"language",locale:l.id})),...APPEARANCE_SETTINGS.map((setting)=>({id:`appearance:${setting}`,kind:"appearance",setting})),{id:"toast",kind:"toast"},{id:"sound",kind:"sound"},{id:"sound-volume",kind:"soundVolume"},{id:"cross-task",kind:"crossTask"},{id:"finished-alerts",kind:"finishedAlerts"},{id:"key-hints",kind:"keyHints"},{id:"update-channel",kind:"updateChannel"},{id:"update-notify",kind:"updateNotify"},{id:"update-check",kind:"updateCheck"},{id:"editor-kind",kind:"editorKind"},{id:"editor-custom",kind:"editorCustom"},{id:"worktree-base",kind:"worktreeBase"},{id:"worktree-custom",kind:"worktreeCustom"},{id:"scrollback-rows",kind:"scrollbackRows"},{id:"tab-strip-hide-single",kind:"tabStripHideSingle"},{id:"usage-show",kind:"usageShow"}]}function engineRows(engineList){return[...engineList.map((vendor)=>({id:engineRowId(vendor),kind:"engine",vendor})),{id:"add-engine",kind:"engineAdd"},{id:"install-hooks",kind:"engineHooksInstall"},{id:"uninstall-hooks",kind:"engineHooksUninstall"},{id:"install-skill",kind:"engineSkillInstall"}]}function pluginRows(plugins){return plugins.flatMap(({id,settingKeys})=>[{id:pluginRowId(id),kind:"pluginToggle",pluginId:id},...settingKeys.map((key)=>({id:pluginSettingRowId(id,key),kind:"pluginSetting",pluginId:id,key}))])}function marketplaceRows(refs){return refs.map((ref)=>({id:marketplaceRowId(ref),kind:"pluginInstall",ref}))}function autoRoutingRows(){return[...AUTO_ROUTING_TIERS.map((tier)=>({id:autoRoutingRowId(tier),kind:"autoRoutingTier",tier})),{id:"auto-routing-classifier",kind:"autoRoutingClassifier"},{id:"auto-routing-endpoint",kind:"autoRoutingClassifierEndpoint"},{id:"auto-routing-threshold",kind:"autoRoutingClassifierThreshold"},{id:"auto-routing-key",kind:"autoRoutingClassifierKey"}]}function displayEndpoint(kind,storedMode,remembered){if(kind==="url")return storedMode||remembered;if(kind==="refused")return storedMode;return remembered}function feedbackRows(){return[{id:"feedback-title",kind:"feedbackTitle"},{id:"feedback-body",kind:"feedbackBody"},{id:"feedback-send",kind:"feedbackSend"}]}var keybindingRowId=(bindingId)=>`key:${bindingId}`;function keybindingRows(){return[...PREFIX_TAP_PRESENTATIONS.map((presentation)=>({id:prefixTapPresentationRowId(presentation),kind:"prefixTapPresentation",presentation})),...[PREFIX_KEY_ID,...editableBindings().map((row)=>row.id)].map((bindingId)=>({id:keybindingRowId(bindingId),kind:"keybinding",bindingId}))]}function devRows(hasDaemon){return[{id:"dev-reset",kind:"devReset"},...hasDaemon?[{id:"dev-restart",kind:"devRestartDaemon"}]:[],{id:"dev-reload",kind:"devReloadSettings"},{id:"remote-projects",kind:"devRemoteProjects"},{id:"auto-status",kind:"devAutoStatus"},{id:"dispatcher",kind:"devDispatcher"}]}function sectionRows(section,input){switch(section){case"general":return generalRows();case"engines":return engineRows(input.engineList);case"autoRouting":return autoRoutingRows();case"keys":return keybindingRows();case"plugins":return pluginRows(input.plugins);case"marketplace":return marketplaceRows(input.marketplace);case"feedback":return feedbackRows();case"dev":return devRows(input.hasDaemon)}}function rowIndex(rows,id){return rows.findIndex((row)=>row.id===id)}function rowAt(rows,index){return rows[index]}var SECTIONS_SIDEBAR_WIDTH=14,SECTIONS_COLUMN_GAP=2,ROW_PADDING_X=2,LABEL_COLUMN_MAX=30,LABEL_NATURAL_MAX=24,HINT_MIN_CELLS=18;function generalLabelLayout(width,dialogPadX){let rowCells=width-dialogPadX*2-SECTIONS_SIDEBAR_WIDTH-SECTIONS_COLUMN_GAP-ROW_PADDING_X;if(rowCells>=LABEL_COLUMN_MAX+HINT_MIN_CELLS)return{labelColumn:LABEL_COLUMN_MAX,showHint:!0};if(rowCells>=LABEL_NATURAL_MAX+HINT_MIN_CELLS)return{labelColumn:rowCells-HINT_MIN_CELLS,showHint:!0};return{labelColumn:0,showHint:!1}}import{randomUUID}from"crypto";import{existsSync as existsSync5}from"fs";import{join as join4}from"path";function fenceFor(text){let longest=Math.max(0,...(text.match(/`+/g)??[]).map((run)=>run.length));return"`".repeat(Math.max(3,longest+1))}function formatDiffComment(c,stale=!1){let escaped=c.body.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\r/g,"\\r").replace(/\n/g,"\\n"),location=c.startLine!==void 0&&c.startLine!==c.line?`Lines: ${c.startLine}-${c.line}`:`Line: ${c.line}`,staleNote=stale?["Note: this path is no longer in the branch \u2014 it was renamed or deleted after the note was written."]:[],fence=c.code?fenceFor(c.code):"",quoted=c.code?["Code:",`${fence}diff`,c.code,fence]:[];return[`File: ${c.filePath}`,location,...staleNote,...quoted,`User comment: "${escaped}"`].join(`
33
33
  `)}function formatDiffComments(comments,worktreePath){return comments.map((c)=>formatDiffComment(c,worktreePath?!existsSync5(join4(worktreePath,c.filePath)):!1)).join(`
34
34
 
35
35
  `)}function unsentComments(comments){return comments.filter((c)=>c.sentAt===void 0)}var HUNK_HEADER=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function unifiedDiffRows(diff){let rows=[],oldLine=0,newLine=0,inHunk=!1;for(let line of diff.split(`
@@ -39,4 +39,4 @@ If any of these steps fail, ask the user for help.`;async function git2(cwd,args
39
39
  `)}
40
40
  `:"",{mode:OWNER_ONLY_FILE_MODE}),tightenPluginPermissions(pluginId,homeDir)}function findFileHandler(fileName,homeDir){for(let entry of loadPluginRegistry(homeDir).plugins){if(!entry.enabled)continue;let manifest;try{manifest=readPluginManifest(entry.root).manifest}catch{continue}for(let handler of manifest.fileHandlers)try{if(new RegExp(handler.pattern,"i").test(fileName))return{qualifiedAction:qualifiedActionId(entry.id,handler.action)}}catch{}}return null}import{closeSync as closeSync2,openSync as openSync2,readFileSync as readFileSync3,readSync as readSync2,statSync as statSync3}from"fs";function builtInRowView(info){return{id:info.id,version:"",enabled:info.enabled,linked:!1,source:info.description,declares:{actions:0,events:0,panes:0,engines:0,pages:info.pages},platformOk:!0,hooksDeclared:!1,lastRun:null,settings:[],updateAvailable:!1,pageErrors:[],builtIn:!0}}function parseLastRun(logText){if(!logText)return null;let lines=logText.trimEnd().split(`
41
41
  `);for(let i=lines.length-1;i>=0;i--){let line=lines[i]?.trim();if(!line)continue;let record;try{record=JSON.parse(line)}catch{continue}if(typeof record.at!=="number")continue;let exitCode=typeof record.exitCode==="number"?record.exitCode:null,spawnError=typeof record.spawnError==="string"?record.spawnError:void 0,running=record.phase==="running";return{at:record.at,label:typeof record.label==="string"?record.label:typeof record.kind==="string"?record.kind:"run",exitCode,ok:!running&&spawnError===void 0&&exitCode===0,running,...spawnError?{spawnError}:{}}}return null}function pluginRowView(outdated,entry,manifestText,logText,settingValues={},pageErrors=[]){let declares=null,settings=[],platformOk=!0,hooksDeclared=!1;if(manifestText!==null)try{let{manifest}=parsePluginManifest(manifestText);declares={actions:manifest.actions.length,events:manifest.events.length,panes:manifest.panes.length,engines:manifest.engines.length,pages:manifest.pages.length},hooksDeclared=manifest.actions.length+manifest.events.length+manifest.startup.length>0,platformOk=supportsPlatform({},manifest,currentPluginPlatform()),settings=pluginSettingRows(manifest.settings,settingValues)}catch{declares=null}return{id:entry.id,version:entry.version,enabled:entry.enabled,linked:entry.source.kind==="link",source:entry.source.kind==="link"?entry.root:entry.source.spec,declares,platformOk,hooksDeclared,lastRun:parseLastRun(logText),settings,updateAvailable:outdated.has(entry.id),pageErrors,builtIn:!1}}var LOG_TAIL_BYTES=65536;function readTail(path2){let fd;try{let size=statSync3(path2).size,length=Math.min(size,LOG_TAIL_BYTES),buf=Buffer.alloc(length);return fd=openSync2(path2,"r"),readSync2(fd,buf,0,length,size-length),buf.toString("utf8")}catch{return null}finally{if(fd!==void 0)closeSync2(fd)}}function readTextOrNull(path2){if(!path2)return null;try{return readFileSync3(path2,"utf8")}catch{return null}}function readPluginRows(builtIns=[],homeDir){let outdated=new Set(readOutdatedCache(homeDir)),registered=loadPluginRegistry(homeDir).plugins.map((entry)=>pluginRowView(outdated,entry,readTextOrNull(pluginManifestPath(entry.root)),readTail(pluginLogPath(entry.id,homeDir)),readPluginSettings(entry.id,homeDir),pluginPageErrors().filter((error)=>error.pluginId===entry.id).map((error)=>`${error.pageId}: ${error.message}`)));return[...builtIns.map(builtInRowView),...registered]}function setPluginSetting(pluginId,key,value,homeDir){writePluginSettings(pluginId,{[key]:value},homeDir)}function setPluginEnabled(id,enabled,homeDir){let registry=loadPluginRegistry(homeDir);savePluginRegistry({plugins:registry.plugins.map((p)=>p.id===id?{...p,enabled}:p)},homeDir),reloadPluginEngines(homeDir)}
42
- export{SCROLLBACK_ROWS_KEY,DEFAULT_SCROLLBACK_ROWS,SCROLLBACK_ROWS_MIN,SCROLLBACK_ROWS_MAX,normalizeScrollbackRows,persistedScrollbackRows,relativeBuckets,relativeAge,asAttachmentPaths,attachmentLabel,appendAttachmentRefs,captureClipboardAttachment,withImagePlaceholders,ISSUE_CHAT_PLACEMENTS,issueChatTaskTitle,issueWorktreePrompt2 as issueWorktreePrompt,issueProjectPrompt2 as issueProjectPrompt,DEFAULT_BASE_REF,validateRepoPath,pathProblem,repoProblem,isUnborn,getCurrentBranch,branchOf,listLocalBranches,branchesOf,truncateEnd,truncateEndCells,truncateStartCells,reconcileStableRows,compareNewest,compareRecent,nameCollator,compareName,repoBasename,sidebarProjectKeyOfTask,isNoProjectTask,sidebarProjectKeyResolver,sidebarRepoLabel,sidebarProjectLabel,EVENT_FEED_LIMIT,detailFragment,eventRows,pluginPageErrorState,WORKING_BORDER_KEY,DEFAULT_WORKING_BORDER,normalizeWorkingBorder,fuzzyMatch,groupBindings,legendCap,grammarHelpSections,scopeCategory,guideCategory,matchesHelpAction,PREFIX_TAP_PRESENTATION_KEY,PREFIX_TAP_PRESENTATIONS,DEFAULT_PREFIX_TAP_PRESENTATION,normalizePrefixTapPresentation,SPLIT_STYLE_KEY,normalizeSplitStyle,sendFileToMachine,TASK_COLORS_KEY,DEFAULT_TASK_COLORS,normalizeTaskColors,taskColor,planSelfRefresh,relaunchSelf,spawnDetached,openExternally,revealInFileManager,GLYPH_SET_KEY,DEFAULT_GLYPH_SET,normalizeGlyphSet,GLYPH_SETS,DEFAULT_GLYPHS,COLORBLIND_KEY,DEFAULT_COLORBLIND,normalizeColorblind,USAGE_SHOW_KEY,USAGE_SHOWS,normalizeUsageShow,shownPercent,rowLiveBranchPath,conversationTitleOf,isNamedDir,worktreeRowLabel,engineIntegrations,enginesNeedingHookInstall,enginesWithHooksInstalled,deriveFolderName,validateGitUrl,validateCloneTarget,resolveCloneTarget,findAvailableFolderName,cloneRepo,editableBindings,RUNNING_TITLE_KEY,DEFAULT_RUNNING_TITLE,normalizeRunningTitle,APPEARANCE_SETTINGS,appearanceChoices,applyAppearanceChoice,currentAppearanceChoice,SECTIONS,languageRowId,prefixTapPresentationRowId,generalRows,autoRoutingRows,displayEndpoint,keybindingRowId,keybindingRows,devRows,sectionRows,rowIndex,rowAt,SECTIONS_SIDEBAR_WIDTH,generalLabelLayout,subscribeBackgroundPolls,createBackgroundPoller,displaySettingValue,isBooleanOn,nextEnumValue,toggledBooleanValue,normalizeNumberInput,findFileHandler,readPluginRows,setPluginSetting,setPluginEnabled,TAB_STRIP_MODE_KEY,TAB_STRIP_MODES,TAB_STRIP_HIDE_SINGLE_KEY,resolveTabStripMode,tabStripVisible,detectWorktreeOpener,openWorktree,formatDiffComments,unsentComments,unifiedDiffRows,commentRange,computeReviewPaint,commentAtRow,diffCommentsKey,buildDiffReview,gatherPRPromptState,buildPRPrompt};
42
+ export{SCROLLBACK_ROWS_KEY,DEFAULT_SCROLLBACK_ROWS,SCROLLBACK_ROWS_MIN,SCROLLBACK_ROWS_MAX,normalizeScrollbackRows,persistedScrollbackRows,relativeBuckets,relativeAge,asAttachmentPaths,attachmentLabel,appendAttachmentRefs,captureClipboardAttachment,withImagePlaceholders,ISSUE_CHAT_PLACEMENTS,issueChatTaskTitle,issueWorktreePrompt2 as issueWorktreePrompt,issueProjectPrompt2 as issueProjectPrompt,DEFAULT_BASE_REF,validateRepoPath,pathProblem,repoProblem,isUnborn,getCurrentBranch,branchOf,listLocalBranches,branchesOf,truncateEnd,truncateEndCells,truncateStartCells,reconcileStableRows,compareNewest,compareRecent,nameCollator,compareName,repoBasename,sidebarProjectKeyOfTask,isNoProjectTask,sidebarProjectKeyResolver,sidebarRepoLabel,sidebarProjectLabel,EVENT_FEED_LIMIT,detailFragment,eventRows,pluginPageErrorState,WORKING_BORDER_KEY,DEFAULT_WORKING_BORDER,normalizeWorkingBorder,fuzzyMatch,groupBindings,legendCap,grammarHelpSections,scopeCategory,guideCategory,matchesHelpAction,PREFIX_TAP_PRESENTATION_KEY,PREFIX_TAP_PRESENTATIONS,DEFAULT_PREFIX_TAP_PRESENTATION,normalizePrefixTapPresentation,SPLIT_STYLE_KEY,normalizeSplitStyle,sendFileToMachine,TASK_COLORS_KEY,DEFAULT_TASK_COLORS,normalizeTaskColors,taskColor,planSelfRefresh,relaunchSelf,spawnDetached,openExternally,revealInFileManager,COLORBLIND_KEY,DEFAULT_COLORBLIND,normalizeColorblind,USAGE_SHOW_KEY,USAGE_SHOWS,normalizeUsageShow,shownPercent,GLYPH_SET_KEY,DEFAULT_GLYPH_SET,normalizeGlyphSet,GLYPH_SETS,DEFAULT_GLYPHS,rowLiveBranchPath,conversationTitleOf,isNamedDir,worktreeRowLabel,engineIntegrations,enginesNeedingHookInstall,enginesWithHooksInstalled,deriveFolderName,validateGitUrl,validateCloneTarget,resolveCloneTarget,findAvailableFolderName,cloneRepo,editableBindings,RUNNING_TITLE_KEY,DEFAULT_RUNNING_TITLE,normalizeRunningTitle,APPEARANCE_SETTINGS,appearanceChoices,applyAppearanceChoice,currentAppearanceChoice,SECTIONS,languageRowId,prefixTapPresentationRowId,generalRows,autoRoutingRows,displayEndpoint,keybindingRowId,keybindingRows,devRows,sectionRows,rowIndex,rowAt,SECTIONS_SIDEBAR_WIDTH,generalLabelLayout,subscribeBackgroundPolls,createBackgroundPoller,displaySettingValue,isBooleanOn,nextEnumValue,toggledBooleanValue,normalizeNumberInput,findFileHandler,readPluginRows,setPluginSetting,setPluginEnabled,TAB_STRIP_MODE_KEY,TAB_STRIP_MODES,TAB_STRIP_HIDE_SINGLE_KEY,resolveTabStripMode,tabStripVisible,detectWorktreeOpener,openWorktree,formatDiffComments,unsentComments,unifiedDiffRows,commentRange,computeReviewPaint,commentAtRow,diffCommentsKey,buildDiffReview,gatherPRPromptState,buildPRPrompt};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{stampOrigin}from"./chunk-nwz00nba.js";import{createStateCell}from"./chunk-cmp64q4j.js";var NO_LIVE={activity:new Map,changes:new Map,tokens:new Map};function decodeMachines(payload){let p=payload;if(!p||!Array.isArray(p.machines)||!Array.isArray(p.tasks)||!p.live||typeof p.live!=="object")return null;let map=(value)=>new Map(value&&typeof value==="object"?Object.entries(value):[]);return{machines:p.machines,tasks:p.tasks,live:{activity:map(p.live.activity),changes:map(p.live.changes),tokens:map(p.live.tokens)}}}class MachineFeed{local;machinesAcc=createStateCell([],"machines.status");remoteTasksAcc=createStateCell(null,"machines.remoteTasks");tasksAcc;merged=null;liveAcc=createStateCell(NO_LIVE,"machines.live");stops;constructor(local){this.local=local;this.tasksAcc=this.mergedTasks();let raw=local.rawChannelSignal("machines"),take=()=>{let next=decodeMachines(raw.get());if(!next)return;this.machinesAcc.set(next.machines),this.liveAcc.set(next.live),this.remoteTasksAcc.set(next.machines.length===0?null:next.tasks)};this.stops=[raw.subscribe(take)],take()}machinesSignal(){return this.machinesAcc}tasksSignal(){return this.tasksAcc}liveSignal(){return this.liveAcc}mergedTasks(){let localTasks=this.local.tasksSignal(),get=()=>{let local=localTasks.get(),remote=this.remoteTasksAcc.get();if(remote===null)return local;if(this.merged?.local!==local||this.merged.remote!==remote){let value=[...local.map((task)=>stampOrigin(task,"local","local")),...remote];this.merged={local,remote,value}}return this.merged.value},state=get;return state.get=get,state.subscribe=(listener)=>{let stopLocal=localTasks.subscribe(listener),stopRemote=this.remoteTasksAcc.subscribe(listener);return()=>{stopLocal(),stopRemote()}},state}dispose(){for(let stop of this.stops)stop()}}
2
+ import{stampOrigin}from"./chunk-b7rxn7c9.js";import{createStateCell}from"./chunk-cmp64q4j.js";var NO_LIVE={activity:new Map,changes:new Map,tokens:new Map};function decodeMachines(payload){let p=payload;if(!p||!Array.isArray(p.machines)||!Array.isArray(p.tasks)||!p.live||typeof p.live!=="object")return null;let map=(value)=>new Map(value&&typeof value==="object"?Object.entries(value):[]);return{machines:p.machines,tasks:p.tasks,live:{activity:map(p.live.activity),changes:map(p.live.changes),tokens:map(p.live.tokens)}}}class MachineFeed{local;machinesAcc=createStateCell([],"machines.status");remoteTasksAcc=createStateCell(null,"machines.remoteTasks");tasksAcc;merged=null;liveAcc=createStateCell(NO_LIVE,"machines.live");stops;constructor(local){this.local=local;this.tasksAcc=this.mergedTasks();let raw=local.rawChannelSignal("machines"),take=()=>{let next=decodeMachines(raw.get());if(!next)return;this.machinesAcc.set(next.machines),this.liveAcc.set(next.live),this.remoteTasksAcc.set(next.machines.length===0?null:next.tasks)};this.stops=[raw.subscribe(take)],take()}machinesSignal(){return this.machinesAcc}tasksSignal(){return this.tasksAcc}liveSignal(){return this.liveAcc}mergedTasks(){let localTasks=this.local.tasksSignal(),get=()=>{let local=localTasks.get(),remote=this.remoteTasksAcc.get();if(remote===null)return local;if(this.merged?.local!==local||this.merged.remote!==remote){let value=[...local.map((task)=>stampOrigin(task,"local","local")),...remote];this.merged={local,remote,value}}return this.merged.value},state=get;return state.get=get,state.subscribe=(listener)=>{let stopLocal=localTasks.subscribe(listener),stopRemote=this.remoteTasksAcc.subscribe(listener);return()=>{stopLocal(),stopRemote()}},state}dispose(){for(let stop of this.stops)stop()}}
3
3
  export{decodeMachines,MachineFeed};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{invokeVerb}from"./chunk-06kf5yg7.js";import"./chunk-m1dgjq5f.js";import{defaultApiRuntime,loadContext}from"./chunk-0et8q8pm.js";import"./chunk-vn0rnzyt.js";import{ensurePluginEnginesLoaded}from"./chunk-8hfkcjxm.js";import"./chunk-h9z9x14k.js";import"./chunk-j2k6f128.js";import"./chunk-38hnq4aq.js";import"./chunk-rset5pt8.js";import"./chunk-17e2tgyg.js";import"./chunk-2xsxcdp6.js";import"./chunk-79wejcs5.js";import"./chunk-vpm8dfyg.js";import"./chunk-q8ffd1pc.js";import"./chunk-je7egpqh.js";import"./chunk-2bgmby1d.js";import"./chunk-5mhvjytn.js";import"./chunk-d1vv8xk6.js";import"./chunk-psxhek7n.js";import"./chunk-r0p3qshx.js";import"./chunk-bpvx5c14.js";import"./chunk-mdx18vtz.js";import"./chunk-gx3j06wx.js";import"./chunk-7108m3qy.js";import"./chunk-6h8sxpmj.js";import"./chunk-nb99x2kt.js";import"./chunk-q6qmv2jq.js";import"./chunk-y0e28qha.js";import"./chunk-qkehg2c1.js";import"./chunk-2x6s7z8w.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import"./chunk-fphcr46j.js";import{SUBCOMMAND_VERBS}from"./chunk-p9an6jcq.js";import"./chunk-d6nhhxmh.js";import"./chunk-fpecy1fw.js";import"./chunk-0x62tvdk.js";import"./chunk-y0skz8j9.js";import"./chunk-mqfvzdpr.js";import"./chunk-r2ez4ker.js";import"./chunk-rxqdw6s5.js";import"./chunk-xe3zr5b9.js";import"./chunk-gzn14mwk.js";import"./chunk-hafbyy9x.js";import"./chunk-abrs0bnr.js";import"./chunk-zc7e78mv.js";import"./chunk-han0d078.js";import"./chunk-nw48bskt.js";import{ApiError}from"./chunk-jz1kj4sf.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-g9ba25q5.js";import"./chunk-133c884f.js";import"./chunk-catrr0z3.js";import"./chunk-xjrkvksc.js";import"./chunk-tn9gtf18.js";import"./chunk-ahbw1f8n.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-rz5sspn8.js";import"./chunk-hmfqyvet.js";import"./chunk-2bapg0v2.js";import"./chunk-w7zv47mp.js";import{connectIfRunning}from"./chunk-k7tdg6kb.js";import"./chunk-1pmzr8kr.js";import"./chunk-e5jxbd98.js";import{RoveDaemonClient,automationRunNeedsAttention}from"./chunk-84q9hv7m.js";import"./chunk-96kvwzj8.js";import"./chunk-etfh8f4z.js";import{getSavedRepos}from"./chunk-07665jz6.js";import"./chunk-40dgv828.js";import"./chunk-zsfyj36g.js";import"./chunk-1feav1w3.js";import"./chunk-9gctbddn.js";import"./chunk-mg1cas61.js";import"./chunk-yvg46jh9.js";import"./chunk-xasg8z9e.js";import"./chunk-yv86xb1s.js";import"./chunk-cmp64q4j.js";import"./chunk-j152pk57.js";import"./chunk-c4dfktv2.js";import"./chunk-bdmbevk8.js";import"./chunk-7kysxgbq.js";import"./chunk-g755p68b.js";import"./chunk-tcmzq86w.js";import"./chunk-y8hjgmn0.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-m5nd44st.js";import"./chunk-rxb0hw1e.js";import"./chunk-tw25g9g5.js";import"./chunk-yt15y085.js";import{resolveDaemonHomeDir}from"./chunk-2z2jwetd.js";import"./chunk-8143k3t6.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-g6wb8p4p.js";import{ROVE_STATE_DIR_BASENAME,readRoveEnv}from"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import{__commonJS,__toESM}from"./chunk-91sykzqq.js";var require_QRMode=__commonJS((exports,module)=>{module.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}});var require_QR8bitByte=__commonJS((exports,module)=>{var QRMode=require_QRMode();function QR8bitByte(data){this.mode=QRMode.MODE_8BIT_BYTE,this.data=data}QR8bitByte.prototype={getLength:function(){return this.data.length},write:function(buffer){for(var i=0;i<this.data.length;i++)buffer.put(this.data.charCodeAt(i),8)}};module.exports=QR8bitByte});var require_QRMath=__commonJS((exports,module)=>{var QRMath={glog:function(n){if(n<1)throw Error("glog("+n+")");return QRMath.LOG_TABLE[n]},gexp:function(n){while(n<0)n+=255;while(n>=256)n-=255;return QRMath.EXP_TABLE[n]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)};for(i=0;i<8;i++)QRMath.EXP_TABLE[i]=1<<i;var i;for(i=8;i<256;i++)QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];var i;for(i=0;i<255;i++)QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;var i;module.exports=QRMath});var require_QRPolynomial=__commonJS((exports,module)=>{var QRMath=require_QRMath();function QRPolynomial(num,shift){if(num.length===void 0)throw Error(num.length+"/"+shift);var offset=0;while(offset<num.length&&num[offset]===0)offset++;this.num=Array(num.length-offset+shift);for(var i=0;i<num.length-offset;i++)this.num[i]=num[i+offset]}QRPolynomial.prototype={get:function(index){return this.num[index]},getLength:function(){return this.num.length},multiply:function(e){var num=Array(this.getLength()+e.getLength()-1);for(var i=0;i<this.getLength();i++)for(var j=0;j<e.getLength();j++)num[i+j]^=QRMath.gexp(QRMath.glog(this.get(i))+QRMath.glog(e.get(j)));return new QRPolynomial(num,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;var ratio=QRMath.glog(this.get(0))-QRMath.glog(e.get(0)),num=Array(this.getLength());for(var i=0;i<this.getLength();i++)num[i]=this.get(i);for(var x=0;x<e.getLength();x++)num[x]^=QRMath.gexp(QRMath.glog(e.get(x))+ratio);return new QRPolynomial(num,0).mod(e)}};module.exports=QRPolynomial});var require_QRMaskPattern=__commonJS((exports,module)=>{module.exports={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7}});var require_QRUtil=__commonJS((exports,module)=>{var QRMode=require_QRMode(),QRPolynomial=require_QRPolynomial(),QRMath=require_QRMath(),QRMaskPattern=require_QRMaskPattern(),QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(data){var d=data<<10;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)>=0)d^=QRUtil.G15<<QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15);return(data<<10|d)^QRUtil.G15_MASK},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0)d^=QRUtil.G18<<QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18);return data<<12|d},getBCHDigit:function(data){var digit=0;while(data!==0)digit++,data>>>=1;return digit},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1]},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2===0;case QRMaskPattern.PATTERN001:return i%2===0;case QRMaskPattern.PATTERN010:return j%3===0;case QRMaskPattern.PATTERN011:return(i+j)%3===0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2===0;case QRMaskPattern.PATTERN101:return i*j%2+i*j%3===0;case QRMaskPattern.PATTERN110:return(i*j%2+i*j%3)%2===0;case QRMaskPattern.PATTERN111:return(i*j%3+(i+j)%2)%2===0;default:throw Error("bad maskPattern:"+maskPattern)}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i<errorCorrectLength;i++)a=a.multiply(new QRPolynomial([1,QRMath.gexp(i)],0));return a},getLengthInBits:function(mode,type){if(1<=type&&type<10)switch(mode){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw Error("mode:"+mode)}else if(type<27)switch(mode){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw Error("mode:"+mode)}else if(type<41)switch(mode){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw Error("mode:"+mode)}else throw Error("type:"+type)},getLostPoint:function(qrCode){var moduleCount=qrCode.getModuleCount(),lostPoint=0,row=0,col=0;for(row=0;row<moduleCount;row++)for(col=0;col<moduleCount;col++){var sameCount=0,dark=qrCode.isDark(row,col);for(var r=-1;r<=1;r++){if(row+r<0||moduleCount<=row+r)continue;for(var c=-1;c<=1;c++){if(col+c<0||moduleCount<=col+c)continue;if(r===0&&c===0)continue;if(dark===qrCode.isDark(row+r,col+c))sameCount++}}if(sameCount>5)lostPoint+=3+sameCount-5}for(row=0;row<moduleCount-1;row++)for(col=0;col<moduleCount-1;col++){var count=0;if(qrCode.isDark(row,col))count++;if(qrCode.isDark(row+1,col))count++;if(qrCode.isDark(row,col+1))count++;if(qrCode.isDark(row+1,col+1))count++;if(count===0||count===4)lostPoint+=3}for(row=0;row<moduleCount;row++)for(col=0;col<moduleCount-6;col++)if(qrCode.isDark(row,col)&&!qrCode.isDark(row,col+1)&&qrCode.isDark(row,col+2)&&qrCode.isDark(row,col+3)&&qrCode.isDark(row,col+4)&&!qrCode.isDark(row,col+5)&&qrCode.isDark(row,col+6))lostPoint+=40;for(col=0;col<moduleCount;col++)for(row=0;row<moduleCount-6;row++)if(qrCode.isDark(row,col)&&!qrCode.isDark(row+1,col)&&qrCode.isDark(row+2,col)&&qrCode.isDark(row+3,col)&&qrCode.isDark(row+4,col)&&!qrCode.isDark(row+5,col)&&qrCode.isDark(row+6,col))lostPoint+=40;var darkCount=0;for(col=0;col<moduleCount;col++)for(row=0;row<moduleCount;row++)if(qrCode.isDark(row,col))darkCount++;var ratio=Math.abs(100*darkCount/moduleCount/moduleCount-50)/5;return lostPoint+=ratio*10,lostPoint}};module.exports=QRUtil});var require_QRErrorCorrectLevel=__commonJS((exports,module)=>{module.exports={L:1,M:0,Q:3,H:2}});var require_QRRSBlock=__commonJS((exports,module)=>{var QRErrorCorrectLevel=require_QRErrorCorrectLevel();function QRRSBlock(totalCount,dataCount){this.totalCount=totalCount,this.dataCount=dataCount}QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];QRRSBlock.getRSBlocks=function(typeNumber,errorCorrectLevel){var rsBlock=QRRSBlock.getRsBlockTable(typeNumber,errorCorrectLevel);if(rsBlock===void 0)throw Error("bad rs block @ typeNumber:"+typeNumber+"/errorCorrectLevel:"+errorCorrectLevel);var length=rsBlock.length/3,list=[];for(var i=0;i<length;i++){var count=rsBlock[i*3+0],totalCount=rsBlock[i*3+1],dataCount=rsBlock[i*3+2];for(var j=0;j<count;j++)list.push(new QRRSBlock(totalCount,dataCount))}return list};QRRSBlock.getRsBlockTable=function(typeNumber,errorCorrectLevel){switch(errorCorrectLevel){case QRErrorCorrectLevel.L:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+0];case QRErrorCorrectLevel.M:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+1];case QRErrorCorrectLevel.Q:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+2];case QRErrorCorrectLevel.H:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+3];default:return}};module.exports=QRRSBlock});var require_QRBitBuffer=__commonJS((exports,module)=>{function QRBitBuffer(){this.buffer=[],this.length=0}QRBitBuffer.prototype={get:function(index){var bufIndex=Math.floor(index/8);return(this.buffer[bufIndex]>>>7-index%8&1)==1},put:function(num,length){for(var i=0;i<length;i++)this.putBit((num>>>length-i-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex)this.buffer.push(0);if(bit)this.buffer[bufIndex]|=128>>>this.length%8;this.length++}};module.exports=QRBitBuffer});var require_QRCode=__commonJS((exports,module)=>{var QR8bitByte=require_QR8bitByte(),QRUtil=require_QRUtil(),QRPolynomial=require_QRPolynomial(),QRRSBlock=require_QRRSBlock(),QRBitBuffer=require_QRBitBuffer();function QRCode(typeNumber,errorCorrectLevel){this.typeNumber=typeNumber,this.errorCorrectLevel=errorCorrectLevel,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}QRCode.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData),this.dataCache=null},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col)throw Error(row+","+col);return this.modules[row][col]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var typeNumber=1;for(typeNumber=1;typeNumber<40;typeNumber++){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,this.errorCorrectLevel),buffer=new QRBitBuffer,totalDataCount=0;for(var i=0;i<rsBlocks.length;i++)totalDataCount+=rsBlocks[i].dataCount;for(var x=0;x<this.dataList.length;x++){var data=this.dataList[x];buffer.put(data.mode,4),buffer.put(data.getLength(),QRUtil.getLengthInBits(data.mode,typeNumber)),data.write(buffer)}if(buffer.getLengthInBits()<=totalDataCount*8)break}this.typeNumber=typeNumber}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17,this.modules=Array(this.moduleCount);for(var row=0;row<this.moduleCount;row++){this.modules[row]=Array(this.moduleCount);for(var col=0;col<this.moduleCount;col++)this.modules[row][col]=null}if(this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(test,maskPattern),this.typeNumber>=7)this.setupTypeNumber(test);if(this.dataCache===null)this.dataCache=QRCode.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);this.mapData(this.dataCache,maskPattern)},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if(0<=r&&r<=6&&(c===0||c===6)||0<=c&&c<=6&&(r===0||r===6)||2<=r&&r<=4&&2<=c&&c<=4)this.modules[row+r][col+c]=!0;else this.modules[row+r][col+c]=!1}}},getBestMaskPattern:function(){var minLostPoint=0,pattern=0;for(var i=0;i<8;i++){this.makeImpl(!0,i);var lostPoint=QRUtil.getLostPoint(this);if(i===0||minLostPoint>lostPoint)minLostPoint=lostPoint,pattern=i}return pattern},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth),cs=1;this.make();for(var row=0;row<this.modules.length;row++){var y=row*cs;for(var col=0;col<this.modules[row].length;col++){var x=col*cs,dark=this.modules[row][col];if(dark)qr_mc.beginFill(0,100),qr_mc.moveTo(x,y),qr_mc.lineTo(x+cs,y),qr_mc.lineTo(x+cs,y+cs),qr_mc.lineTo(x,y+cs),qr_mc.endFill()}}return qr_mc},setupTimingPattern:function(){for(var r=8;r<this.moduleCount-8;r++){if(this.modules[r][6]!==null)continue;this.modules[r][6]=r%2===0}for(var c=8;c<this.moduleCount-8;c++){if(this.modules[6][c]!==null)continue;this.modules[6][c]=c%2===0}},setupPositionAdjustPattern:function(){var pos=QRUtil.getPatternPosition(this.typeNumber);for(var i=0;i<pos.length;i++)for(var j=0;j<pos.length;j++){var row=pos[i],col=pos[j];if(this.modules[row][col]!==null)continue;for(var r=-2;r<=2;r++)for(var c=-2;c<=2;c++)if(Math.abs(r)===2||Math.abs(c)===2||r===0&&c===0)this.modules[row+r][col+c]=!0;else this.modules[row+r][col+c]=!1}},setupTypeNumber:function(test){var bits=QRUtil.getBCHTypeNumber(this.typeNumber),mod;for(var i=0;i<18;i++)mod=!test&&(bits>>i&1)===1,this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;for(var x=0;x<18;x++)mod=!test&&(bits>>x&1)===1,this.modules[x%3+this.moduleCount-8-3][Math.floor(x/3)]=mod},setupTypeInfo:function(test,maskPattern){var data=this.errorCorrectLevel<<3|maskPattern,bits=QRUtil.getBCHTypeInfo(data),mod;for(var v=0;v<15;v++)if(mod=!test&&(bits>>v&1)===1,v<6)this.modules[v][8]=mod;else if(v<8)this.modules[v+1][8]=mod;else this.modules[this.moduleCount-15+v][8]=mod;for(var h=0;h<15;h++)if(mod=!test&&(bits>>h&1)===1,h<8)this.modules[8][this.moduleCount-h-1]=mod;else if(h<9)this.modules[8][15-h-1+1]=mod;else this.modules[8][15-h-1]=mod;this.modules[this.moduleCount-8][8]=!test},mapData:function(data,maskPattern){var inc=-1,row=this.moduleCount-1,bitIndex=7,byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col===6)col--;while(!0){for(var c=0;c<2;c++)if(this.modules[row][col-c]===null){var dark=!1;if(byteIndex<data.length)dark=(data[byteIndex]>>>bitIndex&1)===1;var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask)dark=!dark;if(this.modules[row][col-c]=dark,bitIndex--,bitIndex===-1)byteIndex++,bitIndex=7}if(row+=inc,row<0||this.moduleCount<=row){row-=inc,inc=-inc;break}}}}};QRCode.PAD0=236;QRCode.PAD1=17;QRCode.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel),buffer=new QRBitBuffer;for(var i=0;i<dataList.length;i++){var data=dataList[i];buffer.put(data.mode,4),buffer.put(data.getLength(),QRUtil.getLengthInBits(data.mode,typeNumber)),data.write(buffer)}var totalDataCount=0;for(var x=0;x<rsBlocks.length;x++)totalDataCount+=rsBlocks[x].dataCount;if(buffer.getLengthInBits()>totalDataCount*8)throw Error("code length overflow. ("+buffer.getLengthInBits()+">"+totalDataCount*8+")");if(buffer.getLengthInBits()+4<=totalDataCount*8)buffer.put(0,4);while(buffer.getLengthInBits()%8!==0)buffer.putBit(!1);while(!0){if(buffer.getLengthInBits()>=totalDataCount*8)break;if(buffer.put(QRCode.PAD0,8),buffer.getLengthInBits()>=totalDataCount*8)break;buffer.put(QRCode.PAD1,8)}return QRCode.createBytes(buffer,rsBlocks)};QRCode.createBytes=function(buffer,rsBlocks){var offset=0,maxDcCount=0,maxEcCount=0,dcdata=Array(rsBlocks.length),ecdata=Array(rsBlocks.length);for(var r=0;r<rsBlocks.length;r++){var dcCount=rsBlocks[r].dataCount,ecCount=rsBlocks[r].totalCount-dcCount;maxDcCount=Math.max(maxDcCount,dcCount),maxEcCount=Math.max(maxEcCount,ecCount),dcdata[r]=Array(dcCount);for(var i=0;i<dcdata[r].length;i++)dcdata[r][i]=255&buffer.buffer[i+offset];offset+=dcCount;var rsPoly=QRUtil.getErrorCorrectPolynomial(ecCount),rawPoly=new QRPolynomial(dcdata[r],rsPoly.getLength()-1),modPoly=rawPoly.mod(rsPoly);ecdata[r]=Array(rsPoly.getLength()-1);for(var x=0;x<ecdata[r].length;x++){var modIndex=x+modPoly.getLength()-ecdata[r].length;ecdata[r][x]=modIndex>=0?modPoly.get(modIndex):0}}var totalCodeCount=0;for(var y=0;y<rsBlocks.length;y++)totalCodeCount+=rsBlocks[y].totalCount;var data=Array(totalCodeCount),index=0;for(var z=0;z<maxDcCount;z++)for(var s=0;s<rsBlocks.length;s++)if(z<dcdata[s].length)data[index++]=dcdata[s][z];for(var xx=0;xx<maxEcCount;xx++)for(var t=0;t<rsBlocks.length;t++)if(xx<ecdata[t].length)data[index++]=ecdata[t][xx];return data};module.exports=QRCode});var require_main=__commonJS((exports,module)=>{var QRCode=require_QRCode(),QRErrorCorrectLevel=require_QRErrorCorrectLevel(),black="\x1B[40m \x1B[0m",white="\x1B[47m \x1B[0m",toCell=function(isBlack){return isBlack?black:white},repeat=function(color){return{times:function(count){return Array(count).join(color)}}},fill=function(length,value){var arr=Array(length);for(var i=0;i<length;i++)arr[i]=value;return arr};module.exports={error:QRErrorCorrectLevel.L,generate:function(input,opts,cb){if(typeof opts==="function")cb=opts,opts={};var qrcode=new QRCode(-1,this.error);qrcode.addData(input),qrcode.make();var output="";if(opts&&opts.small){var BLACK=!0,WHITE=!1,moduleCount=qrcode.getModuleCount(),moduleData=qrcode.modules.slice(),oddRow=moduleCount%2===1;if(oddRow)moduleData.push(fill(moduleCount,WHITE));var platte={WHITE_ALL:"\u2588",WHITE_BLACK:"\u2580",BLACK_WHITE:"\u2584",BLACK_ALL:" "},borderTop=repeat(platte.BLACK_WHITE).times(moduleCount+3),borderBottom=repeat(platte.WHITE_BLACK).times(moduleCount+3);output+=borderTop+`
2
+ import{invokeVerb}from"./chunk-3jh1cfdj.js";import"./chunk-am70fwd0.js";import{defaultApiRuntime,loadContext}from"./chunk-gafj4yp3.js";import"./chunk-t4reqv8m.js";import{ensurePluginEnginesLoaded}from"./chunk-8hfkcjxm.js";import"./chunk-h9z9x14k.js";import"./chunk-j2k6f128.js";import"./chunk-38hnq4aq.js";import"./chunk-rset5pt8.js";import"./chunk-17e2tgyg.js";import"./chunk-2xsxcdp6.js";import"./chunk-79wejcs5.js";import"./chunk-6cggsxpr.js";import"./chunk-q8ffd1pc.js";import"./chunk-je7egpqh.js";import"./chunk-2bgmby1d.js";import"./chunk-5mhvjytn.js";import"./chunk-d1vv8xk6.js";import"./chunk-psxhek7n.js";import"./chunk-pf3nzz87.js";import"./chunk-xj3034s1.js";import"./chunk-mdx18vtz.js";import"./chunk-p4rhkv3k.js";import"./chunk-zc67sqet.js";import"./chunk-ejs6dnxf.js";import"./chunk-a6s52zm5.js";import"./chunk-y0e28qha.js";import"./chunk-qkehg2c1.js";import"./chunk-2x6s7z8w.js";import"./chunk-t7j8g9f6.js";import"./chunk-dmzg9zdc.js";import"./chunk-kg9kmwt9.js";import"./chunk-6xppe9bj.js";import"./chunk-s2eezz0a.js";import{SUBCOMMAND_VERBS}from"./chunk-6jxe4f13.js";import"./chunk-06vsvvtr.js";import"./chunk-zze1pw22.js";import"./chunk-0x62tvdk.js";import"./chunk-y0skz8j9.js";import"./chunk-mqfvzdpr.js";import"./chunk-4whghfgg.js";import"./chunk-rxqdw6s5.js";import"./chunk-xe3zr5b9.js";import"./chunk-gzn14mwk.js";import"./chunk-t7qj639x.js";import"./chunk-gz0x179r.js";import{ApiError}from"./chunk-jz1kj4sf.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-g9ba25q5.js";import"./chunk-133c884f.js";import"./chunk-catrr0z3.js";import"./chunk-xjrkvksc.js";import"./chunk-tn9gtf18.js";import"./chunk-ahbw1f8n.js";import"./chunk-sak1tphp.js";import"./chunk-y1xnjx8x.js";import"./chunk-sffdpzfv.js";import"./chunk-5dv7pw3w.js";import"./chunk-2bapg0v2.js";import"./chunk-750rk2xz.js";import"./chunk-w7zv47mp.js";import"./chunk-cw9h73h5.js";import"./chunk-37g0yabr.js";import"./chunk-nw48bskt.js";import{connectIfRunning}from"./chunk-k7tdg6kb.js";import"./chunk-1pmzr8kr.js";import"./chunk-e5jxbd98.js";import{RoveDaemonClient,automationRunNeedsAttention}from"./chunk-84q9hv7m.js";import"./chunk-96kvwzj8.js";import"./chunk-etfh8f4z.js";import{getSavedRepos}from"./chunk-07665jz6.js";import"./chunk-40dgv828.js";import"./chunk-zsfyj36g.js";import"./chunk-1feav1w3.js";import"./chunk-9gctbddn.js";import"./chunk-mg1cas61.js";import"./chunk-yvg46jh9.js";import"./chunk-xasg8z9e.js";import"./chunk-8xdhw922.js";import"./chunk-cmp64q4j.js";import"./chunk-j152pk57.js";import"./chunk-c4dfktv2.js";import"./chunk-bdmbevk8.js";import"./chunk-7kysxgbq.js";import"./chunk-g755p68b.js";import"./chunk-tcmzq86w.js";import"./chunk-y8hjgmn0.js";import"./chunk-xy8be792.js";import"./chunk-h2m7em1e.js";import"./chunk-pn5ygqn6.js";import"./chunk-7ghwdjdc.js";import"./chunk-m5nd44st.js";import"./chunk-rxb0hw1e.js";import"./chunk-tw25g9g5.js";import"./chunk-yt15y085.js";import{resolveDaemonHomeDir}from"./chunk-2z2jwetd.js";import"./chunk-8143k3t6.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import"./chunk-g6wb8p4p.js";import{ROVE_STATE_DIR_BASENAME,readRoveEnv}from"./chunk-nc46gddg.js";import"./chunk-1mp632fj.js";import{__commonJS,__toESM}from"./chunk-91sykzqq.js";var require_QRMode=__commonJS((exports,module)=>{module.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}});var require_QR8bitByte=__commonJS((exports,module)=>{var QRMode=require_QRMode();function QR8bitByte(data){this.mode=QRMode.MODE_8BIT_BYTE,this.data=data}QR8bitByte.prototype={getLength:function(){return this.data.length},write:function(buffer){for(var i=0;i<this.data.length;i++)buffer.put(this.data.charCodeAt(i),8)}};module.exports=QR8bitByte});var require_QRMath=__commonJS((exports,module)=>{var QRMath={glog:function(n){if(n<1)throw Error("glog("+n+")");return QRMath.LOG_TABLE[n]},gexp:function(n){while(n<0)n+=255;while(n>=256)n-=255;return QRMath.EXP_TABLE[n]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)};for(i=0;i<8;i++)QRMath.EXP_TABLE[i]=1<<i;var i;for(i=8;i<256;i++)QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];var i;for(i=0;i<255;i++)QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;var i;module.exports=QRMath});var require_QRPolynomial=__commonJS((exports,module)=>{var QRMath=require_QRMath();function QRPolynomial(num,shift){if(num.length===void 0)throw Error(num.length+"/"+shift);var offset=0;while(offset<num.length&&num[offset]===0)offset++;this.num=Array(num.length-offset+shift);for(var i=0;i<num.length-offset;i++)this.num[i]=num[i+offset]}QRPolynomial.prototype={get:function(index){return this.num[index]},getLength:function(){return this.num.length},multiply:function(e){var num=Array(this.getLength()+e.getLength()-1);for(var i=0;i<this.getLength();i++)for(var j=0;j<e.getLength();j++)num[i+j]^=QRMath.gexp(QRMath.glog(this.get(i))+QRMath.glog(e.get(j)));return new QRPolynomial(num,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;var ratio=QRMath.glog(this.get(0))-QRMath.glog(e.get(0)),num=Array(this.getLength());for(var i=0;i<this.getLength();i++)num[i]=this.get(i);for(var x=0;x<e.getLength();x++)num[x]^=QRMath.gexp(QRMath.glog(e.get(x))+ratio);return new QRPolynomial(num,0).mod(e)}};module.exports=QRPolynomial});var require_QRMaskPattern=__commonJS((exports,module)=>{module.exports={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7}});var require_QRUtil=__commonJS((exports,module)=>{var QRMode=require_QRMode(),QRPolynomial=require_QRPolynomial(),QRMath=require_QRMath(),QRMaskPattern=require_QRMaskPattern(),QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(data){var d=data<<10;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)>=0)d^=QRUtil.G15<<QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15);return(data<<10|d)^QRUtil.G15_MASK},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0)d^=QRUtil.G18<<QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18);return data<<12|d},getBCHDigit:function(data){var digit=0;while(data!==0)digit++,data>>>=1;return digit},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1]},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2===0;case QRMaskPattern.PATTERN001:return i%2===0;case QRMaskPattern.PATTERN010:return j%3===0;case QRMaskPattern.PATTERN011:return(i+j)%3===0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2===0;case QRMaskPattern.PATTERN101:return i*j%2+i*j%3===0;case QRMaskPattern.PATTERN110:return(i*j%2+i*j%3)%2===0;case QRMaskPattern.PATTERN111:return(i*j%3+(i+j)%2)%2===0;default:throw Error("bad maskPattern:"+maskPattern)}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i<errorCorrectLength;i++)a=a.multiply(new QRPolynomial([1,QRMath.gexp(i)],0));return a},getLengthInBits:function(mode,type){if(1<=type&&type<10)switch(mode){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw Error("mode:"+mode)}else if(type<27)switch(mode){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw Error("mode:"+mode)}else if(type<41)switch(mode){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw Error("mode:"+mode)}else throw Error("type:"+type)},getLostPoint:function(qrCode){var moduleCount=qrCode.getModuleCount(),lostPoint=0,row=0,col=0;for(row=0;row<moduleCount;row++)for(col=0;col<moduleCount;col++){var sameCount=0,dark=qrCode.isDark(row,col);for(var r=-1;r<=1;r++){if(row+r<0||moduleCount<=row+r)continue;for(var c=-1;c<=1;c++){if(col+c<0||moduleCount<=col+c)continue;if(r===0&&c===0)continue;if(dark===qrCode.isDark(row+r,col+c))sameCount++}}if(sameCount>5)lostPoint+=3+sameCount-5}for(row=0;row<moduleCount-1;row++)for(col=0;col<moduleCount-1;col++){var count=0;if(qrCode.isDark(row,col))count++;if(qrCode.isDark(row+1,col))count++;if(qrCode.isDark(row,col+1))count++;if(qrCode.isDark(row+1,col+1))count++;if(count===0||count===4)lostPoint+=3}for(row=0;row<moduleCount;row++)for(col=0;col<moduleCount-6;col++)if(qrCode.isDark(row,col)&&!qrCode.isDark(row,col+1)&&qrCode.isDark(row,col+2)&&qrCode.isDark(row,col+3)&&qrCode.isDark(row,col+4)&&!qrCode.isDark(row,col+5)&&qrCode.isDark(row,col+6))lostPoint+=40;for(col=0;col<moduleCount;col++)for(row=0;row<moduleCount-6;row++)if(qrCode.isDark(row,col)&&!qrCode.isDark(row+1,col)&&qrCode.isDark(row+2,col)&&qrCode.isDark(row+3,col)&&qrCode.isDark(row+4,col)&&!qrCode.isDark(row+5,col)&&qrCode.isDark(row+6,col))lostPoint+=40;var darkCount=0;for(col=0;col<moduleCount;col++)for(row=0;row<moduleCount;row++)if(qrCode.isDark(row,col))darkCount++;var ratio=Math.abs(100*darkCount/moduleCount/moduleCount-50)/5;return lostPoint+=ratio*10,lostPoint}};module.exports=QRUtil});var require_QRErrorCorrectLevel=__commonJS((exports,module)=>{module.exports={L:1,M:0,Q:3,H:2}});var require_QRRSBlock=__commonJS((exports,module)=>{var QRErrorCorrectLevel=require_QRErrorCorrectLevel();function QRRSBlock(totalCount,dataCount){this.totalCount=totalCount,this.dataCount=dataCount}QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];QRRSBlock.getRSBlocks=function(typeNumber,errorCorrectLevel){var rsBlock=QRRSBlock.getRsBlockTable(typeNumber,errorCorrectLevel);if(rsBlock===void 0)throw Error("bad rs block @ typeNumber:"+typeNumber+"/errorCorrectLevel:"+errorCorrectLevel);var length=rsBlock.length/3,list=[];for(var i=0;i<length;i++){var count=rsBlock[i*3+0],totalCount=rsBlock[i*3+1],dataCount=rsBlock[i*3+2];for(var j=0;j<count;j++)list.push(new QRRSBlock(totalCount,dataCount))}return list};QRRSBlock.getRsBlockTable=function(typeNumber,errorCorrectLevel){switch(errorCorrectLevel){case QRErrorCorrectLevel.L:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+0];case QRErrorCorrectLevel.M:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+1];case QRErrorCorrectLevel.Q:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+2];case QRErrorCorrectLevel.H:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+3];default:return}};module.exports=QRRSBlock});var require_QRBitBuffer=__commonJS((exports,module)=>{function QRBitBuffer(){this.buffer=[],this.length=0}QRBitBuffer.prototype={get:function(index){var bufIndex=Math.floor(index/8);return(this.buffer[bufIndex]>>>7-index%8&1)==1},put:function(num,length){for(var i=0;i<length;i++)this.putBit((num>>>length-i-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex)this.buffer.push(0);if(bit)this.buffer[bufIndex]|=128>>>this.length%8;this.length++}};module.exports=QRBitBuffer});var require_QRCode=__commonJS((exports,module)=>{var QR8bitByte=require_QR8bitByte(),QRUtil=require_QRUtil(),QRPolynomial=require_QRPolynomial(),QRRSBlock=require_QRRSBlock(),QRBitBuffer=require_QRBitBuffer();function QRCode(typeNumber,errorCorrectLevel){this.typeNumber=typeNumber,this.errorCorrectLevel=errorCorrectLevel,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}QRCode.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData),this.dataCache=null},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col)throw Error(row+","+col);return this.modules[row][col]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var typeNumber=1;for(typeNumber=1;typeNumber<40;typeNumber++){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,this.errorCorrectLevel),buffer=new QRBitBuffer,totalDataCount=0;for(var i=0;i<rsBlocks.length;i++)totalDataCount+=rsBlocks[i].dataCount;for(var x=0;x<this.dataList.length;x++){var data=this.dataList[x];buffer.put(data.mode,4),buffer.put(data.getLength(),QRUtil.getLengthInBits(data.mode,typeNumber)),data.write(buffer)}if(buffer.getLengthInBits()<=totalDataCount*8)break}this.typeNumber=typeNumber}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17,this.modules=Array(this.moduleCount);for(var row=0;row<this.moduleCount;row++){this.modules[row]=Array(this.moduleCount);for(var col=0;col<this.moduleCount;col++)this.modules[row][col]=null}if(this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(test,maskPattern),this.typeNumber>=7)this.setupTypeNumber(test);if(this.dataCache===null)this.dataCache=QRCode.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);this.mapData(this.dataCache,maskPattern)},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if(0<=r&&r<=6&&(c===0||c===6)||0<=c&&c<=6&&(r===0||r===6)||2<=r&&r<=4&&2<=c&&c<=4)this.modules[row+r][col+c]=!0;else this.modules[row+r][col+c]=!1}}},getBestMaskPattern:function(){var minLostPoint=0,pattern=0;for(var i=0;i<8;i++){this.makeImpl(!0,i);var lostPoint=QRUtil.getLostPoint(this);if(i===0||minLostPoint>lostPoint)minLostPoint=lostPoint,pattern=i}return pattern},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth),cs=1;this.make();for(var row=0;row<this.modules.length;row++){var y=row*cs;for(var col=0;col<this.modules[row].length;col++){var x=col*cs,dark=this.modules[row][col];if(dark)qr_mc.beginFill(0,100),qr_mc.moveTo(x,y),qr_mc.lineTo(x+cs,y),qr_mc.lineTo(x+cs,y+cs),qr_mc.lineTo(x,y+cs),qr_mc.endFill()}}return qr_mc},setupTimingPattern:function(){for(var r=8;r<this.moduleCount-8;r++){if(this.modules[r][6]!==null)continue;this.modules[r][6]=r%2===0}for(var c=8;c<this.moduleCount-8;c++){if(this.modules[6][c]!==null)continue;this.modules[6][c]=c%2===0}},setupPositionAdjustPattern:function(){var pos=QRUtil.getPatternPosition(this.typeNumber);for(var i=0;i<pos.length;i++)for(var j=0;j<pos.length;j++){var row=pos[i],col=pos[j];if(this.modules[row][col]!==null)continue;for(var r=-2;r<=2;r++)for(var c=-2;c<=2;c++)if(Math.abs(r)===2||Math.abs(c)===2||r===0&&c===0)this.modules[row+r][col+c]=!0;else this.modules[row+r][col+c]=!1}},setupTypeNumber:function(test){var bits=QRUtil.getBCHTypeNumber(this.typeNumber),mod;for(var i=0;i<18;i++)mod=!test&&(bits>>i&1)===1,this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;for(var x=0;x<18;x++)mod=!test&&(bits>>x&1)===1,this.modules[x%3+this.moduleCount-8-3][Math.floor(x/3)]=mod},setupTypeInfo:function(test,maskPattern){var data=this.errorCorrectLevel<<3|maskPattern,bits=QRUtil.getBCHTypeInfo(data),mod;for(var v=0;v<15;v++)if(mod=!test&&(bits>>v&1)===1,v<6)this.modules[v][8]=mod;else if(v<8)this.modules[v+1][8]=mod;else this.modules[this.moduleCount-15+v][8]=mod;for(var h=0;h<15;h++)if(mod=!test&&(bits>>h&1)===1,h<8)this.modules[8][this.moduleCount-h-1]=mod;else if(h<9)this.modules[8][15-h-1+1]=mod;else this.modules[8][15-h-1]=mod;this.modules[this.moduleCount-8][8]=!test},mapData:function(data,maskPattern){var inc=-1,row=this.moduleCount-1,bitIndex=7,byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col===6)col--;while(!0){for(var c=0;c<2;c++)if(this.modules[row][col-c]===null){var dark=!1;if(byteIndex<data.length)dark=(data[byteIndex]>>>bitIndex&1)===1;var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask)dark=!dark;if(this.modules[row][col-c]=dark,bitIndex--,bitIndex===-1)byteIndex++,bitIndex=7}if(row+=inc,row<0||this.moduleCount<=row){row-=inc,inc=-inc;break}}}}};QRCode.PAD0=236;QRCode.PAD1=17;QRCode.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel),buffer=new QRBitBuffer;for(var i=0;i<dataList.length;i++){var data=dataList[i];buffer.put(data.mode,4),buffer.put(data.getLength(),QRUtil.getLengthInBits(data.mode,typeNumber)),data.write(buffer)}var totalDataCount=0;for(var x=0;x<rsBlocks.length;x++)totalDataCount+=rsBlocks[x].dataCount;if(buffer.getLengthInBits()>totalDataCount*8)throw Error("code length overflow. ("+buffer.getLengthInBits()+">"+totalDataCount*8+")");if(buffer.getLengthInBits()+4<=totalDataCount*8)buffer.put(0,4);while(buffer.getLengthInBits()%8!==0)buffer.putBit(!1);while(!0){if(buffer.getLengthInBits()>=totalDataCount*8)break;if(buffer.put(QRCode.PAD0,8),buffer.getLengthInBits()>=totalDataCount*8)break;buffer.put(QRCode.PAD1,8)}return QRCode.createBytes(buffer,rsBlocks)};QRCode.createBytes=function(buffer,rsBlocks){var offset=0,maxDcCount=0,maxEcCount=0,dcdata=Array(rsBlocks.length),ecdata=Array(rsBlocks.length);for(var r=0;r<rsBlocks.length;r++){var dcCount=rsBlocks[r].dataCount,ecCount=rsBlocks[r].totalCount-dcCount;maxDcCount=Math.max(maxDcCount,dcCount),maxEcCount=Math.max(maxEcCount,ecCount),dcdata[r]=Array(dcCount);for(var i=0;i<dcdata[r].length;i++)dcdata[r][i]=255&buffer.buffer[i+offset];offset+=dcCount;var rsPoly=QRUtil.getErrorCorrectPolynomial(ecCount),rawPoly=new QRPolynomial(dcdata[r],rsPoly.getLength()-1),modPoly=rawPoly.mod(rsPoly);ecdata[r]=Array(rsPoly.getLength()-1);for(var x=0;x<ecdata[r].length;x++){var modIndex=x+modPoly.getLength()-ecdata[r].length;ecdata[r][x]=modIndex>=0?modPoly.get(modIndex):0}}var totalCodeCount=0;for(var y=0;y<rsBlocks.length;y++)totalCodeCount+=rsBlocks[y].totalCount;var data=Array(totalCodeCount),index=0;for(var z=0;z<maxDcCount;z++)for(var s=0;s<rsBlocks.length;s++)if(z<dcdata[s].length)data[index++]=dcdata[s][z];for(var xx=0;xx<maxEcCount;xx++)for(var t=0;t<rsBlocks.length;t++)if(xx<ecdata[t].length)data[index++]=ecdata[t][xx];return data};module.exports=QRCode});var require_main=__commonJS((exports,module)=>{var QRCode=require_QRCode(),QRErrorCorrectLevel=require_QRErrorCorrectLevel(),black="\x1B[40m \x1B[0m",white="\x1B[47m \x1B[0m",toCell=function(isBlack){return isBlack?black:white},repeat=function(color){return{times:function(count){return Array(count).join(color)}}},fill=function(length,value){var arr=Array(length);for(var i=0;i<length;i++)arr[i]=value;return arr};module.exports={error:QRErrorCorrectLevel.L,generate:function(input,opts,cb){if(typeof opts==="function")cb=opts,opts={};var qrcode=new QRCode(-1,this.error);qrcode.addData(input),qrcode.make();var output="";if(opts&&opts.small){var BLACK=!0,WHITE=!1,moduleCount=qrcode.getModuleCount(),moduleData=qrcode.modules.slice(),oddRow=moduleCount%2===1;if(oddRow)moduleData.push(fill(moduleCount,WHITE));var platte={WHITE_ALL:"\u2588",WHITE_BLACK:"\u2580",BLACK_WHITE:"\u2584",BLACK_ALL:" "},borderTop=repeat(platte.BLACK_WHITE).times(moduleCount+3),borderBottom=repeat(platte.WHITE_BLACK).times(moduleCount+3);output+=borderTop+`
3
3
  `;for(var row=0;row<moduleCount;row+=2){output+=platte.WHITE_ALL;for(var col=0;col<moduleCount;col++)if(moduleData[row][col]===WHITE&&moduleData[row+1][col]===WHITE)output+=platte.WHITE_ALL;else if(moduleData[row][col]===WHITE&&moduleData[row+1][col]===BLACK)output+=platte.WHITE_BLACK;else if(moduleData[row][col]===BLACK&&moduleData[row+1][col]===WHITE)output+=platte.BLACK_WHITE;else output+=platte.BLACK_ALL;output+=platte.WHITE_ALL+`
4
4
  `}if(!oddRow)output+=borderBottom}else{var border=repeat(white).times(qrcode.getModuleCount()+3);output+=border+`
5
5
  `,qrcode.modules.forEach(function(row2){output+=white,output+=row2.map(toCell).join(""),output+=white+`
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{loadStateFile,updateStateFile}from"./chunk-xasg8z9e.js";import{shortHomeTag}from"./chunk-2z2jwetd.js";import{homeDir}from"./chunk-8143k3t6.js";var LOCAL_MACHINE_ID="local",ALIAS_RE=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function isValidMachineAlias(alias){return alias!==LOCAL_MACHINE_ID&&alias.length<=64&&ALIAS_RE.test(alias)}function parseSshTarget(target){let trimmed=target.trim();if(!trimmed)return null;let at=trimmed.lastIndexOf("@"),user=at>=0?trimmed.slice(0,at):void 0,rest=at>=0?trimmed.slice(at+1):trimmed;if(at>=0&&!user)return null;let bracketed=/^\[([^\]]+)\](?::(\d{1,5}))?$/.exec(rest),portMatch=bracketed?null:/^([^:]*):(\d{1,5})$/.exec(rest),host=bracketed?bracketed[1]??"":portMatch?portMatch[1]??"":rest,rawPort=bracketed?bracketed[2]:portMatch?.[2],port=rawPort?Number(rawPort):void 0;if(!host||/\s/.test(host))return null;if(port!==void 0&&(port<1||port>65535))return null;return{host,...user?{user}:{},...port?{port}:{}}}function defaultMachineAlias(args){let source=!args.typedUser&&args.port===void 0&&!isIpLiteral(args.typedHost)?args.typedHost:args.remoteHostname||args.typedHost;return sanitizeAlias(source)}function isIpLiteral(host){return host.includes(":")||/^\d{1,3}(\.\d{1,3}){3}$/.test(host)}function sanitizeAlias(raw){return(raw.split(".")[0]??raw).replace(/[^A-Za-z0-9._-]/g,"-").slice(0,64)}function sshTargetOf(config){return config.user?`${config.user}@${config.host}`:config.host}function readMachines(state){let raw=state.machines;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function listMachines(){let machines=readMachines(loadStateFile());return Object.entries(machines).map(([alias,config])=>({alias,...config}))}function getMachine(alias){return readMachines(loadStateFile())[alias]??null}function addMachine(alias,config){let added=!1;return updateStateFile((state)=>{let machines={...readMachines(state)};added=machines[alias]===void 0,machines[alias]={...config,addedAt:config.addedAt??machines[alias]?.addedAt??new Date().toISOString()},state.machines=machines;return}),{added}}function updateMachine(alias,patch){updateStateFile((state)=>{let machines={...readMachines(state)},existing=machines[alias];if(!existing)return!1;machines[alias]={...existing,...patch},state.machines=machines;return})}function setMachineIdentity(alias,identity){updateMachine(alias,{identity})}function removeMachine(alias){let removed=!1;return updateStateFile((state)=>{let machines={...readMachines(state)};if(removed=machines[alias]!==void 0,!removed)return!1;delete machines[alias],state.machines=machines;return}),removed}function dedupeMachines(entries){let kept=[],seen=[];for(let entry of entries){let identity=entry.identity;if(identity){if(seen.some((other)=>sameMachine(other,identity)))continue;seen.push(identity)}kept.push(entry)}return kept}function sameMachine(a,b){return a.hostname===b.hostname&&a.homeDir===b.homeDir&&a.daemonPid===b.daemonPid}function duplicateAliasOf(machines,self,identity){for(let[alias,config]of Object.entries(machines)){if(alias===self)continue;let other=config.identity;if(!other)continue;if(other.hostname===identity.hostname&&other.homeDir===identity.homeDir&&other.daemonPid===identity.daemonPid)return alias}return null}import{existsSync}from"fs";import{tmpdir}from"os";import{join}from"path";var CONTROL_PERSIST_SECONDS=300;function machineSocketDir(alias,home=homeDir()){let natural=join(home,".rove","machines",alias);if(Buffer.byteLength(join(natural,"daemon.sock"),"utf8")<=SOCKET_PATH_LIMIT)return natural;return join(tmpdir(),`rove-m-${shortHomeTag(home)}-${shortHomeTag(alias)}`)}var SOCKET_PATH_LIMIT=100;function localDaemonSocketPath(alias,home=homeDir()){return join(machineSocketDir(alias,home),"daemon.sock")}function localPtySocketPath(alias,home=homeDir()){return join(machineSocketDir(alias,home),"pty.sock")}function controlPath(alias,home=homeDir()){return join(machineSocketDir(alias,home),"cm")}function hubKeyPath(home=homeDir()){return join(home,".rove","ssh","hub_ed25519")}function machineIdentityFile(config,home=homeDir()){if(config.auth.kind!=="key")return;if(config.auth.keyPath)return config.auth.keyPath;let hubKey=hubKeyPath(home);return existsSync(hubKey)?hubKey:void 0}function machineSshArgs(alias,config,opts={}){let argv=["ssh"];if(opts.batch!==!1)argv.push("-o","BatchMode=yes");if(opts.mux!==!1&&process.platform!=="win32")argv.push("-o","ControlMaster=auto","-o",`ControlPath=${controlPath(alias,opts.home)}`,"-o",`ControlPersist=${CONTROL_PERSIST_SECONDS}`);if(argv.push("-o","StrictHostKeyChecking=accept-new"),config.port)argv.push("-p",String(config.port));let identity=machineIdentityFile(config,opts.home);if(identity)argv.push("-i",identity);return argv.push(sshTargetOf(config)),argv}
2
+ import{loadStateFile,updateStateFile}from"./chunk-xasg8z9e.js";import{shortHomeTag}from"./chunk-2z2jwetd.js";import{homeDir}from"./chunk-8143k3t6.js";var LOCAL_MACHINE_ID="local",ALIAS_RE=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function isValidMachineAlias(alias){return alias!==LOCAL_MACHINE_ID&&alias.length<=64&&ALIAS_RE.test(alias)}function parseSshTarget(target){let trimmed=target.trim();if(!trimmed)return null;let at=trimmed.lastIndexOf("@"),user=at>=0?trimmed.slice(0,at):void 0,rest=at>=0?trimmed.slice(at+1):trimmed;if(at>=0&&!user)return null;let bracketed=/^\[([^\]]+)\](?::(\d{1,5}))?$/.exec(rest),portMatch=bracketed?null:/^([^:]*):(\d{1,5})$/.exec(rest),host=bracketed?bracketed[1]??"":portMatch?portMatch[1]??"":rest,rawPort=bracketed?bracketed[2]:portMatch?.[2],port=rawPort?Number(rawPort):void 0;if(!host||/\s/.test(host))return null;if(port!==void 0&&(port<1||port>65535))return null;return{host,...user?{user}:{},...port?{port}:{}}}function defaultMachineAlias(args){let source=!args.typedUser&&args.port===void 0&&!isIpLiteral(args.typedHost)?args.typedHost:args.remoteHostname||args.typedHost;return sanitizeAlias(source)}function isIpLiteral(host){return host.includes(":")||/^\d{1,3}(\.\d{1,3}){3}$/.test(host)}function sanitizeAlias(raw){return(raw.split(".")[0]??raw).replace(/[^A-Za-z0-9._-]/g,"-").slice(0,64)}function sshTargetOf(config){return config.user?`${config.user}@${config.host}`:config.host}function readMachines(state){let raw=state.machines;if(!raw||typeof raw!=="object"||Array.isArray(raw))return{};return raw}function listMachines(){let machines=readMachines(loadStateFile());return Object.entries(machines).map(([alias,config])=>({alias,...config}))}function getMachine(alias){return readMachines(loadStateFile())[alias]??null}function addMachine(alias,config){let added=!1;return updateStateFile((state)=>{let machines={...readMachines(state)};added=machines[alias]===void 0;let kept=config.mcp??machines[alias]?.mcp;machines[alias]={...config,addedAt:config.addedAt??machines[alias]?.addedAt??new Date().toISOString(),...kept?{mcp:kept}:{}},state.machines=machines;return}),{added}}function updateMachine(alias,patch){updateStateFile((state)=>{let machines={...readMachines(state)},existing=machines[alias];if(!existing)return!1;machines[alias]={...existing,...patch},state.machines=machines;return})}function setMachineIdentity(alias,identity){updateMachine(alias,{identity})}function removeMachine(alias){let removed=!1;return updateStateFile((state)=>{let machines={...readMachines(state)};if(removed=machines[alias]!==void 0,!removed)return!1;delete machines[alias],state.machines=machines;return}),removed}function dedupeMachines(entries){let kept=[],seen=[];for(let entry of entries){let identity=entry.identity;if(identity){if(seen.some((other)=>sameMachine(other,identity)))continue;seen.push(identity)}kept.push(entry)}return kept}function sameMachine(a,b){return a.hostname===b.hostname&&a.homeDir===b.homeDir&&a.daemonPid===b.daemonPid}function duplicateAliasOf(machines,self,identity){for(let[alias,config]of Object.entries(machines)){if(alias===self)continue;let other=config.identity;if(!other)continue;if(other.hostname===identity.hostname&&other.homeDir===identity.homeDir&&other.daemonPid===identity.daemonPid)return alias}return null}import{existsSync}from"fs";import{tmpdir}from"os";import{join}from"path";var CONTROL_PERSIST_SECONDS=300;function machineSocketDir(alias,home=homeDir()){let natural=join(home,".rove","machines",alias);if(Buffer.byteLength(join(natural,`cm.${"x".repeat(16)}`),"utf8")<=SOCKET_PATH_LIMIT)return natural;return join(tmpdir(),`rove-m-${shortHomeTag(home)}-${shortHomeTag(alias)}`)}var SOCKET_PATH_LIMIT=100;function localDaemonSocketPath(alias,home=homeDir()){return join(machineSocketDir(alias,home),"daemon.sock")}function localPtySocketPath(alias,home=homeDir()){return join(machineSocketDir(alias,home),"pty.sock")}function controlPath(alias,home=homeDir()){return join(machineSocketDir(alias,home),"cm")}function hubKeyPath(home=homeDir()){return join(home,".rove","ssh","hub_ed25519")}function machineIdentityFile(config,home=homeDir()){if(config.auth.kind!=="key")return;if(config.auth.keyPath)return config.auth.keyPath;let hubKey=hubKeyPath(home);return existsSync(hubKey)?hubKey:void 0}function machineSshArgs(alias,config,opts={}){let argv=["ssh"];if(opts.batch!==!1)argv.push("-o","BatchMode=yes");if(opts.mux!==!1&&process.platform!=="win32")argv.push("-o","ControlMaster=auto","-o",`ControlPath=${controlPath(alias,opts.home)}`,"-o",`ControlPersist=${CONTROL_PERSIST_SECONDS}`);if(argv.push("-o","StrictHostKeyChecking=accept-new"),config.port)argv.push("-p",String(config.port));let identity=machineIdentityFile(config,opts.home);if(identity)argv.push("-i",identity);return argv.push(sshTargetOf(config)),argv}
3
3
  export{isValidMachineAlias,parseSshTarget,defaultMachineAlias,sanitizeAlias,sshTargetOf,readMachines,listMachines,getMachine,addMachine,updateMachine,setMachineIdentity,removeMachine,dedupeMachines,duplicateAliasOf,machineSocketDir,localDaemonSocketPath,localPtySocketPath,hubKeyPath,machineIdentityFile,machineSshArgs};