exoproc 0.6.4 → 0.6.7
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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +212 -116
- package/dist/commands/compile.js +0 -1
- package/dist/commands/exec.js +0 -1
- package/dist/commands/ps.js +0 -1
- package/dist/commands/run.js +0 -1
- package/dist/commands/screenshot.js +0 -1
- package/dist/commands/windows.js +0 -1
- package/dist/doctor/index.js +0 -1
- package/dist/index.js +173 -157
- package/dist/setup/clients.d.ts.map +1 -1
- package/dist/setup/clients.js +7 -13
- package/dist/setup/config-writer.d.ts.map +1 -1
- package/dist/setup/config-writer.js +19 -11
- package/dist/setup/index.d.ts.map +1 -1
- package/dist/setup/index.js +40 -24
- package/dist/setup/skill-installer.js +0 -1
- package/dist/setup/types.js +0 -1
- package/package.json +2 -2
- package/dist/capstone.dll +0 -0
- package/dist/cli.js.map +0 -1
- package/dist/commands/compile.js.map +0 -1
- package/dist/commands/exec.js.map +0 -1
- package/dist/commands/ps.js.map +0 -1
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/screenshot.js.map +0 -1
- package/dist/commands/windows.js.map +0 -1
- package/dist/deps/capstone.dll +0 -0
- package/dist/deps/ecj-3.26.0.jar +0 -0
- package/dist/deps/ecj-3.46.100.jar +0 -0
- package/dist/deps/tiny-remapper-0.14.1-fat.jar +0 -0
- package/dist/doctor/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/setup/clients.js.map +0 -1
- package/dist/setup/config-writer.js.map +0 -1
- package/dist/setup/index.js.map +0 -1
- package/dist/setup/skill-installer.js.map +0 -1
- package/dist/setup/types.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -85286,7 +85286,7 @@ var package_default;
|
|
|
85286
85286
|
var init_package = __esm(() => {
|
|
85287
85287
|
package_default = {
|
|
85288
85288
|
name: "exoproc-mcp",
|
|
85289
|
-
version: "0.6.
|
|
85289
|
+
version: "0.6.5",
|
|
85290
85290
|
description: "Dedicated Model Context Protocol (MCP) server for native Windows x64 reverse engineering, thread hijacking, function hooking, memory inspection, and JVM analysis.",
|
|
85291
85291
|
main: "./dist/index.js",
|
|
85292
85292
|
bin: {
|
|
@@ -90902,7 +90902,7 @@ var init_cgenerator = __esm(() => {
|
|
|
90902
90902
|
|
|
90903
90903
|
// packages/xffi/dist/cjit.js
|
|
90904
90904
|
import { cc as cc2, toArrayBuffer as toArrayBuffer2 } from "bun:ffi";
|
|
90905
|
-
import { writeFileSync as writeFileSync4, readFileSync as readFileSync4, existsSync as
|
|
90905
|
+
import { writeFileSync as writeFileSync4, readFileSync as readFileSync4, existsSync as existsSync7, unlinkSync as unlinkSync2 } from "fs";
|
|
90906
90906
|
import { join as join7 } from "path";
|
|
90907
90907
|
import { tmpdir as tmpdir4 } from "os";
|
|
90908
90908
|
import { randomBytes as randomBytes3 } from "crypto";
|
|
@@ -91015,7 +91015,7 @@ function cjitopen(symbols, options) {
|
|
|
91015
91015
|
});
|
|
91016
91016
|
const sharedHash = Bun.hash(sharedHeaderContent).toString(16);
|
|
91017
91017
|
const sharedHeaderFile = join7(tmpdir4(), `xffi-shared-header-${sharedHash}.h`);
|
|
91018
|
-
if (!
|
|
91018
|
+
if (!existsSync7(sharedHeaderFile)) {
|
|
91019
91019
|
try {
|
|
91020
91020
|
writeFileSync4(sharedHeaderFile, sharedHeaderContent, "utf8");
|
|
91021
91021
|
} catch {}
|
|
@@ -91037,7 +91037,7 @@ function cjitopen(symbols, options) {
|
|
|
91037
91037
|
const ccSymbols = {};
|
|
91038
91038
|
const hash = Bun.hash(headerSource).toString(16);
|
|
91039
91039
|
const headerFile = join7(tmpdir4(), `xffi-jit-header-${hash}.h`);
|
|
91040
|
-
if (!
|
|
91040
|
+
if (!existsSync7(headerFile)) {
|
|
91041
91041
|
try {
|
|
91042
91042
|
writeFileSync4(headerFile, headerSource, "utf8");
|
|
91043
91043
|
} catch {}
|
|
@@ -92532,7 +92532,7 @@ var init_logger = __esm(() => {
|
|
|
92532
92532
|
});
|
|
92533
92533
|
|
|
92534
92534
|
// packages/utils/dist/cache.js
|
|
92535
|
-
import { existsSync as
|
|
92535
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync5, rmSync as rmSync3 } from "fs";
|
|
92536
92536
|
import { tmpdir as tmpdir5 } from "os";
|
|
92537
92537
|
import { join as join8 } from "path";
|
|
92538
92538
|
function getCacheDir2(subpath) {
|
|
@@ -92559,7 +92559,7 @@ function getCacheDir2(subpath) {
|
|
|
92559
92559
|
}
|
|
92560
92560
|
}
|
|
92561
92561
|
const finalDir = subpath ? join8(baseDir, subpath) : baseDir;
|
|
92562
|
-
if (!
|
|
92562
|
+
if (!existsSync8(finalDir)) {
|
|
92563
92563
|
try {
|
|
92564
92564
|
mkdirSync5(finalDir, { recursive: true });
|
|
92565
92565
|
} catch {}
|
|
@@ -92572,9 +92572,9 @@ function getAgentCacheDir2() {
|
|
|
92572
92572
|
var init_cache = () => {};
|
|
92573
92573
|
|
|
92574
92574
|
// packages/utils/dist/downloader.js
|
|
92575
|
-
import { createWriteStream as createWriteStream2, mkdirSync as mkdirSync6, createReadStream as createReadStream2, existsSync as
|
|
92575
|
+
import { createWriteStream as createWriteStream2, mkdirSync as mkdirSync6, createReadStream as createReadStream2, existsSync as existsSync9, readFileSync as readFileSync5, readdirSync as readdirSync2, statSync as statSync2, copyFileSync as copyFileSync3 } from "fs";
|
|
92576
92576
|
import { rmSync as rmSync4 } from "fs";
|
|
92577
|
-
import { join as join9, dirname as dirname5, basename as
|
|
92577
|
+
import { join as join9, dirname as dirname5, basename as basename3, resolve as resolve2, isAbsolute as isAbsolute2 } from "path";
|
|
92578
92578
|
import { tmpdir as tmpdir6 } from "os";
|
|
92579
92579
|
import { randomBytes as randomBytes4, createHash as createHash2 } from "crypto";
|
|
92580
92580
|
import { execSync as execSync2 } from "child_process";
|
|
@@ -92586,7 +92586,7 @@ function computeHash2(filePath, algorithm = "sha1") {
|
|
|
92586
92586
|
return createHash2(algorithm).update(fileBuffer).digest("hex");
|
|
92587
92587
|
}
|
|
92588
92588
|
function verifyChecksum2(filePath, dep) {
|
|
92589
|
-
if (!
|
|
92589
|
+
if (!existsSync9(filePath))
|
|
92590
92590
|
return false;
|
|
92591
92591
|
try {
|
|
92592
92592
|
if (dep.sha1) {
|
|
@@ -92614,7 +92614,7 @@ function downloadFileSync2(url, destPath) {
|
|
|
92614
92614
|
stdio: ["ignore", "pipe", "pipe"],
|
|
92615
92615
|
timeout: 120000
|
|
92616
92616
|
});
|
|
92617
|
-
if (
|
|
92617
|
+
if (existsSync9(destPath) && statSync2(destPath).size > 0) {
|
|
92618
92618
|
return;
|
|
92619
92619
|
}
|
|
92620
92620
|
} catch {
|
|
@@ -92623,7 +92623,7 @@ function downloadFileSync2(url, destPath) {
|
|
|
92623
92623
|
stdio: ["ignore", "pipe", "pipe"],
|
|
92624
92624
|
timeout: 120000
|
|
92625
92625
|
});
|
|
92626
|
-
if (
|
|
92626
|
+
if (existsSync9(destPath) && statSync2(destPath).size > 0) {
|
|
92627
92627
|
return;
|
|
92628
92628
|
}
|
|
92629
92629
|
}
|
|
@@ -92653,7 +92653,7 @@ function extractEntryFromZipSync2(zipPath, destFile, entryName) {
|
|
|
92653
92653
|
execSync2(`unzip -p "${zipPath}" "*${entryName}" > "${destFile}"`, {
|
|
92654
92654
|
stdio: ["ignore", "pipe", "pipe"]
|
|
92655
92655
|
});
|
|
92656
|
-
if (
|
|
92656
|
+
if (existsSync9(destFile) && statSync2(destFile).size > 0)
|
|
92657
92657
|
return;
|
|
92658
92658
|
} catch {}
|
|
92659
92659
|
const pyScript = `
|
|
@@ -92686,7 +92686,7 @@ function findFileRecursive2(dir, targetName) {
|
|
|
92686
92686
|
return null;
|
|
92687
92687
|
}
|
|
92688
92688
|
function resolveDepPath2(dep, packageDir) {
|
|
92689
|
-
const filename =
|
|
92689
|
+
const filename = basename3(dep.target);
|
|
92690
92690
|
if (packageDir) {
|
|
92691
92691
|
const localTarget = isAbsolute2(dep.target) ? dep.target : resolve2(packageDir, dep.target);
|
|
92692
92692
|
if (verifyChecksum2(localTarget, dep)) {
|
|
@@ -92715,7 +92715,7 @@ function resolveOrDownloadDepSync2(dep, packageDir, options = {}) {
|
|
|
92715
92715
|
return existing;
|
|
92716
92716
|
}
|
|
92717
92717
|
}
|
|
92718
|
-
const filename =
|
|
92718
|
+
const filename = basename3(dep.target);
|
|
92719
92719
|
const cacheDest = join9(getDepsCacheDir2(), filename);
|
|
92720
92720
|
const tempDir = join9(tmpdir6(), `exoproc-dep-sync-${randomBytes4(6).toString("hex")}`);
|
|
92721
92721
|
mkdirSync6(tempDir, { recursive: true });
|
|
@@ -93127,7 +93127,7 @@ var init_debug_helper = __esm(() => {
|
|
|
93127
93127
|
});
|
|
93128
93128
|
|
|
93129
93129
|
// packages/xffi/dist/middleware-accessor.js
|
|
93130
|
-
import { writeFileSync as writeFileSync5, readFileSync as readFileSync6, existsSync as
|
|
93130
|
+
import { writeFileSync as writeFileSync5, readFileSync as readFileSync6, existsSync as existsSync10, mkdirSync as mkdirSync7, unlinkSync as unlinkSync3, openSync, closeSync, statSync as statSync3 } from "fs";
|
|
93131
93131
|
import { resolve as resolve3, dirname as dirname6 } from "path";
|
|
93132
93132
|
function runInCall(fn) {
|
|
93133
93133
|
const ctx = getActiveContext();
|
|
@@ -93145,7 +93145,7 @@ function isInittableAccessor(obj2) {
|
|
|
93145
93145
|
function withFileLockSync(filePath, fn, timeoutMs = 5000) {
|
|
93146
93146
|
const absTarget = resolve3(filePath);
|
|
93147
93147
|
const dir = dirname6(absTarget);
|
|
93148
|
-
if (!
|
|
93148
|
+
if (!existsSync10(dir)) {
|
|
93149
93149
|
mkdirSync7(dir, { recursive: true });
|
|
93150
93150
|
}
|
|
93151
93151
|
const lockPath = `${absTarget}.lock`;
|
|
@@ -93186,7 +93186,7 @@ function withFileLockSync(filePath, fn, timeoutMs = 5000) {
|
|
|
93186
93186
|
} catch {}
|
|
93187
93187
|
}
|
|
93188
93188
|
try {
|
|
93189
|
-
if (
|
|
93189
|
+
if (existsSync10(lockPath)) {
|
|
93190
93190
|
unlinkSync3(lockPath);
|
|
93191
93191
|
}
|
|
93192
93192
|
} catch {}
|
|
@@ -93195,7 +93195,7 @@ function withFileLockSync(filePath, fn, timeoutMs = 5000) {
|
|
|
93195
93195
|
async function withFileLock(filePath, fn, timeoutMs = 5000) {
|
|
93196
93196
|
const absTarget = resolve3(filePath);
|
|
93197
93197
|
const dir = dirname6(absTarget);
|
|
93198
|
-
if (!
|
|
93198
|
+
if (!existsSync10(dir)) {
|
|
93199
93199
|
mkdirSync7(dir, { recursive: true });
|
|
93200
93200
|
}
|
|
93201
93201
|
const lockPath = `${absTarget}.lock`;
|
|
@@ -93235,7 +93235,7 @@ async function withFileLock(filePath, fn, timeoutMs = 5000) {
|
|
|
93235
93235
|
} catch {}
|
|
93236
93236
|
}
|
|
93237
93237
|
try {
|
|
93238
|
-
if (
|
|
93238
|
+
if (existsSync10(lockPath)) {
|
|
93239
93239
|
unlinkSync3(lockPath);
|
|
93240
93240
|
}
|
|
93241
93241
|
} catch {}
|
|
@@ -93834,7 +93834,7 @@ var init_middleware_accessor = __esm(() => {
|
|
|
93834
93834
|
const session = this.toJSON();
|
|
93835
93835
|
withFileLockSync(absPath, () => {
|
|
93836
93836
|
const dir = dirname6(absPath);
|
|
93837
|
-
if (!
|
|
93837
|
+
if (!existsSync10(dir)) {
|
|
93838
93838
|
mkdirSync7(dir, { recursive: true });
|
|
93839
93839
|
}
|
|
93840
93840
|
writeFileSync5(absPath, JSON.stringify(session, null, 2), "utf8");
|
|
@@ -93853,7 +93853,7 @@ var init_middleware_accessor = __esm(() => {
|
|
|
93853
93853
|
const session = this.toJSON();
|
|
93854
93854
|
await withFileLock(absPath, async () => {
|
|
93855
93855
|
const dir = dirname6(absPath);
|
|
93856
|
-
if (!
|
|
93856
|
+
if (!existsSync10(dir)) {
|
|
93857
93857
|
mkdirSync7(dir, { recursive: true });
|
|
93858
93858
|
}
|
|
93859
93859
|
writeFileSync5(absPath, JSON.stringify(session, null, 2), "utf8");
|
|
@@ -93871,7 +93871,7 @@ var init_middleware_accessor = __esm(() => {
|
|
|
93871
93871
|
static loadSession(filePath) {
|
|
93872
93872
|
const absPath = resolve3(filePath);
|
|
93873
93873
|
return withFileLockSync(absPath, () => {
|
|
93874
|
-
if (!
|
|
93874
|
+
if (!existsSync10(absPath)) {
|
|
93875
93875
|
throw new Error(`HostAccessor session file not found: ${absPath}`);
|
|
93876
93876
|
}
|
|
93877
93877
|
const raw = readFileSync6(absPath, "utf8");
|
|
@@ -93891,7 +93891,7 @@ var init_middleware_accessor = __esm(() => {
|
|
|
93891
93891
|
const shouldConsume = overrideOptions?.consume !== false;
|
|
93892
93892
|
let session;
|
|
93893
93893
|
await withFileLock(absPath, async () => {
|
|
93894
|
-
if (!
|
|
93894
|
+
if (!existsSync10(absPath)) {
|
|
93895
93895
|
throw new Error(`HostAccessor session file not found: ${absPath}`);
|
|
93896
93896
|
}
|
|
93897
93897
|
const raw = readFileSync6(absPath, "utf8");
|
|
@@ -102101,7 +102101,7 @@ function parseClassBytecode(bytes) {
|
|
|
102101
102101
|
}
|
|
102102
102102
|
|
|
102103
102103
|
// packages/java/jjit/dist/remapper.js
|
|
102104
|
-
import { copyFileSync as copyFileSync4, existsSync as
|
|
102104
|
+
import { copyFileSync as copyFileSync4, existsSync as existsSync11, mkdirSync as mkdirSync8, readFileSync as readFileSync7, rmSync as rmSync5, statSync as statSync4, writeFileSync as writeFileSync6 } from "fs";
|
|
102105
102105
|
import { spawnSync } from "child_process";
|
|
102106
102106
|
import { tmpdir as tmpdir7 } from "os";
|
|
102107
102107
|
import { join as join10, resolve as resolve4 } from "path";
|
|
@@ -102119,7 +102119,7 @@ function resolveTinyRemapperJarPath() {
|
|
|
102119
102119
|
const jarName = "tiny-remapper-0.14.1-fat.jar";
|
|
102120
102120
|
try {
|
|
102121
102121
|
const cached = join10(getDepsCacheDir2(), jarName);
|
|
102122
|
-
if (
|
|
102122
|
+
if (existsSync11(cached)) {
|
|
102123
102123
|
return resolve4(cached);
|
|
102124
102124
|
}
|
|
102125
102125
|
} catch {}
|
|
@@ -102140,7 +102140,7 @@ function resolveTinyRemapperJarPath() {
|
|
|
102140
102140
|
];
|
|
102141
102141
|
for (const dir of candidateDirs) {
|
|
102142
102142
|
const candidate = join10(dir, jarName);
|
|
102143
|
-
if (
|
|
102143
|
+
if (existsSync11(candidate)) {
|
|
102144
102144
|
return resolve4(candidate);
|
|
102145
102145
|
}
|
|
102146
102146
|
}
|
|
@@ -102356,7 +102356,7 @@ async function remapJava(options) {
|
|
|
102356
102356
|
mkdirSync8(outDir, { recursive: true });
|
|
102357
102357
|
try {
|
|
102358
102358
|
if (typeof options.input === "string") {
|
|
102359
|
-
if (
|
|
102359
|
+
if (existsSync11(options.input)) {
|
|
102360
102360
|
const st = statSync4(options.input);
|
|
102361
102361
|
if (st.isDirectory()) {
|
|
102362
102362
|
inputDir = options.input;
|
|
@@ -102383,7 +102383,7 @@ async function remapJava(options) {
|
|
|
102383
102383
|
}
|
|
102384
102384
|
let mappingFile;
|
|
102385
102385
|
let tinyContent = "";
|
|
102386
|
-
if (typeof options.mappings === "string" &&
|
|
102386
|
+
if (typeof options.mappings === "string" && existsSync11(options.mappings)) {
|
|
102387
102387
|
mappingFile = options.mappings;
|
|
102388
102388
|
try {
|
|
102389
102389
|
tinyContent = readFileSync7(options.mappings, "utf8");
|
|
@@ -102420,7 +102420,7 @@ async function remapJava(options) {
|
|
|
102420
102420
|
const stderr = await new Response(proc.stderr).text();
|
|
102421
102421
|
const code = await proc.exited;
|
|
102422
102422
|
const classes = new Map;
|
|
102423
|
-
if (code === 0 &&
|
|
102423
|
+
if (code === 0 && existsSync11(outDir)) {
|
|
102424
102424
|
collectClassFilesSync(outDir, outDir, classes);
|
|
102425
102425
|
}
|
|
102426
102426
|
return {
|
|
@@ -102458,7 +102458,7 @@ function remapJavaSync(options) {
|
|
|
102458
102458
|
mkdirSync8(outDir, { recursive: true });
|
|
102459
102459
|
try {
|
|
102460
102460
|
if (typeof options.input === "string") {
|
|
102461
|
-
if (
|
|
102461
|
+
if (existsSync11(options.input)) {
|
|
102462
102462
|
const st = statSync4(options.input);
|
|
102463
102463
|
if (st.isDirectory()) {
|
|
102464
102464
|
inputDir = options.input;
|
|
@@ -102485,7 +102485,7 @@ function remapJavaSync(options) {
|
|
|
102485
102485
|
}
|
|
102486
102486
|
let mappingFile;
|
|
102487
102487
|
let tinyContent = "";
|
|
102488
|
-
if (typeof options.mappings === "string" &&
|
|
102488
|
+
if (typeof options.mappings === "string" && existsSync11(options.mappings)) {
|
|
102489
102489
|
mappingFile = options.mappings;
|
|
102490
102490
|
try {
|
|
102491
102491
|
tinyContent = readFileSync7(options.mappings, "utf8");
|
|
@@ -102516,7 +102516,7 @@ function remapJavaSync(options) {
|
|
|
102516
102516
|
const stdout = result.stdout || "";
|
|
102517
102517
|
const stderr = result.stderr || "";
|
|
102518
102518
|
const classes = new Map;
|
|
102519
|
-
if (code === 0 &&
|
|
102519
|
+
if (code === 0 && existsSync11(outDir)) {
|
|
102520
102520
|
collectClassFilesSync(outDir, outDir, classes);
|
|
102521
102521
|
}
|
|
102522
102522
|
return {
|
|
@@ -102559,7 +102559,7 @@ function extractBytecodeList(input) {
|
|
|
102559
102559
|
if (byteArrays.length > 0)
|
|
102560
102560
|
return byteArrays;
|
|
102561
102561
|
}
|
|
102562
|
-
if (typeof input === "string" &&
|
|
102562
|
+
if (typeof input === "string" && existsSync11(input)) {
|
|
102563
102563
|
const stat = statSync4(input);
|
|
102564
102564
|
if (stat.isDirectory()) {
|
|
102565
102565
|
const map = new Map;
|
|
@@ -102690,7 +102690,7 @@ function obfuscateBytecodeSync(input, options = {}) {
|
|
|
102690
102690
|
const mappings = generateObfuscationMappings(input, options);
|
|
102691
102691
|
if (options.exportMappingsPath) {
|
|
102692
102692
|
const parentDir = resolve4(options.exportMappingsPath, "..");
|
|
102693
|
-
if (!
|
|
102693
|
+
if (!existsSync11(parentDir)) {
|
|
102694
102694
|
mkdirSync8(parentDir, { recursive: true });
|
|
102695
102695
|
}
|
|
102696
102696
|
const content = options.exportMappingsPath.endsWith(".txt") ? formatMappingsHumanReadable(mappings) : mappings;
|
|
@@ -102712,7 +102712,7 @@ async function obfuscateBytecode(input, options = {}) {
|
|
|
102712
102712
|
const mappings = generateObfuscationMappings(input, options);
|
|
102713
102713
|
if (options.exportMappingsPath) {
|
|
102714
102714
|
const parentDir = resolve4(options.exportMappingsPath, "..");
|
|
102715
|
-
if (!
|
|
102715
|
+
if (!existsSync11(parentDir)) {
|
|
102716
102716
|
mkdirSync8(parentDir, { recursive: true });
|
|
102717
102717
|
}
|
|
102718
102718
|
const content = options.exportMappingsPath.endsWith(".txt") ? formatMappingsHumanReadable(mappings) : mappings;
|
|
@@ -102816,14 +102816,14 @@ var init_remapper = __esm(() => {
|
|
|
102816
102816
|
});
|
|
102817
102817
|
|
|
102818
102818
|
// packages/java/jjit/dist/compiler.js
|
|
102819
|
-
import { existsSync as
|
|
102819
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync9, readdirSync as readdirSync3, readFileSync as readFileSync8, statSync as statSync5, writeFileSync as writeFileSync7 } from "fs";
|
|
102820
102820
|
import { mkdtemp, readFile, rm as rm2 } from "fs/promises";
|
|
102821
102821
|
import { tmpdir as tmpdir8 } from "os";
|
|
102822
102822
|
import { join as join11, resolve as resolve5, relative } from "path";
|
|
102823
102823
|
function resolveDefaultJavaPath() {
|
|
102824
102824
|
if (process.env.JAVA_HOME) {
|
|
102825
102825
|
const bin = join11(process.env.JAVA_HOME, "bin", process.platform === "win32" ? "java.exe" : "java");
|
|
102826
|
-
if (
|
|
102826
|
+
if (existsSync12(bin))
|
|
102827
102827
|
return bin;
|
|
102828
102828
|
}
|
|
102829
102829
|
return "java";
|
|
@@ -102833,7 +102833,7 @@ function resolveEcjJarPath(javaMajorVersion) {
|
|
|
102833
102833
|
const baseDir = import.meta.dirname || import.meta.dir || process.cwd();
|
|
102834
102834
|
try {
|
|
102835
102835
|
const cached = join11(getDepsCacheDir2(), jarName);
|
|
102836
|
-
if (
|
|
102836
|
+
if (existsSync12(cached)) {
|
|
102837
102837
|
return resolve5(cached);
|
|
102838
102838
|
}
|
|
102839
102839
|
} catch {}
|
|
@@ -102854,7 +102854,7 @@ function resolveEcjJarPath(javaMajorVersion) {
|
|
|
102854
102854
|
];
|
|
102855
102855
|
for (const dir of candidateDirs) {
|
|
102856
102856
|
const candidate = join11(dir, jarName);
|
|
102857
|
-
if (
|
|
102857
|
+
if (existsSync12(candidate)) {
|
|
102858
102858
|
return resolve5(candidate);
|
|
102859
102859
|
}
|
|
102860
102860
|
}
|
|
@@ -103115,7 +103115,7 @@ ${stderrText}`.trim();
|
|
|
103115
103115
|
mappings: appliedMappings,
|
|
103116
103116
|
readClasses: async () => {
|
|
103117
103117
|
const map = new Map;
|
|
103118
|
-
if (exitCode === 0 &&
|
|
103118
|
+
if (exitCode === 0 && existsSync12(outDir)) {
|
|
103119
103119
|
await collectClassFiles(outDir, outDir, map);
|
|
103120
103120
|
}
|
|
103121
103121
|
return map;
|
|
@@ -103125,7 +103125,7 @@ ${stderrText}`.trim();
|
|
|
103125
103125
|
if (!targetName)
|
|
103126
103126
|
return;
|
|
103127
103127
|
const classPath = join11(outDir, ...targetName.split(".")) + ".class";
|
|
103128
|
-
if (!
|
|
103128
|
+
if (!existsSync12(classPath))
|
|
103129
103129
|
return;
|
|
103130
103130
|
const bytes = await readFile(classPath);
|
|
103131
103131
|
return new Uint8Array(bytes);
|
|
@@ -103133,7 +103133,7 @@ ${stderrText}`.trim();
|
|
|
103133
103133
|
get classes() {
|
|
103134
103134
|
if (!cachedClasses) {
|
|
103135
103135
|
cachedClasses = new Map;
|
|
103136
|
-
if (exitCode === 0 &&
|
|
103136
|
+
if (exitCode === 0 && existsSync12(outDir)) {
|
|
103137
103137
|
collectClassFilesSync(outDir, outDir, cachedClasses);
|
|
103138
103138
|
}
|
|
103139
103139
|
}
|
|
@@ -103303,7 +103303,7 @@ ${stderrText}`.trim();
|
|
|
103303
103303
|
mappings: appliedMappings,
|
|
103304
103304
|
readClasses: async () => {
|
|
103305
103305
|
const map = new Map;
|
|
103306
|
-
if (exitCode === 0 &&
|
|
103306
|
+
if (exitCode === 0 && existsSync12(outDir)) {
|
|
103307
103307
|
await collectClassFiles(outDir, outDir, map);
|
|
103308
103308
|
}
|
|
103309
103309
|
return map;
|
|
@@ -103313,7 +103313,7 @@ ${stderrText}`.trim();
|
|
|
103313
103313
|
if (!targetName)
|
|
103314
103314
|
return;
|
|
103315
103315
|
const classPath = join11(outDir, ...targetName.split(".")) + ".class";
|
|
103316
|
-
if (!
|
|
103316
|
+
if (!existsSync12(classPath))
|
|
103317
103317
|
return;
|
|
103318
103318
|
const bytes = await readFile(classPath);
|
|
103319
103319
|
return new Uint8Array(bytes);
|
|
@@ -103321,7 +103321,7 @@ ${stderrText}`.trim();
|
|
|
103321
103321
|
get classes() {
|
|
103322
103322
|
if (!cachedClasses) {
|
|
103323
103323
|
cachedClasses = new Map;
|
|
103324
|
-
if (exitCode === 0 &&
|
|
103324
|
+
if (exitCode === 0 && existsSync12(outDir)) {
|
|
103325
103325
|
collectClassFilesSync(outDir, outDir, cachedClasses);
|
|
103326
103326
|
}
|
|
103327
103327
|
}
|
|
@@ -104456,7 +104456,7 @@ var init_jar2 = __esm(() => {
|
|
|
104456
104456
|
});
|
|
104457
104457
|
|
|
104458
104458
|
// packages/java/njava/dist/stubs/project.js
|
|
104459
|
-
import { existsSync as
|
|
104459
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync11, rmSync as rmSync6, writeFileSync as writeFileSync9 } from "fs";
|
|
104460
104460
|
import { tmpdir as tmpdir9 } from "os";
|
|
104461
104461
|
import { join as join12, resolve as resolve6 } from "path";
|
|
104462
104462
|
|
|
@@ -104713,7 +104713,7 @@ Created-By: Exoproc NJava Virtual Stubs\r
|
|
|
104713
104713
|
return new Map(this.generatedFiles);
|
|
104714
104714
|
}
|
|
104715
104715
|
cleanup() {
|
|
104716
|
-
if (
|
|
104716
|
+
if (existsSync13(this.workspaceDir)) {
|
|
104717
104717
|
try {
|
|
104718
104718
|
rmSync6(this.workspaceDir, { recursive: true, force: true });
|
|
104719
104719
|
} catch {}
|
|
@@ -104732,7 +104732,7 @@ var init_remapper2 = __esm(() => {
|
|
|
104732
104732
|
});
|
|
104733
104733
|
|
|
104734
104734
|
// packages/java/njava/dist/mapping.js
|
|
104735
|
-
import { existsSync as
|
|
104735
|
+
import { existsSync as existsSync14, readFileSync as readFileSync9 } from "fs";
|
|
104736
104736
|
function isObfuscatedMethodName(methodName) {
|
|
104737
104737
|
if (!methodName)
|
|
104738
104738
|
return false;
|
|
@@ -105210,7 +105210,7 @@ class JavaMappingRegistry {
|
|
|
105210
105210
|
return this;
|
|
105211
105211
|
let content = tinyContentOrPath;
|
|
105212
105212
|
if (typeof content === "string" && (content.includes("/") || content.includes("\\") || content.endsWith(".tiny") || content.endsWith(".txt"))) {
|
|
105213
|
-
if (
|
|
105213
|
+
if (existsSync14(content)) {
|
|
105214
105214
|
try {
|
|
105215
105215
|
content = readFileSync9(content, "utf8");
|
|
105216
105216
|
} catch {}
|
|
@@ -105275,7 +105275,7 @@ class JavaMappingRegistry {
|
|
|
105275
105275
|
return this.load(parsed);
|
|
105276
105276
|
} catch {}
|
|
105277
105277
|
}
|
|
105278
|
-
if (
|
|
105278
|
+
if (existsSync14(trimmed)) {
|
|
105279
105279
|
if (trimmed.endsWith(".tiny")) {
|
|
105280
105280
|
return this.loadTiny(trimmed);
|
|
105281
105281
|
}
|
|
@@ -106793,7 +106793,7 @@ var init_agent_sources = __esm(() => {
|
|
|
106793
106793
|
});
|
|
106794
106794
|
|
|
106795
106795
|
// packages/java/agent/dist/agent-builder.js
|
|
106796
|
-
import { existsSync as
|
|
106796
|
+
import { existsSync as existsSync15, readFileSync as readFileSync10, writeFileSync as writeFileSync10 } from "fs";
|
|
106797
106797
|
import { join as join13, resolve as resolve7 } from "path";
|
|
106798
106798
|
function getAgentSources(options) {
|
|
106799
106799
|
if (options?.buildId || options?.port !== undefined) {
|
|
@@ -106907,12 +106907,12 @@ function getAgentJarSync(options = {}) {
|
|
|
106907
106907
|
const portSuffix = options.port && options.port !== 43378 ? `-p${options.port}` : "";
|
|
106908
106908
|
const targetJarPath = options.outputPath ?? resolve7(join13(cacheDir, options.obfuscate ? `njava-agent-java${javaVersion}${portSuffix}-obf.jar` : `njava-agent-java${javaVersion}${portSuffix}.jar`));
|
|
106909
106909
|
const targetTinyPath = targetJarPath.replace(/\.jar$/, ".tiny");
|
|
106910
|
-
if (!options.force &&
|
|
106910
|
+
if (!options.force && existsSync15(targetJarPath)) {
|
|
106911
106911
|
try {
|
|
106912
106912
|
const jarBuffer = readFileSync10(targetJarPath);
|
|
106913
106913
|
if (jarBuffer.length > 500) {
|
|
106914
106914
|
let mappings;
|
|
106915
|
-
if (
|
|
106915
|
+
if (existsSync15(targetTinyPath)) {
|
|
106916
106916
|
try {
|
|
106917
106917
|
mappings = readFileSync10(targetTinyPath, "utf8");
|
|
106918
106918
|
} catch {}
|
|
@@ -106987,12 +106987,12 @@ async function getAgentJar(options = {}) {
|
|
|
106987
106987
|
const portSuffix = options.port && options.port !== 43378 ? `-p${options.port}` : "";
|
|
106988
106988
|
const targetJarPath = options.outputPath ?? resolve7(join13(cacheDir, options.obfuscate ? `njava-agent-java${javaVersion}${portSuffix}-obf.jar` : `njava-agent-java${javaVersion}${portSuffix}.jar`));
|
|
106989
106989
|
const targetTinyPath = targetJarPath.replace(/\.jar$/, ".tiny");
|
|
106990
|
-
if (!options.force &&
|
|
106990
|
+
if (!options.force && existsSync15(targetJarPath)) {
|
|
106991
106991
|
try {
|
|
106992
106992
|
const jarBuffer = readFileSync10(targetJarPath);
|
|
106993
106993
|
if (jarBuffer.length > 500) {
|
|
106994
106994
|
let mappings;
|
|
106995
|
-
if (
|
|
106995
|
+
if (existsSync15(targetTinyPath)) {
|
|
106996
106996
|
try {
|
|
106997
106997
|
mappings = readFileSync10(targetTinyPath, "utf8");
|
|
106998
106998
|
} catch {}
|
|
@@ -107073,7 +107073,7 @@ function loadAgentMappings(poolOrRegistry, sourceOrOptions = {}) {
|
|
|
107073
107073
|
let mappings = "";
|
|
107074
107074
|
const cacheDir = getDefaultAgentCacheDir();
|
|
107075
107075
|
if (typeof sourceOrOptions === "string") {
|
|
107076
|
-
if (
|
|
107076
|
+
if (existsSync15(sourceOrOptions)) {
|
|
107077
107077
|
try {
|
|
107078
107078
|
mappings = readFileSync10(sourceOrOptions, "utf8");
|
|
107079
107079
|
} catch {
|
|
@@ -107081,7 +107081,7 @@ function loadAgentMappings(poolOrRegistry, sourceOrOptions = {}) {
|
|
|
107081
107081
|
}
|
|
107082
107082
|
} else {
|
|
107083
107083
|
const cachedTiny = join13(cacheDir, `${sourceOrOptions}.tiny`);
|
|
107084
|
-
if (
|
|
107084
|
+
if (existsSync15(cachedTiny)) {
|
|
107085
107085
|
try {
|
|
107086
107086
|
mappings = readFileSync10(cachedTiny, "utf8");
|
|
107087
107087
|
} catch {}
|
|
@@ -107093,7 +107093,7 @@ function loadAgentMappings(poolOrRegistry, sourceOrOptions = {}) {
|
|
|
107093
107093
|
} else if (sourceOrOptions && typeof sourceOrOptions === "object") {
|
|
107094
107094
|
if (sourceOrOptions.buildId) {
|
|
107095
107095
|
const cachedTiny = join13(cacheDir, `${sourceOrOptions.buildId}.tiny`);
|
|
107096
|
-
if (
|
|
107096
|
+
if (existsSync15(cachedTiny)) {
|
|
107097
107097
|
try {
|
|
107098
107098
|
mappings = readFileSync10(cachedTiny, "utf8");
|
|
107099
107099
|
} catch {}
|
|
@@ -107109,7 +107109,7 @@ function loadAgentMappings(poolOrRegistry, sourceOrOptions = {}) {
|
|
|
107109
107109
|
mappings = sourceOrOptions.build.mappings;
|
|
107110
107110
|
} else if (!mappings && typeof sourceOrOptions.jarPath === "string") {
|
|
107111
107111
|
const tinyPath = sourceOrOptions.jarPath.replace(/\.jar$/, ".tiny");
|
|
107112
|
-
if (
|
|
107112
|
+
if (existsSync15(tinyPath)) {
|
|
107113
107113
|
try {
|
|
107114
107114
|
mappings = readFileSync10(tinyPath, "utf8");
|
|
107115
107115
|
} catch {}
|
|
@@ -107148,7 +107148,7 @@ var init_agent_builder = __esm(() => {
|
|
|
107148
107148
|
});
|
|
107149
107149
|
|
|
107150
107150
|
// packages/java/agent/dist/loader.js
|
|
107151
|
-
import { existsSync as
|
|
107151
|
+
import { existsSync as existsSync16, readFileSync as readFileSync11 } from "fs";
|
|
107152
107152
|
function extractClassNameFromClassBytes(bytes) {
|
|
107153
107153
|
if (!bytes || bytes.length < 10)
|
|
107154
107154
|
return null;
|
|
@@ -107231,7 +107231,7 @@ async function injectAgentInMemory(java, options = {}) {
|
|
|
107231
107231
|
let className;
|
|
107232
107232
|
let mappings = options.mappings;
|
|
107233
107233
|
if (options.classPath) {
|
|
107234
|
-
if (!
|
|
107234
|
+
if (!existsSync16(options.classPath)) {
|
|
107235
107235
|
throw new Error(`Agent .class file not found at: ${options.classPath}`);
|
|
107236
107236
|
}
|
|
107237
107237
|
bytecode = new Uint8Array(readFileSync11(options.classPath));
|
|
@@ -107398,7 +107398,7 @@ function injectAgentInMemorySync(java, options = {}) {
|
|
|
107398
107398
|
let className;
|
|
107399
107399
|
let mappings = options.mappings;
|
|
107400
107400
|
if (options.classPath) {
|
|
107401
|
-
if (!
|
|
107401
|
+
if (!existsSync16(options.classPath)) {
|
|
107402
107402
|
throw new Error(`Agent .class file not found at: ${options.classPath}`);
|
|
107403
107403
|
}
|
|
107404
107404
|
bytecode = new Uint8Array(readFileSync11(options.classPath));
|
|
@@ -107565,7 +107565,7 @@ async function injectAgentViaClassLoader(java, options = {}) {
|
|
|
107565
107565
|
if (options.buildResult && "jarPath" in options.buildResult) {
|
|
107566
107566
|
jarPath = options.buildResult.jarPath;
|
|
107567
107567
|
mappings = options.buildResult.mappings ?? mappings;
|
|
107568
|
-
} else if (!jarPath || !
|
|
107568
|
+
} else if (!jarPath || !existsSync16(jarPath)) {
|
|
107569
107569
|
if (verbose)
|
|
107570
107570
|
console.log(`[njava-agent] Compiling/resolving agent JAR for Java ${options.targetVersion ?? "auto"}...`);
|
|
107571
107571
|
const buildRes = await getAgentJar({
|
|
@@ -107577,7 +107577,7 @@ async function injectAgentViaClassLoader(java, options = {}) {
|
|
|
107577
107577
|
mappings = buildRes.mappings ?? mappings;
|
|
107578
107578
|
} else if (jarPath && !mappings) {
|
|
107579
107579
|
const tinyPath = jarPath.replace(/\.jar$/, ".tiny");
|
|
107580
|
-
if (
|
|
107580
|
+
if (existsSync16(tinyPath)) {
|
|
107581
107581
|
try {
|
|
107582
107582
|
mappings = readFileSync11(tinyPath, "utf8");
|
|
107583
107583
|
} catch {}
|
|
@@ -107695,7 +107695,7 @@ function injectAgentViaClassLoaderSync(java, options = {}) {
|
|
|
107695
107695
|
if (options.buildResult && "jarPath" in options.buildResult) {
|
|
107696
107696
|
jarPath = options.buildResult.jarPath;
|
|
107697
107697
|
mappings = options.buildResult.mappings ?? mappings;
|
|
107698
|
-
} else if (!jarPath || !
|
|
107698
|
+
} else if (!jarPath || !existsSync16(jarPath)) {
|
|
107699
107699
|
const buildRes = getAgentJarSync({
|
|
107700
107700
|
javaVersion: options.targetVersion,
|
|
107701
107701
|
javaPath: options.javaPath,
|
|
@@ -107705,7 +107705,7 @@ function injectAgentViaClassLoaderSync(java, options = {}) {
|
|
|
107705
107705
|
mappings = buildRes.mappings ?? mappings;
|
|
107706
107706
|
} else if (jarPath && !mappings) {
|
|
107707
107707
|
const tinyPath = jarPath.replace(/\.jar$/, ".tiny");
|
|
107708
|
-
if (
|
|
107708
|
+
if (existsSync16(tinyPath)) {
|
|
107709
107709
|
try {
|
|
107710
107710
|
mappings = readFileSync11(tinyPath, "utf8");
|
|
107711
107711
|
} catch {}
|
|
@@ -107789,7 +107789,7 @@ var init_loader = __esm(() => {
|
|
|
107789
107789
|
});
|
|
107790
107790
|
|
|
107791
107791
|
// packages/java/agent/dist/client.js
|
|
107792
|
-
import { existsSync as
|
|
107792
|
+
import { existsSync as existsSync17, writeFileSync as writeFileSync11, mkdirSync as mkdirSync12, statSync as statSync6 } from "fs";
|
|
107793
107793
|
import { resolve as resolve8, dirname as dirname8, join as join14 } from "path";
|
|
107794
107794
|
function timeoutSignal(ms) {
|
|
107795
107795
|
if (typeof AbortSignal?.timeout === "function") {
|
|
@@ -107917,7 +107917,7 @@ async function dumpAgent(options = {}) {
|
|
|
107917
107917
|
let targetPath = options.path ? resolve8(process.cwd(), options.path) : undefined;
|
|
107918
107918
|
const defaultFileName = "mappings.txt";
|
|
107919
107919
|
if (targetPath) {
|
|
107920
|
-
if (
|
|
107920
|
+
if (existsSync17(targetPath) && statSync6(targetPath).isDirectory()) {
|
|
107921
107921
|
targetPath = join14(targetPath, defaultFileName);
|
|
107922
107922
|
} else if (targetPath.endsWith("/") || targetPath.endsWith("\\")) {
|
|
107923
107923
|
mkdirSync12(targetPath, { recursive: true });
|
|
@@ -107927,7 +107927,7 @@ async function dumpAgent(options = {}) {
|
|
|
107927
107927
|
targetPath = resolve8(process.cwd(), defaultFileName);
|
|
107928
107928
|
}
|
|
107929
107929
|
const parentDir = dirname8(targetPath);
|
|
107930
|
-
if (!
|
|
107930
|
+
if (!existsSync17(parentDir)) {
|
|
107931
107931
|
mkdirSync12(parentDir, { recursive: true });
|
|
107932
107932
|
}
|
|
107933
107933
|
const content = targetPath.endsWith(".tiny") ? tiny : formatMappingsHumanReadable(tiny);
|
|
@@ -107946,7 +107946,7 @@ async function dumpAgent(options = {}) {
|
|
|
107946
107946
|
const isClass2 = options.format === "class" || targetPath && targetPath.toLowerCase().endsWith(".class");
|
|
107947
107947
|
const defaultFileName = isClass2 ? "Exoproc.class" : obfuscate ? `njava-agent-java${javaVersion}-obf.jar` : `njava-agent-java${javaVersion}.jar`;
|
|
107948
107948
|
if (targetPath) {
|
|
107949
|
-
if (
|
|
107949
|
+
if (existsSync17(targetPath) && statSync6(targetPath).isDirectory()) {
|
|
107950
107950
|
targetPath = join14(targetPath, defaultFileName);
|
|
107951
107951
|
} else if (targetPath.endsWith("/") || targetPath.endsWith("\\")) {
|
|
107952
107952
|
mkdirSync12(targetPath, { recursive: true });
|
|
@@ -107956,7 +107956,7 @@ async function dumpAgent(options = {}) {
|
|
|
107956
107956
|
targetPath = resolve8(process.cwd(), defaultFileName);
|
|
107957
107957
|
}
|
|
107958
107958
|
const parentDir = dirname8(targetPath);
|
|
107959
|
-
if (!
|
|
107959
|
+
if (!existsSync17(parentDir)) {
|
|
107960
107960
|
mkdirSync12(parentDir, { recursive: true });
|
|
107961
107961
|
}
|
|
107962
107962
|
let mappingsPath;
|
|
@@ -107970,7 +107970,7 @@ async function dumpAgent(options = {}) {
|
|
|
107970
107970
|
if (options.dumpMappings && res.mappings) {
|
|
107971
107971
|
const mPath = typeof options.dumpMappings === "string" ? resolve8(process.cwd(), options.dumpMappings) : targetPath.replace(/\.class$/, "") + "-mappings.txt";
|
|
107972
107972
|
const mParent = dirname8(mPath);
|
|
107973
|
-
if (!
|
|
107973
|
+
if (!existsSync17(mParent)) {
|
|
107974
107974
|
mkdirSync12(mParent, { recursive: true });
|
|
107975
107975
|
}
|
|
107976
107976
|
const mContent = mPath.endsWith(".tiny") ? res.mappings : formatMappingsHumanReadable(res.mappings);
|
|
@@ -107998,7 +107998,7 @@ async function dumpAgent(options = {}) {
|
|
|
107998
107998
|
if (options.dumpMappings && res.mappings) {
|
|
107999
107999
|
const mPath = typeof options.dumpMappings === "string" ? resolve8(process.cwd(), options.dumpMappings) : targetPath.replace(/\.jar$/, "") + "-mappings.txt";
|
|
108000
108000
|
const mParent = dirname8(mPath);
|
|
108001
|
-
if (!
|
|
108001
|
+
if (!existsSync17(mParent)) {
|
|
108002
108002
|
mkdirSync12(mParent, { recursive: true });
|
|
108003
108003
|
}
|
|
108004
108004
|
const mContent = mPath.endsWith(".tiny") ? res.mappings : formatMappingsHumanReadable(res.mappings);
|
|
@@ -112448,7 +112448,7 @@ var init_dist13 = __esm(() => {
|
|
|
112448
112448
|
});
|
|
112449
112449
|
|
|
112450
112450
|
// packages/exoproc-mcp/src/tools/session.ts
|
|
112451
|
-
import { existsSync as
|
|
112451
|
+
import { existsSync as existsSync18, unlinkSync as unlinkSync5, writeFileSync as writeFileSync13 } from "fs";
|
|
112452
112452
|
import { tmpdir as tmpdir11 } from "os";
|
|
112453
112453
|
import { join as join16 } from "path";
|
|
112454
112454
|
function setActiveSession(session) {
|
|
@@ -112634,7 +112634,7 @@ async function closeAccessor(options) {
|
|
|
112634
112634
|
console.error("[closeAccessor] s.accessor.close error:", err);
|
|
112635
112635
|
}
|
|
112636
112636
|
try {
|
|
112637
|
-
if (
|
|
112637
|
+
if (existsSync18(s.sessionFile)) {
|
|
112638
112638
|
unlinkSync5(s.sessionFile);
|
|
112639
112639
|
}
|
|
112640
112640
|
} catch {}
|
|
@@ -115031,12 +115031,12 @@ var EMBEDDED_CAPSTONE_DLL_BASE64 = "TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAA
|
|
|
115031
115031
|
// packages/capstone/core/dist/def/index.js
|
|
115032
115032
|
import { fileURLToPath } from "url";
|
|
115033
115033
|
import { dirname as dirname9, join as join17 } from "path";
|
|
115034
|
-
import { existsSync as
|
|
115034
|
+
import { existsSync as existsSync19, statSync as statSync7, writeFileSync as writeFileSync14 } from "fs";
|
|
115035
115035
|
import { tmpdir as tmpdir12 } from "os";
|
|
115036
115036
|
function findCapstoneDll() {
|
|
115037
115037
|
try {
|
|
115038
115038
|
const cached = join17(getDepsCacheDir2(), "capstone.dll");
|
|
115039
|
-
if (
|
|
115039
|
+
if (existsSync19(cached)) {
|
|
115040
115040
|
return cached;
|
|
115041
115041
|
}
|
|
115042
115042
|
} catch {}
|
|
@@ -115052,7 +115052,7 @@ function findCapstoneDll() {
|
|
|
115052
115052
|
join17(process.cwd(), "packages/capstone/deps/capstone.dll")
|
|
115053
115053
|
];
|
|
115054
115054
|
for (const candidate of candidates) {
|
|
115055
|
-
if (
|
|
115055
|
+
if (existsSync19(candidate)) {
|
|
115056
115056
|
return candidate;
|
|
115057
115057
|
}
|
|
115058
115058
|
}
|
|
@@ -115071,7 +115071,7 @@ function findCapstoneDll() {
|
|
|
115071
115071
|
const tempDllPath = join17(tmpdir12(), "exoproc_capstone.dll");
|
|
115072
115072
|
try {
|
|
115073
115073
|
const buf = Buffer.from(EMBEDDED_CAPSTONE_DLL_BASE64, "base64");
|
|
115074
|
-
if (!
|
|
115074
|
+
if (!existsSync19(tempDllPath) || statSync7(tempDllPath).size !== buf.length) {
|
|
115075
115075
|
writeFileSync14(tempDllPath, buf);
|
|
115076
115076
|
}
|
|
115077
115077
|
return tempDllPath;
|
|
@@ -122512,7 +122512,7 @@ var init_jar4 = __esm(() => {
|
|
|
122512
122512
|
});
|
|
122513
122513
|
|
|
122514
122514
|
// packages/java/njava/src/stubs/project.ts
|
|
122515
|
-
import { existsSync as
|
|
122515
|
+
import { existsSync as existsSync25, mkdirSync as mkdirSync14, rmSync as rmSync7, writeFileSync as writeFileSync20 } from "fs";
|
|
122516
122516
|
import { tmpdir as tmpdir16 } from "os";
|
|
122517
122517
|
import { join as join21, resolve as resolve12 } from "path";
|
|
122518
122518
|
|
|
@@ -122769,7 +122769,7 @@ Created-By: Exoproc NJava Virtual Stubs\r
|
|
|
122769
122769
|
return new Map(this.generatedFiles);
|
|
122770
122770
|
}
|
|
122771
122771
|
cleanup() {
|
|
122772
|
-
if (
|
|
122772
|
+
if (existsSync25(this.workspaceDir)) {
|
|
122773
122773
|
try {
|
|
122774
122774
|
rmSync7(this.workspaceDir, { recursive: true, force: true });
|
|
122775
122775
|
} catch {}
|
|
@@ -122788,7 +122788,7 @@ var init_remapper3 = __esm(() => {
|
|
|
122788
122788
|
});
|
|
122789
122789
|
|
|
122790
122790
|
// packages/java/njava/src/mapping.ts
|
|
122791
|
-
import { existsSync as
|
|
122791
|
+
import { existsSync as existsSync26, readFileSync as readFileSync18 } from "fs";
|
|
122792
122792
|
function isPrimitiveType2(type) {
|
|
122793
122793
|
return JAVA_PRIMITIVES3.has(type);
|
|
122794
122794
|
}
|
|
@@ -123289,7 +123289,7 @@ class JavaMappingRegistry2 {
|
|
|
123289
123289
|
return this;
|
|
123290
123290
|
let content = tinyContentOrPath;
|
|
123291
123291
|
if (typeof content === "string" && (content.includes("/") || content.includes("\\") || content.endsWith(".tiny") || content.endsWith(".txt"))) {
|
|
123292
|
-
if (
|
|
123292
|
+
if (existsSync26(content)) {
|
|
123293
123293
|
try {
|
|
123294
123294
|
content = readFileSync18(content, "utf8");
|
|
123295
123295
|
} catch {}
|
|
@@ -123354,7 +123354,7 @@ class JavaMappingRegistry2 {
|
|
|
123354
123354
|
return this.load(parsed);
|
|
123355
123355
|
} catch {}
|
|
123356
123356
|
}
|
|
123357
|
-
if (
|
|
123357
|
+
if (existsSync26(trimmed)) {
|
|
123358
123358
|
if (trimmed.endsWith(".tiny")) {
|
|
123359
123359
|
return this.loadTiny(trimmed);
|
|
123360
123360
|
}
|
|
@@ -126664,7 +126664,8 @@ __export(exports_src10, {
|
|
|
126664
126664
|
|
|
126665
126665
|
// packages/exoproc/src/setup/index.ts
|
|
126666
126666
|
import { homedir } from "os";
|
|
126667
|
-
import { join as join3 } from "path";
|
|
126667
|
+
import { basename, join as join3 } from "path";
|
|
126668
|
+
import { existsSync as existsSync4 } from "fs";
|
|
126668
126669
|
|
|
126669
126670
|
// packages/exoproc/src/setup/clients.ts
|
|
126670
126671
|
import { existsSync } from "fs";
|
|
@@ -126734,21 +126735,15 @@ var SUPPORTED_CLIENTS = [
|
|
|
126734
126735
|
id: "gemini_cli",
|
|
126735
126736
|
displayName: "Gemini CLI / Antigravity",
|
|
126736
126737
|
format: "json",
|
|
126737
|
-
getConfigPaths: (ctx) =>
|
|
126738
|
-
|
|
126739
|
-
|
|
126740
|
-
join(ctx.home, ".gemini", "settings.json")
|
|
126741
|
-
];
|
|
126742
|
-
if (existsSync(join(ctx.cwd, ".gemini"))) {
|
|
126743
|
-
paths.push(join(ctx.cwd, ".gemini", "mcp_config.json"));
|
|
126744
|
-
}
|
|
126745
|
-
return paths;
|
|
126746
|
-
},
|
|
126738
|
+
getConfigPaths: (ctx) => [
|
|
126739
|
+
join(ctx.home, ".gemini", "config", "mcp_config.json")
|
|
126740
|
+
],
|
|
126747
126741
|
getSkillPaths: (ctx) => [
|
|
126742
|
+
join(ctx.home, ".gemini", "config", "skills", "exoproc", "SKILL.md"),
|
|
126748
126743
|
join(ctx.home, ".gemini", "antigravity", "skills", "exoproc", "SKILL.md"),
|
|
126749
|
-
join(ctx.
|
|
126744
|
+
join(ctx.cwd, ".agents", "skills", "exoproc", "SKILL.md")
|
|
126750
126745
|
],
|
|
126751
|
-
detect: (ctx) => existsSync(join(ctx.home, ".gemini")) || existsSync(join(ctx.home, ".agents"))
|
|
126746
|
+
detect: (ctx) => existsSync(join(ctx.home, ".gemini")) || existsSync(join(ctx.home, ".agents")) || existsSync(join(ctx.cwd, ".agents"))
|
|
126752
126747
|
},
|
|
126753
126748
|
{
|
|
126754
126749
|
id: "cline",
|
|
@@ -126806,7 +126801,11 @@ import {
|
|
|
126806
126801
|
} from "fs";
|
|
126807
126802
|
import { dirname as dirname2 } from "path";
|
|
126808
126803
|
function parseJsonc(content) {
|
|
126809
|
-
|
|
126804
|
+
if (!content || !content.trim())
|
|
126805
|
+
return {};
|
|
126806
|
+
const cleaned = content.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|[^\\:])\/\/.*$/gm, "$1").replace(/,\s*([}\]])/g, "$1").trim();
|
|
126807
|
+
if (!cleaned)
|
|
126808
|
+
return {};
|
|
126810
126809
|
return JSON.parse(cleaned);
|
|
126811
126810
|
}
|
|
126812
126811
|
function isClientConfigured(client, configPath, command) {
|
|
@@ -126814,6 +126813,8 @@ function isClientConfigured(client, configPath, command) {
|
|
|
126814
126813
|
return false;
|
|
126815
126814
|
try {
|
|
126816
126815
|
const raw = readFileSync(configPath, "utf8");
|
|
126816
|
+
if (!raw.trim())
|
|
126817
|
+
return false;
|
|
126817
126818
|
const doc = parseJsonc(raw);
|
|
126818
126819
|
if (client.format === "zed") {
|
|
126819
126820
|
const entry = doc?.context_servers?.exoproc;
|
|
@@ -126837,14 +126838,16 @@ function updateClientConfig(client, configPath, command, dryRun = false) {
|
|
|
126837
126838
|
let doc = {};
|
|
126838
126839
|
if (existsSync2(configPath)) {
|
|
126839
126840
|
const content = readFileSync(configPath, "utf8");
|
|
126840
|
-
|
|
126841
|
-
|
|
126842
|
-
|
|
126843
|
-
|
|
126844
|
-
|
|
126845
|
-
|
|
126846
|
-
|
|
126847
|
-
|
|
126841
|
+
if (content.trim()) {
|
|
126842
|
+
try {
|
|
126843
|
+
doc = parseJsonc(content);
|
|
126844
|
+
} catch (err) {
|
|
126845
|
+
return {
|
|
126846
|
+
path: configPath,
|
|
126847
|
+
status: "failed",
|
|
126848
|
+
error: `Existing config at ${configPath} is not valid JSON/JSONC: ${err.message}`
|
|
126849
|
+
};
|
|
126850
|
+
}
|
|
126848
126851
|
}
|
|
126849
126852
|
}
|
|
126850
126853
|
if (isClientConfigured(client, configPath, command)) {
|
|
@@ -127007,6 +127010,18 @@ function installSkills(paths, dryRun = false) {
|
|
|
127007
127010
|
}
|
|
127008
127011
|
|
|
127009
127012
|
// packages/exoproc/src/setup/index.ts
|
|
127013
|
+
function resolveBunCommand(home, platform) {
|
|
127014
|
+
if (platform === "win32") {
|
|
127015
|
+
if (process.execPath && basename(process.execPath).toLowerCase().startsWith("bun")) {
|
|
127016
|
+
return process.execPath;
|
|
127017
|
+
}
|
|
127018
|
+
const defaultWinBun = join3(home, ".bun", "bin", "bun.exe");
|
|
127019
|
+
if (existsSync4(defaultWinBun)) {
|
|
127020
|
+
return defaultWinBun;
|
|
127021
|
+
}
|
|
127022
|
+
}
|
|
127023
|
+
return "bun";
|
|
127024
|
+
}
|
|
127010
127025
|
function createSetupContext(options) {
|
|
127011
127026
|
const home = homedir();
|
|
127012
127027
|
const platform = process.platform;
|
|
@@ -127014,11 +127029,12 @@ function createSetupContext(options) {
|
|
|
127014
127029
|
const cwd = process.cwd();
|
|
127015
127030
|
let command = options?.command;
|
|
127016
127031
|
if (!command || command.length === 0) {
|
|
127032
|
+
const bunCmd = resolveBunCommand(home, platform);
|
|
127017
127033
|
if (options?.dev) {
|
|
127018
127034
|
const localDist = join3(cwd, "packages", "exoproc", "dist", "cli.js");
|
|
127019
|
-
command = [
|
|
127035
|
+
command = [bunCmd, localDist, "mcp"];
|
|
127020
127036
|
} else {
|
|
127021
|
-
command = [
|
|
127037
|
+
command = [bunCmd, "x", "exoproc", "mcp"];
|
|
127022
127038
|
}
|
|
127023
127039
|
}
|
|
127024
127040
|
return {
|
|
@@ -127202,7 +127218,7 @@ class Logger {
|
|
|
127202
127218
|
}
|
|
127203
127219
|
}
|
|
127204
127220
|
// packages/utils/src/cache.ts
|
|
127205
|
-
import { existsSync as
|
|
127221
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync3, rmSync } from "fs";
|
|
127206
127222
|
import { tmpdir } from "os";
|
|
127207
127223
|
import { join as join4 } from "path";
|
|
127208
127224
|
function getCacheDir(subpath) {
|
|
@@ -127229,7 +127245,7 @@ function getCacheDir(subpath) {
|
|
|
127229
127245
|
}
|
|
127230
127246
|
}
|
|
127231
127247
|
const finalDir = subpath ? join4(baseDir, subpath) : baseDir;
|
|
127232
|
-
if (!
|
|
127248
|
+
if (!existsSync5(finalDir)) {
|
|
127233
127249
|
try {
|
|
127234
127250
|
mkdirSync3(finalDir, { recursive: true });
|
|
127235
127251
|
} catch {}
|
|
@@ -127241,7 +127257,7 @@ function getRealTempDir(subpath) {
|
|
|
127241
127257
|
if (!subpath)
|
|
127242
127258
|
return base;
|
|
127243
127259
|
const target = join4(base, subpath);
|
|
127244
|
-
if (!
|
|
127260
|
+
if (!existsSync5(target)) {
|
|
127245
127261
|
try {
|
|
127246
127262
|
mkdirSync3(target, { recursive: true });
|
|
127247
127263
|
} catch {}
|
|
@@ -127256,7 +127272,7 @@ function getDaemonStatePath() {
|
|
|
127256
127272
|
}
|
|
127257
127273
|
function clearCache(subpath) {
|
|
127258
127274
|
const dir = getCacheDir(subpath);
|
|
127259
|
-
if (
|
|
127275
|
+
if (existsSync5(dir)) {
|
|
127260
127276
|
try {
|
|
127261
127277
|
rmSync(dir, { recursive: true, force: true });
|
|
127262
127278
|
} catch {}
|
|
@@ -127268,7 +127284,7 @@ import {
|
|
|
127268
127284
|
createWriteStream,
|
|
127269
127285
|
mkdirSync as mkdirSync4,
|
|
127270
127286
|
createReadStream,
|
|
127271
|
-
existsSync as
|
|
127287
|
+
existsSync as existsSync6,
|
|
127272
127288
|
readFileSync as readFileSync3,
|
|
127273
127289
|
readdirSync,
|
|
127274
127290
|
statSync,
|
|
@@ -127277,7 +127293,7 @@ import {
|
|
|
127277
127293
|
import { pipeline } from "stream/promises";
|
|
127278
127294
|
import { rm } from "fs/promises";
|
|
127279
127295
|
import { rmSync as rmSync2 } from "fs";
|
|
127280
|
-
import { join as join5, dirname as dirname4, basename, resolve, isAbsolute } from "path";
|
|
127296
|
+
import { join as join5, dirname as dirname4, basename as basename2, resolve, isAbsolute } from "path";
|
|
127281
127297
|
import { tmpdir as tmpdir2 } from "os";
|
|
127282
127298
|
import { randomBytes, createHash } from "crypto";
|
|
127283
127299
|
import { execSync } from "child_process";
|
|
@@ -127289,7 +127305,7 @@ function computeHash(filePath, algorithm = "sha1") {
|
|
|
127289
127305
|
return createHash(algorithm).update(fileBuffer).digest("hex");
|
|
127290
127306
|
}
|
|
127291
127307
|
function verifyChecksum(filePath, dep) {
|
|
127292
|
-
if (!
|
|
127308
|
+
if (!existsSync6(filePath))
|
|
127293
127309
|
return false;
|
|
127294
127310
|
try {
|
|
127295
127311
|
if (dep.sha1) {
|
|
@@ -127329,7 +127345,7 @@ function downloadFileSync(url, destPath) {
|
|
|
127329
127345
|
stdio: ["ignore", "pipe", "pipe"],
|
|
127330
127346
|
timeout: 120000
|
|
127331
127347
|
});
|
|
127332
|
-
if (
|
|
127348
|
+
if (existsSync6(destPath) && statSync(destPath).size > 0) {
|
|
127333
127349
|
return;
|
|
127334
127350
|
}
|
|
127335
127351
|
} catch {
|
|
@@ -127338,7 +127354,7 @@ function downloadFileSync(url, destPath) {
|
|
|
127338
127354
|
stdio: ["ignore", "pipe", "pipe"],
|
|
127339
127355
|
timeout: 120000
|
|
127340
127356
|
});
|
|
127341
|
-
if (
|
|
127357
|
+
if (existsSync6(destPath) && statSync(destPath).size > 0) {
|
|
127342
127358
|
return;
|
|
127343
127359
|
}
|
|
127344
127360
|
}
|
|
@@ -127352,7 +127368,7 @@ function extractEntryFromZip(zipPath, destFile, entryName) {
|
|
|
127352
127368
|
const readStream = createReadStream(zipPath);
|
|
127353
127369
|
const stream = readStream.pipe($Parse());
|
|
127354
127370
|
stream.on("entry", (entry) => {
|
|
127355
|
-
const fileName =
|
|
127371
|
+
const fileName = basename2(entry.path);
|
|
127356
127372
|
if (!found && fileName.toLowerCase() === entryName.toLowerCase()) {
|
|
127357
127373
|
entry.pipe(createWriteStream(destFile)).on("finish", () => {
|
|
127358
127374
|
found = true;
|
|
@@ -127400,7 +127416,7 @@ function extractEntryFromZipSync(zipPath, destFile, entryName) {
|
|
|
127400
127416
|
execSync(`unzip -p "${zipPath}" "*${entryName}" > "${destFile}"`, {
|
|
127401
127417
|
stdio: ["ignore", "pipe", "pipe"]
|
|
127402
127418
|
});
|
|
127403
|
-
if (
|
|
127419
|
+
if (existsSync6(destFile) && statSync(destFile).size > 0)
|
|
127404
127420
|
return;
|
|
127405
127421
|
} catch {}
|
|
127406
127422
|
const pyScript = `
|
|
@@ -127458,7 +127474,7 @@ function extractAllFromZip(zipPath, destDir) {
|
|
|
127458
127474
|
});
|
|
127459
127475
|
}
|
|
127460
127476
|
function resolveDepPath(dep, packageDir) {
|
|
127461
|
-
const filename =
|
|
127477
|
+
const filename = basename2(dep.target);
|
|
127462
127478
|
if (packageDir) {
|
|
127463
127479
|
const localTarget = isAbsolute(dep.target) ? dep.target : resolve(packageDir, dep.target);
|
|
127464
127480
|
if (verifyChecksum(localTarget, dep)) {
|
|
@@ -127487,7 +127503,7 @@ async function resolveOrDownloadDep(dep, packageDir, options = {}) {
|
|
|
127487
127503
|
return existing;
|
|
127488
127504
|
}
|
|
127489
127505
|
}
|
|
127490
|
-
const filename =
|
|
127506
|
+
const filename = basename2(dep.target);
|
|
127491
127507
|
const cacheDest = join5(getDepsCacheDir(), filename);
|
|
127492
127508
|
const tempDir = join5(tmpdir2(), `exoproc-dep-${randomBytes(6).toString("hex")}`);
|
|
127493
127509
|
mkdirSync4(tempDir, { recursive: true });
|
|
@@ -127541,7 +127557,7 @@ function resolveOrDownloadDepSync(dep, packageDir, options = {}) {
|
|
|
127541
127557
|
return existing;
|
|
127542
127558
|
}
|
|
127543
127559
|
}
|
|
127544
|
-
const filename =
|
|
127560
|
+
const filename = basename2(dep.target);
|
|
127545
127561
|
const cacheDest = join5(getDepsCacheDir(), filename);
|
|
127546
127562
|
const tempDir = join5(tmpdir2(), `exoproc-dep-sync-${randomBytes(6).toString("hex")}`);
|
|
127547
127563
|
mkdirSync4(tempDir, { recursive: true });
|
|
@@ -127579,16 +127595,16 @@ async function downloadPackageDeps(packageDir, configOrFile, options = {}) {
|
|
|
127579
127595
|
if (!configOrFile) {
|
|
127580
127596
|
const defaultJson = join5(packageDir, "deps.json");
|
|
127581
127597
|
const altJson = join5(packageDir, "exoproc-deps.json");
|
|
127582
|
-
if (
|
|
127598
|
+
if (existsSync6(defaultJson)) {
|
|
127583
127599
|
config = JSON.parse(readFileSync3(defaultJson, "utf-8"));
|
|
127584
|
-
} else if (
|
|
127600
|
+
} else if (existsSync6(altJson)) {
|
|
127585
127601
|
config = JSON.parse(readFileSync3(altJson, "utf-8"));
|
|
127586
127602
|
} else {
|
|
127587
127603
|
return [];
|
|
127588
127604
|
}
|
|
127589
127605
|
} else if (typeof configOrFile === "string") {
|
|
127590
127606
|
const resolvedPath = isAbsolute(configOrFile) ? configOrFile : join5(packageDir, configOrFile);
|
|
127591
|
-
if (!
|
|
127607
|
+
if (!existsSync6(resolvedPath)) {
|
|
127592
127608
|
throw new Error(`Deps config file not found at: ${resolvedPath}`);
|
|
127593
127609
|
}
|
|
127594
127610
|
config = JSON.parse(readFileSync3(resolvedPath, "utf-8"));
|
|
@@ -127621,18 +127637,18 @@ async function downloadPackageDeps(packageDir, configOrFile, options = {}) {
|
|
|
127621
127637
|
function findWorkspaceDepsConfigs(workspaceRoot) {
|
|
127622
127638
|
const found = [];
|
|
127623
127639
|
const packagesDir = join5(workspaceRoot, "packages");
|
|
127624
|
-
if (!
|
|
127640
|
+
if (!existsSync6(packagesDir))
|
|
127625
127641
|
return found;
|
|
127626
127642
|
const searchDir = (dir) => {
|
|
127627
|
-
if (!
|
|
127643
|
+
if (!existsSync6(dir))
|
|
127628
127644
|
return;
|
|
127629
127645
|
const items = readdirSync(dir, { withFileTypes: true });
|
|
127630
127646
|
const depsPath = join5(dir, "deps.json");
|
|
127631
127647
|
const altDepsPath = join5(dir, "exoproc-deps.json");
|
|
127632
|
-
if (
|
|
127648
|
+
if (existsSync6(depsPath)) {
|
|
127633
127649
|
let pkgName;
|
|
127634
127650
|
const pkgJson = join5(dir, "package.json");
|
|
127635
|
-
if (
|
|
127651
|
+
if (existsSync6(pkgJson)) {
|
|
127636
127652
|
try {
|
|
127637
127653
|
pkgName = JSON.parse(readFileSync3(pkgJson, "utf-8")).name;
|
|
127638
127654
|
} catch {}
|
|
@@ -127642,10 +127658,10 @@ function findWorkspaceDepsConfigs(workspaceRoot) {
|
|
|
127642
127658
|
configPath: depsPath,
|
|
127643
127659
|
packageName: pkgName
|
|
127644
127660
|
});
|
|
127645
|
-
} else if (
|
|
127661
|
+
} else if (existsSync6(altDepsPath)) {
|
|
127646
127662
|
let pkgName;
|
|
127647
127663
|
const pkgJson = join5(dir, "package.json");
|
|
127648
|
-
if (
|
|
127664
|
+
if (existsSync6(pkgJson)) {
|
|
127649
127665
|
try {
|
|
127650
127666
|
pkgName = JSON.parse(readFileSync3(pkgJson, "utf-8")).name;
|
|
127651
127667
|
} catch {}
|
|
@@ -127669,7 +127685,7 @@ async function downloadAllWorkspaceDeps(workspaceRoot, options = {}) {
|
|
|
127669
127685
|
const configs = findWorkspaceDepsConfigs(workspaceRoot);
|
|
127670
127686
|
const results = new Map;
|
|
127671
127687
|
for (const cfg of configs) {
|
|
127672
|
-
const pkgTitle = cfg.packageName ||
|
|
127688
|
+
const pkgTitle = cfg.packageName || basename2(cfg.packageDir);
|
|
127673
127689
|
if (!options.silent) {
|
|
127674
127690
|
console.log(`
|
|
127675
127691
|
\uD83D\uDCE6 Checking dependencies for ${pkgTitle}...`);
|
|
@@ -127712,19 +127728,19 @@ var STANDARD_EXOPROC_DEPS = [
|
|
|
127712
127728
|
}
|
|
127713
127729
|
];
|
|
127714
127730
|
function inspectDepChecksum(dep, packageDir) {
|
|
127715
|
-
const filename =
|
|
127731
|
+
const filename = basename2(dep.target);
|
|
127716
127732
|
let foundPath = null;
|
|
127717
127733
|
let source = "missing";
|
|
127718
127734
|
if (packageDir) {
|
|
127719
127735
|
const localTarget = isAbsolute(dep.target) ? dep.target : resolve(packageDir, dep.target);
|
|
127720
|
-
if (
|
|
127736
|
+
if (existsSync6(localTarget)) {
|
|
127721
127737
|
foundPath = localTarget;
|
|
127722
127738
|
source = "local";
|
|
127723
127739
|
}
|
|
127724
127740
|
}
|
|
127725
127741
|
if (!foundPath) {
|
|
127726
127742
|
const cachedPath = join5(getDepsCacheDir(), filename);
|
|
127727
|
-
if (
|
|
127743
|
+
if (existsSync6(cachedPath)) {
|
|
127728
127744
|
foundPath = cachedPath;
|
|
127729
127745
|
source = "cache";
|
|
127730
127746
|
}
|
|
@@ -127740,7 +127756,7 @@ function inspectDepChecksum(dep, packageDir) {
|
|
|
127740
127756
|
];
|
|
127741
127757
|
for (const dir of candidateDirs) {
|
|
127742
127758
|
const p = join5(dir, filename);
|
|
127743
|
-
if (
|
|
127759
|
+
if (existsSync6(p)) {
|
|
127744
127760
|
foundPath = p;
|
|
127745
127761
|
source = "local";
|
|
127746
127762
|
break;
|
|
@@ -127826,7 +127842,7 @@ function inspectAllDeps(workspaceRoot) {
|
|
|
127826
127842
|
}
|
|
127827
127843
|
}
|
|
127828
127844
|
for (const stdDep of STANDARD_EXOPROC_DEPS) {
|
|
127829
|
-
const fn =
|
|
127845
|
+
const fn = basename2(stdDep.target).toLowerCase();
|
|
127830
127846
|
if (!processedFilenames.has(fn)) {
|
|
127831
127847
|
results.push(inspectDepChecksum(stdDep));
|
|
127832
127848
|
processedFilenames.add(fn);
|
|
@@ -127941,11 +127957,11 @@ Failed to capture screenshot:`, result);
|
|
|
127941
127957
|
}
|
|
127942
127958
|
}
|
|
127943
127959
|
// packages/exoproc/src/commands/compile.ts
|
|
127944
|
-
import { readFileSync as readFileSync14, existsSync as
|
|
127960
|
+
import { readFileSync as readFileSync14, existsSync as existsSync20 } from "fs";
|
|
127945
127961
|
async function commandCompile(options) {
|
|
127946
127962
|
await Promise.resolve().then(() => init_src());
|
|
127947
127963
|
let source = options.codeOrPath;
|
|
127948
|
-
if (
|
|
127964
|
+
if (existsSync20(source)) {
|
|
127949
127965
|
source = readFileSync14(source, "utf8");
|
|
127950
127966
|
}
|
|
127951
127967
|
const result = await compileC({
|
|
@@ -128016,12 +128032,12 @@ async function commandExec(options) {
|
|
|
128016
128032
|
}
|
|
128017
128033
|
}
|
|
128018
128034
|
// packages/exoproc/src/commands/run.ts
|
|
128019
|
-
import { existsSync as
|
|
128035
|
+
import { existsSync as existsSync21, readFileSync as readFileSync15 } from "fs";
|
|
128020
128036
|
import { resolve as resolve10 } from "path";
|
|
128021
128037
|
async function commandRun(scriptPath) {
|
|
128022
128038
|
await Promise.resolve().then(() => init_src());
|
|
128023
128039
|
const absPath = resolve10(process.cwd(), scriptPath);
|
|
128024
|
-
if (!
|
|
128040
|
+
if (!existsSync21(absPath)) {
|
|
128025
128041
|
console.error(`Script not found: ${absPath}`);
|
|
128026
128042
|
process.exit(1);
|
|
128027
128043
|
}
|
|
@@ -133379,7 +133395,7 @@ import {
|
|
|
133379
133395
|
cc as cc4,
|
|
133380
133396
|
toArrayBuffer as toArrayBuffer8
|
|
133381
133397
|
} from "bun:ffi";
|
|
133382
|
-
import { writeFileSync as writeFileSync17, readFileSync as readFileSync16, existsSync as
|
|
133398
|
+
import { writeFileSync as writeFileSync17, readFileSync as readFileSync16, existsSync as existsSync22, unlinkSync as unlinkSync7 } from "fs";
|
|
133383
133399
|
import { join as join19 } from "path";
|
|
133384
133400
|
import { tmpdir as tmpdir14 } from "os";
|
|
133385
133401
|
import { randomBytes as randomBytes6 } from "crypto";
|
|
@@ -133724,7 +133740,7 @@ function cjitopen2(symbols, options) {
|
|
|
133724
133740
|
});
|
|
133725
133741
|
const sharedHash = Bun.hash(sharedHeaderContent).toString(16);
|
|
133726
133742
|
const sharedHeaderFile = join19(tmpdir14(), `xffi-shared-header-${sharedHash}.h`);
|
|
133727
|
-
if (!
|
|
133743
|
+
if (!existsSync22(sharedHeaderFile)) {
|
|
133728
133744
|
try {
|
|
133729
133745
|
writeFileSync17(sharedHeaderFile, sharedHeaderContent, "utf8");
|
|
133730
133746
|
} catch {}
|
|
@@ -133746,7 +133762,7 @@ function cjitopen2(symbols, options) {
|
|
|
133746
133762
|
const ccSymbols = {};
|
|
133747
133763
|
const hash = Bun.hash(headerSource).toString(16);
|
|
133748
133764
|
const headerFile = join19(tmpdir14(), `xffi-jit-header-${hash}.h`);
|
|
133749
|
-
if (!
|
|
133765
|
+
if (!existsSync22(headerFile)) {
|
|
133750
133766
|
try {
|
|
133751
133767
|
writeFileSync17(headerFile, headerSource, "utf8");
|
|
133752
133768
|
} catch {}
|
|
@@ -135080,7 +135096,7 @@ setDefaultAccessor2(concreteLocalMemoryAccessor2);
|
|
|
135080
135096
|
import {
|
|
135081
135097
|
writeFileSync as writeFileSync18,
|
|
135082
135098
|
readFileSync as readFileSync17,
|
|
135083
|
-
existsSync as
|
|
135099
|
+
existsSync as existsSync23,
|
|
135084
135100
|
mkdirSync as mkdirSync13,
|
|
135085
135101
|
unlinkSync as unlinkSync8,
|
|
135086
135102
|
openSync as openSync2,
|
|
@@ -135886,7 +135902,7 @@ class AccessorSealedError2 extends Error {
|
|
|
135886
135902
|
function withFileLockSync2(filePath, fn, timeoutMs = 5000) {
|
|
135887
135903
|
const absTarget = resolve11(filePath);
|
|
135888
135904
|
const dir = dirname10(absTarget);
|
|
135889
|
-
if (!
|
|
135905
|
+
if (!existsSync23(dir)) {
|
|
135890
135906
|
mkdirSync13(dir, { recursive: true });
|
|
135891
135907
|
}
|
|
135892
135908
|
const lockPath = `${absTarget}.lock`;
|
|
@@ -135927,7 +135943,7 @@ function withFileLockSync2(filePath, fn, timeoutMs = 5000) {
|
|
|
135927
135943
|
} catch {}
|
|
135928
135944
|
}
|
|
135929
135945
|
try {
|
|
135930
|
-
if (
|
|
135946
|
+
if (existsSync23(lockPath)) {
|
|
135931
135947
|
unlinkSync8(lockPath);
|
|
135932
135948
|
}
|
|
135933
135949
|
} catch {}
|
|
@@ -135936,7 +135952,7 @@ function withFileLockSync2(filePath, fn, timeoutMs = 5000) {
|
|
|
135936
135952
|
async function withFileLock2(filePath, fn, timeoutMs = 5000) {
|
|
135937
135953
|
const absTarget = resolve11(filePath);
|
|
135938
135954
|
const dir = dirname10(absTarget);
|
|
135939
|
-
if (!
|
|
135955
|
+
if (!existsSync23(dir)) {
|
|
135940
135956
|
mkdirSync13(dir, { recursive: true });
|
|
135941
135957
|
}
|
|
135942
135958
|
const lockPath = `${absTarget}.lock`;
|
|
@@ -135976,7 +135992,7 @@ async function withFileLock2(filePath, fn, timeoutMs = 5000) {
|
|
|
135976
135992
|
} catch {}
|
|
135977
135993
|
}
|
|
135978
135994
|
try {
|
|
135979
|
-
if (
|
|
135995
|
+
if (existsSync23(lockPath)) {
|
|
135980
135996
|
unlinkSync8(lockPath);
|
|
135981
135997
|
}
|
|
135982
135998
|
} catch {}
|
|
@@ -136143,7 +136159,7 @@ class HostAccessor2 extends InittableMiddlewareAccessor2 {
|
|
|
136143
136159
|
const session = this.toJSON();
|
|
136144
136160
|
withFileLockSync2(absPath, () => {
|
|
136145
136161
|
const dir = dirname10(absPath);
|
|
136146
|
-
if (!
|
|
136162
|
+
if (!existsSync23(dir)) {
|
|
136147
136163
|
mkdirSync13(dir, { recursive: true });
|
|
136148
136164
|
}
|
|
136149
136165
|
writeFileSync18(absPath, JSON.stringify(session, null, 2), "utf8");
|
|
@@ -136162,7 +136178,7 @@ class HostAccessor2 extends InittableMiddlewareAccessor2 {
|
|
|
136162
136178
|
const session = this.toJSON();
|
|
136163
136179
|
await withFileLock2(absPath, async () => {
|
|
136164
136180
|
const dir = dirname10(absPath);
|
|
136165
|
-
if (!
|
|
136181
|
+
if (!existsSync23(dir)) {
|
|
136166
136182
|
mkdirSync13(dir, { recursive: true });
|
|
136167
136183
|
}
|
|
136168
136184
|
writeFileSync18(absPath, JSON.stringify(session, null, 2), "utf8");
|
|
@@ -136180,7 +136196,7 @@ class HostAccessor2 extends InittableMiddlewareAccessor2 {
|
|
|
136180
136196
|
static loadSession(filePath) {
|
|
136181
136197
|
const absPath = resolve11(filePath);
|
|
136182
136198
|
return withFileLockSync2(absPath, () => {
|
|
136183
|
-
if (!
|
|
136199
|
+
if (!existsSync23(absPath)) {
|
|
136184
136200
|
throw new Error(`HostAccessor session file not found: ${absPath}`);
|
|
136185
136201
|
}
|
|
136186
136202
|
const raw = readFileSync17(absPath, "utf8");
|
|
@@ -136200,7 +136216,7 @@ class HostAccessor2 extends InittableMiddlewareAccessor2 {
|
|
|
136200
136216
|
const shouldConsume = overrideOptions?.consume !== false;
|
|
136201
136217
|
let session;
|
|
136202
136218
|
await withFileLock2(absPath, async () => {
|
|
136203
|
-
if (!
|
|
136219
|
+
if (!existsSync23(absPath)) {
|
|
136204
136220
|
throw new Error(`HostAccessor session file not found: ${absPath}`);
|
|
136205
136221
|
}
|
|
136206
136222
|
const raw = readFileSync17(absPath, "utf8");
|
|
@@ -139055,7 +139071,7 @@ init_capstone_def();
|
|
|
139055
139071
|
init_dist3();
|
|
139056
139072
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
139057
139073
|
import { dirname as dirname11, join as join20 } from "path";
|
|
139058
|
-
import { existsSync as
|
|
139074
|
+
import { existsSync as existsSync24, statSync as statSync9, writeFileSync as writeFileSync19 } from "fs";
|
|
139059
139075
|
import { tmpdir as tmpdir15 } from "os";
|
|
139060
139076
|
|
|
139061
139077
|
// packages/capstone/core/src/def/embedded-capstone.ts
|
|
@@ -139067,7 +139083,7 @@ var __dirname3 = dirname11(__filename3);
|
|
|
139067
139083
|
function findCapstoneDll2() {
|
|
139068
139084
|
try {
|
|
139069
139085
|
const cached = join20(getDepsCacheDir2(), "capstone.dll");
|
|
139070
|
-
if (
|
|
139086
|
+
if (existsSync24(cached)) {
|
|
139071
139087
|
return cached;
|
|
139072
139088
|
}
|
|
139073
139089
|
} catch {}
|
|
@@ -139083,7 +139099,7 @@ function findCapstoneDll2() {
|
|
|
139083
139099
|
join20(process.cwd(), "packages/capstone/deps/capstone.dll")
|
|
139084
139100
|
];
|
|
139085
139101
|
for (const candidate of candidates) {
|
|
139086
|
-
if (
|
|
139102
|
+
if (existsSync24(candidate)) {
|
|
139087
139103
|
return candidate;
|
|
139088
139104
|
}
|
|
139089
139105
|
}
|
|
@@ -139102,7 +139118,7 @@ function findCapstoneDll2() {
|
|
|
139102
139118
|
const tempDllPath = join20(tmpdir15(), "exoproc_capstone.dll");
|
|
139103
139119
|
try {
|
|
139104
139120
|
const buf = Buffer.from(EMBEDDED_CAPSTONE_DLL_BASE642, "base64");
|
|
139105
|
-
if (!
|
|
139121
|
+
if (!existsSync24(tempDllPath) || statSync9(tempDllPath).size !== buf.length) {
|
|
139106
139122
|
writeFileSync19(tempDllPath, buf);
|
|
139107
139123
|
}
|
|
139108
139124
|
return tempDllPath;
|