mobbdev 1.0.189 → 1.0.191
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/args/commands/upload_ai_blame.d.mts +15 -0
- package/dist/args/commands/upload_ai_blame.mjs +5625 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +67 -61
- package/package.json +1 -1
package/dist/index.d.mts
ADDED
package/dist/index.mjs
CHANGED
|
@@ -1323,10 +1323,10 @@ import Debug20 from "debug";
|
|
|
1323
1323
|
import { hideBin } from "yargs/helpers";
|
|
1324
1324
|
|
|
1325
1325
|
// src/args/commands/convert_to_sarif.ts
|
|
1326
|
-
import
|
|
1326
|
+
import fs7 from "fs";
|
|
1327
1327
|
|
|
1328
1328
|
// src/commands/convert_to_sarif.ts
|
|
1329
|
-
import
|
|
1329
|
+
import fs6 from "fs";
|
|
1330
1330
|
import path5 from "path";
|
|
1331
1331
|
|
|
1332
1332
|
// src/commands/fpr_stream_parser.ts
|
|
@@ -9087,6 +9087,7 @@ __export(utils_exports, {
|
|
|
9087
9087
|
CliError: () => CliError,
|
|
9088
9088
|
Spinner: () => Spinner,
|
|
9089
9089
|
getDirName: () => getDirName,
|
|
9090
|
+
getModuleRootDir: () => getModuleRootDir,
|
|
9090
9091
|
getTopLevelDirName: () => getTopLevelDirName,
|
|
9091
9092
|
keypress: () => keypress,
|
|
9092
9093
|
packageJson: () => packageJson,
|
|
@@ -9094,8 +9095,20 @@ __export(utils_exports, {
|
|
|
9094
9095
|
});
|
|
9095
9096
|
|
|
9096
9097
|
// src/utils/dirname.ts
|
|
9098
|
+
import fs4 from "fs";
|
|
9097
9099
|
import path3 from "path";
|
|
9098
9100
|
import { fileURLToPath } from "url";
|
|
9101
|
+
function getModuleRootDir() {
|
|
9102
|
+
let manifestDir = getDirName();
|
|
9103
|
+
for (let i = 0; i < 10; i++) {
|
|
9104
|
+
const manifestPath = path3.join(manifestDir, "package.json");
|
|
9105
|
+
if (fs4.existsSync(manifestPath)) {
|
|
9106
|
+
return manifestDir;
|
|
9107
|
+
}
|
|
9108
|
+
manifestDir = path3.join(manifestDir, "..");
|
|
9109
|
+
}
|
|
9110
|
+
throw new Error("Cannot locate package.json file");
|
|
9111
|
+
}
|
|
9099
9112
|
function getDirName() {
|
|
9100
9113
|
return path3.dirname(fileURLToPath(import.meta.url));
|
|
9101
9114
|
}
|
|
@@ -9163,15 +9176,13 @@ function Spinner({ ci = false } = {}) {
|
|
|
9163
9176
|
}
|
|
9164
9177
|
|
|
9165
9178
|
// src/utils/check_node_version.ts
|
|
9166
|
-
import
|
|
9179
|
+
import fs5 from "fs";
|
|
9167
9180
|
import path4 from "path";
|
|
9168
9181
|
import semver from "semver";
|
|
9169
9182
|
function getPackageJson() {
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
}
|
|
9174
|
-
return JSON.parse(fs4.readFileSync(manifestPath, "utf8"));
|
|
9183
|
+
return JSON.parse(
|
|
9184
|
+
fs5.readFileSync(path4.join(getModuleRootDir(), "package.json"), "utf8")
|
|
9185
|
+
);
|
|
9175
9186
|
}
|
|
9176
9187
|
var packageJson = getPackageJson();
|
|
9177
9188
|
if (!semver.satisfies(process.version, packageJson.engines.node)) {
|
|
@@ -9237,7 +9248,7 @@ async function convertFprToSarif(inputFilePath, outputFilePath, codePathPatterns
|
|
|
9237
9248
|
await auditXmlSaxParser.parse();
|
|
9238
9249
|
}
|
|
9239
9250
|
await zipIn.close();
|
|
9240
|
-
const writer =
|
|
9251
|
+
const writer = fs6.createWriteStream(outputFilePath);
|
|
9241
9252
|
writer.write(`{
|
|
9242
9253
|
"$schema": "https://json.schemastore.org/sarif-2.1.0.json",
|
|
9243
9254
|
"version": "2.1.0",
|
|
@@ -9343,14 +9354,12 @@ import chalk2 from "chalk";
|
|
|
9343
9354
|
|
|
9344
9355
|
// src/constants.ts
|
|
9345
9356
|
import path6 from "path";
|
|
9346
|
-
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
9347
9357
|
import chalk from "chalk";
|
|
9348
9358
|
import Debug4 from "debug";
|
|
9349
9359
|
import * as dotenv from "dotenv";
|
|
9350
9360
|
import { z as z24 } from "zod";
|
|
9351
9361
|
var debug5 = Debug4("mobbdev:constants");
|
|
9352
|
-
|
|
9353
|
-
dotenv.config({ path: path6.join(__dirname, "../.env") });
|
|
9362
|
+
dotenv.config({ path: path6.join(getModuleRootDir(), ".env") });
|
|
9354
9363
|
var scmFriendlyText = {
|
|
9355
9364
|
["Ado" /* Ado */]: "Azure DevOps",
|
|
9356
9365
|
["Bitbucket" /* Bitbucket */]: "Bitbucket",
|
|
@@ -9571,7 +9580,7 @@ function convertToSarifBuilder(args) {
|
|
|
9571
9580
|
).help().demandOption(["input-file-path", "input-file-format", "output-file-path"]);
|
|
9572
9581
|
}
|
|
9573
9582
|
async function validateConvertToSarifOptions(args) {
|
|
9574
|
-
if (!
|
|
9583
|
+
if (!fs7.existsSync(args.inputFilePath)) {
|
|
9575
9584
|
throw new CliError(
|
|
9576
9585
|
"\nError: --input-file-path flag should point to an existing file"
|
|
9577
9586
|
);
|
|
@@ -9605,14 +9614,14 @@ import chalk11 from "chalk";
|
|
|
9605
9614
|
import yargs from "yargs/yargs";
|
|
9606
9615
|
|
|
9607
9616
|
// src/args/commands/analyze.ts
|
|
9608
|
-
import
|
|
9617
|
+
import fs10 from "fs";
|
|
9609
9618
|
|
|
9610
9619
|
// src/commands/index.ts
|
|
9611
9620
|
import crypto from "crypto";
|
|
9612
9621
|
import os from "os";
|
|
9613
9622
|
|
|
9614
9623
|
// src/features/analysis/index.ts
|
|
9615
|
-
import
|
|
9624
|
+
import fs9 from "fs";
|
|
9616
9625
|
import fsPromises2 from "fs/promises";
|
|
9617
9626
|
import path9 from "path";
|
|
9618
9627
|
import { env as env2 } from "process";
|
|
@@ -10892,7 +10901,7 @@ var GQLClient = class {
|
|
|
10892
10901
|
|
|
10893
10902
|
// src/features/analysis/pack.ts
|
|
10894
10903
|
init_configs();
|
|
10895
|
-
import
|
|
10904
|
+
import fs8 from "fs";
|
|
10896
10905
|
import path7 from "path";
|
|
10897
10906
|
import AdmZip from "adm-zip";
|
|
10898
10907
|
import Debug13 from "debug";
|
|
@@ -10969,11 +10978,11 @@ async function pack(srcDirPath, vulnFiles, isIncludeAllFiles = false) {
|
|
|
10969
10978
|
continue;
|
|
10970
10979
|
}
|
|
10971
10980
|
}
|
|
10972
|
-
if (
|
|
10981
|
+
if (fs8.lstatSync(absFilepath).size > MCP_MAX_FILE_SIZE) {
|
|
10973
10982
|
debug14("ignoring %s because the size is > 5MB", filepath);
|
|
10974
10983
|
continue;
|
|
10975
10984
|
}
|
|
10976
|
-
const data = git ? await git.showBuffer([`HEAD:./${filepath}`]) :
|
|
10985
|
+
const data = git ? await git.showBuffer([`HEAD:./${filepath}`]) : fs8.readFileSync(absFilepath);
|
|
10977
10986
|
if (isBinary2(null, data)) {
|
|
10978
10987
|
debug14("ignoring %s because is seems to be a binary file", filepath);
|
|
10979
10988
|
continue;
|
|
@@ -11397,13 +11406,13 @@ async function downloadRepo({
|
|
|
11397
11406
|
repoSpinner.error({ text: "\u{1F4BE} Repo download failed" });
|
|
11398
11407
|
throw new Error(`Can't access ${chalk5.bold(repoUrl)}`);
|
|
11399
11408
|
}
|
|
11400
|
-
const fileWriterStream =
|
|
11409
|
+
const fileWriterStream = fs9.createWriteStream(zipFilePath);
|
|
11401
11410
|
if (!response.body) {
|
|
11402
11411
|
throw new Error("Response body is empty");
|
|
11403
11412
|
}
|
|
11404
11413
|
await pipeline(response.body, fileWriterStream);
|
|
11405
11414
|
await extract(zipFilePath, { dir: dirname });
|
|
11406
|
-
const repoRoot =
|
|
11415
|
+
const repoRoot = fs9.readdirSync(dirname, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name)[0];
|
|
11407
11416
|
if (!repoRoot) {
|
|
11408
11417
|
throw new Error("Repo root not found");
|
|
11409
11418
|
}
|
|
@@ -12332,7 +12341,7 @@ function analyzeBuilder(yargs2) {
|
|
|
12332
12341
|
).help();
|
|
12333
12342
|
}
|
|
12334
12343
|
function validateAnalyzeOptions(argv) {
|
|
12335
|
-
if (argv.f && !
|
|
12344
|
+
if (argv.f && !fs10.existsSync(argv.f)) {
|
|
12336
12345
|
throw new CliError(`
|
|
12337
12346
|
Can't access ${chalk8.bold(argv.f)}`);
|
|
12338
12347
|
}
|
|
@@ -13393,7 +13402,7 @@ async function createAuthenticatedMcpGQLClient({
|
|
|
13393
13402
|
|
|
13394
13403
|
// src/mcp/services/McpUsageService/host.ts
|
|
13395
13404
|
import { execSync } from "child_process";
|
|
13396
|
-
import
|
|
13405
|
+
import fs11 from "fs";
|
|
13397
13406
|
import os3 from "os";
|
|
13398
13407
|
import path11 from "path";
|
|
13399
13408
|
var IDEs = ["cursor", "windsurf", "webstorm", "vscode", "claude"];
|
|
@@ -13412,15 +13421,15 @@ var getClaudeWorkspacePaths = () => {
|
|
|
13412
13421
|
const home = os3.homedir();
|
|
13413
13422
|
const claudeIdePath = path11.join(home, ".claude", "ide");
|
|
13414
13423
|
const workspacePaths = [];
|
|
13415
|
-
if (!
|
|
13424
|
+
if (!fs11.existsSync(claudeIdePath)) {
|
|
13416
13425
|
return workspacePaths;
|
|
13417
13426
|
}
|
|
13418
13427
|
try {
|
|
13419
|
-
const lockFiles =
|
|
13428
|
+
const lockFiles = fs11.readdirSync(claudeIdePath).filter((file) => file.endsWith(".lock"));
|
|
13420
13429
|
for (const lockFile of lockFiles) {
|
|
13421
13430
|
const lockFilePath = path11.join(claudeIdePath, lockFile);
|
|
13422
13431
|
try {
|
|
13423
|
-
const lockContent = JSON.parse(
|
|
13432
|
+
const lockContent = JSON.parse(fs11.readFileSync(lockFilePath, "utf8"));
|
|
13424
13433
|
if (lockContent.workspaceFolders && Array.isArray(lockContent.workspaceFolders)) {
|
|
13425
13434
|
workspacePaths.push(...lockContent.workspaceFolders);
|
|
13426
13435
|
}
|
|
@@ -13486,9 +13495,9 @@ var getMCPConfigPaths = (hostName) => {
|
|
|
13486
13495
|
}
|
|
13487
13496
|
};
|
|
13488
13497
|
var readConfigFile = (filePath) => {
|
|
13489
|
-
if (!
|
|
13498
|
+
if (!fs11.existsSync(filePath)) return null;
|
|
13490
13499
|
try {
|
|
13491
|
-
return JSON.parse(
|
|
13500
|
+
return JSON.parse(fs11.readFileSync(filePath, "utf8"));
|
|
13492
13501
|
} catch (error) {
|
|
13493
13502
|
logWarn(`[UsageService] Failed to read MCP config: ${filePath}`);
|
|
13494
13503
|
return null;
|
|
@@ -14111,7 +14120,6 @@ var McpServer = class {
|
|
|
14111
14120
|
SIGQUIT: "MCP server quit signal received",
|
|
14112
14121
|
SIGABRT: "MCP server abort signal received",
|
|
14113
14122
|
SIGPIPE: "MCP server broken pipe signal received",
|
|
14114
|
-
SIGCHLD: "MCP server child process signal received",
|
|
14115
14123
|
SIGTSTP: "MCP server terminal stop signal received",
|
|
14116
14124
|
exit: "MCP server exiting",
|
|
14117
14125
|
uncaughtException: "Uncaught exception in MCP server",
|
|
@@ -14143,9 +14151,6 @@ var McpServer = class {
|
|
|
14143
14151
|
} else {
|
|
14144
14152
|
logDebug(message, { signal });
|
|
14145
14153
|
}
|
|
14146
|
-
if (signal === "SIGCHLD") {
|
|
14147
|
-
return;
|
|
14148
|
-
}
|
|
14149
14154
|
if (signal === "SIGINT" || signal === "SIGTERM" || signal === "SIGHUP" || signal === "SIGQUIT" || signal === "SIGABRT" || signal === "SIGPIPE" || signal === "SIGTSTP") {
|
|
14150
14155
|
await this.trackServerUsage("stop", signal);
|
|
14151
14156
|
process.exit(0);
|
|
@@ -14235,7 +14240,6 @@ var McpServer = class {
|
|
|
14235
14240
|
"SIGQUIT",
|
|
14236
14241
|
"SIGABRT",
|
|
14237
14242
|
"SIGPIPE",
|
|
14238
|
-
"SIGCHLD",
|
|
14239
14243
|
"SIGTSTP",
|
|
14240
14244
|
"exit",
|
|
14241
14245
|
"uncaughtException",
|
|
@@ -14472,7 +14476,7 @@ var McpServer = class {
|
|
|
14472
14476
|
import { z as z34 } from "zod";
|
|
14473
14477
|
|
|
14474
14478
|
// src/mcp/services/PathValidation.ts
|
|
14475
|
-
import
|
|
14479
|
+
import fs12 from "fs";
|
|
14476
14480
|
import path12 from "path";
|
|
14477
14481
|
async function validatePath(inputPath) {
|
|
14478
14482
|
logDebug("Validating MCP path", { inputPath });
|
|
@@ -14532,7 +14536,7 @@ async function validatePath(inputPath) {
|
|
|
14532
14536
|
logDebug("Path validation successful", { inputPath });
|
|
14533
14537
|
logDebug("Checking path existence", { inputPath });
|
|
14534
14538
|
try {
|
|
14535
|
-
await
|
|
14539
|
+
await fs12.promises.access(inputPath);
|
|
14536
14540
|
logDebug("Path exists and is accessible", { inputPath });
|
|
14537
14541
|
WorkspaceService.setKnownWorkspacePath(inputPath);
|
|
14538
14542
|
logDebug("Stored validated path in WorkspaceService", { inputPath });
|
|
@@ -14782,10 +14786,12 @@ You have viewed ${shownCount} out of ${totalCount} available fixes.
|
|
|
14782
14786
|
|
|
14783
14787
|
### \u26A0\uFE0F CRITICAL INSTRUCTION FOR AI AGENTS \u26A0\uFE0F
|
|
14784
14788
|
|
|
14785
|
-
**DO NOT AUTOMATICALLY FETCH ADDITIONAL FIXES
|
|
14789
|
+
**YOU MUST INFORM THE USER, BUT DO NOT AUTOMATICALLY FETCH ADDITIONAL FIXES**
|
|
14786
14790
|
|
|
14791
|
+
- **YOU MUST** tell the user that there are ${totalCount - nextOffset} additional fixes available
|
|
14792
|
+
- **YOU MUST** inform the user they can request more fixes if they want to see them
|
|
14787
14793
|
- **DO NOT** run the \`${currentTool}\` tool again on your own
|
|
14788
|
-
- **DO NOT** automatically retrieve more fixes
|
|
14794
|
+
- **DO NOT** automatically retrieve more fixes without explicit user request
|
|
14789
14795
|
- **ONLY** fetch additional fixes if the user explicitly asks for them
|
|
14790
14796
|
- **WAIT** for the user to specifically request more fixes before proceeding
|
|
14791
14797
|
|
|
@@ -15154,7 +15160,7 @@ If you wish to scan files that were recently changed in your git history call th
|
|
|
15154
15160
|
init_FileUtils();
|
|
15155
15161
|
init_GitService();
|
|
15156
15162
|
init_configs();
|
|
15157
|
-
import
|
|
15163
|
+
import fs13 from "fs/promises";
|
|
15158
15164
|
import nodePath from "path";
|
|
15159
15165
|
var getLocalFiles = async ({
|
|
15160
15166
|
path: path17,
|
|
@@ -15172,7 +15178,7 @@ var getLocalFiles = async ({
|
|
|
15172
15178
|
scanRecentlyChangedFiles
|
|
15173
15179
|
});
|
|
15174
15180
|
try {
|
|
15175
|
-
const resolvedRepoPath = await
|
|
15181
|
+
const resolvedRepoPath = await fs13.realpath(path17);
|
|
15176
15182
|
logDebug(`[${scanContext}] Resolved repository path`, {
|
|
15177
15183
|
resolvedRepoPath,
|
|
15178
15184
|
originalPath: path17
|
|
@@ -15252,7 +15258,7 @@ var getLocalFiles = async ({
|
|
|
15252
15258
|
absoluteFilePath
|
|
15253
15259
|
);
|
|
15254
15260
|
try {
|
|
15255
|
-
const fileStat = await
|
|
15261
|
+
const fileStat = await fs13.stat(absoluteFilePath);
|
|
15256
15262
|
return {
|
|
15257
15263
|
filename: nodePath.basename(absoluteFilePath),
|
|
15258
15264
|
relativePath,
|
|
@@ -15287,7 +15293,7 @@ var getLocalFiles = async ({
|
|
|
15287
15293
|
};
|
|
15288
15294
|
|
|
15289
15295
|
// src/mcp/services/LocalMobbFolderService.ts
|
|
15290
|
-
import
|
|
15296
|
+
import fs14 from "fs";
|
|
15291
15297
|
import path13 from "path";
|
|
15292
15298
|
import { z as z33 } from "zod";
|
|
15293
15299
|
init_GitService();
|
|
@@ -15379,15 +15385,15 @@ var LocalMobbFolderService = class {
|
|
|
15379
15385
|
this.repoPath,
|
|
15380
15386
|
this.defaultMobbFolderName
|
|
15381
15387
|
);
|
|
15382
|
-
if (!
|
|
15388
|
+
if (!fs14.existsSync(mobbFolderPath)) {
|
|
15383
15389
|
logInfo("[LocalMobbFolderService] Creating .mobb folder", {
|
|
15384
15390
|
mobbFolderPath
|
|
15385
15391
|
});
|
|
15386
|
-
|
|
15392
|
+
fs14.mkdirSync(mobbFolderPath, { recursive: true });
|
|
15387
15393
|
} else {
|
|
15388
15394
|
logDebug("[LocalMobbFolderService] .mobb folder already exists");
|
|
15389
15395
|
}
|
|
15390
|
-
const stats =
|
|
15396
|
+
const stats = fs14.statSync(mobbFolderPath);
|
|
15391
15397
|
if (!stats.isDirectory()) {
|
|
15392
15398
|
throw new Error(`Path exists but is not a directory: ${mobbFolderPath}`);
|
|
15393
15399
|
}
|
|
@@ -15428,13 +15434,13 @@ var LocalMobbFolderService = class {
|
|
|
15428
15434
|
logDebug("[LocalMobbFolderService] Git repository validated successfully");
|
|
15429
15435
|
} else {
|
|
15430
15436
|
try {
|
|
15431
|
-
const stats =
|
|
15437
|
+
const stats = fs14.statSync(this.repoPath);
|
|
15432
15438
|
if (!stats.isDirectory()) {
|
|
15433
15439
|
throw new Error(
|
|
15434
15440
|
`Path exists but is not a directory: ${this.repoPath}`
|
|
15435
15441
|
);
|
|
15436
15442
|
}
|
|
15437
|
-
|
|
15443
|
+
fs14.accessSync(this.repoPath, fs14.constants.R_OK | fs14.constants.W_OK);
|
|
15438
15444
|
logDebug(
|
|
15439
15445
|
"[LocalMobbFolderService] Non-git directory validated successfully"
|
|
15440
15446
|
);
|
|
@@ -15548,7 +15554,7 @@ var LocalMobbFolderService = class {
|
|
|
15548
15554
|
baseFileName
|
|
15549
15555
|
);
|
|
15550
15556
|
const filePath = path13.join(mobbFolderPath, uniqueFileName);
|
|
15551
|
-
await
|
|
15557
|
+
await fs14.promises.writeFile(filePath, patch, "utf8");
|
|
15552
15558
|
logInfo("[LocalMobbFolderService] Patch saved successfully", {
|
|
15553
15559
|
filePath,
|
|
15554
15560
|
fileName: uniqueFileName,
|
|
@@ -15609,7 +15615,7 @@ var LocalMobbFolderService = class {
|
|
|
15609
15615
|
const extension = path13.parse(baseFileName).ext;
|
|
15610
15616
|
let uniqueFileName = baseFileName;
|
|
15611
15617
|
let index = 1;
|
|
15612
|
-
while (
|
|
15618
|
+
while (fs14.existsSync(path13.join(folderPath, uniqueFileName))) {
|
|
15613
15619
|
uniqueFileName = `${baseName}-${index}${extension}`;
|
|
15614
15620
|
index++;
|
|
15615
15621
|
if (index > 1e3) {
|
|
@@ -15643,15 +15649,15 @@ var LocalMobbFolderService = class {
|
|
|
15643
15649
|
const patchInfoPath = path13.join(mobbFolderPath, "patchInfo.md");
|
|
15644
15650
|
const markdownContent = this.generateFixMarkdown(fix, savedPatchFileName);
|
|
15645
15651
|
let existingContent = "";
|
|
15646
|
-
if (
|
|
15647
|
-
existingContent = await
|
|
15652
|
+
if (fs14.existsSync(patchInfoPath)) {
|
|
15653
|
+
existingContent = await fs14.promises.readFile(patchInfoPath, "utf8");
|
|
15648
15654
|
logDebug("[LocalMobbFolderService] Existing patchInfo.md found");
|
|
15649
15655
|
} else {
|
|
15650
15656
|
logDebug("[LocalMobbFolderService] Creating new patchInfo.md file");
|
|
15651
15657
|
}
|
|
15652
15658
|
const separator = existingContent ? "\n\n================================================================================\n\n" : "";
|
|
15653
15659
|
const updatedContent = `${markdownContent}${separator}${existingContent}`;
|
|
15654
|
-
await
|
|
15660
|
+
await fs14.promises.writeFile(patchInfoPath, updatedContent, "utf8");
|
|
15655
15661
|
logInfo("[LocalMobbFolderService] Patch info logged successfully", {
|
|
15656
15662
|
patchInfoPath,
|
|
15657
15663
|
fixId: fix.id,
|
|
@@ -16024,7 +16030,7 @@ import {
|
|
|
16024
16030
|
unlinkSync,
|
|
16025
16031
|
writeFileSync
|
|
16026
16032
|
} from "fs";
|
|
16027
|
-
import
|
|
16033
|
+
import fs15 from "fs/promises";
|
|
16028
16034
|
import parseDiff2 from "parse-diff";
|
|
16029
16035
|
import path14 from "path";
|
|
16030
16036
|
var PatchApplicationService = class {
|
|
@@ -16522,7 +16528,7 @@ var PatchApplicationService = class {
|
|
|
16522
16528
|
try {
|
|
16523
16529
|
const absolutePath = path14.resolve(repositoryPath, targetFile);
|
|
16524
16530
|
if (existsSync2(absolutePath)) {
|
|
16525
|
-
const stats = await
|
|
16531
|
+
const stats = await fs15.stat(absolutePath);
|
|
16526
16532
|
const fileModTime = stats.mtime.getTime();
|
|
16527
16533
|
if (fileModTime > scanStartTime) {
|
|
16528
16534
|
logError(
|
|
@@ -16563,7 +16569,7 @@ var PatchApplicationService = class {
|
|
|
16563
16569
|
const appliedFixes = [];
|
|
16564
16570
|
const failedFixes = [];
|
|
16565
16571
|
const skippedFixes = [];
|
|
16566
|
-
const resolvedRepoPath = await
|
|
16572
|
+
const resolvedRepoPath = await fs15.realpath(repositoryPath);
|
|
16567
16573
|
logInfo(
|
|
16568
16574
|
`[${scanContext}] Starting patch application for ${fixes.length} fixes`,
|
|
16569
16575
|
{
|
|
@@ -16992,7 +16998,7 @@ init_configs();
|
|
|
16992
16998
|
|
|
16993
16999
|
// src/mcp/services/FileOperations.ts
|
|
16994
17000
|
init_FileUtils();
|
|
16995
|
-
import
|
|
17001
|
+
import fs16 from "fs";
|
|
16996
17002
|
import path15 from "path";
|
|
16997
17003
|
import AdmZip2 from "adm-zip";
|
|
16998
17004
|
var FileOperations = class {
|
|
@@ -17075,7 +17081,7 @@ var FileOperations = class {
|
|
|
17075
17081
|
continue;
|
|
17076
17082
|
}
|
|
17077
17083
|
try {
|
|
17078
|
-
await
|
|
17084
|
+
await fs16.promises.access(absoluteFilepath, fs16.constants.R_OK);
|
|
17079
17085
|
validatedPaths.push(filepath);
|
|
17080
17086
|
} catch (error) {
|
|
17081
17087
|
logDebug(
|
|
@@ -17094,7 +17100,7 @@ var FileOperations = class {
|
|
|
17094
17100
|
const fileDataArray = [];
|
|
17095
17101
|
for (const absolutePath of filePaths) {
|
|
17096
17102
|
try {
|
|
17097
|
-
const content = await
|
|
17103
|
+
const content = await fs16.promises.readFile(absolutePath);
|
|
17098
17104
|
const relativePath = path15.basename(absolutePath);
|
|
17099
17105
|
fileDataArray.push({
|
|
17100
17106
|
relativePath,
|
|
@@ -17120,7 +17126,7 @@ var FileOperations = class {
|
|
|
17120
17126
|
relativeFilepath
|
|
17121
17127
|
}) {
|
|
17122
17128
|
try {
|
|
17123
|
-
return await
|
|
17129
|
+
return await fs16.promises.readFile(absoluteFilepath);
|
|
17124
17130
|
} catch (fsError) {
|
|
17125
17131
|
logError(
|
|
17126
17132
|
`[FileOperations] Failed to read ${relativeFilepath} from filesystem: ${fsError}`
|
|
@@ -18669,7 +18675,7 @@ var mcpHandler = async (_args) => {
|
|
|
18669
18675
|
};
|
|
18670
18676
|
|
|
18671
18677
|
// src/args/commands/review.ts
|
|
18672
|
-
import
|
|
18678
|
+
import fs17 from "fs";
|
|
18673
18679
|
import chalk9 from "chalk";
|
|
18674
18680
|
function reviewBuilder(yargs2) {
|
|
18675
18681
|
return yargs2.option("f", {
|
|
@@ -18706,7 +18712,7 @@ function reviewBuilder(yargs2) {
|
|
|
18706
18712
|
).help();
|
|
18707
18713
|
}
|
|
18708
18714
|
function validateReviewOptions(argv) {
|
|
18709
|
-
if (!
|
|
18715
|
+
if (!fs17.existsSync(argv.f)) {
|
|
18710
18716
|
throw new CliError(`
|
|
18711
18717
|
Can't access ${chalk9.bold(argv.f)}`);
|
|
18712
18718
|
}
|
|
@@ -18779,7 +18785,7 @@ async function addScmTokenHandler(args) {
|
|
|
18779
18785
|
}
|
|
18780
18786
|
|
|
18781
18787
|
// src/args/commands/upload_ai_blame.ts
|
|
18782
|
-
import
|
|
18788
|
+
import fs18 from "fs/promises";
|
|
18783
18789
|
import path16 from "path";
|
|
18784
18790
|
import chalk10 from "chalk";
|
|
18785
18791
|
function uploadAiBlameBuilder(args) {
|
|
@@ -18829,7 +18835,7 @@ async function uploadAiBlameHandler(args) {
|
|
|
18829
18835
|
const promptPath = String(prompts[i]);
|
|
18830
18836
|
const inferencePath = String(inferences[i]);
|
|
18831
18837
|
try {
|
|
18832
|
-
await Promise.all([
|
|
18838
|
+
await Promise.all([fs18.access(promptPath), fs18.access(inferencePath)]);
|
|
18833
18839
|
} catch {
|
|
18834
18840
|
console.error(chalk10.red(`File not found for session ${i + 1}`));
|
|
18835
18841
|
process.exit(1);
|