wherdr 1.3.2 → 1.3.3

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 (174) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{AgentView.C4YOwvZG.css → AgentView.DzFWBd2A.css} +1 -1
  3. package/.output/public/_nuxt/B4Yk2tB1.js +23 -0
  4. package/.output/public/_nuxt/BBw_0a4M.js +6 -0
  5. package/.output/public/_nuxt/{D7sxNXx1.js → BSy6OCIY.js} +1 -1
  6. package/.output/public/_nuxt/BX5PM2JQ.js +1 -0
  7. package/.output/public/_nuxt/BgPDnf2S.js +1 -0
  8. package/.output/public/_nuxt/BkOxQzbS.js +2 -0
  9. package/.output/public/_nuxt/{8ksjcuDu.js → CKhgznq4.js} +45 -56
  10. package/.output/public/_nuxt/{Cd8j9O5w.js → CP8o925U.js} +1 -1
  11. package/.output/public/_nuxt/CkbmecwS.js +1 -0
  12. package/.output/public/_nuxt/Cr3SrGky.js +1 -0
  13. package/.output/public/_nuxt/DAg9fiVh.js +89 -0
  14. package/.output/public/_nuxt/DT8qZ0Wv.js +1 -0
  15. package/.output/public/_nuxt/DaaJIRB3.js +1 -0
  16. package/.output/public/_nuxt/{DViwOclv.js → DcJi16XA.js} +1 -1
  17. package/.output/public/_nuxt/VpjCgSXu.js +36 -0
  18. package/.output/public/_nuxt/builds/latest.json +1 -1
  19. package/.output/public/_nuxt/builds/meta/c735b6c0-1bd0-47d7-a208-d310f0a06287.json +1 -0
  20. package/.output/public/_nuxt/dPxB2L94.js +89 -0
  21. package/.output/public/_nuxt/{entry.Crt1r4l3.css → entry.CGWKmYU3.css} +1 -1
  22. package/.output/public/_nuxt/xYX85SPI.js +1 -0
  23. package/.output/public/sw.js +1 -1
  24. package/.output/server/chunks/_/branding.mjs +1 -1
  25. package/.output/server/chunks/_/filePaths.mjs +25 -0
  26. package/.output/server/chunks/_/files.mjs +204 -0
  27. package/.output/server/chunks/_/machineOrder.mjs +1 -1
  28. package/.output/server/chunks/_/onboarding.mjs +1 -1
  29. package/.output/server/chunks/_/package.mjs +3 -2
  30. package/.output/server/chunks/_/pluginPolicy.mjs +93 -0
  31. package/.output/server/chunks/_/plugins.mjs +4 -94
  32. package/.output/server/chunks/_/projectBoard.mjs +120 -29
  33. package/.output/server/chunks/_/projectDocs.mjs +106 -0
  34. package/.output/server/chunks/_/projectInbox.mjs +135 -0
  35. package/.output/server/chunks/_/projectThreads.mjs +46 -0
  36. package/.output/server/chunks/_/projectThreads2.mjs +61 -0
  37. package/.output/server/chunks/_/projectsActions.mjs +1 -1
  38. package/.output/server/chunks/_/projectsPlugin.mjs +1 -1
  39. package/.output/server/chunks/_/restart.mjs +2 -312
  40. package/.output/server/chunks/_/reveal.mjs +2 -24
  41. package/.output/server/chunks/_/selfupdate.mjs +3 -2
  42. package/.output/server/chunks/_/updates.mjs +51 -10
  43. package/.output/server/chunks/_/worktrees.mjs +1 -1
  44. package/.output/server/chunks/_/ws.mjs +1 -1
  45. package/.output/server/chunks/nitro/nitro.mjs +1096 -268
  46. package/.output/server/chunks/raw/bump-homebrew.mjs +1 -1
  47. package/.output/server/chunks/raw/herdr-plugin.mjs +1 -1
  48. package/.output/server/chunks/raw/release-ready.mjs +5 -0
  49. package/.output/server/chunks/routes/api/_..._.mjs +1 -1
  50. package/.output/server/chunks/routes/api/agents.post.mjs +1 -1
  51. package/.output/server/chunks/routes/api/ask-tab.post.mjs +1 -1
  52. package/.output/server/chunks/routes/api/attach.post.mjs +1 -1
  53. package/.output/server/chunks/routes/api/auth/disable.post.mjs +1 -1
  54. package/.output/server/chunks/routes/api/auth/lock-all.post.mjs +1 -1
  55. package/.output/server/chunks/routes/api/auth/lock.post.mjs +1 -1
  56. package/.output/server/chunks/routes/api/auth/login/options.post.mjs +1 -1
  57. package/.output/server/chunks/routes/api/auth/login/verify.post.mjs +1 -1
  58. package/.output/server/chunks/routes/api/auth/max-session.post.mjs +1 -1
  59. package/.output/server/chunks/routes/api/auth/register/options.post.mjs +1 -1
  60. package/.output/server/chunks/routes/api/auth/register/verify.post.mjs +1 -1
  61. package/.output/server/chunks/routes/api/auth/status.get.mjs +1 -1
  62. package/.output/server/chunks/routes/api/board.get.mjs +147 -0
  63. package/.output/server/chunks/routes/api/changes.get.mjs +2 -2
  64. package/.output/server/chunks/routes/api/chat/image.get.mjs +2 -2
  65. package/.output/server/chunks/routes/api/chat.get.mjs +2 -2
  66. package/.output/server/chunks/routes/api/choose.post.mjs +29 -3
  67. package/.output/server/chunks/routes/api/claude-statusline.post.mjs +2 -2
  68. package/.output/server/chunks/routes/api/close/status.get.mjs +2 -2
  69. package/.output/server/chunks/routes/api/close.post.mjs +1 -1
  70. package/.output/server/chunks/routes/api/codex-update.post.mjs +2 -2
  71. package/.output/server/chunks/routes/api/commands.get.mjs +2 -2
  72. package/.output/server/chunks/routes/api/config.get.mjs +3 -2
  73. package/.output/server/chunks/routes/api/dirs.get.mjs +2 -2
  74. package/.output/server/chunks/routes/api/dismiss-stopped.post.mjs +43 -0
  75. package/.output/server/chunks/routes/api/dismiss.post.mjs +2 -2
  76. package/.output/server/chunks/routes/api/effort.post.mjs +2 -2
  77. package/.output/server/chunks/routes/api/efforts.get.mjs +2 -2
  78. package/.output/server/chunks/routes/api/file.post.mjs +2 -2
  79. package/.output/server/chunks/routes/api/files/download.get.mjs +53 -0
  80. package/.output/server/chunks/routes/api/files/read.get.mjs +45 -0
  81. package/.output/server/chunks/routes/api/files.get.mjs +44 -0
  82. package/.output/server/chunks/routes/api/gitroot.get.mjs +2 -2
  83. package/.output/server/chunks/routes/api/health.get.mjs +1 -1
  84. package/.output/server/chunks/routes/api/index.get.mjs +1 -1
  85. package/.output/server/chunks/routes/api/input.post.mjs +13 -3
  86. package/.output/server/chunks/routes/api/interrupt.post.mjs +2 -2
  87. package/.output/server/chunks/routes/api/isgit.get.mjs +2 -2
  88. package/.output/server/chunks/routes/api/machine/awake.get.mjs +2 -2
  89. package/.output/server/chunks/routes/api/machine/awake.post.mjs +2 -2
  90. package/.output/server/chunks/routes/api/machine/order.get.mjs +1 -1
  91. package/.output/server/chunks/routes/api/machine/order.post.mjs +1 -1
  92. package/.output/server/chunks/routes/api/machine/rename.post.mjs +2 -2
  93. package/.output/server/chunks/routes/api/menu.post.mjs +2 -2
  94. package/.output/server/chunks/routes/api/model.post.mjs +2 -2
  95. package/.output/server/chunks/routes/api/models.get.mjs +2 -2
  96. package/.output/server/chunks/routes/api/nav.post.mjs +5 -4
  97. package/.output/server/chunks/routes/api/onboarding.get.mjs +1 -1
  98. package/.output/server/chunks/routes/api/onboarding.post.mjs +1 -1
  99. package/.output/server/chunks/routes/api/phone.get.mjs +2 -2
  100. package/.output/server/chunks/routes/api/phone.post.mjs +2 -2
  101. package/.output/server/chunks/routes/api/plugins/actions.get.mjs +2 -1
  102. package/.output/server/chunks/routes/api/plugins/invoke.post.mjs +2 -1
  103. package/.output/server/chunks/routes/api/plugins/profiles.get.mjs +2 -1
  104. package/.output/server/chunks/routes/api/plugins/projects.get.mjs +2 -2
  105. package/.output/server/chunks/routes/api/plugins/projects.post.mjs +2 -2
  106. package/.output/server/chunks/routes/api/plugins/thread-limits.get.mjs +2 -2
  107. package/.output/server/chunks/routes/api/plugins/thread-limits.post.mjs +2 -2
  108. package/.output/server/chunks/routes/api/project/inbox.get.mjs +43 -0
  109. package/.output/server/chunks/routes/api/project/inbox.post.mjs +43 -0
  110. package/.output/server/chunks/routes/api/project/memory.get.mjs +42 -0
  111. package/.output/server/chunks/routes/api/project/report.get.mjs +2 -2
  112. package/.output/server/chunks/routes/api/project/routines.get.mjs +43 -0
  113. package/.output/server/chunks/routes/api/project/settings.get.mjs +41 -0
  114. package/.output/server/chunks/routes/api/project/thread.get.mjs +44 -0
  115. package/.output/server/chunks/routes/api/project/thread.post.mjs +45 -0
  116. package/.output/server/chunks/routes/api/prompt.post.mjs +21 -3
  117. package/.output/server/chunks/routes/api/push/quiet.post.mjs +2 -2
  118. package/.output/server/chunks/routes/api/push/subscribe.post.mjs +2 -2
  119. package/.output/server/chunks/routes/api/push/test.post.mjs +2 -2
  120. package/.output/server/chunks/routes/api/push/unsubscribe.post.mjs +2 -2
  121. package/.output/server/chunks/routes/api/quotas.get.mjs +2 -2
  122. package/.output/server/chunks/routes/api/rename.post.mjs +1 -1
  123. package/.output/server/chunks/routes/api/requeue.post.mjs +2 -2
  124. package/.output/server/chunks/routes/api/restart.get.mjs +1 -1
  125. package/.output/server/chunks/routes/api/restart.post.mjs +1 -1
  126. package/.output/server/chunks/routes/api/reveal.post.mjs +2 -1
  127. package/.output/server/chunks/routes/api/screen-key.post.mjs +2 -2
  128. package/.output/server/chunks/routes/api/screen.get.mjs +5 -3
  129. package/.output/server/chunks/routes/api/search.get.mjs +2 -2
  130. package/.output/server/chunks/routes/api/seen.post.mjs +2 -2
  131. package/.output/server/chunks/routes/api/sessions.get.mjs +2 -2
  132. package/.output/server/chunks/routes/api/sessions.post.mjs +2 -2
  133. package/.output/server/chunks/routes/api/space.post.mjs +14 -14
  134. package/.output/server/chunks/routes/api/state.get.mjs +2 -2
  135. package/.output/server/chunks/routes/api/unqueue.post.mjs +2 -2
  136. package/.output/server/chunks/routes/api/update/status.get.mjs +1 -1
  137. package/.output/server/chunks/routes/api/update.get.mjs +2 -2
  138. package/.output/server/chunks/routes/api/update.post.mjs +2 -2
  139. package/.output/server/chunks/routes/api/upload.post.mjs +2 -2
  140. package/.output/server/chunks/routes/api/worktrees/remove.post.mjs +1 -1
  141. package/.output/server/chunks/routes/api/worktrees.get.mjs +1 -1
  142. package/.output/server/chunks/routes/favicon.ico.get.mjs +1 -1
  143. package/.output/server/chunks/routes/icons/_name_.get.mjs +2 -2
  144. package/.output/server/chunks/routes/renderer.mjs +3 -3
  145. package/.output/server/chunks/routes/uploads/_...name_.get.mjs +2 -2
  146. package/.output/server/chunks/routes/ws/_..._.mjs +2 -2
  147. package/.output/server/chunks/routes/ws/events.mjs +2 -2
  148. package/.output/server/chunks/routes/ws/term.mjs +2 -2
  149. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  150. package/.output/server/index.mjs +2 -2
  151. package/.output/server/package.json +1 -1
  152. package/README.md +332 -25
  153. package/bin/install-docker-skill.sh +20 -0
  154. package/bin/lib/commands.mjs +5 -1
  155. package/bin/lib/core.mjs +1 -0
  156. package/bin/lib/install-skill.sh +100 -0
  157. package/bin/lib/skill.mjs +16 -0
  158. package/bin/lib/updater.mjs +65 -12
  159. package/bin/lib/verify-release.mjs +20 -0
  160. package/package.json +3 -2
  161. package/skills/wherdr/SKILL.md +180 -0
  162. package/.output/public/_nuxt/B7QP1TFs.js +0 -23
  163. package/.output/public/_nuxt/BDNMzG2s.js +0 -1
  164. package/.output/public/_nuxt/BOpBIziZ.js +0 -6
  165. package/.output/public/_nuxt/BWXdFfeg.js +0 -17
  166. package/.output/public/_nuxt/COFCNFpG.js +0 -83
  167. package/.output/public/_nuxt/CXG-cOdh.js +0 -1
  168. package/.output/public/_nuxt/CkZ8t6uB.js +0 -1
  169. package/.output/public/_nuxt/D4Yz4rat.js +0 -65
  170. package/.output/public/_nuxt/DoD7Qb5P.js +0 -30
  171. package/.output/public/_nuxt/DyBZDSCV.js +0 -2
  172. package/.output/public/_nuxt/bLP7Jj-b.js +0 -1
  173. package/.output/public/_nuxt/builds/meta/7afbf062-5369-4002-b20d-7a582ff6e0f1.json +0 -1
  174. package/.output/server/chunks/routes/ws/mirror.mjs +0 -161
