wherdr 1.2.0 → 1.3.1

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 (124) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{AgentView.DE2GDt4O.css → AgentView.C4YOwvZG.css} +1 -1
  3. package/.output/public/_nuxt/{BIA9pZvC.js → B6qBWHWB.js} +1 -1
  4. package/.output/public/_nuxt/BMIe8p_3.js +2 -0
  5. package/.output/public/_nuxt/BrAeJIZR.js +30 -0
  6. package/.output/public/_nuxt/C12eXl5z.js +1 -0
  7. package/.output/public/_nuxt/{DxO1TBoK.js → C2T9fQ4f.js} +1 -1
  8. package/.output/public/_nuxt/CYxHnMNH.js +83 -0
  9. package/.output/public/_nuxt/{D903WmCE.js → CctS2Xn6.js} +1 -1
  10. package/.output/public/_nuxt/{Bta8at9w.js → CiYar6hg.js} +1 -1
  11. package/.output/public/_nuxt/{CjKICX3g.js → Dwh-l2rQ.js} +11 -11
  12. package/.output/public/_nuxt/{e5N4AqCN.js → WLQjK8uJ.js} +41 -41
  13. package/.output/public/_nuxt/builds/latest.json +1 -1
  14. package/.output/public/_nuxt/builds/meta/6466b0ab-7935-460c-abdf-2ea632dae6d0.json +1 -0
  15. package/.output/public/_nuxt/{entry.SHBiCXBL.css → entry.cKR16VqG.css} +1 -1
  16. package/.output/public/_nuxt/whFLy_Ne.js +23 -0
  17. package/.output/public/sw.js +1 -1
  18. package/.output/server/chunks/_/branding.mjs +1 -1
  19. package/.output/server/chunks/_/plugins.mjs +10 -2
  20. package/.output/server/chunks/_/worktrees.mjs +1 -1
  21. package/.output/server/chunks/_/ws.mjs +1 -1
  22. package/.output/server/chunks/nitro/nitro.mjs +626 -436
  23. package/.output/server/chunks/raw/bump-homebrew.mjs +7 -0
  24. package/.output/server/chunks/raw/herdr-plugin.mjs +1 -1
  25. package/.output/server/chunks/routes/api/_..._.mjs +1 -0
  26. package/.output/server/chunks/routes/api/agents.post.mjs +1 -0
  27. package/.output/server/chunks/routes/api/ask-tab.post.mjs +1 -0
  28. package/.output/server/chunks/routes/api/attach.post.mjs +1 -0
  29. package/.output/server/chunks/routes/api/auth/disable.post.mjs +1 -0
  30. package/.output/server/chunks/routes/api/auth/lock-all.post.mjs +1 -0
  31. package/.output/server/chunks/routes/api/auth/lock.post.mjs +1 -0
  32. package/.output/server/chunks/routes/api/auth/login/options.post.mjs +1 -0
  33. package/.output/server/chunks/routes/api/auth/login/verify.post.mjs +1 -0
  34. package/.output/server/chunks/routes/api/auth/max-session.post.mjs +1 -0
  35. package/.output/server/chunks/routes/api/auth/register/options.post.mjs +1 -0
  36. package/.output/server/chunks/routes/api/auth/register/verify.post.mjs +1 -0
  37. package/.output/server/chunks/routes/api/auth/status.get.mjs +1 -0
  38. package/.output/server/chunks/routes/api/changes.get.mjs +1 -0
  39. package/.output/server/chunks/routes/api/chat/image.get.mjs +1 -0
  40. package/.output/server/chunks/routes/api/chat.get.mjs +1 -0
  41. package/.output/server/chunks/routes/api/choose.post.mjs +1 -0
  42. package/.output/server/chunks/routes/api/claude-statusline.post.mjs +1 -0
  43. package/.output/server/chunks/routes/api/close/status.get.mjs +1 -0
  44. package/.output/server/chunks/routes/api/close.post.mjs +1 -0
  45. package/.output/server/chunks/routes/api/codex-update.post.mjs +1 -0
  46. package/.output/server/chunks/routes/api/commands.get.mjs +1 -0
  47. package/.output/server/chunks/routes/api/config.get.mjs +1 -0
  48. package/.output/server/chunks/routes/api/dirs.get.mjs +1 -0
  49. package/.output/server/chunks/routes/api/dismiss.post.mjs +1 -0
  50. package/.output/server/chunks/routes/api/effort.post.mjs +1 -0
  51. package/.output/server/chunks/routes/api/efforts.get.mjs +1 -0
  52. package/.output/server/chunks/routes/api/file.post.mjs +1 -0
  53. package/.output/server/chunks/routes/api/gitroot.get.mjs +1 -0
  54. package/.output/server/chunks/routes/api/index.get.mjs +1 -0
  55. package/.output/server/chunks/routes/api/input.post.mjs +1 -0
  56. package/.output/server/chunks/routes/api/interrupt.post.mjs +1 -0
  57. package/.output/server/chunks/routes/api/isgit.get.mjs +1 -0
  58. package/.output/server/chunks/routes/api/machine/awake.get.mjs +1 -0
  59. package/.output/server/chunks/routes/api/machine/awake.post.mjs +1 -0
  60. package/.output/server/chunks/routes/api/machine/order.get.mjs +1 -0
  61. package/.output/server/chunks/routes/api/machine/order.post.mjs +1 -0
  62. package/.output/server/chunks/routes/api/machine/rename.post.mjs +1 -0
  63. package/.output/server/chunks/routes/api/menu.post.mjs +1 -0
  64. package/.output/server/chunks/routes/api/model.post.mjs +1 -0
  65. package/.output/server/chunks/routes/api/models.get.mjs +1 -0
  66. package/.output/server/chunks/routes/api/nav.post.mjs +1 -0
  67. package/.output/server/chunks/routes/api/onboarding.get.mjs +1 -0
  68. package/.output/server/chunks/routes/api/onboarding.post.mjs +1 -0
  69. package/.output/server/chunks/routes/api/phone.get.mjs +1 -0
  70. package/.output/server/chunks/routes/api/phone.post.mjs +1 -0
  71. package/.output/server/chunks/routes/api/plugins/actions.get.mjs +1 -0
  72. package/.output/server/chunks/routes/api/plugins/invoke.post.mjs +1 -0
  73. package/.output/server/chunks/routes/api/plugins/profiles.get.mjs +1 -0
  74. package/.output/server/chunks/routes/api/plugins/projects.get.mjs +1 -0
  75. package/.output/server/chunks/routes/api/plugins/projects.post.mjs +1 -0
  76. package/.output/server/chunks/routes/api/plugins/thread-limits.get.mjs +1 -0
  77. package/.output/server/chunks/routes/api/plugins/thread-limits.post.mjs +1 -0
  78. package/.output/server/chunks/routes/api/project/report.get.mjs +1 -0
  79. package/.output/server/chunks/routes/api/prompt.post.mjs +1 -0
  80. package/.output/server/chunks/routes/api/push/quiet.post.mjs +1 -0
  81. package/.output/server/chunks/routes/api/push/subscribe.post.mjs +1 -0
  82. package/.output/server/chunks/routes/api/push/test.post.mjs +1 -0
  83. package/.output/server/chunks/routes/api/push/unsubscribe.post.mjs +1 -0
  84. package/.output/server/chunks/routes/api/quotas.get.mjs +1 -0
  85. package/.output/server/chunks/routes/api/rename.post.mjs +1 -0
  86. package/.output/server/chunks/routes/api/requeue.post.mjs +1 -0
  87. package/.output/server/chunks/routes/api/restart.get.mjs +1 -0
  88. package/.output/server/chunks/routes/api/restart.post.mjs +1 -0
  89. package/.output/server/chunks/routes/api/reveal.post.mjs +1 -0
  90. package/.output/server/chunks/routes/api/screen-key.post.mjs +1 -0
  91. package/.output/server/chunks/routes/api/screen.get.mjs +8 -5
  92. package/.output/server/chunks/routes/api/search.get.mjs +2 -1
  93. package/.output/server/chunks/routes/api/seen.post.mjs +2 -1
  94. package/.output/server/chunks/routes/api/sessions.get.mjs +2 -1
  95. package/.output/server/chunks/routes/api/sessions.post.mjs +2 -1
  96. package/.output/server/chunks/routes/api/space.post.mjs +2 -1
  97. package/.output/server/chunks/routes/api/state.get.mjs +1 -0
  98. package/.output/server/chunks/routes/api/unqueue.post.mjs +2 -1
  99. package/.output/server/chunks/routes/api/update.get.mjs +3 -2
  100. package/.output/server/chunks/routes/api/upload.post.mjs +1 -0
  101. package/.output/server/chunks/routes/api/worktrees/remove.post.mjs +1 -0
  102. package/.output/server/chunks/routes/api/worktrees.get.mjs +1 -0
  103. package/.output/server/chunks/routes/favicon.ico.get.mjs +1 -0
  104. package/.output/server/chunks/routes/icons/_name_.get.mjs +2 -1
  105. package/.output/server/chunks/routes/renderer.mjs +3 -2
  106. package/.output/server/chunks/routes/uploads/_...name_.get.mjs +2 -1
  107. package/.output/server/chunks/routes/ws/_..._.mjs +2 -1
  108. package/.output/server/chunks/routes/ws/events.mjs +2 -1
  109. package/.output/server/chunks/routes/ws/mirror.mjs +1 -1
  110. package/.output/server/chunks/routes/ws/term.mjs +2 -96
  111. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  112. package/.output/server/index.mjs +2 -1
  113. package/.output/server/package.json +1 -1
  114. package/README.md +107 -23
  115. package/bin/lib/brew.mjs +86 -0
  116. package/bin/lib/commands.mjs +32 -8
  117. package/bin/lib/core.mjs +7 -2
  118. package/package.json +1 -1
  119. package/.output/public/_nuxt/BDI8xNSb.js +0 -2
  120. package/.output/public/_nuxt/BevNMnQ2.js +0 -83
  121. package/.output/public/_nuxt/CA9mI3eg.js +0 -23
  122. package/.output/public/_nuxt/DBu2-cEy.js +0 -30
  123. package/.output/public/_nuxt/DJE_XMLO.js +0 -1
  124. package/.output/public/_nuxt/builds/meta/211609c0-be04-46c5-a6b0-566bc0c4a3dd.json +0 -1
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, i as getQuery, P as PANE_RE, H as HerdrError, h as herdr } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, i as getQuery, P as PANE_RE, H as HerdrError, h as herdr, b7 as settingsTabs, b8 as tabsOfRow } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -63,13 +64,15 @@ const screen_get = defineApi(async (event) => {
63
64
  if (!PANE_RE.test(pane)) throw new HerdrError("bad_pane", "Invalid pane");
64
65
  const r = await herdr("pane.read", { pane_id: pane, source: "visible" }, 4e3);
65
66
  const text = r.read && r.read.text || "";
67
+ const tabs = settingsTabs(text);
66
68
  let tab = null;
67
- if (/^\s*Settings\s+Status\s+Config\b/m.test(text)) {
69
+ if (tabs) {
68
70
  const a = await herdr("pane.read", { pane_id: pane, source: "visible", format: "ansi" }, 4e3).catch(() => null);
69
- const line = String(a && a.read && a.read.text || "").split("\n").find((l) => l.includes("Settings") && l.includes("Status"));
70
- tab = line ? activeTab(line) : null;
71
+ const line = String(a && a.read && a.read.text || "").split("\n").find((l) => tabsOfRow(l.replace(/\x1b\[[\d;]*m|\r/g, "")));
72
+ const hit = line ? activeTab(line) : null;
73
+ tab = hit && tabs.includes(hit) ? hit : null;
71
74
  }
72
- return { text, tab };
75
+ return { text, tabs, tab };
73
76
  });
74
77
 
75
78
  export { screen_get as default };
@@ -1,4 +1,4 @@
1
- import { a as defineApi, i as getQuery, aC as getState, b7 as hasTranscript, n as machineOfPane, b8 as SEARCH_DEADLINE_MS, b9 as SEARCH_MAX_RESULTS, ba as spaceTitle } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, i as getQuery, aC as getState, b9 as hasTranscript, n as machineOfPane, ba as SEARCH_DEADLINE_MS, bb as SEARCH_MAX_RESULTS, bc as spaceTitle } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, P as PANE_RE, H as HerdrError, bb as markSeen } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, bd as markSeen } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, i as getQuery, bc as listSessions } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, i as getQuery, be as listSessions } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, H as HerdrError, bd as openSession } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, H as HerdrError, bf as openSession } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { be as PANE_DIRECTIONS, a5 as splitId, a4 as PANE_RE, a as defineApi, H as HerdrError, Q as log, p as poll, aB as herdrOn } from '../../nitro/nitro.mjs';
1
+ import { bg as PANE_DIRECTIONS, a5 as splitId, a4 as PANE_RE, a as defineApi, H as HerdrError, Q as log, p as poll, aB as herdrOn } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, P as PANE_RE, H as HerdrError, bf as cancelQueued } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, bh as cancelQueued } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { bg as installMode, bh as updateCommand, bi as compareVersions, a as defineApi } from '../../nitro/nitro.mjs';
1
+ import { bi as installMode, bj as updateCommand, bk as compareVersions, a as defineApi } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,11 +20,12 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
26
27
 
