@evandu/super-pi 0.1.269 → 0.1.271
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/bin/super-pi.js +40 -5
- package/bin/update-receipt.js +2 -2
- package/desktop/update-lifecycle.cjs +1 -1
- package/dist/client/.super-pi-client-sources.json +9 -9
- package/dist/client/assets/{CodeMirrorEditor-D0SD95j9.js → CodeMirrorEditor-Q77Plbqw.js} +1 -1
- package/dist/client/assets/{GitDiffEditor-CNSgHsRB.js → GitDiffEditor-C0XYcNpE.js} +1 -1
- package/dist/client/assets/{index-BFA-1fpt.js → index-CoLvWsuI.js} +62 -62
- package/dist/client/assets/index-DV3qc1Hh.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/http-server.js +4 -0
- package/dist/server/managed-http-direct.d.ts +1 -1
- package/dist/server/managed-http-direct.js +2 -2
- package/dist/server/managed-http-tunnel.js +1 -1
- package/dist/server/managed-http.js +5 -0
- package/dist/server/managed-servers.d.ts +14 -1
- package/dist/server/managed-servers.js +193 -60
- package/dist/server/pi-session.d.ts +1 -0
- package/dist/server/pi-session.js +2 -0
- package/dist/server/remote-bootstrap.d.ts +3 -1
- package/dist/server/remote-bootstrap.js +13 -2
- package/dist/server/ws-server.js +4 -0
- package/dist/shared/managed-servers.d.ts +8 -0
- package/dist/shared/managed-servers.js +1 -0
- package/dist/shared/message-source-link.d.ts +15 -0
- package/dist/shared/message-source-link.js +72 -0
- package/package.json +6 -1
- package/scripts/restart-server.mjs +76 -23
- package/dist/client/assets/index-Cl8iehsn.css +0 -1
|
@@ -17,6 +17,8 @@ export type ServiceProbe = {
|
|
|
17
17
|
status?: number;
|
|
18
18
|
message: string;
|
|
19
19
|
};
|
|
20
|
+
export type ServiceListenHost = "127.0.0.1" | "0.0.0.0" | "::";
|
|
21
|
+
export declare const isServiceListenHost: (value: unknown) => value is ServiceListenHost;
|
|
20
22
|
export declare function defaultServiceUrl(host: string, port: number): string;
|
|
21
23
|
export interface ManagedServerProfile {
|
|
22
24
|
id: string;
|
|
@@ -34,8 +36,13 @@ export interface ManagedServerProfile {
|
|
|
34
36
|
deployedAt?: string;
|
|
35
37
|
remoteRoot?: string;
|
|
36
38
|
serviceUrl?: string;
|
|
39
|
+
allowServiceTunnel?: boolean;
|
|
37
40
|
transport?: "direct" | "ssh";
|
|
38
41
|
serviceError?: string;
|
|
42
|
+
sshError?: string;
|
|
43
|
+
modelError?: string;
|
|
44
|
+
serviceHost?: ServiceListenHost;
|
|
45
|
+
deployedServiceHost?: ServiceListenHost;
|
|
39
46
|
ssh: "offline" | "connecting" | "online" | "needsTrust" | "awaitingVerification";
|
|
40
47
|
service: "unknown" | "offline" | "online";
|
|
41
48
|
modelChannel: "offline" | "online";
|
|
@@ -69,4 +76,5 @@ export interface ManagedServerInput {
|
|
|
69
76
|
passphrase?: string;
|
|
70
77
|
serviceAccessToken?: string;
|
|
71
78
|
serviceUrl?: string;
|
|
79
|
+
serviceHost?: ServiceListenHost;
|
|
72
80
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export const isServiceListenHost = (value) => value === "127.0.0.1" || value === "0.0.0.0" || value === "::";
|
|
1
2
|
export function defaultServiceUrl(host, port) {
|
|
2
3
|
return new URL(`http://${host.includes(":") && !host.startsWith("[") ? `[${host}]` : host}:${port}`).origin;
|
|
3
4
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const SOURCE_LINK_GUIDANCE = "When referencing code locations, use Markdown links with paths relative to your working directory and a line fragment, such as [`function_name`](./src/example.cpp#L397). Do not prefix them with a localhost URL.";
|
|
2
|
+
type Position = {
|
|
3
|
+
path: string;
|
|
4
|
+
line: number;
|
|
5
|
+
column?: number;
|
|
6
|
+
};
|
|
7
|
+
export type SourceLinkScope = {
|
|
8
|
+
root: string;
|
|
9
|
+
cwd: string;
|
|
10
|
+
origin: string;
|
|
11
|
+
};
|
|
12
|
+
/** Local destinations rejected as browser URLs may still be represented as editor actions. */
|
|
13
|
+
export declare function isLocalSourceDestination(value: string): boolean;
|
|
14
|
+
export declare function resolveMessageSourceLink(value: string, scope: SourceLinkScope): Position | undefined;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export const SOURCE_LINK_GUIDANCE = "When referencing code locations, use Markdown links with paths relative to your working directory and a line fragment, such as [`function_name`](./src/example.cpp#L397). Do not prefix them with a localhost URL.";
|
|
2
|
+
function position(value) {
|
|
3
|
+
const marker = /#L([1-9]\d*)(?:C([1-9]\d*))?(?:-L?[1-9]\d*)?$/i.exec(value)
|
|
4
|
+
?? /:([1-9]\d*)(?::([1-9]\d*))?$/.exec(value);
|
|
5
|
+
if (!marker || marker.index === 0)
|
|
6
|
+
return;
|
|
7
|
+
const line = Number(marker[1]), column = marker[2] ? Number(marker[2]) : undefined;
|
|
8
|
+
if (!Number.isSafeInteger(line) || (column !== undefined && !Number.isSafeInteger(column)))
|
|
9
|
+
return;
|
|
10
|
+
return { path: value.slice(0, marker.index), line, column };
|
|
11
|
+
}
|
|
12
|
+
function sourcePath(raw) {
|
|
13
|
+
try {
|
|
14
|
+
const path = decodeURIComponent(raw).replaceAll("\\", "/");
|
|
15
|
+
if (!path || path.startsWith("//") || /[\u0000-\u001f\u007f?#]/.test(path) || /:/.test(path.replace(/^[a-z]:\//i, "")))
|
|
16
|
+
return;
|
|
17
|
+
const name = path.split("/").at(-1) ?? "";
|
|
18
|
+
if (!/^(?:[\w.-]*\.[\w.-]+|Makefile|Dockerfile|LICENSE)$/iu.test(name) && !/\.[\p{L}\p{N}_-]+$/u.test(name))
|
|
19
|
+
return;
|
|
20
|
+
return path;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** Local destinations rejected as browser URLs may still be represented as editor actions. */
|
|
27
|
+
export function isLocalSourceDestination(value) {
|
|
28
|
+
const target = position(value);
|
|
29
|
+
return Boolean(target && sourcePath(target.path));
|
|
30
|
+
}
|
|
31
|
+
export function resolveMessageSourceLink(value, scope) {
|
|
32
|
+
let destination = value;
|
|
33
|
+
if (/^https?:\/\//i.test(value)) {
|
|
34
|
+
let url;
|
|
35
|
+
try {
|
|
36
|
+
url = new URL(value);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const legacyLoopback = ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname) && url.port === "3080";
|
|
42
|
+
if (url.username || url.password || url.search || !url.hash || (url.origin !== scope.origin && !legacyLoopback))
|
|
43
|
+
return;
|
|
44
|
+
destination = url.pathname + url.hash;
|
|
45
|
+
}
|
|
46
|
+
const target = position(destination);
|
|
47
|
+
if (!target)
|
|
48
|
+
return;
|
|
49
|
+
const path = sourcePath(target.path);
|
|
50
|
+
if (!path)
|
|
51
|
+
return;
|
|
52
|
+
const root = scope.root.replaceAll("\\", "/").replace(/\/+$/, "");
|
|
53
|
+
const windows = /^[a-z]:\//i.test(root);
|
|
54
|
+
const comparable = (part) => windows ? part.toLowerCase() : part;
|
|
55
|
+
const atRoot = comparable(path).startsWith(comparable(root + "/"));
|
|
56
|
+
if (/^[a-z]:\//i.test(path) && !atRoot)
|
|
57
|
+
return;
|
|
58
|
+
const segments = (atRoot || path.startsWith("/") ? "" : scope.cwd).split("/").filter(Boolean);
|
|
59
|
+
const relative = atRoot ? path.slice(root.length + 1) : path;
|
|
60
|
+
for (const part of relative.split("/")) {
|
|
61
|
+
if (!part || part === ".")
|
|
62
|
+
continue;
|
|
63
|
+
if (part === "..") {
|
|
64
|
+
if (!segments.length)
|
|
65
|
+
return;
|
|
66
|
+
segments.pop();
|
|
67
|
+
}
|
|
68
|
+
else
|
|
69
|
+
segments.push(part);
|
|
70
|
+
}
|
|
71
|
+
return { ...target, path: segments.join("/") };
|
|
72
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evandu/super-pi",
|
|
3
|
-
"
|
|
3
|
+
"superPi": {
|
|
4
|
+
"managedDirectListener": true
|
|
5
|
+
},
|
|
6
|
+
"version": "0.1.271",
|
|
4
7
|
"description": "Web control plane and companion for Pi",
|
|
5
8
|
"license": "MIT",
|
|
6
9
|
"type": "module",
|
|
@@ -50,6 +53,7 @@
|
|
|
50
53
|
"pack:server": "npm run build && node scripts/pack-server.mjs"
|
|
51
54
|
},
|
|
52
55
|
"check:logic": [
|
|
56
|
+
"scripts/remote-listener.test.mjs",
|
|
53
57
|
"scripts/group-member-sessions.test.mjs",
|
|
54
58
|
"scripts/group-member-pi-history.test.mjs",
|
|
55
59
|
"scripts/desktop-relaunch.test.mjs",
|
|
@@ -321,6 +325,7 @@
|
|
|
321
325
|
"scripts/session-reminder-pmo-rights.test.mjs"
|
|
322
326
|
],
|
|
323
327
|
"check:browser": [
|
|
328
|
+
"scripts/message-source-links-browser.test.mjs",
|
|
324
329
|
"scripts/settings-number-drafts-browser.test.mjs",
|
|
325
330
|
"scripts/remote-tool-runtime-browser.test.mjs",
|
|
326
331
|
"scripts/remote-image-paste-browser.test.mjs",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { spawn, execFile } from "node:child_process";
|
|
2
|
-
import { openSync, readFileSync, writeFileSync, renameSync } from "node:fs";
|
|
2
|
+
import { closeSync, openSync, readFileSync, writeFileSync, renameSync } from "node:fs";
|
|
3
|
+
import { createConnection, isIPv6 } from "node:net";
|
|
3
4
|
import { homedir, platform } from "node:os";
|
|
4
5
|
import { join, resolve } from "node:path";
|
|
5
6
|
import { promisify } from "node:util";
|
|
@@ -24,6 +25,9 @@ function savedPort() {
|
|
|
24
25
|
// as an argument and never sets this variable, so the script looked at 3080 and never found the
|
|
25
26
|
// running server it was supposed to replace.
|
|
26
27
|
const port = Number(process.env.SUPER_PI_PORT ?? savedPort() ?? 3080);
|
|
28
|
+
const bindHost = process.env.SUPER_PI_HOST;
|
|
29
|
+
const probeHost = !bindHost || bindHost === "0.0.0.0" ? "127.0.0.1" : bindHost === "::" ? "::1" : bindHost;
|
|
30
|
+
const origin = `http://${isIPv6(probeHost) ? `[${probeHost}]` : probeHost}:${port}`;
|
|
27
31
|
const entry = "dist/server/index.js";
|
|
28
32
|
const allowedEntries = [entry, "src/server/index.ts"];
|
|
29
33
|
/** Compare paths the way Windows reports them. A command line on Windows contains BACKSLASHES
|
|
@@ -32,38 +36,78 @@ const allowedEntries = [entry, "src/server/index.ts"];
|
|
|
32
36
|
const normalisePath = (value) => value.replace(/[\\/]+/g, "/").toLowerCase();
|
|
33
37
|
const waitMs = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
34
38
|
const dataDirectory = process.env.SUPER_PI_DATA_DIR || join(homedir(), '.super-pi');
|
|
39
|
+
const gracefulOnly = process.env.SUPER_PI_RESTART_GRACEFUL_ONLY === "1";
|
|
40
|
+
const expectedVersion = process.env.SUPER_PI_RESTART_EXPECTED_VERSION;
|
|
41
|
+
async function readHealth(timeout) {
|
|
42
|
+
try {
|
|
43
|
+
const response = await fetch(`${origin}/api/health`, { headers: { connection: "close" }, signal: AbortSignal.timeout(timeout) });
|
|
44
|
+
return response.ok ? await response.json() : undefined;
|
|
45
|
+
} catch { return undefined; }
|
|
46
|
+
}
|
|
35
47
|
const releaseRestart = await acquireRestartLock(dataDirectory);
|
|
36
48
|
process.once('exit', releaseRestart);
|
|
37
49
|
// A second helper for this same accepted operation must not restart its healthy successor.
|
|
38
50
|
if (process.env.SUPER_PI_UPDATE_OPERATION_ID) {
|
|
39
51
|
try {
|
|
40
52
|
const operation = JSON.parse(readFileSync(join(dataDirectory, 'update-status.json'), 'utf8'));
|
|
41
|
-
const
|
|
42
|
-
const health = await response.json();
|
|
53
|
+
const health = await readHealth(1500);
|
|
43
54
|
let finished;
|
|
44
55
|
try { finished = JSON.parse(readFileSync(join(dataDirectory, 'restart-service-completed.json'), 'utf8')); } catch {}
|
|
45
|
-
if (
|
|
56
|
+
if (health?.service === 'super-pi' && operation.id === process.env.SUPER_PI_UPDATE_OPERATION_ID && (operation.phase === 'completed' || finished?.id === operation.id && finished.version === operation.targetVersion) && health.runningVersion === operation.targetVersion) process.exit(0);
|
|
46
57
|
} catch { /* No healthy successor yet; this helper owns recovery. */ }
|
|
47
58
|
}
|
|
48
59
|
async function pidsOnPort() {
|
|
49
60
|
if (platform() === "win32") {
|
|
50
61
|
const { stdout } = await execFileAsync("netstat", ["-ano", "-p", "TCP"]);
|
|
51
|
-
return [...new Set(stdout.split(/\r?\n/).
|
|
62
|
+
return [...new Set(stdout.split(/\r?\n/).map(line => line.trim().split(/\s+/)).filter(([, local, , state]) => state === "LISTENING" && local.endsWith(`:${port}`)).map(fields => fields.at(-1)))];
|
|
52
63
|
}
|
|
53
64
|
try { const { stdout } = await execFileAsync("lsof", ["-nP", `-iTCP:${port}`, "-sTCP:LISTEN", "-t"]); return stdout.trim().split(/\s+/).filter(Boolean); }
|
|
54
|
-
catch
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (error.code === 1 && !error.stdout?.trim() && !error.stderr?.trim()) return [];
|
|
67
|
+
if (platform() !== "linux") throw error;
|
|
68
|
+
const { stdout } = await execFileAsync("ss", ["-lptn", "sport", "=", `:${port}`]);
|
|
69
|
+
return [...new Set([...stdout.matchAll(/pid=(\d+)/g)].map((match) => match[1]))];
|
|
70
|
+
}
|
|
55
71
|
}
|
|
56
72
|
async function commandLine(pid) {
|
|
57
73
|
return readProcessCommandLine(pid);
|
|
58
74
|
}
|
|
59
75
|
async function requestShutdown() {
|
|
60
|
-
const headers = {};
|
|
76
|
+
const headers = { connection: "close" };
|
|
61
77
|
if (process.env.SUPER_PI_ACCESS_TOKEN) headers.authorization = `Bearer ${process.env.SUPER_PI_ACCESS_TOKEN}`;
|
|
62
|
-
try { return (await fetch(
|
|
78
|
+
try { return (await fetch(`${origin}/api/shutdown`, { method: "POST", headers, signal: AbortSignal.timeout(2000) })).status; }
|
|
63
79
|
catch { return null; }
|
|
64
80
|
}
|
|
65
81
|
async function waitForPortRelease(timeoutMs) {
|
|
66
|
-
|
|
82
|
+
const deadline = Date.now() + timeoutMs;
|
|
83
|
+
do { if (!(await pidsOnPort()).length) return true; await waitMs(100); } while (Date.now() < deadline);
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function portReleased() {
|
|
88
|
+
return new Promise(resolve => {
|
|
89
|
+
const socket = createConnection({ host: probeHost, port });
|
|
90
|
+
socket.setTimeout(1000);
|
|
91
|
+
const done = released => { socket.destroy(); resolve(released); };
|
|
92
|
+
socket.once("error", error => done(error.code === "ECONNREFUSED"));
|
|
93
|
+
socket.once("connect", () => done(false));
|
|
94
|
+
socket.once("timeout", () => done(false));
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function stopGracefully() {
|
|
99
|
+
if (await portReleased()) return true;
|
|
100
|
+
const health = await readHealth(2000);
|
|
101
|
+
if (health?.service !== "super-pi") {
|
|
102
|
+
console.error(`Port ${port} is occupied by a service that did not identify itself as Super Pi.`);
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
const status = await requestShutdown();
|
|
106
|
+
if (status >= 200 && status < 300) {
|
|
107
|
+
const deadline = Date.now() + 20_000;
|
|
108
|
+
do { if (await portReleased()) return true; await waitMs(200); } while (Date.now() < deadline);
|
|
109
|
+
}
|
|
110
|
+
console.error(`Super Pi did not release port ${port} after a graceful shutdown request (HTTP ${status ?? "no response"}).`);
|
|
67
111
|
return false;
|
|
68
112
|
}
|
|
69
113
|
// On Windows a detached, console-less node.exe has no window to receive WM_CLOSE, so plain
|
|
@@ -75,12 +119,12 @@ async function forceKill(pid) {
|
|
|
75
119
|
}
|
|
76
120
|
async function stopConflicts() {
|
|
77
121
|
const pids = await pidsOnPort(); if (!pids.length) { console.log(`Port ${port} is free.`); return true; }
|
|
78
|
-
for (const pid of pids) { const cmd = await commandLine(pid);
|
|
122
|
+
for (const pid of pids) { const cmd = await commandLine(pid); if (!allowedEntries.some((candidate) => normalisePath(cmd).includes(normalisePath(candidate)))) { console.error(`Refusing to stop non-Super Pi process on port ${port} (PID ${pid}).`); return false; } }
|
|
79
123
|
const status = await requestShutdown();
|
|
80
124
|
if (status !== null && status >= 200 && status < 300) {
|
|
81
125
|
console.log(`Graceful shutdown accepted (HTTP ${status}); waiting for port ${port} to release...`);
|
|
82
126
|
if (await waitForPortRelease(3000)) { console.log(`Port ${port} released after graceful shutdown.`); return true; }
|
|
83
|
-
console.log(`Graceful shutdown did not release port ${port}
|
|
127
|
+
console.log(`Graceful shutdown did not release port ${port} in time.`);
|
|
84
128
|
} else {
|
|
85
129
|
console.log(`Graceful shutdown unavailable (HTTP ${status ?? "no response"}); the running server may predate the shutdown endpoint.`);
|
|
86
130
|
}
|
|
@@ -88,11 +132,19 @@ async function stopConflicts() {
|
|
|
88
132
|
if (await waitForPortRelease(2000)) { console.log(`Port ${port} released after force kill.`); return true; }
|
|
89
133
|
console.error(`Port ${port} is still occupied after force kill.`); process.exitCode = 1; return false;
|
|
90
134
|
}
|
|
91
|
-
if (await
|
|
135
|
+
if (!await (gracefulOnly ? stopGracefully() : stopConflicts())) process.exit(2);
|
|
92
136
|
console.log(`Starting ${entry} on port ${port}...`);
|
|
93
137
|
const logPath = process.env.SUPER_PI_LOG ?? "restart-server.log";
|
|
94
138
|
const logFd = openSync(logPath, "a");
|
|
95
|
-
const
|
|
139
|
+
const serverEnv = { ...process.env };
|
|
140
|
+
delete serverEnv.SUPER_PI_RESTART_EXPECTED_VERSION;
|
|
141
|
+
delete serverEnv.SUPER_PI_RESTART_GRACEFUL_ONLY;
|
|
142
|
+
delete serverEnv.SUPER_PI_UPDATE_OPERATION_ID;
|
|
143
|
+
let child;
|
|
144
|
+
try { child = spawn(process.execPath, [entry], { stdio: ["ignore", logFd, logFd], detached: true, env: serverEnv, windowsHide: true }); }
|
|
145
|
+
finally { closeSync(logFd); }
|
|
146
|
+
let startupError;
|
|
147
|
+
child.once("error", error => { startupError = error.message; });
|
|
96
148
|
child.unref();
|
|
97
149
|
// HOW LONG THE NEW SERVER MAY TAKE TO BECOME REACHABLE.
|
|
98
150
|
//
|
|
@@ -108,17 +160,18 @@ child.unref();
|
|
|
108
160
|
const READINESS_BUDGET_MS = 120000;
|
|
109
161
|
const deadline = Date.now() + READINESS_BUDGET_MS;
|
|
110
162
|
while (Date.now() < deadline) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const file = join(dataDirectory, 'restart-service-completed.json'), temporary = `${file}.${process.pid}.tmp`;
|
|
117
|
-
writeFileSync(temporary, JSON.stringify({ id: process.env.SUPER_PI_UPDATE_OPERATION_ID, version: body.runningVersion })); renameSync(temporary, file);
|
|
118
|
-
}
|
|
119
|
-
console.log("Server ready: /api/health passed."); process.exit(0);
|
|
163
|
+
const body = await readHealth(2_000);
|
|
164
|
+
if (body?.status === "ok" && body.service === "super-pi" && (!expectedVersion || body.runningVersion === expectedVersion)) {
|
|
165
|
+
if (process.env.SUPER_PI_UPDATE_OPERATION_ID) {
|
|
166
|
+
const file = join(dataDirectory, 'restart-service-completed.json'), temporary = `${file}.${process.pid}.tmp`;
|
|
167
|
+
writeFileSync(temporary, JSON.stringify({ id: process.env.SUPER_PI_UPDATE_OPERATION_ID, version: body.runningVersion })); renameSync(temporary, file);
|
|
120
168
|
}
|
|
121
|
-
|
|
169
|
+
console.log("Server ready: /api/health passed."); process.exit(0);
|
|
170
|
+
}
|
|
171
|
+
if (startupError || child.exitCode !== null || child.signalCode !== null) {
|
|
172
|
+
console.error(`Server exited before becoming ready (${startupError ?? child.exitCode ?? child.signalCode}). See ${logPath}.`);
|
|
173
|
+
process.exit(1);
|
|
174
|
+
}
|
|
122
175
|
await waitMs(200);
|
|
123
176
|
}
|
|
124
177
|
console.error(`Server did not become reachable within ${READINESS_BUDGET_MS}ms. It is STILL RUNNING - do not kill it, a slow start still ends up serving. See ${logPath}:`); try { console.error(readFileSync(logPath, "utf8").slice(-8000)); } catch {}
|