Skip to content

Commit 54e3d2c

Browse files
committed
Sync server/dist/**
1 parent 82a2657 commit 54e3d2c

File tree

2 files changed

+47
-56
lines changed

2 files changed

+47
-56
lines changed

server/dist/codeql-development-mcp-server.js

Lines changed: 43 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -31254,10 +31254,10 @@ var require_view = __commonJS({
3125431254
var debug = require_src()("express:view");
3125531255
var path4 = __require("node:path");
3125631256
var fs3 = __require("node:fs");
31257-
var dirname9 = path4.dirname;
31257+
var dirname8 = path4.dirname;
3125831258
var basename7 = path4.basename;
3125931259
var extname2 = path4.extname;
31260-
var join20 = path4.join;
31260+
var join19 = path4.join;
3126131261
var resolve13 = path4.resolve;
3126231262
module.exports = View;
3126331263
function View(name, options) {
@@ -31293,7 +31293,7 @@ var require_view = __commonJS({
3129331293
for (var i = 0; i < roots.length && !path5; i++) {
3129431294
var root = roots[i];
3129531295
var loc = resolve13(root, name);
31296-
var dir = dirname9(loc);
31296+
var dir = dirname8(loc);
3129731297
var file = basename7(loc);
3129831298
path5 = this.resolve(dir, file);
3129931299
}
@@ -31319,12 +31319,12 @@ var require_view = __commonJS({
3131931319
};
3132031320
View.prototype.resolve = function resolve14(dir, file) {
3132131321
var ext = this.ext;
31322-
var path5 = join20(dir, file);
31322+
var path5 = join19(dir, file);
3132331323
var stat = tryStat(path5);
3132431324
if (stat && stat.isFile()) {
3132531325
return path5;
3132631326
}
31327-
path5 = join20(dir, basename7(file, ext), "index" + ext);
31327+
path5 = join19(dir, basename7(file, ext), "index" + ext);
3132831328
stat = tryStat(path5);
3132931329
if (stat && stat.isFile()) {
3133031330
return path5;
@@ -34969,7 +34969,7 @@ var require_send = __commonJS({
3496934969
var Stream = __require("stream");
3497034970
var util2 = __require("util");
3497134971
var extname2 = path4.extname;
34972-
var join20 = path4.join;
34972+
var join19 = path4.join;
3497334973
var normalize = path4.normalize;
3497434974
var resolve13 = path4.resolve;
3497534975
var sep2 = path4.sep;
@@ -35141,7 +35141,7 @@ var require_send = __commonJS({
3514135141
return res;
3514235142
}
3514335143
parts = path5.split(sep2);
35144-
path5 = normalize(join20(root, path5));
35144+
path5 = normalize(join19(root, path5));
3514535145
} else {
3514635146
if (UP_PATH_REGEXP.test(path5)) {
3514735147
debug('malicious path "%s"', path5);
@@ -35274,7 +35274,7 @@ var require_send = __commonJS({
3527435274
if (err) return self.onStatError(err);
3527535275
return self.error(404);
3527635276
}
35277-
var p = join20(path5, self._index[i]);
35277+
var p = join19(path5, self._index[i]);
3527835278
debug('stat "%s"', p);
3527935279
fs3.stat(p, function(err2, stat) {
3528035280
if (err2) return next(err2);
@@ -40516,8 +40516,8 @@ var require_adm_zip = __commonJS({
4051640516
return null;
4051740517
}
4051840518
function fixPath(zipPath) {
40519-
const { join: join20, normalize, sep: sep2 } = pth.posix;
40520-
return join20(".", normalize(sep2 + zipPath.split("\\").join(sep2) + sep2));
40519+
const { join: join19, normalize, sep: sep2 } = pth.posix;
40520+
return join19(".", normalize(sep2 + zipPath.split("\\").join(sep2) + sep2));
4052140521
}
4052240522
function filenameFilter(filterfn) {
4052340523
if (filterfn instanceof RegExp) {
@@ -63007,39 +63007,30 @@ function registerCodeQLTools(server) {
6300763007
registerRegisterDatabaseTool(server);
6300863008
}
6300963009

63010+
// src/resources/getting-started.md
63011+
var getting_started_default = "# CodeQL Getting Started Guide\n\n## What is CodeQL?\n\nCodeQL is a semantic code analysis engine that allows you to write queries to find problems in source code.\n\n## Installation\n\n1. Download CodeQL CLI from GitHub releases\n2. Add to PATH\n3. Verify: `codeql version`\n\n## First Steps\n\n### 1. Create a Database\n\n```bash\ncodeql database create my-db --language=java --source-root=./src\n```\n\n### 2. Run Analysis\n\n```bash\ncodeql database analyze my-db --format=sarif --output=results.sarif\n```\n\n## Resources\n\n- [CodeQL Documentation](https://codeql.github.com/)\n- [GitHub Security Lab](https://securitylab.github.com/)\n";
63012+
63013+
// src/resources/performance-patterns.md
63014+
var performance_patterns_default = '# Performance Optimization Patterns\n\n## Efficient Joins\n\n```ql\n// Efficient - Proper join condition\nfrom Method m, MethodAccess ma\nwhere ma.getMethod() = m\nselect m, ma\n```\n\n## Early Filtering\n\n```ql\n// Filter early for better performance\nfrom Expr e\nwhere e.getEnclosingCallable().getDeclaringType().hasName("Controller")\n and e.getType().hasName("String")\n```\n';
63015+
63016+
// src/resources/query-basics.md
63017+
var query_basics_default = '# CodeQL Query Basics\n\n## Query Structure\n\n```ql\n/**\n * @name Query Name\n * @description What this query finds\n */\n\nimport language\n\nfrom Variable declarations\nwhere Conditions\nselect Results\n```\n\n## Core Clauses\n\n- **from**: Declares variables and types\n- **where**: Specifies conditions\n- **select**: Defines output\n\n## Example\n\n```ql\nfrom Method m\nwhere m.getName() = "execute"\nselect m, "Found execute method"\n```\n';
63018+
63019+
// src/resources/security-templates.md
63020+
var security_templates_default = '# Security Query Templates\n\n## SQL Injection Detection (Go)\n\nBased on the real CodeQL query from github/codeql repository:\n\n```ql\n/**\n * @name Database query built from user-controlled sources\n * @description Building a database query from user-controlled sources is vulnerable to insertion of\n * malicious code by the user.\n * @kind path-problem\n * @problem.severity error\n * @security-severity 8.8\n * @precision high\n * @id go/sql-injection\n * @tags security\n * external/cwe/cwe-089\n */\n\nimport go\nimport semmle.go.security.SqlInjection\nimport SqlInjection::Flow::PathGraph\n\nfrom SqlInjection::Flow::PathNode source, SqlInjection::Flow::PathNode sink\nwhere SqlInjection::Flow::flowPath(source, sink)\nselect sink.getNode(), source, sink, "This query depends on a $@.", source.getNode(),\n "user-provided value"\n```\n\n## Cross-Site Scripting (XSS) Template\n\n```ql\n/**\n * @name Cross-site scripting\n * @description Writing user input directly to a web page\n * allows for a cross-site scripting vulnerability.\n * @kind path-problem\n * @problem.severity error\n * @security-severity 6.1\n * @precision high\n * @id js/xss\n * @tags security\n * external/cwe/cwe-079\n */\n\nimport javascript\nimport semmle.javascript.security.dataflow.DomBasedXss\nimport DomBasedXss::Flow::PathGraph\n\nfrom DomBasedXss::Flow::PathNode source, DomBasedXss::Flow::PathNode sink\nwhere DomBasedXss::Flow::flowPath(source, sink)\nselect sink.getNode(), source, sink, "Cross-site scripting vulnerability due to $@.",\n source.getNode(), "user-provided value"\n```\n';
63021+
6301063022
// src/lib/resources.ts
63011-
import { readFileSync as readFileSync11 } from "fs";
63012-
import { join as join16, dirname as dirname8 } from "path";
63013-
import { fileURLToPath as fileURLToPath3 } from "url";
63014-
var __filename2 = fileURLToPath3(import.meta.url);
63015-
var __dirname2 = dirname8(__filename2);
6301663023
function getGettingStartedGuide() {
63017-
try {
63018-
return readFileSync11(join16(__dirname2, "../resources/getting-started.md"), "utf-8");
63019-
} catch {
63020-
return "Getting started guide not available";
63021-
}
63024+
return getting_started_default;
6302263025
}
6302363026
function getQueryBasicsGuide() {
63024-
try {
63025-
return readFileSync11(join16(__dirname2, "../resources/query-basics.md"), "utf-8");
63026-
} catch {
63027-
return "Query basics guide not available";
63028-
}
63027+
return query_basics_default;
6302963028
}
6303063029
function getSecurityTemplates() {
63031-
try {
63032-
return readFileSync11(join16(__dirname2, "../resources/security-templates.md"), "utf-8");
63033-
} catch {
63034-
return "Security templates not available";
63035-
}
63030+
return security_templates_default;
6303663031
}
6303763032
function getPerformancePatterns() {
63038-
try {
63039-
return readFileSync11(join16(__dirname2, "../resources/performance-patterns.md"), "utf-8");
63040-
} catch {
63041-
return "Performance patterns not available";
63042-
}
63033+
return performance_patterns_default;
6304363034
}
6304463035

6304563036
// src/tools/codeql-resources.ts
@@ -63125,7 +63116,7 @@ function registerCodeQLResources(server) {
6312563116
// src/tools/lsp/lsp-diagnostics.ts
6312663117
init_logger();
6312763118
init_temp_dir();
63128-
import { join as join17 } from "path";
63119+
import { join as join16 } from "path";
6312963120
import { pathToFileURL as pathToFileURL3 } from "url";
6313063121

6313163122
// src/tools/lsp/lsp-server-helper.ts
@@ -63223,7 +63214,7 @@ async function lspDiagnostics({
6322363214
serverOptions,
6322463215
workspaceUri
6322563216
});
63226-
const evalUri = pathToFileURL3(join17(getProjectTmpDir("lsp-eval"), `eval_${Date.now()}.ql`)).href;
63217+
const evalUri = pathToFileURL3(join16(getProjectTmpDir("lsp-eval"), `eval_${Date.now()}.ql`)).href;
6322763218
const diagnostics = await languageServer.evaluateQL(qlCode, evalUri);
6322863219
const summary = {
6322963220
errorCount: diagnostics.filter((d) => d.severity === 1).length,
@@ -63497,8 +63488,8 @@ function registerLSPTools(server) {
6349763488
}
6349863489

6349963490
// src/resources/language-resources.ts
63500-
import { readFileSync as readFileSync12, existsSync as existsSync12 } from "fs";
63501-
import { join as join18 } from "path";
63491+
import { readFileSync as readFileSync11, existsSync as existsSync12 } from "fs";
63492+
import { join as join17 } from "path";
6350263493

6350363494
// src/types/language-types.ts
6350463495
var LANGUAGE_RESOURCES = [
@@ -63554,16 +63545,16 @@ var LANGUAGE_RESOURCES = [
6355463545
init_package_paths();
6355563546
init_logger();
6355663547
function getQLBasePath() {
63557-
return workspaceRootDir;
63548+
return packageRootDir;
6355863549
}
6355963550
function loadResourceContent(relativePath) {
6356063551
try {
63561-
const fullPath = join18(getQLBasePath(), relativePath);
63552+
const fullPath = join17(getQLBasePath(), relativePath);
6356263553
if (!existsSync12(fullPath)) {
6356363554
logger.warn(`Resource file not found: ${fullPath}`);
6356463555
return null;
6356563556
}
63566-
return readFileSync12(fullPath, "utf-8");
63557+
return readFileSync11(fullPath, "utf-8");
6356763558
} catch (error2) {
6356863559
logger.error(`Error loading resource file ${relativePath}:`, error2);
6356963560
return null;
@@ -64255,7 +64246,7 @@ var Low = class {
6425564246
};
6425664247

6425764248
// ../node_modules/lowdb/lib/adapters/node/TextFile.js
64258-
import { readFileSync as readFileSync13, renameSync, writeFileSync as writeFileSync6 } from "node:fs";
64249+
import { readFileSync as readFileSync12, renameSync, writeFileSync as writeFileSync6 } from "node:fs";
6425964250
import path3 from "node:path";
6426064251
var TextFileSync = class {
6426164252
#tempFilename;
@@ -64268,7 +64259,7 @@ var TextFileSync = class {
6426864259
read() {
6426964260
let data;
6427064261
try {
64271-
data = readFileSync13(this.#filename, "utf-8");
64262+
data = readFileSync12(this.#filename, "utf-8");
6427264263
} catch (e) {
6427364264
if (e.code === "ENOENT") {
6427464265
return null;
@@ -64319,7 +64310,7 @@ var JSONFileSync = class extends DataFileSync {
6431964310
// src/lib/session-data-manager.ts
6432064311
init_temp_dir();
6432164312
import { mkdirSync as mkdirSync9, writeFileSync as writeFileSync7 } from "fs";
64322-
import { join as join19 } from "path";
64313+
import { join as join18 } from "path";
6432364314
import { randomUUID as randomUUID2 } from "crypto";
6432464315

6432564316
// src/types/monitoring.ts
@@ -64463,7 +64454,7 @@ var SessionDataManager = class {
6446364454
});
6446464455
this.storageDir = this.config.storageLocation;
6446564456
this.ensureStorageDirectory();
64466-
const adapter = new JSONFileSync(join19(this.storageDir, "sessions.json"));
64457+
const adapter = new JSONFileSync(join18(this.storageDir, "sessions.json"));
6446764458
this.db = new Low(adapter, {
6446864459
sessions: []
6446964460
});
@@ -64495,9 +64486,9 @@ var SessionDataManager = class {
6449564486
mkdirSync9(this.storageDir, { recursive: true });
6449664487
const subdirs = ["sessions-archive", "exports"];
6449764488
for (const subdir of subdirs) {
64498-
mkdirSync9(join19(this.storageDir, subdir), { recursive: true });
64489+
mkdirSync9(join18(this.storageDir, subdir), { recursive: true });
6449964490
}
64500-
const configPath = join19(this.storageDir, "config.json");
64491+
const configPath = join18(this.storageDir, "config.json");
6450164492
try {
6450264493
writeFileSync7(configPath, JSON.stringify(this.config, null, 2), { flag: "wx" });
6450364494
} catch (e) {
@@ -64676,9 +64667,9 @@ var SessionDataManager = class {
6467664667
if (!session) return;
6467764668
const date3 = new Date(session.endTime || session.startTime);
6467864669
const monthDir = `${date3.getFullYear()}-${String(date3.getMonth() + 1).padStart(2, "0")}`;
64679-
const archiveDir = join19(this.storageDir, "sessions-archive", monthDir);
64670+
const archiveDir = join18(this.storageDir, "sessions-archive", monthDir);
6468064671
mkdirSync9(archiveDir, { recursive: true });
64681-
const archiveFile = join19(archiveDir, `${sessionId}.json`);
64672+
const archiveFile = join18(archiveDir, `${sessionId}.json`);
6468264673
writeFileSync7(archiveFile, JSON.stringify(session, null, 2));
6468364674
await this.db.read();
6468464675
this.db.data.sessions = this.db.data.sessions.filter((s) => s.sessionId !== sessionId);
@@ -64730,7 +64721,7 @@ var SessionDataManager = class {
6473064721
...this.config,
6473164722
...configUpdate
6473264723
});
64733-
const configPath = join19(this.storageDir, "config.json");
64724+
const configPath = join18(this.storageDir, "config.json");
6473464725
writeFileSync7(configPath, JSON.stringify(this.config, null, 2));
6473564726
logger.info("Updated monitoring configuration");
6473664727
}
@@ -64740,7 +64731,7 @@ function parseBoolEnv(envVar, defaultValue) {
6474064731
return envVar.toLowerCase() === "true" || envVar === "1";
6474164732
}
6474264733
var sessionDataManager = new SessionDataManager({
64743-
storageLocation: process.env.MONITORING_STORAGE_LOCATION || join19(getProjectTmpBase(), ".ql-mcp-tracking"),
64734+
storageLocation: process.env.MONITORING_STORAGE_LOCATION || join18(getProjectTmpBase(), ".ql-mcp-tracking"),
6474464735
enableMonitoringTools: parseBoolEnv(process.env.ENABLE_MONITORING_TOOLS, false)
6474564736
});
6474664737

0 commit comments

Comments
 (0)