wherdr 2.4.0 → 2.6.0

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 (287) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{CPlkxpge.js → 2fsYF-LK.js} +41 -41
  3. package/.output/public/_nuxt/2fsYF-LK.js.br +0 -0
  4. package/.output/public/_nuxt/2fsYF-LK.js.gz +0 -0
  5. package/.output/public/_nuxt/{CV6ukk-M.js → 3bE7s96N.js} +1 -1
  6. package/.output/public/_nuxt/6YTlf8ot.js +1 -0
  7. package/.output/public/_nuxt/6YTlf8ot.js.br +0 -0
  8. package/.output/public/_nuxt/6YTlf8ot.js.gz +0 -0
  9. package/.output/public/_nuxt/{BYZVrreW.js → 7KozZy5Y.js} +1 -1
  10. package/.output/public/_nuxt/AgentView.BwyQIUef.css +1 -0
  11. package/.output/public/_nuxt/AgentView.BwyQIUef.css.br +0 -0
  12. package/.output/public/_nuxt/AgentView.BwyQIUef.css.gz +0 -0
  13. package/.output/public/_nuxt/{BdJIc1Xf.js → B40shTLf.js} +1 -1
  14. package/.output/public/_nuxt/{BdJIc1Xf.js.br → B40shTLf.js.br} +0 -0
  15. package/.output/public/_nuxt/B40shTLf.js.gz +0 -0
  16. package/.output/public/_nuxt/B5cSia3P.js +62 -0
  17. package/.output/public/_nuxt/B5cSia3P.js.br +0 -0
  18. package/.output/public/_nuxt/B5cSia3P.js.gz +0 -0
  19. package/.output/public/_nuxt/BK1_9FXg.js +1 -0
  20. package/.output/public/_nuxt/BK1_9FXg.js.br +0 -0
  21. package/.output/public/_nuxt/BK1_9FXg.js.gz +0 -0
  22. package/.output/public/_nuxt/{CgUSTIM1.js → Bqz3nVVB.js} +1 -1
  23. package/.output/public/_nuxt/{CgUSTIM1.js.br → Bqz3nVVB.js.br} +0 -0
  24. package/.output/public/_nuxt/Bqz3nVVB.js.gz +0 -0
  25. package/.output/public/_nuxt/{B2KlcBQ-.js → ByLPJEo6.js} +1 -1
  26. package/.output/public/_nuxt/ByLPJEo6.js.br +0 -0
  27. package/.output/public/_nuxt/ByLPJEo6.js.gz +0 -0
  28. package/.output/public/_nuxt/C8tHIeGN.js +3 -0
  29. package/.output/public/_nuxt/C8tHIeGN.js.br +0 -0
  30. package/.output/public/_nuxt/C8tHIeGN.js.gz +0 -0
  31. package/.output/public/_nuxt/CAkH_IfS.js +9 -0
  32. package/.output/public/_nuxt/CAkH_IfS.js.br +0 -0
  33. package/.output/public/_nuxt/CAkH_IfS.js.gz +0 -0
  34. package/.output/public/_nuxt/COWXF9OU.js +123 -0
  35. package/.output/public/_nuxt/COWXF9OU.js.br +0 -0
  36. package/.output/public/_nuxt/COWXF9OU.js.gz +0 -0
  37. package/.output/public/_nuxt/{BDTOz37p.js → CiG2Lovu.js} +1 -1
  38. package/.output/public/_nuxt/CiG2Lovu.js.br +0 -0
  39. package/.output/public/_nuxt/CiG2Lovu.js.gz +0 -0
  40. package/.output/public/_nuxt/CnjxEm0H.js +27 -0
  41. package/.output/public/_nuxt/CnjxEm0H.js.br +0 -0
  42. package/.output/public/_nuxt/CnjxEm0H.js.gz +0 -0
  43. package/.output/public/_nuxt/DNs2cMBZ.js +23 -0
  44. package/.output/public/_nuxt/DNs2cMBZ.js.br +0 -0
  45. package/.output/public/_nuxt/DNs2cMBZ.js.gz +0 -0
  46. package/.output/public/_nuxt/D_x7Rysx.js +31 -0
  47. package/.output/public/_nuxt/D_x7Rysx.js.br +0 -0
  48. package/.output/public/_nuxt/D_x7Rysx.js.gz +0 -0
  49. package/.output/public/_nuxt/{CLf2i_DM.js → T-qXNaMY.js} +1 -1
  50. package/.output/public/_nuxt/{board.fZYj3O-m.css → board.CpFnG_Ho.css} +1 -1
  51. package/.output/public/_nuxt/board.CpFnG_Ho.css.br +0 -0
  52. package/.output/public/_nuxt/board.CpFnG_Ho.css.gz +0 -0
  53. package/.output/public/_nuxt/builds/latest.json +1 -1
  54. package/.output/public/_nuxt/builds/meta/e2ee8d99-6a6a-4754-934f-8b7dbecfcdcb.json +1 -0
  55. package/.output/public/_nuxt/entry.C_hImCpq.css +2 -0
  56. package/.output/public/_nuxt/entry.C_hImCpq.css.br +0 -0
  57. package/.output/public/_nuxt/entry.C_hImCpq.css.gz +0 -0
  58. package/.output/public/_nuxt/{settings.Cdb21nNw.css → settings.ycbeituV.css} +1 -1
  59. package/.output/public/_nuxt/settings.ycbeituV.css.br +0 -0
  60. package/.output/public/_nuxt/settings.ycbeituV.css.gz +0 -0
  61. package/.output/public/_nuxt/useViewport.D9mmYA6A.css +1 -0
  62. package/.output/public/_nuxt/useWorktrees.BWpb3OO0.css +1 -0
  63. package/.output/public/_nuxt/useWorktrees.BWpb3OO0.css.br +0 -0
  64. package/.output/public/_nuxt/useWorktrees.BWpb3OO0.css.gz +0 -0
  65. package/.output/public/sw.js +6 -2
  66. package/.output/server/chunks/_/branding.mjs +1 -1
  67. package/.output/server/chunks/_/fileDownload.mjs +1 -1
  68. package/.output/server/chunks/_/files.mjs +26 -3
  69. package/.output/server/chunks/_/machineOrder.mjs +1 -1
  70. package/.output/server/chunks/_/onboarding.mjs +1 -1
  71. package/.output/server/chunks/_/package.mjs +1 -1
  72. package/.output/server/chunks/_/plugins.mjs +1 -1
  73. package/.output/server/chunks/_/restart.mjs +1 -1
  74. package/.output/server/chunks/_/revoke.mjs +22 -0
  75. package/.output/server/chunks/_/selfupdate.mjs +2 -1
  76. package/.output/server/chunks/_/splitShell.mjs +42 -0
  77. package/.output/server/chunks/_/updates.mjs +18 -4
  78. package/.output/server/chunks/_/uploadHashes.mjs +46 -0
  79. package/.output/server/chunks/_/worktrees.mjs +1 -1
  80. package/.output/server/chunks/_/ws.mjs +3 -3
  81. package/.output/server/chunks/nitro/nitro.mjs +15815 -15082
  82. package/.output/server/chunks/raw/check-leaks.mjs +1 -1
  83. package/.output/server/chunks/raw/ci-browser-plan.mjs +5 -0
  84. package/.output/server/chunks/raw/engine-changes.mjs +5 -0
  85. package/.output/server/chunks/raw/engine-result.mjs +7 -0
  86. package/.output/server/chunks/raw/herdr-plugin.mjs +1 -1
  87. package/.output/server/chunks/raw/prerelease.mjs +1 -1
  88. package/.output/server/chunks/raw/test-affected.mjs +1 -1
  89. package/.output/server/chunks/routes/api/_..._.mjs +5 -5
  90. package/.output/server/chunks/routes/api/agents.post.mjs +5 -5
  91. package/.output/server/chunks/routes/api/ask-tab.post.mjs +5 -5
  92. package/.output/server/chunks/routes/api/attach.post.mjs +5 -5
  93. package/.output/server/chunks/routes/api/auth/disable.post.mjs +14 -7
  94. package/.output/server/chunks/routes/api/auth/lock-all.post.mjs +12 -6
  95. package/.output/server/chunks/routes/api/auth/lock.post.mjs +5 -5
  96. package/.output/server/chunks/routes/api/auth/login/options.post.mjs +7 -7
  97. package/.output/server/chunks/routes/api/auth/login/verify.post.mjs +5 -5
  98. package/.output/server/chunks/routes/api/auth/max-session.post.mjs +5 -5
  99. package/.output/server/chunks/routes/api/auth/register/options.post.mjs +5 -5
  100. package/.output/server/chunks/routes/api/auth/register/verify.post.mjs +5 -5
  101. package/.output/server/chunks/routes/api/auth/status.get.mjs +10 -10
  102. package/.output/server/chunks/routes/api/changes.get.mjs +6 -6
  103. package/.output/server/chunks/routes/api/chat/image.get.mjs +6 -6
  104. package/.output/server/chunks/routes/api/chat.get.mjs +20 -49
  105. package/.output/server/chunks/routes/api/choose.post.mjs +6 -6
  106. package/.output/server/chunks/routes/api/claude-setup.post.mjs +6 -6
  107. package/.output/server/chunks/routes/api/claude-statusline.post.mjs +6 -6
  108. package/.output/server/chunks/routes/api/clear-queued-input.post.mjs +6 -6
  109. package/.output/server/chunks/routes/api/close/status.get.mjs +6 -6
  110. package/.output/server/chunks/routes/api/close-preview.get.mjs +62 -0
  111. package/.output/server/chunks/routes/api/close.post.mjs +5 -5
  112. package/.output/server/chunks/routes/api/codex-update.post.mjs +6 -6
  113. package/.output/server/chunks/routes/api/commands.get.mjs +6 -6
  114. package/.output/server/chunks/routes/api/config.get.mjs +6 -6
  115. package/.output/server/chunks/routes/api/dirs.get.mjs +6 -6
  116. package/.output/server/chunks/routes/api/dismiss-stopped.post.mjs +6 -6
  117. package/.output/server/chunks/routes/api/dismiss.post.mjs +6 -6
  118. package/.output/server/chunks/routes/api/effort.post.mjs +6 -6
  119. package/.output/server/chunks/routes/api/efforts.get.mjs +6 -6
  120. package/.output/server/chunks/routes/api/file.post.mjs +6 -6
  121. package/.output/server/chunks/routes/api/files/download.get.mjs +5 -5
  122. package/.output/server/chunks/routes/api/files/download.head.mjs +5 -5
  123. package/.output/server/chunks/routes/api/files/read.get.mjs +6 -6
  124. package/.output/server/chunks/routes/api/files.get.mjs +6 -6
  125. package/.output/server/chunks/routes/api/health.get.mjs +5 -5
  126. package/.output/server/chunks/routes/api/input.post.mjs +6 -6
  127. package/.output/server/chunks/routes/api/interrupt.post.mjs +6 -6
  128. package/.output/server/chunks/routes/api/isgit.get.mjs +6 -6
  129. package/.output/server/chunks/routes/api/machine/awake.get.mjs +6 -6
  130. package/.output/server/chunks/routes/api/machine/awake.post.mjs +6 -6
  131. package/.output/server/chunks/routes/api/machine/order.get.mjs +5 -5
  132. package/.output/server/chunks/routes/api/machine/order.post.mjs +5 -5
  133. package/.output/server/chunks/routes/api/machine/reconnect.post.mjs +6 -6
  134. package/.output/server/chunks/routes/api/machine/rename.post.mjs +6 -6
  135. package/.output/server/chunks/routes/api/machine/status.post.mjs +6 -6
  136. package/.output/server/chunks/routes/api/menu-left.post.mjs +6 -6
  137. package/.output/server/chunks/routes/api/menu.post.mjs +6 -6
  138. package/.output/server/chunks/routes/api/model.post.mjs +6 -6
  139. package/.output/server/chunks/routes/api/models.get.mjs +6 -6
  140. package/.output/server/chunks/routes/api/nav.post.mjs +6 -6
  141. package/.output/server/chunks/routes/api/onboarding.get.mjs +5 -5
  142. package/.output/server/chunks/routes/api/onboarding.post.mjs +5 -5
  143. package/.output/server/chunks/routes/api/phone.get.mjs +6 -6
  144. package/.output/server/chunks/routes/api/phone.post.mjs +6 -6
  145. package/.output/server/chunks/routes/api/plugins/actions.get.mjs +5 -5
  146. package/.output/server/chunks/routes/api/plugins/invoke.post.mjs +5 -5
  147. package/.output/server/chunks/routes/api/plugins/projects.get.mjs +6 -6
  148. package/.output/server/chunks/routes/api/plugins/projects.post.mjs +6 -6
  149. package/.output/server/chunks/routes/api/prompt.post.mjs +6 -6
  150. package/.output/server/chunks/routes/api/push/devices.post.mjs +49 -0
  151. package/.output/server/chunks/routes/api/push/quiet.post.mjs +6 -6
  152. package/.output/server/chunks/routes/api/push/subscribe.post.mjs +8 -7
  153. package/.output/server/chunks/routes/api/push/test.post.mjs +6 -6
  154. package/.output/server/chunks/routes/api/push/unsubscribe.post.mjs +6 -6
  155. package/.output/server/chunks/routes/api/quotas.get.mjs +6 -6
  156. package/.output/server/chunks/routes/api/rename.post.mjs +5 -5
  157. package/.output/server/chunks/routes/api/requeue.post.mjs +6 -6
  158. package/.output/server/chunks/routes/api/restart.get.mjs +5 -5
  159. package/.output/server/chunks/routes/api/restart.post.mjs +5 -5
  160. package/.output/server/chunks/routes/api/reveal.post.mjs +6 -6
  161. package/.output/server/chunks/routes/api/screen-key.post.mjs +6 -6
  162. package/.output/server/chunks/routes/api/screen.get.mjs +6 -6
  163. package/.output/server/chunks/routes/api/search.get.mjs +6 -6
  164. package/.output/server/chunks/routes/api/seen.post.mjs +6 -6
  165. package/.output/server/chunks/routes/api/send-now.post.mjs +6 -6
  166. package/.output/server/chunks/routes/api/sessions.get.mjs +6 -6
  167. package/.output/server/chunks/routes/api/sessions.post.mjs +6 -6
  168. package/.output/server/chunks/routes/api/settings-tab.post.mjs +6 -6
  169. package/.output/server/chunks/routes/api/settings.get.mjs +6 -6
  170. package/.output/server/chunks/routes/api/settings.post.mjs +6 -6
  171. package/.output/server/chunks/routes/api/space.post.mjs +6 -6
  172. package/.output/server/chunks/routes/api/split-command.post.mjs +9 -44
  173. package/.output/server/chunks/routes/api/state.get.mjs +6 -6
  174. package/.output/server/chunks/routes/api/tasks/action.post.mjs +6 -6
  175. package/.output/server/chunks/routes/api/tasks/add.post.mjs +6 -6
  176. package/.output/server/chunks/routes/api/tasks/after.post.mjs +6 -6
  177. package/.output/server/chunks/routes/api/tasks/approve.post.mjs +6 -6
  178. package/.output/server/chunks/routes/api/tasks/archive-done.post.mjs +6 -6
  179. package/.output/server/chunks/routes/api/tasks/archived.get.mjs +6 -6
  180. package/.output/server/chunks/routes/api/tasks/autopilot.get.mjs +6 -6
  181. package/.output/server/chunks/routes/api/tasks/autopilot.post.mjs +6 -6
  182. package/.output/server/chunks/routes/api/tasks/board-settings.get.mjs +6 -6
  183. package/.output/server/chunks/routes/api/tasks/board-settings.post.mjs +6 -6
  184. package/.output/server/chunks/routes/api/tasks/coordinator.get.mjs +6 -6
  185. package/.output/server/chunks/routes/api/tasks/coordinator.post.mjs +6 -6
  186. package/.output/server/chunks/routes/api/tasks/describe.post.mjs +6 -6
  187. package/.output/server/chunks/routes/api/tasks/details.get.mjs +6 -6
  188. package/.output/server/chunks/routes/api/tasks/limit.post.mjs +6 -6
  189. package/.output/server/chunks/routes/api/tasks/links.get.mjs +7 -7
  190. package/.output/server/chunks/routes/api/tasks/models.get.mjs +6 -6
  191. package/.output/server/chunks/routes/api/tasks/pick.post.mjs +6 -6
  192. package/.output/server/chunks/routes/api/tasks/project.get.mjs +6 -6
  193. package/.output/server/chunks/routes/api/tasks/project.post.mjs +6 -6
  194. package/.output/server/chunks/routes/api/tasks/question.post.mjs +6 -6
  195. package/.output/server/chunks/routes/api/tasks/scheduled.get.mjs +6 -6
  196. package/.output/server/chunks/routes/api/tasks/settings.get.mjs +6 -6
  197. package/.output/server/chunks/routes/api/tasks/start.get.mjs +6 -6
  198. package/.output/server/chunks/routes/api/tasks/tell.post.mjs +6 -6
  199. package/.output/server/chunks/routes/api/tasks/transcript-image.get.mjs +47 -0
  200. package/.output/server/chunks/routes/api/tasks/transcript.get.mjs +48 -0
  201. package/.output/server/chunks/routes/api/tasks.get.mjs +6 -6
  202. package/.output/server/chunks/routes/api/unqueue.post.mjs +6 -6
  203. package/.output/server/chunks/routes/api/update/status.get.mjs +5 -5
  204. package/.output/server/chunks/routes/api/update.get.mjs +5 -5
  205. package/.output/server/chunks/routes/api/update.post.mjs +5 -5
  206. package/.output/server/chunks/routes/api/upload.post.mjs +6 -6
  207. package/.output/server/chunks/routes/api/worktrees/remove.post.mjs +5 -5
  208. package/.output/server/chunks/routes/api/worktrees.get.mjs +5 -5
  209. package/.output/server/chunks/routes/favicon.ico.get.mjs +5 -5
  210. package/.output/server/chunks/routes/icons/_name_.get.mjs +6 -6
  211. package/.output/server/chunks/routes/renderer.mjs +7 -7
  212. package/.output/server/chunks/routes/uploads/_...name_.get.mjs +6 -6
  213. package/.output/server/chunks/routes/ws/_..._.mjs +6 -6
  214. package/.output/server/chunks/routes/ws/events.mjs +6 -6
  215. package/.output/server/chunks/routes/ws/term.mjs +6 -6
  216. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  217. package/.output/server/index.mjs +6 -6
  218. package/.output/server/package.json +1 -1
  219. package/README.md +1 -1
  220. package/bin/lib/tailnet.d.mts +7 -4
  221. package/bin/lib/tailnet.mjs +76 -18
  222. package/bin/lib/updater.mjs +6 -0
  223. package/docs/README.md +4 -0
  224. package/docs/RELEASING.md +27 -5
  225. package/docs/configuration.md +3 -4
  226. package/docs/conversation.md +11 -3
  227. package/docs/design.md +1 -1
  228. package/docs/devices.md +28 -0
  229. package/docs/home.md +29 -0
  230. package/docs/installation.md +14 -5
  231. package/docs/networks.md +9 -4
  232. package/docs/notifications.md +7 -0
  233. package/docs/plugins.md +1 -1
  234. package/docs/quick-start.md +7 -6
  235. package/docs/quotas.md +10 -1
  236. package/docs/release-notes-2.5.0.md +25 -0
  237. package/docs/release-notes-2.6.0.md +29 -0
  238. package/docs/security.md +61 -11
  239. package/docs/troubleshooting.md +4 -0
  240. package/package.json +1 -1
  241. package/skills/wherdr/SKILL.md +21 -0
  242. package/.output/public/_nuxt/AgentView.B12D6ccj.css +0 -1
  243. package/.output/public/_nuxt/AgentView.B12D6ccj.css.br +0 -0
  244. package/.output/public/_nuxt/AgentView.B12D6ccj.css.gz +0 -0
  245. package/.output/public/_nuxt/B2KlcBQ-.js.br +0 -0
  246. package/.output/public/_nuxt/B2KlcBQ-.js.gz +0 -0
  247. package/.output/public/_nuxt/BDTOz37p.js.br +0 -0
  248. package/.output/public/_nuxt/BDTOz37p.js.gz +0 -0
  249. package/.output/public/_nuxt/BGD5AamG.js +0 -25
  250. package/.output/public/_nuxt/BGD5AamG.js.br +0 -0
  251. package/.output/public/_nuxt/BGD5AamG.js.gz +0 -0
  252. package/.output/public/_nuxt/BdJIc1Xf.js.gz +0 -0
  253. package/.output/public/_nuxt/BxlzUs1i.js +0 -23
  254. package/.output/public/_nuxt/BxlzUs1i.js.br +0 -0
  255. package/.output/public/_nuxt/BxlzUs1i.js.gz +0 -0
  256. package/.output/public/_nuxt/C-BDzEtI.js +0 -3
  257. package/.output/public/_nuxt/C-BDzEtI.js.br +0 -0
  258. package/.output/public/_nuxt/C-BDzEtI.js.gz +0 -0
  259. package/.output/public/_nuxt/CO4sDeSt.js +0 -62
  260. package/.output/public/_nuxt/CO4sDeSt.js.br +0 -0
  261. package/.output/public/_nuxt/CO4sDeSt.js.gz +0 -0
  262. package/.output/public/_nuxt/CPlkxpge.js.br +0 -0
  263. package/.output/public/_nuxt/CPlkxpge.js.gz +0 -0
  264. package/.output/public/_nuxt/CTPNZj4T.js +0 -9
  265. package/.output/public/_nuxt/CTPNZj4T.js.br +0 -0
  266. package/.output/public/_nuxt/CTPNZj4T.js.gz +0 -0
  267. package/.output/public/_nuxt/CgUSTIM1.js.gz +0 -0
  268. package/.output/public/_nuxt/CwurhZnh.js +0 -123
  269. package/.output/public/_nuxt/CwurhZnh.js.br +0 -0
  270. package/.output/public/_nuxt/CwurhZnh.js.gz +0 -0
  271. package/.output/public/_nuxt/D7fCPncR.js +0 -1
  272. package/.output/public/_nuxt/D7fCPncR.js.br +0 -0
  273. package/.output/public/_nuxt/D7fCPncR.js.gz +0 -0
  274. package/.output/public/_nuxt/DFe-cDm2.js +0 -1
  275. package/.output/public/_nuxt/DFe-cDm2.js.br +0 -0
  276. package/.output/public/_nuxt/DFe-cDm2.js.gz +0 -0
  277. package/.output/public/_nuxt/Dpe9TNcA.js +0 -31
  278. package/.output/public/_nuxt/Dpe9TNcA.js.br +0 -0
  279. package/.output/public/_nuxt/Dpe9TNcA.js.gz +0 -0
  280. package/.output/public/_nuxt/board.fZYj3O-m.css.br +0 -0
  281. package/.output/public/_nuxt/board.fZYj3O-m.css.gz +0 -0
  282. package/.output/public/_nuxt/builds/meta/75cc4ea7-3027-463a-aa3e-29e474ed7173.json +0 -1
  283. package/.output/public/_nuxt/entry.KNdllmoL.css +0 -2
  284. package/.output/public/_nuxt/entry.KNdllmoL.css.br +0 -0
  285. package/.output/public/_nuxt/entry.KNdllmoL.css.gz +0 -0
  286. package/.output/public/_nuxt/settings.Cdb21nNw.css.br +0 -0
  287. package/.output/public/_nuxt/settings.Cdb21nNw.css.gz +0 -0
