@@ -184627,7 +184627,7 @@ function cacheDatabaseAnalyzeResults(params, logger2) {
184627184627 resultContent,
184628184628 resultCount
184629184629 });
184630- logger2.info(`Cached database-analyze results with key: ${cacheKey2} (${resultCount ?? 0 } results)`);
184630+ logger2.info(`Cached database-analyze results with key: ${cacheKey2} (${resultCount != null ? `${resultCount } results` : "result count unknown"} )`);
184631184631 } catch (err) {
184632184632 logger2.error("Failed to cache database-analyze results:", err);
184633184633 }
@@ -187354,7 +187354,7 @@ function registerCLITool(server, definition) {
187354187354 if (files && Array.isArray(files)) {
187355187355 positionalArgs = [...positionalArgs, ...files];
187356187356 }
187357- if (file && name.startsWith("codeql_bqrs_")) {
187357+ if (file !== void 0 && name.startsWith("codeql_bqrs_")) {
187358187358 let cleanFile = Array.isArray(file) ? file.length > 0 ? String(file[0]) : "" : String(file);
187359187359 if (cleanFile.startsWith("[") && cleanFile.endsWith("]")) {
187360187360 try {
@@ -187367,7 +187367,7 @@ function registerCLITool(server, definition) {
187367187367 } catch {
187368187368 }
187369187369 }
187370- if (!cleanFile) {
187370+ if (!cleanFile.trim() ) {
187371187371 throw new Error('The "file" parameter for BQRS tools must be a non-empty string path to a .bqrs file.');
187372187372 }
187373187373 positionalArgs = [...positionalArgs, cleanFile];
@@ -187500,9 +187500,15 @@ function registerCLITool(server, definition) {
187500187500 }
187501187501 break;
187502187502 }
187503- case "codeql_bqrs_interpret":
187504- if (options.database) {
187505- const dbPath = resolveDatabasePath(options.database);
187503+ case "codeql_bqrs_interpret": {
187504+ const dbValue = options.database;
187505+ delete options.database;
187506+ if (dbValue !== void 0) {
187507+ const dbStr = String(dbValue).trim();
187508+ if (!dbStr) {
187509+ throw new Error('The "database" parameter must be a non-empty path to a CodeQL database.');
187510+ }
187511+ const dbPath = resolveDatabasePath(dbStr);
187506187512 if (!options["source-archive"]) {
187507187513 const srcZipPath = join10(dbPath, "src.zip");
187508187514 const srcDirPath = join10(dbPath, "src");
@@ -187511,7 +187517,6 @@ function registerCLITool(server, definition) {
187511187517 } else if (existsSync6(srcDirPath)) {
187512187518 options["source-archive"] = srcDirPath;
187513187519 } else {
187514- delete options.database;
187515187520 throw new Error(
187516187521 `CodeQL database at "${dbPath}" does not contain a source archive (expected "src.zip" file or "src" directory).`
187517187522 );
@@ -187528,9 +187533,9 @@ function registerCLITool(server, definition) {
187528187533 } catch {
187529187534 }
187530187535 }
187531- delete options.database;
187532187536 }
187533187537 break;
187538+ }
187534187539 case "codeql_query_compile":
187535187540 case "codeql_resolve_metadata":
187536187541 if (query) {
0 commit comments