blun-king-cli 9.1.30 → 9.1.31
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/README.md +1 -1
- package/bin/launcher-runtime.js +48 -2
- package/bin/managed-node.js +150 -0
- package/bin/node-runtime.js +33 -0
- package/bin/node-version.js +47 -0
- package/blun.mjs +172 -120
- package/package.json +1 -1
package/README.md
CHANGED
package/bin/launcher-runtime.js
CHANGED
|
@@ -22,6 +22,7 @@ const {
|
|
|
22
22
|
seedStandardTools,
|
|
23
23
|
} = require('./standard-tools-bootstrap');
|
|
24
24
|
const { CORE_LOADED_MESSAGE } = require('./core-bootstrap');
|
|
25
|
+
const { prepareManagedNodeRuntime } = require('./node-runtime');
|
|
25
26
|
const { acquireSharedRuntimeLease, tryAcquireUpdateLease } = require('./update-lease');
|
|
26
27
|
const { runExplicitUpdate, runUpdateNotice } = require('./update-notice');
|
|
27
28
|
const {
|
|
@@ -182,6 +183,33 @@ function installTelegramForProfile(packageRoot, blunDir) {
|
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
|
|
186
|
+
function spawnManagedLauncher(binary, cwd) {
|
|
187
|
+
return new Promise((resolve, reject) => {
|
|
188
|
+
const child = spawn(binary, process.argv.slice(1), {
|
|
189
|
+
cwd,
|
|
190
|
+
env: process.env,
|
|
191
|
+
stdio: 'inherit',
|
|
192
|
+
windowsHide: true,
|
|
193
|
+
});
|
|
194
|
+
child.once('error', reject);
|
|
195
|
+
child.once('exit', (code, signal) => {
|
|
196
|
+
if (Number.isInteger(code)) {
|
|
197
|
+
resolve(code);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (signal === 'SIGINT') {
|
|
201
|
+
resolve(130);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (signal === 'SIGTERM') {
|
|
205
|
+
resolve(143);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
resolve(1);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
185
213
|
async function runLauncher(options = {}) {
|
|
186
214
|
const callerCwd = process.cwd();
|
|
187
215
|
const mode = options.mode || launcherModeFromArgv(process.argv);
|
|
@@ -278,6 +306,20 @@ async function runLauncher(options = {}) {
|
|
|
278
306
|
return;
|
|
279
307
|
}
|
|
280
308
|
|
|
309
|
+
const privatePaths = resolveLauncherPrivatePaths();
|
|
310
|
+
const nodeRuntime = await prepareManagedNodeRuntime({ blunDir: privatePaths.blunHome });
|
|
311
|
+
if (nodeRuntime.kind === 'failed') {
|
|
312
|
+
process.stderr.write(`${nodeRuntime.message}\n`);
|
|
313
|
+
process.exitCode = 1;
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
if (nodeRuntime.kind === 'managed') {
|
|
317
|
+
process.stdout.write('BLUN hat die passende Node.js-Laufzeit eingerichtet.\n');
|
|
318
|
+
await releaseNotice();
|
|
319
|
+
process.exitCode = await spawnManagedLauncher(nodeRuntime.binary, callerCwd);
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
|
|
281
323
|
if (ARGS.some((arg) => arg === '--help' || arg === '-h')) {
|
|
282
324
|
process.stdout.write(launcherHelpText());
|
|
283
325
|
const env = createLauncherEnvironment(process.env, mode, readPackageVersion());
|
|
@@ -288,7 +330,6 @@ async function runLauncher(options = {}) {
|
|
|
288
330
|
return;
|
|
289
331
|
}
|
|
290
332
|
|
|
291
|
-
const privatePaths = resolveLauncherPrivatePaths();
|
|
292
333
|
const blunDir = privatePaths.blunHome;
|
|
293
334
|
ensurePrivateDirectory(blunDir);
|
|
294
335
|
|
|
@@ -356,4 +397,9 @@ async function runLauncher(options = {}) {
|
|
|
356
397
|
}
|
|
357
398
|
}
|
|
358
399
|
|
|
359
|
-
module.exports = {
|
|
400
|
+
module.exports = {
|
|
401
|
+
resolveLauncherPrivatePaths,
|
|
402
|
+
runLauncher,
|
|
403
|
+
shouldDetachProtectedCore,
|
|
404
|
+
spawnManagedLauncher,
|
|
405
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const crypto = require('node:crypto');
|
|
4
|
+
const fs = require('node:fs');
|
|
5
|
+
const https = require('node:https');
|
|
6
|
+
const os = require('node:os');
|
|
7
|
+
const path = require('node:path');
|
|
8
|
+
const { spawnSync } = require('node:child_process');
|
|
9
|
+
|
|
10
|
+
const NODE_VERSION = '24.15.0';
|
|
11
|
+
const MAX_ARCHIVE_BYTES = 100 * 1024 * 1024;
|
|
12
|
+
const DISTRIBUTIONS = {
|
|
13
|
+
'darwin-arm64': {
|
|
14
|
+
archive: `node-v${NODE_VERSION}-darwin-arm64.tar.gz`,
|
|
15
|
+
sha256: '372331b969779ab5d15b949884fc6eaf88d5afe87bde8ba881d6400b9100ffc4',
|
|
16
|
+
},
|
|
17
|
+
'darwin-x64': {
|
|
18
|
+
archive: `node-v${NODE_VERSION}-darwin-x64.tar.gz`,
|
|
19
|
+
sha256: 'ffd5ee293467927f3ee731a553eb88fd1f48cf74eebc2d74a6babe4af228673b',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function distributionFor(platform, arch) {
|
|
24
|
+
return DISTRIBUTIONS[`${platform}-${arch}`] || null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function sha256File(file) {
|
|
28
|
+
const hash = crypto.createHash('sha256');
|
|
29
|
+
hash.update(fs.readFileSync(file));
|
|
30
|
+
return hash.digest('hex');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function downloadFile(url, destination, redirectsLeft = 3) {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
const request = https.get(url, { timeout: 30_000 }, (response) => {
|
|
36
|
+
if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) {
|
|
37
|
+
response.resume();
|
|
38
|
+
if (redirectsLeft <= 0) {
|
|
39
|
+
reject(new Error('Zu viele Weiterleitungen beim Node.js-Download.'));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const redirect = new URL(response.headers.location, url);
|
|
43
|
+
if (redirect.protocol !== 'https:') {
|
|
44
|
+
reject(new Error('Unsichere Weiterleitung beim Node.js-Download abgelehnt.'));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
downloadFile(redirect.href, destination, redirectsLeft - 1).then(resolve, reject);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (response.statusCode !== 200) {
|
|
52
|
+
response.resume();
|
|
53
|
+
reject(new Error(`Node.js-Download antwortete mit HTTP ${response.statusCode}.`));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const contentLength = Number(response.headers['content-length'] || 0);
|
|
58
|
+
if (contentLength > MAX_ARCHIVE_BYTES) {
|
|
59
|
+
response.destroy();
|
|
60
|
+
reject(new Error('Node.js-Download ist groesser als erwartet.'));
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
let received = 0;
|
|
65
|
+
const output = fs.createWriteStream(destination, { flags: 'wx' });
|
|
66
|
+
response.on('data', (chunk) => {
|
|
67
|
+
received += chunk.length;
|
|
68
|
+
if (received > MAX_ARCHIVE_BYTES) {
|
|
69
|
+
response.destroy(new Error('Node.js-Download ist groesser als erwartet.'));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
response.on('error', reject);
|
|
73
|
+
output.on('error', reject);
|
|
74
|
+
output.on('finish', () => output.close(resolve));
|
|
75
|
+
response.pipe(output);
|
|
76
|
+
});
|
|
77
|
+
request.on('error', reject);
|
|
78
|
+
request.on('timeout', () => request.destroy(new Error('Zeitlimit beim Node.js-Download erreicht.')));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function usableNode(binary) {
|
|
83
|
+
if (!fs.existsSync(binary)) return false;
|
|
84
|
+
const result = spawnSync(binary, ['--version'], { encoding: 'utf8', timeout: 5_000 });
|
|
85
|
+
return result.status === 0 && result.stdout.trim() === `v${NODE_VERSION}`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function ensureManagedNode(blunHome, platform, arch) {
|
|
89
|
+
const distribution = distributionFor(platform, arch);
|
|
90
|
+
if (!distribution) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
`Automatische Node.js-Einrichtung wird fuer ${platform}-${arch} noch nicht unterstuetzt.`,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const installDir = path.join(
|
|
97
|
+
blunHome,
|
|
98
|
+
'runtime',
|
|
99
|
+
'node',
|
|
100
|
+
`v${NODE_VERSION}-${platform}-${arch}`,
|
|
101
|
+
);
|
|
102
|
+
const binary = path.join(installDir, 'bin', 'node');
|
|
103
|
+
if (usableNode(binary)) return binary;
|
|
104
|
+
|
|
105
|
+
const staging = fs.mkdtempSync(path.join(os.tmpdir(), 'blun-node-runtime-'));
|
|
106
|
+
try {
|
|
107
|
+
const archive = path.join(staging, distribution.archive);
|
|
108
|
+
await downloadFile(
|
|
109
|
+
`https://nodejs.org/dist/v${NODE_VERSION}/${distribution.archive}`,
|
|
110
|
+
archive,
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const actualSha = sha256File(archive);
|
|
114
|
+
if (actualSha !== distribution.sha256) {
|
|
115
|
+
throw new Error('Die SHA-256-Pruefsumme der Node.js-Laufzeit stimmt nicht.');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const extractedName = distribution.archive.slice(0, -'.tar.gz'.length);
|
|
119
|
+
const extractedDir = path.join(staging, extractedName);
|
|
120
|
+
const unpacked = spawnSync('/usr/bin/tar', ['-xzf', archive, '-C', staging], {
|
|
121
|
+
encoding: 'utf8',
|
|
122
|
+
timeout: 120_000,
|
|
123
|
+
});
|
|
124
|
+
if (unpacked.status !== 0 || !usableNode(path.join(extractedDir, 'bin', 'node'))) {
|
|
125
|
+
const detail = (unpacked.stderr || '').trim();
|
|
126
|
+
throw new Error(
|
|
127
|
+
`Die Node.js-Laufzeit konnte nicht entpackt werden${detail ? `: ${detail}` : '.'}`,
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
fs.mkdirSync(path.dirname(installDir), { recursive: true });
|
|
132
|
+
if (usableNode(binary)) return binary;
|
|
133
|
+
fs.rmSync(installDir, { recursive: true, force: true });
|
|
134
|
+
fs.renameSync(extractedDir, installDir);
|
|
135
|
+
if (!usableNode(binary)) throw new Error('Die installierte Node.js-Laufzeit startet nicht.');
|
|
136
|
+
return binary;
|
|
137
|
+
} finally {
|
|
138
|
+
fs.rmSync(staging, { recursive: true, force: true });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
module.exports = {
|
|
143
|
+
DISTRIBUTIONS,
|
|
144
|
+
MAX_ARCHIVE_BYTES,
|
|
145
|
+
NODE_VERSION,
|
|
146
|
+
distributionFor,
|
|
147
|
+
ensureManagedNode,
|
|
148
|
+
sha256File,
|
|
149
|
+
usableNode,
|
|
150
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { ensureManagedNode } = require('./managed-node');
|
|
4
|
+
const { unsupportedNodeMessage } = require('./node-version');
|
|
5
|
+
|
|
6
|
+
async function prepareManagedNodeRuntime(options = {}) {
|
|
7
|
+
const version = options.version || process.versions.node;
|
|
8
|
+
const platform = options.platform || process.platform;
|
|
9
|
+
const arch = options.arch || process.arch;
|
|
10
|
+
const message = unsupportedNodeMessage(version, platform);
|
|
11
|
+
if (message === null) return { kind: 'current' };
|
|
12
|
+
if (platform !== 'darwin') return { kind: 'failed', message };
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const binary = await (options.ensureManagedNode || ensureManagedNode)(
|
|
16
|
+
options.blunDir,
|
|
17
|
+
platform,
|
|
18
|
+
arch,
|
|
19
|
+
);
|
|
20
|
+
return { binary, kind: 'managed' };
|
|
21
|
+
} catch (error) {
|
|
22
|
+
return {
|
|
23
|
+
kind: 'failed',
|
|
24
|
+
message: [
|
|
25
|
+
'Die automatische Node.js-Einrichtung ist fehlgeschlagen.',
|
|
26
|
+
error && error.message ? error.message : String(error),
|
|
27
|
+
message,
|
|
28
|
+
].join('\n'),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports = { prepareManagedNodeRuntime };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const MINIMUM_NODE_VERSION = '24.15.0';
|
|
4
|
+
|
|
5
|
+
function parseNodeVersion(version) {
|
|
6
|
+
const match = /^(\d+)\.(\d+)\.(\d+)/.exec(String(version));
|
|
7
|
+
return match ? match.slice(1).map(Number) : null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function supportsNodeVersion(version) {
|
|
11
|
+
const actual = parseNodeVersion(version);
|
|
12
|
+
const minimum = parseNodeVersion(MINIMUM_NODE_VERSION);
|
|
13
|
+
if (!actual || !minimum) return false;
|
|
14
|
+
|
|
15
|
+
for (let index = 0; index < minimum.length; index += 1) {
|
|
16
|
+
if (actual[index] > minimum[index]) return true;
|
|
17
|
+
if (actual[index] < minimum[index]) return false;
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function unsupportedNodeMessage(version, platform) {
|
|
23
|
+
if (supportsNodeVersion(version)) return null;
|
|
24
|
+
|
|
25
|
+
const lines = [
|
|
26
|
+
'',
|
|
27
|
+
'BLUN kann mit dieser Node.js-Version nicht starten.',
|
|
28
|
+
`Installiert: Node.js ${version}`,
|
|
29
|
+
`Benoetigt: Node.js ${MINIMUM_NODE_VERSION} oder neuer`,
|
|
30
|
+
'',
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
if (platform === 'darwin') {
|
|
34
|
+
lines.push(`Falls die automatische Einrichtung scheitert: nvm install ${MINIMUM_NODE_VERSION}`);
|
|
35
|
+
} else {
|
|
36
|
+
lines.push(`Node.js ${MINIMUM_NODE_VERSION} oder neuer installieren: https://nodejs.org/`);
|
|
37
|
+
}
|
|
38
|
+
lines.push('Danach BLUN aktualisieren: npm i -g blun-king-cli@latest', '');
|
|
39
|
+
return lines.join('\n');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
module.exports = {
|
|
43
|
+
MINIMUM_NODE_VERSION,
|
|
44
|
+
parseNodeVersion,
|
|
45
|
+
supportsNodeVersion,
|
|
46
|
+
unsupportedNodeMessage,
|
|
47
|
+
};
|
package/blun.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// BLUN_BUILD_INPUT_SHA256:
|
|
2
|
+
// BLUN_BUILD_INPUT_SHA256:a7df37740da4f38cdb11b51de60021135cbc55aec8643f9501c9c946c3b67c0b
|
|
3
3
|
import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
|
|
4
4
|
import { dirname as __cjsShimDirname } from 'node:path';
|
|
5
5
|
const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __cjsShimDirname(__filename);
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import crypto$1, { createHash, randomBytes, randomInt, randomUUID, timingSafeEqual } from "node:crypto";
|
|
9
|
-
import * as fs$
|
|
9
|
+
import * as fs$16 from "node:fs";
|
|
10
10
|
import Kt, { accessSync, appendFileSync, chmodSync, closeSync, constants, copyFileSync, createReadStream, createWriteStream, existsSync, fsyncSync, linkSync, lstatSync, mkdirSync, openSync, promises, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
11
11
|
import * as path$17 from "node:path";
|
|
12
12
|
import path, { basename, dirname, extname, isAbsolute, join, normalize, posix, relative, resolve, sep, win32 } from "node:path";
|
|
13
13
|
import { Blob as Blob$1, Buffer as Buffer$1, File as File$1 } from "node:buffer";
|
|
14
14
|
import * as nodeOs from "node:os";
|
|
15
15
|
import os, { arch, homedir, hostname, networkInterfaces, platform, release, tmpdir, type, userInfo } from "node:os";
|
|
16
|
-
import
|
|
16
|
+
import ro, { access, appendFile, chmod, constants as constants$1, copyFile, cp, link, lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
17
17
|
import { execFile, execFileSync, execSync, spawn, spawnSync } from "node:child_process";
|
|
18
18
|
import * as sysPath from "path";
|
|
19
19
|
import path$1, { basename as basename$1, dirname as dirname$1, join as join$1, parse } from "path";
|
|
@@ -2072,11 +2072,11 @@ var init_blun_files = __esmMin((() => {
|
|
|
2072
2072
|
async uploadVideo(input, options) {
|
|
2073
2073
|
let file;
|
|
2074
2074
|
if (typeof input === "string") {
|
|
2075
|
-
if (!fs$
|
|
2075
|
+
if (!fs$16.existsSync(input)) throw new ChatProviderError(`Video file not found: ${input}`);
|
|
2076
2076
|
const filename = path$17.basename(input);
|
|
2077
2077
|
const mimeType = guessMimeTypeFromExt(filename);
|
|
2078
2078
|
if (mimeType === void 0 || !mimeType.startsWith("video/")) throw new ChatProviderError(`BlunFiles.uploadVideo: file extension does not indicate a video type: ${filename}`);
|
|
2079
|
-
const data = await fs$
|
|
2079
|
+
const data = await fs$16.promises.readFile(input);
|
|
2080
2080
|
file = new File$1([new Blob$1([new Uint8Array(data)], { type: mimeType })], filename, { type: mimeType });
|
|
2081
2081
|
} else {
|
|
2082
2082
|
if (!input.mimeType.startsWith("video/")) throw new ChatProviderError(`Expected a video mime type, got ${input.mimeType}`);
|
|
@@ -11432,7 +11432,7 @@ var require_clone$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11432
11432
|
//#endregion
|
|
11433
11433
|
//#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
11434
11434
|
var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11435
|
-
var fs$
|
|
11435
|
+
var fs$15 = __require("fs");
|
|
11436
11436
|
var polyfills = require_polyfills();
|
|
11437
11437
|
var legacy = require_legacy_streams();
|
|
11438
11438
|
var clone = require_clone$1();
|
|
@@ -11461,36 +11461,36 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11461
11461
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
11462
11462
|
console.error(m);
|
|
11463
11463
|
};
|
|
11464
|
-
if (!fs$
|
|
11465
|
-
publishQueue(fs$
|
|
11466
|
-
fs$
|
|
11464
|
+
if (!fs$15[gracefulQueue]) {
|
|
11465
|
+
publishQueue(fs$15, global[gracefulQueue] || []);
|
|
11466
|
+
fs$15.close = (function(fs$close) {
|
|
11467
11467
|
function close(fd, cb) {
|
|
11468
|
-
return fs$close.call(fs$
|
|
11468
|
+
return fs$close.call(fs$15, fd, function(err) {
|
|
11469
11469
|
if (!err) resetQueue();
|
|
11470
11470
|
if (typeof cb === "function") cb.apply(this, arguments);
|
|
11471
11471
|
});
|
|
11472
11472
|
}
|
|
11473
11473
|
Object.defineProperty(close, previousSymbol, { value: fs$close });
|
|
11474
11474
|
return close;
|
|
11475
|
-
})(fs$
|
|
11476
|
-
fs$
|
|
11475
|
+
})(fs$15.close);
|
|
11476
|
+
fs$15.closeSync = (function(fs$closeSync) {
|
|
11477
11477
|
function closeSync(fd) {
|
|
11478
|
-
fs$closeSync.apply(fs$
|
|
11478
|
+
fs$closeSync.apply(fs$15, arguments);
|
|
11479
11479
|
resetQueue();
|
|
11480
11480
|
}
|
|
11481
11481
|
Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync });
|
|
11482
11482
|
return closeSync;
|
|
11483
|
-
})(fs$
|
|
11483
|
+
})(fs$15.closeSync);
|
|
11484
11484
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
|
|
11485
|
-
debug(fs$
|
|
11486
|
-
__require("assert").equal(fs$
|
|
11485
|
+
debug(fs$15[gracefulQueue]);
|
|
11486
|
+
__require("assert").equal(fs$15[gracefulQueue].length, 0);
|
|
11487
11487
|
});
|
|
11488
11488
|
}
|
|
11489
|
-
if (!global[gracefulQueue]) publishQueue(global, fs$
|
|
11490
|
-
module.exports = patch(clone(fs$
|
|
11491
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$
|
|
11492
|
-
module.exports = patch(fs$
|
|
11493
|
-
fs$
|
|
11489
|
+
if (!global[gracefulQueue]) publishQueue(global, fs$15[gracefulQueue]);
|
|
11490
|
+
module.exports = patch(clone(fs$15));
|
|
11491
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$15.__patched) {
|
|
11492
|
+
module.exports = patch(fs$15);
|
|
11493
|
+
fs$15.__patched = true;
|
|
11494
11494
|
}
|
|
11495
11495
|
function patch(fs) {
|
|
11496
11496
|
polyfills(fs);
|
|
@@ -11745,23 +11745,23 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11745
11745
|
}
|
|
11746
11746
|
function enqueue(elem) {
|
|
11747
11747
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
11748
|
-
fs$
|
|
11748
|
+
fs$15[gracefulQueue].push(elem);
|
|
11749
11749
|
retry();
|
|
11750
11750
|
}
|
|
11751
11751
|
var retryTimer;
|
|
11752
11752
|
function resetQueue() {
|
|
11753
11753
|
var now = Date.now();
|
|
11754
|
-
for (var i = 0; i < fs$
|
|
11755
|
-
fs$
|
|
11756
|
-
fs$
|
|
11754
|
+
for (var i = 0; i < fs$15[gracefulQueue].length; ++i) if (fs$15[gracefulQueue][i].length > 2) {
|
|
11755
|
+
fs$15[gracefulQueue][i][3] = now;
|
|
11756
|
+
fs$15[gracefulQueue][i][4] = now;
|
|
11757
11757
|
}
|
|
11758
11758
|
retry();
|
|
11759
11759
|
}
|
|
11760
11760
|
function retry() {
|
|
11761
11761
|
clearTimeout(retryTimer);
|
|
11762
11762
|
retryTimer = void 0;
|
|
11763
|
-
if (fs$
|
|
11764
|
-
var elem = fs$
|
|
11763
|
+
if (fs$15[gracefulQueue].length === 0) return;
|
|
11764
|
+
var elem = fs$15[gracefulQueue].shift();
|
|
11765
11765
|
var fn = elem[0];
|
|
11766
11766
|
var args = elem[1];
|
|
11767
11767
|
var err = elem[2];
|
|
@@ -11780,7 +11780,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11780
11780
|
if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
|
|
11781
11781
|
debug("RETRY", fn.name, args);
|
|
11782
11782
|
fn.apply(null, args.concat([startTime]));
|
|
11783
|
-
} else fs$
|
|
11783
|
+
} else fs$15[gracefulQueue].push(elem);
|
|
11784
11784
|
}
|
|
11785
11785
|
if (retryTimer === void 0) retryTimer = setTimeout(retry, 0);
|
|
11786
11786
|
}
|
|
@@ -14616,7 +14616,7 @@ async function syncDir(dirPath) {
|
|
|
14616
14616
|
*/
|
|
14617
14617
|
function syncFd(fd) {
|
|
14618
14618
|
return new Promise((resolve, reject) => {
|
|
14619
|
-
fs$
|
|
14619
|
+
fs$16.fsync(fd, (err) => {
|
|
14620
14620
|
if (err) {
|
|
14621
14621
|
reject(err);
|
|
14622
14622
|
return;
|
|
@@ -26793,7 +26793,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
26793
26793
|
};
|
|
26794
26794
|
return _setPrototypeOf(o, p);
|
|
26795
26795
|
}
|
|
26796
|
-
var fs$
|
|
26796
|
+
var fs$14 = __require("fs");
|
|
26797
26797
|
var path$14 = __require("path");
|
|
26798
26798
|
var Loader = require_loader();
|
|
26799
26799
|
var PrecompiledLoader = require_precompiled_loader().PrecompiledLoader;
|
|
@@ -26817,7 +26817,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
26817
26817
|
} catch (e) {
|
|
26818
26818
|
throw new Error("watch requires chokidar to be installed");
|
|
26819
26819
|
}
|
|
26820
|
-
var paths = _this.searchPaths.filter(fs$
|
|
26820
|
+
var paths = _this.searchPaths.filter(fs$14.existsSync);
|
|
26821
26821
|
var watcher = chokidar.watch(paths);
|
|
26822
26822
|
watcher.on("all", function(event, fullname) {
|
|
26823
26823
|
fullname = path$14.resolve(fullname);
|
|
@@ -26836,7 +26836,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
26836
26836
|
for (var i = 0; i < paths.length; i++) {
|
|
26837
26837
|
var basePath = path$14.resolve(paths[i]);
|
|
26838
26838
|
var p = path$14.resolve(paths[i], name);
|
|
26839
|
-
if (p.indexOf(basePath) === 0 && fs$
|
|
26839
|
+
if (p.indexOf(basePath) === 0 && fs$14.existsSync(p)) {
|
|
26840
26840
|
fullpath = p;
|
|
26841
26841
|
break;
|
|
26842
26842
|
}
|
|
@@ -26844,7 +26844,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
26844
26844
|
if (!fullpath) return null;
|
|
26845
26845
|
this.pathsToNames[fullpath] = name;
|
|
26846
26846
|
var source = {
|
|
26847
|
-
src: fs$
|
|
26847
|
+
src: fs$14.readFileSync(fullpath, "utf-8"),
|
|
26848
26848
|
path: fullpath,
|
|
26849
26849
|
noCache: this.noCache
|
|
26850
26850
|
};
|
|
@@ -26892,7 +26892,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
26892
26892
|
}
|
|
26893
26893
|
this.pathsToNames[fullpath] = name;
|
|
26894
26894
|
var source = {
|
|
26895
|
-
src: fs$
|
|
26895
|
+
src: fs$14.readFileSync(fullpath, "utf-8"),
|
|
26896
26896
|
path: fullpath,
|
|
26897
26897
|
noCache: this.noCache
|
|
26898
26898
|
};
|
|
@@ -27636,7 +27636,7 @@ var require_precompile_global = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
27636
27636
|
//#endregion
|
|
27637
27637
|
//#region ../../node_modules/.pnpm/nunjucks@3.2.4_chokidar@4.0.3/node_modules/nunjucks/src/precompile.js
|
|
27638
27638
|
var require_precompile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
27639
|
-
var fs$
|
|
27639
|
+
var fs$13 = __require("fs");
|
|
27640
27640
|
var path$12 = __require("path");
|
|
27641
27641
|
var _prettifyError = require_lib$7()._prettifyError;
|
|
27642
27642
|
var compiler = require_compiler();
|
|
@@ -27661,27 +27661,27 @@ var require_precompile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
27661
27661
|
var env = opts.env || new Environment([]);
|
|
27662
27662
|
var wrapper = opts.wrapper || precompileGlobal;
|
|
27663
27663
|
if (opts.isString) return precompileString(input, opts);
|
|
27664
|
-
var pathStats = fs$
|
|
27664
|
+
var pathStats = fs$13.existsSync(input) && fs$13.statSync(input);
|
|
27665
27665
|
var precompiled = [];
|
|
27666
27666
|
var templates = [];
|
|
27667
27667
|
function addTemplates(dir) {
|
|
27668
|
-
fs$
|
|
27668
|
+
fs$13.readdirSync(dir).forEach(function(file) {
|
|
27669
27669
|
var filepath = path$12.join(dir, file);
|
|
27670
27670
|
var subpath = filepath.substr(path$12.join(input, "/").length);
|
|
27671
|
-
var stat = fs$
|
|
27671
|
+
var stat = fs$13.statSync(filepath);
|
|
27672
27672
|
if (stat && stat.isDirectory()) {
|
|
27673
27673
|
subpath += "/";
|
|
27674
27674
|
if (!match(subpath, opts.exclude)) addTemplates(filepath);
|
|
27675
27675
|
} else if (match(subpath, opts.include)) templates.push(filepath);
|
|
27676
27676
|
});
|
|
27677
27677
|
}
|
|
27678
|
-
if (pathStats.isFile()) precompiled.push(_precompile(fs$
|
|
27678
|
+
if (pathStats.isFile()) precompiled.push(_precompile(fs$13.readFileSync(input, "utf-8"), opts.name || input, env));
|
|
27679
27679
|
else if (pathStats.isDirectory()) {
|
|
27680
27680
|
addTemplates(input);
|
|
27681
27681
|
for (var i = 0; i < templates.length; i++) {
|
|
27682
27682
|
var name = templates[i].replace(path$12.join(input, "/"), "");
|
|
27683
27683
|
try {
|
|
27684
|
-
precompiled.push(_precompile(fs$
|
|
27684
|
+
precompiled.push(_precompile(fs$13.readFileSync(templates[i], "utf-8"), name, env));
|
|
27685
27685
|
} catch (e) {
|
|
27686
27686
|
if (opts.force) console.error(e);
|
|
27687
27687
|
else throw e;
|
|
@@ -36246,7 +36246,7 @@ var require_gifframe = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36246
36246
|
//#region ../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/gifutil.js
|
|
36247
36247
|
var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
36248
36248
|
/** @namespace GifUtil */
|
|
36249
|
-
const fs$
|
|
36249
|
+
const fs$12 = __require("fs");
|
|
36250
36250
|
const ImageQ = require_image_q();
|
|
36251
36251
|
const BitmapImage = require_bitmapimage();
|
|
36252
36252
|
const { GifFrame } = require_gifframe();
|
|
@@ -36513,7 +36513,7 @@ var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36513
36513
|
}
|
|
36514
36514
|
function _readBinary(path) {
|
|
36515
36515
|
return new Promise((resolve, reject) => {
|
|
36516
|
-
fs$
|
|
36516
|
+
fs$12.readFile(path, (err, buffer) => {
|
|
36517
36517
|
if (err) return reject(err);
|
|
36518
36518
|
return resolve(buffer);
|
|
36519
36519
|
});
|
|
@@ -36521,7 +36521,7 @@ var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
36521
36521
|
}
|
|
36522
36522
|
function _writeBinary(path, buffer) {
|
|
36523
36523
|
return new Promise((resolve, reject) => {
|
|
36524
|
-
fs$
|
|
36524
|
+
fs$12.writeFile(path, buffer, (err) => {
|
|
36525
36525
|
if (err) return reject(err);
|
|
36526
36526
|
return resolve();
|
|
36527
36527
|
});
|
|
@@ -62339,7 +62339,7 @@ var init_file_type = __esmMin((() => {
|
|
|
62339
62339
|
}
|
|
62340
62340
|
async fromFile(path) {
|
|
62341
62341
|
this.options.signal?.throwIfAborted();
|
|
62342
|
-
const fileHandle = await
|
|
62342
|
+
const fileHandle = await ro.open(path, constants.O_RDONLY | constants.O_NONBLOCK);
|
|
62343
62343
|
const fileStat = await fileHandle.stat();
|
|
62344
62344
|
if (!fileStat.isFile()) {
|
|
62345
62345
|
await fileHandle.close();
|
|
@@ -252497,7 +252497,7 @@ function Yn(s, t) {
|
|
|
252497
252497
|
function Kn(s, t) {
|
|
252498
252498
|
s.head = new ue$1(t, void 0, s.head, s), s.tail || (s.tail = s.head), s.length++;
|
|
252499
252499
|
}
|
|
252500
|
-
var zr, Ur, Ds, Wr, Gr, Zr, Q$1, J$1, nt$1, De$1, qt, Ne$1, Ns, Ae$1, As, z$1, Mt, g$1, Qt, Bt, b$1, N$1, _$1, bi, Ie$1, L$1, S, _i, Oi, Is, Ti, Z$1, xi, Ce$1, Jt$1, Rt, C, jt, Yr, Kr, Vr, $r, Fe$1, Li, Xr, qr, A$1, Jr, ht, H$1, te, m$1, Ni, tt$1, Ai, ki, vi, ie$1, ke$1, Ut$1, Ht, Ii, Pt, at, U$1, ot, Y$1, zt, Ci, j$1, ee$1, Fi, ve$1, gt$2, Me, bt, _t, Be$1, et$1, Wt$1, jr, Fs, ks, vs, Ms, Bs, tn, se$1, K$1, sn, M$1, rn, zs, nn, Bi, Tt, Gt, Pi, re, Pe$1, ze$1, Ue, He$1, We$1, Ge$1, Ze$1, Ye$1, Ke$1, Us, hn, an, Hs, ln, cn, Ws, Gs, Hi, ne, dn, Ui, oe$1, Ve$1, un, F$1, mn, xt, Wi, pn, lt, En, wn, Sn, ct, yn, Rn, gn, Gi, bn, Lt, ft, On, Tn, xn, f, $e$1, Dt, Nn, Xi, qi, An, B$1, Nt, it, Zi, Zs, V$1, he$1, dt, Ys, p, st$1, ut, Yi, At, w$1, Xe$1, qe$1, Ki, Ks, Vs, ae$1, Vi, Qe$1, Yt$1, $$1, Je$1, It, je$1, ti, $s, In, le$1, $i, Xs, Cn, rt$1, mt, vn, Qi, Mn, Bn, Ct, Ji, zn, qs, ce$1, ei, ji, Un, Hn, ts, Qs, rr, Wn, tr, er, ir, is$2, sr, fe$1, ii, ss, si, rs, ns, os$6, hs, pt, ri, as, es, q$1, de$1, ni, oi, Gn, hi, ue$1, pi, nr, li, me$1, W$1, pe$2, Et, Ft$1, Ee$1, ai, G, ls, ci, or, ds, us, fi, di, hr, cs, ui, lr, fs$
|
|
252500
|
+
var zr, Ur, Ds, Wr, Gr, Zr, Q$1, J$1, nt$1, De$1, qt, Ne$1, Ns, Ae$1, As, z$1, Mt, g$1, Qt, Bt, b$1, N$1, _$1, bi, Ie$1, L$1, S, _i, Oi, Is, Ti, Z$1, xi, Ce$1, Jt$1, Rt, C, jt, Yr, Kr, Vr, $r, Fe$1, Li, Xr, qr, A$1, Jr, ht, H$1, te, m$1, Ni, tt$1, Ai, ki, vi, ie$1, ke$1, Ut$1, Ht, Ii, Pt, at, U$1, ot, Y$1, zt, Ci, j$1, ee$1, Fi, ve$1, gt$2, Me, bt, _t, Be$1, et$1, Wt$1, jr, Fs, ks, vs, Ms, Bs, tn, se$1, K$1, sn, M$1, rn, zs, nn, Bi, Tt, Gt, Pi, re, Pe$1, ze$1, Ue, He$1, We$1, Ge$1, Ze$1, Ye$1, Ke$1, Us, hn, an, Hs, ln, cn, Ws, Gs, Hi, ne, dn, Ui, oe$1, Ve$1, un, F$1, mn, xt, Wi, pn, lt, En, wn, Sn, ct, yn, Rn, gn, Gi, bn, Lt, ft, On, Tn, xn, f, $e$1, Dt, Nn, Xi, qi, An, B$1, Nt, it, Zi, Zs, V$1, he$1, dt, Ys, p, st$1, ut, Yi, At, w$1, Xe$1, qe$1, Ki, Ks, Vs, ae$1, Vi, Qe$1, Yt$1, $$1, Je$1, It, je$1, ti, $s, In, le$1, $i, Xs, Cn, rt$1, mt, vn, Qi, Mn, Bn, Ct, Ji, zn, qs, ce$1, ei, ji, Un, Hn, ts, Qs, rr, Wn, tr, er, ir, is$2, sr, fe$1, ii, ss, si, rs, ns, os$6, hs, pt, ri, as, es, q$1, de$1, ni, oi, Gn, hi, ue$1, pi, nr, li, me$1, W$1, pe$2, Et, Ft$1, Ee$1, ai, G, ls, ci, or, ds, us, fi, di, hr, cs, ui, lr, fs$11, wt, kt, Vn, $n, fr, dr, Xn, qn, Er, wr, ur, Sr, yr, Rr, jn, to, eo, mr, ms, ps, Ei, io, Es, so, ws, Se$1, St, no, gr, Ss, br, oo, _r, ys, Or, Vt$1, Tr, ao, lo, yi, Lr, Dr, _s, Nr, Os, P$1, Ts, xs, gi, Ar, Ir, Re, Cr, Fr, Rs, yt, O$1, Ri, kr, $t, gs, bs, Ls, ge$1, be, _e$1, Oe$1, Te$1, uo, mo, po, vr, Xt$1, ye$1, xe$1, Eo, wo, So, yo, Ro, go, bo, _o, vt, To;
|
|
252501
252501
|
var init_index_min = __esmMin((() => {
|
|
252502
252502
|
zr = Object.defineProperty;
|
|
252503
252503
|
Ur = (s, t) => {
|
|
@@ -254467,7 +254467,7 @@ while (this[Zs](this[st$1].shift()));
|
|
|
254467
254467
|
constructor(t, e) {
|
|
254468
254468
|
this.path = t || "./", this.absolute = e;
|
|
254469
254469
|
}
|
|
254470
|
-
}, nr = Buffer.alloc(1024), li = Symbol("onStat"), me$1 = Symbol("ended"), W$1 = Symbol("queue"), pe$2 = Symbol("pendingLinks"), Et = Symbol("current"), Ft$1 = Symbol("process"), Ee$1 = Symbol("processing"), ai = Symbol("processJob"), G = Symbol("jobs"), ls = Symbol("jobDone"), ci = Symbol("addFSEntry"), or = Symbol("addTarEntry"), ds = Symbol("stat"), us = Symbol("readdir"), fi = Symbol("onreaddir"), di = Symbol("pipe"), hr = Symbol("entry"), cs = Symbol("entryOpt"), ui = Symbol("writeEntryClass"), lr = Symbol("write"), fs$
|
|
254470
|
+
}, nr = Buffer.alloc(1024), li = Symbol("onStat"), me$1 = Symbol("ended"), W$1 = Symbol("queue"), pe$2 = Symbol("pendingLinks"), Et = Symbol("current"), Ft$1 = Symbol("process"), Ee$1 = Symbol("processing"), ai = Symbol("processJob"), G = Symbol("jobs"), ls = Symbol("jobDone"), ci = Symbol("addFSEntry"), or = Symbol("addTarEntry"), ds = Symbol("stat"), us = Symbol("readdir"), fi = Symbol("onreaddir"), di = Symbol("pipe"), hr = Symbol("entry"), cs = Symbol("entryOpt"), ui = Symbol("writeEntryClass"), lr = Symbol("write"), fs$11 = Symbol("ondrain"), wt = class extends A$1 {
|
|
254471
254471
|
sync = !1;
|
|
254472
254472
|
opt;
|
|
254473
254473
|
cwd;
|
|
@@ -254500,8 +254500,8 @@ while (this[Zs](this[st$1].shift()));
|
|
|
254500
254500
|
if ((t.gzip ? 1 : 0) + (t.brotli ? 1 : 0) + (t.zstd ? 1 : 0) > 1) throw new TypeError("gzip, brotli, zstd are mutually exclusive");
|
|
254501
254501
|
if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = !0), this.zip = new ze$1(t.gzip)), t.brotli && (typeof t.brotli != "object" && (t.brotli = {}), this.zip = new We$1(t.brotli)), t.zstd && (typeof t.zstd != "object" && (t.zstd = {}), this.zip = new Ye$1(t.zstd)), !this.zip) throw new Error("impossible");
|
|
254502
254502
|
let e = this.zip;
|
|
254503
|
-
e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[fs$
|
|
254504
|
-
} else this.on("drain", this[fs$
|
|
254503
|
+
e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[fs$11]()), this.on("resume", () => e.resume());
|
|
254504
|
+
} else this.on("drain", this[fs$11]);
|
|
254505
254505
|
this.noDirRecurse = !!t.noDirRecurse, this.follow = !!t.follow, this.noMtime = !!t.noMtime, t.mtime && (this.mtime = t.mtime), this.filter = typeof t.filter == "function" ? t.filter : () => !0, this[W$1] = new hi(), this[G] = 0, this.jobs = Number(t.jobs) || 4, this[Ee$1] = !1, this[me$1] = !1;
|
|
254506
254506
|
}
|
|
254507
254507
|
[lr](t) {
|
|
@@ -254628,7 +254628,7 @@ while (this[Zs](this[st$1].shift()));
|
|
|
254628
254628
|
this.emit("error", e);
|
|
254629
254629
|
}
|
|
254630
254630
|
}
|
|
254631
|
-
[fs$
|
|
254631
|
+
[fs$11]() {
|
|
254632
254632
|
this[Et] && this[Et].entry && this[Et].entry.resume();
|
|
254633
254633
|
}
|
|
254634
254634
|
[di](t) {
|
|
@@ -254794,7 +254794,7 @@ while (this[Zs](this[st$1].shift()));
|
|
|
254794
254794
|
E ? e(E) : x && a ? Es(x, o, h, (Le) => y(Le)) : n ? Kt.chmod(s, r, e) : e();
|
|
254795
254795
|
};
|
|
254796
254796
|
if (s === d) return no(s, y);
|
|
254797
|
-
if (l) return
|
|
254797
|
+
if (l) return ro.mkdir(s, {
|
|
254798
254798
|
mode: r,
|
|
254799
254799
|
recursive: !0
|
|
254800
254800
|
}).then((E) => y(null, E ?? void 0), y);
|
|
@@ -255553,7 +255553,7 @@ var require_pend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
255553
255553
|
//#endregion
|
|
255554
255554
|
//#region ../../node_modules/.pnpm/yauzl@3.3.0/node_modules/yauzl/fd-slicer.js
|
|
255555
255555
|
var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
255556
|
-
var fs$
|
|
255556
|
+
var fs$10 = __require("fs");
|
|
255557
255557
|
var util$6 = __require("util");
|
|
255558
255558
|
var stream$2 = __require("stream");
|
|
255559
255559
|
var Readable = stream$2.Readable;
|
|
@@ -255578,7 +255578,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
255578
255578
|
FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
|
|
255579
255579
|
var self = this;
|
|
255580
255580
|
self.pend.go(function(cb) {
|
|
255581
|
-
fs$
|
|
255581
|
+
fs$10.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
|
|
255582
255582
|
cb();
|
|
255583
255583
|
callback(err, bytesRead, buffer);
|
|
255584
255584
|
});
|
|
@@ -255587,7 +255587,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
255587
255587
|
FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
|
|
255588
255588
|
var self = this;
|
|
255589
255589
|
self.pend.go(function(cb) {
|
|
255590
|
-
fs$
|
|
255590
|
+
fs$10.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
|
|
255591
255591
|
cb();
|
|
255592
255592
|
callback(err, written, buffer);
|
|
255593
255593
|
});
|
|
@@ -255607,7 +255607,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
255607
255607
|
self.refCount -= 1;
|
|
255608
255608
|
if (self.refCount > 0) return;
|
|
255609
255609
|
if (self.refCount < 0) throw new Error("invalid unref");
|
|
255610
|
-
if (self.autoClose) fs$
|
|
255610
|
+
if (self.autoClose) fs$10.close(self.fd, onCloseDone);
|
|
255611
255611
|
function onCloseDone(err) {
|
|
255612
255612
|
if (err) self.emit("error", err);
|
|
255613
255613
|
else self.emit("close");
|
|
@@ -255638,7 +255638,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
255638
255638
|
self.context.pend.go(function(cb) {
|
|
255639
255639
|
if (self.destroyed) return cb();
|
|
255640
255640
|
var buffer = Buffer.allocUnsafe(toRead);
|
|
255641
|
-
fs$
|
|
255641
|
+
fs$10.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
|
|
255642
255642
|
if (err) self.destroy(err);
|
|
255643
255643
|
else if (bytesRead === 0) {
|
|
255644
255644
|
self.destroyed = true;
|
|
@@ -255684,7 +255684,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
255684
255684
|
}
|
|
255685
255685
|
self.context.pend.go(function(cb) {
|
|
255686
255686
|
if (self.destroyed) return cb();
|
|
255687
|
-
fs$
|
|
255687
|
+
fs$10.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
|
|
255688
255688
|
if (err) {
|
|
255689
255689
|
self.destroy();
|
|
255690
255690
|
cb();
|
|
@@ -292642,7 +292642,7 @@ var init_proxy = __esmMin((() => {
|
|
|
292642
292642
|
var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
292643
292643
|
module.exports = isexe;
|
|
292644
292644
|
isexe.sync = sync;
|
|
292645
|
-
var fs$
|
|
292645
|
+
var fs$8 = __require("fs");
|
|
292646
292646
|
function checkPathExt(path, options) {
|
|
292647
292647
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
292648
292648
|
if (!pathext) return true;
|
|
@@ -292659,12 +292659,12 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
292659
292659
|
return checkPathExt(path, options);
|
|
292660
292660
|
}
|
|
292661
292661
|
function isexe(path, options, cb) {
|
|
292662
|
-
fs$
|
|
292662
|
+
fs$8.stat(path, function(er, stat) {
|
|
292663
292663
|
cb(er, er ? false : checkStat(stat, path, options));
|
|
292664
292664
|
});
|
|
292665
292665
|
}
|
|
292666
292666
|
function sync(path, options) {
|
|
292667
|
-
return checkStat(fs$
|
|
292667
|
+
return checkStat(fs$8.statSync(path), path, options);
|
|
292668
292668
|
}
|
|
292669
292669
|
}));
|
|
292670
292670
|
//#endregion
|
|
@@ -292672,14 +292672,14 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
292672
292672
|
var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
292673
292673
|
module.exports = isexe;
|
|
292674
292674
|
isexe.sync = sync;
|
|
292675
|
-
var fs$
|
|
292675
|
+
var fs$7 = __require("fs");
|
|
292676
292676
|
function isexe(path, options, cb) {
|
|
292677
|
-
fs$
|
|
292677
|
+
fs$7.stat(path, function(er, stat) {
|
|
292678
292678
|
cb(er, er ? false : checkStat(stat, options));
|
|
292679
292679
|
});
|
|
292680
292680
|
}
|
|
292681
292681
|
function sync(path, options) {
|
|
292682
|
-
return checkStat(fs$
|
|
292682
|
+
return checkStat(fs$7.statSync(path), options);
|
|
292683
292683
|
}
|
|
292684
292684
|
function checkStat(stat, options) {
|
|
292685
292685
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -292894,16 +292894,16 @@ var require_shebang_command = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
292894
292894
|
//#endregion
|
|
292895
292895
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
292896
292896
|
var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
292897
|
-
const fs$
|
|
292897
|
+
const fs$6 = __require("fs");
|
|
292898
292898
|
const shebangCommand = require_shebang_command();
|
|
292899
292899
|
function readShebang(command) {
|
|
292900
292900
|
const size = 150;
|
|
292901
292901
|
const buffer = Buffer.alloc(size);
|
|
292902
292902
|
let fd;
|
|
292903
292903
|
try {
|
|
292904
|
-
fd = fs$
|
|
292905
|
-
fs$
|
|
292906
|
-
fs$
|
|
292904
|
+
fd = fs$6.openSync(command, "r");
|
|
292905
|
+
fs$6.readSync(fd, buffer, 0, size, 0);
|
|
292906
|
+
fs$6.closeSync(fd);
|
|
292907
292907
|
} catch (e) {}
|
|
292908
292908
|
return shebangCommand(buffer.toString());
|
|
292909
292909
|
}
|
|
@@ -310652,7 +310652,7 @@ var require_dist$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
310652
310652
|
//#endregion
|
|
310653
310653
|
//#region ../../node_modules/.pnpm/yazl@3.3.1/node_modules/yazl/index.js
|
|
310654
310654
|
var require_yazl = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
310655
|
-
var fs$
|
|
310655
|
+
var fs$5 = __require("fs");
|
|
310656
310656
|
var Transform$2 = __require("stream").Transform;
|
|
310657
310657
|
var PassThrough$2 = __require("stream").PassThrough;
|
|
310658
310658
|
var zlib$1 = __require("zlib");
|
|
@@ -310681,14 +310681,14 @@ var require_yazl = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
310681
310681
|
if (shouldIgnoreAdding(self)) return;
|
|
310682
310682
|
var entry = new Entry(metadataPath, false, options);
|
|
310683
310683
|
self.entries.push(entry);
|
|
310684
|
-
fs$
|
|
310684
|
+
fs$5.stat(realPath, function(err, stats) {
|
|
310685
310685
|
if (err) return self.emit("error", err);
|
|
310686
310686
|
if (!stats.isFile()) return self.emit("error", /* @__PURE__ */ new Error("not a file: " + realPath));
|
|
310687
310687
|
entry.uncompressedSize = stats.size;
|
|
310688
310688
|
if (options.mtime == null) entry.setLastModDate(stats.mtime);
|
|
310689
310689
|
if (options.mode == null) entry.setFileAttributesMode(stats.mode);
|
|
310690
310690
|
entry.setFileDataPumpFunction(function() {
|
|
310691
|
-
var readStream = fs$
|
|
310691
|
+
var readStream = fs$5.createReadStream(realPath);
|
|
310692
310692
|
entry.state = Entry.FILE_DATA_IN_PROGRESS;
|
|
310693
310693
|
readStream.on("error", function(err) {
|
|
310694
310694
|
self.emit("error", err);
|
|
@@ -327269,7 +327269,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
327269
327269
|
const EventEmitter$12 = __require("node:events").EventEmitter;
|
|
327270
327270
|
const childProcess = __require("node:child_process");
|
|
327271
327271
|
const path$7 = __require("node:path");
|
|
327272
|
-
const fs$
|
|
327272
|
+
const fs$4 = __require("node:fs");
|
|
327273
327273
|
const process$2 = __require("node:process");
|
|
327274
327274
|
const { Argument, humanReadableArgName } = require_argument();
|
|
327275
327275
|
const { CommanderError } = require_error$2();
|
|
@@ -328152,7 +328152,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
328152
328152
|
* @param {string} subcommandName
|
|
328153
328153
|
*/
|
|
328154
328154
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
328155
|
-
if (fs$
|
|
328155
|
+
if (fs$4.existsSync(executableFile)) return;
|
|
328156
328156
|
const executableMissing = `'${executableFile}' does not exist
|
|
328157
328157
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
328158
328158
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
@@ -328176,9 +328176,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
328176
328176
|
];
|
|
328177
328177
|
function findFile(baseDir, baseName) {
|
|
328178
328178
|
const localBin = path$7.resolve(baseDir, baseName);
|
|
328179
|
-
if (fs$
|
|
328179
|
+
if (fs$4.existsSync(localBin)) return localBin;
|
|
328180
328180
|
if (sourceExt.includes(path$7.extname(baseName))) return void 0;
|
|
328181
|
-
const foundExt = sourceExt.find((ext) => fs$
|
|
328181
|
+
const foundExt = sourceExt.find((ext) => fs$4.existsSync(`${localBin}${ext}`));
|
|
328182
328182
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
328183
328183
|
}
|
|
328184
328184
|
this._checkForMissingMandatoryOptions();
|
|
@@ -328188,7 +328188,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
328188
328188
|
if (this._scriptPath) {
|
|
328189
328189
|
let resolvedScriptPath;
|
|
328190
328190
|
try {
|
|
328191
|
-
resolvedScriptPath = fs$
|
|
328191
|
+
resolvedScriptPath = fs$4.realpathSync(this._scriptPath);
|
|
328192
328192
|
} catch {
|
|
328193
328193
|
resolvedScriptPath = this._scriptPath;
|
|
328194
328194
|
}
|
|
@@ -346669,7 +346669,7 @@ var require_atomic_sleep = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
346669
346669
|
//#endregion
|
|
346670
346670
|
//#region ../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js
|
|
346671
346671
|
var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
346672
|
-
const fs$
|
|
346672
|
+
const fs$3 = __require("fs");
|
|
346673
346673
|
const EventEmitter$10 = __require("events");
|
|
346674
346674
|
const inherits$6 = __require("util").inherits;
|
|
346675
346675
|
const path$6 = __require("path");
|
|
@@ -346712,17 +346712,17 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
346712
346712
|
const flags = sonic.append ? "a" : "w";
|
|
346713
346713
|
const mode = sonic.mode;
|
|
346714
346714
|
if (sonic.sync) try {
|
|
346715
|
-
if (sonic.mkdir) fs$
|
|
346716
|
-
fileOpened(null, fs$
|
|
346715
|
+
if (sonic.mkdir) fs$3.mkdirSync(path$6.dirname(file), { recursive: true });
|
|
346716
|
+
fileOpened(null, fs$3.openSync(file, flags, mode));
|
|
346717
346717
|
} catch (err) {
|
|
346718
346718
|
fileOpened(err);
|
|
346719
346719
|
throw err;
|
|
346720
346720
|
}
|
|
346721
|
-
else if (sonic.mkdir) fs$
|
|
346721
|
+
else if (sonic.mkdir) fs$3.mkdir(path$6.dirname(file), { recursive: true }, (err) => {
|
|
346722
346722
|
if (err) return fileOpened(err);
|
|
346723
|
-
fs$
|
|
346723
|
+
fs$3.open(file, flags, mode, fileOpened);
|
|
346724
346724
|
});
|
|
346725
|
-
else fs$
|
|
346725
|
+
else fs$3.open(file, flags, mode, fileOpened);
|
|
346726
346726
|
}
|
|
346727
346727
|
function SonicBoom(opts) {
|
|
346728
346728
|
if (!(this instanceof SonicBoom)) return new SonicBoom(opts);
|
|
@@ -346760,8 +346760,8 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
346760
346760
|
this.flush = flushBuffer;
|
|
346761
346761
|
this.flushSync = flushBufferSync;
|
|
346762
346762
|
this._actualWrite = actualWriteBuffer;
|
|
346763
|
-
fsWriteSync = () => fs$
|
|
346764
|
-
fsWrite = () => fs$
|
|
346763
|
+
fsWriteSync = () => fs$3.writeSync(this.fd, this._writingBuf);
|
|
346764
|
+
fsWrite = () => fs$3.write(this.fd, this._writingBuf, this.release);
|
|
346765
346765
|
} else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
|
|
346766
346766
|
this._writingBuf = "";
|
|
346767
346767
|
this.write = write;
|
|
@@ -346769,12 +346769,12 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
346769
346769
|
this.flushSync = flushSync;
|
|
346770
346770
|
this._actualWrite = actualWrite;
|
|
346771
346771
|
fsWriteSync = () => {
|
|
346772
|
-
if (Buffer.isBuffer(this._writingBuf)) return fs$
|
|
346773
|
-
return fs$
|
|
346772
|
+
if (Buffer.isBuffer(this._writingBuf)) return fs$3.writeSync(this.fd, this._writingBuf);
|
|
346773
|
+
return fs$3.writeSync(this.fd, this._writingBuf, "utf8");
|
|
346774
346774
|
};
|
|
346775
346775
|
fsWrite = () => {
|
|
346776
|
-
if (Buffer.isBuffer(this._writingBuf)) return fs$
|
|
346777
|
-
return fs$
|
|
346776
|
+
if (Buffer.isBuffer(this._writingBuf)) return fs$3.write(this.fd, this._writingBuf, this.release);
|
|
346777
|
+
return fs$3.write(this.fd, this._writingBuf, "utf8", this.release);
|
|
346778
346778
|
};
|
|
346779
346779
|
} else throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
|
|
346780
346780
|
if (typeof fd === "number") {
|
|
@@ -346819,7 +346819,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
346819
346819
|
return;
|
|
346820
346820
|
}
|
|
346821
346821
|
}
|
|
346822
|
-
if (this._fsync) fs$
|
|
346822
|
+
if (this._fsync) fs$3.fsyncSync(this.fd);
|
|
346823
346823
|
const len = this._len;
|
|
346824
346824
|
if (this._reopening) {
|
|
346825
346825
|
this._writing = false;
|
|
@@ -346916,7 +346916,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
346916
346916
|
this._flushPending = true;
|
|
346917
346917
|
const onDrain = () => {
|
|
346918
346918
|
if (!this._fsync) try {
|
|
346919
|
-
fs$
|
|
346919
|
+
fs$3.fsync(this.fd, (err) => {
|
|
346920
346920
|
this._flushPending = false;
|
|
346921
346921
|
cb(err);
|
|
346922
346922
|
});
|
|
@@ -346993,7 +346993,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
346993
346993
|
if (this._writing) return;
|
|
346994
346994
|
const fd = this.fd;
|
|
346995
346995
|
this.once("ready", () => {
|
|
346996
|
-
if (fd !== this.fd) fs$
|
|
346996
|
+
if (fd !== this.fd) fs$3.close(fd, (err) => {
|
|
346997
346997
|
if (err) return this.emit("error", err);
|
|
346998
346998
|
});
|
|
346999
346999
|
});
|
|
@@ -347024,7 +347024,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
347024
347024
|
while (this._bufs.length || buf.length) {
|
|
347025
347025
|
if (buf.length <= 0) buf = this._bufs[0];
|
|
347026
347026
|
try {
|
|
347027
|
-
const n = Buffer.isBuffer(buf) ? fs$
|
|
347027
|
+
const n = Buffer.isBuffer(buf) ? fs$3.writeSync(this.fd, buf) : fs$3.writeSync(this.fd, buf, "utf8");
|
|
347028
347028
|
const releasedBufObj = releaseWritingBuf(buf, this._len, n);
|
|
347029
347029
|
buf = releasedBufObj.writingBuf;
|
|
347030
347030
|
this._len = releasedBufObj.len;
|
|
@@ -347035,7 +347035,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
347035
347035
|
}
|
|
347036
347036
|
}
|
|
347037
347037
|
try {
|
|
347038
|
-
fs$
|
|
347038
|
+
fs$3.fsyncSync(this.fd);
|
|
347039
347039
|
} catch {}
|
|
347040
347040
|
}
|
|
347041
347041
|
function flushBufferSync() {
|
|
@@ -347049,7 +347049,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
347049
347049
|
while (this._bufs.length || buf.length) {
|
|
347050
347050
|
if (buf.length <= 0) buf = mergeBuf(this._bufs[0], this._lens[0]);
|
|
347051
347051
|
try {
|
|
347052
|
-
const n = fs$
|
|
347052
|
+
const n = fs$3.writeSync(this.fd, buf);
|
|
347053
347053
|
buf = buf.subarray(n);
|
|
347054
347054
|
this._len = Math.max(this._len - n, 0);
|
|
347055
347055
|
if (buf.length <= 0) {
|
|
@@ -347071,24 +347071,24 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
347071
347071
|
this._writing = true;
|
|
347072
347072
|
this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
|
|
347073
347073
|
if (this.sync) try {
|
|
347074
|
-
release(null, Buffer.isBuffer(this._writingBuf) ? fs$
|
|
347074
|
+
release(null, Buffer.isBuffer(this._writingBuf) ? fs$3.writeSync(this.fd, this._writingBuf) : fs$3.writeSync(this.fd, this._writingBuf, "utf8"));
|
|
347075
347075
|
} catch (err) {
|
|
347076
347076
|
release(err);
|
|
347077
347077
|
}
|
|
347078
|
-
else fs$
|
|
347078
|
+
else fs$3.write(this.fd, this._writingBuf, release);
|
|
347079
347079
|
}
|
|
347080
347080
|
function actualWriteBuffer() {
|
|
347081
347081
|
const release = this.release;
|
|
347082
347082
|
this._writing = true;
|
|
347083
347083
|
this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
|
|
347084
347084
|
if (this.sync) try {
|
|
347085
|
-
release(null, fs$
|
|
347085
|
+
release(null, fs$3.writeSync(this.fd, this._writingBuf));
|
|
347086
347086
|
} catch (err) {
|
|
347087
347087
|
release(err);
|
|
347088
347088
|
}
|
|
347089
347089
|
else {
|
|
347090
347090
|
if (kCopyBuffer) this._writingBuf = Buffer.from(this._writingBuf);
|
|
347091
|
-
fs$
|
|
347091
|
+
fs$3.write(this.fd, this._writingBuf, release);
|
|
347092
347092
|
}
|
|
347093
347093
|
}
|
|
347094
347094
|
function actualClose(sonic) {
|
|
@@ -347102,10 +347102,10 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
347102
347102
|
sonic._lens = [];
|
|
347103
347103
|
assert$8(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
|
|
347104
347104
|
try {
|
|
347105
|
-
fs$
|
|
347105
|
+
fs$3.fsync(sonic.fd, closeWrapped);
|
|
347106
347106
|
} catch {}
|
|
347107
347107
|
function closeWrapped() {
|
|
347108
|
-
if (sonic.fd !== 1 && sonic.fd !== 2) fs$
|
|
347108
|
+
if (sonic.fd !== 1 && sonic.fd !== 2) fs$3.close(sonic.fd, done);
|
|
347109
347109
|
else done();
|
|
347110
347110
|
}
|
|
347111
347111
|
function done(err) {
|
|
@@ -369728,7 +369728,7 @@ var require_constants$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
369728
369728
|
//#endregion
|
|
369729
369729
|
//#region ../../../../node_modules/node-gyp-build/node-gyp-build.js
|
|
369730
369730
|
var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
369731
|
-
var fs$
|
|
369731
|
+
var fs$2 = __require("fs");
|
|
369732
369732
|
var path$5 = __require("path");
|
|
369733
369733
|
var os$3 = __require("os");
|
|
369734
369734
|
var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
@@ -369784,7 +369784,7 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
369784
369784
|
};
|
|
369785
369785
|
function readdirSync(dir) {
|
|
369786
369786
|
try {
|
|
369787
|
-
return fs$
|
|
369787
|
+
return fs$2.readdirSync(dir);
|
|
369788
369788
|
} catch (err) {
|
|
369789
369789
|
return [];
|
|
369790
369790
|
}
|
|
@@ -369872,7 +369872,7 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
369872
369872
|
return typeof window !== "undefined" && window.process && window.process.type === "renderer";
|
|
369873
369873
|
}
|
|
369874
369874
|
function isAlpine(platform) {
|
|
369875
|
-
return platform === "linux" && fs$
|
|
369875
|
+
return platform === "linux" && fs$2.existsSync("/etc/alpine-release");
|
|
369876
369876
|
}
|
|
369877
369877
|
load.parseTags = parseTags;
|
|
369878
369878
|
load.matchTags = matchTags;
|
|
@@ -390025,7 +390025,7 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
390025
390025
|
//#region ../../node_modules/.pnpm/@fastify+swagger@9.7.0/node_modules/@fastify/swagger/lib/mode/static.js
|
|
390026
390026
|
var require_static = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
390027
390027
|
const path$3 = __require("node:path");
|
|
390028
|
-
const fs$
|
|
390028
|
+
const fs$1 = __require("node:fs");
|
|
390029
390029
|
const yaml = require_dist$1();
|
|
390030
390030
|
module.exports = function(fastify, opts, done) {
|
|
390031
390031
|
if (!opts.specification) return done(/* @__PURE__ */ new Error("specification is missing in the module options"));
|
|
@@ -390034,14 +390034,14 @@ var require_static = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
390034
390034
|
if (!opts.specification.path && !opts.specification.document) return done(/* @__PURE__ */ new Error("both specification.path and specification.document are missing, should be path to the file or swagger document spec"));
|
|
390035
390035
|
else if (opts.specification.path) {
|
|
390036
390036
|
if (typeof opts.specification.path !== "string") return done(/* @__PURE__ */ new Error("specification.path is not a string"));
|
|
390037
|
-
if (!fs$
|
|
390037
|
+
if (!fs$1.existsSync(path$3.resolve(opts.specification.path))) return done(/* @__PURE__ */ new Error(`${opts.specification.path} does not exist`));
|
|
390038
390038
|
const extName = path$3.extname(opts.specification.path).toLowerCase();
|
|
390039
390039
|
if ([".yaml", ".json"].indexOf(extName) === -1) return done(/* @__PURE__ */ new Error("specification.path extension name is not supported, should be one from ['.yaml', '.json']"));
|
|
390040
390040
|
if (opts.specification.postProcessor && typeof opts.specification.postProcessor !== "function") return done(/* @__PURE__ */ new Error("specification.postProcessor should be a function"));
|
|
390041
390041
|
if (opts.specification.baseDir && typeof opts.specification.baseDir !== "string") return done(/* @__PURE__ */ new Error("specification.baseDir should be string"));
|
|
390042
390042
|
if (!opts.specification.baseDir) opts.specification.baseDir = path$3.resolve(path$3.dirname(opts.specification.path));
|
|
390043
390043
|
else while (opts.specification.baseDir.endsWith("/")) opts.specification.baseDir = opts.specification.baseDir.slice(0, -1);
|
|
390044
|
-
const source = fs$
|
|
390044
|
+
const source = fs$1.readFileSync(path$3.resolve(opts.specification.path), "utf8");
|
|
390045
390045
|
switch (extName) {
|
|
390046
390046
|
case ".yaml":
|
|
390047
390047
|
swaggerObject = yaml.parse(source);
|
|
@@ -390308,11 +390308,11 @@ var require_should_route_hide = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
390308
390308
|
//#endregion
|
|
390309
390309
|
//#region ../../node_modules/.pnpm/@fastify+swagger@9.7.0/node_modules/@fastify/swagger/lib/util/read-package-json.js
|
|
390310
390310
|
var require_read_package_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
390311
|
-
const fs
|
|
390311
|
+
const fs = __require("node:fs");
|
|
390312
390312
|
const path$2 = __require("node:path");
|
|
390313
390313
|
function readPackageJson() {
|
|
390314
390314
|
try {
|
|
390315
|
-
return JSON.parse(fs
|
|
390315
|
+
return JSON.parse(fs.readFileSync(path$2.join(__dirname, "..", "..", "package.json")));
|
|
390316
390316
|
} catch {
|
|
390317
390317
|
return {};
|
|
390318
390318
|
}
|
|
@@ -405262,7 +405262,7 @@ var TUI = class TUI extends Container {
|
|
|
405262
405262
|
if (!debugRedraw) return;
|
|
405263
405263
|
const logPath = path$17.join(nodeOs.homedir(), ".pi", "agent", "pi-debug.log");
|
|
405264
405264
|
const msg = `[${(/* @__PURE__ */ new Date()).toISOString()}] fullRender: ${reason} (prev=${this.previousLines.length}, new=${newLines.length}, height=${height})\n`;
|
|
405265
|
-
fs$
|
|
405265
|
+
fs$16.appendFileSync(logPath, msg);
|
|
405266
405266
|
};
|
|
405267
405267
|
if (this.previousLines.length === 0 && !widthChanged && !heightChanged) {
|
|
405268
405268
|
logRedraw("first render");
|
|
@@ -405409,7 +405409,7 @@ var TUI = class TUI extends Container {
|
|
|
405409
405409
|
buffer += "\x1B[?2026l";
|
|
405410
405410
|
if (process.env["PI_TUI_DEBUG"] === "1") {
|
|
405411
405411
|
const debugDir = "/tmp/tui";
|
|
405412
|
-
fs$
|
|
405412
|
+
fs$16.mkdirSync(debugDir, { recursive: true });
|
|
405413
405413
|
const debugPath = path$17.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);
|
|
405414
405414
|
const debugData = [
|
|
405415
405415
|
`firstChanged: ${firstChanged}`,
|
|
@@ -405433,7 +405433,7 @@ var TUI = class TUI extends Container {
|
|
|
405433
405433
|
"=== buffer ===",
|
|
405434
405434
|
JSON.stringify(buffer)
|
|
405435
405435
|
].join("\n");
|
|
405436
|
-
fs$
|
|
405436
|
+
fs$16.writeFileSync(debugPath, debugData);
|
|
405437
405437
|
}
|
|
405438
405438
|
this.terminal.write(buffer);
|
|
405439
405439
|
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
@@ -410092,7 +410092,7 @@ var ProcessTerminal = class {
|
|
|
410092
410092
|
const env = process.env["PI_TUI_WRITE_LOG"] || "";
|
|
410093
410093
|
if (!env) return "";
|
|
410094
410094
|
try {
|
|
410095
|
-
if (fs$
|
|
410095
|
+
if (fs$16.statSync(env).isDirectory()) {
|
|
410096
410096
|
const now = /* @__PURE__ */ new Date();
|
|
410097
410097
|
const ts = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}_${String(now.getHours()).padStart(2, "0")}-${String(now.getMinutes()).padStart(2, "0")}-${String(now.getSeconds()).padStart(2, "0")}`;
|
|
410098
410098
|
return path$17.join(env, `tui-${ts}-${process.pid}.log`);
|
|
@@ -410375,7 +410375,7 @@ var ProcessTerminal = class {
|
|
|
410375
410375
|
write(data) {
|
|
410376
410376
|
process.stdout.write(data);
|
|
410377
410377
|
if (this.writeLogPath) try {
|
|
410378
|
-
fs$
|
|
410378
|
+
fs$16.appendFileSync(this.writeLogPath, data, { encoding: "utf8" });
|
|
410379
410379
|
} catch {}
|
|
410380
410380
|
}
|
|
410381
410381
|
get columns() {
|
|
@@ -497750,6 +497750,8 @@ var AuthFlowController = class {
|
|
|
497750
497750
|
host;
|
|
497751
497751
|
managedAccountRefreshSequence = 0;
|
|
497752
497752
|
managedQuotaRefreshSequence = 0;
|
|
497753
|
+
managedQuotaRetryTimer;
|
|
497754
|
+
managedQuotaRetryAttempt = 0;
|
|
497753
497755
|
constructor(host) {
|
|
497754
497756
|
this.host = host;
|
|
497755
497757
|
}
|
|
@@ -497803,24 +497805,69 @@ var AuthFlowController = class {
|
|
|
497803
497805
|
maxContextTokens
|
|
497804
497806
|
};
|
|
497805
497807
|
}
|
|
497806
|
-
async refreshManagedQuotaWindows() {
|
|
497808
|
+
async refreshManagedQuotaWindows(options = {}) {
|
|
497807
497809
|
const { host } = this;
|
|
497808
497810
|
const sessionId = host.state.appState.sessionId;
|
|
497809
497811
|
if (sessionId.length === 0) return;
|
|
497812
|
+
if (options.retry !== true) {
|
|
497813
|
+
this.clearManagedQuotaRetry();
|
|
497814
|
+
this.managedQuotaRetryAttempt = 0;
|
|
497815
|
+
}
|
|
497810
497816
|
const sequence = ++this.managedQuotaRefreshSequence;
|
|
497811
497817
|
let usage;
|
|
497812
497818
|
try {
|
|
497813
497819
|
usage = await host.harness.auth.getManagedQuota(this.managedProviderName());
|
|
497814
497820
|
} catch {
|
|
497821
|
+
this.handleManagedQuotaFailure("unavailable", sessionId);
|
|
497815
497822
|
return;
|
|
497816
497823
|
}
|
|
497817
497824
|
if (sequence !== this.managedQuotaRefreshSequence || host.state.appState.sessionId !== sessionId) return;
|
|
497818
497825
|
if (usage?.kind !== "ok") {
|
|
497819
|
-
|
|
497826
|
+
const error = usage?.code === "unauthenticated" ? "unauthenticated" : usage?.code === "invalid_payload" ? "invalid_payload" : "unavailable";
|
|
497827
|
+
if (error === "unauthenticated") {
|
|
497828
|
+
this.clearManagedQuotaRetry();
|
|
497829
|
+
this.managedQuotaRetryAttempt = 0;
|
|
497830
|
+
host.setAppState({
|
|
497831
|
+
managedQuotaWindows: void 0,
|
|
497832
|
+
managedQuotaError: error
|
|
497833
|
+
});
|
|
497834
|
+
} else this.handleManagedQuotaFailure(error, sessionId);
|
|
497820
497835
|
return;
|
|
497821
497836
|
}
|
|
497822
497837
|
const managedQuotaWindows = normalizeManagedQuotaWindows(usage.limits);
|
|
497823
|
-
|
|
497838
|
+
if (managedQuotaWindows === void 0) {
|
|
497839
|
+
this.handleManagedQuotaFailure("invalid_payload", sessionId);
|
|
497840
|
+
return;
|
|
497841
|
+
}
|
|
497842
|
+
this.clearManagedQuotaRetry();
|
|
497843
|
+
this.managedQuotaRetryAttempt = 0;
|
|
497844
|
+
host.setAppState({
|
|
497845
|
+
managedQuotaWindows,
|
|
497846
|
+
managedQuotaError: void 0
|
|
497847
|
+
});
|
|
497848
|
+
}
|
|
497849
|
+
handleManagedQuotaFailure(error, sessionId) {
|
|
497850
|
+
const { host } = this;
|
|
497851
|
+
if (error === "invalid_payload") host.setAppState({
|
|
497852
|
+
managedQuotaWindows: void 0,
|
|
497853
|
+
managedQuotaError: error
|
|
497854
|
+
});
|
|
497855
|
+
else if (host.state.appState.managedQuotaWindows === void 0) host.setAppState({ managedQuotaError: error });
|
|
497856
|
+
if (this.managedQuotaRetryAttempt >= 2 || this.managedQuotaRetryTimer !== void 0) return;
|
|
497857
|
+
const delayMs = this.managedQuotaRetryAttempt === 0 ? 750 : 3e3;
|
|
497858
|
+
this.managedQuotaRetryAttempt += 1;
|
|
497859
|
+
this.managedQuotaRetryTimer = setTimeout(() => {
|
|
497860
|
+
this.managedQuotaRetryTimer = void 0;
|
|
497861
|
+
if (host.state.appState.sessionId !== sessionId) return;
|
|
497862
|
+
this.refreshManagedQuotaWindows({ retry: true });
|
|
497863
|
+
}, delayMs);
|
|
497864
|
+
this.managedQuotaRetryTimer.unref?.();
|
|
497865
|
+
}
|
|
497866
|
+
clearManagedQuotaRetry() {
|
|
497867
|
+
if (this.managedQuotaRetryTimer !== void 0) {
|
|
497868
|
+
clearTimeout(this.managedQuotaRetryTimer);
|
|
497869
|
+
this.managedQuotaRetryTimer = void 0;
|
|
497870
|
+
}
|
|
497824
497871
|
}
|
|
497825
497872
|
managedProviderName() {
|
|
497826
497873
|
return DEFAULT_OAUTH_PROVIDER_NAME;
|
|
@@ -497859,7 +497906,8 @@ var AuthFlowController = class {
|
|
|
497859
497906
|
contextUsage: 0,
|
|
497860
497907
|
sessionTitle: null,
|
|
497861
497908
|
managedAccountContextTokens: void 0,
|
|
497862
|
-
managedQuotaWindows: void 0
|
|
497909
|
+
managedQuotaWindows: void 0,
|
|
497910
|
+
managedQuotaError: void 0
|
|
497863
497911
|
});
|
|
497864
497912
|
this.host.appendStartupNotice(notice);
|
|
497865
497913
|
this.host.setStartupReady();
|
|
@@ -497913,7 +497961,8 @@ var AuthFlowController = class {
|
|
|
497913
497961
|
sessionTitle: null,
|
|
497914
497962
|
...options?.clearCustomerAccount === false ? {} : {
|
|
497915
497963
|
managedAccountContextTokens: void 0,
|
|
497916
|
-
managedQuotaWindows: void 0
|
|
497964
|
+
managedQuotaWindows: void 0,
|
|
497965
|
+
managedQuotaError: void 0
|
|
497917
497966
|
}
|
|
497918
497967
|
});
|
|
497919
497968
|
await this.host.refreshSkillCommands();
|
|
@@ -497959,7 +498008,8 @@ var AuthFlowController = class {
|
|
|
497959
498008
|
contextTokens: 0,
|
|
497960
498009
|
...options?.clearCustomerAccount === false ? {} : {
|
|
497961
498010
|
managedAccountContextTokens: void 0,
|
|
497962
|
-
managedQuotaWindows: void 0
|
|
498011
|
+
managedQuotaWindows: void 0,
|
|
498012
|
+
managedQuotaError: void 0
|
|
497963
498013
|
}
|
|
497964
498014
|
});
|
|
497965
498015
|
}
|
|
@@ -497990,6 +498040,8 @@ var AuthFlowController = class {
|
|
|
497990
498040
|
return result;
|
|
497991
498041
|
}
|
|
497992
498042
|
invalidateManagedAccountRefreshes() {
|
|
498043
|
+
this.clearManagedQuotaRetry();
|
|
498044
|
+
this.managedQuotaRetryAttempt = 0;
|
|
497993
498045
|
this.managedAccountRefreshSequence += 1;
|
|
497994
498046
|
this.managedQuotaRefreshSequence += 1;
|
|
497995
498047
|
}
|
|
@@ -505454,7 +505506,7 @@ var FooterComponent = class {
|
|
|
505454
505506
|
const pad = Math.max(0, width - visibleWidth(shownLeft) - rightWidth);
|
|
505455
505507
|
line1 = shownLeft + " ".repeat(pad) + right;
|
|
505456
505508
|
}
|
|
505457
|
-
const quotaLines = state.managedQuotaWindows === void 0 ? [] : formatManagedQuotaFooterLines(state.managedQuotaWindows, colors, width);
|
|
505509
|
+
const quotaLines = state.managedQuotaWindows === void 0 ? state.managedQuotaError === void 0 ? [] : [truncateToWidth(chalk.hex(colors.warning)(uiText(state.managedQuotaError === "unauthenticated" ? "usage.plan.error.unauthenticated" : state.managedQuotaError === "invalid_payload" ? "usage.plan.error.invalidPayload" : "usage.plan.error.unavailable")), width)] : formatManagedQuotaFooterLines(state.managedQuotaWindows, colors, width);
|
|
505458
505510
|
return [truncateToWidth(line1, width), ...quotaLines];
|
|
505459
505511
|
}
|
|
505460
505512
|
syncGoalClock(goal) {
|
|
@@ -511169,7 +511221,7 @@ var BlunTUI = class {
|
|
|
511169
511221
|
if (this.session !== void 0) {
|
|
511170
511222
|
await this.refreshPersonalMemory(true);
|
|
511171
511223
|
await this.refreshCustomerMistakeConsent();
|
|
511172
|
-
|
|
511224
|
+
this.authFlow.refreshManagedQuotaWindows();
|
|
511173
511225
|
}
|
|
511174
511226
|
this.showTmuxKeyboardWarningIfNeeded();
|
|
511175
511227
|
this.startTelegramChannel();
|
|
@@ -513442,7 +513494,7 @@ var BlunTUI = class {
|
|
|
513442
513494
|
if (applyStartupModes) {
|
|
513443
513495
|
await this.refreshPersonalMemory(true);
|
|
513444
513496
|
await this.refreshCustomerMistakeConsent();
|
|
513445
|
-
|
|
513497
|
+
this.authFlow.refreshManagedQuotaWindows();
|
|
513446
513498
|
await this.promptStartupResumeGoalIfNeeded();
|
|
513447
513499
|
}
|
|
513448
513500
|
}
|