@@ -1,4 +1,4 @@
1
- import { a as defineApi, k as auth, r as reqOf } from '../../../../nitro/nitro.mjs';
1
+ import { a as defineApi, k as auth, r as reqOf, y as clientKey } from '../../../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -17,21 +17,21 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
- const options_post = defineApi((event) => auth.loginOptions(reqOf(event)));
34
+ const options_post = defineApi((event) => auth.loginOptions(reqOf(event), clientKey(event)));
35
35
 
36
36
  export { options_post as default };
37
37
  //# sourceMappingURL=options.post.mjs.map
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const verify_post = defineApi((event, body) => auth.loginVerify(reqOf(event), body));
35
35
 
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const maxSession_post = defineApi((event, body) => auth.setMaxSession(reqOf(event), body == null ? void 0 : body.days));
35
35
 
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const options_post = defineApi((event, body) => auth.registerOptions(reqOf(event), body));
35
35
 
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const verify_post = defineApi((event, body) => auth.registerVerify(reqOf(event), body));
35
35
 
@@ -1,4 +1,4 @@
1
- import { a as defineApi, l as localMachineLabel, k as auth, r as reqOf, i as getQuery } from '../../../nitro/nitro.mjs';
1
+ import { a as defineApi, k as auth, r as reqOf, i as getQuery, z as localMachineLabel } from '../../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -17,24 +17,24 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
- const status_get = defineApi((event) => ({
35
- ...auth.status(reqOf(event), { resume: getQuery(event).resume === "1" }),
36
- hostLabel: localMachineLabel()
37
- }));
34
+ const status_get = defineApi((event) => {
35
+ const st = auth.status(reqOf(event), { resume: getQuery(event).resume === "1" });
36
+ return st.unlocked ? { ...st, hostLabel: localMachineLabel() } : st;
37
+ });
38
38
 