@@ -1,4 +1,4 @@
1
- import { H as HerdrError, B as keysFor, C as parseChoices, D as parseOmpField, a as defineApi, P as PANE_RE, h as herdr, f as findPane, q as transcripts, b as screenChoices, E as sameQuestion, F as sleep, g as choicesCache, p as poll } from '../../nitro/nitro.mjs';
1
+ import { H as HerdrError, N as keysFor, O as parseChoices, Q as parseOmpField, a as defineApi, P as PANE_RE, f as findPane, R as withPaneLock, S as selfUpdates, T as restarting, V as updateChoices, W as UPDATE_LABELS, X as updateRestartPlan, Y as restarts, p as poll, h as herdr, G as transcripts, b as screenChoices, Z as usesTerminalException, _ as sameQuestion, $ as sleep, g as choicesCache } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -113,7 +113,33 @@ async function typeClaudeAnswer(d, paneId, choices, index, answer) {
113
113
  }
114
114
 
115
115
  const choose_post = defineApi(async (event, b) => {
116
+ var _a;
116
117
  if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
118
+ if ((_a = findPane(b.pane_id)) == null ? void 0 : _a.stopped) {
119
+ return withPaneLock(b.pane_id, async () => {
120
+ const p = findPane(b.pane_id);
121
+ const launch = await selfUpdates.check(b.pane_id);
122
+ if (!(p == null ? void 0 : p.stopped) || !launch || restarting(p.id)) throw new HerdrError("stale", "The pane is not at an empty shell prompt. Check its terminal.");
123
+ const choice = updateChoices(launch)[Number(b.index)];
124
+ if (!choice || UPDATE_LABELS[choice] !== b.label || b.text) throw new HerdrError("stale", "The question has changed \u2014 check the current screen.");
125
+ const plan = updateRestartPlan(launch, choice);
126
+ restarts.set(p.id, { phase: "starting", agent: "codex", session: launch.session, at: Date.now() });
127
+ poll();
128
+ try {
129
+ await herdr("agent.start", { name: p.name || `codex-${Date.now().toString(36)}`, kind: "codex", pane_id: p.id, args: plan.args, timeout_ms: 6e4 }, 75e3);
130
+ } catch (e) {
131
+ if (!(e instanceof HerdrError) || e.code !== "agent_not_ready") {
132
+ restarts.delete(p.id);
133
+ setTimeout(poll, 0);
134
+ throw e;
135
+ }
136
+ }
137
+ selfUpdates.clear(p.id);
138
+ restarts.set(p.id, { phase: "starting", agent: "codex", session: launch.session, at: Date.now(), started: true });
139
+ setTimeout(poll, 0);
140
+ return { ok: true };
141
+ });
142
+ }
117
143
  const r = await herdr("pane.read", { pane_id: b.pane_id, source: "detection" }, 4e3);
118
144
  const text = r.read && r.read.text;
119
145
  const pane = findPane(b.pane_id);
@@ -122,7 +148,7 @@ const choose_post = defineApi(async (event, b) => {
122
148
  const i = Number(b.index);
123
149
  const option = choices && choices.options[i];
124
150
  const answer = typeof b.text === "string" ? b.text.trim() : "";
125
- if (!choices || !option || option.label !== b.label || answer && !option.free || option.free && !sameQuestion(choices.question, typeof b.question === "string" ? b.question : null)) {
151
+ if (!choices || usesTerminalException({ text: String(text || ""), agent: pane == null ? void 0 : pane.agent, status: pane == null ? void 0 : pane.status }) || !option || option.label !== b.label || answer && !option.free || option.free && !sameQuestion(choices.question, typeof b.question === "string" ? b.question : null)) {
126
152
  throw new HerdrError("stale", "The question has changed \u2014 check the current screen.");
127
153
  }
128
154
  if (option.free && !answer) throw new HerdrError("bad_text", "Write your answer before sending it.");
@@ -1,4 +1,4 @@
1
- import { a as defineApi, M as MACHINE_KEY_RE, G as getMachine, H as HerdrError, I as installClaudeStatusline } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, a0 as MACHINE_KEY_RE, a1 as getMachine, H as HerdrError, a2 as installClaudeStatusline } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -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, v 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';
@@ -21,8 +21,8 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
- import 'node:readline';
25
24
  import 'node:fs/promises';
25
+ import 'node:readline';
26
26
  import 'node:dns';
27
27
  import 'node:util';
28
28
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, P as PANE_RE, H as HerdrError, f as findPane, J as codexStatus } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, f as findPane, a3 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';
@@ -21,8 +21,8 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
- import 'node:readline';
25
24
  import 'node:fs/promises';
25
+ import 'node:readline';
26
26
  import 'node:dns';
27
27
  import 'node:util';
28
28
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, f as findPane, i as getQuery, H as HerdrError, n as machineOfPane, S as builtinCommands, T as slashCommands, Q as log } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, f as findPane, i as getQuery, H as HerdrError, D as machineOfPane, af as builtinCommands, ag as slashCommands, ab as log } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { V as HOME, a as defineApi, W as localMachine, X as readSubs, Y as vapidPublicKey, Z as pushReady, _ as machineConfigs, $ as recentDirsWithKinds, a0 as installedAgentKinds, l as localMachineLabel } from '../../nitro/nitro.mjs';
1
+ import { ah as HOME, a as defineApi, ai as localMachine, aj as readSubs, ak as vapidPublicKey, al as pushReady, am as machineConfigs, an as recentDirsWithKinds, ao as installedAgentKinds, l as localMachineLabel } from '../../nitro/nitro.mjs';
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { h as hostOpenReady } from '../../_/reveal.mjs';
@@ -21,14 +21,15 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
- import 'node:readline';
25
24
  import 'node:fs/promises';
25
+ import 'node:readline';
26
26
  import 'node:dns';
27
27
  import 'node:util';
28
28
  import 'qrcode-terminal/vendor/QRCode/index.js';
29
29
  import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
30
  import '@simplewebauthn/server';
31
31
  import 'node:url';
32
+ import '../../_/filePaths.mjs';
32
33
 
33
34
  const COLOR = /^(#[0-9a-f]{3,8}|[a-z]{3,20}|rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\))$/i;
34
35
  const NAME = /^[a-z0-9][a-z0-9-]{0,39}$/i;
@@ -1,4 +1,4 @@
1
- import { a as defineApi, i as getQuery, a7 as listDirs } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, i as getQuery, av as listDirs } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -0,0 +1,43 @@
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, R as withPaneLock, f as findPane, T as restarting, aw as dismissStopped, p as poll } from '../../nitro/nitro.mjs';
2
+ import 'node:http';
3
+ import 'node:https';
4
+ import 'node:crypto';
5
+ import 'stream';
6
+ import 'events';
7
+ import 'http';
8
+ import 'crypto';
9
+ import 'buffer';
10
+ import 'zlib';
11
+ import 'https';
12
+ import 'net';
13
+ import 'tls';
14
+ import 'url';
15
+ import 'node:events';
16
+ import 'node:buffer';
17
+ import 'node:fs';
18
+ import 'node:path';
19
+ import 'web-push';
20
+ import 'node:os';
21
+ import 'node:child_process';
22
+ import 'node:net';
23
+ import 'node:fs/promises';
24
+ import 'node:readline';
25
+ import 'node:dns';
26
+ import 'node:util';
27
+ import 'qrcode-terminal/vendor/QRCode/index.js';
28
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
29
+ import '@simplewebauthn/server';
30
+ import 'node:url';
31
+
32
+ const dismissStopped_post = defineApi(async (event, b) => {
33
+ if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
34
+ await withPaneLock(b.pane_id, async () => {
35
+ var _a;
36
+ if (((_a = findPane(b.pane_id)) == null ? void 0 : _a.stopped) && !restarting(b.pane_id)) dismissStopped(b.pane_id);
37
+ });
38
+ await poll();
39
+ return { ok: true };
40
+ });
41
+
42
+ export { dismissStopped_post as default };
43
+ //# sourceMappingURL=dismiss-stopped.post.mjs.map
@@ -1,4 +1,4 @@
1
- import { a as defineApi, P as PANE_RE, H as HerdrError, a8 as closePanel } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, ax as closePanel } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, P as PANE_RE, H as HerdrError, a9 as setEffort, f as findPane, aa as refreshModel } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, ay as setEffort, f as findPane, az as refreshModel } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, i as getQuery, P as PANE_RE, H as HerdrError, ab as listEfforts, f as findPane, aa as refreshModel } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, i as getQuery, P as PANE_RE, H as HerdrError, aA as listEfforts, f as findPane, az as refreshModel } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, i as getQuery, ac as saveUpload, P as PANE_RE } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, i as getQuery, aB as saveUpload, P as PANE_RE } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -0,0 +1,53 @@
1
+ import { a as defineApi, i as getQuery, f as findPane, H as HerdrError, v as machineFor, aC as setResponseHeader } from '../../../nitro/nitro.mjs';
2
+ import { r as readWrittenBytes, a as readFileBytes, b as attachmentHeader } from '../../../_/files.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 'web-push';
21
+ import 'node:os';
22
+ import 'node:child_process';
23
+ import 'node:net';
24
+ import 'node:fs/promises';
25
+ import 'node:readline';
26
+ import 'node:dns';
27
+ import 'node:util';
28
+ import 'qrcode-terminal/vendor/QRCode/index.js';
29
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
+ import '@simplewebauthn/server';
31
+ import 'node:url';
32
+ import '../../../_/filePaths.mjs';
33
+ import '../../../_/changes.mjs';
34
+
35
+ const download_get = defineApi(async (event) => {
36
+ const q = getQuery(event);
37
+ const p = findPane(String(q.pane || ""));
38
+ if (!p) throw new HerdrError("bad_pane", "Pane not found");
39
+ let f;
40
+ if (q.from === "chat") f = await readWrittenBytes(machineFor(p.machine), p.cwd, q.path);
41
+ else {
42
+ if (!p.cwd) throw new HerdrError("bad_cwd", "This agent\u2019s folder is unknown");
43
+ f = await readFileBytes(machineFor(p.machine), p.cwd, q.path);
44
+ }
45
+ setResponseHeader(event, "content-type", "application/octet-stream");
46
+ setResponseHeader(event, "content-disposition", attachmentHeader(f.name));
47
+ setResponseHeader(event, "x-content-type-options", "nosniff");
48
+ setResponseHeader(event, "content-security-policy", "default-src 'none'; sandbox");
49
+ return f.body;
50
+ });
51
+
52
+ export { download_get as default };
53
+ //# sourceMappingURL=download.get.mjs.map
@@ -0,0 +1,45 @@
1
+ import { a as defineApi, i as getQuery, f as findPane, H as HerdrError, v as machineFor } from '../../../nitro/nitro.mjs';
2
+ import { c as readWrittenPreview, d as readFilePreview } from '../../../_/files.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 'web-push';
21
+ import 'node:os';
22
+ import 'node:child_process';
23
+ import 'node:net';
24
+ import 'node:fs/promises';
25
+ import 'node:readline';
26
+ import 'node:dns';
27
+ import 'node:util';
28
+ import 'qrcode-terminal/vendor/QRCode/index.js';
29
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
+ import '@simplewebauthn/server';
31
+ import 'node:url';
32
+ import '../../../_/filePaths.mjs';
33
+ import '../../../_/changes.mjs';
34
+
35
+ const read_get = defineApi(async (event) => {
36
+ const q = getQuery(event);
37
+ const p = findPane(String(q.pane || ""));
38
+ if (!p) throw new HerdrError("bad_pane", "Pane not found");
39
+ if (q.from === "chat") return readWrittenPreview(machineFor(p.machine), p.cwd, q.path);
40
+ if (!p.cwd) throw new HerdrError("bad_cwd", "This agent\u2019s folder is unknown");
41
+ return readFilePreview(machineFor(p.machine), p.cwd, q.path);
42
+ });
43
+
44
+ export { read_get as default };
45
+ //# sourceMappingURL=read.get.mjs.map
@@ -0,0 +1,44 @@
1
+ import { a as defineApi, i as getQuery, f as findPane, H as HerdrError, v as machineFor } from '../../nitro/nitro.mjs';
2
+ import { l as listFiles } from '../../_/files.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 'web-push';
21
+ import 'node:os';
22
+ import 'node:child_process';
23
+ import 'node:net';
24
+ import 'node:fs/promises';
25
+ import 'node:readline';
26
+ import 'node:dns';
27
+ import 'node:util';
28
+ import 'qrcode-terminal/vendor/QRCode/index.js';
29
+ import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
30
+ import '@simplewebauthn/server';
31
+ import 'node:url';
32
+ import '../../_/filePaths.mjs';
33
+ import '../../_/changes.mjs';
34
+
35
+ const files_get = defineApi(async (event) => {
36
+ const q = getQuery(event);
37
+ const p = findPane(String(q.pane || ""));
38
+ if (!p) throw new HerdrError("bad_pane", "Pane not found");
39
+ if (!p.cwd) throw new HerdrError("bad_cwd", "This agent\u2019s folder is unknown");
40
+ return listFiles(machineFor(p.machine), p.cwd, q.path === void 0 ? null : String(q.path));
41
+ });
42
+
43
+ export { files_get as default };
44
+ //# sourceMappingURL=files.get.mjs.map
@@ -1,4 +1,4 @@
1
- import { a as defineApi, i as getQuery, m as machineFor, ad as underHome } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, i as getQuery, v as machineFor, aD as underHome } from '../../nitro/nitro.mjs';
2
2
  import { g as gitToplevel } from '../../_/changes.mjs';
