grain-tools 0.10.11 → 0.10.13
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/mcp-app.html +5 -16
- package/dist/web-app.html +1 -18
- package/out/server/standalone.js +905 -810
- package/package.json +1 -1
- package/server.json +2 -2
package/out/server/standalone.js
CHANGED
|
@@ -464,10 +464,10 @@ function mergeDefs(...defs) {
|
|
|
464
464
|
function cloneDef(schema) {
|
|
465
465
|
return mergeDefs(schema._zod.def);
|
|
466
466
|
}
|
|
467
|
-
function getElementAtPath(obj,
|
|
468
|
-
if (!
|
|
467
|
+
function getElementAtPath(obj, path46) {
|
|
468
|
+
if (!path46)
|
|
469
469
|
return obj;
|
|
470
|
-
return
|
|
470
|
+
return path46.reduce((acc, key) => acc?.[key], obj);
|
|
471
471
|
}
|
|
472
472
|
function promiseAllObject(promisesObj) {
|
|
473
473
|
const keys2 = Object.keys(promisesObj);
|
|
@@ -795,11 +795,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
795
795
|
}
|
|
796
796
|
return false;
|
|
797
797
|
}
|
|
798
|
-
function prefixIssues(
|
|
798
|
+
function prefixIssues(path46, issues) {
|
|
799
799
|
return issues.map((iss) => {
|
|
800
800
|
var _a4;
|
|
801
801
|
(_a4 = iss).path ?? (_a4.path = []);
|
|
802
|
-
iss.path.unshift(
|
|
802
|
+
iss.path.unshift(path46);
|
|
803
803
|
return iss;
|
|
804
804
|
});
|
|
805
805
|
}
|
|
@@ -1016,16 +1016,16 @@ function flattenError(error52, mapper = (issue2) => issue2.message) {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
function formatError(error52, mapper = (issue2) => issue2.message) {
|
|
1018
1018
|
const fieldErrors = { _errors: [] };
|
|
1019
|
-
const processError = (error53,
|
|
1019
|
+
const processError = (error53, path46 = []) => {
|
|
1020
1020
|
for (const issue2 of error53.issues) {
|
|
1021
1021
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1022
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1022
|
+
issue2.errors.map((issues) => processError({ issues }, [...path46, ...issue2.path]));
|
|
1023
1023
|
} else if (issue2.code === "invalid_key") {
|
|
1024
|
-
processError({ issues: issue2.issues }, [...
|
|
1024
|
+
processError({ issues: issue2.issues }, [...path46, ...issue2.path]);
|
|
1025
1025
|
} else if (issue2.code === "invalid_element") {
|
|
1026
|
-
processError({ issues: issue2.issues }, [...
|
|
1026
|
+
processError({ issues: issue2.issues }, [...path46, ...issue2.path]);
|
|
1027
1027
|
} else {
|
|
1028
|
-
const fullpath = [...
|
|
1028
|
+
const fullpath = [...path46, ...issue2.path];
|
|
1029
1029
|
if (fullpath.length === 0) {
|
|
1030
1030
|
fieldErrors._errors.push(mapper(issue2));
|
|
1031
1031
|
} else {
|
|
@@ -1052,17 +1052,17 @@ function formatError(error52, mapper = (issue2) => issue2.message) {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
function treeifyError(error52, mapper = (issue2) => issue2.message) {
|
|
1054
1054
|
const result = { errors: [] };
|
|
1055
|
-
const processError = (error53,
|
|
1055
|
+
const processError = (error53, path46 = []) => {
|
|
1056
1056
|
var _a4, _b2;
|
|
1057
1057
|
for (const issue2 of error53.issues) {
|
|
1058
1058
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1059
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1059
|
+
issue2.errors.map((issues) => processError({ issues }, [...path46, ...issue2.path]));
|
|
1060
1060
|
} else if (issue2.code === "invalid_key") {
|
|
1061
|
-
processError({ issues: issue2.issues }, [...
|
|
1061
|
+
processError({ issues: issue2.issues }, [...path46, ...issue2.path]);
|
|
1062
1062
|
} else if (issue2.code === "invalid_element") {
|
|
1063
|
-
processError({ issues: issue2.issues }, [...
|
|
1063
|
+
processError({ issues: issue2.issues }, [...path46, ...issue2.path]);
|
|
1064
1064
|
} else {
|
|
1065
|
-
const fullpath = [...
|
|
1065
|
+
const fullpath = [...path46, ...issue2.path];
|
|
1066
1066
|
if (fullpath.length === 0) {
|
|
1067
1067
|
result.errors.push(mapper(issue2));
|
|
1068
1068
|
continue;
|
|
@@ -1094,8 +1094,8 @@ function treeifyError(error52, mapper = (issue2) => issue2.message) {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
function toDotPath(_path) {
|
|
1096
1096
|
const segs = [];
|
|
1097
|
-
const
|
|
1098
|
-
for (const seg of
|
|
1097
|
+
const path46 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1098
|
+
for (const seg of path46) {
|
|
1099
1099
|
if (typeof seg === "number")
|
|
1100
1100
|
segs.push(`[${seg}]`);
|
|
1101
1101
|
else if (typeof seg === "symbol")
|
|
@@ -14411,13 +14411,13 @@ function resolveRef(ref, ctx) {
|
|
|
14411
14411
|
if (!ref.startsWith("#")) {
|
|
14412
14412
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14413
14413
|
}
|
|
14414
|
-
const
|
|
14415
|
-
if (
|
|
14414
|
+
const path46 = ref.slice(1).split("/").filter(Boolean);
|
|
14415
|
+
if (path46.length === 0) {
|
|
14416
14416
|
return ctx.rootSchema;
|
|
14417
14417
|
}
|
|
14418
14418
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
14419
|
-
if (
|
|
14420
|
-
const key =
|
|
14419
|
+
if (path46[0] === defsKey) {
|
|
14420
|
+
const key = path46[1];
|
|
14421
14421
|
if (!key || !ctx.defs[key]) {
|
|
14422
14422
|
throw new Error(`Reference not found: ${ref}`);
|
|
14423
14423
|
}
|
|
@@ -16821,12 +16821,12 @@ var init_stdio2 = __esm({
|
|
|
16821
16821
|
this.onclose?.();
|
|
16822
16822
|
}
|
|
16823
16823
|
send(message) {
|
|
16824
|
-
return new Promise((
|
|
16824
|
+
return new Promise((resolve11) => {
|
|
16825
16825
|
const json2 = serializeMessage(message);
|
|
16826
16826
|
if (this._stdout.write(json2)) {
|
|
16827
|
-
|
|
16827
|
+
resolve11();
|
|
16828
16828
|
} else {
|
|
16829
|
-
this._stdout.once("drain",
|
|
16829
|
+
this._stdout.once("drain", resolve11);
|
|
16830
16830
|
}
|
|
16831
16831
|
});
|
|
16832
16832
|
}
|
|
@@ -18589,25 +18589,25 @@ var init_DaemonConfig = __esm({
|
|
|
18589
18589
|
});
|
|
18590
18590
|
|
|
18591
18591
|
// src/server/config/ConfigValidator.ts
|
|
18592
|
-
function assertInteger(value,
|
|
18592
|
+
function assertInteger(value, path46, options = {}) {
|
|
18593
18593
|
if (!Number.isInteger(value)) {
|
|
18594
|
-
throw new ConfigValidationError(`${
|
|
18594
|
+
throw new ConfigValidationError(`${path46} must be an integer`);
|
|
18595
18595
|
}
|
|
18596
18596
|
if (options.min !== void 0 && value < options.min) {
|
|
18597
|
-
throw new ConfigValidationError(`${
|
|
18597
|
+
throw new ConfigValidationError(`${path46} must be >= ${options.min}`);
|
|
18598
18598
|
}
|
|
18599
18599
|
if (options.max !== void 0 && value > options.max) {
|
|
18600
|
-
throw new ConfigValidationError(`${
|
|
18600
|
+
throw new ConfigValidationError(`${path46} must be <= ${options.max}`);
|
|
18601
18601
|
}
|
|
18602
18602
|
}
|
|
18603
|
-
function assertBoolean(value,
|
|
18603
|
+
function assertBoolean(value, path46) {
|
|
18604
18604
|
if (typeof value !== "boolean") {
|
|
18605
|
-
throw new ConfigValidationError(`${
|
|
18605
|
+
throw new ConfigValidationError(`${path46} must be a boolean`);
|
|
18606
18606
|
}
|
|
18607
18607
|
}
|
|
18608
|
-
function assertNonEmptyString(value,
|
|
18608
|
+
function assertNonEmptyString(value, path46) {
|
|
18609
18609
|
if (typeof value !== "string" || value.trim().length === 0) {
|
|
18610
|
-
throw new ConfigValidationError(`${
|
|
18610
|
+
throw new ConfigValidationError(`${path46} must be a non-empty string`);
|
|
18611
18611
|
}
|
|
18612
18612
|
}
|
|
18613
18613
|
function validateDaemonConfig(config2) {
|
|
@@ -19277,13 +19277,27 @@ var init_StdioBridge = __esm({
|
|
|
19277
19277
|
}
|
|
19278
19278
|
}
|
|
19279
19279
|
async forwardAgentMessage(message, fatal) {
|
|
19280
|
+
const isInitialize = "method" in message && message.method === "initialize";
|
|
19281
|
+
const isHandshake = isInitialize || "method" in message && message.method === "notifications/initialized";
|
|
19282
|
+
if (!isInitialize && this.sessionOpening) {
|
|
19283
|
+
await this.sessionOpening;
|
|
19284
|
+
}
|
|
19280
19285
|
if (this.reconnecting) {
|
|
19281
|
-
|
|
19286
|
+
if (!isHandshake) {
|
|
19287
|
+
this.queuedAgentMessages.push(message);
|
|
19288
|
+
}
|
|
19282
19289
|
return;
|
|
19283
19290
|
}
|
|
19291
|
+
const sending = this.daemonTransport.send(message);
|
|
19292
|
+
if (isInitialize) {
|
|
19293
|
+
this.sessionOpening = sending.catch(() => void 0);
|
|
19294
|
+
}
|
|
19284
19295
|
try {
|
|
19285
|
-
await
|
|
19296
|
+
await sending;
|
|
19286
19297
|
} catch {
|
|
19298
|
+
if (!isHandshake) {
|
|
19299
|
+
this.queuedAgentMessages.push(message);
|
|
19300
|
+
}
|
|
19287
19301
|
void this.reconnect(fatal);
|
|
19288
19302
|
}
|
|
19289
19303
|
}
|
|
@@ -19347,7 +19361,7 @@ var init_StdioBridge = __esm({
|
|
|
19347
19361
|
}
|
|
19348
19362
|
}
|
|
19349
19363
|
async delay(milliseconds) {
|
|
19350
|
-
await new Promise((
|
|
19364
|
+
await new Promise((resolve11) => setTimeout(resolve11, milliseconds));
|
|
19351
19365
|
}
|
|
19352
19366
|
};
|
|
19353
19367
|
}
|
|
@@ -19496,7 +19510,7 @@ async function readGrainServiceStatus(configDir = resolveGrainHome()) {
|
|
|
19496
19510
|
const host = record2.host === "0.0.0.0" ? "127.0.0.1" : record2.host;
|
|
19497
19511
|
const url3 = `http://${host}:${record2.port}/status`;
|
|
19498
19512
|
try {
|
|
19499
|
-
const data = await new Promise((
|
|
19513
|
+
const data = await new Promise((resolve11, reject) => {
|
|
19500
19514
|
const req = http2.get(url3, (res) => {
|
|
19501
19515
|
if (res.statusCode !== 200) {
|
|
19502
19516
|
reject(new Error(`HTTP ${res.statusCode ?? "unknown"}`));
|
|
@@ -19506,7 +19520,7 @@ async function readGrainServiceStatus(configDir = resolveGrainHome()) {
|
|
|
19506
19520
|
res.on("data", (chunk) => {
|
|
19507
19521
|
body += chunk;
|
|
19508
19522
|
});
|
|
19509
|
-
res.on("end", () =>
|
|
19523
|
+
res.on("end", () => resolve11(body));
|
|
19510
19524
|
});
|
|
19511
19525
|
req.on("error", reject);
|
|
19512
19526
|
req.setTimeout(500, () => {
|
|
@@ -20473,7 +20487,11 @@ var init_TelemetrySchema = __esm({
|
|
|
20473
20487
|
duration_bucket: "durationBucket",
|
|
20474
20488
|
error_kind: "errorKind"
|
|
20475
20489
|
},
|
|
20476
|
-
ledger_health: {
|
|
20490
|
+
ledger_health: {
|
|
20491
|
+
entries_bucket: "rowCountBucket",
|
|
20492
|
+
write_failures_bucket: "rowCountBucket",
|
|
20493
|
+
outcome: "safeString"
|
|
20494
|
+
},
|
|
20477
20495
|
ledger_verify_completed: {
|
|
20478
20496
|
outcome: "safeString",
|
|
20479
20497
|
entries_checked_bucket: "rowCountBucket",
|
|
@@ -20644,7 +20662,7 @@ function buildBatchUrl(host) {
|
|
|
20644
20662
|
}
|
|
20645
20663
|
}
|
|
20646
20664
|
function settleWithin(promise2, ms) {
|
|
20647
|
-
return new Promise((
|
|
20665
|
+
return new Promise((resolve11) => {
|
|
20648
20666
|
let timer;
|
|
20649
20667
|
let settled = false;
|
|
20650
20668
|
const cleanupAndResolve = () => {
|
|
@@ -20656,7 +20674,7 @@ function settleWithin(promise2, ms) {
|
|
|
20656
20674
|
clearTimeout(timer);
|
|
20657
20675
|
timer = void 0;
|
|
20658
20676
|
}
|
|
20659
|
-
|
|
20677
|
+
resolve11();
|
|
20660
20678
|
};
|
|
20661
20679
|
if (ms <= 0) {
|
|
20662
20680
|
cleanupAndResolve();
|
|
@@ -20677,7 +20695,7 @@ function isPermanentError(err) {
|
|
|
20677
20695
|
return false;
|
|
20678
20696
|
}
|
|
20679
20697
|
function postJson(url3, payload, timeoutMs) {
|
|
20680
|
-
return new Promise((
|
|
20698
|
+
return new Promise((resolve11, reject) => {
|
|
20681
20699
|
const parsed = new import_url.URL(url3);
|
|
20682
20700
|
const body = JSON.stringify(payload);
|
|
20683
20701
|
const client = parsed.protocol === "http:" ? http3 : https;
|
|
@@ -20699,7 +20717,7 @@ function postJson(url3, payload, timeoutMs) {
|
|
|
20699
20717
|
response.on("end", () => {
|
|
20700
20718
|
const statusCode = response.statusCode ?? 0;
|
|
20701
20719
|
if (statusCode >= 200 && statusCode < 300) {
|
|
20702
|
-
|
|
20720
|
+
resolve11();
|
|
20703
20721
|
} else {
|
|
20704
20722
|
reject(
|
|
20705
20723
|
new TelemetrySendError(
|
|
@@ -21192,7 +21210,7 @@ function clientFor(url3) {
|
|
|
21192
21210
|
function downloadToFile(url3, destPath, options) {
|
|
21193
21211
|
const responseTimeoutMs = options?.responseTimeoutMs ?? 1e4;
|
|
21194
21212
|
const idleTimeoutMs = options?.idleTimeoutMs ?? 3e4;
|
|
21195
|
-
return new Promise((
|
|
21213
|
+
return new Promise((resolve11, reject) => {
|
|
21196
21214
|
fs10.mkdirSync(path12.dirname(destPath), { recursive: true });
|
|
21197
21215
|
let settled = false;
|
|
21198
21216
|
let file4;
|
|
@@ -21246,7 +21264,7 @@ function downloadToFile(url3, destPath, options) {
|
|
|
21246
21264
|
settled = true;
|
|
21247
21265
|
clearTimers();
|
|
21248
21266
|
if (file4) {
|
|
21249
|
-
file4.close(() =>
|
|
21267
|
+
file4.close(() => resolve11());
|
|
21250
21268
|
}
|
|
21251
21269
|
});
|
|
21252
21270
|
file4.on("error", failOnce);
|
|
@@ -21259,20 +21277,20 @@ function downloadToFile(url3, destPath, options) {
|
|
|
21259
21277
|
});
|
|
21260
21278
|
}
|
|
21261
21279
|
function sha512File(filePath) {
|
|
21262
|
-
return new Promise((
|
|
21280
|
+
return new Promise((resolve11, reject) => {
|
|
21263
21281
|
const hash2 = crypto6.createHash("sha512");
|
|
21264
21282
|
const stream4 = fs10.createReadStream(filePath);
|
|
21265
21283
|
stream4.on("data", (chunk) => hash2.update(chunk));
|
|
21266
|
-
stream4.on("end", () =>
|
|
21284
|
+
stream4.on("end", () => resolve11(hash2.digest("base64")));
|
|
21267
21285
|
stream4.on("error", reject);
|
|
21268
21286
|
});
|
|
21269
21287
|
}
|
|
21270
21288
|
function sha256File(filePath) {
|
|
21271
|
-
return new Promise((
|
|
21289
|
+
return new Promise((resolve11, reject) => {
|
|
21272
21290
|
const hash2 = crypto6.createHash("sha256");
|
|
21273
21291
|
const stream4 = fs10.createReadStream(filePath);
|
|
21274
21292
|
stream4.on("data", (chunk) => hash2.update(chunk));
|
|
21275
|
-
stream4.on("end", () =>
|
|
21293
|
+
stream4.on("end", () => resolve11(hash2.digest("hex")));
|
|
21276
21294
|
stream4.on("error", reject);
|
|
21277
21295
|
});
|
|
21278
21296
|
}
|
|
@@ -21689,7 +21707,7 @@ var init_applicationPayload = __esm({
|
|
|
21689
21707
|
function createCommandRunner() {
|
|
21690
21708
|
return {
|
|
21691
21709
|
run(command, args) {
|
|
21692
|
-
return new Promise((
|
|
21710
|
+
return new Promise((resolve11, reject) => {
|
|
21693
21711
|
const child = (0, import_child_process3.spawn)(command, [...args], { stdio: ["ignore", "pipe", "pipe"] });
|
|
21694
21712
|
let output = "";
|
|
21695
21713
|
child.stdout.on("data", (chunk) => {
|
|
@@ -21699,7 +21717,7 @@ function createCommandRunner() {
|
|
|
21699
21717
|
output += String(chunk);
|
|
21700
21718
|
});
|
|
21701
21719
|
child.on("error", reject);
|
|
21702
|
-
child.on("exit", (exitCode) =>
|
|
21720
|
+
child.on("exit", (exitCode) => resolve11({ exitCode: exitCode ?? 1, output }));
|
|
21703
21721
|
});
|
|
21704
21722
|
}
|
|
21705
21723
|
};
|
|
@@ -21816,7 +21834,7 @@ var require_package = __commonJS({
|
|
|
21816
21834
|
name: "grain",
|
|
21817
21835
|
displayName: "Grain SQL",
|
|
21818
21836
|
description: "Run SQL in VS Code and expose safe, visible MCP database tools for Claude, Cursor, and other AI agents.",
|
|
21819
|
-
version: "0.10.
|
|
21837
|
+
version: "0.10.13",
|
|
21820
21838
|
license: "UNLICENSED",
|
|
21821
21839
|
mcpName: "io.github.pattrnlabs/grain",
|
|
21822
21840
|
publisher: "pattrnlabs",
|
|
@@ -22462,7 +22480,7 @@ var require_package = __commonJS({
|
|
|
22462
22480
|
"test:telemetry-seam": 'node scripts/emit-seam-receipt.js "npm run test:telemetry-seam" -- jest src/test/integration/exceptionTelemetrySeam.test.ts',
|
|
22463
22481
|
"test:chart-flag-seam": 'node scripts/emit-seam-receipt.js "npm run test:chart-flag-seam" -- jest src/test/unit/extensionChartEditorRegistration.test.ts src/test/unit/telemetry/ProductTelemetryService.test.ts src/test/unit/DaemonClient.test.ts',
|
|
22464
22482
|
"check:contributed-commands": "node scripts/check-contributed-commands.js",
|
|
22465
|
-
"quality-check": "npm run type-check
|
|
22483
|
+
"quality-check": "node scripts/run-checks.js npm run type-check npm run lint npm run format:check npm run check:seams npm run check:ui-contract npm run check:telemetry-coverage npm run check:telemetry-failure-identity npm run check:daemon-spawn-sites npm run check:test-skips npm run check:never-written-primitives npm run check:boundaries npm run check:size-ratchet npm run check:workflows npm run check:config-defaults npm run check:release-contract npm run check:doc-inventory npm run check:briefs npm run check:decision-notes npm run rfc:check npm run check:brand-tokens npm run check:identity npm run check:issue-refs npm run check:token-theme-parity npm run check:release-notes npm run check:contributed-commands npm run check:gate-wiring npm run check:dependency-licenses npm run check:lockfile-pinnable npm run check:gates npm run check:no-system-npm npm run check:no-execpath-units",
|
|
22466
22484
|
"check:telemetry-coverage": "node scripts/check-telemetry-coverage.js",
|
|
22467
22485
|
"check:telemetry-failure-identity": "node scripts/check-telemetry-failure-identity.js",
|
|
22468
22486
|
"check:daemon-spawn-sites": "node scripts/check-daemon-spawn-sites.js",
|
|
@@ -22982,7 +23000,7 @@ __export(startCommand_exports, {
|
|
|
22982
23000
|
startCommand: () => startCommand
|
|
22983
23001
|
});
|
|
22984
23002
|
async function checkAuthenticatedReadiness(host, port, token) {
|
|
22985
|
-
return new Promise((
|
|
23003
|
+
return new Promise((resolve11) => {
|
|
22986
23004
|
const req = http5.get(
|
|
22987
23005
|
`http://${host}:${port}${OWNERSHIP_PROBE_PATH}`,
|
|
22988
23006
|
{
|
|
@@ -22992,17 +23010,17 @@ async function checkAuthenticatedReadiness(host, port, token) {
|
|
|
22992
23010
|
},
|
|
22993
23011
|
(res) => {
|
|
22994
23012
|
if (res.statusCode === 200) {
|
|
22995
|
-
|
|
23013
|
+
resolve11(true);
|
|
22996
23014
|
} else {
|
|
22997
|
-
|
|
23015
|
+
resolve11(false);
|
|
22998
23016
|
}
|
|
22999
23017
|
res.resume();
|
|
23000
23018
|
}
|
|
23001
23019
|
);
|
|
23002
|
-
req.on("error", () =>
|
|
23020
|
+
req.on("error", () => resolve11(false));
|
|
23003
23021
|
req.setTimeout(500, () => {
|
|
23004
23022
|
req.destroy();
|
|
23005
|
-
|
|
23023
|
+
resolve11(false);
|
|
23006
23024
|
});
|
|
23007
23025
|
});
|
|
23008
23026
|
}
|
|
@@ -23080,7 +23098,7 @@ ${clock.now()}`);
|
|
|
23080
23098
|
}
|
|
23081
23099
|
}
|
|
23082
23100
|
}
|
|
23083
|
-
await new Promise((
|
|
23101
|
+
await new Promise((resolve11) => setTimeout(resolve11, 250));
|
|
23084
23102
|
}
|
|
23085
23103
|
console.error(`Grain did not start within 20 seconds. Check ${logPath} for errors.`);
|
|
23086
23104
|
return 1;
|
|
@@ -23220,7 +23238,7 @@ async function stopCommand(configDir = resolveGrainHome(), clock = Date, process
|
|
|
23220
23238
|
console.log("Grain stopped.");
|
|
23221
23239
|
return 0;
|
|
23222
23240
|
}
|
|
23223
|
-
await new Promise((
|
|
23241
|
+
await new Promise((resolve11) => setTimeout(resolve11, 250));
|
|
23224
23242
|
}
|
|
23225
23243
|
console.error("Grain did not stop within 10 seconds.");
|
|
23226
23244
|
return 1;
|
|
@@ -28706,11 +28724,11 @@ var require_raw_body = __commonJS({
|
|
|
28706
28724
|
if (done) {
|
|
28707
28725
|
return readStream2(stream4, encoding, length, limit, wrap(done));
|
|
28708
28726
|
}
|
|
28709
|
-
return new Promise(function executor(
|
|
28727
|
+
return new Promise(function executor(resolve11, reject) {
|
|
28710
28728
|
readStream2(stream4, encoding, length, limit, function onRead(err, buf) {
|
|
28711
28729
|
if (err)
|
|
28712
28730
|
return reject(err);
|
|
28713
|
-
|
|
28731
|
+
resolve11(buf);
|
|
28714
28732
|
});
|
|
28715
28733
|
});
|
|
28716
28734
|
}
|
|
@@ -42204,11 +42222,11 @@ var require_mime_types = __commonJS({
|
|
|
42204
42222
|
}
|
|
42205
42223
|
return exts[0];
|
|
42206
42224
|
}
|
|
42207
|
-
function lookup(
|
|
42208
|
-
if (!
|
|
42225
|
+
function lookup(path46) {
|
|
42226
|
+
if (!path46 || typeof path46 !== "string") {
|
|
42209
42227
|
return false;
|
|
42210
42228
|
}
|
|
42211
|
-
var extension2 = extname("x." +
|
|
42229
|
+
var extension2 = extname("x." + path46).toLowerCase().slice(1);
|
|
42212
42230
|
if (!extension2) {
|
|
42213
42231
|
return false;
|
|
42214
42232
|
}
|
|
@@ -45700,13 +45718,13 @@ var require_view = __commonJS({
|
|
|
45700
45718
|
"node_modules/express/lib/view.js"(exports, module2) {
|
|
45701
45719
|
"use strict";
|
|
45702
45720
|
var debug = require_src()("express:view");
|
|
45703
|
-
var
|
|
45721
|
+
var path46 = require("node:path");
|
|
45704
45722
|
var fs44 = require("node:fs");
|
|
45705
|
-
var dirname16 =
|
|
45706
|
-
var basename5 =
|
|
45707
|
-
var extname =
|
|
45708
|
-
var join37 =
|
|
45709
|
-
var
|
|
45723
|
+
var dirname16 = path46.dirname;
|
|
45724
|
+
var basename5 = path46.basename;
|
|
45725
|
+
var extname = path46.extname;
|
|
45726
|
+
var join37 = path46.join;
|
|
45727
|
+
var resolve11 = path46.resolve;
|
|
45710
45728
|
module2.exports = View2;
|
|
45711
45729
|
function View2(name, options) {
|
|
45712
45730
|
var opts = options || {};
|
|
@@ -45735,17 +45753,17 @@ var require_view = __commonJS({
|
|
|
45735
45753
|
this.path = this.lookup(fileName);
|
|
45736
45754
|
}
|
|
45737
45755
|
View2.prototype.lookup = function lookup(name) {
|
|
45738
|
-
var
|
|
45756
|
+
var path47;
|
|
45739
45757
|
var roots2 = [].concat(this.root);
|
|
45740
45758
|
debug('lookup "%s"', name);
|
|
45741
|
-
for (var i = 0; i < roots2.length && !
|
|
45759
|
+
for (var i = 0; i < roots2.length && !path47; i++) {
|
|
45742
45760
|
var root = roots2[i];
|
|
45743
|
-
var loc =
|
|
45761
|
+
var loc = resolve11(root, name);
|
|
45744
45762
|
var dir3 = dirname16(loc);
|
|
45745
45763
|
var file4 = basename5(loc);
|
|
45746
|
-
|
|
45764
|
+
path47 = this.resolve(dir3, file4);
|
|
45747
45765
|
}
|
|
45748
|
-
return
|
|
45766
|
+
return path47;
|
|
45749
45767
|
};
|
|
45750
45768
|
View2.prototype.render = function render2(options, callback) {
|
|
45751
45769
|
var sync = true;
|
|
@@ -45765,23 +45783,23 @@ var require_view = __commonJS({
|
|
|
45765
45783
|
});
|
|
45766
45784
|
sync = false;
|
|
45767
45785
|
};
|
|
45768
|
-
View2.prototype.resolve = function
|
|
45786
|
+
View2.prototype.resolve = function resolve12(dir3, file4) {
|
|
45769
45787
|
var ext = this.ext;
|
|
45770
|
-
var
|
|
45771
|
-
var stat = tryStat(
|
|
45788
|
+
var path47 = join37(dir3, file4);
|
|
45789
|
+
var stat = tryStat(path47);
|
|
45772
45790
|
if (stat && stat.isFile()) {
|
|
45773
|
-
return
|
|
45791
|
+
return path47;
|
|
45774
45792
|
}
|
|
45775
|
-
|
|
45776
|
-
stat = tryStat(
|
|
45793
|
+
path47 = join37(dir3, basename5(file4, ext), "index" + ext);
|
|
45794
|
+
stat = tryStat(path47);
|
|
45777
45795
|
if (stat && stat.isFile()) {
|
|
45778
|
-
return
|
|
45796
|
+
return path47;
|
|
45779
45797
|
}
|
|
45780
45798
|
};
|
|
45781
|
-
function tryStat(
|
|
45782
|
-
debug('stat "%s"',
|
|
45799
|
+
function tryStat(path47) {
|
|
45800
|
+
debug('stat "%s"', path47);
|
|
45783
45801
|
try {
|
|
45784
|
-
return fs44.statSync(
|
|
45802
|
+
return fs44.statSync(path47);
|
|
45785
45803
|
} catch (e2) {
|
|
45786
45804
|
return void 0;
|
|
45787
45805
|
}
|
|
@@ -55288,11 +55306,11 @@ var require_mime_types2 = __commonJS({
|
|
|
55288
55306
|
}
|
|
55289
55307
|
return exts[0];
|
|
55290
55308
|
}
|
|
55291
|
-
function lookup(
|
|
55292
|
-
if (!
|
|
55309
|
+
function lookup(path46) {
|
|
55310
|
+
if (!path46 || typeof path46 !== "string") {
|
|
55293
55311
|
return false;
|
|
55294
55312
|
}
|
|
55295
|
-
var extension2 = extname("x." +
|
|
55313
|
+
var extension2 = extname("x." + path46).toLowerCase().slice(1);
|
|
55296
55314
|
if (!extension2) {
|
|
55297
55315
|
return false;
|
|
55298
55316
|
}
|
|
@@ -56430,15 +56448,15 @@ var require_dist = __commonJS({
|
|
|
56430
56448
|
let index = 0;
|
|
56431
56449
|
function consumeUntil(end2) {
|
|
56432
56450
|
const output = [];
|
|
56433
|
-
let
|
|
56451
|
+
let path46 = "";
|
|
56434
56452
|
function writePath() {
|
|
56435
|
-
if (!
|
|
56453
|
+
if (!path46)
|
|
56436
56454
|
return;
|
|
56437
56455
|
output.push({
|
|
56438
56456
|
type: "text",
|
|
56439
|
-
value: encodePath(
|
|
56457
|
+
value: encodePath(path46)
|
|
56440
56458
|
});
|
|
56441
|
-
|
|
56459
|
+
path46 = "";
|
|
56442
56460
|
}
|
|
56443
56461
|
while (index < chars.length) {
|
|
56444
56462
|
const value = chars[index++];
|
|
@@ -56450,7 +56468,7 @@ var require_dist = __commonJS({
|
|
|
56450
56468
|
if (index === chars.length) {
|
|
56451
56469
|
throw new PathError(`Unexpected end after \\ at index ${index}`, str);
|
|
56452
56470
|
}
|
|
56453
|
-
|
|
56471
|
+
path46 += chars[index++];
|
|
56454
56472
|
continue;
|
|
56455
56473
|
}
|
|
56456
56474
|
if (value === ":" || value === "*") {
|
|
@@ -56494,7 +56512,7 @@ var require_dist = __commonJS({
|
|
|
56494
56512
|
if (value === "}" || value === "(" || value === ")" || value === "[" || value === "]" || value === "+" || value === "?" || value === "!") {
|
|
56495
56513
|
throw new PathError(`Unexpected ${value} at index ${index - 1}`, str);
|
|
56496
56514
|
}
|
|
56497
|
-
|
|
56515
|
+
path46 += value;
|
|
56498
56516
|
}
|
|
56499
56517
|
if (end2) {
|
|
56500
56518
|
throw new PathError(`Unexpected end at index ${index}, expected ${end2}`, str);
|
|
@@ -56504,17 +56522,17 @@ var require_dist = __commonJS({
|
|
|
56504
56522
|
}
|
|
56505
56523
|
return new TokenData(consumeUntil(""), str);
|
|
56506
56524
|
}
|
|
56507
|
-
function compile(
|
|
56525
|
+
function compile(path46, options = {}) {
|
|
56508
56526
|
const { encode: encode5 = encodeURIComponent, delimiter: delimiter2 = DEFAULT_DELIMITER } = options;
|
|
56509
|
-
const data = typeof
|
|
56527
|
+
const data = typeof path46 === "object" ? path46 : parse4(path46, options);
|
|
56510
56528
|
const fn = tokensToFunction(data.tokens, delimiter2, encode5);
|
|
56511
|
-
return function
|
|
56529
|
+
return function path47(params = {}) {
|
|
56512
56530
|
const missing = [];
|
|
56513
|
-
const
|
|
56531
|
+
const path48 = fn(params, missing);
|
|
56514
56532
|
if (missing.length) {
|
|
56515
56533
|
throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
|
|
56516
56534
|
}
|
|
56517
|
-
return
|
|
56535
|
+
return path48;
|
|
56518
56536
|
};
|
|
56519
56537
|
}
|
|
56520
56538
|
function tokensToFunction(tokens, delimiter2, encode5) {
|
|
@@ -56576,9 +56594,9 @@ var require_dist = __commonJS({
|
|
|
56576
56594
|
return encodeValue(value);
|
|
56577
56595
|
};
|
|
56578
56596
|
}
|
|
56579
|
-
function match(
|
|
56597
|
+
function match(path46, options = {}) {
|
|
56580
56598
|
const { decode: decode4 = decodeURIComponent, delimiter: delimiter2 = DEFAULT_DELIMITER } = options;
|
|
56581
|
-
const { regexp: regexp2, keys: keys2 } = pathToRegexp(
|
|
56599
|
+
const { regexp: regexp2, keys: keys2 } = pathToRegexp(path46, options);
|
|
56582
56600
|
const decoders = keys2.map((key) => {
|
|
56583
56601
|
if (decode4 === false)
|
|
56584
56602
|
return NOOP_VALUE;
|
|
@@ -56590,7 +56608,7 @@ var require_dist = __commonJS({
|
|
|
56590
56608
|
const m2 = regexp2.exec(input);
|
|
56591
56609
|
if (!m2)
|
|
56592
56610
|
return false;
|
|
56593
|
-
const
|
|
56611
|
+
const path47 = m2[0];
|
|
56594
56612
|
const params = /* @__PURE__ */ Object.create(null);
|
|
56595
56613
|
for (let i = 1; i < m2.length; i++) {
|
|
56596
56614
|
if (m2[i] === void 0)
|
|
@@ -56599,21 +56617,21 @@ var require_dist = __commonJS({
|
|
|
56599
56617
|
const decoder = decoders[i - 1];
|
|
56600
56618
|
params[key.name] = decoder(m2[i]);
|
|
56601
56619
|
}
|
|
56602
|
-
return { path:
|
|
56620
|
+
return { path: path47, params };
|
|
56603
56621
|
};
|
|
56604
56622
|
}
|
|
56605
|
-
function pathToRegexp(
|
|
56623
|
+
function pathToRegexp(path46, options = {}) {
|
|
56606
56624
|
const { delimiter: delimiter2 = DEFAULT_DELIMITER, end: end2 = true, sensitive = false, trailing = true } = options;
|
|
56607
56625
|
const keys2 = [];
|
|
56608
56626
|
let source = "";
|
|
56609
56627
|
let combinations = 0;
|
|
56610
|
-
function process4(
|
|
56611
|
-
if (Array.isArray(
|
|
56612
|
-
for (const p of
|
|
56628
|
+
function process4(path47) {
|
|
56629
|
+
if (Array.isArray(path47)) {
|
|
56630
|
+
for (const p of path47)
|
|
56613
56631
|
process4(p);
|
|
56614
56632
|
return;
|
|
56615
56633
|
}
|
|
56616
|
-
const data = typeof
|
|
56634
|
+
const data = typeof path47 === "object" ? path47 : parse4(path47, options);
|
|
56617
56635
|
flatten(data.tokens, 0, [], (tokens) => {
|
|
56618
56636
|
if (combinations >= 256) {
|
|
56619
56637
|
throw new PathError("Too many path combinations", data.originalPath);
|
|
@@ -56624,7 +56642,7 @@ var require_dist = __commonJS({
|
|
|
56624
56642
|
combinations++;
|
|
56625
56643
|
});
|
|
56626
56644
|
}
|
|
56627
|
-
process4(
|
|
56645
|
+
process4(path46);
|
|
56628
56646
|
let pattern = `^(?:${source})`;
|
|
56629
56647
|
if (trailing)
|
|
56630
56648
|
pattern += "(?:" + escape2(delimiter2) + "$)?";
|
|
@@ -56764,18 +56782,18 @@ var require_layer = __commonJS({
|
|
|
56764
56782
|
var TRAILING_SLASH_REGEXP = /\/+$/;
|
|
56765
56783
|
var MATCHING_GROUP_REGEXP = /\((?:\?<(.*?)>)?(?!\?)/g;
|
|
56766
56784
|
module2.exports = Layer2;
|
|
56767
|
-
function Layer2(
|
|
56785
|
+
function Layer2(path46, options, fn) {
|
|
56768
56786
|
if (!(this instanceof Layer2)) {
|
|
56769
|
-
return new Layer2(
|
|
56787
|
+
return new Layer2(path46, options, fn);
|
|
56770
56788
|
}
|
|
56771
|
-
debug("new %o",
|
|
56789
|
+
debug("new %o", path46);
|
|
56772
56790
|
const opts = options || {};
|
|
56773
56791
|
this.handle = fn;
|
|
56774
56792
|
this.keys = [];
|
|
56775
56793
|
this.name = fn.name || "<anonymous>";
|
|
56776
56794
|
this.params = void 0;
|
|
56777
56795
|
this.path = void 0;
|
|
56778
|
-
this.slash =
|
|
56796
|
+
this.slash = path46 === "/" && opts.end === false;
|
|
56779
56797
|
function matcher(_path) {
|
|
56780
56798
|
if (_path instanceof RegExp) {
|
|
56781
56799
|
const keys2 = [];
|
|
@@ -56814,7 +56832,7 @@ var require_layer = __commonJS({
|
|
|
56814
56832
|
decode: decodeParam
|
|
56815
56833
|
});
|
|
56816
56834
|
}
|
|
56817
|
-
this.matchers = Array.isArray(
|
|
56835
|
+
this.matchers = Array.isArray(path46) ? path46.map(matcher) : [matcher(path46)];
|
|
56818
56836
|
}
|
|
56819
56837
|
Layer2.prototype.handleError = function handleError(error52, req, res, next) {
|
|
56820
56838
|
const fn = this.handle;
|
|
@@ -56854,9 +56872,9 @@ var require_layer = __commonJS({
|
|
|
56854
56872
|
next(err);
|
|
56855
56873
|
}
|
|
56856
56874
|
};
|
|
56857
|
-
Layer2.prototype.match = function match(
|
|
56875
|
+
Layer2.prototype.match = function match(path46) {
|
|
56858
56876
|
let match2;
|
|
56859
|
-
if (
|
|
56877
|
+
if (path46 != null) {
|
|
56860
56878
|
if (this.slash) {
|
|
56861
56879
|
this.params = {};
|
|
56862
56880
|
this.path = "";
|
|
@@ -56864,7 +56882,7 @@ var require_layer = __commonJS({
|
|
|
56864
56882
|
}
|
|
56865
56883
|
let i = 0;
|
|
56866
56884
|
while (!match2 && i < this.matchers.length) {
|
|
56867
|
-
match2 = this.matchers[i](
|
|
56885
|
+
match2 = this.matchers[i](path46);
|
|
56868
56886
|
i++;
|
|
56869
56887
|
}
|
|
56870
56888
|
}
|
|
@@ -56892,13 +56910,13 @@ var require_layer = __commonJS({
|
|
|
56892
56910
|
throw err;
|
|
56893
56911
|
}
|
|
56894
56912
|
}
|
|
56895
|
-
function loosen(
|
|
56896
|
-
if (
|
|
56897
|
-
return
|
|
56913
|
+
function loosen(path46) {
|
|
56914
|
+
if (path46 instanceof RegExp || path46 === "/") {
|
|
56915
|
+
return path46;
|
|
56898
56916
|
}
|
|
56899
|
-
return Array.isArray(
|
|
56917
|
+
return Array.isArray(path46) ? path46.map(function(p) {
|
|
56900
56918
|
return loosen(p);
|
|
56901
|
-
}) : String(
|
|
56919
|
+
}) : String(path46).replace(TRAILING_SLASH_REGEXP, "");
|
|
56902
56920
|
}
|
|
56903
56921
|
}
|
|
56904
56922
|
});
|
|
@@ -56914,9 +56932,9 @@ var require_route = __commonJS({
|
|
|
56914
56932
|
var flatten = Array.prototype.flat;
|
|
56915
56933
|
var methods = METHODS.map((method) => method.toLowerCase());
|
|
56916
56934
|
module2.exports = Route;
|
|
56917
|
-
function Route(
|
|
56918
|
-
debug("new %o",
|
|
56919
|
-
this.path =
|
|
56935
|
+
function Route(path46) {
|
|
56936
|
+
debug("new %o", path46);
|
|
56937
|
+
this.path = path46;
|
|
56920
56938
|
this.stack = [];
|
|
56921
56939
|
this.methods = /* @__PURE__ */ Object.create(null);
|
|
56922
56940
|
}
|
|
@@ -57124,8 +57142,8 @@ var require_router = __commonJS({
|
|
|
57124
57142
|
if (++sync > 100) {
|
|
57125
57143
|
return setImmediate(next, err);
|
|
57126
57144
|
}
|
|
57127
|
-
const
|
|
57128
|
-
if (
|
|
57145
|
+
const path46 = getPathname(req);
|
|
57146
|
+
if (path46 == null) {
|
|
57129
57147
|
return done(layerError);
|
|
57130
57148
|
}
|
|
57131
57149
|
let layer;
|
|
@@ -57133,7 +57151,7 @@ var require_router = __commonJS({
|
|
|
57133
57151
|
let route;
|
|
57134
57152
|
while (match !== true && idx < stack.length) {
|
|
57135
57153
|
layer = stack[idx++];
|
|
57136
|
-
match = matchLayer(layer,
|
|
57154
|
+
match = matchLayer(layer, path46);
|
|
57137
57155
|
route = layer.route;
|
|
57138
57156
|
if (typeof match !== "boolean") {
|
|
57139
57157
|
layerError = layerError || match;
|
|
@@ -57171,18 +57189,18 @@ var require_router = __commonJS({
|
|
|
57171
57189
|
} else if (route) {
|
|
57172
57190
|
layer.handleRequest(req, res, next);
|
|
57173
57191
|
} else {
|
|
57174
|
-
trimPrefix(layer, layerError, layerPath,
|
|
57192
|
+
trimPrefix(layer, layerError, layerPath, path46);
|
|
57175
57193
|
}
|
|
57176
57194
|
sync = 0;
|
|
57177
57195
|
});
|
|
57178
57196
|
}
|
|
57179
|
-
function trimPrefix(layer, layerError, layerPath,
|
|
57197
|
+
function trimPrefix(layer, layerError, layerPath, path46) {
|
|
57180
57198
|
if (layerPath.length !== 0) {
|
|
57181
|
-
if (layerPath !==
|
|
57199
|
+
if (layerPath !== path46.substring(0, layerPath.length)) {
|
|
57182
57200
|
next(layerError);
|
|
57183
57201
|
return;
|
|
57184
57202
|
}
|
|
57185
|
-
const c =
|
|
57203
|
+
const c = path46[layerPath.length];
|
|
57186
57204
|
if (c && c !== "/") {
|
|
57187
57205
|
next(layerError);
|
|
57188
57206
|
return;
|
|
@@ -57206,7 +57224,7 @@ var require_router = __commonJS({
|
|
|
57206
57224
|
};
|
|
57207
57225
|
Router.prototype.use = function use2(handler) {
|
|
57208
57226
|
let offset = 0;
|
|
57209
|
-
let
|
|
57227
|
+
let path46 = "/";
|
|
57210
57228
|
if (typeof handler !== "function") {
|
|
57211
57229
|
let arg = handler;
|
|
57212
57230
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -57214,7 +57232,7 @@ var require_router = __commonJS({
|
|
|
57214
57232
|
}
|
|
57215
57233
|
if (typeof arg !== "function") {
|
|
57216
57234
|
offset = 1;
|
|
57217
|
-
|
|
57235
|
+
path46 = handler;
|
|
57218
57236
|
}
|
|
57219
57237
|
}
|
|
57220
57238
|
const callbacks = flatten.call(slice2.call(arguments, offset), Infinity);
|
|
@@ -57226,8 +57244,8 @@ var require_router = __commonJS({
|
|
|
57226
57244
|
if (typeof fn !== "function") {
|
|
57227
57245
|
throw new TypeError("argument handler must be a function");
|
|
57228
57246
|
}
|
|
57229
|
-
debug("use %o %s",
|
|
57230
|
-
const layer = new Layer2(
|
|
57247
|
+
debug("use %o %s", path46, fn.name || "<anonymous>");
|
|
57248
|
+
const layer = new Layer2(path46, {
|
|
57231
57249
|
sensitive: this.caseSensitive,
|
|
57232
57250
|
strict: false,
|
|
57233
57251
|
end: false
|
|
@@ -57237,9 +57255,9 @@ var require_router = __commonJS({
|
|
|
57237
57255
|
}
|
|
57238
57256
|
return this;
|
|
57239
57257
|
};
|
|
57240
|
-
Router.prototype.route = function route(
|
|
57241
|
-
const route2 = new Route(
|
|
57242
|
-
const layer = new Layer2(
|
|
57258
|
+
Router.prototype.route = function route(path46) {
|
|
57259
|
+
const route2 = new Route(path46);
|
|
57260
|
+
const layer = new Layer2(path46, {
|
|
57243
57261
|
sensitive: this.caseSensitive,
|
|
57244
57262
|
strict: this.strict,
|
|
57245
57263
|
end: true
|
|
@@ -57252,8 +57270,8 @@ var require_router = __commonJS({
|
|
|
57252
57270
|
return route2;
|
|
57253
57271
|
};
|
|
57254
57272
|
methods.concat("all").forEach(function(method) {
|
|
57255
|
-
Router.prototype[method] = function(
|
|
57256
|
-
const route = this.route(
|
|
57273
|
+
Router.prototype[method] = function(path46) {
|
|
57274
|
+
const route = this.route(path46);
|
|
57257
57275
|
route[method].apply(route, slice2.call(arguments, 1));
|
|
57258
57276
|
return this;
|
|
57259
57277
|
};
|
|
@@ -57282,9 +57300,9 @@ var require_router = __commonJS({
|
|
|
57282
57300
|
const fqdnIndex = url3.substring(0, pathLength).indexOf("://");
|
|
57283
57301
|
return fqdnIndex !== -1 ? url3.substring(0, url3.indexOf("/", 3 + fqdnIndex)) : void 0;
|
|
57284
57302
|
}
|
|
57285
|
-
function matchLayer(layer,
|
|
57303
|
+
function matchLayer(layer, path46) {
|
|
57286
57304
|
try {
|
|
57287
|
-
return layer.match(
|
|
57305
|
+
return layer.match(path46);
|
|
57288
57306
|
} catch (err) {
|
|
57289
57307
|
return err;
|
|
57290
57308
|
}
|
|
@@ -57434,7 +57452,7 @@ var require_application = __commonJS({
|
|
|
57434
57452
|
var compileETag = require_utils3().compileETag;
|
|
57435
57453
|
var compileQueryParser = require_utils3().compileQueryParser;
|
|
57436
57454
|
var compileTrust = require_utils3().compileTrust;
|
|
57437
|
-
var
|
|
57455
|
+
var resolve11 = require("node:path").resolve;
|
|
57438
57456
|
var once = require_once();
|
|
57439
57457
|
var Router = require_router();
|
|
57440
57458
|
var slice2 = Array.prototype.slice;
|
|
@@ -57488,7 +57506,7 @@ var require_application = __commonJS({
|
|
|
57488
57506
|
this.mountpath = "/";
|
|
57489
57507
|
this.locals.settings = this.settings;
|
|
57490
57508
|
this.set("view", View2);
|
|
57491
|
-
this.set("views",
|
|
57509
|
+
this.set("views", resolve11("views"));
|
|
57492
57510
|
this.set("jsonp callback name", "callback");
|
|
57493
57511
|
if (env2 === "production") {
|
|
57494
57512
|
this.enable("view cache");
|
|
@@ -57513,7 +57531,7 @@ var require_application = __commonJS({
|
|
|
57513
57531
|
};
|
|
57514
57532
|
app.use = function use2(fn) {
|
|
57515
57533
|
var offset = 0;
|
|
57516
|
-
var
|
|
57534
|
+
var path46 = "/";
|
|
57517
57535
|
if (typeof fn !== "function") {
|
|
57518
57536
|
var arg = fn;
|
|
57519
57537
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -57521,7 +57539,7 @@ var require_application = __commonJS({
|
|
|
57521
57539
|
}
|
|
57522
57540
|
if (typeof arg !== "function") {
|
|
57523
57541
|
offset = 1;
|
|
57524
|
-
|
|
57542
|
+
path46 = fn;
|
|
57525
57543
|
}
|
|
57526
57544
|
}
|
|
57527
57545
|
var fns = flatten.call(slice2.call(arguments, offset), Infinity);
|
|
@@ -57531,12 +57549,12 @@ var require_application = __commonJS({
|
|
|
57531
57549
|
var router = this.router;
|
|
57532
57550
|
fns.forEach(function(fn2) {
|
|
57533
57551
|
if (!fn2 || !fn2.handle || !fn2.set) {
|
|
57534
|
-
return router.use(
|
|
57552
|
+
return router.use(path46, fn2);
|
|
57535
57553
|
}
|
|
57536
|
-
debug(".use app under %s",
|
|
57537
|
-
fn2.mountpath =
|
|
57554
|
+
debug(".use app under %s", path46);
|
|
57555
|
+
fn2.mountpath = path46;
|
|
57538
57556
|
fn2.parent = this;
|
|
57539
|
-
router.use(
|
|
57557
|
+
router.use(path46, function mounted_app(req, res, next) {
|
|
57540
57558
|
var orig = req.app;
|
|
57541
57559
|
fn2.handle(req, res, function(err) {
|
|
57542
57560
|
Object.setPrototypeOf(req, orig.request);
|
|
@@ -57548,8 +57566,8 @@ var require_application = __commonJS({
|
|
|
57548
57566
|
}, this);
|
|
57549
57567
|
return this;
|
|
57550
57568
|
};
|
|
57551
|
-
app.route = function route(
|
|
57552
|
-
return this.router.route(
|
|
57569
|
+
app.route = function route(path46) {
|
|
57570
|
+
return this.router.route(path46);
|
|
57553
57571
|
};
|
|
57554
57572
|
app.engine = function engine(ext, fn) {
|
|
57555
57573
|
if (typeof fn !== "function") {
|
|
@@ -57592,7 +57610,7 @@ var require_application = __commonJS({
|
|
|
57592
57610
|
}
|
|
57593
57611
|
return this;
|
|
57594
57612
|
};
|
|
57595
|
-
app.path = function
|
|
57613
|
+
app.path = function path46() {
|
|
57596
57614
|
return this.parent ? this.parent.path() + this.mountpath : "";
|
|
57597
57615
|
};
|
|
57598
57616
|
app.enabled = function enabled(setting) {
|
|
@@ -57608,17 +57626,17 @@ var require_application = __commonJS({
|
|
|
57608
57626
|
return this.set(setting, false);
|
|
57609
57627
|
};
|
|
57610
57628
|
methods.forEach(function(method) {
|
|
57611
|
-
app[method] = function(
|
|
57629
|
+
app[method] = function(path46) {
|
|
57612
57630
|
if (method === "get" && arguments.length === 1) {
|
|
57613
|
-
return this.set(
|
|
57631
|
+
return this.set(path46);
|
|
57614
57632
|
}
|
|
57615
|
-
var route = this.route(
|
|
57633
|
+
var route = this.route(path46);
|
|
57616
57634
|
route[method].apply(route, slice2.call(arguments, 1));
|
|
57617
57635
|
return this;
|
|
57618
57636
|
};
|
|
57619
57637
|
});
|
|
57620
|
-
app.all = function all3(
|
|
57621
|
-
var route = this.route(
|
|
57638
|
+
app.all = function all3(path46) {
|
|
57639
|
+
var route = this.route(path46);
|
|
57622
57640
|
var args = slice2.call(arguments, 1);
|
|
57623
57641
|
for (var i = 0; i < methods.length; i++) {
|
|
57624
57642
|
route[methods[i]].apply(route, args);
|
|
@@ -67661,11 +67679,11 @@ var require_mime_types3 = __commonJS({
|
|
|
67661
67679
|
}
|
|
67662
67680
|
return exts[0];
|
|
67663
67681
|
}
|
|
67664
|
-
function lookup(
|
|
67665
|
-
if (!
|
|
67682
|
+
function lookup(path46) {
|
|
67683
|
+
if (!path46 || typeof path46 !== "string") {
|
|
67666
67684
|
return false;
|
|
67667
67685
|
}
|
|
67668
|
-
var extension2 = extname("x." +
|
|
67686
|
+
var extension2 = extname("x." + path46).toLowerCase().slice(1);
|
|
67669
67687
|
if (!extension2) {
|
|
67670
67688
|
return false;
|
|
67671
67689
|
}
|
|
@@ -68044,7 +68062,7 @@ var require_request = __commonJS({
|
|
|
68044
68062
|
var subdomains2 = !isIP(hostname3) ? hostname3.split(".").reverse() : [hostname3];
|
|
68045
68063
|
return subdomains2.slice(offset);
|
|
68046
68064
|
});
|
|
68047
|
-
defineGetter(req, "path", function
|
|
68065
|
+
defineGetter(req, "path", function path46() {
|
|
68048
68066
|
return parse4(this).pathname;
|
|
68049
68067
|
});
|
|
68050
68068
|
defineGetter(req, "host", function host() {
|
|
@@ -77909,11 +77927,11 @@ var require_mime_types4 = __commonJS({
|
|
|
77909
77927
|
}
|
|
77910
77928
|
return exts[0];
|
|
77911
77929
|
}
|
|
77912
|
-
function lookup(
|
|
77913
|
-
if (!
|
|
77930
|
+
function lookup(path46) {
|
|
77931
|
+
if (!path46 || typeof path46 !== "string") {
|
|
77914
77932
|
return false;
|
|
77915
77933
|
}
|
|
77916
|
-
var extension2 = extname("x." +
|
|
77934
|
+
var extension2 = extname("x." + path46).toLowerCase().slice(1);
|
|
77917
77935
|
if (!extension2) {
|
|
77918
77936
|
return false;
|
|
77919
77937
|
}
|
|
@@ -77973,27 +77991,27 @@ var require_send = __commonJS({
|
|
|
77973
77991
|
var ms = require_ms();
|
|
77974
77992
|
var onFinished = require_on_finished();
|
|
77975
77993
|
var parseRange = require_range_parser();
|
|
77976
|
-
var
|
|
77994
|
+
var path46 = require("path");
|
|
77977
77995
|
var statuses = require_statuses();
|
|
77978
77996
|
var Stream = require("stream");
|
|
77979
77997
|
var util3 = require("util");
|
|
77980
|
-
var extname =
|
|
77981
|
-
var join37 =
|
|
77982
|
-
var normalize5 =
|
|
77983
|
-
var
|
|
77984
|
-
var sep7 =
|
|
77998
|
+
var extname = path46.extname;
|
|
77999
|
+
var join37 = path46.join;
|
|
78000
|
+
var normalize5 = path46.normalize;
|
|
78001
|
+
var resolve11 = path46.resolve;
|
|
78002
|
+
var sep7 = path46.sep;
|
|
77985
78003
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
77986
78004
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
77987
78005
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
77988
78006
|
module2.exports = send;
|
|
77989
|
-
function send(req,
|
|
77990
|
-
return new SendStream(req,
|
|
78007
|
+
function send(req, path47, options) {
|
|
78008
|
+
return new SendStream(req, path47, options);
|
|
77991
78009
|
}
|
|
77992
|
-
function SendStream(req,
|
|
78010
|
+
function SendStream(req, path47, options) {
|
|
77993
78011
|
Stream.call(this);
|
|
77994
78012
|
var opts = options || {};
|
|
77995
78013
|
this.options = opts;
|
|
77996
|
-
this.path =
|
|
78014
|
+
this.path = path47;
|
|
77997
78015
|
this.req = req;
|
|
77998
78016
|
this._acceptRanges = opts.acceptRanges !== void 0 ? Boolean(opts.acceptRanges) : true;
|
|
77999
78017
|
this._cacheControl = opts.cacheControl !== void 0 ? Boolean(opts.cacheControl) : true;
|
|
@@ -78009,7 +78027,7 @@ var require_send = __commonJS({
|
|
|
78009
78027
|
this._maxage = opts.maxAge || opts.maxage;
|
|
78010
78028
|
this._maxage = typeof this._maxage === "string" ? ms(this._maxage) : Number(this._maxage);
|
|
78011
78029
|
this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
|
|
78012
|
-
this._root = opts.root ?
|
|
78030
|
+
this._root = opts.root ? resolve11(opts.root) : null;
|
|
78013
78031
|
}
|
|
78014
78032
|
util3.inherits(SendStream, Stream);
|
|
78015
78033
|
SendStream.prototype.error = function error52(status, err) {
|
|
@@ -78107,10 +78125,10 @@ var require_send = __commonJS({
|
|
|
78107
78125
|
var lastModified = this.res.getHeader("Last-Modified");
|
|
78108
78126
|
return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
|
|
78109
78127
|
};
|
|
78110
|
-
SendStream.prototype.redirect = function redirect(
|
|
78128
|
+
SendStream.prototype.redirect = function redirect(path47) {
|
|
78111
78129
|
var res = this.res;
|
|
78112
78130
|
if (hasListeners(this, "directory")) {
|
|
78113
|
-
this.emit("directory", res,
|
|
78131
|
+
this.emit("directory", res, path47);
|
|
78114
78132
|
return;
|
|
78115
78133
|
}
|
|
78116
78134
|
if (this.hasTrailingSlash()) {
|
|
@@ -78130,38 +78148,38 @@ var require_send = __commonJS({
|
|
|
78130
78148
|
SendStream.prototype.pipe = function pipe2(res) {
|
|
78131
78149
|
var root = this._root;
|
|
78132
78150
|
this.res = res;
|
|
78133
|
-
var
|
|
78134
|
-
if (
|
|
78151
|
+
var path47 = decode4(this.path);
|
|
78152
|
+
if (path47 === -1) {
|
|
78135
78153
|
this.error(400);
|
|
78136
78154
|
return res;
|
|
78137
78155
|
}
|
|
78138
|
-
if (~
|
|
78156
|
+
if (~path47.indexOf("\0")) {
|
|
78139
78157
|
this.error(400);
|
|
78140
78158
|
return res;
|
|
78141
78159
|
}
|
|
78142
78160
|
var parts;
|
|
78143
78161
|
if (root !== null) {
|
|
78144
|
-
if (
|
|
78145
|
-
|
|
78162
|
+
if (path47) {
|
|
78163
|
+
path47 = normalize5("." + sep7 + path47);
|
|
78146
78164
|
}
|
|
78147
|
-
if (UP_PATH_REGEXP.test(
|
|
78148
|
-
debug('malicious path "%s"',
|
|
78165
|
+
if (UP_PATH_REGEXP.test(path47)) {
|
|
78166
|
+
debug('malicious path "%s"', path47);
|
|
78149
78167
|
this.error(403);
|
|
78150
78168
|
return res;
|
|
78151
78169
|
}
|
|
78152
|
-
parts =
|
|
78153
|
-
|
|
78170
|
+
parts = path47.split(sep7);
|
|
78171
|
+
path47 = normalize5(join37(root, path47));
|
|
78154
78172
|
} else {
|
|
78155
|
-
if (UP_PATH_REGEXP.test(
|
|
78156
|
-
debug('malicious path "%s"',
|
|
78173
|
+
if (UP_PATH_REGEXP.test(path47)) {
|
|
78174
|
+
debug('malicious path "%s"', path47);
|
|
78157
78175
|
this.error(403);
|
|
78158
78176
|
return res;
|
|
78159
78177
|
}
|
|
78160
|
-
parts = normalize5(
|
|
78161
|
-
|
|
78178
|
+
parts = normalize5(path47).split(sep7);
|
|
78179
|
+
path47 = resolve11(path47);
|
|
78162
78180
|
}
|
|
78163
78181
|
if (containsDotFile(parts)) {
|
|
78164
|
-
debug('%s dotfile "%s"', this._dotfiles,
|
|
78182
|
+
debug('%s dotfile "%s"', this._dotfiles, path47);
|
|
78165
78183
|
switch (this._dotfiles) {
|
|
78166
78184
|
case "allow":
|
|
78167
78185
|
break;
|
|
@@ -78175,13 +78193,13 @@ var require_send = __commonJS({
|
|
|
78175
78193
|
}
|
|
78176
78194
|
}
|
|
78177
78195
|
if (this._index.length && this.hasTrailingSlash()) {
|
|
78178
|
-
this.sendIndex(
|
|
78196
|
+
this.sendIndex(path47);
|
|
78179
78197
|
return res;
|
|
78180
78198
|
}
|
|
78181
|
-
this.sendFile(
|
|
78199
|
+
this.sendFile(path47);
|
|
78182
78200
|
return res;
|
|
78183
78201
|
};
|
|
78184
|
-
SendStream.prototype.send = function send2(
|
|
78202
|
+
SendStream.prototype.send = function send2(path47, stat) {
|
|
78185
78203
|
var len2 = stat.size;
|
|
78186
78204
|
var options = this.options;
|
|
78187
78205
|
var opts = {};
|
|
@@ -78193,9 +78211,9 @@ var require_send = __commonJS({
|
|
|
78193
78211
|
this.headersAlreadySent();
|
|
78194
78212
|
return;
|
|
78195
78213
|
}
|
|
78196
|
-
debug('pipe "%s"',
|
|
78197
|
-
this.setHeader(
|
|
78198
|
-
this.type(
|
|
78214
|
+
debug('pipe "%s"', path47);
|
|
78215
|
+
this.setHeader(path47, stat);
|
|
78216
|
+
this.type(path47);
|
|
78199
78217
|
if (this.isConditionalGET()) {
|
|
78200
78218
|
if (this.isPreconditionFailure()) {
|
|
78201
78219
|
this.error(412);
|
|
@@ -78245,31 +78263,31 @@ var require_send = __commonJS({
|
|
|
78245
78263
|
res.end();
|
|
78246
78264
|
return;
|
|
78247
78265
|
}
|
|
78248
|
-
this.stream(
|
|
78266
|
+
this.stream(path47, opts);
|
|
78249
78267
|
};
|
|
78250
|
-
SendStream.prototype.sendFile = function sendFile(
|
|
78268
|
+
SendStream.prototype.sendFile = function sendFile(path47) {
|
|
78251
78269
|
var i = 0;
|
|
78252
78270
|
var self2 = this;
|
|
78253
|
-
debug('stat "%s"',
|
|
78254
|
-
fs44.stat(
|
|
78255
|
-
var pathEndsWithSep =
|
|
78256
|
-
if (err && err.code === "ENOENT" && !extname(
|
|
78271
|
+
debug('stat "%s"', path47);
|
|
78272
|
+
fs44.stat(path47, function onstat(err, stat) {
|
|
78273
|
+
var pathEndsWithSep = path47[path47.length - 1] === sep7;
|
|
78274
|
+
if (err && err.code === "ENOENT" && !extname(path47) && !pathEndsWithSep) {
|
|
78257
78275
|
return next(err);
|
|
78258
78276
|
}
|
|
78259
78277
|
if (err)
|
|
78260
78278
|
return self2.onStatError(err);
|
|
78261
78279
|
if (stat.isDirectory())
|
|
78262
|
-
return self2.redirect(
|
|
78280
|
+
return self2.redirect(path47);
|
|
78263
78281
|
if (pathEndsWithSep)
|
|
78264
78282
|
return self2.error(404);
|
|
78265
|
-
self2.emit("file",
|
|
78266
|
-
self2.send(
|
|
78283
|
+
self2.emit("file", path47, stat);
|
|
78284
|
+
self2.send(path47, stat);
|
|
78267
78285
|
});
|
|
78268
78286
|
function next(err) {
|
|
78269
78287
|
if (self2._extensions.length <= i) {
|
|
78270
78288
|
return err ? self2.onStatError(err) : self2.error(404);
|
|
78271
78289
|
}
|
|
78272
|
-
var p =
|
|
78290
|
+
var p = path47 + "." + self2._extensions[i++];
|
|
78273
78291
|
debug('stat "%s"', p);
|
|
78274
78292
|
fs44.stat(p, function(err2, stat) {
|
|
78275
78293
|
if (err2)
|
|
@@ -78281,7 +78299,7 @@ var require_send = __commonJS({
|
|
|
78281
78299
|
});
|
|
78282
78300
|
}
|
|
78283
78301
|
};
|
|
78284
|
-
SendStream.prototype.sendIndex = function sendIndex(
|
|
78302
|
+
SendStream.prototype.sendIndex = function sendIndex(path47) {
|
|
78285
78303
|
var i = -1;
|
|
78286
78304
|
var self2 = this;
|
|
78287
78305
|
function next(err) {
|
|
@@ -78290,7 +78308,7 @@ var require_send = __commonJS({
|
|
|
78290
78308
|
return self2.onStatError(err);
|
|
78291
78309
|
return self2.error(404);
|
|
78292
78310
|
}
|
|
78293
|
-
var p = join37(
|
|
78311
|
+
var p = join37(path47, self2._index[i]);
|
|
78294
78312
|
debug('stat "%s"', p);
|
|
78295
78313
|
fs44.stat(p, function(err2, stat) {
|
|
78296
78314
|
if (err2)
|
|
@@ -78303,10 +78321,10 @@ var require_send = __commonJS({
|
|
|
78303
78321
|
}
|
|
78304
78322
|
next();
|
|
78305
78323
|
};
|
|
78306
|
-
SendStream.prototype.stream = function stream4(
|
|
78324
|
+
SendStream.prototype.stream = function stream4(path47, options) {
|
|
78307
78325
|
var self2 = this;
|
|
78308
78326
|
var res = this.res;
|
|
78309
|
-
var stream5 = fs44.createReadStream(
|
|
78327
|
+
var stream5 = fs44.createReadStream(path47, options);
|
|
78310
78328
|
this.emit("stream", stream5);
|
|
78311
78329
|
stream5.pipe(res);
|
|
78312
78330
|
function cleanup() {
|
|
@@ -78321,18 +78339,18 @@ var require_send = __commonJS({
|
|
|
78321
78339
|
self2.emit("end");
|
|
78322
78340
|
});
|
|
78323
78341
|
};
|
|
78324
|
-
SendStream.prototype.type = function type(
|
|
78342
|
+
SendStream.prototype.type = function type(path47) {
|
|
78325
78343
|
var res = this.res;
|
|
78326
78344
|
if (res.getHeader("Content-Type"))
|
|
78327
78345
|
return;
|
|
78328
|
-
var ext = extname(
|
|
78346
|
+
var ext = extname(path47);
|
|
78329
78347
|
var type2 = mime.contentType(ext) || "application/octet-stream";
|
|
78330
78348
|
debug("content-type %s", type2);
|
|
78331
78349
|
res.setHeader("Content-Type", type2);
|
|
78332
78350
|
};
|
|
78333
|
-
SendStream.prototype.setHeader = function setHeader(
|
|
78351
|
+
SendStream.prototype.setHeader = function setHeader(path47, stat) {
|
|
78334
78352
|
var res = this.res;
|
|
78335
|
-
this.emit("headers", res,
|
|
78353
|
+
this.emit("headers", res, path47, stat);
|
|
78336
78354
|
if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
|
|
78337
78355
|
debug("accept ranges");
|
|
78338
78356
|
res.setHeader("Accept-Ranges", "bytes");
|
|
@@ -78390,9 +78408,9 @@ var require_send = __commonJS({
|
|
|
78390
78408
|
}
|
|
78391
78409
|
return err instanceof Error ? createError(status, err, { expose: false }) : createError(status, err);
|
|
78392
78410
|
}
|
|
78393
|
-
function decode4(
|
|
78411
|
+
function decode4(path47) {
|
|
78394
78412
|
try {
|
|
78395
|
-
return decodeURIComponent(
|
|
78413
|
+
return decodeURIComponent(path47);
|
|
78396
78414
|
} catch (err) {
|
|
78397
78415
|
return -1;
|
|
78398
78416
|
}
|
|
@@ -78536,7 +78554,7 @@ var require_response = __commonJS({
|
|
|
78536
78554
|
var http9 = require("node:http");
|
|
78537
78555
|
var onFinished = require_on_finished();
|
|
78538
78556
|
var mime = require_mime_types2();
|
|
78539
|
-
var
|
|
78557
|
+
var path46 = require("node:path");
|
|
78540
78558
|
var pathIsAbsolute = require("node:path").isAbsolute;
|
|
78541
78559
|
var statuses = require_statuses();
|
|
78542
78560
|
var sign = require_cookie_signature().sign;
|
|
@@ -78545,8 +78563,8 @@ var require_response = __commonJS({
|
|
|
78545
78563
|
var setCharset = require_utils3().setCharset;
|
|
78546
78564
|
var cookie = require_cookie();
|
|
78547
78565
|
var send = require_send();
|
|
78548
|
-
var extname =
|
|
78549
|
-
var
|
|
78566
|
+
var extname = path46.extname;
|
|
78567
|
+
var resolve11 = path46.resolve;
|
|
78550
78568
|
var vary = require_vary();
|
|
78551
78569
|
var { Buffer: Buffer2 } = require("node:buffer");
|
|
78552
78570
|
var res = Object.create(http9.ServerResponse.prototype);
|
|
@@ -78693,26 +78711,26 @@ var require_response = __commonJS({
|
|
|
78693
78711
|
this.type("txt");
|
|
78694
78712
|
return this.send(body);
|
|
78695
78713
|
};
|
|
78696
|
-
res.sendFile = function sendFile(
|
|
78714
|
+
res.sendFile = function sendFile(path47, options, callback) {
|
|
78697
78715
|
var done = callback;
|
|
78698
78716
|
var req = this.req;
|
|
78699
78717
|
var res2 = this;
|
|
78700
78718
|
var next = req.next;
|
|
78701
78719
|
var opts = options || {};
|
|
78702
|
-
if (!
|
|
78720
|
+
if (!path47) {
|
|
78703
78721
|
throw new TypeError("path argument is required to res.sendFile");
|
|
78704
78722
|
}
|
|
78705
|
-
if (typeof
|
|
78723
|
+
if (typeof path47 !== "string") {
|
|
78706
78724
|
throw new TypeError("path must be a string to res.sendFile");
|
|
78707
78725
|
}
|
|
78708
78726
|
if (typeof options === "function") {
|
|
78709
78727
|
done = options;
|
|
78710
78728
|
opts = {};
|
|
78711
78729
|
}
|
|
78712
|
-
if (!opts.root && !pathIsAbsolute(
|
|
78730
|
+
if (!opts.root && !pathIsAbsolute(path47)) {
|
|
78713
78731
|
throw new TypeError("path must be absolute or specify root to res.sendFile");
|
|
78714
78732
|
}
|
|
78715
|
-
var pathname = encodeURI(
|
|
78733
|
+
var pathname = encodeURI(path47);
|
|
78716
78734
|
opts.etag = this.app.enabled("etag");
|
|
78717
78735
|
var file4 = send(req, pathname, opts);
|
|
78718
78736
|
sendfile(res2, file4, opts, function(err) {
|
|
@@ -78725,7 +78743,7 @@ var require_response = __commonJS({
|
|
|
78725
78743
|
}
|
|
78726
78744
|
});
|
|
78727
78745
|
};
|
|
78728
|
-
res.download = function download(
|
|
78746
|
+
res.download = function download(path47, filename, options, callback) {
|
|
78729
78747
|
var done = callback;
|
|
78730
78748
|
var name = filename;
|
|
78731
78749
|
var opts = options || null;
|
|
@@ -78742,7 +78760,7 @@ var require_response = __commonJS({
|
|
|
78742
78760
|
opts = filename;
|
|
78743
78761
|
}
|
|
78744
78762
|
var headers = {
|
|
78745
|
-
"Content-Disposition": contentDisposition(name ||
|
|
78763
|
+
"Content-Disposition": contentDisposition(name || path47)
|
|
78746
78764
|
};
|
|
78747
78765
|
if (opts && opts.headers) {
|
|
78748
78766
|
var keys2 = Object.keys(opts.headers);
|
|
@@ -78755,7 +78773,7 @@ var require_response = __commonJS({
|
|
|
78755
78773
|
}
|
|
78756
78774
|
opts = Object.create(opts);
|
|
78757
78775
|
opts.headers = headers;
|
|
78758
|
-
var fullPath = !opts.root ?
|
|
78776
|
+
var fullPath = !opts.root ? resolve11(path47) : path47;
|
|
78759
78777
|
return this.sendFile(fullPath, opts, done);
|
|
78760
78778
|
};
|
|
78761
78779
|
res.contentType = res.type = function contentType2(type) {
|
|
@@ -79012,7 +79030,7 @@ var require_serve_static = __commonJS({
|
|
|
79012
79030
|
var encodeUrl = require_encodeurl();
|
|
79013
79031
|
var escapeHtml2 = require_escape_html();
|
|
79014
79032
|
var parseUrl2 = require_parseurl();
|
|
79015
|
-
var
|
|
79033
|
+
var resolve11 = require("path").resolve;
|
|
79016
79034
|
var send = require_send();
|
|
79017
79035
|
var url3 = require("url");
|
|
79018
79036
|
module2.exports = serveStatic;
|
|
@@ -79031,7 +79049,7 @@ var require_serve_static = __commonJS({
|
|
|
79031
79049
|
throw new TypeError("option setHeaders must be function");
|
|
79032
79050
|
}
|
|
79033
79051
|
opts.maxage = opts.maxage || opts.maxAge || 0;
|
|
79034
|
-
opts.root =
|
|
79052
|
+
opts.root = resolve11(root);
|
|
79035
79053
|
var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
|
|
79036
79054
|
return function serveStatic2(req, res, next) {
|
|
79037
79055
|
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
@@ -79046,11 +79064,11 @@ var require_serve_static = __commonJS({
|
|
|
79046
79064
|
}
|
|
79047
79065
|
var forwardError = !fallthrough;
|
|
79048
79066
|
var originalUrl = parseUrl2.original(req);
|
|
79049
|
-
var
|
|
79050
|
-
if (
|
|
79051
|
-
|
|
79067
|
+
var path46 = parseUrl2(req).pathname;
|
|
79068
|
+
if (path46 === "/" && originalUrl.pathname.substr(-1) !== "/") {
|
|
79069
|
+
path46 = "";
|
|
79052
79070
|
}
|
|
79053
|
-
var stream4 = send(req,
|
|
79071
|
+
var stream4 = send(req, path46, opts);
|
|
79054
79072
|
stream4.on("directory", onDirectory);
|
|
79055
79073
|
if (setHeaders) {
|
|
79056
79074
|
stream4.on("headers", setHeaders);
|
|
@@ -79216,11 +79234,11 @@ var init_ipcEndpoint = __esm({
|
|
|
79216
79234
|
|
|
79217
79235
|
// src/common/tcpPortAvailability.ts
|
|
79218
79236
|
function isTcpPortAvailable(port, host = "127.0.0.1") {
|
|
79219
|
-
return new Promise((
|
|
79237
|
+
return new Promise((resolve11) => {
|
|
79220
79238
|
const server = net.createServer();
|
|
79221
79239
|
const finish = (available) => {
|
|
79222
79240
|
server.removeAllListeners();
|
|
79223
|
-
|
|
79241
|
+
resolve11(available);
|
|
79224
79242
|
};
|
|
79225
79243
|
server.once("error", () => finish(false));
|
|
79226
79244
|
server.listen({ port, host, exclusive: true }, () => {
|
|
@@ -79883,6 +79901,11 @@ var init_src = __esm({
|
|
|
79883
79901
|
);
|
|
79884
79902
|
}
|
|
79885
79903
|
try {
|
|
79904
|
+
if (config2.fileSearchPath) {
|
|
79905
|
+
await connection.run(
|
|
79906
|
+
`SET file_search_path = '${config2.fileSearchPath.replace(/'/g, "''")}'`
|
|
79907
|
+
);
|
|
79908
|
+
}
|
|
79886
79909
|
if (config2.mounts) {
|
|
79887
79910
|
for (const filePath of Object.values(config2.mounts)) {
|
|
79888
79911
|
if (!fs24.existsSync(filePath)) {
|
|
@@ -89881,11 +89904,11 @@ var require_mime_types5 = __commonJS({
|
|
|
89881
89904
|
}
|
|
89882
89905
|
return exts[0];
|
|
89883
89906
|
}
|
|
89884
|
-
function lookup(
|
|
89885
|
-
if (!
|
|
89907
|
+
function lookup(path46) {
|
|
89908
|
+
if (!path46 || typeof path46 !== "string") {
|
|
89886
89909
|
return false;
|
|
89887
89910
|
}
|
|
89888
|
-
var extension2 = extname("x." +
|
|
89911
|
+
var extension2 = extname("x." + path46).toLowerCase().substr(1);
|
|
89889
89912
|
if (!extension2) {
|
|
89890
89913
|
return false;
|
|
89891
89914
|
}
|
|
@@ -90187,7 +90210,7 @@ var require_form_data = __commonJS({
|
|
|
90187
90210
|
"use strict";
|
|
90188
90211
|
var CombinedStream = require_combined_stream();
|
|
90189
90212
|
var util3 = require("util");
|
|
90190
|
-
var
|
|
90213
|
+
var path46 = require("path");
|
|
90191
90214
|
var http9 = require("http");
|
|
90192
90215
|
var https6 = require("https");
|
|
90193
90216
|
var parseUrl2 = require("url").parse;
|
|
@@ -90315,11 +90338,11 @@ var require_form_data = __commonJS({
|
|
|
90315
90338
|
FormData3.prototype._getContentDisposition = function(value, options) {
|
|
90316
90339
|
var filename;
|
|
90317
90340
|
if (typeof options.filepath === "string") {
|
|
90318
|
-
filename =
|
|
90341
|
+
filename = path46.normalize(options.filepath).replace(/\\/g, "/");
|
|
90319
90342
|
} else if (options.filename || value && (value.name || value.path)) {
|
|
90320
|
-
filename =
|
|
90343
|
+
filename = path46.basename(options.filename || value && (value.name || value.path));
|
|
90321
90344
|
} else if (value && value.readable && hasOwn2(value, "httpVersion")) {
|
|
90322
|
-
filename =
|
|
90345
|
+
filename = path46.basename(value.client._httpMessage.path || "");
|
|
90323
90346
|
}
|
|
90324
90347
|
if (filename) {
|
|
90325
90348
|
return 'filename="' + filename + '"';
|
|
@@ -90516,10 +90539,10 @@ function isVisitable(thing) {
|
|
|
90516
90539
|
function removeBrackets(key) {
|
|
90517
90540
|
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
90518
90541
|
}
|
|
90519
|
-
function renderKey(
|
|
90520
|
-
if (!
|
|
90542
|
+
function renderKey(path46, key, dots) {
|
|
90543
|
+
if (!path46)
|
|
90521
90544
|
return key;
|
|
90522
|
-
return
|
|
90545
|
+
return path46.concat(key).map(function each17(token, i) {
|
|
90523
90546
|
token = removeBrackets(token);
|
|
90524
90547
|
return !dots && i ? "[" + token + "]" : token;
|
|
90525
90548
|
}).join(dots ? "." : "");
|
|
@@ -90571,13 +90594,13 @@ function toFormData(obj, formData, options) {
|
|
|
90571
90594
|
}
|
|
90572
90595
|
return value;
|
|
90573
90596
|
}
|
|
90574
|
-
function defaultVisitor(value, key,
|
|
90597
|
+
function defaultVisitor(value, key, path46) {
|
|
90575
90598
|
let arr = value;
|
|
90576
90599
|
if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) {
|
|
90577
|
-
formData.append(renderKey(
|
|
90600
|
+
formData.append(renderKey(path46, key, dots), convertValue(value));
|
|
90578
90601
|
return false;
|
|
90579
90602
|
}
|
|
90580
|
-
if (value && !
|
|
90603
|
+
if (value && !path46 && typeof value === "object") {
|
|
90581
90604
|
if (utils_default.endsWith(key, "{}")) {
|
|
90582
90605
|
key = metaTokens ? key : key.slice(0, -2);
|
|
90583
90606
|
value = JSON.stringify(value);
|
|
@@ -90596,7 +90619,7 @@ function toFormData(obj, formData, options) {
|
|
|
90596
90619
|
if (isVisitable(value)) {
|
|
90597
90620
|
return true;
|
|
90598
90621
|
}
|
|
90599
|
-
formData.append(renderKey(
|
|
90622
|
+
formData.append(renderKey(path46, key, dots), convertValue(value));
|
|
90600
90623
|
return false;
|
|
90601
90624
|
}
|
|
90602
90625
|
const stack = [];
|
|
@@ -90605,7 +90628,7 @@ function toFormData(obj, formData, options) {
|
|
|
90605
90628
|
convertValue,
|
|
90606
90629
|
isVisitable
|
|
90607
90630
|
});
|
|
90608
|
-
function build(value,
|
|
90631
|
+
function build(value, path46, depth = 0) {
|
|
90609
90632
|
if (utils_default.isUndefined(value))
|
|
90610
90633
|
return;
|
|
90611
90634
|
if (depth > maxDepth) {
|
|
@@ -90615,13 +90638,13 @@ function toFormData(obj, formData, options) {
|
|
|
90615
90638
|
);
|
|
90616
90639
|
}
|
|
90617
90640
|
if (stack.indexOf(value) !== -1) {
|
|
90618
|
-
throw Error("Circular reference detected in " +
|
|
90641
|
+
throw Error("Circular reference detected in " + path46.join("."));
|
|
90619
90642
|
}
|
|
90620
90643
|
stack.push(value);
|
|
90621
90644
|
utils_default.forEach(value, function each17(el, key) {
|
|
90622
|
-
const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key,
|
|
90645
|
+
const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path46, exposedHelpers);
|
|
90623
90646
|
if (result === true) {
|
|
90624
|
-
build(el,
|
|
90647
|
+
build(el, path46 ? path46.concat(key) : [key], depth + 1);
|
|
90625
90648
|
}
|
|
90626
90649
|
});
|
|
90627
90650
|
stack.pop();
|
|
@@ -90894,7 +90917,7 @@ var init_platform = __esm({
|
|
|
90894
90917
|
// node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
90895
90918
|
function toURLEncodedForm(data, options) {
|
|
90896
90919
|
return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
|
|
90897
|
-
visitor: function(value, key,
|
|
90920
|
+
visitor: function(value, key, path46, helpers) {
|
|
90898
90921
|
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
90899
90922
|
this.append(key, value.toString("base64"));
|
|
90900
90923
|
return false;
|
|
@@ -90932,12 +90955,12 @@ function arrayToObject(arr) {
|
|
|
90932
90955
|
return obj;
|
|
90933
90956
|
}
|
|
90934
90957
|
function formDataToJSON(formData) {
|
|
90935
|
-
function buildPath4(
|
|
90936
|
-
let name =
|
|
90958
|
+
function buildPath4(path46, value, target, index) {
|
|
90959
|
+
let name = path46[index++];
|
|
90937
90960
|
if (name === "__proto__")
|
|
90938
90961
|
return true;
|
|
90939
90962
|
const isNumericKey = Number.isFinite(+name);
|
|
90940
|
-
const isLast = index >=
|
|
90963
|
+
const isLast = index >= path46.length;
|
|
90941
90964
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
90942
90965
|
if (isLast) {
|
|
90943
90966
|
if (utils_default.hasOwnProp(target, name)) {
|
|
@@ -90950,7 +90973,7 @@ function formDataToJSON(formData) {
|
|
|
90950
90973
|
if (!target[name] || !utils_default.isObject(target[name])) {
|
|
90951
90974
|
target[name] = [];
|
|
90952
90975
|
}
|
|
90953
|
-
const result = buildPath4(
|
|
90976
|
+
const result = buildPath4(path46, value, target[name], index);
|
|
90954
90977
|
if (result && utils_default.isArray(target[name])) {
|
|
90955
90978
|
target[name] = arrayToObject(target[name]);
|
|
90956
90979
|
}
|
|
@@ -91162,10 +91185,10 @@ var init_CanceledError = __esm({
|
|
|
91162
91185
|
});
|
|
91163
91186
|
|
|
91164
91187
|
// node_modules/axios/lib/core/settle.js
|
|
91165
|
-
function settle(
|
|
91188
|
+
function settle(resolve11, reject, response) {
|
|
91166
91189
|
const validateStatus2 = response.config.validateStatus;
|
|
91167
91190
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
91168
|
-
|
|
91191
|
+
resolve11(response);
|
|
91169
91192
|
} else {
|
|
91170
91193
|
reject(new AxiosError_default(
|
|
91171
91194
|
"Request failed with status code " + response.status,
|
|
@@ -92743,7 +92766,7 @@ var init_http = __esm({
|
|
|
92743
92766
|
http2Sessions = new Http2Sessions();
|
|
92744
92767
|
isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
92745
92768
|
wrapAsync = (asyncExecutor) => {
|
|
92746
|
-
return new Promise((
|
|
92769
|
+
return new Promise((resolve11, reject) => {
|
|
92747
92770
|
let onDone;
|
|
92748
92771
|
let isDone;
|
|
92749
92772
|
const done = (value, isRejected) => {
|
|
@@ -92754,7 +92777,7 @@ var init_http = __esm({
|
|
|
92754
92777
|
};
|
|
92755
92778
|
const _resolve = (value) => {
|
|
92756
92779
|
done(value);
|
|
92757
|
-
|
|
92780
|
+
resolve11(value);
|
|
92758
92781
|
};
|
|
92759
92782
|
const _reject = (reason) => {
|
|
92760
92783
|
done(reason, true);
|
|
@@ -92801,7 +92824,7 @@ var init_http = __esm({
|
|
|
92801
92824
|
}
|
|
92802
92825
|
};
|
|
92803
92826
|
http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
92804
|
-
return wrapAsync(async function dispatchHttpRequest(
|
|
92827
|
+
return wrapAsync(async function dispatchHttpRequest(resolve11, reject, onDone) {
|
|
92805
92828
|
const own2 = (key) => utils_default.hasOwnProp(config2, key) ? config2[key] : void 0;
|
|
92806
92829
|
let data = own2("data");
|
|
92807
92830
|
let lookup = own2("lookup");
|
|
@@ -92921,7 +92944,7 @@ var init_http = __esm({
|
|
|
92921
92944
|
}
|
|
92922
92945
|
let convertedData;
|
|
92923
92946
|
if (method !== "GET") {
|
|
92924
|
-
return settle(
|
|
92947
|
+
return settle(resolve11, reject, {
|
|
92925
92948
|
status: 405,
|
|
92926
92949
|
statusText: "method not allowed",
|
|
92927
92950
|
headers: {},
|
|
@@ -92943,7 +92966,7 @@ var init_http = __esm({
|
|
|
92943
92966
|
} else if (responseType === "stream") {
|
|
92944
92967
|
convertedData = import_stream5.default.Readable.from(convertedData);
|
|
92945
92968
|
}
|
|
92946
|
-
return settle(
|
|
92969
|
+
return settle(resolve11, reject, {
|
|
92947
92970
|
data: convertedData,
|
|
92948
92971
|
status: 200,
|
|
92949
92972
|
statusText: "OK",
|
|
@@ -93057,9 +93080,9 @@ var init_http = __esm({
|
|
|
93057
93080
|
auth2 = urlUsername + ":" + urlPassword;
|
|
93058
93081
|
}
|
|
93059
93082
|
auth2 && headers.delete("authorization");
|
|
93060
|
-
let
|
|
93083
|
+
let path46;
|
|
93061
93084
|
try {
|
|
93062
|
-
|
|
93085
|
+
path46 = buildURL(
|
|
93063
93086
|
parsed.pathname + parsed.search,
|
|
93064
93087
|
config2.params,
|
|
93065
93088
|
config2.paramsSerializer
|
|
@@ -93077,7 +93100,7 @@ var init_http = __esm({
|
|
|
93077
93100
|
false
|
|
93078
93101
|
);
|
|
93079
93102
|
const options = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
93080
|
-
path:
|
|
93103
|
+
path: path46,
|
|
93081
93104
|
method,
|
|
93082
93105
|
headers: headers.toJSON(),
|
|
93083
93106
|
agents: { http: config2.httpAgent, https: config2.httpsAgent },
|
|
@@ -93231,7 +93254,7 @@ var init_http = __esm({
|
|
|
93231
93254
|
});
|
|
93232
93255
|
}
|
|
93233
93256
|
response.data = responseStream;
|
|
93234
|
-
settle(
|
|
93257
|
+
settle(resolve11, reject, response);
|
|
93235
93258
|
} else {
|
|
93236
93259
|
const responseBuffer = [];
|
|
93237
93260
|
let totalResponseBytes = 0;
|
|
@@ -93283,7 +93306,7 @@ var init_http = __esm({
|
|
|
93283
93306
|
} catch (err) {
|
|
93284
93307
|
return reject(AxiosError_default.from(err, null, config2, response.request, response));
|
|
93285
93308
|
}
|
|
93286
|
-
settle(
|
|
93309
|
+
settle(resolve11, reject, response);
|
|
93287
93310
|
});
|
|
93288
93311
|
}
|
|
93289
93312
|
abortEmitter.once("abort", (err) => {
|
|
@@ -93432,15 +93455,15 @@ var init_cookies = __esm({
|
|
|
93432
93455
|
cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
93433
93456
|
// Standard browser envs support document.cookie
|
|
93434
93457
|
{
|
|
93435
|
-
write(name, value, expires,
|
|
93458
|
+
write(name, value, expires, path46, domain2, secure, sameSite) {
|
|
93436
93459
|
if (typeof document === "undefined")
|
|
93437
93460
|
return;
|
|
93438
93461
|
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
93439
93462
|
if (utils_default.isNumber(expires)) {
|
|
93440
93463
|
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
93441
93464
|
}
|
|
93442
|
-
if (utils_default.isString(
|
|
93443
|
-
cookie.push(`path=${
|
|
93465
|
+
if (utils_default.isString(path46)) {
|
|
93466
|
+
cookie.push(`path=${path46}`);
|
|
93444
93467
|
}
|
|
93445
93468
|
if (utils_default.isString(domain2)) {
|
|
93446
93469
|
cookie.push(`domain=${domain2}`);
|
|
@@ -93679,7 +93702,7 @@ var init_xhr = __esm({
|
|
|
93679
93702
|
init_resolveConfig();
|
|
93680
93703
|
isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
93681
93704
|
xhr_default = isXHRAdapterSupported && function(config2) {
|
|
93682
|
-
return new Promise(function dispatchXhrRequest(
|
|
93705
|
+
return new Promise(function dispatchXhrRequest(resolve11, reject) {
|
|
93683
93706
|
const _config = resolveConfig_default(config2);
|
|
93684
93707
|
let requestData = _config.data;
|
|
93685
93708
|
const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
|
|
@@ -93714,7 +93737,7 @@ var init_xhr = __esm({
|
|
|
93714
93737
|
};
|
|
93715
93738
|
settle(
|
|
93716
93739
|
function _resolve(value) {
|
|
93717
|
-
|
|
93740
|
+
resolve11(value);
|
|
93718
93741
|
done();
|
|
93719
93742
|
},
|
|
93720
93743
|
function _reject(err) {
|
|
@@ -94228,8 +94251,8 @@ var init_fetch = __esm({
|
|
|
94228
94251
|
}
|
|
94229
94252
|
}
|
|
94230
94253
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
94231
|
-
return await new Promise((
|
|
94232
|
-
settle(
|
|
94254
|
+
return await new Promise((resolve11, reject) => {
|
|
94255
|
+
settle(resolve11, reject, {
|
|
94233
94256
|
data: responseData,
|
|
94234
94257
|
headers: AxiosHeaders_default.from(response.headers),
|
|
94235
94258
|
status: response.status,
|
|
@@ -94724,8 +94747,8 @@ var init_CancelToken = __esm({
|
|
|
94724
94747
|
throw new TypeError("executor must be a function.");
|
|
94725
94748
|
}
|
|
94726
94749
|
let resolvePromise;
|
|
94727
|
-
this.promise = new Promise(function promiseExecutor(
|
|
94728
|
-
resolvePromise =
|
|
94750
|
+
this.promise = new Promise(function promiseExecutor(resolve11) {
|
|
94751
|
+
resolvePromise = resolve11;
|
|
94729
94752
|
});
|
|
94730
94753
|
const token = this;
|
|
94731
94754
|
this.promise.then((cancel) => {
|
|
@@ -94739,9 +94762,9 @@ var init_CancelToken = __esm({
|
|
|
94739
94762
|
});
|
|
94740
94763
|
this.promise.then = (onfulfilled) => {
|
|
94741
94764
|
let _resolve;
|
|
94742
|
-
const promise2 = new Promise((
|
|
94743
|
-
token.subscribe(
|
|
94744
|
-
_resolve =
|
|
94765
|
+
const promise2 = new Promise((resolve11) => {
|
|
94766
|
+
token.subscribe(resolve11);
|
|
94767
|
+
_resolve = resolve11;
|
|
94745
94768
|
}).then(onfulfilled);
|
|
94746
94769
|
promise2.cancel = function reject() {
|
|
94747
94770
|
token.unsubscribe(_resolve);
|
|
@@ -98643,18 +98666,18 @@ function connectAsync(connection) {
|
|
|
98643
98666
|
if (typeof connection.connectAsync === "function") {
|
|
98644
98667
|
return connection.connectAsync();
|
|
98645
98668
|
}
|
|
98646
|
-
return new Promise((
|
|
98669
|
+
return new Promise((resolve11, reject) => {
|
|
98647
98670
|
connection.connect((err) => {
|
|
98648
98671
|
if (err) {
|
|
98649
98672
|
reject(err);
|
|
98650
98673
|
} else {
|
|
98651
|
-
|
|
98674
|
+
resolve11();
|
|
98652
98675
|
}
|
|
98653
98676
|
});
|
|
98654
98677
|
});
|
|
98655
98678
|
}
|
|
98656
98679
|
function executeAsync(connection, sqlText) {
|
|
98657
|
-
return new Promise((
|
|
98680
|
+
return new Promise((resolve11, reject) => {
|
|
98658
98681
|
connection.execute({
|
|
98659
98682
|
sqlText,
|
|
98660
98683
|
fetchAsString: ["Date", "JSON"],
|
|
@@ -98663,14 +98686,14 @@ function executeAsync(connection, sqlText) {
|
|
|
98663
98686
|
reject(err);
|
|
98664
98687
|
return;
|
|
98665
98688
|
}
|
|
98666
|
-
|
|
98689
|
+
resolve11({ rows: rows ?? [], columns: [] });
|
|
98667
98690
|
}
|
|
98668
98691
|
});
|
|
98669
98692
|
});
|
|
98670
98693
|
}
|
|
98671
98694
|
function destroyAsync(connection) {
|
|
98672
|
-
return new Promise((
|
|
98673
|
-
connection.destroy((_destroyErr) =>
|
|
98695
|
+
return new Promise((resolve11) => {
|
|
98696
|
+
connection.destroy((_destroyErr) => resolve11());
|
|
98674
98697
|
});
|
|
98675
98698
|
}
|
|
98676
98699
|
function inferTypeFromValue(value) {
|
|
@@ -99437,8 +99460,8 @@ var init_ElasticsearchConnector = __esm({
|
|
|
99437
99460
|
const withoutProtocol = raw.replace(/^https?:\/\//i, "");
|
|
99438
99461
|
const pathStart = withoutProtocol.indexOf("/");
|
|
99439
99462
|
const hostPart = (pathStart === -1 ? withoutProtocol : withoutProtocol.slice(0, pathStart)).replace(/:\d+$/, "");
|
|
99440
|
-
const
|
|
99441
|
-
return `${config2.ssl === false ? "http" : "https"}://${hostPart}:${config2.port}${
|
|
99463
|
+
const path46 = pathStart === -1 ? "" : withoutProtocol.slice(pathStart);
|
|
99464
|
+
return `${config2.ssl === false ? "http" : "https"}://${hostPart}:${config2.port}${path46}`;
|
|
99442
99465
|
}
|
|
99443
99466
|
requestConfig(config2, authHeader, signal) {
|
|
99444
99467
|
const authorization = authHeader ?? this.authorization(config2);
|
|
@@ -100158,7 +100181,7 @@ var init_ExtensionCredentialStore = __esm({
|
|
|
100158
100181
|
|
|
100159
100182
|
// src/server/connection/keychainWorker.ts
|
|
100160
100183
|
function invokeWorker(modulePath, operation, args, timeoutMs) {
|
|
100161
|
-
return new Promise((
|
|
100184
|
+
return new Promise((resolve11, reject) => {
|
|
100162
100185
|
let settled = false;
|
|
100163
100186
|
const worker = new import_worker_threads.Worker(WORKER_CODE, {
|
|
100164
100187
|
eval: true,
|
|
@@ -100180,7 +100203,7 @@ function invokeWorker(modulePath, operation, args, timeoutMs) {
|
|
|
100180
100203
|
clearTimeout(timeout);
|
|
100181
100204
|
worker.terminate();
|
|
100182
100205
|
if (message.success) {
|
|
100183
|
-
|
|
100206
|
+
resolve11(message.result);
|
|
100184
100207
|
} else {
|
|
100185
100208
|
const err = new Error(message.error.message);
|
|
100186
100209
|
err.name = message.error.name;
|
|
@@ -100429,7 +100452,7 @@ var init_PlatformCredentialHelperStore = __esm({
|
|
|
100429
100452
|
}
|
|
100430
100453
|
}
|
|
100431
100454
|
async invoke(operation, payload) {
|
|
100432
|
-
return new Promise((
|
|
100455
|
+
return new Promise((resolve11, reject) => {
|
|
100433
100456
|
let settled = false;
|
|
100434
100457
|
const timeoutMs = operation === "erase" ? this.options.eraseTimeoutMs ?? ERASE_TIMEOUT_MS : this.options.interactiveTimeoutMs ?? INTERACTIVE_TIMEOUT_MS;
|
|
100435
100458
|
const maxStdoutBytes = this.options.maxStdoutBytes ?? MAX_STDOUT_BYTES;
|
|
@@ -100455,7 +100478,7 @@ var init_PlatformCredentialHelperStore = __esm({
|
|
|
100455
100478
|
reject(error52);
|
|
100456
100479
|
return;
|
|
100457
100480
|
}
|
|
100458
|
-
|
|
100481
|
+
resolve11(response);
|
|
100459
100482
|
};
|
|
100460
100483
|
child.once("error", (error52) => {
|
|
100461
100484
|
const platform2 = this.options.platform ?? process.platform;
|
|
@@ -101349,7 +101372,8 @@ var init_QueryOperationRunner = __esm({
|
|
|
101349
101372
|
request2.origin,
|
|
101350
101373
|
request2.loadAllRows,
|
|
101351
101374
|
request2.enforceReadOnly,
|
|
101352
|
-
request2.clientConsent
|
|
101375
|
+
request2.clientConsent,
|
|
101376
|
+
request2.workspaceRoot
|
|
101353
101377
|
).finally(() => {
|
|
101354
101378
|
this.sessionManager.unregisterOperation(controller);
|
|
101355
101379
|
detachAbortForwarder();
|
|
@@ -101550,13 +101574,26 @@ var init_QueryOperationRunner = __esm({
|
|
|
101550
101574
|
sql
|
|
101551
101575
|
};
|
|
101552
101576
|
}
|
|
101577
|
+
getNextResultNumber(session) {
|
|
101578
|
+
let maxCount = 0;
|
|
101579
|
+
session.tabs.forEach((tab) => {
|
|
101580
|
+
const match = tab.title.match(/^Result (\d+)$/);
|
|
101581
|
+
if (match && match[1]) {
|
|
101582
|
+
const count2 = parseInt(match[1], 10);
|
|
101583
|
+
if (count2 > maxCount) {
|
|
101584
|
+
maxCount = count2;
|
|
101585
|
+
}
|
|
101586
|
+
}
|
|
101587
|
+
});
|
|
101588
|
+
return maxCount + 1;
|
|
101589
|
+
}
|
|
101553
101590
|
resolveTab(session, providedTabId, shouldCreateNewTab, providedTitle) {
|
|
101554
101591
|
if (providedTabId) {
|
|
101555
101592
|
const tab = session.tabs.get(providedTabId);
|
|
101556
101593
|
return {
|
|
101557
101594
|
tab,
|
|
101558
101595
|
tabId: providedTabId,
|
|
101559
|
-
tabTitle: providedTitle || tab?.title || `Result ${session
|
|
101596
|
+
tabTitle: providedTitle || tab?.title || `Result ${this.getNextResultNumber(session)}`
|
|
101560
101597
|
};
|
|
101561
101598
|
}
|
|
101562
101599
|
if (!shouldCreateNewTab && session.activeTabId) {
|
|
@@ -101572,10 +101609,10 @@ var init_QueryOperationRunner = __esm({
|
|
|
101572
101609
|
return {
|
|
101573
101610
|
tab: void 0,
|
|
101574
101611
|
tabId: `t${Math.random().toString(36).substring(2, 10)}`,
|
|
101575
|
-
tabTitle: providedTitle || `Result ${session
|
|
101612
|
+
tabTitle: providedTitle || `Result ${this.getNextResultNumber(session)}`
|
|
101576
101613
|
};
|
|
101577
101614
|
}
|
|
101578
|
-
async executeAndStore(sessionId, tabId, sql, connectionId, connectionProfile, authHeader, controller, origin2, loadAllRows, enforceReadOnly, clientConsent) {
|
|
101615
|
+
async executeAndStore(sessionId, tabId, sql, connectionId, connectionProfile, authHeader, controller, origin2, loadAllRows, enforceReadOnly, clientConsent, workspaceRoot) {
|
|
101579
101616
|
const session = this.sessionManager.getSession(sessionId);
|
|
101580
101617
|
if (!session) {
|
|
101581
101618
|
return;
|
|
@@ -101644,7 +101681,8 @@ var init_QueryOperationRunner = __esm({
|
|
|
101644
101681
|
authHeader,
|
|
101645
101682
|
maxRows,
|
|
101646
101683
|
hooks,
|
|
101647
|
-
clientConsent
|
|
101684
|
+
clientConsent,
|
|
101685
|
+
workspaceRoot
|
|
101648
101686
|
);
|
|
101649
101687
|
for await (const page of generator) {
|
|
101650
101688
|
if (controller.signal.aborted) {
|
|
@@ -113027,21 +113065,21 @@ var init_PathProxy = __esm({
|
|
|
113027
113065
|
}
|
|
113028
113066
|
this._len = len2;
|
|
113029
113067
|
};
|
|
113030
|
-
PathProxy2.prototype.appendPath = function(
|
|
113031
|
-
if (!(
|
|
113032
|
-
|
|
113068
|
+
PathProxy2.prototype.appendPath = function(path46) {
|
|
113069
|
+
if (!(path46 instanceof Array)) {
|
|
113070
|
+
path46 = [path46];
|
|
113033
113071
|
}
|
|
113034
|
-
var len2 =
|
|
113072
|
+
var len2 = path46.length;
|
|
113035
113073
|
var appendSize = 0;
|
|
113036
113074
|
var offset = this._len;
|
|
113037
113075
|
for (var i = 0; i < len2; i++) {
|
|
113038
|
-
appendSize +=
|
|
113076
|
+
appendSize += path46[i].len();
|
|
113039
113077
|
}
|
|
113040
113078
|
if (hasTypedArray && this.data instanceof Float32Array) {
|
|
113041
113079
|
this.data = new Float32Array(offset + appendSize);
|
|
113042
113080
|
}
|
|
113043
113081
|
for (var i = 0; i < len2; i++) {
|
|
113044
|
-
var appendPathData =
|
|
113082
|
+
var appendPathData = path46[i].data;
|
|
113045
113083
|
for (var k = 0; k < appendPathData.length; k++) {
|
|
113046
113084
|
this.data[offset++] = appendPathData[k];
|
|
113047
113085
|
}
|
|
@@ -113783,9 +113821,9 @@ function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {
|
|
|
113783
113821
|
}
|
|
113784
113822
|
return w;
|
|
113785
113823
|
}
|
|
113786
|
-
function containPath(
|
|
113787
|
-
var data =
|
|
113788
|
-
var len2 =
|
|
113824
|
+
function containPath(path46, lineWidth, isStroke, x, y) {
|
|
113825
|
+
var data = path46.data;
|
|
113826
|
+
var len2 = path46.len();
|
|
113789
113827
|
var w = 0;
|
|
113790
113828
|
var xi = 0;
|
|
113791
113829
|
var yi = 0;
|
|
@@ -114114,13 +114152,13 @@ var init_Path = __esm({
|
|
|
114114
114152
|
firstInvoke = true;
|
|
114115
114153
|
this.createPathProxy();
|
|
114116
114154
|
}
|
|
114117
|
-
var
|
|
114155
|
+
var path46 = this.path;
|
|
114118
114156
|
if (firstInvoke || this.__dirty & SHAPE_CHANGED_BIT) {
|
|
114119
|
-
|
|
114120
|
-
this.buildPath(
|
|
114157
|
+
path46.beginPath();
|
|
114158
|
+
this.buildPath(path46, this.shape, false);
|
|
114121
114159
|
this.pathUpdated();
|
|
114122
114160
|
}
|
|
114123
|
-
rect =
|
|
114161
|
+
rect = path46.getBoundingRect();
|
|
114124
114162
|
}
|
|
114125
114163
|
this._rect = rect;
|
|
114126
114164
|
if (this.hasStroke() && this.path && this.path.len() > 0) {
|
|
@@ -115746,12 +115784,12 @@ var init_states = __esm({
|
|
|
115746
115784
|
});
|
|
115747
115785
|
|
|
115748
115786
|
// node_modules/zrender/lib/tool/transformPath.js
|
|
115749
|
-
function transformPath(
|
|
115787
|
+
function transformPath(path46, m2) {
|
|
115750
115788
|
if (!m2) {
|
|
115751
115789
|
return;
|
|
115752
115790
|
}
|
|
115753
|
-
var data =
|
|
115754
|
-
var len2 =
|
|
115791
|
+
var data = path46.data;
|
|
115792
|
+
var len2 = path46.len();
|
|
115755
115793
|
var cmd;
|
|
115756
115794
|
var nPoint;
|
|
115757
115795
|
var i;
|
|
@@ -115819,7 +115857,7 @@ function transformPath(path45, m2) {
|
|
|
115819
115857
|
data[j++] = p_1[1];
|
|
115820
115858
|
}
|
|
115821
115859
|
}
|
|
115822
|
-
|
|
115860
|
+
path46.increaseVersion();
|
|
115823
115861
|
}
|
|
115824
115862
|
var CMD3, points, mathSqrt2, mathAtan2;
|
|
115825
115863
|
var init_transformPath = __esm({
|
|
@@ -115843,7 +115881,7 @@ function vRatio(u, v) {
|
|
|
115843
115881
|
function vAngle(u, v) {
|
|
115844
115882
|
return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));
|
|
115845
115883
|
}
|
|
115846
|
-
function processArc(x1, y1, x2, y2, fa, fs44, rx, ry, psiDeg, cmd,
|
|
115884
|
+
function processArc(x1, y1, x2, y2, fa, fs44, rx, ry, psiDeg, cmd, path46) {
|
|
115847
115885
|
var psi = psiDeg * (PI3 / 180);
|
|
115848
115886
|
var xp = mathCos3(psi) * (x1 - x2) / 2 + mathSin3(psi) * (y1 - y2) / 2;
|
|
115849
115887
|
var yp = -1 * mathSin3(psi) * (x1 - x2) / 2 + mathCos3(psi) * (y1 - y2) / 2;
|
|
@@ -115871,12 +115909,12 @@ function processArc(x1, y1, x2, y2, fa, fs44, rx, ry, psiDeg, cmd, path45) {
|
|
|
115871
115909
|
var n = Math.round(dTheta / PI3 * 1e6) / 1e6;
|
|
115872
115910
|
dTheta = PI3 * 2 + n % 2 * PI3;
|
|
115873
115911
|
}
|
|
115874
|
-
|
|
115912
|
+
path46.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs44);
|
|
115875
115913
|
}
|
|
115876
115914
|
function createPathProxyFromString(data) {
|
|
115877
|
-
var
|
|
115915
|
+
var path46 = new PathProxy_default();
|
|
115878
115916
|
if (!data) {
|
|
115879
|
-
return
|
|
115917
|
+
return path46;
|
|
115880
115918
|
}
|
|
115881
115919
|
var cpx = 0;
|
|
115882
115920
|
var cpy = 0;
|
|
@@ -115886,7 +115924,7 @@ function createPathProxyFromString(data) {
|
|
|
115886
115924
|
var CMD6 = PathProxy_default.CMD;
|
|
115887
115925
|
var cmdList = data.match(commandReg);
|
|
115888
115926
|
if (!cmdList) {
|
|
115889
|
-
return
|
|
115927
|
+
return path46;
|
|
115890
115928
|
}
|
|
115891
115929
|
for (var l = 0; l < cmdList.length; l++) {
|
|
115892
115930
|
var cmdText = cmdList[l];
|
|
@@ -115915,19 +115953,19 @@ function createPathProxyFromString(data) {
|
|
|
115915
115953
|
cpx += p[off++];
|
|
115916
115954
|
cpy += p[off++];
|
|
115917
115955
|
cmd = CMD6.L;
|
|
115918
|
-
|
|
115956
|
+
path46.addData(cmd, cpx, cpy);
|
|
115919
115957
|
break;
|
|
115920
115958
|
case "L":
|
|
115921
115959
|
cpx = p[off++];
|
|
115922
115960
|
cpy = p[off++];
|
|
115923
115961
|
cmd = CMD6.L;
|
|
115924
|
-
|
|
115962
|
+
path46.addData(cmd, cpx, cpy);
|
|
115925
115963
|
break;
|
|
115926
115964
|
case "m":
|
|
115927
115965
|
cpx += p[off++];
|
|
115928
115966
|
cpy += p[off++];
|
|
115929
115967
|
cmd = CMD6.M;
|
|
115930
|
-
|
|
115968
|
+
path46.addData(cmd, cpx, cpy);
|
|
115931
115969
|
subpathX = cpx;
|
|
115932
115970
|
subpathY = cpy;
|
|
115933
115971
|
cmdStr = "l";
|
|
@@ -115936,7 +115974,7 @@ function createPathProxyFromString(data) {
|
|
|
115936
115974
|
cpx = p[off++];
|
|
115937
115975
|
cpy = p[off++];
|
|
115938
115976
|
cmd = CMD6.M;
|
|
115939
|
-
|
|
115977
|
+
path46.addData(cmd, cpx, cpy);
|
|
115940
115978
|
subpathX = cpx;
|
|
115941
115979
|
subpathY = cpy;
|
|
115942
115980
|
cmdStr = "L";
|
|
@@ -115944,40 +115982,40 @@ function createPathProxyFromString(data) {
|
|
|
115944
115982
|
case "h":
|
|
115945
115983
|
cpx += p[off++];
|
|
115946
115984
|
cmd = CMD6.L;
|
|
115947
|
-
|
|
115985
|
+
path46.addData(cmd, cpx, cpy);
|
|
115948
115986
|
break;
|
|
115949
115987
|
case "H":
|
|
115950
115988
|
cpx = p[off++];
|
|
115951
115989
|
cmd = CMD6.L;
|
|
115952
|
-
|
|
115990
|
+
path46.addData(cmd, cpx, cpy);
|
|
115953
115991
|
break;
|
|
115954
115992
|
case "v":
|
|
115955
115993
|
cpy += p[off++];
|
|
115956
115994
|
cmd = CMD6.L;
|
|
115957
|
-
|
|
115995
|
+
path46.addData(cmd, cpx, cpy);
|
|
115958
115996
|
break;
|
|
115959
115997
|
case "V":
|
|
115960
115998
|
cpy = p[off++];
|
|
115961
115999
|
cmd = CMD6.L;
|
|
115962
|
-
|
|
116000
|
+
path46.addData(cmd, cpx, cpy);
|
|
115963
116001
|
break;
|
|
115964
116002
|
case "C":
|
|
115965
116003
|
cmd = CMD6.C;
|
|
115966
|
-
|
|
116004
|
+
path46.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);
|
|
115967
116005
|
cpx = p[off - 2];
|
|
115968
116006
|
cpy = p[off - 1];
|
|
115969
116007
|
break;
|
|
115970
116008
|
case "c":
|
|
115971
116009
|
cmd = CMD6.C;
|
|
115972
|
-
|
|
116010
|
+
path46.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);
|
|
115973
116011
|
cpx += p[off - 2];
|
|
115974
116012
|
cpy += p[off - 1];
|
|
115975
116013
|
break;
|
|
115976
116014
|
case "S":
|
|
115977
116015
|
ctlPtx = cpx;
|
|
115978
116016
|
ctlPty = cpy;
|
|
115979
|
-
len2 =
|
|
115980
|
-
pathData =
|
|
116017
|
+
len2 = path46.len();
|
|
116018
|
+
pathData = path46.data;
|
|
115981
116019
|
if (prevCmd === CMD6.C) {
|
|
115982
116020
|
ctlPtx += cpx - pathData[len2 - 4];
|
|
115983
116021
|
ctlPty += cpy - pathData[len2 - 3];
|
|
@@ -115987,13 +116025,13 @@ function createPathProxyFromString(data) {
|
|
|
115987
116025
|
y1 = p[off++];
|
|
115988
116026
|
cpx = p[off++];
|
|
115989
116027
|
cpy = p[off++];
|
|
115990
|
-
|
|
116028
|
+
path46.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);
|
|
115991
116029
|
break;
|
|
115992
116030
|
case "s":
|
|
115993
116031
|
ctlPtx = cpx;
|
|
115994
116032
|
ctlPty = cpy;
|
|
115995
|
-
len2 =
|
|
115996
|
-
pathData =
|
|
116033
|
+
len2 = path46.len();
|
|
116034
|
+
pathData = path46.data;
|
|
115997
116035
|
if (prevCmd === CMD6.C) {
|
|
115998
116036
|
ctlPtx += cpx - pathData[len2 - 4];
|
|
115999
116037
|
ctlPty += cpy - pathData[len2 - 3];
|
|
@@ -116003,7 +116041,7 @@ function createPathProxyFromString(data) {
|
|
|
116003
116041
|
y1 = cpy + p[off++];
|
|
116004
116042
|
cpx += p[off++];
|
|
116005
116043
|
cpy += p[off++];
|
|
116006
|
-
|
|
116044
|
+
path46.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);
|
|
116007
116045
|
break;
|
|
116008
116046
|
case "Q":
|
|
116009
116047
|
x1 = p[off++];
|
|
@@ -116011,7 +116049,7 @@ function createPathProxyFromString(data) {
|
|
|
116011
116049
|
cpx = p[off++];
|
|
116012
116050
|
cpy = p[off++];
|
|
116013
116051
|
cmd = CMD6.Q;
|
|
116014
|
-
|
|
116052
|
+
path46.addData(cmd, x1, y1, cpx, cpy);
|
|
116015
116053
|
break;
|
|
116016
116054
|
case "q":
|
|
116017
116055
|
x1 = p[off++] + cpx;
|
|
@@ -116019,13 +116057,13 @@ function createPathProxyFromString(data) {
|
|
|
116019
116057
|
cpx += p[off++];
|
|
116020
116058
|
cpy += p[off++];
|
|
116021
116059
|
cmd = CMD6.Q;
|
|
116022
|
-
|
|
116060
|
+
path46.addData(cmd, x1, y1, cpx, cpy);
|
|
116023
116061
|
break;
|
|
116024
116062
|
case "T":
|
|
116025
116063
|
ctlPtx = cpx;
|
|
116026
116064
|
ctlPty = cpy;
|
|
116027
|
-
len2 =
|
|
116028
|
-
pathData =
|
|
116065
|
+
len2 = path46.len();
|
|
116066
|
+
pathData = path46.data;
|
|
116029
116067
|
if (prevCmd === CMD6.Q) {
|
|
116030
116068
|
ctlPtx += cpx - pathData[len2 - 4];
|
|
116031
116069
|
ctlPty += cpy - pathData[len2 - 3];
|
|
@@ -116033,13 +116071,13 @@ function createPathProxyFromString(data) {
|
|
|
116033
116071
|
cpx = p[off++];
|
|
116034
116072
|
cpy = p[off++];
|
|
116035
116073
|
cmd = CMD6.Q;
|
|
116036
|
-
|
|
116074
|
+
path46.addData(cmd, ctlPtx, ctlPty, cpx, cpy);
|
|
116037
116075
|
break;
|
|
116038
116076
|
case "t":
|
|
116039
116077
|
ctlPtx = cpx;
|
|
116040
116078
|
ctlPty = cpy;
|
|
116041
|
-
len2 =
|
|
116042
|
-
pathData =
|
|
116079
|
+
len2 = path46.len();
|
|
116080
|
+
pathData = path46.data;
|
|
116043
116081
|
if (prevCmd === CMD6.Q) {
|
|
116044
116082
|
ctlPtx += cpx - pathData[len2 - 4];
|
|
116045
116083
|
ctlPty += cpy - pathData[len2 - 3];
|
|
@@ -116047,7 +116085,7 @@ function createPathProxyFromString(data) {
|
|
|
116047
116085
|
cpx += p[off++];
|
|
116048
116086
|
cpy += p[off++];
|
|
116049
116087
|
cmd = CMD6.Q;
|
|
116050
|
-
|
|
116088
|
+
path46.addData(cmd, ctlPtx, ctlPty, cpx, cpy);
|
|
116051
116089
|
break;
|
|
116052
116090
|
case "A":
|
|
116053
116091
|
rx = p[off++];
|
|
@@ -116059,7 +116097,7 @@ function createPathProxyFromString(data) {
|
|
|
116059
116097
|
cpx = p[off++];
|
|
116060
116098
|
cpy = p[off++];
|
|
116061
116099
|
cmd = CMD6.A;
|
|
116062
|
-
processArc(x1, y1, cpx, cpy, fa, fs44, rx, ry, psi, cmd,
|
|
116100
|
+
processArc(x1, y1, cpx, cpy, fa, fs44, rx, ry, psi, cmd, path46);
|
|
116063
116101
|
break;
|
|
116064
116102
|
case "a":
|
|
116065
116103
|
rx = p[off++];
|
|
@@ -116071,36 +116109,36 @@ function createPathProxyFromString(data) {
|
|
|
116071
116109
|
cpx += p[off++];
|
|
116072
116110
|
cpy += p[off++];
|
|
116073
116111
|
cmd = CMD6.A;
|
|
116074
|
-
processArc(x1, y1, cpx, cpy, fa, fs44, rx, ry, psi, cmd,
|
|
116112
|
+
processArc(x1, y1, cpx, cpy, fa, fs44, rx, ry, psi, cmd, path46);
|
|
116075
116113
|
break;
|
|
116076
116114
|
}
|
|
116077
116115
|
}
|
|
116078
116116
|
if (cmdStr === "z" || cmdStr === "Z") {
|
|
116079
116117
|
cmd = CMD6.Z;
|
|
116080
|
-
|
|
116118
|
+
path46.addData(cmd);
|
|
116081
116119
|
cpx = subpathX;
|
|
116082
116120
|
cpy = subpathY;
|
|
116083
116121
|
}
|
|
116084
116122
|
prevCmd = cmd;
|
|
116085
116123
|
}
|
|
116086
|
-
|
|
116087
|
-
return
|
|
116124
|
+
path46.toStatic();
|
|
116125
|
+
return path46;
|
|
116088
116126
|
}
|
|
116089
|
-
function isPathProxy(
|
|
116090
|
-
return
|
|
116127
|
+
function isPathProxy(path46) {
|
|
116128
|
+
return path46.setData != null;
|
|
116091
116129
|
}
|
|
116092
116130
|
function createPathOptions(str, opts) {
|
|
116093
116131
|
var pathProxy = createPathProxyFromString(str);
|
|
116094
116132
|
var innerOpts = extend3({}, opts);
|
|
116095
|
-
innerOpts.buildPath = function(
|
|
116096
|
-
if (isPathProxy(
|
|
116097
|
-
|
|
116098
|
-
var ctx =
|
|
116133
|
+
innerOpts.buildPath = function(path46) {
|
|
116134
|
+
if (isPathProxy(path46)) {
|
|
116135
|
+
path46.setData(pathProxy.data);
|
|
116136
|
+
var ctx = path46.getContext();
|
|
116099
116137
|
if (ctx) {
|
|
116100
|
-
|
|
116138
|
+
path46.rebuildPath(ctx, 1);
|
|
116101
116139
|
}
|
|
116102
116140
|
} else {
|
|
116103
|
-
var ctx =
|
|
116141
|
+
var ctx = path46;
|
|
116104
116142
|
pathProxy.rebuildPath(ctx, 1);
|
|
116105
116143
|
}
|
|
116106
116144
|
};
|
|
@@ -116136,12 +116174,12 @@ function mergePath(pathEls, opts) {
|
|
|
116136
116174
|
}
|
|
116137
116175
|
var pathBundle = new Path_default(opts);
|
|
116138
116176
|
pathBundle.createPathProxy();
|
|
116139
|
-
pathBundle.buildPath = function(
|
|
116140
|
-
if (isPathProxy(
|
|
116141
|
-
|
|
116142
|
-
var ctx =
|
|
116177
|
+
pathBundle.buildPath = function(path46) {
|
|
116178
|
+
if (isPathProxy(path46)) {
|
|
116179
|
+
path46.appendPath(pathList);
|
|
116180
|
+
var ctx = path46.getContext();
|
|
116143
116181
|
if (ctx) {
|
|
116144
|
-
|
|
116182
|
+
path46.rebuildPath(ctx, 1);
|
|
116145
116183
|
}
|
|
116146
116184
|
}
|
|
116147
116185
|
};
|
|
@@ -116149,26 +116187,26 @@ function mergePath(pathEls, opts) {
|
|
|
116149
116187
|
}
|
|
116150
116188
|
function clonePath(sourcePath, opts) {
|
|
116151
116189
|
opts = opts || {};
|
|
116152
|
-
var
|
|
116190
|
+
var path46 = new Path_default();
|
|
116153
116191
|
if (sourcePath.shape) {
|
|
116154
|
-
|
|
116192
|
+
path46.setShape(sourcePath.shape);
|
|
116155
116193
|
}
|
|
116156
|
-
|
|
116194
|
+
path46.setStyle(sourcePath.style);
|
|
116157
116195
|
if (opts.bakeTransform) {
|
|
116158
|
-
transformPath(
|
|
116196
|
+
transformPath(path46.path, sourcePath.getComputedTransform());
|
|
116159
116197
|
} else {
|
|
116160
116198
|
if (opts.toLocal) {
|
|
116161
|
-
|
|
116199
|
+
path46.setLocalTransform(sourcePath.getComputedTransform());
|
|
116162
116200
|
} else {
|
|
116163
|
-
|
|
116201
|
+
path46.copyTransform(sourcePath);
|
|
116164
116202
|
}
|
|
116165
116203
|
}
|
|
116166
|
-
|
|
116167
|
-
|
|
116168
|
-
|
|
116169
|
-
|
|
116170
|
-
|
|
116171
|
-
return
|
|
116204
|
+
path46.buildPath = sourcePath.buildPath;
|
|
116205
|
+
path46.applyTransform = path46.applyTransform;
|
|
116206
|
+
path46.z = sourcePath.z;
|
|
116207
|
+
path46.z2 = sourcePath.z2;
|
|
116208
|
+
path46.zlevel = sourcePath.zlevel;
|
|
116209
|
+
return path46;
|
|
116172
116210
|
}
|
|
116173
116211
|
var mathSqrt3, mathSin3, mathCos3, PI3, commandReg, numberReg, SVGPath;
|
|
116174
116212
|
var init_path2 = __esm({
|
|
@@ -117552,14 +117590,14 @@ function getShapeClass(name) {
|
|
|
117552
117590
|
}
|
|
117553
117591
|
}
|
|
117554
117592
|
function makePath(pathData, opts, rect, layout5) {
|
|
117555
|
-
var
|
|
117593
|
+
var path46 = createFromString(pathData, opts);
|
|
117556
117594
|
if (rect) {
|
|
117557
117595
|
if (layout5 === "center") {
|
|
117558
|
-
rect = centerGraphic(rect,
|
|
117596
|
+
rect = centerGraphic(rect, path46.getBoundingRect());
|
|
117559
117597
|
}
|
|
117560
|
-
resizePath(
|
|
117598
|
+
resizePath(path46, rect);
|
|
117561
117599
|
}
|
|
117562
|
-
return
|
|
117600
|
+
return path46;
|
|
117563
117601
|
}
|
|
117564
117602
|
function makeImage(imageUrl, rect, layout5) {
|
|
117565
117603
|
var zrImg = new Image_default({
|
|
@@ -117601,13 +117639,13 @@ function centerGraphic(rect, boundingRect) {
|
|
|
117601
117639
|
height
|
|
117602
117640
|
};
|
|
117603
117641
|
}
|
|
117604
|
-
function resizePath(
|
|
117605
|
-
if (!
|
|
117642
|
+
function resizePath(path46, rect) {
|
|
117643
|
+
if (!path46.applyTransform) {
|
|
117606
117644
|
return;
|
|
117607
117645
|
}
|
|
117608
|
-
var pathRect =
|
|
117646
|
+
var pathRect = path46.getBoundingRect();
|
|
117609
117647
|
var m2 = pathRect.calculateTransform(rect);
|
|
117610
|
-
|
|
117648
|
+
path46.applyTransform(m2);
|
|
117611
117649
|
}
|
|
117612
117650
|
function subPixelOptimizeLine2(shape, lineWidth) {
|
|
117613
117651
|
subPixelOptimizeLine(shape, shape, {
|
|
@@ -118382,11 +118420,11 @@ var init_Model = __esm({
|
|
|
118382
118420
|
Model2.prototype.mergeOption = function(option, ecModel) {
|
|
118383
118421
|
merge3(this.option, option, true);
|
|
118384
118422
|
};
|
|
118385
|
-
Model2.prototype.get = function(
|
|
118386
|
-
if (
|
|
118423
|
+
Model2.prototype.get = function(path46, ignoreParent) {
|
|
118424
|
+
if (path46 == null) {
|
|
118387
118425
|
return this.option;
|
|
118388
118426
|
}
|
|
118389
|
-
return this._doGet(this.parsePath(
|
|
118427
|
+
return this._doGet(this.parsePath(path46), !ignoreParent && this.parentModel);
|
|
118390
118428
|
};
|
|
118391
118429
|
Model2.prototype.getShallow = function(key, ignoreParent) {
|
|
118392
118430
|
var option = this.option;
|
|
@@ -118399,9 +118437,9 @@ var init_Model = __esm({
|
|
|
118399
118437
|
}
|
|
118400
118438
|
return val;
|
|
118401
118439
|
};
|
|
118402
|
-
Model2.prototype.getModel = function(
|
|
118403
|
-
var hasPath =
|
|
118404
|
-
var pathFinal = hasPath ? this.parsePath(
|
|
118440
|
+
Model2.prototype.getModel = function(path46, parentModel) {
|
|
118441
|
+
var hasPath = path46 != null;
|
|
118442
|
+
var pathFinal = hasPath ? this.parsePath(path46) : null;
|
|
118405
118443
|
var obj = hasPath ? this._doGet(pathFinal) : this.option;
|
|
118406
118444
|
parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal));
|
|
118407
118445
|
return new Model2(obj, parentModel, this.ecModel);
|
|
@@ -118415,14 +118453,14 @@ var init_Model = __esm({
|
|
|
118415
118453
|
var Ctor = this.constructor;
|
|
118416
118454
|
return new Ctor(clone2(this.option));
|
|
118417
118455
|
};
|
|
118418
|
-
Model2.prototype.parsePath = function(
|
|
118419
|
-
if (typeof
|
|
118420
|
-
return
|
|
118456
|
+
Model2.prototype.parsePath = function(path46) {
|
|
118457
|
+
if (typeof path46 === "string") {
|
|
118458
|
+
return path46.split(".");
|
|
118421
118459
|
}
|
|
118422
|
-
return
|
|
118460
|
+
return path46;
|
|
118423
118461
|
};
|
|
118424
|
-
Model2.prototype.resolveParentPath = function(
|
|
118425
|
-
return
|
|
118462
|
+
Model2.prototype.resolveParentPath = function(path46) {
|
|
118463
|
+
return path46;
|
|
118426
118464
|
};
|
|
118427
118465
|
Model2.prototype.isAnimationEnabled = function() {
|
|
118428
118466
|
if (!env_default.node && this.option) {
|
|
@@ -121161,8 +121199,8 @@ var init_compatStyle = __esm({
|
|
|
121161
121199
|
});
|
|
121162
121200
|
|
|
121163
121201
|
// node_modules/echarts/lib/preprocessor/backwardCompat.js
|
|
121164
|
-
function get4(opt,
|
|
121165
|
-
var pathArr =
|
|
121202
|
+
function get4(opt, path46) {
|
|
121203
|
+
var pathArr = path46.split(",");
|
|
121166
121204
|
var obj = opt;
|
|
121167
121205
|
for (var i = 0; i < pathArr.length; i++) {
|
|
121168
121206
|
obj = obj && obj[pathArr[i]];
|
|
@@ -121172,8 +121210,8 @@ function get4(opt, path45) {
|
|
|
121172
121210
|
}
|
|
121173
121211
|
return obj;
|
|
121174
121212
|
}
|
|
121175
|
-
function set3(opt,
|
|
121176
|
-
var pathArr =
|
|
121213
|
+
function set3(opt, path46, val, overwrite) {
|
|
121214
|
+
var pathArr = path46.split(",");
|
|
121177
121215
|
var obj = opt;
|
|
121178
121216
|
var key;
|
|
121179
121217
|
var i = 0;
|
|
@@ -125995,15 +126033,15 @@ var init_symbol2 = __esm({
|
|
|
125995
126033
|
width: 0,
|
|
125996
126034
|
height: 0
|
|
125997
126035
|
},
|
|
125998
|
-
buildPath: function(
|
|
126036
|
+
buildPath: function(path46, shape) {
|
|
125999
126037
|
var cx = shape.cx;
|
|
126000
126038
|
var cy = shape.cy;
|
|
126001
126039
|
var width = shape.width / 2;
|
|
126002
126040
|
var height = shape.height / 2;
|
|
126003
|
-
|
|
126004
|
-
|
|
126005
|
-
|
|
126006
|
-
|
|
126041
|
+
path46.moveTo(cx, cy - height);
|
|
126042
|
+
path46.lineTo(cx + width, cy + height);
|
|
126043
|
+
path46.lineTo(cx - width, cy + height);
|
|
126044
|
+
path46.closePath();
|
|
126007
126045
|
}
|
|
126008
126046
|
});
|
|
126009
126047
|
Diamond = Path_default.extend({
|
|
@@ -126014,16 +126052,16 @@ var init_symbol2 = __esm({
|
|
|
126014
126052
|
width: 0,
|
|
126015
126053
|
height: 0
|
|
126016
126054
|
},
|
|
126017
|
-
buildPath: function(
|
|
126055
|
+
buildPath: function(path46, shape) {
|
|
126018
126056
|
var cx = shape.cx;
|
|
126019
126057
|
var cy = shape.cy;
|
|
126020
126058
|
var width = shape.width / 2;
|
|
126021
126059
|
var height = shape.height / 2;
|
|
126022
|
-
|
|
126023
|
-
|
|
126024
|
-
|
|
126025
|
-
|
|
126026
|
-
|
|
126060
|
+
path46.moveTo(cx, cy - height);
|
|
126061
|
+
path46.lineTo(cx + width, cy);
|
|
126062
|
+
path46.lineTo(cx, cy + height);
|
|
126063
|
+
path46.lineTo(cx - width, cy);
|
|
126064
|
+
path46.closePath();
|
|
126027
126065
|
}
|
|
126028
126066
|
});
|
|
126029
126067
|
Pin = Path_default.extend({
|
|
@@ -126035,7 +126073,7 @@ var init_symbol2 = __esm({
|
|
|
126035
126073
|
width: 0,
|
|
126036
126074
|
height: 0
|
|
126037
126075
|
},
|
|
126038
|
-
buildPath: function(
|
|
126076
|
+
buildPath: function(path46, shape) {
|
|
126039
126077
|
var x = shape.x;
|
|
126040
126078
|
var y = shape.y;
|
|
126041
126079
|
var w = shape.width / 5 * 3;
|
|
@@ -126049,11 +126087,11 @@ var init_symbol2 = __esm({
|
|
|
126049
126087
|
var tanY = Math.cos(angle);
|
|
126050
126088
|
var cpLen = r * 0.6;
|
|
126051
126089
|
var cpLen2 = r * 0.7;
|
|
126052
|
-
|
|
126053
|
-
|
|
126054
|
-
|
|
126055
|
-
|
|
126056
|
-
|
|
126090
|
+
path46.moveTo(x - dx, cy + dy);
|
|
126091
|
+
path46.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);
|
|
126092
|
+
path46.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);
|
|
126093
|
+
path46.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);
|
|
126094
|
+
path46.closePath();
|
|
126057
126095
|
}
|
|
126058
126096
|
});
|
|
126059
126097
|
Arrow = Path_default.extend({
|
|
@@ -126348,7 +126386,7 @@ function brushPath(ctx, el, style, inBatch) {
|
|
|
126348
126386
|
if ((!el.silent || strokePart) && firstDraw) {
|
|
126349
126387
|
el.createPathProxy();
|
|
126350
126388
|
}
|
|
126351
|
-
var
|
|
126389
|
+
var path46 = el.path || pathProxyForDraw;
|
|
126352
126390
|
var dirtyFlag = el.__dirty;
|
|
126353
126391
|
if (!inBatch) {
|
|
126354
126392
|
var fill = style.fill;
|
|
@@ -126401,7 +126439,7 @@ function brushPath(ctx, el, style, inBatch) {
|
|
|
126401
126439
|
}
|
|
126402
126440
|
}
|
|
126403
126441
|
var scale4 = el.getGlobalScale();
|
|
126404
|
-
|
|
126442
|
+
path46.setScale(scale4[0], scale4[1], el.segmentIgnoreThreshold);
|
|
126405
126443
|
var lineDash;
|
|
126406
126444
|
var lineDashOffset;
|
|
126407
126445
|
if (ctx.setLineDash && style.lineDash) {
|
|
@@ -126409,20 +126447,20 @@ function brushPath(ctx, el, style, inBatch) {
|
|
|
126409
126447
|
}
|
|
126410
126448
|
var needsRebuild = true;
|
|
126411
126449
|
if (firstDraw || dirtyFlag & SHAPE_CHANGED_BIT) {
|
|
126412
|
-
|
|
126450
|
+
path46.setDPR(ctx.dpr);
|
|
126413
126451
|
if (strokePart) {
|
|
126414
|
-
|
|
126452
|
+
path46.setContext(null);
|
|
126415
126453
|
} else {
|
|
126416
|
-
|
|
126454
|
+
path46.setContext(ctx);
|
|
126417
126455
|
needsRebuild = false;
|
|
126418
126456
|
}
|
|
126419
|
-
|
|
126420
|
-
el.buildPath(
|
|
126421
|
-
|
|
126457
|
+
path46.reset();
|
|
126458
|
+
el.buildPath(path46, el.shape, inBatch);
|
|
126459
|
+
path46.toStatic();
|
|
126422
126460
|
el.pathUpdated();
|
|
126423
126461
|
}
|
|
126424
126462
|
if (needsRebuild) {
|
|
126425
|
-
|
|
126463
|
+
path46.rebuildPath(ctx, strokePart ? strokePercent : 1);
|
|
126426
126464
|
}
|
|
126427
126465
|
if (lineDash) {
|
|
126428
126466
|
ctx.setLineDash(lineDash);
|
|
@@ -133402,7 +133440,7 @@ function nearestPointOnRect(pt, rect, out2) {
|
|
|
133402
133440
|
out2.set(tmpPt[0], tmpPt[1]);
|
|
133403
133441
|
return dist3;
|
|
133404
133442
|
}
|
|
133405
|
-
function nearestPointOnPath(pt,
|
|
133443
|
+
function nearestPointOnPath(pt, path46, out2) {
|
|
133406
133444
|
var xi = 0;
|
|
133407
133445
|
var yi = 0;
|
|
133408
133446
|
var x0 = 0;
|
|
@@ -133410,7 +133448,7 @@ function nearestPointOnPath(pt, path45, out2) {
|
|
|
133410
133448
|
var x1;
|
|
133411
133449
|
var y1;
|
|
133412
133450
|
var minDist = Infinity;
|
|
133413
|
-
var data =
|
|
133451
|
+
var data = path46.data;
|
|
133414
133452
|
var x = pt.x;
|
|
133415
133453
|
var y = pt.y;
|
|
133416
133454
|
for (var i = 0; i < data.length; ) {
|
|
@@ -133619,30 +133657,30 @@ function setLabelLineState(labelLine, ignore, stateName, stateModel) {
|
|
|
133619
133657
|
var styleObj = stateModel.getModel("lineStyle").getLineStyle();
|
|
133620
133658
|
isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;
|
|
133621
133659
|
}
|
|
133622
|
-
function buildLabelLinePath(
|
|
133660
|
+
function buildLabelLinePath(path46, shape) {
|
|
133623
133661
|
var smooth = shape.smooth;
|
|
133624
133662
|
var points4 = shape.points;
|
|
133625
133663
|
if (!points4) {
|
|
133626
133664
|
return;
|
|
133627
133665
|
}
|
|
133628
|
-
|
|
133666
|
+
path46.moveTo(points4[0][0], points4[0][1]);
|
|
133629
133667
|
if (smooth > 0 && points4.length >= 3) {
|
|
133630
133668
|
var len1 = dist(points4[0], points4[1]);
|
|
133631
133669
|
var len2 = dist(points4[1], points4[2]);
|
|
133632
133670
|
if (!len1 || !len2) {
|
|
133633
|
-
|
|
133634
|
-
|
|
133671
|
+
path46.lineTo(points4[1][0], points4[1][1]);
|
|
133672
|
+
path46.lineTo(points4[2][0], points4[2][1]);
|
|
133635
133673
|
return;
|
|
133636
133674
|
}
|
|
133637
133675
|
var moveLen = Math.min(len1, len2) * smooth;
|
|
133638
133676
|
var midPoint0 = lerp([], points4[1], points4[0], moveLen / len1);
|
|
133639
133677
|
var midPoint2 = lerp([], points4[1], points4[2], moveLen / len2);
|
|
133640
133678
|
var midPoint1 = lerp([], midPoint0, midPoint2, 0.5);
|
|
133641
|
-
|
|
133642
|
-
|
|
133679
|
+
path46.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);
|
|
133680
|
+
path46.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points4[2][0], points4[2][1]);
|
|
133643
133681
|
} else {
|
|
133644
133682
|
for (var i = 1; i < points4.length; i++) {
|
|
133645
|
-
|
|
133683
|
+
path46.lineTo(points4[i][0], points4[i][1]);
|
|
133646
133684
|
}
|
|
133647
133685
|
}
|
|
133648
133686
|
}
|
|
@@ -134675,13 +134713,13 @@ var init_cssClassId = __esm({
|
|
|
134675
134713
|
});
|
|
134676
134714
|
|
|
134677
134715
|
// node_modules/zrender/lib/svg/cssAnimation.js
|
|
134678
|
-
function buildPathString(el, kfShape,
|
|
134716
|
+
function buildPathString(el, kfShape, path46) {
|
|
134679
134717
|
var shape = extend3({}, el.shape);
|
|
134680
134718
|
extend3(shape, kfShape);
|
|
134681
|
-
el.buildPath(
|
|
134719
|
+
el.buildPath(path46, shape);
|
|
134682
134720
|
var svgPathBuilder = new SVGPathRebuilder_default();
|
|
134683
134721
|
svgPathBuilder.reset(getPathPrecision(el));
|
|
134684
|
-
|
|
134722
|
+
path46.rebuildPath(svgPathBuilder, 1);
|
|
134685
134723
|
svgPathBuilder.generateStr();
|
|
134686
134724
|
return svgPathBuilder.getStr();
|
|
134687
134725
|
}
|
|
@@ -134701,10 +134739,10 @@ function createCompoundPathCSSAnimation(el, attrs, scope) {
|
|
|
134701
134739
|
var composedAnim = {};
|
|
134702
134740
|
var cssAnimationCfg;
|
|
134703
134741
|
var cssAnimationName;
|
|
134704
|
-
each(paths, function(
|
|
134742
|
+
each(paths, function(path46) {
|
|
134705
134743
|
var subScope = createBrushScope(scope.zrId);
|
|
134706
134744
|
subScope.animation = true;
|
|
134707
|
-
createCSSAnimation(
|
|
134745
|
+
createCSSAnimation(path46, {}, subScope, true);
|
|
134708
134746
|
var cssAnims = subScope.cssAnims;
|
|
134709
134747
|
var cssNodes = subScope.cssNodes;
|
|
134710
134748
|
var animNames = keys(cssAnims);
|
|
@@ -134829,19 +134867,19 @@ function createCSSAnimation(el, attrs, scope, onlyShape) {
|
|
|
134829
134867
|
}
|
|
134830
134868
|
}
|
|
134831
134869
|
;
|
|
134832
|
-
var
|
|
134870
|
+
var path46;
|
|
134833
134871
|
var canAnimateShape = true;
|
|
134834
134872
|
for (var percent in shapeKfs) {
|
|
134835
134873
|
finalKfs[percent] = finalKfs[percent] || {};
|
|
134836
|
-
var isFirst = !
|
|
134874
|
+
var isFirst = !path46;
|
|
134837
134875
|
var timingFunction = shapeKfs[percent][animationTimingFunctionAttrName];
|
|
134838
134876
|
if (isFirst) {
|
|
134839
|
-
|
|
134877
|
+
path46 = new PathProxy_default();
|
|
134840
134878
|
}
|
|
134841
|
-
var len_1 =
|
|
134842
|
-
|
|
134843
|
-
finalKfs[percent].d = buildPathString(el, shapeKfs[percent],
|
|
134844
|
-
var newLen =
|
|
134879
|
+
var len_1 = path46.len();
|
|
134880
|
+
path46.reset();
|
|
134881
|
+
finalKfs[percent].d = buildPathString(el, shapeKfs[percent], path46);
|
|
134882
|
+
var newLen = path46.len();
|
|
134845
134883
|
if (!isFirst && len_1 !== newLen) {
|
|
134846
134884
|
canAnimateShape = false;
|
|
134847
134885
|
break;
|
|
@@ -135109,13 +135147,13 @@ function brushSVGPath(el, scope) {
|
|
|
135109
135147
|
if (!el.path) {
|
|
135110
135148
|
el.createPathProxy();
|
|
135111
135149
|
}
|
|
135112
|
-
var
|
|
135150
|
+
var path46 = el.path;
|
|
135113
135151
|
if (needBuildPath) {
|
|
135114
|
-
|
|
135115
|
-
el.buildPath(
|
|
135152
|
+
path46.beginPath();
|
|
135153
|
+
el.buildPath(path46, el.shape);
|
|
135116
135154
|
el.pathUpdated();
|
|
135117
135155
|
}
|
|
135118
|
-
var pathVersion =
|
|
135156
|
+
var pathVersion = path46.getVersion();
|
|
135119
135157
|
var elExt = el;
|
|
135120
135158
|
var svgPathBuilder = elExt.__svgPathBuilder;
|
|
135121
135159
|
if (elExt.__svgPathVersion !== pathVersion || !svgPathBuilder || strokePercent !== elExt.__svgPathStrokePercent) {
|
|
@@ -135123,7 +135161,7 @@ function brushSVGPath(el, scope) {
|
|
|
135123
135161
|
svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder_default();
|
|
135124
135162
|
}
|
|
135125
135163
|
svgPathBuilder.reset(precision);
|
|
135126
|
-
|
|
135164
|
+
path46.rebuildPath(svgPathBuilder, strokePercent);
|
|
135127
135165
|
svgPathBuilder.generateStr();
|
|
135128
135166
|
elExt.__svgPathVersion = pathVersion;
|
|
135129
135167
|
elExt.__svgPathStrokePercent = strokePercent;
|
|
@@ -137876,8 +137914,8 @@ var init_poly2 = __esm({
|
|
|
137876
137914
|
this.createPathProxy();
|
|
137877
137915
|
this.buildPath(this.path, this.shape);
|
|
137878
137916
|
}
|
|
137879
|
-
var
|
|
137880
|
-
var data =
|
|
137917
|
+
var path46 = this.path;
|
|
137918
|
+
var data = path46.data;
|
|
137881
137919
|
var CMD6 = PathProxy_default.CMD;
|
|
137882
137920
|
var x0;
|
|
137883
137921
|
var y0;
|
|
@@ -141706,12 +141744,12 @@ var init_LargeSymbolDraw = __esm({
|
|
|
141706
141744
|
this.notClear = false;
|
|
141707
141745
|
this._off = 0;
|
|
141708
141746
|
};
|
|
141709
|
-
LargeSymbolPath2.prototype.buildPath = function(
|
|
141747
|
+
LargeSymbolPath2.prototype.buildPath = function(path46, shape) {
|
|
141710
141748
|
var points4 = shape.points;
|
|
141711
141749
|
var size = shape.size;
|
|
141712
141750
|
var symbolProxy = this.symbolProxy;
|
|
141713
141751
|
var symbolProxyShape = symbolProxy.shape;
|
|
141714
|
-
var ctx =
|
|
141752
|
+
var ctx = path46.getContext ? path46.getContext() : path46;
|
|
141715
141753
|
var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;
|
|
141716
141754
|
var softClipShape = this.softClipShape;
|
|
141717
141755
|
var i;
|
|
@@ -141733,7 +141771,7 @@ var init_LargeSymbolDraw = __esm({
|
|
|
141733
141771
|
symbolProxyShape.y = y - size[1] / 2;
|
|
141734
141772
|
symbolProxyShape.width = size[0];
|
|
141735
141773
|
symbolProxyShape.height = size[1];
|
|
141736
|
-
symbolProxy.buildPath(
|
|
141774
|
+
symbolProxy.buildPath(path46, symbolProxyShape, true);
|
|
141737
141775
|
}
|
|
141738
141776
|
if (this.incremental) {
|
|
141739
141777
|
this._off = i;
|
|
@@ -145927,11 +145965,11 @@ var init_parseSVG = __esm({
|
|
|
145927
145965
|
},
|
|
145928
145966
|
"path": function(xmlNode, parentGroup) {
|
|
145929
145967
|
var d = xmlNode.getAttribute("d") || "";
|
|
145930
|
-
var
|
|
145931
|
-
inheritStyle(parentGroup,
|
|
145932
|
-
parseAttributes(xmlNode,
|
|
145933
|
-
|
|
145934
|
-
return
|
|
145968
|
+
var path46 = createFromString(d);
|
|
145969
|
+
inheritStyle(parentGroup, path46);
|
|
145970
|
+
parseAttributes(xmlNode, path46, this._defsUsePending, false, false);
|
|
145971
|
+
path46.silent = true;
|
|
145972
|
+
return path46;
|
|
145935
145973
|
}
|
|
145936
145974
|
};
|
|
145937
145975
|
}();
|
|
@@ -149158,13 +149196,13 @@ var init_Tree = __esm({
|
|
|
149158
149196
|
TreeNode2.prototype.getLayout = function() {
|
|
149159
149197
|
return this.hostTree.data.getItemLayout(this.dataIndex);
|
|
149160
149198
|
};
|
|
149161
|
-
TreeNode2.prototype.getModel = function(
|
|
149199
|
+
TreeNode2.prototype.getModel = function(path46) {
|
|
149162
149200
|
if (this.dataIndex < 0) {
|
|
149163
149201
|
return;
|
|
149164
149202
|
}
|
|
149165
149203
|
var hostTree = this.hostTree;
|
|
149166
149204
|
var itemModel = hostTree.data.getItemModel(this.dataIndex);
|
|
149167
|
-
return itemModel.getModel(
|
|
149205
|
+
return itemModel.getModel(path46);
|
|
149168
149206
|
};
|
|
149169
149207
|
TreeNode2.prototype.getLevelModel = function() {
|
|
149170
149208
|
return (this.hostTree.levelModels || [])[this.depth];
|
|
@@ -149301,12 +149339,12 @@ function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {
|
|
|
149301
149339
|
}
|
|
149302
149340
|
}
|
|
149303
149341
|
function getPathToRoot(node) {
|
|
149304
|
-
var
|
|
149342
|
+
var path46 = [];
|
|
149305
149343
|
while (node) {
|
|
149306
149344
|
node = node.parentNode;
|
|
149307
|
-
node &&
|
|
149345
|
+
node && path46.push(node);
|
|
149308
149346
|
}
|
|
149309
|
-
return
|
|
149347
|
+
return path46.reverse();
|
|
149310
149348
|
}
|
|
149311
149349
|
function aboveViewRoot(viewRoot, node) {
|
|
149312
149350
|
var viewPath = getPathToRoot(viewRoot);
|
|
@@ -153791,13 +153829,13 @@ var init_Graph = __esm({
|
|
|
153791
153829
|
GraphNode2.prototype.outDegree = function() {
|
|
153792
153830
|
return this.outEdges.length;
|
|
153793
153831
|
};
|
|
153794
|
-
GraphNode2.prototype.getModel = function(
|
|
153832
|
+
GraphNode2.prototype.getModel = function(path46) {
|
|
153795
153833
|
if (this.dataIndex < 0) {
|
|
153796
153834
|
return;
|
|
153797
153835
|
}
|
|
153798
153836
|
var graph = this.hostGraph;
|
|
153799
153837
|
var itemModel = graph.data.getItemModel(this.dataIndex);
|
|
153800
|
-
return itemModel.getModel(
|
|
153838
|
+
return itemModel.getModel(path46);
|
|
153801
153839
|
};
|
|
153802
153840
|
GraphNode2.prototype.getAdjacentDataIndices = function() {
|
|
153803
153841
|
var dataIndices = {
|
|
@@ -153861,13 +153899,13 @@ var init_Graph = __esm({
|
|
|
153861
153899
|
this.node2 = n2;
|
|
153862
153900
|
this.dataIndex = dataIndex == null ? -1 : dataIndex;
|
|
153863
153901
|
}
|
|
153864
|
-
GraphEdge2.prototype.getModel = function(
|
|
153902
|
+
GraphEdge2.prototype.getModel = function(path46) {
|
|
153865
153903
|
if (this.dataIndex < 0) {
|
|
153866
153904
|
return;
|
|
153867
153905
|
}
|
|
153868
153906
|
var graph = this.hostGraph;
|
|
153869
153907
|
var itemModel = graph.edgeData.getItemModel(this.dataIndex);
|
|
153870
|
-
return itemModel.getModel(
|
|
153908
|
+
return itemModel.getModel(path46);
|
|
153871
153909
|
};
|
|
153872
153910
|
GraphEdge2.prototype.getAdjacentDataIndices = function() {
|
|
153873
153911
|
return {
|
|
@@ -154054,8 +154092,8 @@ var init_GraphSeries = __esm({
|
|
|
154054
154092
|
return model;
|
|
154055
154093
|
});
|
|
154056
154094
|
var oldGetModel = Model_default.prototype.getModel;
|
|
154057
|
-
function newGetModel(
|
|
154058
|
-
var model = oldGetModel.call(this,
|
|
154095
|
+
function newGetModel(path46, parentModel) {
|
|
154096
|
+
var model = oldGetModel.call(this, path46, parentModel);
|
|
154059
154097
|
model.resolveParentPath = resolveParentPath;
|
|
154060
154098
|
return model;
|
|
154061
154099
|
}
|
|
@@ -161475,7 +161513,7 @@ function prepareLayoutInfo(itemModel, symbolSize, layout5, symbolRepeat, symbolC
|
|
|
161475
161513
|
}
|
|
161476
161514
|
function createPath(symbolMeta) {
|
|
161477
161515
|
var symbolPatternSize = symbolMeta.symbolPatternSize;
|
|
161478
|
-
var
|
|
161516
|
+
var path46 = createSymbol(
|
|
161479
161517
|
// Consider texture img, make a big size.
|
|
161480
161518
|
symbolMeta.symbolType,
|
|
161481
161519
|
-symbolPatternSize / 2,
|
|
@@ -161483,13 +161521,13 @@ function createPath(symbolMeta) {
|
|
|
161483
161521
|
symbolPatternSize,
|
|
161484
161522
|
symbolPatternSize
|
|
161485
161523
|
);
|
|
161486
|
-
|
|
161524
|
+
path46.attr({
|
|
161487
161525
|
culling: true
|
|
161488
161526
|
});
|
|
161489
|
-
|
|
161527
|
+
path46.type !== "image" && path46.setStyle({
|
|
161490
161528
|
strokeNoScale: true
|
|
161491
161529
|
});
|
|
161492
|
-
return
|
|
161530
|
+
return path46;
|
|
161493
161531
|
}
|
|
161494
161532
|
function createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {
|
|
161495
161533
|
var bundle = bar.__pictorialBundle;
|
|
@@ -161500,28 +161538,28 @@ function createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {
|
|
|
161500
161538
|
var repeatTimes = symbolMeta.repeatTimes || 0;
|
|
161501
161539
|
var index = 0;
|
|
161502
161540
|
var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;
|
|
161503
|
-
eachPath(bar, function(
|
|
161504
|
-
|
|
161505
|
-
|
|
161541
|
+
eachPath(bar, function(path47) {
|
|
161542
|
+
path47.__pictorialAnimationIndex = index;
|
|
161543
|
+
path47.__pictorialRepeatTimes = repeatTimes;
|
|
161506
161544
|
if (index < repeatTimes) {
|
|
161507
|
-
updateAttr(
|
|
161545
|
+
updateAttr(path47, null, makeTarget(index), symbolMeta, isUpdate);
|
|
161508
161546
|
} else {
|
|
161509
|
-
updateAttr(
|
|
161547
|
+
updateAttr(path47, null, {
|
|
161510
161548
|
scaleX: 0,
|
|
161511
161549
|
scaleY: 0
|
|
161512
161550
|
}, symbolMeta, isUpdate, function() {
|
|
161513
|
-
bundle.remove(
|
|
161551
|
+
bundle.remove(path47);
|
|
161514
161552
|
});
|
|
161515
161553
|
}
|
|
161516
161554
|
index++;
|
|
161517
161555
|
});
|
|
161518
161556
|
for (; index < repeatTimes; index++) {
|
|
161519
|
-
var
|
|
161520
|
-
|
|
161521
|
-
|
|
161522
|
-
bundle.add(
|
|
161557
|
+
var path46 = createPath(symbolMeta);
|
|
161558
|
+
path46.__pictorialAnimationIndex = index;
|
|
161559
|
+
path46.__pictorialRepeatTimes = repeatTimes;
|
|
161560
|
+
bundle.add(path46);
|
|
161523
161561
|
var target = makeTarget(index);
|
|
161524
|
-
updateAttr(
|
|
161562
|
+
updateAttr(path46, {
|
|
161525
161563
|
x: target.x,
|
|
161526
161564
|
y: target.y,
|
|
161527
161565
|
scaleX: 0,
|
|
@@ -161629,10 +161667,10 @@ function getItemModel(data, dataIndex) {
|
|
|
161629
161667
|
itemModel.isAnimationEnabled = isAnimationEnabled;
|
|
161630
161668
|
return itemModel;
|
|
161631
161669
|
}
|
|
161632
|
-
function getAnimationDelayParams(
|
|
161670
|
+
function getAnimationDelayParams(path46) {
|
|
161633
161671
|
return {
|
|
161634
|
-
index:
|
|
161635
|
-
count:
|
|
161672
|
+
index: path46.__pictorialAnimationIndex,
|
|
161673
|
+
count: path46.__pictorialRepeatTimes
|
|
161636
161674
|
};
|
|
161637
161675
|
}
|
|
161638
161676
|
function isAnimationEnabled() {
|
|
@@ -161676,13 +161714,13 @@ function removeBar(data, dataIndex, animationModel, bar) {
|
|
|
161676
161714
|
var labelRect = bar.__pictorialBarRect;
|
|
161677
161715
|
labelRect && labelRect.removeTextContent();
|
|
161678
161716
|
var paths = [];
|
|
161679
|
-
eachPath(bar, function(
|
|
161680
|
-
paths.push(
|
|
161717
|
+
eachPath(bar, function(path46) {
|
|
161718
|
+
paths.push(path46);
|
|
161681
161719
|
});
|
|
161682
161720
|
bar.__pictorialMainPath && paths.push(bar.__pictorialMainPath);
|
|
161683
161721
|
bar.__pictorialClipPath && (animationModel = null);
|
|
161684
|
-
each(paths, function(
|
|
161685
|
-
removeElement(
|
|
161722
|
+
each(paths, function(path46) {
|
|
161723
|
+
removeElement(path46, {
|
|
161686
161724
|
scaleX: 0,
|
|
161687
161725
|
scaleY: 0
|
|
161688
161726
|
}, animationModel, dataIndex, function() {
|
|
@@ -161718,10 +161756,10 @@ function updateCommon2(bar, opt, symbolMeta) {
|
|
|
161718
161756
|
var focus = emphasisModel.get("focus");
|
|
161719
161757
|
var blurScope = emphasisModel.get("blurScope");
|
|
161720
161758
|
var hoverScale = emphasisModel.get("scale");
|
|
161721
|
-
eachPath(bar, function(
|
|
161722
|
-
if (
|
|
161723
|
-
var pathStyle =
|
|
161724
|
-
|
|
161759
|
+
eachPath(bar, function(path46) {
|
|
161760
|
+
if (path46 instanceof Image_default) {
|
|
161761
|
+
var pathStyle = path46.style;
|
|
161762
|
+
path46.useStyle(extend3({
|
|
161725
161763
|
// TODO other properties like dx, dy ?
|
|
161726
161764
|
image: pathStyle.image,
|
|
161727
161765
|
x: pathStyle.x,
|
|
@@ -161730,18 +161768,18 @@ function updateCommon2(bar, opt, symbolMeta) {
|
|
|
161730
161768
|
height: pathStyle.height
|
|
161731
161769
|
}, symbolMeta.style));
|
|
161732
161770
|
} else {
|
|
161733
|
-
|
|
161771
|
+
path46.useStyle(symbolMeta.style);
|
|
161734
161772
|
}
|
|
161735
|
-
var emphasisState =
|
|
161773
|
+
var emphasisState = path46.ensureState("emphasis");
|
|
161736
161774
|
emphasisState.style = emphasisStyle;
|
|
161737
161775
|
if (hoverScale) {
|
|
161738
|
-
emphasisState.scaleX =
|
|
161739
|
-
emphasisState.scaleY =
|
|
161776
|
+
emphasisState.scaleX = path46.scaleX * 1.1;
|
|
161777
|
+
emphasisState.scaleY = path46.scaleY * 1.1;
|
|
161740
161778
|
}
|
|
161741
|
-
|
|
161742
|
-
|
|
161743
|
-
cursorStyle && (
|
|
161744
|
-
|
|
161779
|
+
path46.ensureState("blur").style = blurStyle;
|
|
161780
|
+
path46.ensureState("select").style = selectStyle;
|
|
161781
|
+
cursorStyle && (path46.cursor = cursorStyle);
|
|
161782
|
+
path46.z2 = symbolMeta.z2;
|
|
161745
161783
|
});
|
|
161746
161784
|
var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];
|
|
161747
161785
|
var barRect = bar.__pictorialBarRect;
|
|
@@ -170031,14 +170069,14 @@ var init_ToolboxView = __esm({
|
|
|
170031
170069
|
}
|
|
170032
170070
|
var iconPaths = featureModel.iconPaths = {};
|
|
170033
170071
|
each(iconsMap, function(iconStr, iconName) {
|
|
170034
|
-
var
|
|
170072
|
+
var path46 = createIcon(iconStr, {}, {
|
|
170035
170073
|
x: -itemSize / 2,
|
|
170036
170074
|
y: -itemSize / 2,
|
|
170037
170075
|
width: itemSize,
|
|
170038
170076
|
height: itemSize
|
|
170039
170077
|
});
|
|
170040
|
-
|
|
170041
|
-
var pathEmphasisState =
|
|
170078
|
+
path46.setStyle(iconStyleModel.getItemStyle());
|
|
170079
|
+
var pathEmphasisState = path46.ensureState("emphasis");
|
|
170042
170080
|
pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();
|
|
170043
170081
|
var textContent = new Text_default({
|
|
170044
170082
|
style: {
|
|
@@ -170056,24 +170094,24 @@ var init_ToolboxView = __esm({
|
|
|
170056
170094
|
},
|
|
170057
170095
|
ignore: true
|
|
170058
170096
|
});
|
|
170059
|
-
|
|
170097
|
+
path46.setTextContent(textContent);
|
|
170060
170098
|
setTooltipConfig({
|
|
170061
|
-
el:
|
|
170099
|
+
el: path46,
|
|
170062
170100
|
componentModel: toolboxModel,
|
|
170063
170101
|
itemName: iconName,
|
|
170064
170102
|
formatterParamsExtra: {
|
|
170065
170103
|
title: titlesMap[iconName]
|
|
170066
170104
|
}
|
|
170067
170105
|
});
|
|
170068
|
-
|
|
170069
|
-
|
|
170106
|
+
path46.__title = titlesMap[iconName];
|
|
170107
|
+
path46.on("mouseover", function() {
|
|
170070
170108
|
var hoverStyle = iconStyleEmphasisModel.getItemStyle();
|
|
170071
170109
|
var defaultTextPosition = isVertical ? toolboxModel.get("right") == null && toolboxModel.get("left") !== "right" ? "right" : "left" : toolboxModel.get("bottom") == null && toolboxModel.get("top") !== "bottom" ? "bottom" : "top";
|
|
170072
170110
|
textContent.setStyle({
|
|
170073
170111
|
fill: iconStyleEmphasisModel.get("textFill") || hoverStyle.fill || hoverStyle.stroke || "#000",
|
|
170074
170112
|
backgroundColor: iconStyleEmphasisModel.get("textBackgroundColor")
|
|
170075
170113
|
});
|
|
170076
|
-
|
|
170114
|
+
path46.setTextConfig({
|
|
170077
170115
|
position: iconStyleEmphasisModel.get("textPosition") || defaultTextPosition
|
|
170078
170116
|
});
|
|
170079
170117
|
textContent.ignore = !toolboxModel.get("showTitle");
|
|
@@ -170084,10 +170122,10 @@ var init_ToolboxView = __esm({
|
|
|
170084
170122
|
}
|
|
170085
170123
|
textContent.hide();
|
|
170086
170124
|
});
|
|
170087
|
-
(featureModel.get(["iconStatus", iconName]) === "emphasis" ? enterEmphasis : leaveEmphasis)(
|
|
170088
|
-
group.add(
|
|
170089
|
-
|
|
170090
|
-
iconPaths[iconName] =
|
|
170125
|
+
(featureModel.get(["iconStatus", iconName]) === "emphasis" ? enterEmphasis : leaveEmphasis)(path46);
|
|
170126
|
+
group.add(path46);
|
|
170127
|
+
path46.on("click", bind2(feature.onclick, feature, ecModel, api, iconName));
|
|
170128
|
+
iconPaths[iconName] = path46;
|
|
170091
170129
|
});
|
|
170092
170130
|
}
|
|
170093
170131
|
layout4(group, toolboxModel, api);
|
|
@@ -177911,8 +177949,8 @@ var init_SliderZoomView = __esm({
|
|
|
177911
177949
|
deprecateLog("handleIcon now needs 'path://' prefix when using a path string");
|
|
177912
177950
|
}
|
|
177913
177951
|
}
|
|
177914
|
-
var
|
|
177915
|
-
|
|
177952
|
+
var path46 = createSymbol(iconStr, -1, 0, 2, 2, null, true);
|
|
177953
|
+
path46.attr({
|
|
177916
177954
|
cursor: getCursor(this._orient),
|
|
177917
177955
|
draggable: true,
|
|
177918
177956
|
drift: bind2(this._onDragMove, this, handleIndex),
|
|
@@ -177921,20 +177959,20 @@ var init_SliderZoomView = __esm({
|
|
|
177921
177959
|
onmouseout: bind2(this._showDataInfo, this, false),
|
|
177922
177960
|
z2: 5
|
|
177923
177961
|
});
|
|
177924
|
-
var bRect =
|
|
177962
|
+
var bRect = path46.getBoundingRect();
|
|
177925
177963
|
var handleSize = dataZoomModel.get("handleSize");
|
|
177926
177964
|
this._handleHeight = parsePercent2(handleSize, this._size[1]);
|
|
177927
177965
|
this._handleWidth = bRect.width / bRect.height * this._handleHeight;
|
|
177928
|
-
|
|
177929
|
-
|
|
177930
|
-
|
|
177931
|
-
|
|
177932
|
-
enableHoverEmphasis(
|
|
177966
|
+
path46.setStyle(dataZoomModel.getModel("handleStyle").getItemStyle());
|
|
177967
|
+
path46.style.strokeNoScale = true;
|
|
177968
|
+
path46.rectHover = true;
|
|
177969
|
+
path46.ensureState("emphasis").style = dataZoomModel.getModel(["emphasis", "handleStyle"]).getItemStyle();
|
|
177970
|
+
enableHoverEmphasis(path46);
|
|
177933
177971
|
var handleColor = dataZoomModel.get("handleColor");
|
|
177934
177972
|
if (handleColor != null) {
|
|
177935
|
-
|
|
177973
|
+
path46.style.fill = handleColor;
|
|
177936
177974
|
}
|
|
177937
|
-
sliderGroup.add(handles[handleIndex] =
|
|
177975
|
+
sliderGroup.add(handles[handleIndex] = path46);
|
|
177938
177976
|
var textStyleModel = dataZoomModel.getModel("textStyle");
|
|
177939
177977
|
var handleLabel = dataZoomModel.get("handleLabel") || {};
|
|
177940
177978
|
var handleLabelShow = handleLabel.show || false;
|
|
@@ -180954,9 +180992,9 @@ var init_components = __esm({
|
|
|
180954
180992
|
function aroundEqual(a, b) {
|
|
180955
180993
|
return Math.abs(a - b) < 1e-5;
|
|
180956
180994
|
}
|
|
180957
|
-
function pathToBezierCurves(
|
|
180958
|
-
var data =
|
|
180959
|
-
var len2 =
|
|
180995
|
+
function pathToBezierCurves(path46) {
|
|
180996
|
+
var data = path46.data;
|
|
180997
|
+
var len2 = path46.len();
|
|
180960
180998
|
var bezierArrayGroups = [];
|
|
180961
180999
|
var currentSubpath;
|
|
180962
181000
|
var xi = 0;
|
|
@@ -181117,8 +181155,8 @@ function adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, out2, scale4) {
|
|
|
181117
181155
|
adpativeBezier(tmpSegX[0], tmpSegY[0], tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], tmpSegX[3], tmpSegY[3], out2, scale4);
|
|
181118
181156
|
adpativeBezier(tmpSegX[4], tmpSegY[4], tmpSegX[5], tmpSegY[5], tmpSegX[6], tmpSegY[6], tmpSegX[7], tmpSegY[7], out2, scale4);
|
|
181119
181157
|
}
|
|
181120
|
-
function pathToPolygons(
|
|
181121
|
-
var bezierArrayGroups = pathToBezierCurves(
|
|
181158
|
+
function pathToPolygons(path46, scale4) {
|
|
181159
|
+
var bezierArrayGroups = pathToBezierCurves(path46);
|
|
181122
181160
|
var polygons = [];
|
|
181123
181161
|
scale4 = scale4 || 1;
|
|
181124
181162
|
for (var i = 0; i < bezierArrayGroups.length; i++) {
|
|
@@ -181350,10 +181388,10 @@ function binaryDivideRecursive(divider, shape, count2, out2) {
|
|
|
181350
181388
|
}
|
|
181351
181389
|
return out2;
|
|
181352
181390
|
}
|
|
181353
|
-
function clone6(
|
|
181391
|
+
function clone6(path46, count2) {
|
|
181354
181392
|
var paths = [];
|
|
181355
181393
|
for (var i = 0; i < count2; i++) {
|
|
181356
|
-
paths.push(clonePath(
|
|
181394
|
+
paths.push(clonePath(path46));
|
|
181357
181395
|
}
|
|
181358
181396
|
return paths;
|
|
181359
181397
|
}
|
|
@@ -181370,11 +181408,11 @@ function polygonConvert(points4) {
|
|
|
181370
181408
|
}
|
|
181371
181409
|
return out2;
|
|
181372
181410
|
}
|
|
181373
|
-
function split(
|
|
181411
|
+
function split(path46, count2) {
|
|
181374
181412
|
var outShapes = [];
|
|
181375
|
-
var shape =
|
|
181413
|
+
var shape = path46.shape;
|
|
181376
181414
|
var OutShapeCtor;
|
|
181377
|
-
switch (
|
|
181415
|
+
switch (path46.type) {
|
|
181378
181416
|
case "rect":
|
|
181379
181417
|
divideRect(shape, count2, outShapes);
|
|
181380
181418
|
OutShapeCtor = Rect_default;
|
|
@@ -181395,9 +181433,9 @@ function split(path45, count2) {
|
|
|
181395
181433
|
OutShapeCtor = Sector_default;
|
|
181396
181434
|
break;
|
|
181397
181435
|
default:
|
|
181398
|
-
var m2 =
|
|
181436
|
+
var m2 = path46.getComputedTransform();
|
|
181399
181437
|
var scale4 = m2 ? Math.sqrt(Math.max(m2[0] * m2[0] + m2[1] * m2[1], m2[2] * m2[2] + m2[3] * m2[3])) : 1;
|
|
181400
|
-
var polygons = map2(pathToPolygons(
|
|
181438
|
+
var polygons = map2(pathToPolygons(path46.getUpdatedPathProxy(), scale4), function(poly) {
|
|
181401
181439
|
return polygonConvert(poly);
|
|
181402
181440
|
});
|
|
181403
181441
|
var polygonCount = polygons.length;
|
|
@@ -181445,13 +181483,13 @@ function split(path45, count2) {
|
|
|
181445
181483
|
break;
|
|
181446
181484
|
}
|
|
181447
181485
|
if (!OutShapeCtor) {
|
|
181448
|
-
return clone6(
|
|
181486
|
+
return clone6(path46, count2);
|
|
181449
181487
|
}
|
|
181450
181488
|
var out2 = [];
|
|
181451
181489
|
for (var i = 0; i < outShapes.length; i++) {
|
|
181452
181490
|
var subPath = new OutShapeCtor();
|
|
181453
181491
|
subPath.setShape(outShapes[i]);
|
|
181454
|
-
copyPathProps(
|
|
181492
|
+
copyPathProps(path46, subPath);
|
|
181455
181493
|
out2.push(subPath);
|
|
181456
181494
|
}
|
|
181457
181495
|
return out2;
|
|
@@ -181681,8 +181719,8 @@ function findBestMorphingRotation(fromArr, toArr2, searchAngleIteration, searchA
|
|
|
181681
181719
|
}
|
|
181682
181720
|
return result;
|
|
181683
181721
|
}
|
|
181684
|
-
function isCombineMorphing(
|
|
181685
|
-
return
|
|
181722
|
+
function isCombineMorphing(path46) {
|
|
181723
|
+
return path46.__isCombineMorphing;
|
|
181686
181724
|
}
|
|
181687
181725
|
function saveAndModifyMethod(obj, methodName, modifiers) {
|
|
181688
181726
|
var savedMethodName = SAVED_METHOD_PREFIX + methodName;
|
|
@@ -181739,7 +181777,7 @@ function prepareMorphPath(fromPath, toPath) {
|
|
|
181739
181777
|
toPath.transform = null;
|
|
181740
181778
|
var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);
|
|
181741
181779
|
var tmpArr2 = [];
|
|
181742
|
-
saveAndModifyMethod(toPath, "buildPath", { replace: function(
|
|
181780
|
+
saveAndModifyMethod(toPath, "buildPath", { replace: function(path46) {
|
|
181743
181781
|
var t = toPath.__morphT;
|
|
181744
181782
|
var onet = 1 - t;
|
|
181745
181783
|
var newCp = [];
|
|
@@ -181765,7 +181803,7 @@ function prepareMorphPath(fromPath, toPath) {
|
|
|
181765
181803
|
}
|
|
181766
181804
|
var x0 = tmpArr2[0];
|
|
181767
181805
|
var y0 = tmpArr2[1];
|
|
181768
|
-
|
|
181806
|
+
path46.moveTo(x0, y0);
|
|
181769
181807
|
for (var m2 = 2; m2 < from.length; ) {
|
|
181770
181808
|
var x1 = tmpArr2[m2++];
|
|
181771
181809
|
var y1 = tmpArr2[m2++];
|
|
@@ -181774,9 +181812,9 @@ function prepareMorphPath(fromPath, toPath) {
|
|
|
181774
181812
|
var x3 = tmpArr2[m2++];
|
|
181775
181813
|
var y3 = tmpArr2[m2++];
|
|
181776
181814
|
if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) {
|
|
181777
|
-
|
|
181815
|
+
path46.lineTo(x3, y3);
|
|
181778
181816
|
} else {
|
|
181779
|
-
|
|
181817
|
+
path46.bezierCurveTo(x1, y1, x2, y2, x3, y3);
|
|
181780
181818
|
}
|
|
181781
181819
|
x0 = x3;
|
|
181782
181820
|
y0 = y3;
|
|
@@ -181846,9 +181884,9 @@ function sortPaths(pathList) {
|
|
|
181846
181884
|
var yMin = Infinity;
|
|
181847
181885
|
var xMax = -Infinity;
|
|
181848
181886
|
var yMax = -Infinity;
|
|
181849
|
-
var cps = map2(pathList, function(
|
|
181850
|
-
var rect =
|
|
181851
|
-
var m2 =
|
|
181887
|
+
var cps = map2(pathList, function(path46) {
|
|
181888
|
+
var rect = path46.getBoundingRect();
|
|
181889
|
+
var m2 = path46.getComputedTransform();
|
|
181852
181890
|
var x = rect.x + rect.width / 2 + (m2 ? m2[4] : 0);
|
|
181853
181891
|
var y = rect.y + rect.height / 2 + (m2 ? m2[5] : 0);
|
|
181854
181892
|
xMin = Math.min(x, xMin);
|
|
@@ -183870,6 +183908,7 @@ This link expires at ${new Date(
|
|
|
183870
183908
|
...authHeader !== void 0 ? { authHeader } : {},
|
|
183871
183909
|
...typedArgs?.tabId !== void 0 ? { tabId: typedArgs.tabId } : {},
|
|
183872
183910
|
...typedArgs?.loadAllRows !== void 0 ? { loadAllRows: typedArgs.loadAllRows } : {},
|
|
183911
|
+
...isHumanOrigin(origin2) && typeof typedArgs?.workspaceRoot === "string" ? { workspaceRoot: typedArgs.workspaceRoot } : {},
|
|
183873
183912
|
...!isHumanOrigin(origin2) && safeModeActive ? { enforceReadOnly: true } : {},
|
|
183874
183913
|
waitForResult,
|
|
183875
183914
|
clientConsent
|
|
@@ -183976,13 +184015,25 @@ This link expires at ${new Date(
|
|
|
183976
184015
|
};
|
|
183977
184016
|
}
|
|
183978
184017
|
async handleLedgerStats(clientConsent) {
|
|
183979
|
-
if (!this.ledger)
|
|
184018
|
+
if (!this.ledger) {
|
|
184019
|
+
this.options.telemetry?.capture(
|
|
184020
|
+
"ledger_health",
|
|
184021
|
+
{
|
|
184022
|
+
state: "daemon",
|
|
184023
|
+
outcome: "disabled",
|
|
184024
|
+
entries_bucket: "0",
|
|
184025
|
+
write_failures_bucket: "0"
|
|
184026
|
+
},
|
|
184027
|
+
clientConsent
|
|
184028
|
+
);
|
|
183980
184029
|
return textToolResult("Ledger disabled.");
|
|
184030
|
+
}
|
|
183981
184031
|
const stats = await this.ledger.stats();
|
|
183982
184032
|
this.options.telemetry?.capture(
|
|
183983
184033
|
"ledger_health",
|
|
183984
184034
|
{
|
|
183985
184035
|
state: "daemon",
|
|
184036
|
+
outcome: "enabled",
|
|
183986
184037
|
entries_bucket: bucketRowCount(stats.persisted_entries),
|
|
183987
184038
|
write_failures_bucket: bucketRowCount(stats.write_failures)
|
|
183988
184039
|
},
|
|
@@ -183991,8 +184042,19 @@ This link expires at ${new Date(
|
|
|
183991
184042
|
return { content: [{ type: "text", text: JSON.stringify(stats) }], structuredContent: stats };
|
|
183992
184043
|
}
|
|
183993
184044
|
async handleVerifyLedger(clientConsent) {
|
|
183994
|
-
if (!this.ledger)
|
|
184045
|
+
if (!this.ledger) {
|
|
184046
|
+
this.options.telemetry?.capture(
|
|
184047
|
+
"ledger_verify_completed",
|
|
184048
|
+
{
|
|
184049
|
+
state: "daemon",
|
|
184050
|
+
outcome: "disabled",
|
|
184051
|
+
entries_checked_bucket: "0",
|
|
184052
|
+
duration_bucket: "<100ms"
|
|
184053
|
+
},
|
|
184054
|
+
clientConsent
|
|
184055
|
+
);
|
|
183995
184056
|
return textToolResult("Ledger disabled.");
|
|
184057
|
+
}
|
|
183996
184058
|
const startedAt = Date.now();
|
|
183997
184059
|
const result = await verifyLedger(this.ledger);
|
|
183998
184060
|
this.options.telemetry?.capture(
|
|
@@ -184213,7 +184275,7 @@ var init_SubProcessConnectorClient = __esm({
|
|
|
184213
184275
|
let abortKillTimeout;
|
|
184214
184276
|
let errorOutput = "";
|
|
184215
184277
|
let stderrTruncated = false;
|
|
184216
|
-
const closePromise = new Promise((
|
|
184278
|
+
const closePromise = new Promise((resolve11, reject) => {
|
|
184217
184279
|
child.once("close", (code) => {
|
|
184218
184280
|
childClosed = true;
|
|
184219
184281
|
if (abortKillTimeout) {
|
|
@@ -184227,7 +184289,7 @@ var init_SubProcessConnectorClient = __esm({
|
|
|
184227
184289
|
)
|
|
184228
184290
|
);
|
|
184229
184291
|
} else {
|
|
184230
|
-
|
|
184292
|
+
resolve11();
|
|
184231
184293
|
}
|
|
184232
184294
|
});
|
|
184233
184295
|
child.once("error", (err) => {
|
|
@@ -184373,13 +184435,13 @@ var init_LongLivedConnectorClient = __esm({
|
|
|
184373
184435
|
}
|
|
184374
184436
|
});
|
|
184375
184437
|
const initPromise = this.sendRequest("initialize", { config: config2, auth: auth2 });
|
|
184376
|
-
return new Promise((
|
|
184438
|
+
return new Promise((resolve11, reject) => {
|
|
184377
184439
|
const onError = (err) => reject(new import_connector_api11.ConnectionError(`Failed to initialize: ${err.message}`));
|
|
184378
184440
|
this.child.once("error", onError);
|
|
184379
184441
|
this.child.once("close", () => reject(new import_connector_api11.ConnectionError("Process closed before init")));
|
|
184380
184442
|
initPromise.then(() => {
|
|
184381
184443
|
this.child.removeListener("error", onError);
|
|
184382
|
-
|
|
184444
|
+
resolve11();
|
|
184383
184445
|
}).catch(reject);
|
|
184384
184446
|
});
|
|
184385
184447
|
}
|
|
@@ -184429,8 +184491,8 @@ var init_LongLivedConnectorClient = __esm({
|
|
|
184429
184491
|
method,
|
|
184430
184492
|
params
|
|
184431
184493
|
};
|
|
184432
|
-
const promise2 = new Promise((
|
|
184433
|
-
this.pendingRequests.set(id, { resolve:
|
|
184494
|
+
const promise2 = new Promise((resolve11, reject) => {
|
|
184495
|
+
this.pendingRequests.set(id, { resolve: resolve11, reject });
|
|
184434
184496
|
});
|
|
184435
184497
|
this.child.stdin.write(JSON.stringify(req) + "\n");
|
|
184436
184498
|
return promise2;
|
|
@@ -184486,8 +184548,8 @@ var init_LongLivedConnectorClient = __esm({
|
|
|
184486
184548
|
} else if (state.done) {
|
|
184487
184549
|
break;
|
|
184488
184550
|
} else {
|
|
184489
|
-
await new Promise((
|
|
184490
|
-
state.resolve =
|
|
184551
|
+
await new Promise((resolve11) => {
|
|
184552
|
+
state.resolve = resolve11;
|
|
184491
184553
|
});
|
|
184492
184554
|
state.resolve = void 0;
|
|
184493
184555
|
}
|
|
@@ -184664,10 +184726,11 @@ var init_ConnectorProcessPool = __esm({
|
|
|
184664
184726
|
});
|
|
184665
184727
|
|
|
184666
184728
|
// src/server/DaemonQueryExecutor.ts
|
|
184667
|
-
var DaemonQueryExecutor;
|
|
184729
|
+
var path32, DaemonQueryExecutor;
|
|
184668
184730
|
var init_DaemonQueryExecutor = __esm({
|
|
184669
184731
|
"src/server/DaemonQueryExecutor.ts"() {
|
|
184670
184732
|
"use strict";
|
|
184733
|
+
path32 = __toESM(require("path"));
|
|
184671
184734
|
init_routing();
|
|
184672
184735
|
init_authHeaders();
|
|
184673
184736
|
init_errors4();
|
|
@@ -184796,7 +184859,7 @@ var init_DaemonQueryExecutor = __esm({
|
|
|
184796
184859
|
* Resolves the exact profile the executor will use. The policy gate calls this
|
|
184797
184860
|
* before classification so dialect selection and execution cannot diverge.
|
|
184798
184861
|
*/
|
|
184799
|
-
async resolveProfile(query, connectionId, connectionOverride, clientConsent) {
|
|
184862
|
+
async resolveProfile(query, connectionId, connectionOverride, clientConsent, workspaceRoot) {
|
|
184800
184863
|
let profile;
|
|
184801
184864
|
if (connectionOverride) {
|
|
184802
184865
|
profile = connectionOverride;
|
|
@@ -184824,7 +184887,7 @@ var init_DaemonQueryExecutor = __esm({
|
|
|
184824
184887
|
id: "adhoc-sqlite",
|
|
184825
184888
|
name: "Adhoc SQLite",
|
|
184826
184889
|
type: "sqlite",
|
|
184827
|
-
databasePath
|
|
184890
|
+
databasePath: workspaceRoot && databasePath && !path32.isAbsolute(databasePath) ? path32.resolve(workspaceRoot, databasePath) : databasePath
|
|
184828
184891
|
};
|
|
184829
184892
|
} catch (e2) {
|
|
184830
184893
|
this.logger.error("SQLite connector failed during auto-routing", e2);
|
|
@@ -184852,7 +184915,7 @@ var init_DaemonQueryExecutor = __esm({
|
|
|
184852
184915
|
name: "Adhoc DuckDB",
|
|
184853
184916
|
type: "duckdb",
|
|
184854
184917
|
databasePath: ":memory:",
|
|
184855
|
-
|
|
184918
|
+
...workspaceRoot ? { fileSearchPath: workspaceRoot } : {},
|
|
184856
184919
|
sslVerify: true
|
|
184857
184920
|
};
|
|
184858
184921
|
} catch (e2) {
|
|
@@ -184879,13 +184942,14 @@ var init_DaemonQueryExecutor = __esm({
|
|
|
184879
184942
|
return profile;
|
|
184880
184943
|
}
|
|
184881
184944
|
/** Orchestrates query execution after resolving its connector profile. */
|
|
184882
|
-
async *execute(query, sessionId, connectionId, abortSignal, connectionOverride, authHeaderOverride, maxRowsOverride, hooks, clientConsent) {
|
|
184945
|
+
async *execute(query, sessionId, connectionId, abortSignal, connectionOverride, authHeaderOverride, maxRowsOverride, hooks, clientConsent, workspaceRoot) {
|
|
184883
184946
|
this.logger.info(`Starting query execution for session ${sessionId}`, { query });
|
|
184884
184947
|
const profile = await this.resolveProfile(
|
|
184885
184948
|
query,
|
|
184886
184949
|
connectionId,
|
|
184887
184950
|
connectionOverride,
|
|
184888
|
-
clientConsent
|
|
184951
|
+
clientConsent,
|
|
184952
|
+
workspaceRoot
|
|
184889
184953
|
);
|
|
184890
184954
|
if (!profile) {
|
|
184891
184955
|
this.logger.error("No valid connection profile found.");
|
|
@@ -185063,8 +185127,8 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? (0, import_pat
|
|
|
185063
185127
|
return decodedFile;
|
|
185064
185128
|
};
|
|
185065
185129
|
}
|
|
185066
|
-
function normalizeWindowsPath(
|
|
185067
|
-
return
|
|
185130
|
+
function normalizeWindowsPath(path46) {
|
|
185131
|
+
return path46.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
185068
185132
|
}
|
|
185069
185133
|
var import_path9;
|
|
185070
185134
|
var init_module_node = __esm({
|
|
@@ -188810,15 +188874,15 @@ async function addSourceContext(frames) {
|
|
|
188810
188874
|
LRU_FILE_CONTENTS_CACHE.reduce();
|
|
188811
188875
|
return frames;
|
|
188812
188876
|
}
|
|
188813
|
-
function getContextLinesFromFile(
|
|
188814
|
-
return new Promise((
|
|
188815
|
-
const stream4 = (0, import_node_fs.createReadStream)(
|
|
188877
|
+
function getContextLinesFromFile(path46, ranges, output) {
|
|
188878
|
+
return new Promise((resolve11) => {
|
|
188879
|
+
const stream4 = (0, import_node_fs.createReadStream)(path46);
|
|
188816
188880
|
const lineReaded = (0, import_node_readline.createInterface)({
|
|
188817
188881
|
input: stream4
|
|
188818
188882
|
});
|
|
188819
188883
|
function destroyStreamAndResolve() {
|
|
188820
188884
|
stream4.destroy();
|
|
188821
|
-
|
|
188885
|
+
resolve11();
|
|
188822
188886
|
}
|
|
188823
188887
|
let lineNumber = 0;
|
|
188824
188888
|
let currentRangeIndex = 0;
|
|
@@ -188828,7 +188892,7 @@ function getContextLinesFromFile(path45, ranges, output) {
|
|
|
188828
188892
|
let rangeStart = range[0];
|
|
188829
188893
|
let rangeEnd = range[1];
|
|
188830
188894
|
function onStreamError() {
|
|
188831
|
-
LRU_FILE_CONTENTS_FS_READ_FAILED.set(
|
|
188895
|
+
LRU_FILE_CONTENTS_FS_READ_FAILED.set(path46, 1);
|
|
188832
188896
|
lineReaded.close();
|
|
188833
188897
|
lineReaded.removeAllListeners();
|
|
188834
188898
|
destroyStreamAndResolve();
|
|
@@ -188896,8 +188960,8 @@ function clearLineContext(frame) {
|
|
|
188896
188960
|
delete frame.context_line;
|
|
188897
188961
|
delete frame.post_context;
|
|
188898
188962
|
}
|
|
188899
|
-
function shouldSkipContextLinesForFile(
|
|
188900
|
-
return
|
|
188963
|
+
function shouldSkipContextLinesForFile(path46) {
|
|
188964
|
+
return path46.startsWith("node:") || path46.endsWith(".min.js") || path46.endsWith(".min.cjs") || path46.endsWith(".min.mjs") || path46.startsWith("data:");
|
|
188901
188965
|
}
|
|
188902
188966
|
function shouldSkipContextLinesForFrame(frame) {
|
|
188903
188967
|
if (void 0 !== frame.lineno && frame.lineno > MAX_CONTEXTLINES_LINENO)
|
|
@@ -190430,7 +190494,7 @@ var init_sender = __esm({
|
|
|
190430
190494
|
this.fetchFn = hooks.fetch;
|
|
190431
190495
|
this.onError = hooks.onError;
|
|
190432
190496
|
this.now = hooks.now ?? Date.now;
|
|
190433
|
-
this.sleep = hooks.sleep ?? ((ms) => new Promise((
|
|
190497
|
+
this.sleep = hooks.sleep ?? ((ms) => new Promise((resolve11) => safeSetTimeout(resolve11, ms)));
|
|
190434
190498
|
this.generateRequestId = hooks.generateRequestId ?? uuidv72;
|
|
190435
190499
|
this.compress = hooks.compress ?? gzipCompress;
|
|
190436
190500
|
}
|
|
@@ -190742,9 +190806,9 @@ var init_client = __esm({
|
|
|
190742
190806
|
if (this.disabled || this.optedOut)
|
|
190743
190807
|
return;
|
|
190744
190808
|
if (!this._waitUntilCycle) {
|
|
190745
|
-
let
|
|
190809
|
+
let resolve11;
|
|
190746
190810
|
const promise2 = new Promise((r) => {
|
|
190747
|
-
|
|
190811
|
+
resolve11 = r;
|
|
190748
190812
|
});
|
|
190749
190813
|
try {
|
|
190750
190814
|
waitUntil(promise2);
|
|
@@ -190752,7 +190816,7 @@ var init_client = __esm({
|
|
|
190752
190816
|
return;
|
|
190753
190817
|
}
|
|
190754
190818
|
this._waitUntilCycle = {
|
|
190755
|
-
resolve:
|
|
190819
|
+
resolve: resolve11,
|
|
190756
190820
|
startedAt: Date.now(),
|
|
190757
190821
|
timer: void 0
|
|
190758
190822
|
};
|
|
@@ -190778,12 +190842,12 @@ var init_client = __esm({
|
|
|
190778
190842
|
return cycle?.resolve;
|
|
190779
190843
|
}
|
|
190780
190844
|
async resolveWaitUntilFlush() {
|
|
190781
|
-
const
|
|
190845
|
+
const resolve11 = this._consumeWaitUntilCycle();
|
|
190782
190846
|
try {
|
|
190783
190847
|
await this.flushWithPendingPromises();
|
|
190784
190848
|
} catch {
|
|
190785
190849
|
} finally {
|
|
190786
|
-
|
|
190850
|
+
resolve11?.();
|
|
190787
190851
|
}
|
|
190788
190852
|
}
|
|
190789
190853
|
getPersistedProperty(key) {
|
|
@@ -190996,15 +191060,15 @@ var init_client = __esm({
|
|
|
190996
191060
|
return true;
|
|
190997
191061
|
if (void 0 === this.featureFlagsPoller)
|
|
190998
191062
|
return false;
|
|
190999
|
-
return new Promise((
|
|
191063
|
+
return new Promise((resolve11) => {
|
|
191000
191064
|
const timeout = setTimeout(() => {
|
|
191001
191065
|
cleanup();
|
|
191002
|
-
|
|
191066
|
+
resolve11(false);
|
|
191003
191067
|
}, timeoutMs);
|
|
191004
191068
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
191005
191069
|
clearTimeout(timeout);
|
|
191006
191070
|
cleanup();
|
|
191007
|
-
|
|
191071
|
+
resolve11(count2 > 0);
|
|
191008
191072
|
});
|
|
191009
191073
|
});
|
|
191010
191074
|
}
|
|
@@ -191548,14 +191612,14 @@ var init_client = __esm({
|
|
|
191548
191612
|
}
|
|
191549
191613
|
async _shutdown(shutdownTimeoutMs) {
|
|
191550
191614
|
const shutdownDeadlineMs = Date.now() + (shutdownTimeoutMs ?? 3e4);
|
|
191551
|
-
const
|
|
191615
|
+
const resolve11 = this._consumeWaitUntilCycle();
|
|
191552
191616
|
await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
|
|
191553
191617
|
this.errorTracking.shutdown();
|
|
191554
191618
|
if (this._metrics) {
|
|
191555
191619
|
await Promise.race([
|
|
191556
191620
|
this._metrics.flush().catch(() => {
|
|
191557
191621
|
}),
|
|
191558
|
-
new Promise((
|
|
191622
|
+
new Promise((resolve12) => safeSetTimeout(resolve12, Math.max(0, shutdownDeadlineMs - Date.now())))
|
|
191559
191623
|
]);
|
|
191560
191624
|
this._metrics.reset();
|
|
191561
191625
|
}
|
|
@@ -191563,7 +191627,7 @@ var init_client = __esm({
|
|
|
191563
191627
|
return await super._shutdown(Math.max(0, shutdownDeadlineMs - Date.now()));
|
|
191564
191628
|
} finally {
|
|
191565
191629
|
this.distinctIdHasSentFlagCalls = {};
|
|
191566
|
-
|
|
191630
|
+
resolve11?.();
|
|
191567
191631
|
}
|
|
191568
191632
|
}
|
|
191569
191633
|
async _requestRemoteConfigPayload(flagKey) {
|
|
@@ -192147,8 +192211,8 @@ var init_DiagnosticsReporter = __esm({
|
|
|
192147
192211
|
try {
|
|
192148
192212
|
await Promise.race([
|
|
192149
192213
|
this.client.shutdown(),
|
|
192150
|
-
new Promise((
|
|
192151
|
-
timer = setTimeout(
|
|
192214
|
+
new Promise((resolve11) => {
|
|
192215
|
+
timer = setTimeout(resolve11, timeoutMs);
|
|
192152
192216
|
timer.unref?.();
|
|
192153
192217
|
})
|
|
192154
192218
|
]);
|
|
@@ -192733,21 +192797,21 @@ var init_logRedaction = __esm({
|
|
|
192733
192797
|
// src/server/surfaces/distFiles.ts
|
|
192734
192798
|
function distFileCandidates(fileName, baseDir = __dirname) {
|
|
192735
192799
|
return [
|
|
192736
|
-
|
|
192737
|
-
|
|
192738
|
-
|
|
192800
|
+
path33.join(baseDir, "dist", fileName),
|
|
192801
|
+
path33.join(baseDir, "../../dist", fileName),
|
|
192802
|
+
path33.join(baseDir, "../../../dist", fileName)
|
|
192739
192803
|
];
|
|
192740
192804
|
}
|
|
192741
192805
|
function findDistFile(fileName, baseDir = __dirname) {
|
|
192742
192806
|
const candidates = distFileCandidates(fileName, baseDir);
|
|
192743
192807
|
return candidates.find((candidate) => fs30.existsSync(candidate)) ?? candidates[1] ?? fileName;
|
|
192744
192808
|
}
|
|
192745
|
-
var fs30,
|
|
192809
|
+
var fs30, path33;
|
|
192746
192810
|
var init_distFiles = __esm({
|
|
192747
192811
|
"src/server/surfaces/distFiles.ts"() {
|
|
192748
192812
|
"use strict";
|
|
192749
192813
|
fs30 = __toESM(require("fs"));
|
|
192750
|
-
|
|
192814
|
+
path33 = __toESM(require("path"));
|
|
192751
192815
|
}
|
|
192752
192816
|
});
|
|
192753
192817
|
|
|
@@ -193999,7 +194063,7 @@ var init_dist3 = __esm({
|
|
|
193999
194063
|
});
|
|
194000
194064
|
if (!chunk) {
|
|
194001
194065
|
if (i === 1) {
|
|
194002
|
-
await new Promise((
|
|
194066
|
+
await new Promise((resolve11) => setTimeout(resolve11));
|
|
194003
194067
|
maxReadCount = 3;
|
|
194004
194068
|
continue;
|
|
194005
194069
|
}
|
|
@@ -194596,9 +194660,9 @@ data:
|
|
|
194596
194660
|
const initRequest = messages.find((m2) => isInitializeRequest(m2));
|
|
194597
194661
|
const clientProtocolVersion = initRequest ? initRequest.params.protocolVersion : req.headers.get("mcp-protocol-version") ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION;
|
|
194598
194662
|
if (this._enableJsonResponse) {
|
|
194599
|
-
return new Promise((
|
|
194663
|
+
return new Promise((resolve11) => {
|
|
194600
194664
|
this._streamMapping.set(streamId, {
|
|
194601
|
-
resolveJson:
|
|
194665
|
+
resolveJson: resolve11,
|
|
194602
194666
|
cleanup: () => {
|
|
194603
194667
|
this._streamMapping.delete(streamId);
|
|
194604
194668
|
}
|
|
@@ -196026,7 +196090,7 @@ var init_protocol = __esm({
|
|
|
196026
196090
|
return;
|
|
196027
196091
|
}
|
|
196028
196092
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
196029
|
-
await new Promise((
|
|
196093
|
+
await new Promise((resolve11) => setTimeout(resolve11, pollInterval));
|
|
196030
196094
|
options?.signal?.throwIfAborted();
|
|
196031
196095
|
}
|
|
196032
196096
|
} catch (error52) {
|
|
@@ -196043,7 +196107,7 @@ var init_protocol = __esm({
|
|
|
196043
196107
|
*/
|
|
196044
196108
|
request(request2, resultSchema, options) {
|
|
196045
196109
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
196046
|
-
return new Promise((
|
|
196110
|
+
return new Promise((resolve11, reject) => {
|
|
196047
196111
|
const earlyReject = (error52) => {
|
|
196048
196112
|
reject(error52);
|
|
196049
196113
|
};
|
|
@@ -196121,7 +196185,7 @@ var init_protocol = __esm({
|
|
|
196121
196185
|
if (!parseResult.success) {
|
|
196122
196186
|
reject(parseResult.error);
|
|
196123
196187
|
} else {
|
|
196124
|
-
|
|
196188
|
+
resolve11(parseResult.data);
|
|
196125
196189
|
}
|
|
196126
196190
|
} catch (error52) {
|
|
196127
196191
|
reject(error52);
|
|
@@ -196382,12 +196446,12 @@ var init_protocol = __esm({
|
|
|
196382
196446
|
}
|
|
196383
196447
|
} catch {
|
|
196384
196448
|
}
|
|
196385
|
-
return new Promise((
|
|
196449
|
+
return new Promise((resolve11, reject) => {
|
|
196386
196450
|
if (signal.aborted) {
|
|
196387
196451
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
196388
196452
|
return;
|
|
196389
196453
|
}
|
|
196390
|
-
const timeoutId = setTimeout(
|
|
196454
|
+
const timeoutId = setTimeout(resolve11, interval);
|
|
196391
196455
|
signal.addEventListener("abort", () => {
|
|
196392
196456
|
clearTimeout(timeoutId);
|
|
196393
196457
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -199424,7 +199488,7 @@ var require_compile = __commonJS({
|
|
|
199424
199488
|
const schOrFunc = root.refs[ref];
|
|
199425
199489
|
if (schOrFunc)
|
|
199426
199490
|
return schOrFunc;
|
|
199427
|
-
let _sch =
|
|
199491
|
+
let _sch = resolve11.call(this, root, ref);
|
|
199428
199492
|
if (_sch === void 0) {
|
|
199429
199493
|
const schema = (_a4 = root.localRefs) === null || _a4 === void 0 ? void 0 : _a4[ref];
|
|
199430
199494
|
const { schemaId } = this.opts;
|
|
@@ -199451,7 +199515,7 @@ var require_compile = __commonJS({
|
|
|
199451
199515
|
function sameSchemaEnv(s1, s2) {
|
|
199452
199516
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
199453
199517
|
}
|
|
199454
|
-
function
|
|
199518
|
+
function resolve11(root, ref) {
|
|
199455
199519
|
let sch;
|
|
199456
199520
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
199457
199521
|
ref = sch;
|
|
@@ -199670,8 +199734,8 @@ var require_utils4 = __commonJS({
|
|
|
199670
199734
|
}
|
|
199671
199735
|
return ind;
|
|
199672
199736
|
}
|
|
199673
|
-
function removeDotSegments(
|
|
199674
|
-
let input =
|
|
199737
|
+
function removeDotSegments(path46) {
|
|
199738
|
+
let input = path46;
|
|
199675
199739
|
const output = [];
|
|
199676
199740
|
let nextSlash = -1;
|
|
199677
199741
|
let len2 = 0;
|
|
@@ -199923,8 +199987,8 @@ var require_schemes = __commonJS({
|
|
|
199923
199987
|
wsComponent.secure = void 0;
|
|
199924
199988
|
}
|
|
199925
199989
|
if (wsComponent.resourceName) {
|
|
199926
|
-
const [
|
|
199927
|
-
wsComponent.path =
|
|
199990
|
+
const [path46, query] = wsComponent.resourceName.split("?");
|
|
199991
|
+
wsComponent.path = path46 && path46 !== "/" ? path46 : void 0;
|
|
199928
199992
|
wsComponent.query = query;
|
|
199929
199993
|
wsComponent.resourceName = void 0;
|
|
199930
199994
|
}
|
|
@@ -200083,7 +200147,7 @@ var require_fast_uri = __commonJS({
|
|
|
200083
200147
|
}
|
|
200084
200148
|
return uri;
|
|
200085
200149
|
}
|
|
200086
|
-
function
|
|
200150
|
+
function resolve11(baseURI, relativeURI, options) {
|
|
200087
200151
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
200088
200152
|
const resolved = resolveComponent(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
200089
200153
|
schemelessOptions.skipEscape = true;
|
|
@@ -200342,7 +200406,7 @@ var require_fast_uri = __commonJS({
|
|
|
200342
200406
|
var fastUri = {
|
|
200343
200407
|
SCHEMES,
|
|
200344
200408
|
normalize: normalize5,
|
|
200345
|
-
resolve:
|
|
200409
|
+
resolve: resolve11,
|
|
200346
200410
|
resolveComponent,
|
|
200347
200411
|
equal,
|
|
200348
200412
|
serialize,
|
|
@@ -208847,8 +208911,8 @@ var require_promise = __commonJS({
|
|
|
208847
208911
|
_resolve;
|
|
208848
208912
|
_reject;
|
|
208849
208913
|
constructor() {
|
|
208850
|
-
this._promise = new Promise((
|
|
208851
|
-
this._resolve =
|
|
208914
|
+
this._promise = new Promise((resolve11, reject) => {
|
|
208915
|
+
this._resolve = resolve11;
|
|
208852
208916
|
this._reject = reject;
|
|
208853
208917
|
});
|
|
208854
208918
|
}
|
|
@@ -208944,9 +209008,9 @@ var require_exporter = __commonJS({
|
|
|
208944
209008
|
var api_1 = (init_esm2(), __toCommonJS(esm_exports));
|
|
208945
209009
|
var suppress_tracing_1 = require_suppress_tracing();
|
|
208946
209010
|
function _export(exporter, arg) {
|
|
208947
|
-
return new Promise((
|
|
209011
|
+
return new Promise((resolve11) => {
|
|
208948
209012
|
api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => {
|
|
208949
|
-
exporter.export(arg,
|
|
209013
|
+
exporter.export(arg, resolve11);
|
|
208950
209014
|
});
|
|
208951
209015
|
});
|
|
208952
209016
|
}
|
|
@@ -209781,9 +209845,9 @@ var require_getMachineId_linux = __commonJS({
|
|
|
209781
209845
|
var api_1 = (init_esm2(), __toCommonJS(esm_exports));
|
|
209782
209846
|
async function getMachineId() {
|
|
209783
209847
|
const paths = ["/etc/machine-id", "/var/lib/dbus/machine-id"];
|
|
209784
|
-
for (const
|
|
209848
|
+
for (const path46 of paths) {
|
|
209785
209849
|
try {
|
|
209786
|
-
const result = await fs_1.promises.readFile(
|
|
209850
|
+
const result = await fs_1.promises.readFile(path46, { encoding: "utf8" });
|
|
209787
209851
|
return result.trim();
|
|
209788
209852
|
} catch (e2) {
|
|
209789
209853
|
api_1.diag.debug(`error reading machine id: ${e2}`);
|
|
@@ -210971,8 +211035,8 @@ var require_BatchLogRecordProcessorBase = __commonJS({
|
|
|
210971
211035
|
_exportScheduledPromise;
|
|
210972
211036
|
_exportScheduledResolve;
|
|
210973
211037
|
constructor(exporter, logRecords, exportTimeoutMillis) {
|
|
210974
|
-
this._exportScheduledPromise = new Promise((
|
|
210975
|
-
this._exportScheduledResolve =
|
|
211038
|
+
this._exportScheduledPromise = new Promise((resolve11) => {
|
|
211039
|
+
this._exportScheduledResolve = resolve11;
|
|
210976
211040
|
});
|
|
210977
211041
|
this._exportCompleted = this._executeExport(exporter, logRecords, exportTimeoutMillis);
|
|
210978
211042
|
}
|
|
@@ -210996,14 +211060,14 @@ var require_BatchLogRecordProcessorBase = __commonJS({
|
|
|
210996
211060
|
}
|
|
210997
211061
|
}
|
|
210998
211062
|
async _exportWithTimeout(exporter, logRecords, exportTimeoutMillis) {
|
|
210999
|
-
return new Promise((
|
|
211063
|
+
return new Promise((resolve11, reject) => {
|
|
211000
211064
|
const timer = setTimeout(() => {
|
|
211001
211065
|
reject(new Error("Timeout"));
|
|
211002
211066
|
}, exportTimeoutMillis);
|
|
211003
211067
|
exporter.export(logRecords, (result) => {
|
|
211004
211068
|
clearTimeout(timer);
|
|
211005
211069
|
if (result.code === core_1.ExportResultCode.SUCCESS) {
|
|
211006
|
-
|
|
211070
|
+
resolve11();
|
|
211007
211071
|
} else {
|
|
211008
211072
|
reject(result.error ?? new Error("BatchLogRecordProcessor: log record export failed"));
|
|
211009
211073
|
}
|
|
@@ -215982,14 +216046,14 @@ var require_BatchSpanProcessorBase = __commonJS({
|
|
|
215982
216046
|
* for all other cases _flush should be used
|
|
215983
216047
|
* */
|
|
215984
216048
|
_flushAll() {
|
|
215985
|
-
return new Promise((
|
|
216049
|
+
return new Promise((resolve11, reject) => {
|
|
215986
216050
|
const promises3 = [];
|
|
215987
216051
|
const count2 = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize);
|
|
215988
216052
|
for (let i = 0, j = count2; i < j; i++) {
|
|
215989
216053
|
promises3.push(this._flushOneBatch());
|
|
215990
216054
|
}
|
|
215991
216055
|
Promise.all(promises3).then(() => {
|
|
215992
|
-
|
|
216056
|
+
resolve11();
|
|
215993
216057
|
}).catch(reject);
|
|
215994
216058
|
});
|
|
215995
216059
|
}
|
|
@@ -215998,7 +216062,7 @@ var require_BatchSpanProcessorBase = __commonJS({
|
|
|
215998
216062
|
if (this._finishedSpans.length === 0) {
|
|
215999
216063
|
return Promise.resolve();
|
|
216000
216064
|
}
|
|
216001
|
-
return new Promise((
|
|
216065
|
+
return new Promise((resolve11, reject) => {
|
|
216002
216066
|
const timer = setTimeout(() => {
|
|
216003
216067
|
reject(new Error("Timeout"));
|
|
216004
216068
|
}, this._exportTimeoutMillis);
|
|
@@ -216013,7 +216077,7 @@ var require_BatchSpanProcessorBase = __commonJS({
|
|
|
216013
216077
|
const doExport = () => this._exporter.export(spans, (result) => {
|
|
216014
216078
|
clearTimeout(timer);
|
|
216015
216079
|
if (result.code === core_1.ExportResultCode.SUCCESS) {
|
|
216016
|
-
|
|
216080
|
+
resolve11();
|
|
216017
216081
|
} else {
|
|
216018
216082
|
reject(result.error ?? new Error("BatchSpanProcessor: span export failed"));
|
|
216019
216083
|
}
|
|
@@ -216398,12 +216462,12 @@ var require_MultiSpanProcessor = __commonJS({
|
|
|
216398
216462
|
for (const spanProcessor of this._spanProcessors) {
|
|
216399
216463
|
promises3.push(spanProcessor.forceFlush());
|
|
216400
216464
|
}
|
|
216401
|
-
return new Promise((
|
|
216465
|
+
return new Promise((resolve11) => {
|
|
216402
216466
|
Promise.all(promises3).then(() => {
|
|
216403
|
-
|
|
216467
|
+
resolve11();
|
|
216404
216468
|
}).catch((error52) => {
|
|
216405
216469
|
(0, core_1.globalErrorHandler)(error52 || new Error("MultiSpanProcessor: forceFlush failed"));
|
|
216406
|
-
|
|
216470
|
+
resolve11();
|
|
216407
216471
|
});
|
|
216408
216472
|
});
|
|
216409
216473
|
}
|
|
@@ -216429,9 +216493,9 @@ var require_MultiSpanProcessor = __commonJS({
|
|
|
216429
216493
|
for (const spanProcessor of this._spanProcessors) {
|
|
216430
216494
|
promises3.push(spanProcessor.shutdown());
|
|
216431
216495
|
}
|
|
216432
|
-
return new Promise((
|
|
216496
|
+
return new Promise((resolve11, reject) => {
|
|
216433
216497
|
Promise.all(promises3).then(() => {
|
|
216434
|
-
|
|
216498
|
+
resolve11();
|
|
216435
216499
|
}, reject);
|
|
216436
216500
|
});
|
|
216437
216501
|
}
|
|
@@ -216486,32 +216550,32 @@ var require_BasicTracerProvider = __commonJS({
|
|
|
216486
216550
|
forceFlush() {
|
|
216487
216551
|
const timeout = this._config.forceFlushTimeoutMillis;
|
|
216488
216552
|
const promises3 = this._activeSpanProcessor["_spanProcessors"].map((spanProcessor) => {
|
|
216489
|
-
return new Promise((
|
|
216553
|
+
return new Promise((resolve11) => {
|
|
216490
216554
|
let state;
|
|
216491
216555
|
const timeoutInterval = setTimeout(() => {
|
|
216492
|
-
|
|
216556
|
+
resolve11(new Error(`Span processor did not completed within timeout period of ${timeout} ms`));
|
|
216493
216557
|
state = ForceFlushState.timeout;
|
|
216494
216558
|
}, timeout);
|
|
216495
216559
|
spanProcessor.forceFlush().then(() => {
|
|
216496
216560
|
clearTimeout(timeoutInterval);
|
|
216497
216561
|
if (state !== ForceFlushState.timeout) {
|
|
216498
216562
|
state = ForceFlushState.resolved;
|
|
216499
|
-
|
|
216563
|
+
resolve11(state);
|
|
216500
216564
|
}
|
|
216501
216565
|
}).catch((error52) => {
|
|
216502
216566
|
clearTimeout(timeoutInterval);
|
|
216503
216567
|
state = ForceFlushState.error;
|
|
216504
|
-
|
|
216568
|
+
resolve11(error52);
|
|
216505
216569
|
});
|
|
216506
216570
|
});
|
|
216507
216571
|
});
|
|
216508
|
-
return new Promise((
|
|
216572
|
+
return new Promise((resolve11, reject) => {
|
|
216509
216573
|
Promise.all(promises3).then((results) => {
|
|
216510
216574
|
const errors = results.filter((result) => result !== ForceFlushState.resolved);
|
|
216511
216575
|
if (errors.length > 0) {
|
|
216512
216576
|
reject(errors);
|
|
216513
216577
|
} else {
|
|
216514
|
-
|
|
216578
|
+
resolve11();
|
|
216515
216579
|
}
|
|
216516
216580
|
}).catch((error52) => reject([error52]));
|
|
216517
216581
|
});
|
|
@@ -217572,19 +217636,19 @@ var require_module_details_from_path = __commonJS({
|
|
|
217572
217636
|
basedir += segments[i] + sep7;
|
|
217573
217637
|
}
|
|
217574
217638
|
}
|
|
217575
|
-
var
|
|
217639
|
+
var path46 = "";
|
|
217576
217640
|
var lastSegmentIndex = segments.length - 1;
|
|
217577
217641
|
for (var i2 = index + offset; i2 <= lastSegmentIndex; i2++) {
|
|
217578
217642
|
if (i2 === lastSegmentIndex) {
|
|
217579
|
-
|
|
217643
|
+
path46 += segments[i2];
|
|
217580
217644
|
} else {
|
|
217581
|
-
|
|
217645
|
+
path46 += segments[i2] + sep7;
|
|
217582
217646
|
}
|
|
217583
217647
|
}
|
|
217584
217648
|
return {
|
|
217585
217649
|
name,
|
|
217586
217650
|
basedir,
|
|
217587
|
-
path:
|
|
217651
|
+
path: path46
|
|
217588
217652
|
};
|
|
217589
217653
|
};
|
|
217590
217654
|
}
|
|
@@ -217594,7 +217658,7 @@ var require_module_details_from_path = __commonJS({
|
|
|
217594
217658
|
var require_require_in_the_middle = __commonJS({
|
|
217595
217659
|
"node_modules/require-in-the-middle/index.js"(exports, module2) {
|
|
217596
217660
|
"use strict";
|
|
217597
|
-
var
|
|
217661
|
+
var path46 = require("path");
|
|
217598
217662
|
var Module = require("module");
|
|
217599
217663
|
var debug = require_src()("require-in-the-middle");
|
|
217600
217664
|
var moduleDetailsFromPath = require_module_details_from_path();
|
|
@@ -217740,7 +217804,7 @@ var require_require_in_the_middle = __commonJS({
|
|
|
217740
217804
|
}
|
|
217741
217805
|
moduleName = filename;
|
|
217742
217806
|
} else if (hasWhitelist === true && modules.includes(filename)) {
|
|
217743
|
-
const parsedPath =
|
|
217807
|
+
const parsedPath = path46.parse(filename);
|
|
217744
217808
|
moduleName = parsedPath.name;
|
|
217745
217809
|
basedir = parsedPath.dir;
|
|
217746
217810
|
} else {
|
|
@@ -217778,7 +217842,7 @@ var require_require_in_the_middle = __commonJS({
|
|
|
217778
217842
|
}
|
|
217779
217843
|
if (res !== filename) {
|
|
217780
217844
|
if (internals === true) {
|
|
217781
|
-
moduleName = moduleName +
|
|
217845
|
+
moduleName = moduleName + path46.sep + path46.relative(basedir, filename);
|
|
217782
217846
|
debug("preparing to process require of internal file: %s", moduleName);
|
|
217783
217847
|
} else {
|
|
217784
217848
|
debug("ignoring require of non-main module file: %s", res);
|
|
@@ -217814,8 +217878,8 @@ var require_require_in_the_middle = __commonJS({
|
|
|
217814
217878
|
}
|
|
217815
217879
|
};
|
|
217816
217880
|
function resolveModuleName(stat) {
|
|
217817
|
-
const normalizedPath =
|
|
217818
|
-
return
|
|
217881
|
+
const normalizedPath = path46.sep !== "/" ? stat.path.split(path46.sep).join("/") : stat.path;
|
|
217882
|
+
return path46.posix.join(stat.name, normalizedPath).replace(normalize5, "");
|
|
217819
217883
|
}
|
|
217820
217884
|
}
|
|
217821
217885
|
});
|
|
@@ -217900,7 +217964,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
|
|
|
217900
217964
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
217901
217965
|
exports.RequireInTheMiddleSingleton = void 0;
|
|
217902
217966
|
var require_in_the_middle_1 = require_require_in_the_middle();
|
|
217903
|
-
var
|
|
217967
|
+
var path46 = require("path");
|
|
217904
217968
|
var ModuleNameTrie_1 = require_ModuleNameTrie();
|
|
217905
217969
|
var isMocha = [
|
|
217906
217970
|
"afterEach",
|
|
@@ -217965,7 +218029,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
|
|
|
217965
218029
|
__publicField(RequireInTheMiddleSingleton, "_instance");
|
|
217966
218030
|
exports.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton;
|
|
217967
218031
|
function normalizePathSeparators(moduleNameOrPath) {
|
|
217968
|
-
return
|
|
218032
|
+
return path46.sep !== ModuleNameTrie_1.ModuleNameSeparator ? moduleNameOrPath.split(path46.sep).join(ModuleNameTrie_1.ModuleNameSeparator) : moduleNameOrPath;
|
|
217969
218033
|
}
|
|
217970
218034
|
}
|
|
217971
218035
|
});
|
|
@@ -218026,7 +218090,7 @@ var require_register = __commonJS({
|
|
|
218026
218090
|
// node_modules/import-in-the-middle/index.js
|
|
218027
218091
|
var require_import_in_the_middle = __commonJS({
|
|
218028
218092
|
"node_modules/import-in-the-middle/index.js"(exports, module2) {
|
|
218029
|
-
var
|
|
218093
|
+
var path46 = require("path");
|
|
218030
218094
|
var moduleDetailsFromPath = require_module_details_from_path();
|
|
218031
218095
|
var { fileURLToPath: fileURLToPath2 } = require("url");
|
|
218032
218096
|
var { MessageChannel } = require("worker_threads");
|
|
@@ -218082,8 +218146,8 @@ var require_import_in_the_middle = __commonJS({
|
|
|
218082
218146
|
function waitForAllMessagesAcknowledged() {
|
|
218083
218147
|
const timer = setInterval(() => {
|
|
218084
218148
|
}, 1e3);
|
|
218085
|
-
const promise2 = new Promise((
|
|
218086
|
-
resolveFn =
|
|
218149
|
+
const promise2 = new Promise((resolve11) => {
|
|
218150
|
+
resolveFn = resolve11;
|
|
218087
218151
|
}).then(() => {
|
|
218088
218152
|
clearInterval(timer);
|
|
218089
218153
|
});
|
|
@@ -218147,7 +218211,7 @@ var require_import_in_the_middle = __commonJS({
|
|
|
218147
218211
|
} else if (baseDir.endsWith(specifiers.get(loadUrl)) || isTurbopackSpecifier(specifiers.get(loadUrl), baseDir)) {
|
|
218148
218212
|
callHookFn(hookFn, namespace, name, baseDir);
|
|
218149
218213
|
} else if (internals) {
|
|
218150
|
-
const internalPath = name +
|
|
218214
|
+
const internalPath = name + path46.sep + path46.relative(baseDir, filePath);
|
|
218151
218215
|
callHookFn(hookFn, namespace, internalPath, baseDir);
|
|
218152
218216
|
}
|
|
218153
218217
|
} else if (matchArg === specifier) {
|
|
@@ -218222,7 +218286,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
218222
218286
|
"use strict";
|
|
218223
218287
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
218224
218288
|
exports.InstrumentationBase = void 0;
|
|
218225
|
-
var
|
|
218289
|
+
var path46 = require("path");
|
|
218226
218290
|
var util_1 = require("util");
|
|
218227
218291
|
var semver_1 = require_semver();
|
|
218228
218292
|
var shimmer_1 = require_shimmer();
|
|
@@ -218323,7 +218387,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
218323
218387
|
}
|
|
218324
218388
|
_extractPackageVersion(baseDir) {
|
|
218325
218389
|
try {
|
|
218326
|
-
const json2 = (0, fs_1.readFileSync)(
|
|
218390
|
+
const json2 = (0, fs_1.readFileSync)(path46.join(baseDir, "package.json"), {
|
|
218327
218391
|
encoding: "utf8"
|
|
218328
218392
|
});
|
|
218329
218393
|
const version3 = JSON.parse(json2).version;
|
|
@@ -218365,7 +218429,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
218365
218429
|
return exports2;
|
|
218366
218430
|
}
|
|
218367
218431
|
const files = module3.files ?? [];
|
|
218368
|
-
const normalizedName =
|
|
218432
|
+
const normalizedName = path46.normalize(name);
|
|
218369
218433
|
const supportedFileInstrumentations = files.filter((f) => f.name === normalizedName && isSupported(f.supportedVersions, version3, module3.includePrerelease));
|
|
218370
218434
|
return supportedFileInstrumentations.reduce((patchedExports, file4) => {
|
|
218371
218435
|
file4.moduleExports = patchedExports;
|
|
@@ -218411,8 +218475,8 @@ var require_instrumentation2 = __commonJS({
|
|
|
218411
218475
|
this._warnOnPreloadedModules();
|
|
218412
218476
|
for (const module3 of this._modules) {
|
|
218413
218477
|
const hookFn = (exports2, name, baseDir) => {
|
|
218414
|
-
if (!baseDir &&
|
|
218415
|
-
const parsedPath =
|
|
218478
|
+
if (!baseDir && path46.isAbsolute(name)) {
|
|
218479
|
+
const parsedPath = path46.parse(name);
|
|
218416
218480
|
name = parsedPath.name;
|
|
218417
218481
|
baseDir = parsedPath.dir;
|
|
218418
218482
|
}
|
|
@@ -218421,7 +218485,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
218421
218485
|
const onRequire = (exports2, name, baseDir) => {
|
|
218422
218486
|
return this._onRequire(module3, exports2, name, baseDir);
|
|
218423
218487
|
};
|
|
218424
|
-
const hook =
|
|
218488
|
+
const hook = path46.isAbsolute(module3.name) ? new require_in_the_middle_1.Hook([module3.name], { internals: true }, onRequire) : this._requireInTheMiddleSingleton.register(module3.name, onRequire);
|
|
218425
218489
|
this._hooks.push(hook);
|
|
218426
218490
|
const esmHook = new import_in_the_middle_1.Hook([module3.name], { internals: true }, hookFn);
|
|
218427
218491
|
this._hooks.push(esmHook);
|
|
@@ -219675,7 +219739,7 @@ var require_aspromise = __commonJS({
|
|
|
219675
219739
|
var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true;
|
|
219676
219740
|
while (index < arguments.length)
|
|
219677
219741
|
params[offset++] = arguments[index++];
|
|
219678
|
-
return new Promise(function executor(
|
|
219742
|
+
return new Promise(function executor(resolve11, reject) {
|
|
219679
219743
|
params[offset] = function callback(err) {
|
|
219680
219744
|
if (pending) {
|
|
219681
219745
|
pending = false;
|
|
@@ -219685,7 +219749,7 @@ var require_aspromise = __commonJS({
|
|
|
219685
219749
|
var params2 = new Array(arguments.length - 1), offset2 = 0;
|
|
219686
219750
|
while (offset2 < params2.length)
|
|
219687
219751
|
params2[offset2++] = arguments[offset2];
|
|
219688
|
-
|
|
219752
|
+
resolve11.apply(null, params2);
|
|
219689
219753
|
}
|
|
219690
219754
|
}
|
|
219691
219755
|
};
|
|
@@ -228312,7 +228376,7 @@ var init_version3 = __esm({
|
|
|
228312
228376
|
|
|
228313
228377
|
// node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js
|
|
228314
228378
|
function sendWithHttp(request2, url3, headers, compression, userAgent, agent, data, timeoutMillis) {
|
|
228315
|
-
return new Promise((
|
|
228379
|
+
return new Promise((resolve11) => {
|
|
228316
228380
|
const parsedUrl = new URL(url3);
|
|
228317
228381
|
if (userAgent) {
|
|
228318
228382
|
headers["User-Agent"] = `${userAgent} ${DEFAULT_USER_AGENT}`;
|
|
@@ -228334,7 +228398,7 @@ function sendWithHttp(request2, url3, headers, compression, userAgent, agent, da
|
|
|
228334
228398
|
responseSize += chunk.length;
|
|
228335
228399
|
if (responseSize > MAX_RESPONSE_BODY_SIZE) {
|
|
228336
228400
|
const sizeError = new Error(`OTLP export response body exceeded size limit of ${MAX_RESPONSE_BODY_SIZE} bytes`);
|
|
228337
|
-
|
|
228401
|
+
resolve11({ status: "failure", error: sizeError });
|
|
228338
228402
|
res.destroy();
|
|
228339
228403
|
return;
|
|
228340
228404
|
}
|
|
@@ -228342,18 +228406,18 @@ function sendWithHttp(request2, url3, headers, compression, userAgent, agent, da
|
|
|
228342
228406
|
});
|
|
228343
228407
|
res.on("end", () => {
|
|
228344
228408
|
if (res.statusCode && res.statusCode <= 299) {
|
|
228345
|
-
|
|
228409
|
+
resolve11({
|
|
228346
228410
|
status: "success",
|
|
228347
228411
|
data: Buffer.concat(responseData)
|
|
228348
228412
|
});
|
|
228349
228413
|
} else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
|
|
228350
|
-
|
|
228414
|
+
resolve11({
|
|
228351
228415
|
status: "retryable",
|
|
228352
228416
|
retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
|
|
228353
228417
|
});
|
|
228354
228418
|
} else {
|
|
228355
228419
|
const error52 = new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString());
|
|
228356
|
-
|
|
228420
|
+
resolve11({
|
|
228357
228421
|
status: "failure",
|
|
228358
228422
|
error: error52
|
|
228359
228423
|
});
|
|
@@ -228361,17 +228425,17 @@ function sendWithHttp(request2, url3, headers, compression, userAgent, agent, da
|
|
|
228361
228425
|
});
|
|
228362
228426
|
res.on("error", (error52) => {
|
|
228363
228427
|
if (res.statusCode && res.statusCode <= 299) {
|
|
228364
|
-
|
|
228428
|
+
resolve11({
|
|
228365
228429
|
status: "success"
|
|
228366
228430
|
});
|
|
228367
228431
|
} else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) {
|
|
228368
|
-
|
|
228432
|
+
resolve11({
|
|
228369
228433
|
status: "retryable",
|
|
228370
228434
|
error: error52,
|
|
228371
228435
|
retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
|
|
228372
228436
|
});
|
|
228373
228437
|
} else {
|
|
228374
|
-
|
|
228438
|
+
resolve11({
|
|
228375
228439
|
status: "failure",
|
|
228376
228440
|
error: error52
|
|
228377
228441
|
});
|
|
@@ -228380,26 +228444,26 @@ function sendWithHttp(request2, url3, headers, compression, userAgent, agent, da
|
|
|
228380
228444
|
});
|
|
228381
228445
|
req.setTimeout(timeoutMillis, () => {
|
|
228382
228446
|
req.destroy();
|
|
228383
|
-
|
|
228447
|
+
resolve11({
|
|
228384
228448
|
status: "retryable",
|
|
228385
228449
|
error: new Error("Request timed out")
|
|
228386
228450
|
});
|
|
228387
228451
|
});
|
|
228388
228452
|
req.on("error", (error52) => {
|
|
228389
228453
|
if (isHttpTransportNetworkErrorRetryable(error52)) {
|
|
228390
|
-
|
|
228454
|
+
resolve11({
|
|
228391
228455
|
status: "retryable",
|
|
228392
228456
|
error: error52
|
|
228393
228457
|
});
|
|
228394
228458
|
} else {
|
|
228395
|
-
|
|
228459
|
+
resolve11({
|
|
228396
228460
|
status: "failure",
|
|
228397
228461
|
error: error52
|
|
228398
228462
|
});
|
|
228399
228463
|
}
|
|
228400
228464
|
});
|
|
228401
228465
|
compressAndSend(req, compression, data, (error52) => {
|
|
228402
|
-
|
|
228466
|
+
resolve11({
|
|
228403
228467
|
status: "failure",
|
|
228404
228468
|
error: error52
|
|
228405
228469
|
});
|
|
@@ -228513,9 +228577,9 @@ var init_retrying_transport = __esm({
|
|
|
228513
228577
|
this._transport = transport;
|
|
228514
228578
|
}
|
|
228515
228579
|
retry(data, timeoutMillis, inMillis) {
|
|
228516
|
-
return new Promise((
|
|
228580
|
+
return new Promise((resolve11, reject) => {
|
|
228517
228581
|
setTimeout(() => {
|
|
228518
|
-
this._transport.send(data, timeoutMillis).then(
|
|
228582
|
+
this._transport.send(data, timeoutMillis).then(resolve11, reject);
|
|
228519
228583
|
}, inMillis);
|
|
228520
228584
|
});
|
|
228521
228585
|
}
|
|
@@ -228635,7 +228699,7 @@ function appendRootPathToUrlIfNeeded(url3) {
|
|
|
228635
228699
|
return void 0;
|
|
228636
228700
|
}
|
|
228637
228701
|
}
|
|
228638
|
-
function appendResourcePathToUrl(url3,
|
|
228702
|
+
function appendResourcePathToUrl(url3, path46) {
|
|
228639
228703
|
try {
|
|
228640
228704
|
new URL(url3);
|
|
228641
228705
|
} catch {
|
|
@@ -228645,11 +228709,11 @@ function appendResourcePathToUrl(url3, path45) {
|
|
|
228645
228709
|
if (!url3.endsWith("/")) {
|
|
228646
228710
|
url3 = url3 + "/";
|
|
228647
228711
|
}
|
|
228648
|
-
url3 +=
|
|
228712
|
+
url3 += path46;
|
|
228649
228713
|
try {
|
|
228650
228714
|
new URL(url3);
|
|
228651
228715
|
} catch {
|
|
228652
|
-
diag2.warn(`Configuration: Provided URL appended with '${
|
|
228716
|
+
diag2.warn(`Configuration: Provided URL appended with '${path46}' is not a valid URL, using 'undefined' instead of '${url3}'`);
|
|
228653
228717
|
return void 0;
|
|
228654
228718
|
}
|
|
228655
228719
|
return url3;
|
|
@@ -228674,7 +228738,7 @@ function readFileFromEnv(signalSpecificEnvVar, nonSignalSpecificEnvVar, warningM
|
|
|
228674
228738
|
const filePath = signalSpecificPath ?? nonSignalSpecificPath;
|
|
228675
228739
|
if (filePath != null) {
|
|
228676
228740
|
try {
|
|
228677
|
-
return fs32.readFileSync(
|
|
228741
|
+
return fs32.readFileSync(path34.resolve(process.cwd(), filePath));
|
|
228678
228742
|
} catch {
|
|
228679
228743
|
diag2.warn(warningMessage);
|
|
228680
228744
|
return void 0;
|
|
@@ -228705,11 +228769,11 @@ function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourc
|
|
|
228705
228769
|
})
|
|
228706
228770
|
};
|
|
228707
228771
|
}
|
|
228708
|
-
var fs32,
|
|
228772
|
+
var fs32, path34, import_core24;
|
|
228709
228773
|
var init_otlp_node_http_env_configuration = __esm({
|
|
228710
228774
|
"node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-env-configuration.js"() {
|
|
228711
228775
|
fs32 = __toESM(require("fs"));
|
|
228712
|
-
|
|
228776
|
+
path34 = __toESM(require("path"));
|
|
228713
228777
|
import_core24 = __toESM(require_src2());
|
|
228714
228778
|
init_esm2();
|
|
228715
228779
|
init_shared_env_configuration();
|
|
@@ -229213,7 +229277,7 @@ var require_PrometheusExporter = __commonJS({
|
|
|
229213
229277
|
api_1.diag.debug("Prometheus stopServer() was called but server was never started.");
|
|
229214
229278
|
return Promise.resolve();
|
|
229215
229279
|
} else {
|
|
229216
|
-
return new Promise((
|
|
229280
|
+
return new Promise((resolve11) => {
|
|
229217
229281
|
this._server.close((err) => {
|
|
229218
229282
|
if (!err) {
|
|
229219
229283
|
api_1.diag.debug("Prometheus exporter was stopped");
|
|
@@ -229222,7 +229286,7 @@ var require_PrometheusExporter = __commonJS({
|
|
|
229222
229286
|
(0, core_1.globalErrorHandler)(err);
|
|
229223
229287
|
}
|
|
229224
229288
|
}
|
|
229225
|
-
|
|
229289
|
+
resolve11();
|
|
229226
229290
|
});
|
|
229227
229291
|
});
|
|
229228
229292
|
}
|
|
@@ -229231,14 +229295,14 @@ var require_PrometheusExporter = __commonJS({
|
|
|
229231
229295
|
* Starts the Prometheus export server
|
|
229232
229296
|
*/
|
|
229233
229297
|
startServer() {
|
|
229234
|
-
this._startServerPromise ??= new Promise((
|
|
229298
|
+
this._startServerPromise ??= new Promise((resolve11, reject) => {
|
|
229235
229299
|
this._server.once("error", reject);
|
|
229236
229300
|
this._server.listen({
|
|
229237
229301
|
port: this._port,
|
|
229238
229302
|
host: this._host
|
|
229239
229303
|
}, () => {
|
|
229240
229304
|
api_1.diag.debug(`Prometheus exporter server started: ${this._host}:${this._port}/${this._endpoint}`);
|
|
229241
|
-
|
|
229305
|
+
resolve11();
|
|
229242
229306
|
});
|
|
229243
229307
|
});
|
|
229244
229308
|
return this._startServerPromise;
|
|
@@ -229683,9 +229747,9 @@ var require_zipkin = __commonJS({
|
|
|
229683
229747
|
}));
|
|
229684
229748
|
return;
|
|
229685
229749
|
}
|
|
229686
|
-
const promise2 = new Promise((
|
|
229750
|
+
const promise2 = new Promise((resolve11) => {
|
|
229687
229751
|
this._sendSpans(spans, serviceName, (result) => {
|
|
229688
|
-
|
|
229752
|
+
resolve11();
|
|
229689
229753
|
resultCallback(result);
|
|
229690
229754
|
});
|
|
229691
229755
|
});
|
|
@@ -229708,9 +229772,9 @@ var require_zipkin = __commonJS({
|
|
|
229708
229772
|
* Exports any pending spans in exporter
|
|
229709
229773
|
*/
|
|
229710
229774
|
forceFlush() {
|
|
229711
|
-
return new Promise((
|
|
229775
|
+
return new Promise((resolve11, reject) => {
|
|
229712
229776
|
Promise.all(this._sendingPromises).then(() => {
|
|
229713
|
-
|
|
229777
|
+
resolve11();
|
|
229714
229778
|
}, reject);
|
|
229715
229779
|
});
|
|
229716
229780
|
}
|
|
@@ -232419,7 +232483,7 @@ var init_SocketTransport = __esm({
|
|
|
232419
232483
|
return Promise.resolve();
|
|
232420
232484
|
}
|
|
232421
232485
|
async send(message) {
|
|
232422
|
-
return new Promise((
|
|
232486
|
+
return new Promise((resolve11, reject) => {
|
|
232423
232487
|
const json2 = JSON.stringify(
|
|
232424
232488
|
message,
|
|
232425
232489
|
(_key, value) => typeof value === "bigint" ? value.toString() : value
|
|
@@ -232428,7 +232492,7 @@ var init_SocketTransport = __esm({
|
|
|
232428
232492
|
if (err) {
|
|
232429
232493
|
reject(err);
|
|
232430
232494
|
} else {
|
|
232431
|
-
|
|
232495
|
+
resolve11();
|
|
232432
232496
|
}
|
|
232433
232497
|
});
|
|
232434
232498
|
});
|
|
@@ -232471,13 +232535,13 @@ var init_ExtensionConnectionTracker = __esm({
|
|
|
232471
232535
|
});
|
|
232472
232536
|
|
|
232473
232537
|
// src/server/surfaces/DaemonSocketSurface.ts
|
|
232474
|
-
var fs34, net2,
|
|
232538
|
+
var fs34, net2, path35, bindSequence, DaemonSocketSurface;
|
|
232475
232539
|
var init_DaemonSocketSurface = __esm({
|
|
232476
232540
|
"src/server/surfaces/DaemonSocketSurface.ts"() {
|
|
232477
232541
|
"use strict";
|
|
232478
232542
|
fs34 = __toESM(require("fs"));
|
|
232479
232543
|
net2 = __toESM(require("net"));
|
|
232480
|
-
|
|
232544
|
+
path35 = __toESM(require("path"));
|
|
232481
232545
|
init_ipcEndpoint();
|
|
232482
232546
|
init_ConsoleLogger();
|
|
232483
232547
|
init_SocketTransport();
|
|
@@ -232511,14 +232575,14 @@ var init_DaemonSocketSurface = __esm({
|
|
|
232511
232575
|
return;
|
|
232512
232576
|
}
|
|
232513
232577
|
if (isRelocatedDaemonIpcEndpoint(this.options.configDir, this.options.socketPath)) {
|
|
232514
|
-
fs34.mkdirSync(
|
|
232515
|
-
fs34.chmodSync(
|
|
232578
|
+
fs34.mkdirSync(path35.dirname(this.options.socketPath), { recursive: true, mode: 448 });
|
|
232579
|
+
fs34.chmodSync(path35.dirname(this.options.socketPath), 448);
|
|
232516
232580
|
logger.warn(
|
|
232517
|
-
`[Daemon] Relocated IPC endpoint from ${
|
|
232581
|
+
`[Daemon] Relocated IPC endpoint from ${path35.join(this.options.configDir, "srv.sock")} to ${this.options.socketPath}.`
|
|
232518
232582
|
);
|
|
232519
232583
|
}
|
|
232520
232584
|
const usesFilesystemPath = !isWindowsNamedPipe(this.options.socketPath);
|
|
232521
|
-
const privatePath = usesFilesystemPath ?
|
|
232585
|
+
const privatePath = usesFilesystemPath ? path35.join(path35.dirname(this.options.socketPath), `.${process.pid}-${++bindSequence}`) : this.options.socketPath;
|
|
232522
232586
|
const canPublishByRename = usesFilesystemPath && Buffer.byteLength(privatePath) <= UNIX_SOCKET_PATH_MAX_BYTES;
|
|
232523
232587
|
if (usesFilesystemPath && !canPublishByRename) {
|
|
232524
232588
|
logger.warn(
|
|
@@ -232580,7 +232644,7 @@ var init_DaemonSocketSurface = __esm({
|
|
|
232580
232644
|
logger.error("[Daemon] Failed to connect MCP server to transport", error52);
|
|
232581
232645
|
}
|
|
232582
232646
|
});
|
|
232583
|
-
await new Promise((
|
|
232647
|
+
await new Promise((resolve11, reject) => {
|
|
232584
232648
|
const onListen = () => {
|
|
232585
232649
|
if (canPublishByRename) {
|
|
232586
232650
|
try {
|
|
@@ -232597,7 +232661,7 @@ var init_DaemonSocketSurface = __esm({
|
|
|
232597
232661
|
this.server?.on("error", (err) => {
|
|
232598
232662
|
logger.error("[Daemon] IPC server error after bind", err);
|
|
232599
232663
|
});
|
|
232600
|
-
|
|
232664
|
+
resolve11();
|
|
232601
232665
|
};
|
|
232602
232666
|
const onError = (err) => {
|
|
232603
232667
|
cleanup();
|
|
@@ -232635,7 +232699,7 @@ var init_DaemonSocketSurface = __esm({
|
|
|
232635
232699
|
}
|
|
232636
232700
|
const server = this.server;
|
|
232637
232701
|
this.server = null;
|
|
232638
|
-
this.closePromise = new Promise((
|
|
232702
|
+
this.closePromise = new Promise((resolve11) => {
|
|
232639
232703
|
try {
|
|
232640
232704
|
server.close((err) => {
|
|
232641
232705
|
if (err) {
|
|
@@ -232644,12 +232708,12 @@ var init_DaemonSocketSurface = __esm({
|
|
|
232644
232708
|
logger.info("[Daemon] Socket server closed.");
|
|
232645
232709
|
}
|
|
232646
232710
|
this.releaseOwnedEndpoint();
|
|
232647
|
-
|
|
232711
|
+
resolve11();
|
|
232648
232712
|
});
|
|
232649
232713
|
} catch (error52) {
|
|
232650
232714
|
logger.error("[Daemon] Error initiating Socket server close:", error52);
|
|
232651
232715
|
this.releaseOwnedEndpoint();
|
|
232652
|
-
|
|
232716
|
+
resolve11();
|
|
232653
232717
|
}
|
|
232654
232718
|
});
|
|
232655
232719
|
return this.closePromise;
|
|
@@ -232681,13 +232745,13 @@ var init_DaemonSocketSurface = __esm({
|
|
|
232681
232745
|
|
|
232682
232746
|
// src/server/surfaces/DaemonControlSurface.ts
|
|
232683
232747
|
function requestDaemonControlStop(endpoint, token) {
|
|
232684
|
-
return new Promise((
|
|
232748
|
+
return new Promise((resolve11) => {
|
|
232685
232749
|
const socket = net3.createConnection(endpoint);
|
|
232686
232750
|
const timeout = setTimeout(() => settle2(false), 2e3);
|
|
232687
232751
|
const settle2 = (accepted) => {
|
|
232688
232752
|
clearTimeout(timeout);
|
|
232689
232753
|
socket.destroy();
|
|
232690
|
-
|
|
232754
|
+
resolve11(accepted);
|
|
232691
232755
|
};
|
|
232692
232756
|
socket.once("error", () => settle2(false));
|
|
232693
232757
|
socket.once(
|
|
@@ -232756,13 +232820,13 @@ var init_DaemonControlSurface = __esm({
|
|
|
232756
232820
|
});
|
|
232757
232821
|
});
|
|
232758
232822
|
});
|
|
232759
|
-
await new Promise((
|
|
232823
|
+
await new Promise((resolve11, reject) => {
|
|
232760
232824
|
const server = this.server;
|
|
232761
232825
|
server.once("error", reject);
|
|
232762
232826
|
server.listen(this.options.endpoint, () => {
|
|
232763
232827
|
server.removeListener("error", reject);
|
|
232764
232828
|
server.on("error", () => void 0);
|
|
232765
|
-
|
|
232829
|
+
resolve11();
|
|
232766
232830
|
});
|
|
232767
232831
|
});
|
|
232768
232832
|
}
|
|
@@ -232773,7 +232837,7 @@ var init_DaemonControlSurface = __esm({
|
|
|
232773
232837
|
if (!server)
|
|
232774
232838
|
return;
|
|
232775
232839
|
await new Promise(
|
|
232776
|
-
(
|
|
232840
|
+
(resolve11, reject) => server.close((error52) => error52 ? reject(error52) : resolve11())
|
|
232777
232841
|
);
|
|
232778
232842
|
this.server = void 0;
|
|
232779
232843
|
}
|
|
@@ -247383,7 +247447,7 @@ var init_artifactPins_generated = __esm({
|
|
|
247383
247447
|
});
|
|
247384
247448
|
|
|
247385
247449
|
// src/server/runtime/ManagedArtifactRuntime.ts
|
|
247386
|
-
var crypto18, fs35, import_module, os7,
|
|
247450
|
+
var crypto18, fs35, import_module, os7, path36, ORPHAN_DOWNLOAD_MIN_AGE_MS, WAIT_LOG_INTERVAL_MS, requireFromRuntime, ManagedArtifactRuntime;
|
|
247387
247451
|
var init_ManagedArtifactRuntime = __esm({
|
|
247388
247452
|
"src/server/runtime/ManagedArtifactRuntime.ts"() {
|
|
247389
247453
|
"use strict";
|
|
@@ -247391,7 +247455,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247391
247455
|
fs35 = __toESM(require("fs"));
|
|
247392
247456
|
import_module = require("module");
|
|
247393
247457
|
os7 = __toESM(require("os"));
|
|
247394
|
-
|
|
247458
|
+
path36 = __toESM(require("path"));
|
|
247395
247459
|
init_ManagedArtifactTypes();
|
|
247396
247460
|
init_artifactPins_generated();
|
|
247397
247461
|
init_ArtifactDownloader();
|
|
@@ -247524,7 +247588,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247524
247588
|
async provisionAndLoad(forceProvision) {
|
|
247525
247589
|
if (this.options.runtimePath) {
|
|
247526
247590
|
try {
|
|
247527
|
-
return requireFromRuntime(
|
|
247591
|
+
return requireFromRuntime(path36.resolve(this.options.runtimePath));
|
|
247528
247592
|
} catch (error52) {
|
|
247529
247593
|
return this.fail(
|
|
247530
247594
|
"disk_failed",
|
|
@@ -247572,7 +247636,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247572
247636
|
}
|
|
247573
247637
|
}
|
|
247574
247638
|
const lockDir = `${versionDir}.provision-lock`;
|
|
247575
|
-
fs35.mkdirSync(
|
|
247639
|
+
fs35.mkdirSync(path36.dirname(lockDir), { recursive: true });
|
|
247576
247640
|
const lockWaitStartMs = Date.now();
|
|
247577
247641
|
const staleMs = this.options.provisionLockStaleMs ?? 5 * 60 * 1e3;
|
|
247578
247642
|
const maxWaitMs = this.options.provisionLockMaxWaitMs ?? 10 * 60 * 1e3;
|
|
@@ -247623,7 +247687,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247623
247687
|
}
|
|
247624
247688
|
} catch (error52) {
|
|
247625
247689
|
}
|
|
247626
|
-
await new Promise((
|
|
247690
|
+
await new Promise((resolve11) => setTimeout(resolve11, 50));
|
|
247627
247691
|
}
|
|
247628
247692
|
let heartbeatTimer = null;
|
|
247629
247693
|
const heartbeatIntervalMs = Math.max(10, Math.floor(staleMs / 3));
|
|
@@ -247644,7 +247708,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247644
247708
|
}
|
|
247645
247709
|
if (provisionToken) {
|
|
247646
247710
|
try {
|
|
247647
|
-
const currentToken = fs35.readFileSync(
|
|
247711
|
+
const currentToken = fs35.readFileSync(path36.join(lockDir, "owner"), "utf-8");
|
|
247648
247712
|
if (currentToken === provisionToken) {
|
|
247649
247713
|
fs35.rmSync(lockDir, { recursive: true, force: true });
|
|
247650
247714
|
}
|
|
@@ -247665,9 +247729,9 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247665
247729
|
const downloadPrefix = `sql-preview-${this.options.artifactId}-`;
|
|
247666
247730
|
try {
|
|
247667
247731
|
for (const tarball of pins.tarballs) {
|
|
247668
|
-
const downloadPath =
|
|
247732
|
+
const downloadPath = path36.join(
|
|
247669
247733
|
this.downloadDir(),
|
|
247670
|
-
`${downloadPrefix}${
|
|
247734
|
+
`${downloadPrefix}${path36.basename(tarball.name)}-${Date.now()}.tgz`
|
|
247671
247735
|
);
|
|
247672
247736
|
downloadPaths.push(downloadPath);
|
|
247673
247737
|
try {
|
|
@@ -247685,7 +247749,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247685
247749
|
fs35.rmSync(downloadPath, { force: true });
|
|
247686
247750
|
return this.fail("checksum_failed", `Integrity check failed for ${tarball.name}.`);
|
|
247687
247751
|
}
|
|
247688
|
-
const packageDestDir =
|
|
247752
|
+
const packageDestDir = path36.join(
|
|
247689
247753
|
tempDir,
|
|
247690
247754
|
...tarball.installPath ? tarball.installPath.split("/") : ["node_modules", ...tarball.name.split("/")]
|
|
247691
247755
|
);
|
|
@@ -247739,7 +247803,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247739
247803
|
}
|
|
247740
247804
|
if (provisionToken) {
|
|
247741
247805
|
try {
|
|
247742
|
-
const currentToken = fs35.readFileSync(
|
|
247806
|
+
const currentToken = fs35.readFileSync(path36.join(lockDir, "owner"), "utf-8");
|
|
247743
247807
|
if (currentToken === provisionToken) {
|
|
247744
247808
|
fs35.rmSync(lockDir, { recursive: true, force: true });
|
|
247745
247809
|
}
|
|
@@ -247752,14 +247816,14 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247752
247816
|
return this.options.downloadDir ?? os7.tmpdir();
|
|
247753
247817
|
}
|
|
247754
247818
|
reapOrphans(versionDir) {
|
|
247755
|
-
const parentDir =
|
|
247756
|
-
const versionBase =
|
|
247819
|
+
const parentDir = path36.dirname(versionDir);
|
|
247820
|
+
const versionBase = path36.basename(versionDir);
|
|
247757
247821
|
const prefix = `${versionBase}-tmp-`;
|
|
247758
247822
|
try {
|
|
247759
247823
|
const siblings = fs35.readdirSync(parentDir);
|
|
247760
247824
|
for (const sibling of siblings) {
|
|
247761
247825
|
if (sibling.startsWith(prefix)) {
|
|
247762
|
-
const siblingPath =
|
|
247826
|
+
const siblingPath = path36.join(parentDir, sibling);
|
|
247763
247827
|
try {
|
|
247764
247828
|
fs35.rmSync(siblingPath, { recursive: true, force: true });
|
|
247765
247829
|
} catch (error52) {
|
|
@@ -247775,7 +247839,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247775
247839
|
const downloadPrefix = `sql-preview-${this.options.artifactId}-`;
|
|
247776
247840
|
for (const file4 of files) {
|
|
247777
247841
|
if (file4.startsWith(downloadPrefix) && file4.endsWith(".tgz")) {
|
|
247778
|
-
const filePath =
|
|
247842
|
+
const filePath = path36.join(downloadDir, file4);
|
|
247779
247843
|
try {
|
|
247780
247844
|
const stats = fs35.statSync(filePath);
|
|
247781
247845
|
if (now - stats.mtimeMs > ORPHAN_DOWNLOAD_MIN_AGE_MS) {
|
|
@@ -247792,7 +247856,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247792
247856
|
try {
|
|
247793
247857
|
fs35.mkdirSync(lockDir, { recursive: false });
|
|
247794
247858
|
const token = `${process.pid}-${crypto18.randomUUID()}`;
|
|
247795
|
-
fs35.writeFileSync(
|
|
247859
|
+
fs35.writeFileSync(path36.join(lockDir, "owner"), token, "utf-8");
|
|
247796
247860
|
return { acquired: true, token };
|
|
247797
247861
|
} catch (error52) {
|
|
247798
247862
|
if (error52.code === "EEXIST") {
|
|
@@ -247821,7 +247885,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247821
247885
|
if (this.options.platformKey && this.options.platformKey !== currentPlatformKey()) {
|
|
247822
247886
|
return null;
|
|
247823
247887
|
}
|
|
247824
|
-
const entryPath =
|
|
247888
|
+
const entryPath = path36.join(
|
|
247825
247889
|
versionDir,
|
|
247826
247890
|
"node_modules",
|
|
247827
247891
|
...(this.options.entryModule ?? this.options.artifactId).split("/")
|
|
@@ -247829,13 +247893,13 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247829
247893
|
return requireFromRuntime(entryPath);
|
|
247830
247894
|
}
|
|
247831
247895
|
flattenNpmPackage(packageDestDir) {
|
|
247832
|
-
let archiveRoot =
|
|
247896
|
+
let archiveRoot = path36.join(packageDestDir, "package");
|
|
247833
247897
|
if (!fs35.statSync(archiveRoot, { throwIfNoEntry: false })?.isDirectory()) {
|
|
247834
247898
|
const entries = fs35.readdirSync(packageDestDir);
|
|
247835
247899
|
if (entries.length === 1 && entries[0]) {
|
|
247836
247900
|
const singleEntry = entries[0];
|
|
247837
|
-
if (fs35.statSync(
|
|
247838
|
-
archiveRoot =
|
|
247901
|
+
if (fs35.statSync(path36.join(packageDestDir, singleEntry)).isDirectory()) {
|
|
247902
|
+
archiveRoot = path36.join(packageDestDir, singleEntry);
|
|
247839
247903
|
} else {
|
|
247840
247904
|
throw new Error(
|
|
247841
247905
|
`Archive must contain exactly one top-level directory. Found ${entries.length} entries: ${entries.join(", ")} in ${packageDestDir}`
|
|
@@ -247848,7 +247912,7 @@ var init_ManagedArtifactRuntime = __esm({
|
|
|
247848
247912
|
}
|
|
247849
247913
|
}
|
|
247850
247914
|
for (const entry of fs35.readdirSync(archiveRoot)) {
|
|
247851
|
-
fs35.renameSync(
|
|
247915
|
+
fs35.renameSync(path36.join(archiveRoot, entry), path36.join(packageDestDir, entry));
|
|
247852
247916
|
}
|
|
247853
247917
|
fs35.rmdirSync(archiveRoot);
|
|
247854
247918
|
}
|
|
@@ -248046,12 +248110,12 @@ var init_DuckDbRuntime = __esm({
|
|
|
248046
248110
|
});
|
|
248047
248111
|
|
|
248048
248112
|
// src/server/runtime/DriverArtifactProvisioner.ts
|
|
248049
|
-
var fs36,
|
|
248113
|
+
var fs36, path37, DRIVER_ARTIFACTS, DriverArtifactProvisioner;
|
|
248050
248114
|
var init_DriverArtifactProvisioner = __esm({
|
|
248051
248115
|
"src/server/runtime/DriverArtifactProvisioner.ts"() {
|
|
248052
248116
|
"use strict";
|
|
248053
248117
|
fs36 = __toESM(require("fs"));
|
|
248054
|
-
|
|
248118
|
+
path37 = __toESM(require("path"));
|
|
248055
248119
|
init_optionalDrivers();
|
|
248056
248120
|
init_ManagedArtifactTypes();
|
|
248057
248121
|
init_artifactPins_generated();
|
|
@@ -248085,7 +248149,7 @@ var init_DriverArtifactProvisioner = __esm({
|
|
|
248085
248149
|
artifactId,
|
|
248086
248150
|
pins.artifactVersion
|
|
248087
248151
|
);
|
|
248088
|
-
const depPath =
|
|
248152
|
+
const depPath = path37.join(versionDir, "node_modules", ...dependency.split("/"));
|
|
248089
248153
|
if (fs36.existsSync(depPath)) {
|
|
248090
248154
|
return depPath;
|
|
248091
248155
|
}
|
|
@@ -248216,12 +248280,12 @@ function rowToLedgerEntry(row) {
|
|
|
248216
248280
|
function describeError3(error52) {
|
|
248217
248281
|
return error52 instanceof Error ? error52.message : String(error52);
|
|
248218
248282
|
}
|
|
248219
|
-
var fs37,
|
|
248283
|
+
var fs37, path38, LEDGER_DB_FILENAME, JOURNAL_SCHEMA_VERSION, META_KEY_SCHEMA_VERSION, META_KEY_HEAD_HASH, JournalStoreOpenError, openJournalPaths, JournalStore;
|
|
248220
248284
|
var init_JournalStore = __esm({
|
|
248221
248285
|
"src/server/ledger/JournalStore.ts"() {
|
|
248222
248286
|
"use strict";
|
|
248223
248287
|
fs37 = __toESM(require("fs"));
|
|
248224
|
-
|
|
248288
|
+
path38 = __toESM(require("path"));
|
|
248225
248289
|
init_canonicalSerialize();
|
|
248226
248290
|
init_LedgerTypes();
|
|
248227
248291
|
LEDGER_DB_FILENAME = "execution-ledger.duckdb";
|
|
@@ -248259,14 +248323,14 @@ var init_JournalStore = __esm({
|
|
|
248259
248323
|
`DuckDB runtime acquisition failed: ${describeError3(error52)}`
|
|
248260
248324
|
);
|
|
248261
248325
|
}
|
|
248262
|
-
const dbPath =
|
|
248326
|
+
const dbPath = path38.join(options.storageDir, LEDGER_DB_FILENAME);
|
|
248263
248327
|
if (openJournalPaths.has(dbPath)) {
|
|
248264
248328
|
throw new JournalStoreOpenError(
|
|
248265
248329
|
"locked",
|
|
248266
248330
|
`Journal ${dbPath} is already open in this process.`
|
|
248267
248331
|
);
|
|
248268
248332
|
}
|
|
248269
|
-
const lockPath =
|
|
248333
|
+
const lockPath = path38.join(options.storageDir, "execution-ledger.lock");
|
|
248270
248334
|
let ownsLockfile = false;
|
|
248271
248335
|
try {
|
|
248272
248336
|
fs37.mkdirSync(options.storageDir, { recursive: true });
|
|
@@ -248921,12 +248985,12 @@ var init_LedgerService = __esm({
|
|
|
248921
248985
|
function redactFatalText(text) {
|
|
248922
248986
|
return text.replace(AUTHORIZATION_VALUE2, "$1 [redacted]").replace(SENSITIVE_ASSIGNMENT2, "$1[redacted]").replace(QUERY_ASSIGNMENT2, "$1[redacted]").replace(URL_SECRET2, "$1[redacted]");
|
|
248923
248987
|
}
|
|
248924
|
-
var fs38,
|
|
248988
|
+
var fs38, path39, MAX_BYTES, RETAINED_FILES, SENSITIVE_ASSIGNMENT2, QUERY_ASSIGNMENT2, AUTHORIZATION_VALUE2, URL_SECRET2, FatalJournal;
|
|
248925
248989
|
var init_FatalJournal = __esm({
|
|
248926
248990
|
"src/server/FatalJournal.ts"() {
|
|
248927
248991
|
"use strict";
|
|
248928
248992
|
fs38 = __toESM(require("fs"));
|
|
248929
|
-
|
|
248993
|
+
path39 = __toESM(require("path"));
|
|
248930
248994
|
MAX_BYTES = 5 * 1024 * 1024;
|
|
248931
248995
|
RETAINED_FILES = 5;
|
|
248932
248996
|
SENSITIVE_ASSIGNMENT2 = /(\b(?:password|passwd|pwd|credential(?:s)?|authorization|authHeader|customAuthHeader|token|api[-_]?key|secret|privateKeyPassphrase)\b\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;}]+)/gi;
|
|
@@ -248937,8 +249001,8 @@ var init_FatalJournal = __esm({
|
|
|
248937
249001
|
constructor(configDir) {
|
|
248938
249002
|
this.disabled = false;
|
|
248939
249003
|
this.reportedFailure = false;
|
|
248940
|
-
this.logDir =
|
|
248941
|
-
this.logPath =
|
|
249004
|
+
this.logDir = path39.join(configDir, "logs");
|
|
249005
|
+
this.logPath = path39.join(this.logDir, "daemon.log");
|
|
248942
249006
|
}
|
|
248943
249007
|
writeFirst(kind, reason) {
|
|
248944
249008
|
const error52 = reason instanceof Error ? reason : new Error(String(reason));
|
|
@@ -249068,21 +249132,21 @@ var init_webUiHint = __esm({
|
|
|
249068
249132
|
|
|
249069
249133
|
// src/server/registerDriverModulePath.ts
|
|
249070
249134
|
function registerDriverModulePath(configDir) {
|
|
249071
|
-
const driversNodeModules =
|
|
249135
|
+
const driversNodeModules = path40.join(configDir, "drivers", "node_modules");
|
|
249072
249136
|
const existing = process.env["NODE_PATH"];
|
|
249073
|
-
const entries = existing ? existing.split(
|
|
249137
|
+
const entries = existing ? existing.split(path40.delimiter).filter(Boolean) : [];
|
|
249074
249138
|
if (!entries.includes(driversNodeModules)) {
|
|
249075
|
-
process.env["NODE_PATH"] = [driversNodeModules, ...entries].join(
|
|
249139
|
+
process.env["NODE_PATH"] = [driversNodeModules, ...entries].join(path40.delimiter);
|
|
249076
249140
|
}
|
|
249077
249141
|
const nodeModule = require("module");
|
|
249078
249142
|
nodeModule._initPaths?.();
|
|
249079
249143
|
return driversNodeModules;
|
|
249080
249144
|
}
|
|
249081
|
-
var
|
|
249145
|
+
var path40;
|
|
249082
249146
|
var init_registerDriverModulePath = __esm({
|
|
249083
249147
|
"src/server/registerDriverModulePath.ts"() {
|
|
249084
249148
|
"use strict";
|
|
249085
|
-
|
|
249149
|
+
path40 = __toESM(require("path"));
|
|
249086
249150
|
}
|
|
249087
249151
|
});
|
|
249088
249152
|
|
|
@@ -249090,12 +249154,12 @@ var init_registerDriverModulePath = __esm({
|
|
|
249090
249154
|
function faultIdentity(daemonVersion, kind, errorName) {
|
|
249091
249155
|
return `${daemonVersion}:${kind}:${errorName}`;
|
|
249092
249156
|
}
|
|
249093
|
-
var fs39,
|
|
249157
|
+
var fs39, path41, DIAGNOSTICS_REPORT_BUDGET, DIAGNOSTICS_BUDGET_WINDOW_MS, MAX_RETAINED_REPORTS, BUDGET_VERSION, DiagnosticsBudget;
|
|
249094
249158
|
var init_DiagnosticsBudget = __esm({
|
|
249095
249159
|
"src/server/DiagnosticsBudget.ts"() {
|
|
249096
249160
|
"use strict";
|
|
249097
249161
|
fs39 = __toESM(require("fs"));
|
|
249098
|
-
|
|
249162
|
+
path41 = __toESM(require("path"));
|
|
249099
249163
|
DIAGNOSTICS_REPORT_BUDGET = 3;
|
|
249100
249164
|
DIAGNOSTICS_BUDGET_WINDOW_MS = 60 * 6e4;
|
|
249101
249165
|
MAX_RETAINED_REPORTS = 20;
|
|
@@ -249103,7 +249167,7 @@ var init_DiagnosticsBudget = __esm({
|
|
|
249103
249167
|
DiagnosticsBudget = class {
|
|
249104
249168
|
constructor(configDir, options) {
|
|
249105
249169
|
this.hasLoggedWriteError = false;
|
|
249106
|
-
this.filePath =
|
|
249170
|
+
this.filePath = path41.join(configDir, "diagnostics-budget.json");
|
|
249107
249171
|
this.now = options?.now ?? (() => Date.now());
|
|
249108
249172
|
}
|
|
249109
249173
|
read() {
|
|
@@ -249123,7 +249187,7 @@ var init_DiagnosticsBudget = __esm({
|
|
|
249123
249187
|
}
|
|
249124
249188
|
write(file4) {
|
|
249125
249189
|
try {
|
|
249126
|
-
const dir3 =
|
|
249190
|
+
const dir3 = path41.dirname(this.filePath);
|
|
249127
249191
|
if (!fs39.existsSync(dir3)) {
|
|
249128
249192
|
fs39.mkdirSync(dir3, { recursive: true });
|
|
249129
249193
|
}
|
|
@@ -249523,7 +249587,7 @@ function isVersion(value) {
|
|
|
249523
249587
|
return SEMVER_PATTERN2.test(value);
|
|
249524
249588
|
}
|
|
249525
249589
|
function pointerPath(configHome, version3) {
|
|
249526
|
-
return
|
|
249590
|
+
return path42.join(configHome, "versions", `${version3}.json`);
|
|
249527
249591
|
}
|
|
249528
249592
|
function removeVersion(configHome, version3) {
|
|
249529
249593
|
const appPath = applicationDir(configHome, version3);
|
|
@@ -249546,12 +249610,12 @@ function pruneOldVersions(configHome, keep) {
|
|
|
249546
249610
|
}
|
|
249547
249611
|
return removed;
|
|
249548
249612
|
}
|
|
249549
|
-
var fs40,
|
|
249613
|
+
var fs40, path42, SEMVER_PATTERN2;
|
|
249550
249614
|
var init_VersionRetention = __esm({
|
|
249551
249615
|
"src/server/update/VersionRetention.ts"() {
|
|
249552
249616
|
"use strict";
|
|
249553
249617
|
fs40 = __toESM(require("fs"));
|
|
249554
|
-
|
|
249618
|
+
path42 = __toESM(require("path"));
|
|
249555
249619
|
init_applicationPayload();
|
|
249556
249620
|
SEMVER_PATTERN2 = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
249557
249621
|
}
|
|
@@ -249559,8 +249623,8 @@ var init_VersionRetention = __esm({
|
|
|
249559
249623
|
|
|
249560
249624
|
// src/server/update/UpdateStager.ts
|
|
249561
249625
|
function isWithin2(parent, child) {
|
|
249562
|
-
const relative5 =
|
|
249563
|
-
return relative5 === "" || !relative5.startsWith(`..${
|
|
249626
|
+
const relative5 = path43.relative(path43.resolve(parent), path43.resolve(child));
|
|
249627
|
+
return relative5 === "" || !relative5.startsWith(`..${path43.sep}`) && relative5 !== "..";
|
|
249564
249628
|
}
|
|
249565
249629
|
function isVersion2(value) {
|
|
249566
249630
|
return typeof value === "string" && SEMVER_PATTERN3.test(value);
|
|
@@ -249583,7 +249647,7 @@ function findPayloadEntry(root) {
|
|
|
249583
249647
|
const entries = [];
|
|
249584
249648
|
const visit = (directory) => {
|
|
249585
249649
|
for (const entry2 of fs41.readdirSync(directory, { withFileTypes: true })) {
|
|
249586
|
-
const entryPath =
|
|
249650
|
+
const entryPath = path43.join(directory, entry2.name);
|
|
249587
249651
|
if (entry2.isDirectory()) {
|
|
249588
249652
|
visit(entryPath);
|
|
249589
249653
|
} else if (entry2.isFile() && entry2.name === "standalone.js") {
|
|
@@ -249629,13 +249693,13 @@ function atomicWritePointer(fileSystem, pointerPath2, pointer) {
|
|
|
249629
249693
|
}
|
|
249630
249694
|
removeBestEffort(fileSystem, backupPath);
|
|
249631
249695
|
}
|
|
249632
|
-
var fs41, os8,
|
|
249696
|
+
var fs41, os8, path43, SEMVER_PATTERN3, UpdateStager;
|
|
249633
249697
|
var init_UpdateStager = __esm({
|
|
249634
249698
|
"src/server/update/UpdateStager.ts"() {
|
|
249635
249699
|
"use strict";
|
|
249636
249700
|
fs41 = __toESM(require("fs"));
|
|
249637
249701
|
os8 = __toESM(require("os"));
|
|
249638
|
-
|
|
249702
|
+
path43 = __toESM(require("path"));
|
|
249639
249703
|
init_protocolVersion();
|
|
249640
249704
|
init_applicationPayload();
|
|
249641
249705
|
init_MinimalTarExtractor();
|
|
@@ -249652,7 +249716,7 @@ var init_UpdateStager = __esm({
|
|
|
249652
249716
|
this.fileSystem = options.fileSystem ?? fs41;
|
|
249653
249717
|
}
|
|
249654
249718
|
stagedVersion() {
|
|
249655
|
-
const versionsDir =
|
|
249719
|
+
const versionsDir = path43.join(this.configHome, "versions");
|
|
249656
249720
|
let entries;
|
|
249657
249721
|
try {
|
|
249658
249722
|
entries = this.fileSystem.readdirSync(versionsDir, { withFileTypes: true });
|
|
@@ -249667,7 +249731,7 @@ var init_UpdateStager = __esm({
|
|
|
249667
249731
|
try {
|
|
249668
249732
|
const version3 = entry.name.slice(0, -".json".length);
|
|
249669
249733
|
const pointer = JSON.parse(
|
|
249670
|
-
this.fileSystem.readFileSync(
|
|
249734
|
+
this.fileSystem.readFileSync(path43.join(versionsDir, entry.name), "utf8")
|
|
249671
249735
|
);
|
|
249672
249736
|
if (!isVersionPointer(pointer) || pointer.version !== version3 || compareSemver(pointer.version, this.currentVersion) <= 0 || !isWithin2(applicationDir(this.configHome, pointer.version), pointer.path) || !this.fileSystem.statSync(pointer.path).isFile()) {
|
|
249673
249737
|
continue;
|
|
@@ -249693,9 +249757,9 @@ var init_UpdateStager = __esm({
|
|
|
249693
249757
|
);
|
|
249694
249758
|
}
|
|
249695
249759
|
this.fileSystem.mkdirSync(this.downloadDir, { recursive: true });
|
|
249696
|
-
const temporaryRoot = this.fileSystem.mkdtempSync(
|
|
249697
|
-
const archivePath =
|
|
249698
|
-
const extractedPath =
|
|
249760
|
+
const temporaryRoot = this.fileSystem.mkdtempSync(path43.join(this.downloadDir, "grain-update-"));
|
|
249761
|
+
const archivePath = path43.join(temporaryRoot, "artifact.tar.gz");
|
|
249762
|
+
const extractedPath = path43.join(temporaryRoot, "extracted");
|
|
249699
249763
|
try {
|
|
249700
249764
|
await downloadToFile(artifact.url, archivePath);
|
|
249701
249765
|
const actualSha256 = await sha256File(archivePath);
|
|
@@ -249724,19 +249788,19 @@ var init_UpdateStager = __esm({
|
|
|
249724
249788
|
throw new Error(`Invalid staged version ${version3}`);
|
|
249725
249789
|
}
|
|
249726
249790
|
removeBestEffort(this.fileSystem, applicationDir(this.configHome, version3));
|
|
249727
|
-
removeBestEffort(this.fileSystem,
|
|
249791
|
+
removeBestEffort(this.fileSystem, path43.join(this.configHome, "versions", `${version3}.json`));
|
|
249728
249792
|
}
|
|
249729
249793
|
install(version3, sourceEntry) {
|
|
249730
249794
|
const appPath = applicationDir(this.configHome, version3);
|
|
249731
|
-
const versionsDir =
|
|
249732
|
-
const pointerPath2 =
|
|
249795
|
+
const versionsDir = path43.join(this.configHome, "versions");
|
|
249796
|
+
const pointerPath2 = path43.join(versionsDir, `${version3}.json`);
|
|
249733
249797
|
const operationId = `${process.pid}-${Date.now()}`;
|
|
249734
249798
|
const appBackupPath = `${appPath}.update-backup-${operationId}`;
|
|
249735
249799
|
const hadApp = this.fileSystem.existsSync(appPath);
|
|
249736
249800
|
const hadPointer = this.fileSystem.existsSync(pointerPath2);
|
|
249737
249801
|
const previousPointer = hadPointer ? this.fileSystem.readFileSync(pointerPath2, "utf8") : null;
|
|
249738
249802
|
let movedExistingApp = false;
|
|
249739
|
-
this.fileSystem.mkdirSync(
|
|
249803
|
+
this.fileSystem.mkdirSync(path43.dirname(appPath), { recursive: true });
|
|
249740
249804
|
this.fileSystem.mkdirSync(versionsDir, { recursive: true });
|
|
249741
249805
|
try {
|
|
249742
249806
|
if (hadApp) {
|
|
@@ -249803,7 +249867,7 @@ function pruneDeadPidFiles(configDir, ownPidPath) {
|
|
|
249803
249867
|
if (!PID_FILE_PATTERN.test(entry)) {
|
|
249804
249868
|
continue;
|
|
249805
249869
|
}
|
|
249806
|
-
const candidate =
|
|
249870
|
+
const candidate = path44.join(configDir, entry);
|
|
249807
249871
|
if (candidate === ownPidPath) {
|
|
249808
249872
|
continue;
|
|
249809
249873
|
}
|
|
@@ -249819,12 +249883,12 @@ function pruneDeadPidFiles(configDir, ownPidPath) {
|
|
|
249819
249883
|
}
|
|
249820
249884
|
return pruned;
|
|
249821
249885
|
}
|
|
249822
|
-
var fs42,
|
|
249886
|
+
var fs42, path44, PID_FILE_PATTERN;
|
|
249823
249887
|
var init_pidFilePruning = __esm({
|
|
249824
249888
|
"src/server/pidFilePruning.ts"() {
|
|
249825
249889
|
"use strict";
|
|
249826
249890
|
fs42 = __toESM(require("fs"));
|
|
249827
|
-
|
|
249891
|
+
path44 = __toESM(require("path"));
|
|
249828
249892
|
PID_FILE_PATTERN = /^server-\d+\.pid$/;
|
|
249829
249893
|
}
|
|
249830
249894
|
});
|
|
@@ -249876,7 +249940,7 @@ function readInstalledApplicationVersion(configHome, entryPath, fileSystem = fs4
|
|
|
249876
249940
|
if (!entryPath) {
|
|
249877
249941
|
return null;
|
|
249878
249942
|
}
|
|
249879
|
-
const versionsDir =
|
|
249943
|
+
const versionsDir = path45.join(configHome, "versions");
|
|
249880
249944
|
let entries;
|
|
249881
249945
|
try {
|
|
249882
249946
|
entries = fileSystem.readdirSync(versionsDir);
|
|
@@ -249889,9 +249953,9 @@ function readInstalledApplicationVersion(configHome, entryPath, fileSystem = fs4
|
|
|
249889
249953
|
}
|
|
249890
249954
|
try {
|
|
249891
249955
|
const pointer = JSON.parse(
|
|
249892
|
-
fileSystem.readFileSync(
|
|
249956
|
+
fileSystem.readFileSync(path45.join(versionsDir, entry), "utf8")
|
|
249893
249957
|
);
|
|
249894
|
-
if (typeof pointer.version === "string" && typeof pointer.path === "string" &&
|
|
249958
|
+
if (typeof pointer.version === "string" && typeof pointer.path === "string" && path45.resolve(pointer.path) === path45.resolve(entryPath)) {
|
|
249895
249959
|
return pointer.version;
|
|
249896
249960
|
}
|
|
249897
249961
|
} catch {
|
|
@@ -249948,14 +250012,14 @@ function writePidFileAtomically(pidPath, pid) {
|
|
|
249948
250012
|
}
|
|
249949
250013
|
return directWriteSuccess;
|
|
249950
250014
|
}
|
|
249951
|
-
var import_express4, fs43, http8,
|
|
250015
|
+
var import_express4, fs43, http8, path45, FATAL_EXIT_WATCHDOG_MS, LEDGER_CLOSE_TIMEOUT_MS, ServeInconsistencyError, TakeoverRefusalError, INGRESS_CONNECTION_ESCALATION_MS, STOP_STAGE_TIMEOUT_MS, STOP_TOTAL_TIMEOUT_MS, SERVE_INCONSISTENCY_REBIND_TIMEOUT_MS, OCCUPANT_ENDPOINT_GRACE_MS, Daemon;
|
|
249952
250016
|
var init_Daemon = __esm({
|
|
249953
250017
|
"src/server/Daemon.ts"() {
|
|
249954
250018
|
"use strict";
|
|
249955
250019
|
import_express4 = __toESM(require_express2());
|
|
249956
250020
|
fs43 = __toESM(require("fs"));
|
|
249957
250021
|
http8 = __toESM(require("http"));
|
|
249958
|
-
|
|
250022
|
+
path45 = __toESM(require("path"));
|
|
249959
250023
|
init_ipcEndpoint();
|
|
249960
250024
|
init_protocolVersion();
|
|
249961
250025
|
init_tcpPortAvailability();
|
|
@@ -250236,7 +250300,7 @@ var init_Daemon = __esm({
|
|
|
250236
250300
|
* test, so the invariant that write and unlink agree could not be asserted.
|
|
250237
250301
|
*/
|
|
250238
250302
|
pidFilePath() {
|
|
250239
|
-
return
|
|
250303
|
+
return path45.join(this.CONFIG_DIR, `server-${this.boundHttpPort ?? this.HTTP_PORT}.pid`);
|
|
250240
250304
|
}
|
|
250241
250305
|
getHttpBaseUrl() {
|
|
250242
250306
|
const host = ["0.0.0.0", "::", ""].includes(this.config.server.host) ? "127.0.0.1" : this.config.server.host;
|
|
@@ -250515,7 +250579,7 @@ var init_Daemon = __esm({
|
|
|
250515
250579
|
const server = this.httpServer;
|
|
250516
250580
|
this.httpServer = null;
|
|
250517
250581
|
this.closingHttpServer = server;
|
|
250518
|
-
const httpClose = new Promise((
|
|
250582
|
+
const httpClose = new Promise((resolve11) => {
|
|
250519
250583
|
let settled = false;
|
|
250520
250584
|
let escalation;
|
|
250521
250585
|
const finish = () => {
|
|
@@ -250530,7 +250594,7 @@ var init_Daemon = __esm({
|
|
|
250530
250594
|
if (this.closingHttpServer === server) {
|
|
250531
250595
|
this.closingHttpServer = null;
|
|
250532
250596
|
}
|
|
250533
|
-
|
|
250597
|
+
resolve11();
|
|
250534
250598
|
};
|
|
250535
250599
|
if (!force) {
|
|
250536
250600
|
try {
|
|
@@ -250659,7 +250723,7 @@ var init_Daemon = __esm({
|
|
|
250659
250723
|
return true;
|
|
250660
250724
|
}
|
|
250661
250725
|
}
|
|
250662
|
-
await new Promise((
|
|
250726
|
+
await new Promise((resolve11) => setTimeout(resolve11, 100));
|
|
250663
250727
|
}
|
|
250664
250728
|
return false;
|
|
250665
250729
|
}
|
|
@@ -250669,12 +250733,12 @@ var init_Daemon = __esm({
|
|
|
250669
250733
|
}
|
|
250670
250734
|
for (let attempt = 0; attempt < 20; attempt++) {
|
|
250671
250735
|
if (!fs43.existsSync(this.SOCKET_PATH)) {
|
|
250672
|
-
await new Promise((
|
|
250736
|
+
await new Promise((resolve11) => setTimeout(resolve11, 100));
|
|
250673
250737
|
if (!fs43.existsSync(this.SOCKET_PATH)) {
|
|
250674
250738
|
return;
|
|
250675
250739
|
}
|
|
250676
250740
|
}
|
|
250677
|
-
await new Promise((
|
|
250741
|
+
await new Promise((resolve11) => setTimeout(resolve11, 50));
|
|
250678
250742
|
}
|
|
250679
250743
|
}
|
|
250680
250744
|
async isSqlPreviewDaemonProcess(pid) {
|
|
@@ -250682,14 +250746,14 @@ var init_Daemon = __esm({
|
|
|
250682
250746
|
return status?.service === DAEMON_SERVICE_IDENTITY && status.pid === pid;
|
|
250683
250747
|
}
|
|
250684
250748
|
async readExistingDaemonStatus(host = this.config.server.host, port = this.HTTP_PORT) {
|
|
250685
|
-
return new Promise((
|
|
250749
|
+
return new Promise((resolve11) => {
|
|
250686
250750
|
let settled = false;
|
|
250687
250751
|
const settle2 = (status) => {
|
|
250688
250752
|
if (settled) {
|
|
250689
250753
|
return;
|
|
250690
250754
|
}
|
|
250691
250755
|
settled = true;
|
|
250692
|
-
|
|
250756
|
+
resolve11(status);
|
|
250693
250757
|
};
|
|
250694
250758
|
const req = http8.get(
|
|
250695
250759
|
{
|
|
@@ -250743,7 +250807,7 @@ var init_Daemon = __esm({
|
|
|
250743
250807
|
if (Date.now() >= deadline) {
|
|
250744
250808
|
return false;
|
|
250745
250809
|
}
|
|
250746
|
-
await new Promise((
|
|
250810
|
+
await new Promise((resolve11) => setTimeout(resolve11, 50));
|
|
250747
250811
|
}
|
|
250748
250812
|
}
|
|
250749
250813
|
async resolveEndpointOccupant() {
|
|
@@ -250790,7 +250854,7 @@ var init_Daemon = __esm({
|
|
|
250790
250854
|
}
|
|
250791
250855
|
}
|
|
250792
250856
|
async start() {
|
|
250793
|
-
const pidPath =
|
|
250857
|
+
const pidPath = path45.join(this.CONFIG_DIR, `server-${this.HTTP_PORT}.pid`);
|
|
250794
250858
|
const shouldFallbackToEphemeral = this.resolvedConfig?.sources["server.port"] === "default";
|
|
250795
250859
|
let deferPidClaimUntilAfterBind = this.HTTP_PORT === 0 || shouldFallbackToEphemeral;
|
|
250796
250860
|
try {
|
|
@@ -250899,7 +250963,7 @@ var init_Daemon = __esm({
|
|
|
250899
250963
|
}
|
|
250900
250964
|
try {
|
|
250901
250965
|
await this.initializeLedger();
|
|
250902
|
-
const bindHttp = (port) => new Promise((
|
|
250966
|
+
const bindHttp = (port) => new Promise((resolve11, reject) => {
|
|
250903
250967
|
let bindError;
|
|
250904
250968
|
const server = this.app.listen(port, this.config.server.host, () => {
|
|
250905
250969
|
const addr = server.address();
|
|
@@ -250958,7 +251022,7 @@ var init_Daemon = __esm({
|
|
|
250958
251022
|
process.exit(1);
|
|
250959
251023
|
});
|
|
250960
251024
|
this.state = "running";
|
|
250961
|
-
|
|
251025
|
+
resolve11();
|
|
250962
251026
|
});
|
|
250963
251027
|
this.httpServer = server;
|
|
250964
251028
|
server.on("error", (err) => {
|
|
@@ -250998,7 +251062,7 @@ var init_Daemon = __esm({
|
|
|
250998
251062
|
this.isStdioMode = true;
|
|
250999
251063
|
ConsoleLogger.getInstance().setUseStdErr(true);
|
|
251000
251064
|
await this.initializeLedger();
|
|
251001
|
-
await new Promise((
|
|
251065
|
+
await new Promise((resolve11, reject) => {
|
|
251002
251066
|
const server = this.app.listen(0, "127.0.0.1", () => {
|
|
251003
251067
|
const addr = server.address();
|
|
251004
251068
|
const listening = server.listening === true;
|
|
@@ -251020,7 +251084,7 @@ var init_Daemon = __esm({
|
|
|
251020
251084
|
logger.error("[Daemon] Background HTTP server error:", err);
|
|
251021
251085
|
});
|
|
251022
251086
|
this.state = "running";
|
|
251023
|
-
|
|
251087
|
+
resolve11();
|
|
251024
251088
|
});
|
|
251025
251089
|
this.httpServer = server;
|
|
251026
251090
|
server.on("error", reject);
|
|
@@ -251093,10 +251157,10 @@ var init_Daemon = __esm({
|
|
|
251093
251157
|
*/
|
|
251094
251158
|
async withStopBudget(label, work, budgetMs) {
|
|
251095
251159
|
let timer;
|
|
251096
|
-
const deadline = new Promise((
|
|
251160
|
+
const deadline = new Promise((resolve11) => {
|
|
251097
251161
|
timer = setTimeout(() => {
|
|
251098
251162
|
logger.warn(`[Daemon] Shutdown stage "${label}" exceeded its ${budgetMs}ms budget.`);
|
|
251099
|
-
|
|
251163
|
+
resolve11();
|
|
251100
251164
|
}, budgetMs);
|
|
251101
251165
|
});
|
|
251102
251166
|
await Promise.race([
|
|
@@ -251135,12 +251199,12 @@ var init_Daemon = __esm({
|
|
|
251135
251199
|
const service = this.ledgerService;
|
|
251136
251200
|
this.ledgerService = null;
|
|
251137
251201
|
let timer;
|
|
251138
|
-
const closeDeadline = new Promise((
|
|
251202
|
+
const closeDeadline = new Promise((resolve11) => {
|
|
251139
251203
|
timer = setTimeout(() => {
|
|
251140
251204
|
logger.warn(
|
|
251141
251205
|
"[Daemon] Ledger close exceeded its budget; pending entries may be unwritten."
|
|
251142
251206
|
);
|
|
251143
|
-
|
|
251207
|
+
resolve11();
|
|
251144
251208
|
}, LEDGER_CLOSE_TIMEOUT_MS);
|
|
251145
251209
|
});
|
|
251146
251210
|
await Promise.race([
|
|
@@ -251269,7 +251333,7 @@ async function probeSharedDaemon(port, timeoutMs = 500, expected) {
|
|
|
251269
251333
|
}
|
|
251270
251334
|
}
|
|
251271
251335
|
if (attempt < MAX_ATTEMPTS) {
|
|
251272
|
-
await new Promise((
|
|
251336
|
+
await new Promise((resolve11) => setTimeout(resolve11, retryDelaysMs[attempt - 1]));
|
|
251273
251337
|
}
|
|
251274
251338
|
}
|
|
251275
251339
|
return { attempts: MAX_ATTEMPTS, failureReason: lastFailureReason };
|
|
@@ -251298,17 +251362,24 @@ function confirmsExpectedInstance(expected, identity2) {
|
|
|
251298
251362
|
if (expected.token && identity2.pid === void 0) {
|
|
251299
251363
|
return false;
|
|
251300
251364
|
}
|
|
251301
|
-
|
|
251365
|
+
if (expected.pid === void 0 || expected.startedAt === void 0) {
|
|
251366
|
+
return true;
|
|
251367
|
+
}
|
|
251368
|
+
return classifyRecordInstance(
|
|
251369
|
+
{ pid: expected.pid, startedAt: expected.startedAt },
|
|
251370
|
+
identity2,
|
|
251371
|
+
Date.now()
|
|
251372
|
+
) !== "mismatch";
|
|
251302
251373
|
}
|
|
251303
251374
|
function probeSharedDaemonOnce(port, timeoutMs, expected) {
|
|
251304
|
-
return new Promise((
|
|
251375
|
+
return new Promise((resolve11) => {
|
|
251305
251376
|
let settled = false;
|
|
251306
251377
|
const settle2 = (outcome) => {
|
|
251307
251378
|
if (settled) {
|
|
251308
251379
|
return;
|
|
251309
251380
|
}
|
|
251310
251381
|
settled = true;
|
|
251311
|
-
|
|
251382
|
+
resolve11(outcome);
|
|
251312
251383
|
};
|
|
251313
251384
|
const request2 = http.get(
|
|
251314
251385
|
{
|
|
@@ -251353,10 +251424,33 @@ function probeSharedDaemonOnce(port, timeoutMs, expected) {
|
|
|
251353
251424
|
});
|
|
251354
251425
|
});
|
|
251355
251426
|
}
|
|
251427
|
+
function isTokenAccepted(port, token, timeoutMs) {
|
|
251428
|
+
return new Promise((resolve11) => {
|
|
251429
|
+
const request2 = http.get(
|
|
251430
|
+
{
|
|
251431
|
+
host: "127.0.0.1",
|
|
251432
|
+
port,
|
|
251433
|
+
path: "/bridge-token-check",
|
|
251434
|
+
timeout: timeoutMs,
|
|
251435
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
251436
|
+
},
|
|
251437
|
+
(response) => {
|
|
251438
|
+
response.resume();
|
|
251439
|
+
resolve11(response.statusCode !== 401 && response.statusCode !== 403);
|
|
251440
|
+
}
|
|
251441
|
+
);
|
|
251442
|
+
request2.on("timeout", () => {
|
|
251443
|
+
request2.destroy();
|
|
251444
|
+
resolve11(true);
|
|
251445
|
+
});
|
|
251446
|
+
request2.on("error", () => resolve11(true));
|
|
251447
|
+
});
|
|
251448
|
+
}
|
|
251356
251449
|
|
|
251357
251450
|
// src/server/standalone.ts
|
|
251358
251451
|
init_StdioBridge();
|
|
251359
251452
|
init_DaemonAuthToken();
|
|
251453
|
+
init_AgentToken();
|
|
251360
251454
|
init_ConfigLoader();
|
|
251361
251455
|
|
|
251362
251456
|
// src/server/cli/subcommands.ts
|
|
@@ -251790,7 +251884,7 @@ var _NodeRuntimeProvisioner = class {
|
|
|
251790
251884
|
if (Date.now() - startedAt > maxWaitMs) {
|
|
251791
251885
|
throw new Error(`Timed out waiting for Node runtime provisioning lock: ${lockDir}`);
|
|
251792
251886
|
}
|
|
251793
|
-
await new Promise((
|
|
251887
|
+
await new Promise((resolve11) => setTimeout(resolve11, PROVISION_LOCK_POLL_MS));
|
|
251794
251888
|
}
|
|
251795
251889
|
}
|
|
251796
251890
|
isStaleLock(lockDir, staleMs) {
|
|
@@ -252359,7 +252453,7 @@ async function installCommand(deps = {}) {
|
|
|
252359
252453
|
const runner = deps.commandRunner ?? createCommandRunner();
|
|
252360
252454
|
const adapter2 = deps.adapter ?? createSupervisorAdapter(platform2, runner, uid);
|
|
252361
252455
|
const readStatus = deps.readStatus ?? readGrainServiceStatus;
|
|
252362
|
-
const wait = deps.wait ?? ((milliseconds) => new Promise((
|
|
252456
|
+
const wait = deps.wait ?? ((milliseconds) => new Promise((resolve11) => setTimeout(resolve11, milliseconds)));
|
|
252363
252457
|
const writeOutput = deps.writeOutput ?? ((message) => console.log(message));
|
|
252364
252458
|
const telemetryConsentFlag = deps.telemetryConsent;
|
|
252365
252459
|
const standalonePath = deps.standalonePath ?? require.main?.filename;
|
|
@@ -252716,7 +252810,7 @@ init_startCommand();
|
|
|
252716
252810
|
init_supervisorAdapter();
|
|
252717
252811
|
init_localBrowserPaths();
|
|
252718
252812
|
function fetchJson(url3, token, method = "GET", body) {
|
|
252719
|
-
return new Promise((
|
|
252813
|
+
return new Promise((resolve11, reject) => {
|
|
252720
252814
|
const payload = body === void 0 ? void 0 : JSON.stringify(body);
|
|
252721
252815
|
const parsed = new URL(url3);
|
|
252722
252816
|
const req = http6.request(
|
|
@@ -252745,7 +252839,7 @@ function fetchJson(url3, token, method = "GET", body) {
|
|
|
252745
252839
|
} catch {
|
|
252746
252840
|
data = void 0;
|
|
252747
252841
|
}
|
|
252748
|
-
|
|
252842
|
+
resolve11({ status: res.statusCode ?? 0, data });
|
|
252749
252843
|
});
|
|
252750
252844
|
}
|
|
252751
252845
|
);
|
|
@@ -252951,8 +253045,8 @@ function resolveNotSetUpMessage(hasConnectionsEnv) {
|
|
|
252951
253045
|
var SERVICE_START_FLUSH_BUDGET_MS = 2e3;
|
|
252952
253046
|
async function flushWithinBudget(telemetry, budgetMs) {
|
|
252953
253047
|
let timer;
|
|
252954
|
-
const budget = new Promise((
|
|
252955
|
-
timer = setTimeout(
|
|
253048
|
+
const budget = new Promise((resolve11) => {
|
|
253049
|
+
timer = setTimeout(resolve11, budgetMs);
|
|
252956
253050
|
});
|
|
252957
253051
|
await Promise.race([telemetry.flush().catch(() => void 0), budget]);
|
|
252958
253052
|
if (timer) {
|
|
@@ -253002,8 +253096,8 @@ async function handleLaunchFailureMarker(configDir, telemetry) {
|
|
|
253002
253096
|
});
|
|
253003
253097
|
if (isLocalTelemetry) {
|
|
253004
253098
|
let timer;
|
|
253005
|
-
const budget = new Promise((
|
|
253006
|
-
timer = setTimeout(
|
|
253099
|
+
const budget = new Promise((resolve11) => {
|
|
253100
|
+
timer = setTimeout(resolve11, SERVICE_START_FLUSH_BUDGET_MS);
|
|
253007
253101
|
});
|
|
253008
253102
|
await Promise.race([activeTelemetry.dispose().catch(() => void 0), budget]);
|
|
253009
253103
|
if (timer) {
|
|
@@ -253025,12 +253119,12 @@ async function main() {
|
|
|
253025
253119
|
const configDir = defaultDaemonConfigDir();
|
|
253026
253120
|
const { address, source, record: record2 } = resolveDaemonAddress({ args, env: process.env, configDir });
|
|
253027
253121
|
if (address) {
|
|
253028
|
-
const
|
|
253029
|
-
|
|
253030
|
-
|
|
253031
|
-
|
|
253032
|
-
|
|
253033
|
-
const probe =
|
|
253122
|
+
const accessToken = readDaemonAuthToken(configDir);
|
|
253123
|
+
const expected = record2 ? { pid: record2.pid, startedAt: record2.startedAt, token: accessToken } : accessToken ? { token: accessToken } : void 0;
|
|
253124
|
+
const probed = await probeSharedDaemon(address.port, 500, expected);
|
|
253125
|
+
const agentToken = readAgentToken(configDir);
|
|
253126
|
+
const foreignReason = !probed.identity ? void 0 : !agentToken ? "no-agent-token" : await isTokenAccepted(address.port, agentToken, 500) ? void 0 : "agent-token-rejected";
|
|
253127
|
+
const probe = foreignReason ? { attempts: probed.attempts, failureReason: foreignReason } : probed;
|
|
253034
253128
|
if (probe.identity) {
|
|
253035
253129
|
console.error(
|
|
253036
253130
|
`[grain] bridging stdio to shared daemon v${probe.identity.version ?? "?"} on ${address.host}:${address.port} (via ${source}, RFC-082) after ${probe.attempts} attempt(s)`
|
|
@@ -253040,8 +253134,9 @@ async function main() {
|
|
|
253040
253134
|
return;
|
|
253041
253135
|
}
|
|
253042
253136
|
const reasonStr = probe.failureReason === "stale-record" ? `stale-record pid ${expected?.pid}` : probe.failureReason;
|
|
253137
|
+
const detail = probe.failureReason === "no-agent-token" ? `answered, but ${configDir} has no agent-token for this bridge to present` : probe.failureReason === "wrong-instance" || probe.failureReason === "agent-token-rejected" ? `answered, but it does not accept the tokens in ${configDir}, so it belongs to a different Grain home` : void 0;
|
|
253043
253138
|
console.error(
|
|
253044
|
-
`[grain] no shared daemon at ${address.host}:${address.port} (via ${source}) after ${probe.attempts} attempt(s) (${reasonStr}); starting embedded stdio daemon \u2014 this session's queries will not appear in the extension's results panel`
|
|
253139
|
+
(detail ? `[grain] the daemon at ${address.host}:${address.port} (via ${source}) ${detail} (${reasonStr}); check GRAIN_HOME in this MCP server's config. Starting embedded stdio ` : `[grain] no shared daemon at ${address.host}:${address.port} (via ${source}) after ${probe.attempts} attempt(s) (${reasonStr}); starting embedded stdio `) + `daemon \u2014 this session's queries will not appear in the extension's results panel`
|
|
253045
253140
|
);
|
|
253046
253141
|
notSetUpMessage = resolveNotSetUpMessage(Boolean(process.env["GRAIN_CONNECTIONS"]));
|
|
253047
253142
|
} else {
|