27
- var version = "1.2.0";
28
+ var version = "1.3.1";
28
29
  const pkg = {
29
30
  version: version};
30
31
 
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { d as defineEventHandler, bo as getRouterParam } from '../../nitro/nitro.mjs';
1
+ import { d as defineEventHandler, bq as getRouterParam } from '../../nitro/nitro.mjs';
2
2
  import { s as serveBranding } from '../../_/branding.mjs';
3
3
  import 'node:http';
4
4
  import 'node:https';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { bx as useRuntimeConfig, by as encodePath, bz as joinRelativeURL, bA as defineRenderHandler, i as getQuery, bB as createError, bC as destr, bD as getRouteRules, bE as relative, bF as joinURL, bG as getResponseStatusText, bH as getResponseStatus, bI as useNitroApp } from '../nitro/nitro.mjs';
1
+ import { bz as useRuntimeConfig, bA as encodePath, bB as joinRelativeURL, bC as defineRenderHandler, i as getQuery, bD as createError, bE as destr, bF as getRouteRules, bG as relative, bH as joinURL, bI as getResponseStatusText, bJ as getResponseStatus, bK as useNitroApp } from '../nitro/nitro.mjs';
2
2
  import { createHead as createHead$1, propsToString, renderSSRHead } from 'unhead/server';