39
39
  export { status_get as default };
40
40
  //# sourceMappingURL=status.get.mjs.map
@@ -1,4 +1,4 @@
1
- import { a as defineApi, i as getQuery, f as findPane, H as HerdrError, m as machineFor } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, i as getQuery, f as findPane, H as HerdrError, B as machineFor } from '../../nitro/nitro.mjs';
2
2
  import { r as readChanges } from '../../_/changes.mjs';
3
3
  import 'node:http';
4
4
  import 'node:https';
@@ -18,19 +18,19 @@ import 'node:buffer';
18
18
  import 'node:fs';
19
19
  import 'node:path';
20
20
  import 'node:os';
21
- import 'node:net';
22
21
  import 'node:child_process';
23
22
  import 'node:dns';
24
23
  import 'node:util';
24
+ import 'qrcode-terminal/vendor/QRCode/index.js';
25
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
25
26
  import 'web-push';
27
+ import 'node:zlib';
28
+ import '@simplewebauthn/server';
29
+ import 'node:net';
26
30
  import 'node:string_decoder';
27
31
  import 'node:fs/promises';
28
32
  import 'node:readline';
29
- import 'qrcode-terminal/vendor/QRCode/index.js';
30
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
31
33
  import 'node:url';
32
- import 'node:zlib';
33
- import '@simplewebauthn/server';
34
34
 
