wherdr 1.3.1 → 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.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{AgentView.C4YOwvZG.css → AgentView.DzFWBd2A.css} +1 -1
- package/.output/public/_nuxt/B4Yk2tB1.js +23 -0
- package/.output/public/_nuxt/BBw_0a4M.js +6 -0
- package/.output/public/_nuxt/{B6qBWHWB.js → BSy6OCIY.js} +1 -1
- package/.output/public/_nuxt/BX5PM2JQ.js +1 -0
- package/.output/public/_nuxt/BgPDnf2S.js +1 -0
- package/.output/public/_nuxt/BkOxQzbS.js +2 -0
- package/.output/public/_nuxt/{WLQjK8uJ.js → CKhgznq4.js} +45 -46
- package/.output/public/_nuxt/{C2T9fQ4f.js → CP8o925U.js} +1 -1
- package/.output/public/_nuxt/CkbmecwS.js +1 -0
- package/.output/public/_nuxt/Cr3SrGky.js +1 -0
- package/.output/public/_nuxt/DAg9fiVh.js +89 -0
- package/.output/public/_nuxt/DT8qZ0Wv.js +1 -0
- package/.output/public/_nuxt/DaaJIRB3.js +1 -0
- package/.output/public/_nuxt/DcJi16XA.js +1 -0
- package/.output/public/_nuxt/VpjCgSXu.js +36 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/c735b6c0-1bd0-47d7-a208-d310f0a06287.json +1 -0
- package/.output/public/_nuxt/dPxB2L94.js +89 -0
- package/.output/public/_nuxt/{entry.cKR16VqG.css → entry.CGWKmYU3.css} +1 -1
- package/.output/public/_nuxt/hePW80VL.js +1 -0
- package/.output/public/_nuxt/xYX85SPI.js +1 -0
- package/.output/public/sw.js +1 -1
- package/.output/server/chunks/_/branding.mjs +1 -1
- package/.output/server/chunks/_/filePaths.mjs +25 -0
- package/.output/server/chunks/_/files.mjs +204 -0
- package/.output/server/chunks/_/machineOrder.mjs +1 -1
- package/.output/server/chunks/_/onboarding.mjs +1 -1
- package/.output/server/chunks/_/package.mjs +97 -0
- package/.output/server/chunks/_/pluginPolicy.mjs +93 -0
- package/.output/server/chunks/_/plugins.mjs +4 -94
- package/.output/server/chunks/_/projectBoard.mjs +120 -29
- package/.output/server/chunks/_/projectDocs.mjs +106 -0
- package/.output/server/chunks/_/projectInbox.mjs +135 -0
- package/.output/server/chunks/_/projectThreads.mjs +46 -0
- package/.output/server/chunks/_/projectThreads2.mjs +61 -0
- package/.output/server/chunks/_/projectsActions.mjs +1 -1
- package/.output/server/chunks/_/projectsPlugin.mjs +1 -1
- package/.output/server/chunks/_/restart.mjs +2 -312
- package/.output/server/chunks/_/reveal.mjs +2 -24
- package/.output/server/chunks/_/selfupdate.mjs +83 -0
- package/.output/server/chunks/_/updates.mjs +91 -0
- package/.output/server/chunks/_/worktrees.mjs +1 -1
- package/.output/server/chunks/_/ws.mjs +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +2660 -1061
- package/.output/server/chunks/raw/bump-homebrew.mjs +1 -1
- package/.output/server/chunks/raw/herdr-plugin.mjs +1 -1
- package/.output/server/chunks/raw/release-ready.mjs +5 -0
- package/.output/server/chunks/routes/api/_..._.mjs +6 -2
- package/.output/server/chunks/routes/api/agents.post.mjs +6 -2
- package/.output/server/chunks/routes/api/ask-tab.post.mjs +6 -2
- package/.output/server/chunks/routes/api/attach.post.mjs +6 -2
- package/.output/server/chunks/routes/api/auth/disable.post.mjs +6 -2
- package/.output/server/chunks/routes/api/auth/lock-all.post.mjs +6 -2
- package/.output/server/chunks/routes/api/auth/lock.post.mjs +6 -2
- package/.output/server/chunks/routes/api/auth/login/options.post.mjs +6 -2
- package/.output/server/chunks/routes/api/auth/login/verify.post.mjs +6 -2
- package/.output/server/chunks/routes/api/auth/max-session.post.mjs +6 -2
- package/.output/server/chunks/routes/api/auth/register/options.post.mjs +6 -2
- package/.output/server/chunks/routes/api/auth/register/verify.post.mjs +6 -2
- package/.output/server/chunks/routes/api/auth/status.get.mjs +6 -2
- package/.output/server/chunks/routes/api/board.get.mjs +147 -0
- package/.output/server/chunks/routes/api/changes.get.mjs +7 -3
- package/.output/server/chunks/routes/api/chat/image.get.mjs +7 -3
- package/.output/server/chunks/routes/api/chat.get.mjs +7 -3
- package/.output/server/chunks/routes/api/choose.post.mjs +34 -4
- package/.output/server/chunks/routes/api/claude-statusline.post.mjs +7 -3
- package/.output/server/chunks/routes/api/close/status.get.mjs +7 -3
- package/.output/server/chunks/routes/api/close.post.mjs +6 -2
- package/.output/server/chunks/routes/api/codex-update.post.mjs +7 -3
- package/.output/server/chunks/routes/api/commands.get.mjs +7 -3
- package/.output/server/chunks/routes/api/config.get.mjs +8 -3
- package/.output/server/chunks/routes/api/dirs.get.mjs +7 -3
- package/.output/server/chunks/routes/api/dismiss-stopped.post.mjs +43 -0
- package/.output/server/chunks/routes/api/dismiss.post.mjs +7 -3
- package/.output/server/chunks/routes/api/effort.post.mjs +7 -3
- package/.output/server/chunks/routes/api/efforts.get.mjs +7 -3
- package/.output/server/chunks/routes/api/file.post.mjs +7 -3
- package/.output/server/chunks/routes/api/files/download.get.mjs +53 -0
- package/.output/server/chunks/routes/api/files/read.get.mjs +45 -0
- package/.output/server/chunks/routes/api/files.get.mjs +44 -0
- package/.output/server/chunks/routes/api/gitroot.get.mjs +7 -3
- package/.output/server/chunks/routes/api/health.get.mjs +36 -0
- package/.output/server/chunks/routes/api/index.get.mjs +6 -2
- package/.output/server/chunks/routes/api/input.post.mjs +18 -4
- package/.output/server/chunks/routes/api/interrupt.post.mjs +7 -3
- package/.output/server/chunks/routes/api/isgit.get.mjs +7 -3
- package/.output/server/chunks/routes/api/machine/awake.get.mjs +7 -3
- package/.output/server/chunks/routes/api/machine/awake.post.mjs +7 -3
- package/.output/server/chunks/routes/api/machine/order.get.mjs +6 -2
- package/.output/server/chunks/routes/api/machine/order.post.mjs +6 -2
- package/.output/server/chunks/routes/api/machine/rename.post.mjs +7 -3
- package/.output/server/chunks/routes/api/menu.post.mjs +7 -3
- package/.output/server/chunks/routes/api/model.post.mjs +7 -3
- package/.output/server/chunks/routes/api/models.get.mjs +7 -3
- package/.output/server/chunks/routes/api/nav.post.mjs +10 -5
- package/.output/server/chunks/routes/api/onboarding.get.mjs +6 -2
- package/.output/server/chunks/routes/api/onboarding.post.mjs +6 -2
- package/.output/server/chunks/routes/api/phone.get.mjs +6 -7
- package/.output/server/chunks/routes/api/phone.post.mjs +6 -7
- package/.output/server/chunks/routes/api/plugins/actions.get.mjs +7 -2
- package/.output/server/chunks/routes/api/plugins/invoke.post.mjs +7 -2
- package/.output/server/chunks/routes/api/plugins/profiles.get.mjs +7 -2
- package/.output/server/chunks/routes/api/plugins/projects.get.mjs +7 -3
- package/.output/server/chunks/routes/api/plugins/projects.post.mjs +7 -3
- package/.output/server/chunks/routes/api/plugins/thread-limits.get.mjs +7 -3
- package/.output/server/chunks/routes/api/plugins/thread-limits.post.mjs +7 -3
- package/.output/server/chunks/routes/api/project/inbox.get.mjs +43 -0
- package/.output/server/chunks/routes/api/project/inbox.post.mjs +43 -0
- package/.output/server/chunks/routes/api/project/memory.get.mjs +42 -0
- package/.output/server/chunks/routes/api/project/report.get.mjs +7 -3
- package/.output/server/chunks/routes/api/project/routines.get.mjs +43 -0
- package/.output/server/chunks/routes/api/project/settings.get.mjs +41 -0
- package/.output/server/chunks/routes/api/project/thread.get.mjs +44 -0
- package/.output/server/chunks/routes/api/project/thread.post.mjs +45 -0
- package/.output/server/chunks/routes/api/prompt.post.mjs +26 -4
- package/.output/server/chunks/routes/api/push/quiet.post.mjs +7 -3
- package/.output/server/chunks/routes/api/push/subscribe.post.mjs +7 -3
- package/.output/server/chunks/routes/api/push/test.post.mjs +7 -3
- package/.output/server/chunks/routes/api/push/unsubscribe.post.mjs +7 -3
- package/.output/server/chunks/routes/api/quotas.get.mjs +7 -3
- package/.output/server/chunks/routes/api/rename.post.mjs +6 -2
- package/.output/server/chunks/routes/api/requeue.post.mjs +7 -3
- package/.output/server/chunks/routes/api/restart.get.mjs +6 -2
- package/.output/server/chunks/routes/api/restart.post.mjs +6 -2
- package/.output/server/chunks/routes/api/reveal.post.mjs +7 -2
- package/.output/server/chunks/routes/api/screen-key.post.mjs +7 -3
- package/.output/server/chunks/routes/api/screen.get.mjs +10 -4
- package/.output/server/chunks/routes/api/search.get.mjs +7 -3
- package/.output/server/chunks/routes/api/seen.post.mjs +7 -3
- package/.output/server/chunks/routes/api/sessions.get.mjs +7 -3
- package/.output/server/chunks/routes/api/sessions.post.mjs +7 -3
- package/.output/server/chunks/routes/api/space.post.mjs +19 -15
- package/.output/server/chunks/routes/api/state.get.mjs +7 -3
- package/.output/server/chunks/routes/api/unqueue.post.mjs +7 -3
- package/.output/server/chunks/routes/api/update/status.get.mjs +38 -0
- package/.output/server/chunks/routes/api/update.get.mjs +12 -51
- package/.output/server/chunks/routes/api/update.post.mjs +41 -0
- package/.output/server/chunks/routes/api/upload.post.mjs +7 -3
- package/.output/server/chunks/routes/api/worktrees/remove.post.mjs +6 -2
- package/.output/server/chunks/routes/api/worktrees.get.mjs +6 -2
- package/.output/server/chunks/routes/favicon.ico.get.mjs +6 -2
- package/.output/server/chunks/routes/icons/_name_.get.mjs +7 -3
- package/.output/server/chunks/routes/renderer.mjs +8 -4
- package/.output/server/chunks/routes/uploads/_...name_.get.mjs +7 -3
- package/.output/server/chunks/routes/ws/_..._.mjs +7 -3
- package/.output/server/chunks/routes/ws/events.mjs +7 -3
- package/.output/server/chunks/routes/ws/term.mjs +9 -5
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/index.mjs +7 -3
- package/.output/server/package.json +1 -1
- package/README.md +440 -46
- package/bin/install-docker-skill.sh +20 -0
- package/bin/lib/commands.mjs +47 -9
- package/bin/lib/core.mjs +18 -2
- package/bin/lib/install-skill.sh +100 -0
- package/bin/lib/skill.mjs +16 -0
- package/bin/lib/tailnet.d.mts +12 -3
- package/bin/lib/tailnet.mjs +103 -25
- package/bin/lib/updater.mjs +320 -0
- package/bin/lib/verify-release.mjs +20 -0
- package/package.json +4 -2
- package/skills/wherdr/SKILL.md +180 -0
- package/.output/public/_nuxt/BDNMzG2s.js +0 -1
- package/.output/public/_nuxt/BMIe8p_3.js +0 -2
- package/.output/public/_nuxt/BpQH8Ho1.js +0 -1
- package/.output/public/_nuxt/BrAeJIZR.js +0 -30
- package/.output/public/_nuxt/C12eXl5z.js +0 -1
- package/.output/public/_nuxt/CXG-cOdh.js +0 -1
- package/.output/public/_nuxt/CYxHnMNH.js +0 -83
- package/.output/public/_nuxt/CctS2Xn6.js +0 -65
- package/.output/public/_nuxt/CiYar6hg.js +0 -6
- package/.output/public/_nuxt/DLLQgP0d.js +0 -1
- package/.output/public/_nuxt/Dwh-l2rQ.js +0 -17
- package/.output/public/_nuxt/bLP7Jj-b.js +0 -1
- package/.output/public/_nuxt/builds/meta/6466b0ab-7935-460c-abdf-2ea632dae6d0.json +0 -1
- package/.output/public/_nuxt/whFLy_Ne.js +0 -23
- package/.output/server/chunks/_/phone.mjs +0 -343
- package/.output/server/chunks/routes/ws/mirror.mjs +0 -157
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { m as getState, n as projectOf, o as isCoordinator, q as paneBaseMachine, t as pickCoordinator, a as defineApi, i as getQuery } from '../../nitro/nitro.mjs';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { r as readProjectBoard } from '../../_/projectBoard.mjs';
|
|
5
|
+
import 'node:http';
|
|
6
|
+
import 'node:https';
|
|
7
|
+
import 'stream';
|
|
8
|
+
import 'events';
|
|
9
|
+
import 'http';
|
|
10
|
+
import 'crypto';
|
|
11
|
+
import 'buffer';
|
|
12
|
+
import 'zlib';
|
|
13
|
+
import 'https';
|
|
14
|
+
import 'net';
|
|
15
|
+
import 'tls';
|
|
16
|
+
import 'url';
|
|
17
|
+
import 'node:events';
|
|
18
|
+
import 'node:buffer';
|
|
19
|
+
import 'node:fs';
|
|
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
|
+
|
|
33
|
+
const RESOLVED_KEPT = 20;
|
|
34
|
+
|
|
35
|
+
const READ_DEADLINE_MS = 4e3;
|
|
36
|
+
const INFLIGHT_MAX_MS = 6e4;
|
|
37
|
+
const REUSE_MS = 5e3;
|
|
38
|
+
const cache = /* @__PURE__ */ new Map();
|
|
39
|
+
const inflight = /* @__PURE__ */ new Map();
|
|
40
|
+
function groupProjects(panes) {
|
|
41
|
+
const groups = /* @__PURE__ */ new Map();
|
|
42
|
+
for (const p of panes) {
|
|
43
|
+
const cwd = (p.cwd || "").replace(/\/+$/, "");
|
|
44
|
+
const slug = projectOf(p);
|
|
45
|
+
if (!isCoordinator(p) || !slug || !path.posix.isAbsolute(cwd)) continue;
|
|
46
|
+
const dirName = path.posix.basename(cwd);
|
|
47
|
+
if (dirName.toLowerCase() !== slug.toLowerCase()) continue;
|
|
48
|
+
const key = `${paneBaseMachine(p)}|${cwd}`;
|
|
49
|
+
const g = groups.get(key);
|
|
50
|
+
if (g) g.panes.push(p);
|
|
51
|
+
else groups.set(key, { key, slug: dirName, panes: [p] });
|
|
52
|
+
}
|
|
53
|
+
return [...groups.values()];
|
|
54
|
+
}
|
|
55
|
+
function isOnline(machine) {
|
|
56
|
+
var _a;
|
|
57
|
+
if (!machine) return true;
|
|
58
|
+
const info = (_a = getState().machines) == null ? void 0 : _a.find((m) => m.key === machine);
|
|
59
|
+
return !info || info.status === "online";
|
|
60
|
+
}
|
|
61
|
+
function startRead(key, pane, since) {
|
|
62
|
+
const running = inflight.get(key);
|
|
63
|
+
if (running && Date.now() - running.since < INFLIGHT_MAX_MS) return running.read;
|
|
64
|
+
const read = readProjectBoard(pane, since).then((r) => {
|
|
65
|
+
const at = Date.now();
|
|
66
|
+
if ("same" in r) {
|
|
67
|
+
const kept = cache.get(key);
|
|
68
|
+
if (kept) kept.at = at;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const board = "available" in r ? null : r;
|
|
72
|
+
cache.set(key, { board, digest: createHash("sha1").update(JSON.stringify(board)).digest("hex"), at });
|
|
73
|
+
}).finally(() => {
|
|
74
|
+
var _a;
|
|
75
|
+
if (((_a = inflight.get(key)) == null ? void 0 : _a.read) === read) inflight.delete(key);
|
|
76
|
+
});
|
|
77
|
+
inflight.set(key, { read, since: Date.now() });
|
|
78
|
+
return read;
|
|
79
|
+
}
|
|
80
|
+
async function withDeadline(read) {
|
|
81
|
+
const late = Promise.withResolvers();
|
|
82
|
+
const timer = setTimeout(() => late.reject(new Error("Board read timed out")), READ_DEADLINE_MS);
|
|
83
|
+
try {
|
|
84
|
+
await Promise.race([read, late.promise]);
|
|
85
|
+
} finally {
|
|
86
|
+
clearTimeout(timer);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function readGroup(g, refresh) {
|
|
90
|
+
var _a, _b, _c, _d;
|
|
91
|
+
const pane = (_a = pickCoordinator(g.panes, g.slug)) != null ? _a : g.panes[0];
|
|
92
|
+
const panes = [pane, ...g.panes.filter((p) => p !== pane)].map((p) => p.id);
|
|
93
|
+
const project = { key: g.key, slug: g.slug, panes, board: null };
|
|
94
|
+
let failure;
|
|
95
|
+
const kept = cache.get(g.key);
|
|
96
|
+
if (!isOnline(pane.machine)) {
|
|
97
|
+
failure = "";
|
|
98
|
+
} else if (refresh || !kept || Date.now() - kept.at >= REUSE_MS) {
|
|
99
|
+
try {
|
|
100
|
+
await withDeadline(startRead(g.key, pane, refresh ? void 0 : (_b = kept == null ? void 0 : kept.board) == null ? void 0 : _b.version));
|
|
101
|
+
} catch (e) {
|
|
102
|
+
failure = e.message || "Board read failed";
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const board = (_d = (_c = cache.get(g.key)) == null ? void 0 : _c.board) != null ? _d : null;
|
|
106
|
+
if (board) {
|
|
107
|
+
project.board = { ...board, resolved: board.resolved.slice(0, RESOLVED_KEPT) };
|
|
108
|
+
project.resolvedTotal = board.resolved.length;
|
|
109
|
+
}
|
|
110
|
+
if (failure !== void 0) {
|
|
111
|
+
project.stale = true;
|
|
112
|
+
if (failure) project.error = failure;
|
|
113
|
+
}
|
|
114
|
+
return project;
|
|
115
|
+
}
|
|
116
|
+
function versionOf(projects) {
|
|
117
|
+
const h = createHash("sha1");
|
|
118
|
+
h.update(JSON.stringify(projects.map((p) => {
|
|
119
|
+
var _a, _b, _c, _d;
|
|
120
|
+
return [p.key, p.panes, (_b = (_a = cache.get(p.key)) == null ? void 0 : _a.digest) != null ? _b : null, (_c = p.stale) != null ? _c : false, (_d = p.error) != null ? _d : null];
|
|
121
|
+
})));
|
|
122
|
+
return h.digest("hex").slice(0, 16);
|
|
123
|
+
}
|
|
124
|
+
async function readGlobalBoard(since, refresh = []) {
|
|
125
|
+
const groups = groupProjects(getState().panes);
|
|
126
|
+
const keys = new Set(groups.map((g) => g.key));
|
|
127
|
+
for (const k of cache.keys()) if (!keys.has(k)) cache.delete(k);
|
|
128
|
+
const again = new Set(refresh);
|
|
129
|
+
const projects = await Promise.all(groups.map((g) => readGroup(g, again.has(g.key))));
|
|
130
|
+
projects.sort((a, b) => a.slug.localeCompare(b.slug) || (a.key < b.key ? -1 : 1));
|
|
131
|
+
const version = versionOf(projects);
|
|
132
|
+
if (since === version) return { same: true, version };
|
|
133
|
+
return { version, projects };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const REFRESH_KEYS = 50;
|
|
137
|
+
const REFRESH_KEY_CHARS = 400;
|
|
138
|
+
const board_get = defineApi(async (event) => {
|
|
139
|
+
var _a;
|
|
140
|
+
const q = getQuery(event);
|
|
141
|
+
const raw = [(_a = q.refresh) != null ? _a : []].flat();
|
|
142
|
+
const refresh = raw.filter((k) => typeof k === "string" && !!k && k.length <= REFRESH_KEY_CHARS).slice(0, REFRESH_KEYS);
|
|
143
|
+
return readGlobalBoard(typeof q.since === "string" ? q.since.slice(0, 64) : void 0, refresh);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export { board_get as default };
|
|
147
|
+
//# sourceMappingURL=board.get.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, i as getQuery, f as findPane, H as HerdrError,
|
|
1
|
+
import { a as defineApi, i as getQuery, f as findPane, H as HerdrError, v as machineFor } from '../../nitro/nitro.mjs';
|
|
2
2
|
import { r as readChanges } from '../../_/changes.mjs';
|
|
3
3
|
import 'node:http';
|
|
4
4
|
import 'node:https';
|
|
@@ -21,10 +21,14 @@ 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';
|
|
26
|
-
import 'node:
|
|
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';
|
|
27
30
|
import '@simplewebauthn/server';
|
|
31
|
+
import 'node:url';
|
|
28
32
|
|
|
29
33
|
const changes_get = defineApi(async (event) => {
|
|
30
34
|
const q = getQuery(event);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as defineEventHandler, i as getQuery, f as findPane,
|
|
1
|
+
import { d as defineEventHandler, i as getQuery, f as findPane, G as transcripts, s as sendError, M as sendImage } from '../../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:crypto';
|
|
@@ -20,10 +20,14 @@ 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';
|
|
25
|
-
import 'node:
|
|
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';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const image_get = defineEventHandler(async (event) => {
|
|
29
33
|
const q = getQuery(event);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as UPLOAD_DIR,
|
|
1
|
+
import { U as UPLOAD_DIR, C as uploadNames, a as defineApi, i as getQuery, f as findPane, H as HerdrError, D as machineOfPane, E as fmt, F as takenBackOf, G as transcripts, I as chatPasted, J as withoutTakenBack, K as withSentText, L as currentModel } from '../../nitro/nitro.mjs';
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
import path from 'node:path';
|
|
@@ -22,8 +22,12 @@ import 'node:os';
|
|
|
22
22
|
import 'node:child_process';
|
|
23
23
|
import 'node:net';
|
|
24
24
|
import 'node:readline';
|
|
25
|
-
import 'node:
|
|
25
|
+
import 'node:dns';
|
|
26
|
+
import 'node:util';
|
|
27
|
+
import 'qrcode-terminal/vendor/QRCode/index.js';
|
|
28
|
+
import 'qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const UPLOAD_PATH = /\.cache\/herdr-web\/uploads\/([\w-]+\.[a-z]+)/g;
|
|
29
33
|
const CACHE_MAX = 500;
|
|
@@ -83,7 +87,7 @@ const chat_get = defineApi(async (event) => {
|
|
|
83
87
|
});
|
|
84
88
|
if (r.token) r.token += mark;
|
|
85
89
|
if (r.items) {
|
|
86
|
-
r.items = withoutTakenBack(r.items, hidden);
|
|
90
|
+
r.items = chatPasted(withoutTakenBack(r.items, hidden));
|
|
87
91
|
await addUploadHashes(r.items);
|
|
88
92
|
}
|
|
89
93
|
if (r.queue && r.queue.length) r.queue = withSentText(p.id, r.queue);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HerdrError,
|
|
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,10 +20,14 @@ 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';
|
|
25
|
-
import 'node:
|
|
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';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const OPEN_MS = 3e3;
|
|
29
33
|
const answering = /* @__PURE__ */ new Set();
|
|
@@ -109,7 +113,33 @@ async function typeClaudeAnswer(d, paneId, choices, index, answer) {
|
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
const choose_post = defineApi(async (event, b) => {
|
|
116
|
+
var _a;
|
|
112
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
|
+
}
|
|
113
143
|
const r = await herdr("pane.read", { pane_id: b.pane_id, source: "detection" }, 4e3);
|
|
114
144
|
const text = r.read && r.read.text;
|
|
115
145
|
const pane = findPane(b.pane_id);
|
|
@@ -118,7 +148,7 @@ const choose_post = defineApi(async (event, b) => {
|
|
|
118
148
|
const i = Number(b.index);
|
|
119
149
|
const option = choices && choices.options[i];
|
|
120
150
|
const answer = typeof b.text === "string" ? b.text.trim() : "";
|
|
121
|
-
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)) {
|
|
122
152
|
throw new HerdrError("stale", "The question has changed \u2014 check the current screen.");
|
|
123
153
|
}
|
|
124
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,
|
|
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,10 +20,14 @@ 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';
|
|
25
|
-
import 'node:
|
|
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';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const claudeStatusline_post = defineApi(async (_event, body) => {
|
|
29
33
|
const key = typeof body.key === "string" ? body.key : null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, f as findPane, i as getQuery, H as HerdrError,
|
|
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,10 +21,14 @@ 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';
|
|
26
|
-
import 'node:
|
|
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';
|
|
27
30
|
import '@simplewebauthn/server';
|
|
31
|
+
import 'node:url';
|
|
28
32
|
|
|
29
33
|
const status_get = defineApi(async (event) => {
|
|
30
34
|
const p = findPane(String(getQuery(event).pane || ""));
|
|
@@ -20,10 +20,14 @@ 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';
|
|
25
|
-
import 'node:
|
|
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';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const close_post = defineApi(async (event, b) => {
|
|
29
33
|
if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, P as PANE_RE, H as HerdrError, f as findPane,
|
|
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,10 +21,14 @@ 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';
|
|
26
|
-
import 'node:
|
|
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';
|
|
27
30
|
import '@simplewebauthn/server';
|
|
31
|
+
import 'node:url';
|
|
28
32
|
|
|
29
33
|
const codexUpdate_post = defineApi(async (event, b) => {
|
|
30
34
|
if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, f as findPane, i as getQuery, H as HerdrError,
|
|
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,10 +20,14 @@ 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';
|
|
25
|
-
import 'node:
|
|
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';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const commands_get = defineApi(async (event) => {
|
|
29
33
|
const p = findPane(String(getQuery(event).pane || ""));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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,10 +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';
|
|
26
|
-
import 'node:
|
|
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';
|
|
27
30
|
import '@simplewebauthn/server';
|
|
31
|
+
import 'node:url';
|
|
32
|
+
import '../../_/filePaths.mjs';
|
|
28
33
|
|
|
29
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;
|
|
30
35
|
const NAME = /^[a-z0-9][a-z0-9-]{0,39}$/i;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, i as getQuery,
|
|
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,10 +20,14 @@ 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';
|
|
25
|
-
import 'node:
|
|
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';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const dirs_get = defineApi((event) => {
|
|
29
33
|
const q = getQuery(event);
|
|
@@ -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,
|
|
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,10 +20,14 @@ 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';
|
|
25
|
-
import 'node:
|
|
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';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const dismiss_post = defineApi(async (event, b) => {
|
|
29
33
|
if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, P as PANE_RE, H as HerdrError,
|
|
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,10 +20,14 @@ 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';
|
|
25
|
-
import 'node:
|
|
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';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const effort_post = defineApi(async (event, b) => {
|
|
29
33
|
if (!PANE_RE.test(b.pane_id || "")) throw new HerdrError("bad_pane", "Invalid pane");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, i as getQuery, P as PANE_RE, H as HerdrError,
|
|
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,10 +20,14 @@ 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';
|
|
25
|
-
import 'node:
|
|
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';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const efforts_get = defineApi(async (event) => {
|
|
29
33
|
const pane = String(getQuery(event).pane || "");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineApi, i as getQuery,
|
|
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,10 +20,14 @@ 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';
|
|
25
|
-
import 'node:
|
|
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';
|
|
26
29
|
import '@simplewebauthn/server';
|
|
30
|
+
import 'node:url';
|
|
27
31
|
|
|
28
32
|
const file_post = defineApi((event, b) => {
|
|
29
33
|
const pane = String(getQuery(event).pane || "");
|
|
@@ -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
|