openkrak-mcp 1.0.13 → 1.0.15
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/dist/index.js +121 -99
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1292,7 +1292,7 @@ var require_atomic_sleep = __commonJS({
|
|
|
1292
1292
|
var require_sonic_boom = __commonJS({
|
|
1293
1293
|
"../engine-dorchester/node_modules/sonic-boom/index.js"(exports2, module2) {
|
|
1294
1294
|
"use strict";
|
|
1295
|
-
var
|
|
1295
|
+
var fs6 = require("fs");
|
|
1296
1296
|
var EventEmitter2 = require("events");
|
|
1297
1297
|
var inherits = require("util").inherits;
|
|
1298
1298
|
var path7 = require("path");
|
|
@@ -1346,20 +1346,20 @@ var require_sonic_boom = __commonJS({
|
|
|
1346
1346
|
const mode = sonic.mode;
|
|
1347
1347
|
if (sonic.sync) {
|
|
1348
1348
|
try {
|
|
1349
|
-
if (sonic.mkdir)
|
|
1350
|
-
const fd =
|
|
1349
|
+
if (sonic.mkdir) fs6.mkdirSync(path7.dirname(file), { recursive: true });
|
|
1350
|
+
const fd = fs6.openSync(file, flags, mode);
|
|
1351
1351
|
fileOpened(null, fd);
|
|
1352
1352
|
} catch (err) {
|
|
1353
1353
|
fileOpened(err);
|
|
1354
1354
|
throw err;
|
|
1355
1355
|
}
|
|
1356
1356
|
} else if (sonic.mkdir) {
|
|
1357
|
-
|
|
1357
|
+
fs6.mkdir(path7.dirname(file), { recursive: true }, (err) => {
|
|
1358
1358
|
if (err) return fileOpened(err);
|
|
1359
|
-
|
|
1359
|
+
fs6.open(file, flags, mode, fileOpened);
|
|
1360
1360
|
});
|
|
1361
1361
|
} else {
|
|
1362
|
-
|
|
1362
|
+
fs6.open(file, flags, mode, fileOpened);
|
|
1363
1363
|
}
|
|
1364
1364
|
}
|
|
1365
1365
|
function SonicBoom(opts) {
|
|
@@ -1398,16 +1398,16 @@ var require_sonic_boom = __commonJS({
|
|
|
1398
1398
|
this.flush = flushBuffer;
|
|
1399
1399
|
this.flushSync = flushBufferSync;
|
|
1400
1400
|
this._actualWrite = actualWriteBuffer;
|
|
1401
|
-
fsWriteSync = () =>
|
|
1402
|
-
fsWrite = () =>
|
|
1401
|
+
fsWriteSync = () => fs6.writeSync(this.fd, this._writingBuf);
|
|
1402
|
+
fsWrite = () => fs6.write(this.fd, this._writingBuf, this.release);
|
|
1403
1403
|
} else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
|
|
1404
1404
|
this._writingBuf = "";
|
|
1405
1405
|
this.write = write;
|
|
1406
1406
|
this.flush = flush;
|
|
1407
1407
|
this.flushSync = flushSync;
|
|
1408
1408
|
this._actualWrite = actualWrite;
|
|
1409
|
-
fsWriteSync = () =>
|
|
1410
|
-
fsWrite = () =>
|
|
1409
|
+
fsWriteSync = () => fs6.writeSync(this.fd, this._writingBuf, "utf8");
|
|
1410
|
+
fsWrite = () => fs6.write(this.fd, this._writingBuf, "utf8", this.release);
|
|
1411
1411
|
} else {
|
|
1412
1412
|
throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
|
|
1413
1413
|
}
|
|
@@ -1463,7 +1463,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1463
1463
|
}
|
|
1464
1464
|
}
|
|
1465
1465
|
if (this._fsync) {
|
|
1466
|
-
|
|
1466
|
+
fs6.fsyncSync(this.fd);
|
|
1467
1467
|
}
|
|
1468
1468
|
const len = this._len;
|
|
1469
1469
|
if (this._reopening) {
|
|
@@ -1570,7 +1570,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1570
1570
|
this._flushPending = true;
|
|
1571
1571
|
const onDrain = () => {
|
|
1572
1572
|
if (!this._fsync) {
|
|
1573
|
-
|
|
1573
|
+
fs6.fsync(this.fd, (err) => {
|
|
1574
1574
|
this._flushPending = false;
|
|
1575
1575
|
cb(err);
|
|
1576
1576
|
});
|
|
@@ -1669,7 +1669,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1669
1669
|
const fd = this.fd;
|
|
1670
1670
|
this.once("ready", () => {
|
|
1671
1671
|
if (fd !== this.fd) {
|
|
1672
|
-
|
|
1672
|
+
fs6.close(fd, (err) => {
|
|
1673
1673
|
if (err) {
|
|
1674
1674
|
return this.emit("error", err);
|
|
1675
1675
|
}
|
|
@@ -1718,7 +1718,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1718
1718
|
buf = this._bufs[0];
|
|
1719
1719
|
}
|
|
1720
1720
|
try {
|
|
1721
|
-
const n =
|
|
1721
|
+
const n = fs6.writeSync(this.fd, buf, "utf8");
|
|
1722
1722
|
const releasedBufObj = releaseWritingBuf(buf, this._len, n);
|
|
1723
1723
|
buf = releasedBufObj.writingBuf;
|
|
1724
1724
|
this._len = releasedBufObj.len;
|
|
@@ -1734,7 +1734,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1734
1734
|
}
|
|
1735
1735
|
}
|
|
1736
1736
|
try {
|
|
1737
|
-
|
|
1737
|
+
fs6.fsyncSync(this.fd);
|
|
1738
1738
|
} catch {
|
|
1739
1739
|
}
|
|
1740
1740
|
}
|
|
@@ -1755,7 +1755,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1755
1755
|
buf = mergeBuf(this._bufs[0], this._lens[0]);
|
|
1756
1756
|
}
|
|
1757
1757
|
try {
|
|
1758
|
-
const n =
|
|
1758
|
+
const n = fs6.writeSync(this.fd, buf);
|
|
1759
1759
|
buf = buf.subarray(n);
|
|
1760
1760
|
this._len = Math.max(this._len - n, 0);
|
|
1761
1761
|
if (buf.length <= 0) {
|
|
@@ -1783,13 +1783,13 @@ var require_sonic_boom = __commonJS({
|
|
|
1783
1783
|
this._writingBuf = this._writingBuf || this._bufs.shift() || "";
|
|
1784
1784
|
if (this.sync) {
|
|
1785
1785
|
try {
|
|
1786
|
-
const written =
|
|
1786
|
+
const written = fs6.writeSync(this.fd, this._writingBuf, "utf8");
|
|
1787
1787
|
release(null, written);
|
|
1788
1788
|
} catch (err) {
|
|
1789
1789
|
release(err);
|
|
1790
1790
|
}
|
|
1791
1791
|
} else {
|
|
1792
|
-
|
|
1792
|
+
fs6.write(this.fd, this._writingBuf, "utf8", release);
|
|
1793
1793
|
}
|
|
1794
1794
|
}
|
|
1795
1795
|
function actualWriteBuffer() {
|
|
@@ -1798,13 +1798,13 @@ var require_sonic_boom = __commonJS({
|
|
|
1798
1798
|
this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
|
|
1799
1799
|
if (this.sync) {
|
|
1800
1800
|
try {
|
|
1801
|
-
const written =
|
|
1801
|
+
const written = fs6.writeSync(this.fd, this._writingBuf);
|
|
1802
1802
|
release(null, written);
|
|
1803
1803
|
} catch (err) {
|
|
1804
1804
|
release(err);
|
|
1805
1805
|
}
|
|
1806
1806
|
} else {
|
|
1807
|
-
|
|
1807
|
+
fs6.write(this.fd, this._writingBuf, release);
|
|
1808
1808
|
}
|
|
1809
1809
|
}
|
|
1810
1810
|
function actualClose(sonic) {
|
|
@@ -1815,10 +1815,10 @@ var require_sonic_boom = __commonJS({
|
|
|
1815
1815
|
sonic.destroyed = true;
|
|
1816
1816
|
sonic._bufs = [];
|
|
1817
1817
|
sonic._lens = [];
|
|
1818
|
-
|
|
1818
|
+
fs6.fsync(sonic.fd, closeWrapped);
|
|
1819
1819
|
function closeWrapped() {
|
|
1820
1820
|
if (sonic.fd !== 1 && sonic.fd !== 2) {
|
|
1821
|
-
|
|
1821
|
+
fs6.close(sonic.fd, done);
|
|
1822
1822
|
} else {
|
|
1823
1823
|
done();
|
|
1824
1824
|
}
|
|
@@ -8955,10 +8955,10 @@ var require_typescript = __commonJS({
|
|
|
8955
8955
|
function and(f, g) {
|
|
8956
8956
|
return (arg) => f(arg) && g(arg);
|
|
8957
8957
|
}
|
|
8958
|
-
function or(...
|
|
8958
|
+
function or(...fs6) {
|
|
8959
8959
|
return (...args) => {
|
|
8960
8960
|
let lastResult;
|
|
8961
|
-
for (const f of
|
|
8961
|
+
for (const f of fs6) {
|
|
8962
8962
|
lastResult = f(...args);
|
|
8963
8963
|
if (lastResult) {
|
|
8964
8964
|
return lastResult;
|
|
@@ -10533,7 +10533,7 @@ ${lanes.join("\n")}
|
|
|
10533
10533
|
var tracing;
|
|
10534
10534
|
var tracingEnabled;
|
|
10535
10535
|
((tracingEnabled2) => {
|
|
10536
|
-
let
|
|
10536
|
+
let fs6;
|
|
10537
10537
|
let traceCount = 0;
|
|
10538
10538
|
let traceFd = 0;
|
|
10539
10539
|
let mode;
|
|
@@ -10542,9 +10542,9 @@ ${lanes.join("\n")}
|
|
|
10542
10542
|
const legend = [];
|
|
10543
10543
|
function startTracing2(tracingMode, traceDir, configFilePath) {
|
|
10544
10544
|
Debug.assert(!tracing, "Tracing already started");
|
|
10545
|
-
if (
|
|
10545
|
+
if (fs6 === void 0) {
|
|
10546
10546
|
try {
|
|
10547
|
-
|
|
10547
|
+
fs6 = require("fs");
|
|
10548
10548
|
} catch (e) {
|
|
10549
10549
|
throw new Error(`tracing requires having fs
|
|
10550
10550
|
(original error: ${e.message || e})`);
|
|
@@ -10555,8 +10555,8 @@ ${lanes.join("\n")}
|
|
|
10555
10555
|
if (legendPath === void 0) {
|
|
10556
10556
|
legendPath = combinePaths(traceDir, "legend.json");
|
|
10557
10557
|
}
|
|
10558
|
-
if (!
|
|
10559
|
-
|
|
10558
|
+
if (!fs6.existsSync(traceDir)) {
|
|
10559
|
+
fs6.mkdirSync(traceDir, { recursive: true });
|
|
10560
10560
|
}
|
|
10561
10561
|
const countPart = mode === "build" ? `.${process.pid}-${++traceCount}` : mode === "server" ? `.${process.pid}` : ``;
|
|
10562
10562
|
const tracePath = combinePaths(traceDir, `trace${countPart}.json`);
|
|
@@ -10566,10 +10566,10 @@ ${lanes.join("\n")}
|
|
|
10566
10566
|
tracePath,
|
|
10567
10567
|
typesPath
|
|
10568
10568
|
});
|
|
10569
|
-
traceFd =
|
|
10569
|
+
traceFd = fs6.openSync(tracePath, "w");
|
|
10570
10570
|
tracing = tracingEnabled2;
|
|
10571
10571
|
const meta = { cat: "__metadata", ph: "M", ts: 1e3 * timestamp(), pid: 1, tid: 1 };
|
|
10572
|
-
|
|
10572
|
+
fs6.writeSync(
|
|
10573
10573
|
traceFd,
|
|
10574
10574
|
"[\n" + [{ name: "process_name", args: { name: "tsc" }, ...meta }, { name: "thread_name", args: { name: "Main" }, ...meta }, { name: "TracingStartedInBrowser", ...meta, cat: "disabled-by-default-devtools.timeline" }].map((v) => JSON.stringify(v)).join(",\n")
|
|
10575
10575
|
);
|
|
@@ -10578,10 +10578,10 @@ ${lanes.join("\n")}
|
|
|
10578
10578
|
function stopTracing() {
|
|
10579
10579
|
Debug.assert(tracing, "Tracing is not in progress");
|
|
10580
10580
|
Debug.assert(!!typeCatalog.length === (mode !== "server"));
|
|
10581
|
-
|
|
10581
|
+
fs6.writeSync(traceFd, `
|
|
10582
10582
|
]
|
|
10583
10583
|
`);
|
|
10584
|
-
|
|
10584
|
+
fs6.closeSync(traceFd);
|
|
10585
10585
|
tracing = void 0;
|
|
10586
10586
|
if (typeCatalog.length) {
|
|
10587
10587
|
dumpTypes(typeCatalog);
|
|
@@ -10653,11 +10653,11 @@ ${lanes.join("\n")}
|
|
|
10653
10653
|
function writeEvent(eventType, phase, name, args, extras, time = 1e3 * timestamp()) {
|
|
10654
10654
|
if (mode === "server" && phase === "checkTypes") return;
|
|
10655
10655
|
mark("beginTracing");
|
|
10656
|
-
|
|
10656
|
+
fs6.writeSync(traceFd, `,
|
|
10657
10657
|
{"pid":1,"tid":1,"ph":"${eventType}","cat":"${phase}","ts":${time},"name":"${name}"`);
|
|
10658
|
-
if (extras)
|
|
10659
|
-
if (args)
|
|
10660
|
-
|
|
10658
|
+
if (extras) fs6.writeSync(traceFd, `,${extras}`);
|
|
10659
|
+
if (args) fs6.writeSync(traceFd, `,"args":${JSON.stringify(args)}`);
|
|
10660
|
+
fs6.writeSync(traceFd, `}`);
|
|
10661
10661
|
mark("endTracing");
|
|
10662
10662
|
measure("Tracing", "beginTracing", "endTracing");
|
|
10663
10663
|
}
|
|
@@ -10679,9 +10679,9 @@ ${lanes.join("\n")}
|
|
|
10679
10679
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
|
|
10680
10680
|
mark("beginDumpTypes");
|
|
10681
10681
|
const typesPath = legend[legend.length - 1].typesPath;
|
|
10682
|
-
const typesFd =
|
|
10682
|
+
const typesFd = fs6.openSync(typesPath, "w");
|
|
10683
10683
|
const recursionIdentityMap = /* @__PURE__ */ new Map();
|
|
10684
|
-
|
|
10684
|
+
fs6.writeSync(typesFd, "[");
|
|
10685
10685
|
const numTypes = types2.length;
|
|
10686
10686
|
for (let i = 0; i < numTypes; i++) {
|
|
10687
10687
|
const type = types2[i];
|
|
@@ -10777,13 +10777,13 @@ ${lanes.join("\n")}
|
|
|
10777
10777
|
flags: Debug.formatTypeFlags(type.flags).split("|"),
|
|
10778
10778
|
display
|
|
10779
10779
|
};
|
|
10780
|
-
|
|
10780
|
+
fs6.writeSync(typesFd, JSON.stringify(descriptor));
|
|
10781
10781
|
if (i < numTypes - 1) {
|
|
10782
|
-
|
|
10782
|
+
fs6.writeSync(typesFd, ",\n");
|
|
10783
10783
|
}
|
|
10784
10784
|
}
|
|
10785
|
-
|
|
10786
|
-
|
|
10785
|
+
fs6.writeSync(typesFd, "]\n");
|
|
10786
|
+
fs6.closeSync(typesFd);
|
|
10787
10787
|
mark("endDumpTypes");
|
|
10788
10788
|
measure("Dump types", "beginDumpTypes", "endDumpTypes");
|
|
10789
10789
|
}
|
|
@@ -10791,7 +10791,7 @@ ${lanes.join("\n")}
|
|
|
10791
10791
|
if (!legendPath) {
|
|
10792
10792
|
return;
|
|
10793
10793
|
}
|
|
10794
|
-
|
|
10794
|
+
fs6.writeFileSync(legendPath, JSON.stringify(legend));
|
|
10795
10795
|
}
|
|
10796
10796
|
tracingEnabled2.dumpLegend = dumpLegend;
|
|
10797
10797
|
})(tracingEnabled || (tracingEnabled = {}));
|
|
@@ -225651,7 +225651,7 @@ var require_useProvidedPrograms = __commonJS({
|
|
|
225651
225651
|
exports2.useProvidedPrograms = useProvidedPrograms;
|
|
225652
225652
|
exports2.createProgramFromConfigFile = createProgramFromConfigFile;
|
|
225653
225653
|
var debug_1 = __importDefault(require_src());
|
|
225654
|
-
var
|
|
225654
|
+
var fs6 = __importStar(require("fs"));
|
|
225655
225655
|
var path7 = __importStar(require("path"));
|
|
225656
225656
|
var ts = __importStar(require_typescript());
|
|
225657
225657
|
var shared_1 = require_shared();
|
|
@@ -225684,10 +225684,10 @@ var require_useProvidedPrograms = __commonJS({
|
|
|
225684
225684
|
onUnRecoverableConfigFileDiagnostic: (diag) => {
|
|
225685
225685
|
throw new Error(formatDiagnostics([diag]));
|
|
225686
225686
|
},
|
|
225687
|
-
fileExists:
|
|
225687
|
+
fileExists: fs6.existsSync,
|
|
225688
225688
|
getCurrentDirectory: () => projectDirectory && path7.resolve(projectDirectory) || process.cwd(),
|
|
225689
225689
|
readDirectory: ts.sys.readDirectory,
|
|
225690
|
-
readFile: (file) =>
|
|
225690
|
+
readFile: (file) => fs6.readFileSync(file, "utf-8"),
|
|
225691
225691
|
useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames
|
|
225692
225692
|
});
|
|
225693
225693
|
const result = parsed;
|
|
@@ -225957,7 +225957,7 @@ var require_getProjectConfigFiles = __commonJS({
|
|
|
225957
225957
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
225958
225958
|
exports2.getProjectConfigFiles = getProjectConfigFiles;
|
|
225959
225959
|
var debug_1 = __importDefault(require_src());
|
|
225960
|
-
var
|
|
225960
|
+
var fs6 = __importStar(require("fs"));
|
|
225961
225961
|
var path7 = __importStar(require("path"));
|
|
225962
225962
|
var log = (0, debug_1.default)("typescript-eslint:typescript-estree:getProjectConfigFiles");
|
|
225963
225963
|
function getProjectConfigFiles(parseSettings, project) {
|
|
@@ -225976,7 +225976,7 @@ var require_getProjectConfigFiles = __commonJS({
|
|
|
225976
225976
|
do {
|
|
225977
225977
|
log("Checking tsconfig.json path: %s", directory);
|
|
225978
225978
|
const tsconfigPath = path7.join(directory, "tsconfig.json");
|
|
225979
|
-
const cached = parseSettings.tsconfigMatchCache.get(directory) ?? (
|
|
225979
|
+
const cached = parseSettings.tsconfigMatchCache.get(directory) ?? (fs6.existsSync(tsconfigPath) && tsconfigPath);
|
|
225980
225980
|
if (cached) {
|
|
225981
225981
|
for (const directory2 of checkedDirectories) {
|
|
225982
225982
|
parseSettings.tsconfigMatchCache.set(directory2, cached);
|
|
@@ -229663,8 +229663,8 @@ var require_utils3 = __commonJS({
|
|
|
229663
229663
|
exports2.array = array;
|
|
229664
229664
|
var errno = require_errno();
|
|
229665
229665
|
exports2.errno = errno;
|
|
229666
|
-
var
|
|
229667
|
-
exports2.fs =
|
|
229666
|
+
var fs6 = require_fs();
|
|
229667
|
+
exports2.fs = fs6;
|
|
229668
229668
|
var path7 = require_path();
|
|
229669
229669
|
exports2.path = path7;
|
|
229670
229670
|
var pattern = require_pattern();
|
|
@@ -229848,12 +229848,12 @@ var require_fs2 = __commonJS({
|
|
|
229848
229848
|
"use strict";
|
|
229849
229849
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
229850
229850
|
exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
|
229851
|
-
var
|
|
229851
|
+
var fs6 = require("fs");
|
|
229852
229852
|
exports2.FILE_SYSTEM_ADAPTER = {
|
|
229853
|
-
lstat:
|
|
229854
|
-
stat:
|
|
229855
|
-
lstatSync:
|
|
229856
|
-
statSync:
|
|
229853
|
+
lstat: fs6.lstat,
|
|
229854
|
+
stat: fs6.stat,
|
|
229855
|
+
lstatSync: fs6.lstatSync,
|
|
229856
|
+
statSync: fs6.statSync
|
|
229857
229857
|
};
|
|
229858
229858
|
function createFileSystemAdapter(fsMethods) {
|
|
229859
229859
|
if (fsMethods === void 0) {
|
|
@@ -229870,12 +229870,12 @@ var require_settings = __commonJS({
|
|
|
229870
229870
|
"../engine-dorchester/node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
|
|
229871
229871
|
"use strict";
|
|
229872
229872
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
229873
|
-
var
|
|
229873
|
+
var fs6 = require_fs2();
|
|
229874
229874
|
var Settings = class {
|
|
229875
229875
|
constructor(_options = {}) {
|
|
229876
229876
|
this._options = _options;
|
|
229877
229877
|
this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
|
|
229878
|
-
this.fs =
|
|
229878
|
+
this.fs = fs6.createFileSystemAdapter(this._options.fs);
|
|
229879
229879
|
this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
|
|
229880
229880
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
229881
229881
|
}
|
|
@@ -230032,8 +230032,8 @@ var require_utils4 = __commonJS({
|
|
|
230032
230032
|
"use strict";
|
|
230033
230033
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
230034
230034
|
exports2.fs = void 0;
|
|
230035
|
-
var
|
|
230036
|
-
exports2.fs =
|
|
230035
|
+
var fs6 = require_fs3();
|
|
230036
|
+
exports2.fs = fs6;
|
|
230037
230037
|
}
|
|
230038
230038
|
});
|
|
230039
230039
|
|
|
@@ -230228,14 +230228,14 @@ var require_fs4 = __commonJS({
|
|
|
230228
230228
|
"use strict";
|
|
230229
230229
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
230230
230230
|
exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
|
230231
|
-
var
|
|
230231
|
+
var fs6 = require("fs");
|
|
230232
230232
|
exports2.FILE_SYSTEM_ADAPTER = {
|
|
230233
|
-
lstat:
|
|
230234
|
-
stat:
|
|
230235
|
-
lstatSync:
|
|
230236
|
-
statSync:
|
|
230237
|
-
readdir:
|
|
230238
|
-
readdirSync:
|
|
230233
|
+
lstat: fs6.lstat,
|
|
230234
|
+
stat: fs6.stat,
|
|
230235
|
+
lstatSync: fs6.lstatSync,
|
|
230236
|
+
statSync: fs6.statSync,
|
|
230237
|
+
readdir: fs6.readdir,
|
|
230238
|
+
readdirSync: fs6.readdirSync
|
|
230239
230239
|
};
|
|
230240
230240
|
function createFileSystemAdapter(fsMethods) {
|
|
230241
230241
|
if (fsMethods === void 0) {
|
|
@@ -230254,12 +230254,12 @@ var require_settings2 = __commonJS({
|
|
|
230254
230254
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
230255
230255
|
var path7 = require("path");
|
|
230256
230256
|
var fsStat = require_out();
|
|
230257
|
-
var
|
|
230257
|
+
var fs6 = require_fs4();
|
|
230258
230258
|
var Settings = class {
|
|
230259
230259
|
constructor(_options = {}) {
|
|
230260
230260
|
this._options = _options;
|
|
230261
230261
|
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
|
230262
|
-
this.fs =
|
|
230262
|
+
this.fs = fs6.createFileSystemAdapter(this._options.fs);
|
|
230263
230263
|
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path7.sep);
|
|
230264
230264
|
this.stats = this._getValue(this._options.stats, false);
|
|
230265
230265
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
@@ -231640,16 +231640,16 @@ var require_settings4 = __commonJS({
|
|
|
231640
231640
|
"use strict";
|
|
231641
231641
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
231642
231642
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
231643
|
-
var
|
|
231643
|
+
var fs6 = require("fs");
|
|
231644
231644
|
var os = require("os");
|
|
231645
231645
|
var CPU_COUNT = Math.max(os.cpus().length, 1);
|
|
231646
231646
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
231647
|
-
lstat:
|
|
231648
|
-
lstatSync:
|
|
231649
|
-
stat:
|
|
231650
|
-
statSync:
|
|
231651
|
-
readdir:
|
|
231652
|
-
readdirSync:
|
|
231647
|
+
lstat: fs6.lstat,
|
|
231648
|
+
lstatSync: fs6.lstatSync,
|
|
231649
|
+
stat: fs6.stat,
|
|
231650
|
+
statSync: fs6.statSync,
|
|
231651
|
+
readdir: fs6.readdir,
|
|
231652
|
+
readdirSync: fs6.readdirSync
|
|
231653
231653
|
};
|
|
231654
231654
|
var Settings = class {
|
|
231655
231655
|
constructor(_options = {}) {
|
|
@@ -231800,13 +231800,13 @@ var require_path_type = __commonJS({
|
|
|
231800
231800
|
"../engine-dorchester/node_modules/path-type/index.js"(exports2) {
|
|
231801
231801
|
"use strict";
|
|
231802
231802
|
var { promisify } = require("util");
|
|
231803
|
-
var
|
|
231803
|
+
var fs6 = require("fs");
|
|
231804
231804
|
async function isType(fsStatType, statsMethodName, filePath) {
|
|
231805
231805
|
if (typeof filePath !== "string") {
|
|
231806
231806
|
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
231807
231807
|
}
|
|
231808
231808
|
try {
|
|
231809
|
-
const stats = await promisify(
|
|
231809
|
+
const stats = await promisify(fs6[fsStatType])(filePath);
|
|
231810
231810
|
return stats[statsMethodName]();
|
|
231811
231811
|
} catch (error) {
|
|
231812
231812
|
if (error.code === "ENOENT") {
|
|
@@ -231820,7 +231820,7 @@ var require_path_type = __commonJS({
|
|
|
231820
231820
|
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
231821
231821
|
}
|
|
231822
231822
|
try {
|
|
231823
|
-
return
|
|
231823
|
+
return fs6[fsStatType](filePath)[statsMethodName]();
|
|
231824
231824
|
} catch (error) {
|
|
231825
231825
|
if (error.code === "ENOENT") {
|
|
231826
231826
|
return false;
|
|
@@ -232308,7 +232308,7 @@ var require_gitignore = __commonJS({
|
|
|
232308
232308
|
"../engine-dorchester/node_modules/globby/gitignore.js"(exports2, module2) {
|
|
232309
232309
|
"use strict";
|
|
232310
232310
|
var { promisify } = require("util");
|
|
232311
|
-
var
|
|
232311
|
+
var fs6 = require("fs");
|
|
232312
232312
|
var path7 = require("path");
|
|
232313
232313
|
var fastGlob = require_out4();
|
|
232314
232314
|
var gitIgnore = require_ignore();
|
|
@@ -232319,7 +232319,7 @@ var require_gitignore = __commonJS({
|
|
|
232319
232319
|
"**/coverage/**",
|
|
232320
232320
|
"**/.git"
|
|
232321
232321
|
];
|
|
232322
|
-
var readFileP = promisify(
|
|
232322
|
+
var readFileP = promisify(fs6.readFile);
|
|
232323
232323
|
var mapGitIgnorePatternTo = (base) => (ignore) => {
|
|
232324
232324
|
if (ignore.startsWith("!")) {
|
|
232325
232325
|
return "!" + path7.posix.join(base, ignore.slice(1));
|
|
@@ -232364,7 +232364,7 @@ var require_gitignore = __commonJS({
|
|
|
232364
232364
|
};
|
|
232365
232365
|
var getFileSync = (file, cwd) => {
|
|
232366
232366
|
const filePath = path7.join(cwd, file);
|
|
232367
|
-
const content =
|
|
232367
|
+
const content = fs6.readFileSync(filePath, "utf8");
|
|
232368
232368
|
return {
|
|
232369
232369
|
cwd,
|
|
232370
232370
|
filePath,
|
|
@@ -232448,7 +232448,7 @@ var require_stream_utils = __commonJS({
|
|
|
232448
232448
|
var require_globby = __commonJS({
|
|
232449
232449
|
"../engine-dorchester/node_modules/globby/index.js"(exports2, module2) {
|
|
232450
232450
|
"use strict";
|
|
232451
|
-
var
|
|
232451
|
+
var fs6 = require("fs");
|
|
232452
232452
|
var arrayUnion = require_array_union();
|
|
232453
232453
|
var merge2 = require_merge2();
|
|
232454
232454
|
var fastGlob = require_out4();
|
|
@@ -232468,7 +232468,7 @@ var require_globby = __commonJS({
|
|
|
232468
232468
|
}
|
|
232469
232469
|
let stat;
|
|
232470
232470
|
try {
|
|
232471
|
-
stat =
|
|
232471
|
+
stat = fs6.statSync(options.cwd);
|
|
232472
232472
|
} catch {
|
|
232473
232473
|
return;
|
|
232474
232474
|
}
|
|
@@ -232476,7 +232476,7 @@ var require_globby = __commonJS({
|
|
|
232476
232476
|
throw new Error("The `cwd` option must be a path to a directory");
|
|
232477
232477
|
}
|
|
232478
232478
|
};
|
|
232479
|
-
var getPathString = (p) => p.stats instanceof
|
|
232479
|
+
var getPathString = (p) => p.stats instanceof fs6.Stats ? p.path : p;
|
|
232480
232480
|
var generateGlobTasks = (patterns, taskOptions) => {
|
|
232481
232481
|
patterns = arrayUnion([].concat(patterns));
|
|
232482
232482
|
assertPatternsInput(patterns);
|
|
@@ -239924,8 +239924,8 @@ var PathScurryBase = class {
|
|
|
239924
239924
|
*
|
|
239925
239925
|
* @internal
|
|
239926
239926
|
*/
|
|
239927
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
239928
|
-
this.#fs = fsFromOption(
|
|
239927
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs6 = defaultFS } = {}) {
|
|
239928
|
+
this.#fs = fsFromOption(fs6);
|
|
239929
239929
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
239930
239930
|
cwd = (0, import_node_url.fileURLToPath)(cwd);
|
|
239931
239931
|
}
|
|
@@ -240483,8 +240483,8 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
240483
240483
|
/**
|
|
240484
240484
|
* @internal
|
|
240485
240485
|
*/
|
|
240486
|
-
newRoot(
|
|
240487
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
240486
|
+
newRoot(fs6) {
|
|
240487
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs6 });
|
|
240488
240488
|
}
|
|
240489
240489
|
/**
|
|
240490
240490
|
* Return true if the provided path string is an absolute path
|
|
@@ -240512,8 +240512,8 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
240512
240512
|
/**
|
|
240513
240513
|
* @internal
|
|
240514
240514
|
*/
|
|
240515
|
-
newRoot(
|
|
240516
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
240515
|
+
newRoot(fs6) {
|
|
240516
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs6 });
|
|
240517
240517
|
}
|
|
240518
240518
|
/**
|
|
240519
240519
|
* Return true if the provided path string is an absolute path
|
|
@@ -241601,6 +241601,7 @@ var import_fs2 = __toESM(require("fs"), 1);
|
|
|
241601
241601
|
var import_typescript_estree2 = __toESM(require_dist3(), 1);
|
|
241602
241602
|
var import_typescript_estree3 = __toESM(require_dist3(), 1);
|
|
241603
241603
|
var import_path3 = __toESM(require("path"), 1);
|
|
241604
|
+
var import_fs3 = __toESM(require("fs"), 1);
|
|
241604
241605
|
var import_crypto2 = require("crypto");
|
|
241605
241606
|
var import_promises3 = __toESM(require("fs/promises"), 1);
|
|
241606
241607
|
var import_path4 = __toESM(require("path"), 1);
|
|
@@ -241794,7 +241795,27 @@ function inferLanguage(filePath) {
|
|
|
241794
241795
|
if (filePath.endsWith(".js") || filePath.endsWith(".jsx")) return "javascript";
|
|
241795
241796
|
return "unknown";
|
|
241796
241797
|
}
|
|
241797
|
-
function
|
|
241798
|
+
function readTsconfigPaths(repoRoot) {
|
|
241799
|
+
const aliases = {};
|
|
241800
|
+
try {
|
|
241801
|
+
const tsconfigPath = import_path3.default.join(repoRoot, "tsconfig.json");
|
|
241802
|
+
if (!import_fs3.default.existsSync(tsconfigPath)) return aliases;
|
|
241803
|
+
const raw = import_fs3.default.readFileSync(tsconfigPath, "utf-8");
|
|
241804
|
+
const stripped = raw.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
241805
|
+
const tsconfig = JSON.parse(stripped);
|
|
241806
|
+
const paths = tsconfig?.compilerOptions?.paths ?? {};
|
|
241807
|
+
for (const [alias, targets] of Object.entries(paths)) {
|
|
241808
|
+
if (Array.isArray(targets) && targets.length > 0) {
|
|
241809
|
+
const prefix = alias.replace(/\*$/, "");
|
|
241810
|
+
const target = targets[0].replace(/\*$/, "");
|
|
241811
|
+
aliases[prefix] = target;
|
|
241812
|
+
}
|
|
241813
|
+
}
|
|
241814
|
+
} catch {
|
|
241815
|
+
}
|
|
241816
|
+
return aliases;
|
|
241817
|
+
}
|
|
241818
|
+
function extractRawEdges(filePath, ast, fileNodeId, tsconfigPaths) {
|
|
241798
241819
|
const edges = [];
|
|
241799
241820
|
const symbolRanges = [];
|
|
241800
241821
|
(0, import_typescript_estree3.simpleTraverse)(ast, {
|
|
@@ -241845,7 +241866,7 @@ function extractRawEdges(filePath, ast, fileNodeId, tsconfigPaths2) {
|
|
|
241845
241866
|
if (node.type === "ImportDeclaration") {
|
|
241846
241867
|
const importPath = node.source.value;
|
|
241847
241868
|
const line = node.loc?.start.line ?? null;
|
|
241848
|
-
const resolvedTarget = resolveImportTarget(filePath, importPath,
|
|
241869
|
+
const resolvedTarget = resolveImportTarget(filePath, importPath, tsconfigPaths);
|
|
241849
241870
|
edges.push({
|
|
241850
241871
|
from: importFromNodeId,
|
|
241851
241872
|
to: resolvedTarget,
|
|
@@ -241874,7 +241895,7 @@ function extractRawEdges(filePath, ast, fileNodeId, tsconfigPaths2) {
|
|
|
241874
241895
|
const sourceLiteral = node.source.type === "Literal" ? node.source.value : "<dynamic>";
|
|
241875
241896
|
edges.push({
|
|
241876
241897
|
from: fileNodeId,
|
|
241877
|
-
to: resolveImportTarget(filePath, sourceLiteral,
|
|
241898
|
+
to: resolveImportTarget(filePath, sourceLiteral, tsconfigPaths),
|
|
241878
241899
|
kind: "dynamic_import",
|
|
241879
241900
|
file: filePath,
|
|
241880
241901
|
line,
|
|
@@ -241952,7 +241973,7 @@ function extractRawEdges(filePath, ast, fileNodeId, tsconfigPaths2) {
|
|
|
241952
241973
|
});
|
|
241953
241974
|
return edges;
|
|
241954
241975
|
}
|
|
241955
|
-
function extractBarrelReExports(filePath, ast,
|
|
241976
|
+
function extractBarrelReExports(filePath, ast, tsconfigPaths) {
|
|
241956
241977
|
const reExports = [];
|
|
241957
241978
|
(0, import_typescript_estree3.simpleTraverse)(ast, {
|
|
241958
241979
|
enter(node) {
|
|
@@ -241960,7 +241981,7 @@ function extractBarrelReExports(filePath, ast, tsconfigPaths2) {
|
|
|
241960
241981
|
if (!node.source) return;
|
|
241961
241982
|
const sourcePath = node.source.value;
|
|
241962
241983
|
if (!sourcePath.startsWith(".")) return;
|
|
241963
|
-
const resolvedSource = resolveImportTarget(filePath, sourcePath,
|
|
241984
|
+
const resolvedSource = resolveImportTarget(filePath, sourcePath, tsconfigPaths);
|
|
241964
241985
|
if (node.type === "ExportAllDeclaration") {
|
|
241965
241986
|
reExports.push({
|
|
241966
241987
|
barrelFile: filePath,
|
|
@@ -241983,7 +242004,7 @@ function extractBarrelReExports(filePath, ast, tsconfigPaths2) {
|
|
|
241983
242004
|
});
|
|
241984
242005
|
return reExports;
|
|
241985
242006
|
}
|
|
241986
|
-
function resolveImportTarget(fromFile, importPath,
|
|
242007
|
+
function resolveImportTarget(fromFile, importPath, tsconfigPaths) {
|
|
241987
242008
|
if (importPath.startsWith(".")) {
|
|
241988
242009
|
const dir = import_path3.default.dirname(fromFile);
|
|
241989
242010
|
const resolved = import_path3.default.join(dir, importPath).replace(/\\/g, "/");
|
|
@@ -241993,8 +242014,8 @@ function resolveImportTarget(fromFile, importPath, tsconfigPaths2) {
|
|
|
241993
242014
|
}
|
|
241994
242015
|
return normalized;
|
|
241995
242016
|
}
|
|
241996
|
-
if (
|
|
241997
|
-
for (const [prefix, target] of Object.entries(
|
|
242017
|
+
if (tsconfigPaths) {
|
|
242018
|
+
for (const [prefix, target] of Object.entries(tsconfigPaths)) {
|
|
241998
242019
|
if (importPath.startsWith(prefix)) {
|
|
241999
242020
|
const rest = importPath.slice(prefix.length);
|
|
242000
242021
|
const resolved = (target + rest).replace(/\\/g, "/");
|
|
@@ -242617,6 +242638,7 @@ async function runDeepStrike(store, opts) {
|
|
|
242617
242638
|
log.info({ event: "deepstrike.start", repo_root: opts.repoRoot }, "DeepStrike started");
|
|
242618
242639
|
const relFiles = await discoverFiles(opts.repoRoot);
|
|
242619
242640
|
log.info({ event: "file_discovery.complete", count: relFiles.length }, "Files discovered");
|
|
242641
|
+
const tsconfigPaths = readTsconfigPaths(opts.repoRoot);
|
|
242620
242642
|
const prevHashMap = new Map(
|
|
242621
242643
|
(opts.previousFileIndex ?? []).map((e) => [e.path, e.content_hash])
|
|
242622
242644
|
);
|