wherdr 1.3.2 → 1.3.4

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 (188) 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/{Cd8j9O5w.js → BEJHMUrj.js} +1 -1
  4. package/.output/public/_nuxt/BOtcEDnA.js +1 -0
  5. package/.output/public/_nuxt/BUaYhQ2r.js +6 -0
  6. package/.output/public/_nuxt/{yzABg5xl.js → Bpoxvzh6.js} +1 -1
  7. package/.output/public/_nuxt/C25ROUa9.js +3 -0
  8. package/.output/public/_nuxt/CDWjMk9C.js +2 -0
  9. package/.output/public/_nuxt/CJKsMzIp.js +1 -0
  10. package/.output/public/_nuxt/CJNhn9sA.js +36 -0
  11. package/.output/public/_nuxt/COCvtdHN.js +89 -0
  12. package/.output/public/_nuxt/{Ci8N4mWR.js → CXJnLmWv.js} +1 -1
  13. package/.output/public/_nuxt/Cl45J6_Q.js +1 -0
  14. package/.output/public/_nuxt/CndPDbMI.js +2 -0
  15. package/.output/public/_nuxt/Ctbx58Um.js +23 -0
  16. package/.output/public/_nuxt/{8ksjcuDu.js → DMLmW6JM.js} +49 -56
  17. package/.output/public/_nuxt/Dl1PHLOB.js +1 -0
  18. package/.output/public/_nuxt/Nhex3_iH.js +1 -0
  19. package/.output/public/_nuxt/OpWX45i7.js +89 -0
  20. package/.output/public/_nuxt/builds/latest.json +1 -1
  21. package/.output/public/_nuxt/builds/meta/4994f3a4-4126-4f57-a9e5-c7ebb25850bc.json +1 -0
  22. package/.output/public/_nuxt/dTj21DMs.js +1 -0
  23. package/.output/public/_nuxt/entry.BohTWE-n.css +2 -0
  24. package/.output/public/_nuxt/kwSoIiM7.js +1 -0
  25. package/.output/public/_nuxt/mkEwYka4.js +1 -0
  26. package/.output/public/_nuxt/pdf.min.t82Z80JU.mjs +28 -0
  27. package/.output/public/_nuxt/pdf.worker.min.wgc6bjNh.mjs +28 -0
  28. package/.output/public/_nuxt/w7Rm7unj.js +1 -0
  29. package/.output/public/sw.js +1 -1
  30. package/.output/server/chunks/_/branding.mjs +1 -1
  31. package/.output/server/chunks/_/filePaths.mjs +25 -0
  32. package/.output/server/chunks/_/files.mjs +217 -0
  33. package/.output/server/chunks/_/machineOrder.mjs +1 -1
  34. package/.output/server/chunks/_/onboarding.mjs +1 -1
  35. package/.output/server/chunks/_/package.mjs +5 -2
  36. package/.output/server/chunks/_/pluginPolicy.mjs +93 -0
  37. package/.output/server/chunks/_/plugins.mjs +9 -96
  38. package/.output/server/chunks/_/projectBoard.mjs +124 -36
  39. package/.output/server/chunks/_/projectDocs.mjs +106 -0
  40. package/.output/server/chunks/_/projectInbox.mjs +135 -0
  41. package/.output/server/chunks/_/projectThreads.mjs +46 -0
  42. package/.output/server/chunks/_/projectThreads2.mjs +61 -0
  43. package/.output/server/chunks/_/projectsActions.mjs +1 -1
  44. package/.output/server/chunks/_/projectsPlugin.mjs +24 -50
  45. package/.output/server/chunks/_/projectsPlugin2.mjs +57 -0
  46. package/.output/server/chunks/_/restart.mjs +2 -312
  47. package/.output/server/chunks/_/reveal.mjs +2 -24
  48. package/.output/server/chunks/_/selfupdate.mjs +3 -2
  49. package/.output/server/chunks/_/settingstabs.mjs +36 -0
  50. package/.output/server/chunks/_/updates.mjs +51 -10
  51. package/.output/server/chunks/_/worktrees.mjs +1 -1
  52. package/.output/server/chunks/_/ws.mjs +1 -1
  53. package/.output/server/chunks/nitro/nitro.mjs +1718 -417
  54. package/.output/server/chunks/raw/bump-homebrew.mjs +1 -1
  55. package/.output/server/chunks/raw/herdr-plugin.mjs +1 -1
  56. package/.output/server/chunks/raw/release-ready.mjs +5 -0
  57. package/.output/server/chunks/routes/api/_..._.mjs +1 -1
  58. package/.output/server/chunks/routes/api/agents.post.mjs +1 -1
  59. package/.output/server/chunks/routes/api/ask-tab.post.mjs +1 -1
  60. package/.output/server/chunks/routes/api/attach.post.mjs +1 -1
  61. package/.output/server/chunks/routes/api/auth/disable.post.mjs +1 -1
  62. package/.output/server/chunks/routes/api/auth/lock-all.post.mjs +1 -1
  63. package/.output/server/chunks/routes/api/auth/lock.post.mjs +1 -1
  64. package/.output/server/chunks/routes/api/auth/login/options.post.mjs +1 -1
  65. package/.output/server/chunks/routes/api/auth/login/verify.post.mjs +1 -1
  66. package/.output/server/chunks/routes/api/auth/max-session.post.mjs +1 -1
  67. package/.output/server/chunks/routes/api/auth/register/options.post.mjs +1 -1
  68. package/.output/server/chunks/routes/api/auth/register/verify.post.mjs +1 -1
  69. package/.output/server/chunks/routes/api/auth/status.get.mjs +1 -1
  70. package/.output/server/chunks/routes/api/board.get.mjs +148 -0
  71. package/.output/server/chunks/routes/api/changes.get.mjs +2 -2
  72. package/.output/server/chunks/routes/api/chat/image.get.mjs +2 -2
  73. package/.output/server/chunks/routes/api/chat.get.mjs +26 -6
  74. package/.output/server/chunks/routes/api/choose.post.mjs +40 -14
  75. package/.output/server/chunks/routes/api/claude-statusline.post.mjs +2 -2
  76. package/.output/server/chunks/routes/api/close/status.get.mjs +2 -2
  77. package/.output/server/chunks/routes/api/close.post.mjs +1 -1
  78. package/.output/server/chunks/routes/api/codex-update.post.mjs +2 -2
  79. package/.output/server/chunks/routes/api/commands.get.mjs +4 -3
  80. package/.output/server/chunks/routes/api/config.get.mjs +3 -2
  81. package/.output/server/chunks/routes/api/dirs.get.mjs +2 -2
  82. package/.output/server/chunks/routes/api/dismiss-stopped.post.mjs +43 -0
  83. package/.output/server/chunks/routes/api/dismiss.post.mjs +2 -2
  84. package/.output/server/chunks/routes/api/effort.post.mjs +2 -2
  85. package/.output/server/chunks/routes/api/efforts.get.mjs +2 -2
  86. package/.output/server/chunks/routes/api/file.post.mjs +2 -2
  87. package/.output/server/chunks/routes/api/files/download.get.mjs +60 -0
  88. package/.output/server/chunks/routes/api/files/read.get.mjs +45 -0
  89. package/.output/server/chunks/routes/api/files.get.mjs +44 -0
  90. package/.output/server/chunks/routes/api/gitroot.get.mjs +2 -2
  91. package/.output/server/chunks/routes/api/health.get.mjs +1 -1
  92. package/.output/server/chunks/routes/api/index.get.mjs +2 -1
  93. package/.output/server/chunks/routes/api/input.post.mjs +32 -5
  94. package/.output/server/chunks/routes/api/interrupt.post.mjs +2 -2
  95. package/.output/server/chunks/routes/api/isgit.get.mjs +2 -2
  96. package/.output/server/chunks/routes/api/machine/awake.get.mjs +2 -2
  97. package/.output/server/chunks/routes/api/machine/awake.post.mjs +2 -2
  98. package/.output/server/chunks/routes/api/machine/order.get.mjs +1 -1
  99. package/.output/server/chunks/routes/api/machine/order.post.mjs +1 -1
  100. package/.output/server/chunks/routes/api/machine/rename.post.mjs +2 -2
  101. package/.output/server/chunks/routes/api/menu.post.mjs +5 -2
  102. package/.output/server/chunks/routes/api/model.post.mjs +2 -2
  103. package/.output/server/chunks/routes/api/models.get.mjs +2 -2
  104. package/.output/server/chunks/routes/api/nav.post.mjs +36 -22
  105. package/.output/server/chunks/routes/api/onboarding.get.mjs +1 -1
  106. package/.output/server/chunks/routes/api/onboarding.post.mjs +1 -1
  107. package/.output/server/chunks/routes/api/phone.get.mjs +2 -2
  108. package/.output/server/chunks/routes/api/phone.post.mjs +2 -2
  109. package/.output/server/chunks/routes/api/plugins/actions.get.mjs +4 -1
  110. package/.output/server/chunks/routes/api/plugins/invoke.post.mjs +4 -1
  111. package/.output/server/chunks/routes/api/plugins/profiles.get.mjs +4 -1
  112. package/.output/server/chunks/routes/api/plugins/projects.get.mjs +4 -3
  113. package/.output/server/chunks/routes/api/plugins/projects.post.mjs +4 -3
  114. package/.output/server/chunks/routes/api/plugins/thread-limits.get.mjs +2 -2
  115. package/.output/server/chunks/routes/api/plugins/thread-limits.post.mjs +2 -2
  116. package/.output/server/chunks/routes/api/project/inbox.get.mjs +44 -0
  117. package/.output/server/chunks/routes/api/project/inbox.post.mjs +44 -0
  118. package/.output/server/chunks/routes/api/project/memory.get.mjs +43 -0
  119. package/.output/server/chunks/routes/api/project/report.get.mjs +3 -2
  120. package/.output/server/chunks/routes/api/project/routines.get.mjs +44 -0
  121. package/.output/server/chunks/routes/api/project/settings.get.mjs +42 -0
  122. package/.output/server/chunks/routes/api/project/thread.get.mjs +45 -0
  123. package/.output/server/chunks/routes/api/project/thread.post.mjs +47 -0
  124. package/.output/server/chunks/routes/api/prompt.post.mjs +21 -3
  125. package/.output/server/chunks/routes/api/push/quiet.post.mjs +2 -2
  126. package/.output/server/chunks/routes/api/push/subscribe.post.mjs +2 -2
  127. package/.output/server/chunks/routes/api/push/test.post.mjs +2 -2
  128. package/.output/server/chunks/routes/api/push/unsubscribe.post.mjs +2 -2
  129. package/.output/server/chunks/routes/api/quotas.get.mjs +2 -2
  130. package/.output/server/chunks/routes/api/rename.post.mjs +1 -1
  131. package/.output/server/chunks/routes/api/requeue.post.mjs +2 -2
  132. package/.output/server/chunks/routes/api/restart.get.mjs +1 -1
  133. package/.output/server/chunks/routes/api/restart.post.mjs +1 -1
  134. package/.output/server/chunks/routes/api/reveal.post.mjs +2 -1
  135. package/.output/server/chunks/routes/api/screen-key.post.mjs +14 -11
  136. package/.output/server/chunks/routes/api/screen.get.mjs +6 -37
  137. package/.output/server/chunks/routes/api/search.get.mjs +2 -2
  138. package/.output/server/chunks/routes/api/seen.post.mjs +2 -2
  139. package/.output/server/chunks/routes/api/sessions.get.mjs +2 -2
  140. package/.output/server/chunks/routes/api/sessions.post.mjs +2 -2
  141. package/.output/server/chunks/routes/api/settings-tab.post.mjs +89 -0
  142. package/.output/server/chunks/routes/api/space.post.mjs +14 -14
  143. package/.output/server/chunks/routes/api/state.get.mjs +2 -2
  144. package/.output/server/chunks/routes/api/unqueue.post.mjs +2 -2
  145. package/.output/server/chunks/routes/api/update/status.get.mjs +1 -1
  146. package/.output/server/chunks/routes/api/update.get.mjs +2 -2
  147. package/.output/server/chunks/routes/api/update.post.mjs +2 -2
  148. package/.output/server/chunks/routes/api/upload.post.mjs +2 -2
  149. package/.output/server/chunks/routes/api/worktrees/remove.post.mjs +1 -1
  150. package/.output/server/chunks/routes/api/worktrees.get.mjs +1 -1
  151. package/.output/server/chunks/routes/favicon.ico.get.mjs +1 -1
  152. package/.output/server/chunks/routes/icons/_name_.get.mjs +2 -2
  153. package/.output/server/chunks/routes/renderer.mjs +3 -3
  154. package/.output/server/chunks/routes/uploads/_...name_.get.mjs +2 -2
  155. package/.output/server/chunks/routes/ws/_..._.mjs +2 -2
  156. package/.output/server/chunks/routes/ws/events.mjs +2 -2
  157. package/.output/server/chunks/routes/ws/term.mjs +2 -2
  158. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  159. package/.output/server/index.mjs +2 -2
  160. package/.output/server/package.json +1 -1
  161. package/README.md +368 -40
  162. package/bin/install-docker-skill.sh +20 -0
  163. package/bin/lib/commands.mjs +5 -1
  164. package/bin/lib/core.mjs +1 -0
  165. package/bin/lib/install-skill.sh +100 -0
  166. package/bin/lib/skill.mjs +16 -0
  167. package/bin/lib/updater.mjs +65 -12
  168. package/bin/lib/verify-release.mjs +20 -0
  169. package/package.json +5 -2
  170. package/skills/wherdr/SKILL.md +186 -0
  171. package/.output/public/_nuxt/B7QP1TFs.js +0 -23
  172. package/.output/public/_nuxt/BDNMzG2s.js +0 -1
  173. package/.output/public/_nuxt/BOpBIziZ.js +0 -6
  174. package/.output/public/_nuxt/BWXdFfeg.js +0 -17
  175. package/.output/public/_nuxt/COFCNFpG.js +0 -83
  176. package/.output/public/_nuxt/CWwyK2XK.js +0 -2
  177. package/.output/public/_nuxt/CXG-cOdh.js +0 -1
  178. package/.output/public/_nuxt/CkZ8t6uB.js +0 -1
  179. package/.output/public/_nuxt/D4Yz4rat.js +0 -65
  180. package/.output/public/_nuxt/D7sxNXx1.js +0 -1
  181. package/.output/public/_nuxt/DViwOclv.js +0 -1
  182. package/.output/public/_nuxt/DoD7Qb5P.js +0 -30
  183. package/.output/public/_nuxt/DyBZDSCV.js +0 -2
  184. package/.output/public/_nuxt/SiL1FJ5s.js +0 -3
  185. package/.output/public/_nuxt/bLP7Jj-b.js +0 -1
  186. package/.output/public/_nuxt/builds/meta/7afbf062-5369-4002-b20d-7a582ff6e0f1.json +0 -1
  187. package/.output/public/_nuxt/entry.Crt1r4l3.css +0 -2
  188. package/.output/server/chunks/routes/ws/mirror.mjs +0 -161