3
3
  import { p as proposedRepo } from '../../_/projectsActions.mjs';
4
4
  import 'node:http';
@@ -22,8 +22,8 @@ import 'web-push';
22
22
  import 'node:os';
23
23
  import 'node:child_process';
24
24
  import 'node:net';
25
- import 'node:readline';
26
25
  import 'node:fs/promises';
26
+ import 'node:readline';
27
27
  import 'node:dns';
28
28
  import 'node:util';
29
29
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -21,8 +21,8 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
- import 'node:readline';
25
24
  import 'node:fs/promises';
25
+ import 'node:readline';
26
26
  import 'node:dns';
27
27
  import 'node:util';
28
28
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -21,8 +21,8 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
- import 'node:readline';
25
24
  import 'node:fs/promises';
25
+ import 'node:readline';
26
26
  import 'node:dns';
27
27
  import 'node:util';
28
28
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, P as PANE_RE, H as HerdrError, R as withPaneLock, h as herdr, f as findPane, ae as isSlashCommand, af as addQueued, p as poll } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, R as withPaneLock, f as findPane, aE as isSlashCommand, aF as addQueued, p as poll, h as herdr } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -31,10 +31,20 @@ import 'node:url';
31
31
 
32
32
  const input_post = defineApi(async (event, b) => {
33
33
  if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
34
- await withPaneLock(b.pane_id, async () => {
34
+ const held = await withPaneLock(b.pane_id, async () => {
35
+ const now = findPane(b.pane_id);
36
+ if ((now == null ? void 0 : now.stopped) || (now == null ? void 0 : now.leaving)) {
37
+ if (typeof b.text !== "string" || !b.text.trim() || isSlashCommand(b.text) || !Array.isArray(b.keys) || b.keys.length !== 1 || b.keys[0] !== "enter") {
38
+ throw new HerdrError("stale", now.stopped ? "Restart Codex before sending a command." : "Codex just stopped. Try again in a few seconds.");
39
+ }
40
+ const q = addQueued(b.pane_id, b.text, { held: true });
41
+ setTimeout(poll, 50);
42
+ return q;
43
+ }
35
44
  if (typeof b.text === "string" && b.text) await herdr("pane.send_input", { pane_id: b.pane_id, text: b.text });
36
45
  if (Array.isArray(b.keys) && b.keys.length) await herdr("pane.send_input", { pane_id: b.pane_id, keys: b.keys.map(String) });
37
46
  });
47
+ if (held) return { ok: true, queued: held };
38
48
  const p = findPane(b.pane_id);
39
49
  if (p && p.agent && typeof b.text === "string" && b.text.trim() && !isSlashCommand(b.text)) {
40
50
  const q = addQueued(b.pane_id, b.text);
@@ -1,4 +1,4 @@
1
- import { a as defineApi, P as PANE_RE, H as HerdrError, f as findPane, ag as interruptAgent, F as sleep, h as herdr, ah as takeBackFromClaude, ai as takeBack, Q as log, p as poll } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, f as findPane, aG as interruptAgent, $ as sleep, h as herdr, aH as takeBackFromClaude, aI as takeBack, ab as log, p as poll } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, i as getQuery, m as machineFor, ad as underHome, aj as isGitRepo, ak as projectFolderKinds } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, i as getQuery, v as machineFor, aD as underHome, aJ as isGitRepo, aK as projectFolderKinds } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, i as getQuery, M as MACHINE_KEY_RE, H as HerdrError, G as getMachine } from '../../../nitro/nitro.mjs';
1
+ import { a as defineApi, i as getQuery, a0 as MACHINE_KEY_RE, H as HerdrError, a1 as getMachine } from '../../../nitro/nitro.mjs';
2
2
  import { a as awakeStatus, s as sleepAssertions } from '../../../_/awake.mjs';
3
3
  import 'node:http';
4
4
  import 'node:https';
@@ -21,8 +21,8 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
- import 'node:readline';
25
24
  import 'node:fs/promises';
25
+ import 'node:readline';
26
26
  import 'node:dns';
27
27
  import 'node:util';
28
28
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, M as MACHINE_KEY_RE, H as HerdrError, G as getMachine } from '../../../nitro/nitro.mjs';
1
+ import { a as defineApi, a0 as MACHINE_KEY_RE, H as HerdrError, a1 as getMachine } from '../../../nitro/nitro.mjs';
2
2
  import { b as setAwake } from '../../../_/awake.mjs';
