wherdr 1.3.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/BDNMzG2s.js +1 -0
- package/.output/public/_nuxt/BETID3_E.js +1 -0
- package/.output/public/_nuxt/BHenDMeH.js +1 -0
- package/.output/public/_nuxt/BYZVrreW.js +1 -0
- package/.output/public/_nuxt/BhgehRdJ.js +1 -0
- package/.output/public/_nuxt/{yzABg5xl.js → Bpoxvzh6.js} +1 -1
- package/.output/public/_nuxt/BtH82ZuZ.js +9 -0
- package/.output/public/_nuxt/C25ROUa9.js +3 -0
- package/.output/public/_nuxt/C3Bkn4ac.js +62 -0
- package/.output/public/_nuxt/CDWjMk9C.js +2 -0
- package/.output/public/_nuxt/{Ci8N4mWR.js → CXJnLmWv.js} +1 -1
- package/.output/public/_nuxt/CuUQ4mEf.js +1 -0
- package/.output/public/_nuxt/DFGEl0v2.js +23 -0
- package/.output/public/_nuxt/{CKhgznq4.js → DFmgQVme.js} +42 -39
- package/.output/public/_nuxt/DZGKxROq.js +6 -0
- package/.output/public/_nuxt/DmkWvmnE.js +2 -0
- package/.output/public/_nuxt/DrKKeFFE.js +31 -0
- package/.output/public/_nuxt/DyfFwwGq.js +1 -0
- package/.output/public/_nuxt/FaNto0ga.js +105 -0
- package/.output/public/_nuxt/NIF0VwHk.js +25 -0
- package/.output/public/_nuxt/R0Y4VoeX.js +1 -0
- package/.output/public/_nuxt/board.CEEcFc6M.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/0b28b3e9-664e-4347-a35b-afb0a711d5c5.json +1 -0
- package/.output/public/_nuxt/entry.CKoXcwRa.css +2 -0
- package/.output/public/_nuxt/pdf.min.t82Z80JU.mjs +28 -0
- package/.output/public/_nuxt/pdf.worker.min.wgc6bjNh.mjs +28 -0
- package/.output/public/_nuxt/settings.Cdb21nNw.css +1 -0
- package/.output/public/sw.js +1 -1
- package/.output/server/chunks/_/branding.mjs +1 -1
- package/.output/server/chunks/_/changes.mjs +4 -4
- package/.output/server/chunks/_/fileDownload.mjs +278 -0
- package/.output/server/chunks/_/files.mjs +60 -20
- package/.output/server/chunks/_/machineOrder.mjs +1 -1
- package/.output/server/chunks/_/onboarding.mjs +1 -1
- package/.output/server/chunks/_/package.mjs +11 -3
- package/.output/server/chunks/_/plugins.mjs +92 -122
- package/.output/server/chunks/_/restart.mjs +1 -1
- package/.output/server/chunks/_/selfupdate.mjs +1 -1
- package/.output/server/chunks/_/settingstabs.mjs +36 -0
- package/.output/server/chunks/_/updates.mjs +1 -1
- package/.output/server/chunks/_/worktrees.mjs +1 -1
- package/.output/server/chunks/_/ws.mjs +43 -6
- package/.output/server/chunks/nitro/nitro.mjs +14126 -10238
- package/.output/server/chunks/raw/check-doc-links.mjs +5 -0
- package/.output/server/chunks/raw/check-leaks.mjs +1 -1
- package/.output/server/chunks/raw/check-release-notes.mjs +5 -0
- package/.output/server/chunks/raw/herdr-plugin.mjs +1 -1
- package/.output/server/chunks/raw/install-claude-statusline.mjs +1 -1
- package/.output/server/chunks/raw/prerelease-summary.mjs +5 -0
- package/.output/server/chunks/raw/prerelease.mjs +7 -0
- package/.output/server/chunks/raw/reveal.mjs +1 -1
- package/.output/server/chunks/raw/test-affected.mjs +5 -0
- package/.output/server/chunks/routes/api/_..._.mjs +6 -5
- package/.output/server/chunks/routes/api/agents.post.mjs +6 -5
- package/.output/server/chunks/routes/api/ask-tab.post.mjs +6 -5
- package/.output/server/chunks/routes/api/attach.post.mjs +6 -5
- package/.output/server/chunks/routes/api/auth/disable.post.mjs +6 -5
- package/.output/server/chunks/routes/api/auth/lock-all.post.mjs +6 -5
- package/.output/server/chunks/routes/api/auth/lock.post.mjs +6 -5
- package/.output/server/chunks/routes/api/auth/login/options.post.mjs +6 -5
- package/.output/server/chunks/routes/api/auth/login/verify.post.mjs +6 -5
- package/.output/server/chunks/routes/api/auth/max-session.post.mjs +6 -5
- package/.output/server/chunks/routes/api/auth/register/options.post.mjs +6 -5
- package/.output/server/chunks/routes/api/auth/register/verify.post.mjs +6 -5
- package/.output/server/chunks/routes/api/auth/status.get.mjs +6 -5
- package/.output/server/chunks/routes/api/changes.get.mjs +7 -6
- package/.output/server/chunks/routes/api/chat/image.get.mjs +7 -6
- package/.output/server/chunks/routes/api/chat.get.mjs +44 -11
- package/.output/server/chunks/routes/api/choose.post.mjs +44 -30
- package/.output/server/chunks/routes/api/claude-setup.post.mjs +42 -0
- package/.output/server/chunks/routes/api/claude-statusline.post.mjs +7 -6
- package/.output/server/chunks/routes/api/clear-queued-input.post.mjs +42 -0
- package/.output/server/chunks/routes/api/close/status.get.mjs +7 -6
- package/.output/server/chunks/routes/api/close.post.mjs +6 -5
- package/.output/server/chunks/routes/api/codex-update.post.mjs +7 -6
- package/.output/server/chunks/routes/api/commands.get.mjs +9 -7
- package/.output/server/chunks/routes/api/config.get.mjs +10 -13
- package/.output/server/chunks/routes/api/dirs.get.mjs +7 -6
- package/.output/server/chunks/routes/api/dismiss-stopped.post.mjs +7 -6
- package/.output/server/chunks/routes/api/dismiss.post.mjs +7 -6
- package/.output/server/chunks/routes/api/effort.post.mjs +7 -6
- package/.output/server/chunks/routes/api/efforts.get.mjs +7 -6
- package/.output/server/chunks/routes/api/file.post.mjs +7 -6
- package/.output/server/chunks/routes/api/files/download.get.mjs +12 -24
- package/.output/server/chunks/routes/api/files/download.head.mjs +41 -0
- package/.output/server/chunks/routes/api/files/read.get.mjs +8 -7
- package/.output/server/chunks/routes/api/files.get.mjs +7 -6
- package/.output/server/chunks/routes/api/health.get.mjs +6 -5
- package/.output/server/chunks/routes/api/input.post.mjs +33 -15
- package/.output/server/chunks/routes/api/interrupt.post.mjs +24 -21
- package/.output/server/chunks/routes/api/isgit.get.mjs +8 -8
- package/.output/server/chunks/routes/api/machine/awake.get.mjs +7 -6
- package/.output/server/chunks/routes/api/machine/awake.post.mjs +7 -6
- package/.output/server/chunks/routes/api/machine/order.get.mjs +6 -5
- package/.output/server/chunks/routes/api/machine/order.post.mjs +6 -5
- package/.output/server/chunks/routes/api/machine/reconnect.post.mjs +40 -0
- package/.output/server/chunks/routes/api/machine/rename.post.mjs +7 -6
- package/.output/server/chunks/routes/api/machine/status.post.mjs +39 -0
- package/.output/server/chunks/routes/api/menu-left.post.mjs +40 -0
- package/.output/server/chunks/routes/api/menu.post.mjs +10 -6
- package/.output/server/chunks/routes/api/model.post.mjs +7 -6
- package/.output/server/chunks/routes/api/models.get.mjs +7 -6
- package/.output/server/chunks/routes/api/nav.post.mjs +40 -26
- package/.output/server/chunks/routes/api/onboarding.get.mjs +6 -5
- package/.output/server/chunks/routes/api/onboarding.post.mjs +6 -5
- package/.output/server/chunks/routes/api/phone.get.mjs +8 -10
- package/.output/server/chunks/routes/api/phone.post.mjs +8 -10
- package/.output/server/chunks/routes/api/plugins/actions.get.mjs +6 -8
- package/.output/server/chunks/routes/api/plugins/invoke.post.mjs +6 -8
- package/.output/server/chunks/routes/api/plugins/projects.get.mjs +10 -8
- package/.output/server/chunks/routes/api/plugins/projects.post.mjs +11 -7
- package/.output/server/chunks/routes/api/prompt.post.mjs +22 -13
- package/.output/server/chunks/routes/api/push/quiet.post.mjs +7 -6
- package/.output/server/chunks/routes/api/push/subscribe.post.mjs +7 -7
- package/.output/server/chunks/routes/api/push/test.post.mjs +7 -6
- package/.output/server/chunks/routes/api/push/unsubscribe.post.mjs +7 -6
- package/.output/server/chunks/routes/api/quotas.get.mjs +7 -6
- package/.output/server/chunks/routes/api/rename.post.mjs +6 -5
- package/.output/server/chunks/routes/api/requeue.post.mjs +7 -6
- package/.output/server/chunks/routes/api/restart.get.mjs +6 -5
- package/.output/server/chunks/routes/api/restart.post.mjs +6 -5
- package/.output/server/chunks/routes/api/reveal.post.mjs +91 -8
- package/.output/server/chunks/routes/api/screen-key.post.mjs +19 -15
- package/.output/server/chunks/routes/api/screen.get.mjs +8 -40
- package/.output/server/chunks/routes/api/search.get.mjs +7 -6
- package/.output/server/chunks/routes/api/seen.post.mjs +7 -6
- package/.output/server/chunks/routes/api/sessions.get.mjs +7 -6
- package/.output/server/chunks/routes/api/sessions.post.mjs +7 -6
- package/.output/server/chunks/routes/api/settings-tab.post.mjs +90 -0
- package/.output/server/chunks/routes/api/{plugins/thread-limits.get.mjs → settings.get.mjs} +10 -9
- package/.output/server/chunks/routes/api/settings.post.mjs +40 -0
- package/.output/server/chunks/routes/api/space.post.mjs +34 -18
- package/.output/server/chunks/routes/api/state.get.mjs +7 -6
- package/.output/server/chunks/routes/api/tasks/action.post.mjs +39 -0
- package/.output/server/chunks/routes/api/{plugins/profiles.get.mjs → tasks/add.post.mjs} +12 -14
- package/.output/server/chunks/routes/api/tasks/after.post.mjs +39 -0
- package/.output/server/chunks/routes/api/tasks/approve.post.mjs +39 -0
- package/.output/server/chunks/routes/api/{project/report.get.mjs → tasks/archived.get.mjs} +12 -13
- package/.output/server/chunks/routes/api/{gitroot.get.mjs → tasks/autopilot.get.mjs} +13 -14
- package/.output/server/chunks/routes/api/tasks/autopilot.post.mjs +39 -0
- package/.output/server/chunks/routes/api/{index.get.mjs → tasks/board-settings.get.mjs} +12 -13
- package/.output/server/chunks/routes/api/tasks/board-settings.post.mjs +39 -0
- package/.output/server/chunks/routes/api/tasks/coordinator.get.mjs +40 -0
- package/.output/server/chunks/routes/api/tasks/coordinator.post.mjs +39 -0
- package/.output/server/chunks/routes/api/tasks/details.get.mjs +40 -0
- package/.output/server/chunks/routes/api/tasks/limit.post.mjs +39 -0
- package/.output/server/chunks/routes/api/tasks/links.get.mjs +39 -0
- package/.output/server/chunks/routes/api/tasks/models.get.mjs +40 -0
- package/.output/server/chunks/routes/api/tasks/pick.post.mjs +39 -0
- package/.output/server/chunks/routes/api/tasks/question.post.mjs +39 -0
- package/.output/server/chunks/routes/api/tasks/scheduled.get.mjs +40 -0
- package/.output/server/chunks/routes/api/{project → tasks}/settings.get.mjs +10 -11
- package/.output/server/chunks/routes/api/tasks/start.get.mjs +40 -0
- package/.output/server/chunks/routes/api/tasks/tell.post.mjs +39 -0
- package/.output/server/chunks/routes/api/tasks.get.mjs +39 -0
- package/.output/server/chunks/routes/api/unqueue.post.mjs +7 -6
- package/.output/server/chunks/routes/api/update/status.get.mjs +6 -5
- package/.output/server/chunks/routes/api/update.get.mjs +8 -10
- package/.output/server/chunks/routes/api/update.post.mjs +8 -10
- package/.output/server/chunks/routes/api/upload.post.mjs +7 -6
- package/.output/server/chunks/routes/api/worktrees/remove.post.mjs +6 -5
- package/.output/server/chunks/routes/api/worktrees.get.mjs +6 -5
- package/.output/server/chunks/routes/favicon.ico.get.mjs +6 -5
- package/.output/server/chunks/routes/icons/_name_.get.mjs +7 -6
- package/.output/server/chunks/routes/renderer.mjs +8 -7
- package/.output/server/chunks/routes/uploads/_...name_.get.mjs +7 -6
- package/.output/server/chunks/routes/ws/_..._.mjs +7 -6
- package/.output/server/chunks/routes/ws/events.mjs +9 -7
- package/.output/server/chunks/routes/ws/term.mjs +7 -6
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/index.mjs +7 -6
- package/.output/server/package.json +1 -1
- package/README.md +44 -1424
- package/bin/lib/commands.mjs +44 -9
- package/bin/lib/panel.mjs +3 -11
- package/bin/lib/service.mjs +41 -2
- package/bin/lib/skill.mjs +1 -1
- package/bin/lib/tailnet.d.mts +6 -3
- package/bin/lib/tailnet.mjs +70 -32
- package/bin/lib/userpath.d.mts +14 -0
- package/bin/lib/userpath.mjs +142 -0
- package/docs/README.md +58 -0
- package/docs/RELEASING.md +174 -0
- package/docs/board.md +164 -0
- package/docs/command.md +58 -0
- package/docs/configuration.md +39 -0
- package/docs/conversation.md +132 -0
- package/docs/development.md +38 -0
- package/docs/devices.md +58 -0
- package/docs/files.md +29 -0
- package/docs/herdr-projects-1x.md +278 -0
- package/docs/home.md +52 -0
- package/docs/installation.md +174 -0
- package/docs/machines.md +69 -0
- package/docs/migrate-from-1.x-docker.md +160 -0
- package/docs/networks.md +154 -0
- package/docs/notifications.md +83 -0
- package/docs/overview.md +71 -0
- package/docs/phone.md +26 -0
- package/docs/plugins.md +109 -0
- package/docs/quick-start.md +89 -0
- package/docs/quotas.md +65 -0
- package/docs/release-notes-2.0.0.md +84 -0
- package/docs/security.md +117 -0
- package/docs/terminal.md +15 -0
- package/docs/troubleshooting.md +45 -0
- package/package.json +11 -3
- package/skills/wherdr/SKILL.md +24 -167
- package/.output/public/_nuxt/B4Yk2tB1.js +0 -23
- package/.output/public/_nuxt/BBw_0a4M.js +0 -6
- package/.output/public/_nuxt/BSy6OCIY.js +0 -1
- package/.output/public/_nuxt/BX5PM2JQ.js +0 -1
- package/.output/public/_nuxt/BgPDnf2S.js +0 -1
- package/.output/public/_nuxt/BkOxQzbS.js +0 -2
- package/.output/public/_nuxt/CP8o925U.js +0 -1
- package/.output/public/_nuxt/CWwyK2XK.js +0 -2
- package/.output/public/_nuxt/CkbmecwS.js +0 -1
- package/.output/public/_nuxt/Cr3SrGky.js +0 -1
- package/.output/public/_nuxt/DAg9fiVh.js +0 -89
- package/.output/public/_nuxt/DT8qZ0Wv.js +0 -1
- package/.output/public/_nuxt/DaaJIRB3.js +0 -1
- package/.output/public/_nuxt/DcJi16XA.js +0 -1
- package/.output/public/_nuxt/SiL1FJ5s.js +0 -3
- package/.output/public/_nuxt/VpjCgSXu.js +0 -36
- package/.output/public/_nuxt/builds/meta/c735b6c0-1bd0-47d7-a208-d310f0a06287.json +0 -1
- package/.output/public/_nuxt/dPxB2L94.js +0 -89
- package/.output/public/_nuxt/entry.CGWKmYU3.css +0 -2
- package/.output/public/_nuxt/xYX85SPI.js +0 -1
- package/.output/server/chunks/_/pluginPolicy.mjs +0 -93
- package/.output/server/chunks/_/projectBoard.mjs +0 -366
- package/.output/server/chunks/_/projectDocs.mjs +0 -106
- package/.output/server/chunks/_/projectInbox.mjs +0 -135
- package/.output/server/chunks/_/projectThreads.mjs +0 -46
- package/.output/server/chunks/_/projectThreads2.mjs +0 -61
- package/.output/server/chunks/_/projectsActions.mjs +0 -143
- package/.output/server/chunks/_/projectsPlugin.mjs +0 -56
- package/.output/server/chunks/_/reveal.mjs +0 -115
- package/.output/server/chunks/raw/dev.wherdr.open.mjs +0 -7
- package/.output/server/chunks/raw/docker-entrypoint.mjs +0 -7
- package/.output/server/chunks/raw/install-host-open.mjs +0 -7
- package/.output/server/chunks/raw/wherdr-open.mjs +0 -7
- package/.output/server/chunks/routes/api/board.get.mjs +0 -147
- package/.output/server/chunks/routes/api/plugins/thread-limits.post.mjs +0 -45
- package/.output/server/chunks/routes/api/project/inbox.get.mjs +0 -43
- package/.output/server/chunks/routes/api/project/inbox.post.mjs +0 -43
- package/.output/server/chunks/routes/api/project/memory.get.mjs +0 -42
- package/.output/server/chunks/routes/api/project/routines.get.mjs +0 -43
- package/.output/server/chunks/routes/api/project/thread.get.mjs +0 -44
- package/.output/server/chunks/routes/api/project/thread.post.mjs +0 -45
- package/bin/install-docker-skill.sh +0 -20
|
@@ -1,8 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { m as machineFor, aZ as herdrOn, H as HerdrError, f as findPane, a_ as splitId, a$ as getState, aa as log, X as sleep } from '../nitro/nitro.mjs';
|
|
2
|
+
|
|
3
|
+
const PLUGIN_ID_RE = /^[A-Za-z0-9.:_-]{1,100}$/;
|
|
4
|
+
const ACTION_ID_RE = /^[A-Za-z0-9:_-]{1,100}$/;
|
|
5
|
+
function actionContext(pane, workspaces = []) {
|
|
6
|
+
const context = { invocation_source: "wherdr" };
|
|
7
|
+
if (!pane) return context;
|
|
8
|
+
const local = (id) => id.includes("~") ? id.slice(id.indexOf("~") + 1) : id;
|
|
9
|
+
const workspace = workspaces.find((w) => w.id === pane.workspace);
|
|
10
|
+
return {
|
|
11
|
+
...context,
|
|
12
|
+
focused_pane_id: local(pane.id),
|
|
13
|
+
tab_id: local(pane.tab),
|
|
14
|
+
workspace_id: local(pane.workspace),
|
|
15
|
+
workspace_label: (workspace == null ? void 0 : workspace.label) || "",
|
|
16
|
+
workspace_cwd: pane.cwd || "",
|
|
17
|
+
focused_pane_cwd: pane.cwd || ""
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const AGENT_CONTEXTS = ["workspace", "tab", "pane"];
|
|
21
|
+
const READ_ONLY = /\b(list|lists|show|status|view|info|doctor|check|help|preview|inspect|lister|liste|voir|afficher|état|etat|vérifier|verifier|aide)\b/i;
|
|
22
|
+
function needsConfirm(a) {
|
|
23
|
+
return !(READ_ONLY.test(a.id.replace(/[_:]/g, "-")) || READ_ONLY.test(a.title));
|
|
24
|
+
}
|
|
25
|
+
function shortLabel(title, pluginName) {
|
|
26
|
+
const esc = pluginName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
27
|
+
const rest = title.replace(new RegExp(`^${esc}\\s*[:\xB7\u2014\u2013-]\\s*`, "i"), "").trim();
|
|
28
|
+
return rest ? rest[0].toUpperCase() + rest.slice(1) : title;
|
|
29
|
+
}
|
|
30
|
+
const isOwnPlugin = (id) => id === "wherdr" || id.endsWith(".wherdr");
|
|
31
|
+
function opensInHerdr(a) {
|
|
32
|
+
if (a.placement === "popup" || a.placement === "overlay") return true;
|
|
33
|
+
const cmd = Array.isArray(a.command) ? a.command.map(String).join(" ") : "";
|
|
34
|
+
if (/\bplugin\s+pane\s+open\b/.test(cmd)) return true;
|
|
35
|
+
return /(^|[-_:])popup($|[-_:])/i.test(String(a.action_id || ""));
|
|
36
|
+
}
|
|
37
|
+
function normalizeActions(actions, plugins = []) {
|
|
38
|
+
const byId = new Map(plugins.filter((p) => p && p.plugin_id).map((p) => [p.plugin_id, p]));
|
|
39
|
+
const out = [];
|
|
40
|
+
for (const a of actions || []) {
|
|
41
|
+
const plugin = String((a == null ? void 0 : a.plugin_id) || "");
|
|
42
|
+
const id = String((a == null ? void 0 : a.action_id) || "");
|
|
43
|
+
if (!PLUGIN_ID_RE.test(plugin) || !ACTION_ID_RE.test(id) || isOwnPlugin(plugin)) continue;
|
|
44
|
+
const p = byId.get(plugin);
|
|
45
|
+
if (p && p.enabled === false) continue;
|
|
46
|
+
const ctx = (Array.isArray(a.contexts) ? a.contexts : []).map(String);
|
|
47
|
+
const agent = ctx.some((c) => AGENT_CONTEXTS.includes(c));
|
|
48
|
+
const machine = !ctx.length || ctx.includes("global");
|
|
49
|
+
if (!agent && !machine) continue;
|
|
50
|
+
const title = String(a.title || id).replace(/\s+/g, " ").trim().slice(0, 120) || id;
|
|
51
|
+
const description = a.description ? String(a.description).replace(/\s+/g, " ").trim().slice(0, 240) || null : null;
|
|
52
|
+
const pluginName = String((p == null ? void 0 : p.name) || plugin).trim() || plugin;
|
|
53
|
+
out.push({
|
|
54
|
+
plugin,
|
|
55
|
+
pluginName,
|
|
56
|
+
id,
|
|
57
|
+
title,
|
|
58
|
+
label: shortLabel(title, pluginName),
|
|
59
|
+
description,
|
|
60
|
+
agent,
|
|
61
|
+
machine,
|
|
62
|
+
confirm: needsConfirm({ id, title }),
|
|
63
|
+
inHerdr: opensInHerdr(a)
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return out.sort((x, y) => x.pluginName.localeCompare(y.pluginName) || x.label.localeCompare(y.label));
|
|
67
|
+
}
|
|
68
|
+
const ANSI = /\x1B(?:\[[0-?]*[ -/]*[@-~]|\][^\x07\x1B]*(?:\x07|\x1B\\)|[@-Z\\-_])/g;
|
|
69
|
+
function stripAnsi(text) {
|
|
70
|
+
return String(text || "").replace(ANSI, "").replace(/[\x00-\x08\x0B-\x1F\x7F]/g, "");
|
|
71
|
+
}
|
|
72
|
+
function outputTail(text, max = 300) {
|
|
73
|
+
const lines = stripAnsi(text).split("\n").map((l) => l.trim()).filter(Boolean);
|
|
74
|
+
let out = "";
|
|
75
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
76
|
+
const next = out ? `${lines[i]}
|
|
77
|
+
${out}` : lines[i];
|
|
78
|
+
if (next.length > max) {
|
|
79
|
+
if (!out) out = "\u2026" + lines[i].slice(-(max - 1));
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
out = next;
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
function logResult(log2) {
|
|
87
|
+
const status = (log2 == null ? void 0 : log2.status) === "succeeded" || (log2 == null ? void 0 : log2.status) === "failed" ? log2.status : "running";
|
|
88
|
+
const exitCode = typeof (log2 == null ? void 0 : log2.exit_code) === "number" ? log2.exit_code : null;
|
|
89
|
+
const output = status === "failed" ? outputTail(log2 == null ? void 0 : log2.stderr) || outputTail(log2 == null ? void 0 : log2.error) || outputTail(log2 == null ? void 0 : log2.stdout) : outputTail(log2 == null ? void 0 : log2.stdout) || outputTail(log2 == null ? void 0 : log2.stderr);
|
|
90
|
+
return { status, exitCode, output };
|
|
91
|
+
}
|
|
6
92
|
|
|
7
93
|
const CACHE_MS = 1e4;
|
|
8
94
|
const cache = /* @__PURE__ */ new Map();
|
|
@@ -19,78 +105,6 @@ async function listPluginActions(machineKey, fresh = false) {
|
|
|
19
105
|
return actions;
|
|
20
106
|
}
|
|
21
107
|
const WAIT_MS = 12e3;
|
|
22
|
-
function pluginInputFields(plugin, action) {
|
|
23
|
-
return plugin === "herdr-projects" ? PROJECT_INPUTS[action] || [] : [];
|
|
24
|
-
}
|
|
25
|
-
async function runProjects(m, bin, args, timeoutMs = 6e4) {
|
|
26
|
-
var _a;
|
|
27
|
-
if (m.exec) {
|
|
28
|
-
const herdrBin = "bin" in m && typeof m.bin === "string" && m.bin ? m.bin : "herdr";
|
|
29
|
-
const r = await m.exec(REMOTE_PROJECTS_SCRIPT, [herdrBin, bin, ...args], { timeoutMs });
|
|
30
|
-
return { code: (_a = r.code) != null ? _a : 1, stdout: r.stdout.toString("utf8").trim(), stderr: r.stderr.trim() };
|
|
31
|
-
}
|
|
32
|
-
return new Promise((resolve) => execFile(bin, args, {
|
|
33
|
-
env: { ...HERDR_CHILD_ENV, HERDR_BIN_PATH: HERDR_BIN },
|
|
34
|
-
timeout: timeoutMs,
|
|
35
|
-
maxBuffer: 1024 * 1024
|
|
36
|
-
}, (err, stdout, stderr) => resolve({
|
|
37
|
-
code: err ? typeof err.code === "number" ? err.code : 1 : 0,
|
|
38
|
-
stdout: String(stdout).trim(),
|
|
39
|
-
stderr: String(stderr || (err && !stdout ? err.message : "")).trim()
|
|
40
|
-
})));
|
|
41
|
-
}
|
|
42
|
-
async function projectsBin(m) {
|
|
43
|
-
const bin = await binaryOn(m);
|
|
44
|
-
if (!bin) throw new HerdrError("plugin_unavailable", "Projects binary not found");
|
|
45
|
-
return bin;
|
|
46
|
-
}
|
|
47
|
-
async function projectsCommand(m, args, lang = "en") {
|
|
48
|
-
const r = await runProjects(m, await projectsBin(m), args);
|
|
49
|
-
if (r.code !== 0) {
|
|
50
|
-
const error = r.stderr || r.stdout || `code ${r.code}`;
|
|
51
|
-
const readOnly = readOnlyMessage(error, { docker: m.local && IN_DOCKER });
|
|
52
|
-
if (readOnly) log(`herdr-projects ${args[0]}: ${error}`);
|
|
53
|
-
throw new HerdrError(readOnly ? "read_only" : "plugin_failed", readOnly || error);
|
|
54
|
-
}
|
|
55
|
-
return r.stdout;
|
|
56
|
-
}
|
|
57
|
-
async function withoutContainerTicker(m, run) {
|
|
58
|
-
if (!m.local || !IN_DOCKER) return run();
|
|
59
|
-
const bin = await projectsBin(m);
|
|
60
|
-
const before = await runProjects(m, bin, ["ticker", "status"]).catch(() => null);
|
|
61
|
-
try {
|
|
62
|
-
return await run();
|
|
63
|
-
} finally {
|
|
64
|
-
if (before && before.code === 0 && !tickerRunning(before.stdout)) {
|
|
65
|
-
const after = await runProjects(m, bin, ["ticker", "status"]).catch(() => null);
|
|
66
|
-
if (after && tickerRunning(after.stdout)) {
|
|
67
|
-
log("herdr-projects: ticker started in the container, stop requested (it will restart on the host)");
|
|
68
|
-
runProjects(m, bin, ["ticker", "stop"]).then((r) => r.code && log(`herdr-projects ticker stop: ${r.stderr || r.code}`));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async function projectsDoctor(m) {
|
|
74
|
-
const bin = await projectsBin(m);
|
|
75
|
-
const [version, doctor] = await Promise.all([
|
|
76
|
-
runProjects(m, bin, ["--version"]).catch(() => null),
|
|
77
|
-
runProjects(m, bin, projectCommandArgs("doctor", {}, { session: m.session }))
|
|
78
|
-
]);
|
|
79
|
-
const home = m.local ? String(HERDR_CHILD_ENV.HOME || HOME) : m.home;
|
|
80
|
-
const full = stripAnsi([doctor.stdout, doctor.stderr].filter(Boolean).join("\n")).slice(-12e3);
|
|
81
|
-
return {
|
|
82
|
-
status: doctor.code === 0 ? "succeeded" : "failed",
|
|
83
|
-
exitCode: doctor.code,
|
|
84
|
-
output: outputTail(full),
|
|
85
|
-
full,
|
|
86
|
-
setup: setupHeader({ version: version && version.code === 0 ? version.stdout : null, binary: bin, home })
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
async function projectProfiles(machineKey) {
|
|
90
|
-
const m = machineFor(machineKey);
|
|
91
|
-
const r = await runProjects(m, await projectsBin(m), ["profile", "list"], 1e4);
|
|
92
|
-
return r.code === 0 ? parseProfileList(stripAnsi(r.stdout)) : null;
|
|
93
|
-
}
|
|
94
108
|
async function invokePluginAction(body) {
|
|
95
109
|
const plugin = String(body.plugin || "");
|
|
96
110
|
const action = String(body.action || "");
|
|
@@ -102,50 +116,6 @@ async function invokePluginAction(body) {
|
|
|
102
116
|
const known = (await listPluginActions(m.key, true)).find((a) => a.plugin === plugin && a.id === action);
|
|
103
117
|
if (!known) throw new HerdrError("plugin_action_not_found", "Action not found on this machine");
|
|
104
118
|
if (pane ? !known.agent : !known.machine) throw new HerdrError("bad_context", "Action not available here");
|
|
105
|
-
if (plugin === "herdr-projects" && action === "open-popup") {
|
|
106
|
-
throw new HerdrError("popup_unavailable", "The Projects panel is available in the Herdr client; its inputs are not reachable through the Herdr API.");
|
|
107
|
-
}
|
|
108
|
-
if (plugin === "herdr-projects" && action === "doctor") {
|
|
109
|
-
log(`plugin ${plugin}.${action}${m.local ? "" : ` on ${m.label}`} (command)`);
|
|
110
|
-
return projectsDoctor(m);
|
|
111
|
-
}
|
|
112
|
-
const fields = pluginInputFields(plugin, action);
|
|
113
|
-
if (fields.length) {
|
|
114
|
-
const input = cleanProjectInput(action, body.input);
|
|
115
|
-
if (!input) throw new HerdrError("bad_input", "Invalid plugin input");
|
|
116
|
-
if (action === "adopt-workspace" && (!pane || !pane.agent || !pane.cwd)) {
|
|
117
|
-
throw new HerdrError("bad_context", "This space needs an agent and its folder");
|
|
118
|
-
}
|
|
119
|
-
if (input.repo) {
|
|
120
|
-
const rm = input.machine ? machineFor(input.machine) : m;
|
|
121
|
-
const repo = underHome(input.repo, rm.home);
|
|
122
|
-
if (!repo || !await isGitRepo(repo, rm)) throw new HerdrError("bad_input", fmt("Not a Git repository: {path}", { path: input.repo }));
|
|
123
|
-
const arg = repoArgument(repo, rm, m);
|
|
124
|
-
if (!arg) throw new HerdrError("bad_input", fmt("Repository unusable from {machine}: {path}", { machine: m.label, path: `${repo}${rm === m ? "" : ` (${rm.label})`}` }));
|
|
125
|
-
input.repo = arg;
|
|
126
|
-
}
|
|
127
|
-
delete input.machine;
|
|
128
|
-
const lang = body.lang === "fr" ? "fr" : "en";
|
|
129
|
-
const args = projectCommandArgs(action, input, { pane: pane ? splitId(pane.id).local : void 0, cwd: (pane == null ? void 0 : pane.cwd) || void 0, session: m.session, lang });
|
|
130
|
-
const exec = async () => {
|
|
131
|
-
var _a;
|
|
132
|
-
const output = await projectsCommand(m, args, lang);
|
|
133
|
-
if (action === "new") {
|
|
134
|
-
const slug = (_a = /created `([^`]+)`/.exec(output)) == null ? void 0 : _a[1];
|
|
135
|
-
if (slug) {
|
|
136
|
-
try {
|
|
137
|
-
return { status: "succeeded", exitCode: 0, output: outputTail(`${output}
|
|
138
|
-
${await projectsCommand(m, projectCommandArgs("open", { slug }, { session: m.session }), lang)}`) };
|
|
139
|
-
} catch (e) {
|
|
140
|
-
return { status: "failed", exitCode: null, output: outputTail(`${output}
|
|
141
|
-
${e.message}`) };
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return { status: "succeeded", exitCode: 0, output: outputTail(output) };
|
|
146
|
-
};
|
|
147
|
-
return ["new", "open", "adopt-workspace"].includes(action) ? withoutContainerTicker(m, exec) : exec();
|
|
148
|
-
}
|
|
149
119
|
const context = actionContext(pane || null, getState().workspaces);
|
|
150
120
|
const r = await herdrOn(m.key, "plugin.action.invoke", { plugin_id: plugin, action_id: action, context }, 1e4);
|
|
151
121
|
const logId = r.log && r.log.log_id;
|
|
@@ -162,5 +132,5 @@ ${e.message}`) };
|
|
|
162
132
|
return res;
|
|
163
133
|
}
|
|
164
134
|
|
|
165
|
-
export { invokePluginAction as i, listPluginActions as l
|
|
135
|
+
export { invokePluginAction as i, listPluginActions as l };
|
|
166
136
|
//# sourceMappingURL=plugins.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HerdrError,
|
|
1
|
+
import { H as HerdrError, a3 as paneForeground, a4 as codexMenuOpen, a5 as stopAgent, a6 as terminalUpdateLine, a7 as waitFor, a8 as terminalUpdateDone, a9 as startAgent, X as sleep, f as findPane, T as restarts, aa as log, M as withPaneLock, ab as RESTARTABLE, y as transcripts, ac as claudeFooterMode, ad as planRestart, h as herdr, p as poll } from '../nitro/nitro.mjs';
|
|
2
2
|
import crypto from 'node:crypto';
|
|
3
3
|
|
|
4
4
|
const TERM_UPDATE_MS = 10 * 6e4;
|
|
@@ -3,7 +3,7 @@ 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 {
|
|
6
|
+
import { c6 as installMode, H as HerdrError, aa as log, c7 as oneTapMode, ca as updateRunning } from '../nitro/nitro.mjs';
|
|
7
7
|
import { c as checkUpdate, R as REPO } from './updates.mjs';
|
|
8
8
|
|
|
9
9
|
function wherdrDir(env = process.env) {
|
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
import { p as pkg } from './package.mjs';
|
|
2
|
-
import {
|
|
2
|
+
import { c6 as installMode, c7 as oneTapMode, c8 as updateCommand, c9 as compareVersions } from '../nitro/nitro.mjs';
|
|
3
3
|
|
|
4
4
|
const REPO = "afloury/wherdr";
|
|
5
5
|
const RELEASES_URL = `https://api.github.com/repos/${REPO}/releases?per_page=100`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cb as allMachines, $ as getMachine, H as HerdrError, a_ as splitId, aZ as herdrOn, p as poll, an as recentDirs, cc as joinId, a$ 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 {
|
|
1
|
+
import { ck as networkReady, cl as ensureFresh, cm as gateDecision, cn as sameOrigin, co as hostAllowed, k as auth, cp as checkRequestClient, cq as onNetworkReading } from '../nitro/nitro.mjs';
|
|
2
2
|
|
|
3
3
|
var _a, _b;
|
|
4
4
|
const WS_MAX = 256 * 1024;
|
|
@@ -9,11 +9,25 @@ function headersOf(h) {
|
|
|
9
9
|
});
|
|
10
10
|
return out;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
function upgradeVerdict(headers, remoteAddress) {
|
|
13
|
+
return gateDecision({
|
|
14
|
+
check: checkRequestClient(remoteAddress, headers),
|
|
15
|
+
unlocked: auth.isUnlocked({ headers }),
|
|
16
|
+
hostOk: hostAllowed(headers.host),
|
|
17
|
+
crossSite: !sameOrigin(headers),
|
|
18
|
+
path: "/ws",
|
|
19
|
+
ws: true
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async function checkUpgrade(request) {
|
|
23
|
+
var _a2, _b2;
|
|
24
|
+
await networkReady();
|
|
25
|
+
await ensureFresh(0);
|
|
26
|
+
const verdict = upgradeVerdict(headersOf(request.headers), (_b2 = (_a2 = request._req) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.remoteAddress);
|
|
27
|
+
if (verdict === "network") return new Response(null, { status: 403, statusText: "Network not allowed" });
|
|
28
|
+
if (verdict === "host") return new Response(null, { status: 403, statusText: "Host not allowed" });
|
|
29
|
+
if (verdict === "origin") return new Response(null, { status: 403, statusText: "Forbidden" });
|
|
30
|
+
if (verdict === "locked") return new Response(null, { status: 401, statusText: "Unauthorized" });
|
|
17
31
|
}
|
|
18
32
|
const rawWs = (peer) => {
|
|
19
33
|
var _a2;
|
|
@@ -32,6 +46,29 @@ function watchPeer(peer) {
|
|
|
32
46
|
function unwatchPeer(peer) {
|
|
33
47
|
alive.delete(peer);
|
|
34
48
|
}
|
|
49
|
+
function revalidatePeers(peers = alive.keys(), judge = upgradeVerdict) {
|
|
50
|
+
var _a2;
|
|
51
|
+
let closed = 0;
|
|
52
|
+
for (const peer of [...peers]) {
|
|
53
|
+
let verdict;
|
|
54
|
+
try {
|
|
55
|
+
verdict = judge(((_a2 = peer.request) == null ? void 0 : _a2.headers) ? headersOf(peer.request.headers) : {}, peer.remoteAddress);
|
|
56
|
+
} catch {
|
|
57
|
+
verdict = "network";
|
|
58
|
+
}
|
|
59
|
+
if (verdict === "ok") continue;
|
|
60
|
+
closed++;
|
|
61
|
+
alive.delete(peer);
|
|
62
|
+
try {
|
|
63
|
+
peer.close(1008, "Network policy changed");
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return closed;
|
|
68
|
+
}
|
|
69
|
+
onNetworkReading(() => {
|
|
70
|
+
revalidatePeers();
|
|
71
|
+
});
|
|
35
72
|
(_b = (_a = setInterval(() => {
|
|
36
73
|
for (const [peer, ok] of alive) {
|
|
37
74
|
const ws = rawWs(peer);
|