35
35
  const changes_get = defineApi(async (event) => {
36
36
  const q = getQuery(event);
@@ -1,4 +1,4 @@
1
- import { d as defineEventHandler, i as getQuery, f as findPane, y as transcripts, s as sendError, I as sendImage } from '../../../nitro/nitro.mjs';
1
+ import { d as defineEventHandler, i as getQuery, f as findPane, J as transcripts, s as sendError, T as sendImage } from '../../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const image_get = defineEventHandler(async (event) => {
35
35
  const q = getQuery(event);
@@ -1,9 +1,8 @@
1
- import { U as UPLOAD_DIR, u as uploadNames, n as runHerdrCli, o as parseIntegrationStatus, a as defineApi, i as getQuery, f as findPane, H as HerdrError, q as machineOfPane, t as fmt, v as takenBackOf, x as chatDelta, y as transcripts, z as missingIntegration, B as multiMachine, C as integrationCommand, D as chatPasted, E as withoutTakenBack, F as withSentText, G as currentModel } from '../../nitro/nitro.mjs';
2
- import { createHash } from 'node:crypto';
3
- import fs from 'node:fs/promises';
4
- import path from 'node:path';
1
+ import { C as runHerdrCli, D as parseIntegrationStatus, a as defineApi, i as getQuery, f as findPane, H as HerdrError, E as machineOfPane, F as fmt, G as takenBackOf, I as chatDelta, J as transcripts, K as missingIntegration, L as multiMachine, M as integrationCommand, N as chatPasted, O as withoutTakenBack, Q as withSentText, R as currentModel } from '../../nitro/nitro.mjs';
2
+ import { a as addUploadHashes } from '../../_/uploadHashes.mjs';
5
3
  import 'node:http';
6
4
  import 'node:https';
5
+ import 'node:crypto';
7
6
  import 'stream';
8
7
  import 'events';
9
8
  import 'http';
@@ -17,58 +16,21 @@ import 'url';
17
16
  import 'node:events';
18
17
  import 'node:buffer';
19
18
  import 'node:fs';
19
+ import 'node:path';
20
20
  import 'node:os';
21
- import 'node:net';
22
21
  import 'node:child_process';
23
22
  import 'node:dns';
24
23
  import 'node:util';
25
- import 'web-push';
26
- import 'node:string_decoder';
27
- import 'node:readline';
28
24
  import 'qrcode-terminal/vendor/QRCode/index.js';
29
25
  import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
- import 'node:url';
26
+ import 'web-push';
31
27
  import 'node:zlib';
32
28
  import '@simplewebauthn/server';
33
-
34
- const UPLOAD_PATH = /\.cache\/herdr-web\/uploads\/([\w-]+\.[a-z]+)/g;
35
- const CACHE_MAX = 500;
36
- const cache$1 = /* @__PURE__ */ new Map();
37
- async function uploadHash(dir, name) {
38
- const key = `${dir}
39
- ${name}`;
40
- if (cache$1.has(key)) return cache$1.get(key);
41
- let hash = null;
42
- try {
43
- hash = createHash("sha256").update(await fs.readFile(path.join(dir, path.basename(name)))).digest("hex");
44
- } catch {
45
- hash = null;
46
- }
47
- if (cache$1.size >= CACHE_MAX) cache$1.delete(cache$1.keys().next().value);
48
- cache$1.set(key, hash);
49
- return hash;
50
- }
51
- async function addUploadHashes(items, dir = UPLOAD_DIR) {
52
- var _a;
53
- for (const it of items) {
54
- if (it.role === "user") {
55
- const names = uploadNames(it.text);
56
- if (!names.length) continue;
57
- const own = (await Promise.all(names.map((n) => uploadHash(dir, n)))).filter((h) => !!h);
58
- const hashes = [...it.hashes || [], ...own.filter((h) => {
59
- var _a2;
60
- return !((_a2 = it.hashes) == null ? void 0 : _a2.includes(h));
61
- })];
62
- if (hashes.length) it.hashes = hashes;
63
- } else if (it.images === 1) {
64
- const names = [...new Set([...`${it.text}
65
- ${((_a = it.omp) == null ? void 0 : _a.target) || ""}`.matchAll(UPLOAD_PATH)].map((m) => m[1]))];
66
- if (names.length !== 1) continue;
67
- const h = await uploadHash(dir, names[0]);
68
- if (h) it.hashes = [h];
69
- }
70
- }
71
- }
29
+ import 'node:net';
30
+ import 'node:string_decoder';
31
+ import 'node:fs/promises';
32
+ import 'node:readline';
33
+ import 'node:url';
72
34
 
73
35
  const ttl = Number(process.env.WHERDR_INTEGRATION_TTL_MS);
74
36
  const TTL_MS = Number.isFinite(ttl) && ttl >= 0 ? ttl : 6e4;
@@ -100,7 +62,14 @@ const chat_get = defineApi(async (event) => {
100
62
  const count = num("n");
101
63
  const since = chatDelta.sinceOf(p.id, sent, count);
102
64
  const from = num("from");
65
+ const gone = new AbortController();
66
+ const res = event.node.res;
67
+ const onClose = () => {
68
+ if (!res.writableFinished) gone.abort(new HerdrError("aborted", "Request aborted"));
69
+ };
70
+ res.once("close", onClose);
103
71
  const r = await transcripts.chat(p, {
72
+ signal: gone.signal,
104
73
  since: mark ? since.endsWith(mark) ? since.slice(0, -mark.length) : "" : since,
105
74
  from,
106
75
  // re-read from this byte (bottom of the conversation already shown)
@@ -125,7 +94,9 @@ const chat_get = defineApi(async (event) => {
125
94
  }
126
95
  }
127
96
  if (r.queue && r.queue.length) r.queue = withSentText(p.id, r.queue);
128
- return r.available ? { ...r, model: await currentModel(p).catch(() => null) } : r;
97
+ const out = r.available && !gone.signal.aborted ? { ...r, model: await currentModel(p).catch(() => null) } : r;
98
+ res.off("close", onClose);
99
+ return out;
129
100
  });
130
101
 
131
102
  export { chat_get as default };
@@ -1,4 +1,4 @@
1
- import { H as HerdrError, J as keysFor, K as parseChoices, L as parseOmpField, a as defineApi, P as PANE_RE, f as findPane, M as withPaneLock, N as selfUpdates, O as restarting, Q as updateChoices, R as UPDATE_LABELS, S as updateRestartPlan, T as restarts, p as poll, h as herdr, y as transcripts, b as screenChoices, V as usesTerminalException, W as sameQuestion, X as sleep, g as choicesCache } from '../../nitro/nitro.mjs';
1
+ import { H as HerdrError, V as keysFor, W as parseChoices, X as parseOmpField, a as defineApi, P as PANE_RE, f as findPane, Y as withPaneLock, Z as selfUpdates, _ as restarting, $ as updateChoices, a0 as UPDATE_LABELS, a1 as updateRestartPlan, a2 as restarts, p as poll, h as herdr, J as transcripts, b as screenChoices, a3 as usesTerminalException, a4 as sameQuestion, a5 as sleep, g as choicesCache } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const OPEN_MS = 3e3;
35
35
  const answering = /* @__PURE__ */ new Set();
@@ -1,4 +1,4 @@
1
- import { a as defineApi, H as HerdrError, Y as writeDismissed, Z as forgetQuotas } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, H as HerdrError, a6 as writeDismissed, a7 as forgetQuotas } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const claudeSetup_post = defineApi((_event, body) => {
35
35
  const keys = Array.isArray(body == null ? void 0 : body.keys) ? body.keys.filter((k) => typeof k === "string").slice(0, 64) : null;
@@ -1,4 +1,4 @@
1
- import { a as defineApi, _ as MACHINE_KEY_RE, $ as getMachine, H as HerdrError, a0 as installClaudeStatusline } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, a8 as MACHINE_KEY_RE, a9 as getMachine, H as HerdrError, aa as installClaudeStatusline } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const claudeStatusline_post = defineApi(async (_event, body) => {
35
35
  const key = typeof body.key === "string" ? body.key : null;
@@ -1,4 +1,4 @@
1
- import { a as defineApi, P as PANE_RE, H as HerdrError, a1 as clearQueuedInput } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, ab as clearQueuedInput } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const clearQueuedInput_post = defineApi(async (_event, b) => {
35
35
  if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
@@ -1,4 +1,4 @@
1
- import { a as defineApi, f as findPane, i as getQuery, H as HerdrError, m as machineFor } from '../../../nitro/nitro.mjs';
1
+ import { a as defineApi, f as findPane, i as getQuery, H as HerdrError, B as machineFor } from '../../../nitro/nitro.mjs';
2
2
  import { a as readChangeStatus } from '../../../_/changes.mjs';
3
3
  import 'node:http';
4
4
  import 'node:https';
@@ -18,19 +18,19 @@ import 'node:buffer';
18
18
  import 'node:fs';
19
19
  import 'node:path';
20
20
  import 'node:os';
21
- import 'node:net';
22
21
  import 'node:child_process';
23
22
  import 'node:dns';
24
23
  import 'node:util';
24
+ import 'qrcode-terminal/vendor/QRCode/index.js';
25
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
25
26
  import 'web-push';
27
+ import 'node:zlib';
28
+ import '@simplewebauthn/server';
29
+ import 'node:net';
26
30
  import 'node:string_decoder';
27
31
  import 'node:fs/promises';
28
32
  import 'node:readline';
29
- import 'qrcode-terminal/vendor/QRCode/index.js';
30
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
31
33
  import 'node:url';
32
- import 'node:zlib';
33
- import '@simplewebauthn/server';
34
34
 
35
35
  const status_get = defineApi(async (event) => {
36
36
  const p = findPane(String(getQuery(event).pane || ""));
@@ -0,0 +1,62 @@
1
+ import { a as defineApi, i as getQuery, P as PANE_RE, H as HerdrError, h as herdr } from '../../nitro/nitro.mjs';
2
+ import { S as SPLIT_PROMPT_TOKEN } from '../../_/splitShell.mjs';
3
+ import 'node:http';
4
+ import 'node:https';
5
+ import 'node:crypto';
6
+ import 'stream';
7
+ import 'events';
8
+ import 'http';
9
+ import 'crypto';
10
+ import 'buffer';
11
+ import 'zlib';
12
+ import 'https';
13
+ import 'net';
14
+ import 'tls';
15
+ import 'url';
16
+ import 'node:events';
17
+ import 'node:buffer';
18
+ import 'node:fs';
19
+ import 'node:path';
20
+ import 'node:os';
21
+ import 'node:child_process';
22
+ import 'node:dns';
23
+ import 'node:util';
24
+ import 'qrcode-terminal/vendor/QRCode/index.js';
25
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
26
+ import 'web-push';
27
+ import 'node:zlib';
28
+ import '@simplewebauthn/server';
29
+ import 'node:net';
30
+ import 'node:string_decoder';
31
+ import 'node:fs/promises';
32
+ import 'node:readline';
33
+ import 'node:url';
34
+
35
+ function closeProcess(info, promptToken) {
36
+ var _a;
37
+ const procs = info == null ? void 0 : info.foreground_processes;
38
+ if (!(info == null ? void 0 : info.shell_pid) || !Array.isArray(procs) || !procs.length) return { state: "unknown" };
39
+ if (info.foreground_process_group_id === info.shell_pid && procs.every((p2) => p2.pid === info.shell_pid) && promptToken === String(info.shell_pid)) return { state: "idle" };
40
+ const p = procs.find((p2) => p2.pid !== info.shell_pid);
41
+ const argv = ((_a = p == null ? void 0 : p.argv) == null ? void 0 : _a.length) ? p.argv : [(p == null ? void 0 : p.cmdline) || (p == null ? void 0 : p.name) || ""];
42
+ const command = argv.join(" ").replace(/[\x00-\x1f\x7f]/g, " ").trim().slice(0, 160);
43
+ return command ? { state: "running", command } : { state: "unknown" };
44
+ }
45
+
46
+ const closePreview_get = defineApi(async (event) => {
47
+ var _a, _b;
48
+ const pane = String(getQuery(event).pane || "");
49
+ if (!PANE_RE.test(pane)) throw new HerdrError("bad_pane", "Invalid pane");
50
+ try {
51
+ const r = await herdr("pane.process_info", { pane_id: pane }, 3e3);
52
+ const process = closeProcess(r == null ? void 0 : r.process_info);
53
+ if (process.state !== "unknown") return process;
54
+ const p = await herdr("pane.get", { pane_id: pane }, 3e3);
55
+ return closeProcess(r == null ? void 0 : r.process_info, (_b = (_a = p == null ? void 0 : p.pane) == null ? void 0 : _a.tokens) == null ? void 0 : _b[SPLIT_PROMPT_TOKEN]);
56
+ } catch {
57
+ return { state: "unknown" };
58
+ }
59
+ });
60
+
61
+ export { closePreview_get as default };
62
+ //# sourceMappingURL=close-preview.get.mjs.map
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const close_post = defineApi(async (event, b) => {
35
35
  if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
@@ -1,4 +1,4 @@
1
- import { a as defineApi, P as PANE_RE, H as HerdrError, f as findPane, a2 as codexStatus } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, f as findPane, af as codexStatus } from '../../nitro/nitro.mjs';
2
2
  import { u as updateCodexInPane } from '../../_/restart.mjs';
3
3
  import 'node:http';
4
4
  import 'node:https';
@@ -18,19 +18,19 @@ import 'node:buffer';
18
18
  import 'node:fs';
19
19
  import 'node:path';
20
20
  import 'node:os';
21
- import 'node:net';
22
21
  import 'node:child_process';
23
22
  import 'node:dns';
24
23
  import 'node:util';
24
+ import 'qrcode-terminal/vendor/QRCode/index.js';
25
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
25
26
  import 'web-push';
27
+ import 'node:zlib';
28
+ import '@simplewebauthn/server';
29
+ import 'node:net';
26
30
  import 'node:string_decoder';
27
31
  import 'node:fs/promises';
28
32
  import 'node:readline';
29
- import 'qrcode-terminal/vendor/QRCode/index.js';
30
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
31
33
  import 'node:url';
32
- import 'node:zlib';
33
- import '@simplewebauthn/server';
34
34
 
35
35
  const codexUpdate_post = defineApi(async (event, b) => {
36
36
  if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
@@ -1,4 +1,4 @@
1
- import { a as defineApi, f as findPane, i as getQuery, H as HerdrError, q as machineOfPane, ae as builtinCommands, af as slashCommands, aa as log } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, f as findPane, i as getQuery, H as HerdrError, E as machineOfPane, ar as builtinCommands, as as slashCommands, an as log } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -17,19 +17,19 @@ import 'node:buffer';
17
17
  import 'node:fs';
18
18
  import 'node:path';
19
19
  import 'node:os';
20
- import 'node:net';
21
20
  import 'node:child_process';
22
21
  import 'node:dns';
23
22
  import 'node:util';
23
+ import 'qrcode-terminal/vendor/QRCode/index.js';
24
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
24
25
  import 'web-push';
26
+ import 'node:zlib';
27
+ import '@simplewebauthn/server';
28
+ import 'node:net';
25
29
  import 'node:string_decoder';
26
30
  import 'node:fs/promises';
27
31
  import 'node:readline';
28
- import 'qrcode-terminal/vendor/QRCode/index.js';
29
- import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
32
  import 'node:url';
31
- import 'node:zlib';
32
- import '@simplewebauthn/server';
33
33
 
34
34
  const commands_get = defineApi(async (event) => {
35
35
  const p = findPane(String(getQuery(event).pane || ""));