You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/dist/codeql-development-mcp-server.js
+19-9Lines changed: 19 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -182939,7 +182939,6 @@ async function resolveQueryPath(params, logger2) {
182939
182939
182940
182940
// src/lib/result-processor.ts
182941
182941
init_cli_executor();
182942
-
init_cli_executor();
182943
182942
import { basename as basename4, dirname as dirname4 } from "path";
182944
182943
import { mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
182945
182944
import { createHash as createHash2 } from "crypto";
@@ -182965,6 +182964,8 @@ async function extractQueryMetadata(queryPath) {
182965
182964
mtime = fstatSync(fd).mtimeMs;
182966
182965
const cached2 = metadataCache.get(queryPath);
182967
182966
if (cached2 && cached2.mtime === mtime) {
182967
+
metadataCache.delete(queryPath);
182968
+
metadataCache.set(queryPath, cached2);
182968
182969
return cached2.metadata;
182969
182970
}
182970
182971
queryContent = readFileSync4(fd, "utf-8");
@@ -183402,8 +183403,13 @@ var SqliteStore = class _SqliteStore {
183402
183403
/**
183403
183404
* Write the in-memory database to disk.
183404
183405
*
183405
-
* Uses write-to-temp + atomic rename so a crash mid-write cannot
183406
-
* corrupt the database file.
183406
+
* On platforms where `renameSync` can atomically replace the destination
183407
+
* (for example, POSIX filesystems and Windows when the target is not
183408
+
* locked), this uses a write-to-temp + atomic rename pattern so a crash
183409
+
* mid-write cannot corrupt the existing database file. On some Windows
183410
+
* configurations where `renameSync` fails because the destination is
183411
+
* locked, we fall back to a direct overwrite, which is best-effort only
183412
+
* and not fully crash-safe.
183407
183413
*/
183408
183414
flush() {
183409
183415
if (this.flushTimer) {
@@ -183447,6 +183453,10 @@ var SqliteStore = class _SqliteStore {
183447
183453
* Close the database (and flush remaining changes).
183448
183454
*/
183449
183455
close() {
183456
+
if (this.flushTimer) {
183457
+
globalThis.clearTimeout(this.flushTimer);
183458
+
this.flushTimer = null;
183459
+
}
183450
183460
this.flushIfDirty();
183451
183461
this.db?.close();
183452
183462
this.db = null;
@@ -183582,11 +183592,11 @@ var SqliteStore = class _SqliteStore {
183582
183592
sql += " WHERE " + conditions.join(" AND ");
183583
183593
}
183584
183594
sql += " ORDER BY updated_at DESC";
183585
-
if (filter?.limit) {
183595
+
if (filter?.limit !== void 0) {
183586
183596
sql += " LIMIT $limit";
183587
183597
params.$limit = filter.limit;
183588
183598
}
183589
-
if (filter?.offset) {
183599
+
if (filter?.offset !== void 0) {
183590
183600
sql += " OFFSET $offset";
183591
183601
params.$offset = filter.offset;
183592
183602
}
@@ -193731,11 +193741,11 @@ function registerQueryResultsCacheRetrieveTool(server) {
193731
193741
"Retrieve cached query results with optional subset selection. Supports line ranges (for graphtext/CSV) and SARIF result indices and file filtering to return only the relevant portion.",
193732
193742
{
193733
193743
cacheKey: external_exports.string().describe("The cache key of the result to retrieve."),
193734
-
lineRange: external_exports.tuple([external_exports.number(), external_exports.number()]).optional().describe("Line range [start, end] (1-indexed, inclusive). For graphtext/CSV output only."),
193735
-
resultIndices: external_exports.tuple([external_exports.number(), external_exports.number()]).optional().describe("SARIF result index range [start, end] (0-indexed, inclusive). For SARIF output only."),
193744
+
lineRange: external_exports.tuple([external_exports.number().int().min(1), external_exports.number().int().min(1)]).refine(([start, end]) => start <= end, { message: "lineRange start must be <= end" }).optional().describe("Line range [start, end] (1-indexed, inclusive). For graphtext/CSV output only."),
193745
+
resultIndices: external_exports.tuple([external_exports.number().int().min(0), external_exports.number().int().min(0)]).refine(([start, end]) => start <= end, { message: "resultIndices start must be <= end" }).optional().describe("SARIF result index range [start, end] (0-indexed, inclusive). For SARIF output only."),
193736
193746
fileFilter: external_exports.string().optional().describe("For SARIF: only include results whose file path contains this string."),
193737
-
maxLines: external_exports.number().optional().describe("Maximum number of lines to return for line-based formats (default: 500)."),
193738
-
maxResults: external_exports.number().optional().describe("Maximum number of SARIF results to return (default: 100).")
193747
+
maxLines: external_exports.number().int().positive().optional().describe("Maximum number of lines to return for line-based formats (default: 500)."),
193748
+
maxResults: external_exports.number().int().positive().optional().describe("Maximum number of SARIF results to return (default: 100).")
Copy file name to clipboardExpand all lines: server/src/tools/cache-tools.ts
+12-4Lines changed: 12 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -83,11 +83,19 @@ function registerQueryResultsCacheRetrieveTool(server: McpServer): void {
83
83
'Retrieve cached query results with optional subset selection. Supports line ranges (for graphtext/CSV) and SARIF result indices and file filtering to return only the relevant portion.',
84
84
{
85
85
cacheKey: z.string().describe('The cache key of the result to retrieve.'),
86
-
lineRange: z.tuple([z.number(),z.number()]).optional().describe('Line range [start, end] (1-indexed, inclusive). For graphtext/CSV output only.'),
87
-
resultIndices: z.tuple([z.number(),z.number()]).optional().describe('SARIF result index range [start, end] (0-indexed, inclusive). For SARIF output only.'),
0 commit comments