3
3
  import 'node:http';
4
4
  import 'node:https';
@@ -21,8 +21,8 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
- import 'node:readline';
25
24
  import 'node:fs/promises';
25
+ import 'node:readline';
26
26
  import 'node:dns';
27
27
  import 'node:util';
28
28
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -21,8 +21,8 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
- import 'node:readline';
25
24
  import 'node:fs/promises';
25
+ import 'node:readline';
26
26
  import 'node:dns';
27
27
  import 'node:util';
28
28
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -21,8 +21,8 @@ import 'web-push';
21
21
  import 'node:os';
22
22
  import 'node:child_process';
23
23
  import 'node:net';
24
- import 'node:readline';
25
24
  import 'node:fs/promises';
25
+ import 'node:readline';
26
26
  import 'node:dns';
27
27
  import 'node:util';
28
28
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, M as MACHINE_KEY_RE, G as getMachine, H as HerdrError, an as renameMachine } from '../../../nitro/nitro.mjs';
1
+ import { a as defineApi, a0 as MACHINE_KEY_RE, a1 as getMachine, H as HerdrError, aN as renameMachine } from '../../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';
@@ -1,4 +1,4 @@
1
- import { a as defineApi, P as PANE_RE, H as HerdrError, ao as readMenu, ap as searchKeys, F as sleep, aq as findEntry, ar as stepToward, as as clickMovesOnly, e as watchScreen, q as transcripts, p as poll, h as herdr } from '../../nitro/nitro.mjs';
1
+ import { a as defineApi, P as PANE_RE, H as HerdrError, aO as readMenu, aP as searchKeys, $ as sleep, aQ as findEntry, aR as stepToward, aS as clickMovesOnly, e as watchScreen, G as transcripts, p as poll, h as herdr } from '../../nitro/nitro.mjs';
2
2
  import 'node:http';
3
3
  import 'node:https';
4
4
  import 'node:crypto';
@@ -20,8 +20,8 @@ import 'web-push';
20
20
  import 'node:os';
21
21
  import 'node:child_process';
22
22
  import 'node:net';
23
- import 'node:readline';
24
23
  import 'node:fs/promises';
24
+ import 'node:readline';
25
25
  import 'node:dns';
26
26
  import 'node:util';
27
27
  import 'qrcode-terminal/vendor/QRCode/index.js';