reevesagents 1.2.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/CHANGELOG.md +104 -0
- package/LICENSE +166 -0
- package/README.md +288 -0
- package/dist/chunk-3IXII4H5.js +129 -0
- package/dist/chunk-4Q3JF22J.js +51 -0
- package/dist/chunk-D24DQQ6V.js +36 -0
- package/dist/chunk-DHAW6OY3.js +40 -0
- package/dist/chunk-G6FN75ZW.js +2393 -0
- package/dist/chunk-JY4ZTTRK.js +172 -0
- package/dist/chunk-LUW6GCPO.js +108 -0
- package/dist/chunk-MVMGFG4W.js +1462 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +355 -0
- package/dist/extras-25AF6TAR.js +12 -0
- package/dist/index.d.ts +236 -0
- package/dist/index.js +89 -0
- package/dist/open-browser-DRSIJQ37.js +26 -0
- package/dist/router-WCFLHJV7.js +5700 -0
- package/dist/server-Z2YTGWSX.js +883 -0
- package/dist/tui-launch-7RGFE5KY.js +10 -0
- package/dist/web/addon-fit.js +2 -0
- package/dist/web/app.css +1742 -0
- package/dist/web/app.js +1435 -0
- package/dist/web/brand-duck.json +1 -0
- package/dist/web/index.html +178 -0
- package/dist/web/xterm.css +285 -0
- package/dist/web/xterm.js +2 -0
- package/package.json +86 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/web/tui-launch.ts
|
|
4
|
+
var handle = null;
|
|
5
|
+
var pending = null;
|
|
6
|
+
var launchToken = 0;
|
|
7
|
+
async function startWebFromTui() {
|
|
8
|
+
if (handle) {
|
|
9
|
+
const { openBrowser } = await import("./open-browser-DRSIJQ37.js");
|
|
10
|
+
openBrowser(handle.url);
|
|
11
|
+
return handle.url;
|
|
12
|
+
}
|
|
13
|
+
if (pending) {
|
|
14
|
+
const current = await pending;
|
|
15
|
+
return current.url;
|
|
16
|
+
}
|
|
17
|
+
const token = launchToken;
|
|
18
|
+
pending = startTuiWebServer();
|
|
19
|
+
try {
|
|
20
|
+
const current = await pending;
|
|
21
|
+
if (token === launchToken) handle = current;
|
|
22
|
+
return current.url;
|
|
23
|
+
} finally {
|
|
24
|
+
if (token === launchToken) pending = null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async function startTuiWebServer() {
|
|
28
|
+
const { checkWebExtras, webExtrasMessage } = await import("./extras-25AF6TAR.js");
|
|
29
|
+
const extras = await checkWebExtras();
|
|
30
|
+
if (!extras.ok) throw new Error(webExtrasMessage(extras.missing));
|
|
31
|
+
const { startWebServer } = await import("./server-Z2YTGWSX.js");
|
|
32
|
+
return startWebServer({ open: true });
|
|
33
|
+
}
|
|
34
|
+
async function closeTuiWebServer() {
|
|
35
|
+
launchToken += 1;
|
|
36
|
+
const current = handle;
|
|
37
|
+
const starting = pending;
|
|
38
|
+
handle = null;
|
|
39
|
+
pending = null;
|
|
40
|
+
if (current) await current.close();
|
|
41
|
+
if (!current && starting) {
|
|
42
|
+
const started = await starting.catch(() => null);
|
|
43
|
+
if (started) await started.close();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
startWebFromTui,
|
|
49
|
+
closeTuiWebServer
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=chunk-4Q3JF22J.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/web/extras.ts
|
|
4
|
+
var WEB_EXTRA_MODULES = ["ws", "@lydell/node-pty"];
|
|
5
|
+
async function checkWebExtras() {
|
|
6
|
+
const missing = [];
|
|
7
|
+
for (const name of WEB_EXTRA_MODULES) {
|
|
8
|
+
try {
|
|
9
|
+
await import(name);
|
|
10
|
+
} catch {
|
|
11
|
+
missing.push(name);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return { ok: missing.length === 0, missing };
|
|
15
|
+
}
|
|
16
|
+
function webExtrasMessage(missing) {
|
|
17
|
+
return [
|
|
18
|
+
"The web UI needs optional modules that are not installed on this host:",
|
|
19
|
+
...missing.map((name) => ` - ${name}`),
|
|
20
|
+
"",
|
|
21
|
+
"They ship as optional dependencies and were likely skipped because the native",
|
|
22
|
+
"build (@lydell/node-pty) is unavailable for this platform, or the package was",
|
|
23
|
+
"installed without optional dependencies.",
|
|
24
|
+
"",
|
|
25
|
+
"The TUI does not need them: run reevesagents with no arguments to use it.",
|
|
26
|
+
"To enable the web UI, reinstall with optional dependencies enabled (npm default),",
|
|
27
|
+
"then run reevesagents doctor to confirm."
|
|
28
|
+
].join("\n");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
WEB_EXTRA_MODULES,
|
|
33
|
+
checkWebExtras,
|
|
34
|
+
webExtrasMessage
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-D24DQQ6V.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
stateRoot
|
|
4
|
+
} from "./chunk-MVMGFG4W.js";
|
|
5
|
+
|
|
6
|
+
// src/state/tui-open.ts
|
|
7
|
+
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
function tokenPath() {
|
|
10
|
+
return join(stateRoot(), "tui-open-token");
|
|
11
|
+
}
|
|
12
|
+
function readTuiOpenToken() {
|
|
13
|
+
try {
|
|
14
|
+
return readFileSync(tokenPath(), "utf-8").trim();
|
|
15
|
+
} catch {
|
|
16
|
+
return "";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function writeTuiOpenToken() {
|
|
20
|
+
mkdirSync(stateRoot(), { recursive: true });
|
|
21
|
+
writeFileSync(tokenPath(), `${Date.now()}
|
|
22
|
+
`, "utf-8");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/version.ts
|
|
26
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
27
|
+
import { URL } from "url";
|
|
28
|
+
function readVersion() {
|
|
29
|
+
const pkg = JSON.parse(readFileSync2(new URL("../package.json", import.meta.url), "utf8"));
|
|
30
|
+
if (typeof pkg.version !== "string") throw new Error("package.json version must be a string");
|
|
31
|
+
return pkg.version;
|
|
32
|
+
}
|
|
33
|
+
var REEVESAGENTS_VERSION = readVersion();
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
readTuiOpenToken,
|
|
37
|
+
writeTuiOpenToken,
|
|
38
|
+
REEVESAGENTS_VERSION
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=chunk-DHAW6OY3.js.map
|