3
3
  import { isRef, toValue } from 'vue';
4
4
  import { DeprecationsPlugin } from 'unhead/legacy';
@@ -26,6 +26,7 @@ import 'web-push';
26
26
  import 'node:os';
27
27
  import 'node:child_process';
28
28
  import 'node:net';
29
+ import 'node:readline';
29
30
  import 'node:fs/promises';
30
31
  import 'node:url';
31
32
  import '@simplewebauthn/server';
@@ -201,7 +202,7 @@ function encodeForwardSlashes(str) {
201
202
 
202
203
  const renderSSRHeadOptions = {"omitLineBreaks":true};
203
204
 
204
- const entryFileName = "DBu2-cEy.js";
205
+ const entryFileName = "BrAeJIZR.js";
205
206
 
206
207
  //#region src/runtime/handlers/renderer.ts
207
208
  globalThis.__buildAssetsURL = buildAssetsURL;
@@ -1,4 +1,4 @@
1
- import { d as defineEventHandler, bo as getRouterParam, bp as readUpload, s as sendError, z as sendImage } from '../../nitro/nitro.mjs';
1
+ import { d as defineEventHandler, bq as getRouterParam, br as readUpload, s as sendError, z as sendImage } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { bq as defineWebSocketHandler } from '../../nitro/nitro.mjs';
1
+ import { bs as defineWebSocketHandler } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,6 +20,7 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
+ import 'node:readline';
23
24
  import 'node:fs/promises';
24
25
  import 'node:url';
25
26
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { bq as defineWebSocketHandler, br as eventClients, P as PANE_RE, bs as getStateJson } from '../../nitro/nitro.mjs';
1
+ import { bs as defineWebSocketHandler, bt as eventClients, P as PANE_RE, bu as getStateJson } from '../../nitro/nitro.mjs';
2
2
  import { u as unwatchPeer, m as messageText, w as watchPeer, i as isOpen, c as checkUpgrade } from '../../_/ws.mjs';
3
3
  import 'node:http';
4
4
  import 'node:https';
@@ -21,6 +21,7 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
+ import 'node:readline';
24
25
  import 'node:fs/promises';
25
26
  import 'node:url';
26
27
  import '@simplewebauthn/server';
@@ -1,4 +1,4 @@
1
- import { P as PANE_RE, n as machineOfPane, o as fmt, h as herdr, aC as getState, bv as mirrorSize, a5 as splitId, Q as log, bq as defineWebSocketHandler } from '../../nitro/nitro.mjs';
1
+ import { P as PANE_RE, n as machineOfPane, o as fmt, h as herdr, aC as getState, bx as mirrorSize, a5 as splitId, Q as log, bs as defineWebSocketHandler } from '../../nitro/nitro.mjs';
2
2
  import { u as unwatchPeer, m as messageText, w as watchPeer, c as checkUpgrade, i as isOpen } from '../../_/ws.mjs';
3
3
  import readline from 'node:readline';
4
4
  import 'node:http';
@@ -1,6 +1,5 @@
1
- import { P as PANE_RE, n as machineOfPane, o as fmt, a5 as splitId, bw as termSessions, Q as log, h as herdr, bq as defineWebSocketHandler } from '../../nitro/nitro.mjs';
1
+ import { bs as defineWebSocketHandler, by as openTerm } from '../../nitro/nitro.mjs';
2
2
  import { u as unwatchPeer, m as messageText, w as watchPeer, c as checkUpgrade, i as isOpen } from '../../_/ws.mjs';
3
- import readline from 'node:readline';
4
3
  import 'node:http';
5
4
  import 'node:https';
6
5
  import 'node:crypto';
@@ -22,104 +21,11 @@ import 'web-push';
22
21
  import 'node:os';
23
22
  import 'node:child_process';
24
23
  import 'node:net';
24
+ import 'node:readline';
25
25
  import 'node:fs/promises';
26
26
  import 'node:url';
27
27
  import '@simplewebauthn/server';
28
28
 
29
- const clampInt = (v, lo, hi, dflt) => {
30
- const n = parseInt(String(v), 10);
31
- return Number.isFinite(n) ? Math.min(hi, Math.max(lo, n)) : dflt;
32
- };
33
- function openTerm(ws, url) {
34
- const pane = url.searchParams.get("pane") || "";
35
- if (!PANE_RE.test(pane)) {
36
- ws.close(4400, "Invalid pane");
37
- return null;
38
- }
39
- const machine = machineOfPane(pane);
40
- if (!machine || !machine.sock()) {
41
- ws.send(JSON.stringify({ type: "terminal.closed", reason: machine ? fmt("{machine} is unreachable", { machine: machine.label }) : "unknown machine", code: machine ? "unreachable" : "unknown_machine", machine: machine == null ? void 0 : machine.label }));
42
- ws.close(4503, "machine unreachable");
43
- return null;
44
- }
45
- const cols = clampInt(url.searchParams.get("cols"), 10, 400, 80);
46
- const rows = clampInt(url.searchParams.get("rows"), 5, 200, 24);
47
- const args = ["terminal", "session", "control", splitId(pane).local, "--cols", String(cols), "--rows", String(rows)];
48
- if (url.searchParams.get("takeover") === "1") args.push("--takeover");
49
- const child = machine.spawnHerdr(args);
50
- const sess = { pane, visible: true };
51
- termSessions.add(sess);
52
- log(`term ${pane} opened ${cols}x${rows}${args.includes("--takeover") ? " (takeover)" : ""}${machine.local ? "" : ` on ${machine.label}`}`);
53
- readline.createInterface({ input: child.stdout }).on("line", (line) => {
54
- if (ws.isOpen()) ws.send(line);
55
- });
56
- readline.createInterface({ input: child.stderr }).on("line", (line) => {
57
- log(`term ${pane} stderr: ${line}`);
58
- if (ws.isOpen()) ws.send(JSON.stringify({ type: "herdr.stderr", message: line }));
59
- });
60
- child.on("error", (e) => {
61
- if (ws.isOpen()) ws.send(JSON.stringify({ type: "terminal.closed", reason: `herdr: ${e.message}` }));
62
- ws.close(4500, "herdr error");
63
- });
64
- child.on("exit", (code) => {
65
- termSessions.delete(sess);
66
- if (ws.isOpen()) ws.close(4e3, `herdr exit ${code}`);
67
- });
68
- child.stdin.on("error", () => {
69
- });
70
- const toChild = (obj) => {
71
- if (child.stdin.writable) child.stdin.write(JSON.stringify(obj) + "\n");
72
- };
73
- return {
74
- onMessage(raw) {
75
- let m;
76
- try {
77
- m = JSON.parse(raw);
78
- } catch {
79
- return;
80
- }
81
- switch (m && m.type) {
82
- case "terminal.input":
83
- if (typeof m.text === "string" && m.text.length <= 65536) toChild({ type: "terminal.input", text: m.text });
84
- else if (typeof m.bytes === "string" && m.bytes.length <= 9e4) toChild({ type: "terminal.input", bytes: m.bytes });
85
- break;
86
- case "terminal.resize":
87
- toChild({ type: "terminal.resize", cols: clampInt(m.cols, 10, 400, cols), rows: clampInt(m.rows, 5, 200, rows) });
88
- break;
89
- case "terminal.scroll":
90
- if (m.direction === "up" || m.direction === "down") {
91
- toChild({ type: "terminal.scroll", direction: m.direction, lines: clampInt(m.lines, 1, 500, 3) });
92
- }
93
- break;
94
- case "keys":
95
- if (Array.isArray(m.keys) && m.keys.length <= 32 && m.keys.every((k) => typeof k === "string" && k.length <= 24)) {
96
- herdr("pane.send_input", { pane_id: pane, keys: m.keys }).catch((e) => ws.isOpen() && ws.send(JSON.stringify({ type: "web.error", code: e.code, message: e.message })));
97
- }
98
- break;
99
- // Pasted text, as Herdr's pane input: omp receives it as a paste and
100
- // turns an image path into an image (typed through wherdr's xterm, which
101
- // never learns the program's bracketed paste mode, it stays text).
102
- case "paste":
103
- if (typeof m.text === "string" && m.text && m.text.length <= 65536) {
104
- herdr("pane.send_input", { pane_id: pane, text: m.text }).catch((e) => ws.isOpen() && ws.send(JSON.stringify({ type: "web.error", code: e.code, message: e.message })));
105
- }
106
- break;
107
- case "visibility":
108
- sess.visible = Boolean(m.visible);
109
- break;
110
- }
111
- },
112
- onClose() {
113
- termSessions.delete(sess);
114
- toChild({ type: "terminal.release" });
115
- child.stdin.end();
116
- setTimeout(() => {
117
- if (child.exitCode === null) child.kill("SIGTERM");
118
- }, 1500);
119
- }
120
- };
121
- }
122
-
123
29
  const sessions = /* @__PURE__ */ new Map();
124
30
  const term = defineWebSocketHandler({
125
31
  upgrade: (request) => checkUpgrade(request),