@@ -1,56 +1,30 @@
1
- import { promises, constants } from 'node:fs';
2
- import path from 'node:path';
3
- import { H as HerdrError, o as fmt, aA as herdrOn } from '../nitro/nitro.mjs';
4
-
5
- const PROJECTS_REPO = "eliasstravik/herdr-projects";
6
- const PROJECTS_INSTALL_ARGS = ["plugin", "install", PROJECTS_REPO, "--yes"];
7
-
8
- function projectsPluginFromList(plugins) {
9
- const plugin = plugins.find((p) => p.plugin_id === "herdr-projects");
10
- return {
11
- installed: Boolean(plugin),
12
- enabled: Boolean(plugin && plugin.enabled !== false),
13
- version: plugin && typeof plugin.version === "string" && /^\d[\w.+-]{0,39}$/.test(plugin.version) ? plugin.version : null
14
- };
15
- }
16
- async function canInstall(m) {
17
- if (!m.local) return m.status === "online";
18
- try {
19
- await promises.access(path.join(m.home, ".config/herdr"), constants.W_OK);
20
- return true;
21
- } catch {
22
- return false;
1
+ const PROJECTS_REPO = "afloury/herdr-projects";
2
+ const PROJECTS_UPSTREAM = "eliasstravik/herdr-projects";
3
+ const PROJECTS_REF = "v0.2.36";
4
+ const PROJECTS_INSTALL_ARGS = ["plugin", "install", PROJECTS_REPO, "--ref", PROJECTS_REF, "--yes"];
5
+ function manifestBinary(p) {
6
+ for (const c of [...p.startup || [], ...p.actions || [], ...p.panes || []]) {
7
+ const argv = Array.isArray(c == null ? void 0 : c.command) ? c.command : [];
8
+ const bin = typeof argv[0] === "string" ? argv[0] : "";
9
+ if (/(^|\/)herdr-projects$/.test(bin) && !bin.split("/").includes("..")) return bin;
23
10
  }
11
+ return null;
24
12
  }
25
- async function projectsPluginState(m) {
26
- if (m.status !== "online") throw new HerdrError("unreachable", fmt("{machine} is unreachable", { machine: m.label }));
27
- const r = await herdrOn(m.key, "plugin.list", {}, 8e3);
28
- return { ...projectsPluginFromList(r.plugins || []), installable: await canInstall(m) };
13
+ const major = (version) => {
14
+ const m = /^(\d+)\./.exec(version || "");
15
+ return m ? Number(m[1]) : null;
16
+ };
17
+ function isUnsupportedProjects(p) {
18
+ const v = major(p.version);
19
+ if (v !== null) return v >= 1;
20
+ const hasCommands = [...p.startup || [], ...p.actions || [], ...p.panes || []].length > 0;
21
+ return hasCommands && !manifestBinary(p);
29
22
  }
30
- async function installProjectsPlugin(m) {
31
- if (m.status !== "online") throw new HerdrError("unreachable", fmt("{machine} is unreachable", { machine: m.label }));
32
- if ((await projectsPluginState(m)).installed) throw new HerdrError("already_installed", "herdr-projects is already installed");
33
- if (!await canInstall(m)) throw new HerdrError("read_only", fmt("Herdr folder is read-only on {machine}", { machine: m.label }));
34
- const child = m.spawnHerdr([...PROJECTS_INSTALL_ARGS]);
35
- return await new Promise((resolve, reject) => {
36
- let output = "";
37
- const append = (b) => {
38
- output = (output + b.toString("utf8")).slice(-4e3);
39
- };
40
- child.stdout.on("data", append);
41
- child.stderr.on("data", append);
42
- const timer = setTimeout(() => child.kill("SIGKILL"), 12e4);
43
- child.on("error", (e) => {
44
- clearTimeout(timer);
45
- reject(new HerdrError("install_failed", e.message));
46
- });
47
- child.on("close", (code) => {
48
- clearTimeout(timer);
49
- if (code !== 0) reject(new HerdrError("install_failed", output.trim().slice(-300) || fmt("Install failed (code {code})", { code })));
50
- else resolve(output.trim().slice(-300));
51
- });
52
- });
23
+ function updatesToUnsupported(p) {
24
+ if (isUnsupportedProjects(p)) return false;
25
+ const s = p.source;
26
+ return Boolean(s && s.kind === "github" && `${s.owner}/${s.repo}`.toLowerCase() === PROJECTS_UPSTREAM);
53
27
  }
54
28
 
55
- export { installProjectsPlugin as i, projectsPluginState as p };
29
+ export { PROJECTS_INSTALL_ARGS as P, isUnsupportedProjects as i, manifestBinary as m, updatesToUnsupported as u };
56
30
  //# sourceMappingURL=projectsPlugin.mjs.map
@@ -0,0 +1,57 @@
1
+ import { promises, constants } from 'node:fs';
2
+ import path from 'node:path';
3
+ import { H as HerdrError, G as fmt, x as herdrOn } from '../nitro/nitro.mjs';
4
+ import { P as PROJECTS_INSTALL_ARGS, u as updatesToUnsupported, i as isUnsupportedProjects } from './projectsPlugin.mjs';
5
+
6
+ function projectsPluginFromList(plugins) {
7
+ const plugin = plugins.find((p) => p && p.plugin_id === "herdr-projects");
8
+ return {
9
+ installed: Boolean(plugin),
10
+ enabled: Boolean(plugin && plugin.enabled !== false),
11
+ version: plugin && typeof plugin.version === "string" && /^\d[\w.+-]{0,39}$/.test(plugin.version) ? plugin.version : null,
12
+ unsupported: Boolean(plugin && isUnsupportedProjects(plugin)),
13
+ upstream: Boolean(plugin && updatesToUnsupported(plugin))
14
+ };
15
+ }
16
+ const INSTALL_TIMEOUT_MS = 2 * 60 * 1e3;
17
+ async function canInstall(m) {
18
+ if (!m.local) return m.status === "online";
19
+ try {
20
+ await promises.access(path.join(m.home, ".config/herdr"), constants.W_OK);
21
+ return true;
22
+ } catch {
23
+ return false;
24
+ }
25
+ }
26
+ async function projectsPluginState(m) {
27
+ if (m.status !== "online") throw new HerdrError("unreachable", fmt("{machine} is unreachable", { machine: m.label }));
28
+ const r = await herdrOn(m.key, "plugin.list", {}, 8e3);
29
+ return { ...projectsPluginFromList(r.plugins || []), installable: await canInstall(m) };
30
+ }
31
+ async function installProjectsPlugin(m) {
32
+ if (m.status !== "online") throw new HerdrError("unreachable", fmt("{machine} is unreachable", { machine: m.label }));
33
+ if ((await projectsPluginState(m)).installed) throw new HerdrError("already_installed", "herdr-projects is already installed");
34
+ if (!await canInstall(m)) throw new HerdrError("read_only", fmt("Herdr folder is read-only on {machine}", { machine: m.label }));
35
+ const child = m.spawnHerdr([...PROJECTS_INSTALL_ARGS]);
36
+ return await new Promise((resolve, reject) => {
37
+ let output = "";
38
+ const append = (b) => {
39
+ output = (output + b.toString("utf8")).slice(-4e3);
40
+ };
41
+ child.stdout.on("data", append);
42
+ child.stderr.on("data", append);
43
+ const timer = setTimeout(() => child.kill("SIGKILL"), INSTALL_TIMEOUT_MS);
44
+ child.on("error", (e) => {
45
+ clearTimeout(timer);
46
+ reject(new HerdrError("install_failed", e.message));
47
+ });
48
+ child.on("close", (code) => {
49
+ clearTimeout(timer);
50
+ if (code !== 0) reject(new HerdrError("install_failed", output.trim().slice(-300) || fmt("Install failed (code {code})", { code })));
51
+ else resolve(output.trim().slice(-300));
52
+ });
53
+ });
54
+ }
55
+
56
+ export { installProjectsPlugin as i, projectsPluginState as p };
57
+ //# sourceMappingURL=projectsPlugin2.mjs.map
@@ -1,317 +1,6 @@
1
- import { H as HerdrError, K as codexMenuOpen, L as terminalUpdateLine, N as terminalUpdateDone, F as sleep, f as findPane, O as restarts, Q as log, R as withPaneLock, q as transcripts, h as herdr, p as poll } from '../nitro/nitro.mjs';
1
+ import { H as HerdrError, a9 as paneForeground, aa as codexMenuOpen, ab as stopAgent, ac as terminalUpdateLine, ad as waitFor, ae as terminalUpdateDone, af as startAgent, a4 as sleep, f as findPane, a1 as restarts, ag as log, X as withPaneLock, ah as RESTARTABLE, J as transcripts, ai as claudeFooterMode, aj as planRestart, h as herdr, p as poll } from '../nitro/nitro.mjs';
2
2
  import crypto from 'node:crypto';
3
3
 
4
- const CLAUDE = {
5
- keep: {
6
- "--model": 1,
7
- "--effort": 1,
8
- "--permission-mode": 1,
9
- "--fallback-model": 1,
10
- "--agent": 1,
11
- "--agents": 1,
12
- "--settings": 1,
13
- "--setting-sources": 1,
14
- "--system-prompt": 1,
15
- "--append-system-prompt": 1,
16
- "--autocompact": 1,
17
- "-n": 1,
18
- "--name": 1,
19
- "--debug-file": 1,
20
- "--add-dir": "*",
21
- "--mcp-config": "*",
22
- "--plugin-dir": "*",
23
- "--allowedTools": "*",
24
- "--allowed-tools": "*",
25
- "--disallowedTools": "*",
26
- "--disallowed-tools": "*",
27
- "--tools": "*",
28
- "--betas": "*",
29
- "--dangerously-skip-permissions": 0,
30
- "--allow-dangerously-skip-permissions": 0,
31
- "--verbose": 0,
32
- "--ide": 0,
33
- "--chrome": 0,
34
- "--no-chrome": 0,
35
- "--strict-mcp-config": 0,
36
- "--bare": 0,
37
- "--brief": 0,
38
- "--disable-slash-commands": 0,
39
- "--safe-mode": 0,
40
- "--restricted": 0
41
- },
42
- // Conversation choice, one-off launch or already done (worktree created).
43
- drop: {
44
- "-c": 0,
45
- "--continue": 0,
46
- "-r": "?",
47
- "--resume": "?",
48
- "--session-id": 1,
49
- "--fork-session": 0,
50
- "-w": "?",
51
- "--worktree": "?",
52
- "--tmux": 0,
53
- "--from-pr": "?",
54
- "--teleport": "?",
55
- "-p": 0,
56
- "--print": 0,
57
- "--bg": 0,
58
- "--background": 0,
59
- "--remote-control": "?",
60
- "--cloud": "?",
61
- "--file": "*",
62
- "-d": "?",
63
- "--debug": "?"
64
- }
65
- };
66
- const CODEX = {
67
- keep: {
68
- "-c": 1,
69
- "--config": 1,
70
- "--enable": 1,
71
- "--disable": 1,
72
- "-m": 1,
73
- "--model": 1,
74
- "--local-provider": 1,
75
- "-p": 1,
76
- "--profile": 1,
77
- "-s": 1,
78
- "--sandbox": 1,
79
- "-C": 1,
80
- "--cd": 1,
81
- "--add-dir": 1,
82
- "-a": 1,
83
- "--ask-for-approval": 1,
84
- "--remote": 1,
85
- "--remote-auth-token-env": 1,
86
- "--oss": 0,
87
- "--search": 0,
88
- "--no-alt-screen": 0,
89
- "--no-daemon": 0,
90
- "--full-auto": 0,
91
- "--dangerously-bypass-approvals-and-sandbox": 0,
92
- "--yolo": 0,
93
- "--approve-for-me": 0,
94
- "--strict-config": 0,
95
- "--dangerously-bypass-hook-trust": 0
96
- },
97
- drop: { "--last": 0, "--all": 0, "--include-non-interactive": 0, "-i": "*", "--image": "*", "--worktree": 0 }
98
- };
99
- const OMP = {
100
- keep: {
101
- "--model": 1,
102
- "--smol": 1,
103
- "--slow": 1,
104
- "--plan": 1,
105
- "--prewalk-into": 1,
106
- "--plan-yolo-into": 1,
107
- "--provider": 1,
108
- "--system-prompt": 1,
109
- "--system-prompt-template": 1,
110
- "--append-system-prompt": 1,
111
- "--profile": 1,
112
- "--cwd": 1,
113
- "--config": 1,
114
- "--add-dir": 1,
115
- "--session-dir": 1,
116
- "--models": 1,
117
- "--tools": 1,
118
- "--thinking": 1,
119
- "--service-tier": 1,
120
- "--hook": 1,
121
- "-e": 1,
122
- "--extension": 1,
123
- "--skills": 1,
124
- "--approval-mode": 1,
125
- "--plugin-dir": 1,
126
- "--allow-home": 0,
127
- "--prewalk": 0,
128
- "--no-prewalk": 0,
129
- "--no-tools": 0,
130
- "--no-lsp": 0,
131
- "--no-pty": 0,
132
- "--hide-thinking": 0,
133
- "--advisor": 0,
134
- "--external-thinking": 0,
135
- "--no-extensions": 0,
136
- "--no-skills": 0,
137
- "--no-rules": 0,
138
- "--no-title": 0,
139
- "--auto-approve": 0
140
- },
141
- // Conversation choice, one-off launch; the API key is never replayed
142
- // (it would show in the confirmation).
143
- drop: {
144
- "-c": 0,
145
- "--continue": 0,
146
- "-r": "?",
147
- "--resume": "?",
148
- "-p": 0,
149
- "--print": 0,
150
- "--plan-yolo": 0,
151
- "--from-claude": 0,
152
- "--from-codex": 0,
153
- "--no-session": 0,
154
- "--export": 1,
155
- "--mode": 1,
156
- "--max-time": 1,
157
- "--alias": 1,
158
- "--api-key": 1,
159
- "--no-ui": 0,
160
- "--print-thoughts": 0
161
- }
162
- };
163
- const SILENT = /* @__PURE__ */ new Set(["-c", "--continue", "-r", "--resume", "--session-id", "--fork-session", "--last", "--all"]);
164
- const SPECS = { claude: CLAUDE, codex: CODEX, omp: OMP };
165
- const RESTARTABLE = new Set(Object.keys(SPECS));
166
- const base$1 = (s) => s.replace(/^.*\//, "").replace(/\.(c?js|mjs)$/, "");
167
- function launchOptions(kind, argv) {
168
- const spec = SPECS[kind];
169
- const kept = [];
170
- const dropped = [];
171
- if (!spec) return { kept, dropped };
172
- let i = argv.findIndex((a) => base$1(a) === kind);
173
- i = i < 0 ? 1 : i + 1;
174
- for (; i < argv.length; i++) {
175
- const a = argv[i];
176
- if (a === "--") break;
177
- if (!a.startsWith("-") || a === "-") continue;
178
- const eq = a.indexOf("=");
179
- const flag = eq > 0 ? a.slice(0, eq) : a;
180
- const keep = flag in spec.keep;
181
- const arity = keep ? spec.keep[flag] : spec.drop[flag];
182
- const out = [a];
183
- if (keep) kept.push(out);
184
- else if (!SILENT.has(flag)) dropped.push(out);
185
- if (arity === void 0) {
186
- if (eq < 0 && argv[i + 1] !== void 0 && !argv[i + 1].startsWith("-")) out.push(argv[++i]);
187
- continue;
188
- }
189
- if (eq > 0 || arity === 0) continue;
190
- if (arity === 1) {
191
- if (argv[i + 1] !== void 0) out.push(argv[++i]);
192
- continue;
193
- }
194
- while (argv[i + 1] !== void 0 && !argv[i + 1].startsWith("-")) {
195
- out.push(argv[++i]);
196
- if (arity === "?") break;
197
- }
198
- }
199
- return { kept, dropped };
200
- }
201
- const EFFORTS = /* @__PURE__ */ new Set(["low", "medium", "high", "xhigh", "max"]);
202
- function planRestart(o) {
203
- const opts = o.argv ? launchOptions(o.kind, o.argv) : { kept: [], dropped: [] };
204
- const mode = o.session ? "resume" : o.hadSession ? "fresh" : "continue";
205
- let groups = opts.kept;
206
- const without = (...flags) => {
207
- groups = groups.filter((g) => !flags.includes(g[0].split("=")[0]));
208
- };
209
- if (o.kind === "omp" && mode === "resume") without("--model", "--thinking");
210
- if (o.kind === "claude") {
211
- const cur = o.current || {};
212
- if (mode === "resume") without("--model");
213
- const effort = String(cur.effort || "").toLowerCase();
214
- if (EFFORTS.has(effort)) {
215
- without("--effort");
216
- groups.push(["--effort", effort]);
217
- }
218
- if (cur.permissionMode) {
219
- without("--permission-mode");
220
- if (cur.permissionMode !== "default") groups.push(["--permission-mode", cur.permissionMode]);
221
- }
222
- }
223
- const kept = groups.flat();
224
- const dropped = opts.dropped.flat();
225
- let args;
226
- if (o.kind === "codex") {
227
- args = mode === "fresh" ? kept : ["resume", ...kept, mode === "resume" ? o.session : "--last"];
228
- } else {
229
- args = mode === "resume" ? [...kept, "--resume", o.session] : mode === "continue" ? [...kept, "--continue"] : kept;
230
- }
231
- return { args, mode, kept, dropped, unknownArgs: !o.argv };
232
- }
233
- const FOOTER_MODES = [
234
- [/\bplan mode on\b/i, "plan"],
235
- [/\baccept edits on\b/i, "acceptEdits"],
236
- [/\bauto mode on\b/i, "auto"],
237
- [/\bbypass permissions on\b/i, "bypassPermissions"],
238
- [/\bdon'?t ask (?:mode )?on\b/i, "dontAsk"]
239
- ];
240
- function claudeFooterMode(text) {
241
- const lines = String(text || "").split("\n");
242
- let rule = -1;
243
- for (let i = lines.length - 1; i >= 0 && rule < 0; i--) if (/^\s*─{20,}\s*$/.test(lines[i])) rule = i;
244
- if (rule < 1 || !lines.slice(Math.max(0, rule - 6), rule).some((l) => /^\s*❯/.test(l))) return null;
245
- for (const l of lines.slice(rule + 1)) {
246
- for (const [re, mode] of FOOTER_MODES) if (re.test(l)) return mode;
247
- }
248
- return "default";
249
- }
250
-
251
- const base = (s) => s.replace(/^.*\//, "").replace(/\.(c?js|mjs)$/, "");
252
- async function paneForeground(d, paneId, kind) {
253
- const r = await d.call("pane.process_info", { pane_id: paneId }, 4e3);
254
- const info = r && r.process_info || {};
255
- const procs = info.foreground_processes || [];
256
- const agent = procs.find((p) => p.name === kind || (p.argv || []).some((a) => base(a) === kind)) || null;
257
- const atShell = !agent && Boolean(info.shell_pid) && info.foreground_process_group_id === info.shell_pid;
258
- const sh = procs.find((p) => info.shell_pid && p.pid === info.shell_pid);
259
- const shell = { pid: Number(info.shell_pid) || null, name: sh ? String(sh.name || (sh.argv || [])[0] || "") || null : null };
260
- return { agent, atShell, shell, argv: agent && Array.isArray(agent.argv) ? agent.argv.map(String) : null };
261
- }
262
- async function waitFor(d, ms, test) {
263
- const end = d.now() + ms;
264
- while (d.now() < end) {
265
- await d.sleep(500);
266
- try {
267
- if (await test()) return true;
268
- } catch {
269
- }
270
- }
271
- return false;
272
- }
273
- const waitShell = (d, paneId, kind, ms) => waitFor(d, ms, async () => (await paneForeground(d, paneId, kind)).atShell);
274
- const busy = async (d, paneId) => {
275
- const r = await d.call("pane.get", { pane_id: paneId }, 4e3);
276
- const s = r && r.pane && r.pane.agent_status;
277
- return s === "working" || s === "blocked";
278
- };
279
- async function stopAgent(d, p) {
280
- const kind = p.agent;
281
- const key = (k) => d.call("pane.send_input", { pane_id: p.id, keys: [k] });
282
- if (p.status === "working" || p.status === "blocked") {
283
- for (let i = 0; i < 2; i++) {
284
- await key("esc");
285
- if (await waitFor(d, 3e3, async () => !await busy(d, p.id))) break;
286
- }
287
- }
288
- await d.call("pane.send_input", { pane_id: p.id, text: "/exit" });
289
- await d.sleep(300);
290
- await key("enter");
291
- if (await waitShell(d, p.id, kind, 8e3)) return "exit";
292
- await key("ctrl+c");
293
- await d.sleep(400);
294
- await key("ctrl+c");
295
- if (await waitShell(d, p.id, kind, 6e3)) return "ctrl-c";
296
- throw new HerdrError("restart_stop", "the agent did not stop");
297
- }
298
- async function startAgent(d, p, plan) {
299
- const name = p.name || `${p.agent}-${crypto.randomBytes(2).toString("hex")}`;
300
- let last = null;
301
- for (let i = 0; i < 6; i++) {
302
- try {
303
- await d.call("agent.start", { name, kind: p.agent, pane_id: p.id, timeout_ms: 6e4, ...plan.args.length ? { args: plan.args } : {} }, 75e3);
304
- return;
305
- } catch (e) {
306
- last = e;
307
- if (last.code === "agent_not_ready") return;
308
- if (last.code === "timeout" || last.code === "unreachable") break;
309
- await d.sleep(500);
310
- }
311
- }
312
- throw last || new HerdrError("restart_start", "the agent did not restart");
313
- }
314
-
315
4
  const TERM_UPDATE_MS = 10 * 6e4;
316
5
  const READ_LINES = 400;
317
6
  const readRecent = async (d, paneId) => {
@@ -379,6 +68,7 @@ async function restartPlanFor(p, d = defaultDeps) {
379
68
  const planning = /* @__PURE__ */ new Set();
380
69
  async function restartAgent(paneId) {
381
70
  const p = findPane(paneId);
71
+ if (p == null ? void 0 : p.stopped) throw new HerdrError("stale", "Use the restart buttons for this stopped agent.");
382
72
  if (!p || !p.agent) throw new HerdrError("bad_pane", "agent not found");
383
73
  const cur = restarts.get(paneId);
384
74
  if (planning.has(paneId) || cur && cur.phase !== "failed") throw new HerdrError("restart_busy", "restart already in progress");
@@ -1,29 +1,7 @@
1
1
  import { execFile } from 'node:child_process';
2
2
  import { existsSync } from 'node:fs';
3
- import { a1 as IN_DOCKER, a2 as HOST_OPEN_TARGET, a3 as HOST_OPEN_KEY, H as HerdrError, a4 as PANE_RE, f as findPane, G as getMachine, a5 as splitId, o as fmt, Q as log, a6 as HOST_OPEN_USER } from '../nitro/nitro.mjs';
4
-
5
- function posixResolve(base, p) {
6
- const out = [];
7
- for (const seg of (p.startsWith("/") ? p : `${base}/${p}`).split("/")) {
8
- if (seg === "" || seg === ".") continue;
9
- if (seg === "..") out.pop();
10
- else out.push(seg);
11
- }
12
- return "/" + out.join("/");
13
- }
14
- const POSITION = /:\d+(?::\d+)?$/;
15
- const stripPosition = (s) => s.replace(POSITION, "");
16
- function resolveAgentPath(written, cwd, home) {
17
- const p = stripPosition(String(written || "").trim());
18
- if (!p || !home.startsWith("/") || /[\0\n\r]/.test(p)) return null;
19
- const root = posixResolve("/", home);
20
- const inside = (r2) => r2 === root || r2.startsWith(root === "/" ? "/" : root + "/");
21
- const base = cwd && cwd.startsWith("/") && inside(posixResolve("/", cwd)) ? posixResolve("/", cwd) : root;
22
- const r = posixResolve(base, p.replace(/^~(?=$|\/)/, root));
23
- return inside(r) ? r : null;
24
- }
25
- const RUNNABLE = /\.(app|command|tool|terminal|pkg|mpkg|workflow|action|scpt|scptd|applescript|jar|sh|bash|zsh|csh|fish|py|rb|pl|webloc|inetloc|fileloc|prefpane|qlgenerator|saver|kext|osax|dmg)\/?$/i;
26
- const runnablePath = (p) => RUNNABLE.test(p);
3
+ import { au as IN_DOCKER, av as HOST_OPEN_TARGET, aw as HOST_OPEN_KEY, H as HerdrError, ax as PANE_RE, f as findPane, a6 as getMachine, ay as splitId, G as fmt, ag as log, az as HOST_OPEN_USER } from '../nitro/nitro.mjs';
4
+ import { r as resolveAgentPath, a as runnablePath } from './filePaths.mjs';
27
5
 
28
6
  const REVEAL_CHECKS = `p=$2
29
7
  [ -e "$p" ] || exit 3
@@ -3,8 +3,8 @@ import fs from 'node:fs';
3
3
  import os from 'node:os';
4
4
  import path from 'node:path';
5
5
  import { p as pkg } from './package.mjs';
6
- import { bh as installMode, H as HerdrError, Q as log, bi as oneTapMode, bl as updateRunning } from '../nitro/nitro.mjs';
7
- import { c as checkUpdate } from './updates.mjs';
6
+ import { bK as installMode, H as HerdrError, ag as log, bL as oneTapMode, bO as updateRunning } from '../nitro/nitro.mjs';
7
+ import { c as checkUpdate, R as REPO } from './updates.mjs';
8
8
 
9
9
  function wherdrDir(env = process.env) {
10
10
  const home = os.homedir();
@@ -33,6 +33,7 @@ function buildPlan(o) {
33
33
  serverPid: o.pid,
34
34
  port: String(o.env.NITRO_PORT || o.env.PORT || 3e3),
35
35
  host: String(o.env.NITRO_HOST || o.env.HOST || "127.0.0.1"),
36
+ releaseBase: `https://github.com/${REPO}/releases/download`,
36
37
  registry: o.env.npm_config_registry || "https://registry.npmjs.org"
37
38
  };
38
39
  }
@@ -0,0 +1,36 @@
1
+ const SGR = /\x1b\[([\d;]*)m/g;
2
+ function highlight(params, state) {
3
+ const codes = params === "" ? [0] : params.split(";").map(Number);
4
+ for (let i = 0; i < codes.length; i++) {
5
+ const c = codes[i];
6
+ if (c === 38 || c === 48 || c === 58) {
7
+ if (c === 48) state.bg = true;
8
+ i += codes[i + 1] === 5 ? 2 : codes[i + 1] === 2 ? 4 : 0;
9
+ } else if (c === 0) {
10
+ state.bg = false;
11
+ state.inverse = false;
12
+ } else if (c === 7) state.inverse = true;
13
+ else if (c === 27) state.inverse = false;
14
+ else if (c === 49) state.bg = false;
15
+ else if (c >= 40 && c <= 47) state.bg = true;
16
+ }
17
+ }
18
+ function activeTab(line) {
19
+ const state = { bg: false, inverse: false };
20
+ let last = 0;
21
+ const words = [];
22
+ const push = (s) => {
23
+ for (const w of s.split(/\s+/)) if (w) words.push({ text: w, bg: state.bg || state.inverse });
24
+ };
25
+ for (const m of line.matchAll(SGR)) {
26
+ push(line.slice(last, m.index));
27
+ highlight(m[1], state);
28
+ last = m.index + m[0].length;
29
+ }
30
+ push(line.slice(last));
31
+ const hit = words.find((w) => w.bg && w.text !== "Settings");
32
+ return hit ? hit.text.replace(/[^\w]/g, "") : null;
33
+ }
34
+
35
+ export { activeTab as a };
36
+ //# sourceMappingURL=settingstabs.mjs.map
@@ -1,8 +1,8 @@
1
1
  import { p as pkg } from './package.mjs';
2
- import { bh as installMode, bi as oneTapMode, bj as updateCommand, bk as compareVersions } from '../nitro/nitro.mjs';
2
+ import { bK as installMode, bL as oneTapMode, bM as updateCommand, bN as compareVersions } from '../nitro/nitro.mjs';
3
3
 
4
4
  const REPO = "afloury/wherdr";
5
- const RELEASES_URL = `https://api.github.com/repos/${REPO}/releases/latest`;
5
+ const RELEASES_URL = `https://api.github.com/repos/${REPO}/releases?per_page=100`;
6
6
  const DAY_MS = 24 * 60 * 60 * 1e3;
7
7
  const RETRY_MS = 60 * 60 * 1e3;
8
8
  function createUpdateChecker(opts) {
@@ -12,12 +12,46 @@ function createUpdateChecker(opts) {
12
12
  let nextAt = 0;
13
13
  let pending = null;
14
14
  async function refresh() {
15
+ var _a2;
15
16
  try {
16
17
  const res = await opts.fetch(RELEASES_URL);
17
18
  if (!res.ok) throw new Error("http");
18
- const body = await res.json();
19
- if (typeof body.tag_name !== "string") throw new Error("tag");
20
- cached = { version: body.tag_name.replace(/^v/, ""), url: typeof body.html_url === "string" ? body.html_url : "" };
19
+ const releases = await res.json();
20
+ const body = releases.filter((r) => !r.draft && !r.prerelease && /^v\d+\.\d+\.\d+$/.test(String(r.tag_name))).sort((a, b) => compareVersions(String(b.tag_name), String(a.tag_name)))[0];
21
+ if (!body || typeof body.tag_name !== "string") throw new Error("tag");
22
+ const candidate = { version: body.tag_name.replace(/^v/, ""), url: typeof body.html_url === "string" ? body.html_url : "" };
23
+ const mode = installMode(opts.env.WHERDR_INSTALL);
24
+ if (mode === "plugin") {
25
+ const archive = `https://github.com/${REPO}/releases/download/v${candidate.version}/wherdr-${candidate.version}.tgz`;
26
+ if (!(await opts.fetch(archive)).ok || !(await opts.fetch(`${archive}.sha256`)).ok) {
27
+ nextAt = now() + RETRY_MS;
28
+ return;
29
+ }
30
+ }
31
+ if (mode === "npm" || mode === "npm-global") {
32
+ const registry = (opts.env.npm_config_registry || "https://registry.npmjs.org").replace(/\/$/, "");
33
+ const available = await opts.fetch(`${registry}/wherdr/-/wherdr-${candidate.version}.tgz`);
34
+ if (!available.ok) {
35
+ nextAt = now() + RETRY_MS;
36
+ return;
37
+ }
38
+ if (mode === "npm") {
39
+ const latest = await opts.fetch(`${registry}/wherdr/latest`);
40
+ if (!latest.ok || (await latest.json()).version !== candidate.version) {
41
+ nextAt = now() + RETRY_MS;
42
+ return;
43
+ }
44
+ }
45
+ }
46
+ if (mode === "brew") {
47
+ const formula = await opts.fetch("https://raw.githubusercontent.com/afloury/homebrew-tap/main/Formula/wherdr.rb");
48
+ const text = formula.ok ? await ((_a2 = formula.text) == null ? void 0 : _a2.call(formula)) : "";
49
+ if (!(text == null ? void 0 : text.includes(`/v${candidate.version}/wherdr-${candidate.version}.tgz"`))) {
50
+ nextAt = now() + RETRY_MS;
51
+ return;
52
+ }
53
+ }
54
+ cached = candidate;
21
55
  nextAt = now() + DAY_MS;
22
56
  } catch {
23
57
  nextAt = now() + RETRY_MS;
@@ -37,14 +71,21 @@ function createUpdateChecker(opts) {
37
71
  return { ...base, latest: newer ? cached.version : null, url: newer ? cached.url || null : null, checked: !!cached };
38
72
  };
39
73
  }
74
+ function fetchUpdateResource(url, request = fetch) {
75
+ return request(url, {
76
+ method: /\.tgz(?:\.sha256)?$/.test(url) ? "HEAD" : "GET",
77
+ headers: {
78
+ ...new URL(url).hostname === "api.github.com" ? { accept: "application/vnd.github+json" } : {},
79
+ "user-agent": "wherdr"
80
+ },
81
+ signal: AbortSignal.timeout(1e4)
82
+ });
83
+ }
40
84
  const checkUpdate = createUpdateChecker({
41
85
  current: pkg.version,
42
86
  env: process.env,
43
- fetch: (url) => fetch(url, {
44
- headers: { accept: "application/vnd.github+json", "user-agent": "wherdr" },
45
- signal: AbortSignal.timeout(1e4)
46
- })
87
+ fetch: fetchUpdateResource
47
88
  });
48
89
 
49
- export { checkUpdate as c };
90
+ export { REPO as R, checkUpdate as c };
50
91
  //# sourceMappingURL=updates.mjs.map
@@ -1,4 +1,4 @@
1
- import { bm as allMachines, G as getMachine, H as HerdrError, a5 as splitId, aA as herdrOn, p as poll, bn as recentDirs, bo as joinId, aB as getState } from '../nitro/nitro.mjs';
1
+ import { bP as allMachines, a6 as getMachine, H as HerdrError, ay as splitId, x as herdrOn, p as poll, bQ as recentDirs, bR as joinId, m as getState } from '../nitro/nitro.mjs';
2
2
 
3
3
  const opts = { trust_repository: true };
4
4
  async function machineWorktrees(m) {
@@ -1,4 +1,4 @@
1
- import { bw as hostAllowed, bx as sameOrigin, k as auth } from '../nitro/nitro.mjs';
1
+ import { bY as hostAllowed, bZ as sameOrigin, k as auth } from '../nitro/nitro.mjs';
2
2
 
3
3
  var _a, _b;
4
4
  const WS_MAX = 256 * 1024;