@elliemae/encw-leak-runner 1.0.2
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/.eslintrc.cjs +10 -0
- package/.stylelintignore +4 -0
- package/CHANGELOG.md +51 -0
- package/README.md +309 -0
- package/babel.config.cjs +2 -0
- package/bin/leak-runner.ts +9 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/bin/leak-runner.js +792 -0
- package/dist/cjs/analysis/thresholdEvaluator.js +46 -0
- package/dist/cjs/browser/iframeHeapProfiler.js +46 -0
- package/dist/cjs/cli/command.js +16 -0
- package/dist/cjs/cli/commands/listCommand.js +47 -0
- package/dist/cjs/cli/commands/runCommand.js +111 -0
- package/dist/cjs/cli/index.js +42 -0
- package/dist/cjs/config/missingRequiredParamError.js +34 -0
- package/dist/cjs/config/requiredEnvParams.js +57 -0
- package/dist/cjs/config/runnerConfigLoader.js +73 -0
- package/dist/cjs/config/runnerConfigSchema.js +40 -0
- package/dist/cjs/config/sources/cliOverrideConfigSource.js +44 -0
- package/dist/cjs/config/sources/configSource.js +35 -0
- package/dist/cjs/config/sources/envVarConfigSource.js +41 -0
- package/dist/cjs/config/sources/fileConfigSource.js +62 -0
- package/dist/cjs/index.js +52 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/registry/scenarioRegistry.js +51 -0
- package/dist/cjs/reporting/consoleReporter.js +60 -0
- package/dist/cjs/reporting/junitReporter.js +75 -0
- package/dist/cjs/reporting/reporter.js +16 -0
- package/dist/cjs/runner/aiEnhancementStep.js +39 -0
- package/dist/cjs/runner/batchRunner.js +76 -0
- package/dist/cjs/runner/scenarioRunner.js +165 -0
- package/dist/cjs/scenarios/index.js +29 -0
- package/dist/cjs/scenarios/one-admin/export-navigation.scenario.js +50 -0
- package/dist/cjs/scenarios/one-admin/index.js +27 -0
- package/dist/cjs/scenarios/one-admin/page-models/ExportPageModel.js +43 -0
- package/dist/cjs/scenarios/one-admin/page-models/SelectSettingsPageModel.js +47 -0
- package/dist/cjs/scenarios/one-admin/page-models/index.js +26 -0
- package/dist/cjs/types/config.js +27 -0
- package/dist/cjs/types/results.js +16 -0
- package/dist/cjs/types/scenario.js +16 -0
- package/dist/esm/analysis/thresholdEvaluator.js +26 -0
- package/dist/esm/browser/iframeHeapProfiler.js +26 -0
- package/dist/esm/cli/command.js +0 -0
- package/dist/esm/cli/commands/listCommand.js +27 -0
- package/dist/esm/cli/commands/runCommand.js +93 -0
- package/dist/esm/cli/index.js +22 -0
- package/dist/esm/config/missingRequiredParamError.js +14 -0
- package/dist/esm/config/requiredEnvParams.js +37 -0
- package/dist/esm/config/runnerConfigLoader.js +53 -0
- package/dist/esm/config/runnerConfigSchema.js +20 -0
- package/dist/esm/config/sources/cliOverrideConfigSource.js +24 -0
- package/dist/esm/config/sources/configSource.js +15 -0
- package/dist/esm/config/sources/envVarConfigSource.js +21 -0
- package/dist/esm/config/sources/fileConfigSource.js +34 -0
- package/dist/esm/index.js +35 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/registry/scenarioRegistry.js +31 -0
- package/dist/esm/reporting/consoleReporter.js +40 -0
- package/dist/esm/reporting/junitReporter.js +45 -0
- package/dist/esm/reporting/reporter.js +0 -0
- package/dist/esm/runner/aiEnhancementStep.js +22 -0
- package/dist/esm/runner/batchRunner.js +56 -0
- package/dist/esm/runner/scenarioRunner.js +137 -0
- package/dist/esm/scenarios/index.js +9 -0
- package/dist/esm/scenarios/one-admin/export-navigation.scenario.js +33 -0
- package/dist/esm/scenarios/one-admin/index.js +7 -0
- package/dist/esm/scenarios/one-admin/page-models/ExportPageModel.js +23 -0
- package/dist/esm/scenarios/one-admin/page-models/SelectSettingsPageModel.js +27 -0
- package/dist/esm/scenarios/one-admin/page-models/index.js +6 -0
- package/dist/esm/types/config.js +7 -0
- package/dist/esm/types/results.js +0 -0
- package/dist/esm/types/scenario.js +0 -0
- package/dist/types/bin/leak-runner.d.ts +2 -0
- package/dist/types/lib/analysis/tests/thresholdEvaluator.test.d.ts +1 -0
- package/dist/types/lib/analysis/thresholdEvaluator.d.ts +6 -0
- package/dist/types/lib/browser/iframeHeapProfiler.d.ts +9 -0
- package/dist/types/lib/browser/tests/iframeHeapProfiler.test.d.ts +1 -0
- package/dist/types/lib/cli/command.d.ts +17 -0
- package/dist/types/lib/cli/commands/listCommand.d.ts +5 -0
- package/dist/types/lib/cli/commands/runCommand.d.ts +7 -0
- package/dist/types/lib/cli/index.d.ts +4 -0
- package/dist/types/lib/config/missingRequiredParamError.d.ts +4 -0
- package/dist/types/lib/config/requiredEnvParams.d.ts +16 -0
- package/dist/types/lib/config/runnerConfigLoader.d.ts +13 -0
- package/dist/types/lib/config/runnerConfigSchema.d.ts +78 -0
- package/dist/types/lib/config/sources/cliOverrideConfigSource.d.ts +14 -0
- package/dist/types/lib/config/sources/configSource.d.ts +14 -0
- package/dist/types/lib/config/sources/envVarConfigSource.d.ts +7 -0
- package/dist/types/lib/config/sources/fileConfigSource.d.ts +9 -0
- package/dist/types/lib/config/tests/cliOverrideConfigSource.test.d.ts +1 -0
- package/dist/types/lib/config/tests/envVarConfigSource.test.d.ts +1 -0
- package/dist/types/lib/config/tests/fileConfigSource.test.d.ts +1 -0
- package/dist/types/lib/config/tests/requiredEnvParams.test.d.ts +1 -0
- package/dist/types/lib/config/tests/runnerConfigLoader.test.d.ts +1 -0
- package/dist/types/lib/index.d.ts +18 -0
- package/dist/types/lib/registry/scenarioRegistry.d.ts +18 -0
- package/dist/types/lib/registry/tests/scenarioRegistry.test.d.ts +1 -0
- package/dist/types/lib/reporting/consoleReporter.d.ts +5 -0
- package/dist/types/lib/reporting/junitReporter.d.ts +5 -0
- package/dist/types/lib/reporting/reporter.d.ts +4 -0
- package/dist/types/lib/reporting/tests/consoleReporter.test.d.ts +1 -0
- package/dist/types/lib/reporting/tests/junitReporter.test.d.ts +1 -0
- package/dist/types/lib/runner/aiEnhancementStep.d.ts +15 -0
- package/dist/types/lib/runner/batchRunner.d.ts +14 -0
- package/dist/types/lib/runner/scenarioRunner.d.ts +15 -0
- package/dist/types/lib/runner/tests/aiEnhancementStep.test.d.ts +1 -0
- package/dist/types/lib/runner/tests/batchRunner.test.d.ts +1 -0
- package/dist/types/lib/runner/tests/scenarioRunner.test.d.ts +1 -0
- package/dist/types/lib/scenarios/index.d.ts +2 -0
- package/dist/types/lib/scenarios/one-admin/export-navigation.scenario.d.ts +2 -0
- package/dist/types/lib/scenarios/one-admin/index.d.ts +2 -0
- package/dist/types/lib/scenarios/one-admin/page-models/ExportPageModel.d.ts +8 -0
- package/dist/types/lib/scenarios/one-admin/page-models/SelectSettingsPageModel.d.ts +10 -0
- package/dist/types/lib/scenarios/one-admin/page-models/index.d.ts +2 -0
- package/dist/types/lib/types/config.d.ts +26 -0
- package/dist/types/lib/types/results.d.ts +19 -0
- package/dist/types/lib/types/scenario.d.ts +17 -0
- package/jest.config.cjs +9 -0
- package/leak-runner.config.json +13 -0
- package/leak-runner.schema.json +27 -0
- package/lib/analysis/tests/thresholdEvaluator.test.ts +125 -0
- package/lib/analysis/thresholdEvaluator.ts +36 -0
- package/lib/browser/iframeHeapProfiler.ts +30 -0
- package/lib/browser/tests/iframeHeapProfiler.test.ts +71 -0
- package/lib/cli/command.ts +19 -0
- package/lib/cli/commands/listCommand.ts +36 -0
- package/lib/cli/commands/runCommand.ts +126 -0
- package/lib/cli/index.ts +25 -0
- package/lib/config/missingRequiredParamError.ts +10 -0
- package/lib/config/requiredEnvParams.ts +50 -0
- package/lib/config/runnerConfigLoader.ts +84 -0
- package/lib/config/runnerConfigSchema.ts +27 -0
- package/lib/config/sources/cliOverrideConfigSource.ts +30 -0
- package/lib/config/sources/configSource.ts +27 -0
- package/lib/config/sources/envVarConfigSource.ts +23 -0
- package/lib/config/sources/fileConfigSource.ts +39 -0
- package/lib/config/tests/cliOverrideConfigSource.test.ts +25 -0
- package/lib/config/tests/envVarConfigSource.test.ts +57 -0
- package/lib/config/tests/fileConfigSource.test.ts +49 -0
- package/lib/config/tests/requiredEnvParams.test.ts +113 -0
- package/lib/config/tests/runnerConfigLoader.test.ts +59 -0
- package/lib/index.ts +37 -0
- package/lib/registry/scenarioRegistry.ts +48 -0
- package/lib/registry/tests/scenarioRegistry.test.ts +96 -0
- package/lib/reporting/consoleReporter.ts +48 -0
- package/lib/reporting/junitReporter.ts +62 -0
- package/lib/reporting/reporter.ts +5 -0
- package/lib/reporting/tests/consoleReporter.test.ts +82 -0
- package/lib/reporting/tests/junitReporter.test.ts +103 -0
- package/lib/runner/aiEnhancementStep.ts +39 -0
- package/lib/runner/batchRunner.ts +71 -0
- package/lib/runner/scenarioRunner.ts +189 -0
- package/lib/runner/tests/aiEnhancementStep.test.ts +174 -0
- package/lib/runner/tests/batchRunner.test.ts +133 -0
- package/lib/runner/tests/scenarioRunner.test.ts +162 -0
- package/lib/scenarios/index.ts +8 -0
- package/lib/scenarios/one-admin/export-navigation.scenario.ts +38 -0
- package/lib/scenarios/one-admin/index.ts +6 -0
- package/lib/scenarios/one-admin/page-models/ExportPageModel.ts +26 -0
- package/lib/scenarios/one-admin/page-models/SelectSettingsPageModel.ts +30 -0
- package/lib/scenarios/one-admin/page-models/index.ts +2 -0
- package/lib/types/config.ts +34 -0
- package/lib/types/results.ts +22 -0
- package/lib/types/scenario.ts +18 -0
- package/package.json +46 -0
- package/reports/analysis/index.html +116 -0
- package/reports/analysis/thresholdEvaluator.ts.html +193 -0
- package/reports/base.css +224 -0
- package/reports/block-navigation.js +87 -0
- package/reports/browser/iframeHeapProfiler.ts.html +175 -0
- package/reports/browser/index.html +116 -0
- package/reports/cli/commands/index.html +131 -0
- package/reports/cli/commands/listCommand.ts.html +193 -0
- package/reports/cli/commands/runCommand.ts.html +463 -0
- package/reports/cli/index.html +116 -0
- package/reports/cli/index.ts.html +160 -0
- package/reports/config/index.html +161 -0
- package/reports/config/missingRequiredParamError.ts.html +115 -0
- package/reports/config/requiredEnvParams.ts.html +235 -0
- package/reports/config/runnerConfigLoader.ts.html +337 -0
- package/reports/config/runnerConfigSchema.ts.html +166 -0
- package/reports/config/sources/cliOverrideConfigSource.ts.html +175 -0
- package/reports/config/sources/configSource.ts.html +166 -0
- package/reports/config/sources/envVarConfigSource.ts.html +154 -0
- package/reports/config/sources/fileConfigSource.ts.html +202 -0
- package/reports/config/sources/index.html +161 -0
- package/reports/favicon.png +0 -0
- package/reports/index.html +296 -0
- package/reports/lcov-report/analysis/index.html +116 -0
- package/reports/lcov-report/analysis/thresholdEvaluator.ts.html +193 -0
- package/reports/lcov-report/base.css +224 -0
- package/reports/lcov-report/block-navigation.js +87 -0
- package/reports/lcov-report/browser/iframeHeapProfiler.ts.html +175 -0
- package/reports/lcov-report/browser/index.html +116 -0
- package/reports/lcov-report/cli/commands/index.html +131 -0
- package/reports/lcov-report/cli/commands/listCommand.ts.html +193 -0
- package/reports/lcov-report/cli/commands/runCommand.ts.html +463 -0
- package/reports/lcov-report/cli/index.html +116 -0
- package/reports/lcov-report/cli/index.ts.html +160 -0
- package/reports/lcov-report/config/index.html +161 -0
- package/reports/lcov-report/config/missingRequiredParamError.ts.html +115 -0
- package/reports/lcov-report/config/requiredEnvParams.ts.html +235 -0
- package/reports/lcov-report/config/runnerConfigLoader.ts.html +337 -0
- package/reports/lcov-report/config/runnerConfigSchema.ts.html +166 -0
- package/reports/lcov-report/config/sources/cliOverrideConfigSource.ts.html +175 -0
- package/reports/lcov-report/config/sources/configSource.ts.html +166 -0
- package/reports/lcov-report/config/sources/envVarConfigSource.ts.html +154 -0
- package/reports/lcov-report/config/sources/fileConfigSource.ts.html +202 -0
- package/reports/lcov-report/config/sources/index.html +161 -0
- package/reports/lcov-report/favicon.png +0 -0
- package/reports/lcov-report/index.html +296 -0
- package/reports/lcov-report/prettify.css +1 -0
- package/reports/lcov-report/prettify.js +2 -0
- package/reports/lcov-report/registry/index.html +116 -0
- package/reports/lcov-report/registry/scenarioRegistry.ts.html +229 -0
- package/reports/lcov-report/reporting/consoleReporter.ts.html +229 -0
- package/reports/lcov-report/reporting/index.html +131 -0
- package/reports/lcov-report/reporting/junitReporter.ts.html +271 -0
- package/reports/lcov-report/runner/aiEnhancementStep.ts.html +202 -0
- package/reports/lcov-report/runner/batchRunner.ts.html +298 -0
- package/reports/lcov-report/runner/index.html +146 -0
- package/reports/lcov-report/runner/scenarioRunner.ts.html +652 -0
- package/reports/lcov-report/scenarios/index.html +116 -0
- package/reports/lcov-report/scenarios/index.ts.html +109 -0
- package/reports/lcov-report/scenarios/one-admin/export-navigation.scenario.ts.html +199 -0
- package/reports/lcov-report/scenarios/one-admin/index.html +131 -0
- package/reports/lcov-report/scenarios/one-admin/index.ts.html +103 -0
- package/reports/lcov-report/scenarios/one-admin/page-models/ExportPageModel.ts.html +163 -0
- package/reports/lcov-report/scenarios/one-admin/page-models/SelectSettingsPageModel.ts.html +175 -0
- package/reports/lcov-report/scenarios/one-admin/page-models/index.html +131 -0
- package/reports/lcov-report/sort-arrow-sprite.png +0 -0
- package/reports/lcov-report/sorter.js +210 -0
- package/reports/lcov-report/types/config.ts.html +187 -0
- package/reports/lcov-report/types/index.html +116 -0
- package/reports/lcov.info +883 -0
- package/reports/prettify.css +1 -0
- package/reports/prettify.js +2 -0
- package/reports/registry/index.html +116 -0
- package/reports/registry/scenarioRegistry.ts.html +229 -0
- package/reports/reporting/consoleReporter.ts.html +229 -0
- package/reports/reporting/index.html +131 -0
- package/reports/reporting/junitReporter.ts.html +271 -0
- package/reports/runner/aiEnhancementStep.ts.html +202 -0
- package/reports/runner/batchRunner.ts.html +298 -0
- package/reports/runner/index.html +146 -0
- package/reports/runner/scenarioRunner.ts.html +652 -0
- package/reports/scenarios/index.html +116 -0
- package/reports/scenarios/index.ts.html +109 -0
- package/reports/scenarios/one-admin/export-navigation.scenario.ts.html +199 -0
- package/reports/scenarios/one-admin/index.html +131 -0
- package/reports/scenarios/one-admin/index.ts.html +103 -0
- package/reports/scenarios/one-admin/page-models/ExportPageModel.ts.html +163 -0
- package/reports/scenarios/one-admin/page-models/SelectSettingsPageModel.ts.html +175 -0
- package/reports/scenarios/one-admin/page-models/index.html +131 -0
- package/reports/sort-arrow-sprite.png +0 -0
- package/reports/sorter.js +210 -0
- package/reports/types/config.ts.html +187 -0
- package/reports/types/index.html +116 -0
- package/stylelint.config.cjs +2 -0
- package/test-report.xml +100 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var thresholdEvaluator_exports = {};
|
|
20
|
+
__export(thresholdEvaluator_exports, {
|
|
21
|
+
ThresholdEvaluator: () => ThresholdEvaluator
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(thresholdEvaluator_exports);
|
|
24
|
+
function toMB(bytes) {
|
|
25
|
+
return (bytes / (1024 * 1024)).toFixed(1);
|
|
26
|
+
}
|
|
27
|
+
class ThresholdEvaluator {
|
|
28
|
+
static evaluate(report, thresholds) {
|
|
29
|
+
const reasons = [];
|
|
30
|
+
if (report.delta.retainedSizeDelta > thresholds.maxRetainedSizeDeltaBytes) {
|
|
31
|
+
reasons.push(
|
|
32
|
+
`Retained size delta ${toMB(report.delta.retainedSizeDelta)} MB exceeds threshold ${toMB(thresholds.maxRetainedSizeDeltaBytes)} MB`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
const newLeakCount = report.delta.newLeakGroups.length;
|
|
36
|
+
if (newLeakCount > thresholds.maxNewLeakGroups) {
|
|
37
|
+
reasons.push(
|
|
38
|
+
`${newLeakCount} new leak groups detected (threshold: ${thresholds.maxNewLeakGroups})`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
if (reasons.length === 0) {
|
|
42
|
+
return { passed: true, reason: null };
|
|
43
|
+
}
|
|
44
|
+
return { passed: false, reason: reasons.join("; ") };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var iframeHeapProfiler_exports = {};
|
|
20
|
+
__export(iframeHeapProfiler_exports, {
|
|
21
|
+
IframeHeapProfiler: () => IframeHeapProfiler
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(iframeHeapProfiler_exports);
|
|
24
|
+
var import_smoked_suite = require("@elliemae/smoked-suite");
|
|
25
|
+
class IframeHeapProfiler extends import_smoked_suite.HeapMemoryProfiler {
|
|
26
|
+
constructor(profiledPage, frame, outputDir) {
|
|
27
|
+
super(profiledPage, outputDir);
|
|
28
|
+
this.profiledPage = profiledPage;
|
|
29
|
+
this.frame = frame;
|
|
30
|
+
}
|
|
31
|
+
profiledPage;
|
|
32
|
+
frame;
|
|
33
|
+
getCDPTarget() {
|
|
34
|
+
return this.isSameOriginAsPage(this.frame) ? this.profiledPage : this.frame;
|
|
35
|
+
}
|
|
36
|
+
isSameOriginAsPage(frame) {
|
|
37
|
+
const frameUrl = frame.url();
|
|
38
|
+
const pageUrl = this.profiledPage.url();
|
|
39
|
+
if (!frameUrl || frameUrl === "about:blank") return true;
|
|
40
|
+
try {
|
|
41
|
+
return new URL(frameUrl).origin === new URL(pageUrl).origin;
|
|
42
|
+
} catch {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var command_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(command_exports);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var listCommand_exports = {};
|
|
20
|
+
__export(listCommand_exports, {
|
|
21
|
+
ListCommand: () => ListCommand
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(listCommand_exports);
|
|
24
|
+
class ListCommand {
|
|
25
|
+
register(program, deps) {
|
|
26
|
+
program.command("list").description("List all registered scenarios").option("--tag <tag>", "Filter by tag").action((options) => {
|
|
27
|
+
const entries = options.tag ? deps.registry.filterByTag(options.tag) : deps.registry.list();
|
|
28
|
+
if (entries.length === 0) {
|
|
29
|
+
process.stdout.write("No scenarios found.\n");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const keyWidth = Math.max(...entries.map((e) => e.key.length), 32);
|
|
33
|
+
process.stdout.write(`
|
|
34
|
+
REGISTERED SCENARIOS (${entries.length})
|
|
35
|
+
|
|
36
|
+
`);
|
|
37
|
+
entries.forEach(({ key, scenario }) => {
|
|
38
|
+
const tags = scenario.tags?.length ? `[${scenario.tags.join(", ")}]` : "";
|
|
39
|
+
process.stdout.write(
|
|
40
|
+
` ${key.padEnd(keyWidth)} ${tags.padEnd(20)} ${scenario.description}
|
|
41
|
+
`
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
process.stdout.write("\n");
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var runCommand_exports = {};
|
|
20
|
+
__export(runCommand_exports, {
|
|
21
|
+
RunCommand: () => RunCommand
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(runCommand_exports);
|
|
24
|
+
var import_batchRunner = require("../../runner/batchRunner.js");
|
|
25
|
+
var import_consoleReporter = require("../../reporting/consoleReporter.js");
|
|
26
|
+
var import_junitReporter = require("../../reporting/junitReporter.js");
|
|
27
|
+
var import_cliOverrideConfigSource = require("../../config/sources/cliOverrideConfigSource.js");
|
|
28
|
+
var import_envVarConfigSource = require("../../config/sources/envVarConfigSource.js");
|
|
29
|
+
var import_fileConfigSource = require("../../config/sources/fileConfigSource.js");
|
|
30
|
+
var import_runnerConfigLoader = require("../../config/runnerConfigLoader.js");
|
|
31
|
+
var import_requiredEnvParams = require("../../config/requiredEnvParams.js");
|
|
32
|
+
class RunCommand {
|
|
33
|
+
register(program, deps) {
|
|
34
|
+
program.command("run [key]").description(
|
|
35
|
+
"Run a scenario by `<microapp>/<id>`, or use --all / --tag to run multiple"
|
|
36
|
+
).option("--all", "Run all registered scenarios").option("--tag <tag>", "Run all scenarios matching a tag").option("--base-url <url>", "Override base URL").option("--instance-id <id>", "Override instance ID").option("--user-id <id>", "Override user ID").option("--output-dir <dir>", "Override output directory").option(
|
|
37
|
+
"--top-n <n>",
|
|
38
|
+
"Override top-N for heap comparison",
|
|
39
|
+
(v) => parseInt(v, 10)
|
|
40
|
+
).option(
|
|
41
|
+
"--headless <bool>",
|
|
42
|
+
"Override headless mode",
|
|
43
|
+
(v) => v !== "false"
|
|
44
|
+
).option("--config-file <path>", "Path to leak-runner.config.json").action(async (key, options) => {
|
|
45
|
+
try {
|
|
46
|
+
const config = this.buildConfig(options, deps);
|
|
47
|
+
const runner = new import_batchRunner.BatchRunner(config, deps.registry);
|
|
48
|
+
const summary = await this.selectSummary(runner, key, options);
|
|
49
|
+
new import_consoleReporter.ConsoleReporter().write(summary);
|
|
50
|
+
await new import_junitReporter.JunitReporter().write(summary, config.runner.outputDir);
|
|
51
|
+
process.exit(summary.failCount > 0 ? 1 : 0);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
if (err instanceof import_requiredEnvParams.MissingRequiredParamError) {
|
|
54
|
+
process.stderr.write(`Configuration error: ${err.message}
|
|
55
|
+
`);
|
|
56
|
+
process.exit(2);
|
|
57
|
+
}
|
|
58
|
+
process.stderr.write(`Fatal: ${err.message}
|
|
59
|
+
`);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
buildConfig(options, deps) {
|
|
65
|
+
const filePath = options.configFile ?? `${process.cwd()}/leak-runner.config.json`;
|
|
66
|
+
const loader = new import_runnerConfigLoader.RunnerConfigLoader([
|
|
67
|
+
new import_fileConfigSource.FileConfigSource(filePath),
|
|
68
|
+
new import_envVarConfigSource.EnvVarConfigSource(),
|
|
69
|
+
new import_cliOverrideConfigSource.CliOverrideConfigSource({
|
|
70
|
+
headless: options.headless,
|
|
71
|
+
outputDir: options.outputDir,
|
|
72
|
+
topN: options.topN
|
|
73
|
+
})
|
|
74
|
+
]);
|
|
75
|
+
const resolved = loader.resolveOptions();
|
|
76
|
+
const env = deps.envParams.resolve({
|
|
77
|
+
baseUrl: options.baseUrl,
|
|
78
|
+
instanceId: options.instanceId,
|
|
79
|
+
userId: options.userId
|
|
80
|
+
});
|
|
81
|
+
let ai;
|
|
82
|
+
if (resolved.aiEnabled) {
|
|
83
|
+
ai = {
|
|
84
|
+
model: resolved.aiModel,
|
|
85
|
+
temperature: resolved.aiTemperature,
|
|
86
|
+
apiKey: process.env.GENICE_API_KEY ?? ""
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return { env, runner: resolved.runner, ai };
|
|
90
|
+
}
|
|
91
|
+
async selectSummary(runner, key, options) {
|
|
92
|
+
if (options.all) return runner.runAll();
|
|
93
|
+
if (options.tag) {
|
|
94
|
+
const summary = await runner.runByTag(options.tag);
|
|
95
|
+
if (summary.results.length === 0) {
|
|
96
|
+
process.stderr.write(
|
|
97
|
+
`Warning: no scenarios matched tag "${options.tag}"
|
|
98
|
+
`
|
|
99
|
+
);
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
return summary;
|
|
103
|
+
}
|
|
104
|
+
if (key) return runner.runByName(key);
|
|
105
|
+
process.stderr.write(
|
|
106
|
+
"Error: specify a scenario key (e.g. one-admin/export-navigation), --all, or --tag <tag>\n"
|
|
107
|
+
);
|
|
108
|
+
process.exit(1);
|
|
109
|
+
throw new Error("unreachable");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var cli_exports = {};
|
|
20
|
+
__export(cli_exports, {
|
|
21
|
+
buildProgram: () => buildProgram,
|
|
22
|
+
defaultDeps: () => defaultDeps
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(cli_exports);
|
|
25
|
+
var import_commander = require("commander");
|
|
26
|
+
var import_runCommand = require("./commands/runCommand.js");
|
|
27
|
+
var import_listCommand = require("./commands/listCommand.js");
|
|
28
|
+
var import_requiredEnvParams = require("../config/requiredEnvParams.js");
|
|
29
|
+
var import_scenarios = require("../scenarios/index.js");
|
|
30
|
+
function buildProgram(deps = defaultDeps()) {
|
|
31
|
+
const program = new import_commander.Command();
|
|
32
|
+
program.name("leak-runner").description("Microapp memory leak runner for Encompass Web").version("1.0.0");
|
|
33
|
+
const commands = [new import_runCommand.RunCommand(), new import_listCommand.ListCommand()];
|
|
34
|
+
commands.forEach((cmd) => cmd.register(program, deps));
|
|
35
|
+
return program;
|
|
36
|
+
}
|
|
37
|
+
function defaultDeps() {
|
|
38
|
+
return {
|
|
39
|
+
registry: import_scenarios.scenarioRegistry,
|
|
40
|
+
envParams: new import_requiredEnvParams.RequiredEnvParamsResolver()
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var missingRequiredParamError_exports = {};
|
|
20
|
+
__export(missingRequiredParamError_exports, {
|
|
21
|
+
MissingRequiredParamError: () => MissingRequiredParamError
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(missingRequiredParamError_exports);
|
|
24
|
+
class MissingRequiredParamError extends Error {
|
|
25
|
+
constructor(missing) {
|
|
26
|
+
super(
|
|
27
|
+
`Missing required parameter(s): ${missing.join(", ")}.
|
|
28
|
+
Provide via CLI flag (--base-url / --instance-id / --user-id) or env var (BASE_URL / ENCW_INSTANCE_ID / ENCW_USER_ID / ENCW_PASSWORD).`
|
|
29
|
+
);
|
|
30
|
+
this.missing = missing;
|
|
31
|
+
this.name = "MissingRequiredParamError";
|
|
32
|
+
}
|
|
33
|
+
missing;
|
|
34
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var requiredEnvParams_exports = {};
|
|
20
|
+
__export(requiredEnvParams_exports, {
|
|
21
|
+
MissingRequiredParamError: () => import_missingRequiredParamError.MissingRequiredParamError,
|
|
22
|
+
RequiredEnvParamsResolver: () => RequiredEnvParamsResolver
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(requiredEnvParams_exports);
|
|
25
|
+
var import_missingRequiredParamError = require("./missingRequiredParamError.js");
|
|
26
|
+
class RequiredEnvParamsResolver {
|
|
27
|
+
resolve(cliOpts) {
|
|
28
|
+
const baseUrl = this.resolveBaseUrl(cliOpts);
|
|
29
|
+
const instanceId = this.resolveInstanceId(cliOpts);
|
|
30
|
+
const userId = this.resolveUserId(cliOpts);
|
|
31
|
+
const password = this.resolvePassword();
|
|
32
|
+
const params = { baseUrl, instanceId, userId, password };
|
|
33
|
+
const missing = this.collectMissing(params);
|
|
34
|
+
if (missing.length > 0) throw new import_missingRequiredParamError.MissingRequiredParamError(missing);
|
|
35
|
+
return params;
|
|
36
|
+
}
|
|
37
|
+
resolveBaseUrl(cliOpts) {
|
|
38
|
+
return cliOpts.baseUrl || process.env.BASE_URL || "";
|
|
39
|
+
}
|
|
40
|
+
resolveInstanceId(cliOpts) {
|
|
41
|
+
return cliOpts.instanceId || process.env.ENCW_INSTANCE_ID || "";
|
|
42
|
+
}
|
|
43
|
+
resolveUserId(cliOpts) {
|
|
44
|
+
return cliOpts.userId || process.env.ENCW_USER_ID || "";
|
|
45
|
+
}
|
|
46
|
+
resolvePassword() {
|
|
47
|
+
return process.env.ENCW_PASSWORD || "";
|
|
48
|
+
}
|
|
49
|
+
collectMissing(params) {
|
|
50
|
+
const missing = [];
|
|
51
|
+
if (!params.baseUrl) missing.push("baseUrl");
|
|
52
|
+
if (!params.instanceId) missing.push("instanceId");
|
|
53
|
+
if (!params.userId) missing.push("userId");
|
|
54
|
+
if (!params.password) missing.push("password (ENCW_PASSWORD)");
|
|
55
|
+
return missing;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var runnerConfigLoader_exports = {};
|
|
20
|
+
__export(runnerConfigLoader_exports, {
|
|
21
|
+
RunnerConfigLoader: () => RunnerConfigLoader
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(runnerConfigLoader_exports);
|
|
24
|
+
var import_configSource = require("./sources/configSource.js");
|
|
25
|
+
function applyRunnerPayload(acc, payload) {
|
|
26
|
+
return {
|
|
27
|
+
headless: payload.headless ?? acc.headless,
|
|
28
|
+
outputDir: payload.outputDir ?? acc.outputDir,
|
|
29
|
+
topN: payload.topN ?? acc.topN
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function applyAiPayload(acc, payload) {
|
|
33
|
+
return {
|
|
34
|
+
aiEnabled: payload.enabled ?? acc.aiEnabled,
|
|
35
|
+
aiModel: payload.model ?? acc.aiModel,
|
|
36
|
+
aiTemperature: payload.temperature ?? acc.aiTemperature
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function applySource(acc, source) {
|
|
40
|
+
const payload = source.load();
|
|
41
|
+
return {
|
|
42
|
+
runner: payload.runner ? applyRunnerPayload(acc.runner, payload.runner) : acc.runner,
|
|
43
|
+
ai: payload.ai ? applyAiPayload(acc.ai, payload.ai) : acc.ai
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
class RunnerConfigLoader {
|
|
47
|
+
constructor(sources) {
|
|
48
|
+
this.sources = sources;
|
|
49
|
+
}
|
|
50
|
+
sources;
|
|
51
|
+
resolveOptions() {
|
|
52
|
+
const ordered = [...this.sources].sort((a, b) => a.priority - b.priority);
|
|
53
|
+
const initial = {
|
|
54
|
+
runner: {
|
|
55
|
+
headless: import_configSource.BUILT_IN_DEFAULTS.runner.headless ?? true,
|
|
56
|
+
outputDir: import_configSource.BUILT_IN_DEFAULTS.runner.outputDir ?? "./leak-reports/",
|
|
57
|
+
topN: import_configSource.BUILT_IN_DEFAULTS.runner.topN ?? 5
|
|
58
|
+
},
|
|
59
|
+
ai: {
|
|
60
|
+
aiEnabled: import_configSource.BUILT_IN_DEFAULTS.ai.enabled ?? false,
|
|
61
|
+
aiModel: import_configSource.BUILT_IN_DEFAULTS.ai.model ?? "Claude3.7",
|
|
62
|
+
aiTemperature: import_configSource.BUILT_IN_DEFAULTS.ai.temperature ?? 0.3
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const resolved = ordered.reduce(applySource, initial);
|
|
66
|
+
return {
|
|
67
|
+
runner: resolved.runner,
|
|
68
|
+
aiEnabled: resolved.ai.aiEnabled,
|
|
69
|
+
aiModel: resolved.ai.aiModel,
|
|
70
|
+
aiTemperature: resolved.ai.aiTemperature
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var runnerConfigSchema_exports = {};
|
|
20
|
+
__export(runnerConfigSchema_exports, {
|
|
21
|
+
aiConfigFileSchema: () => aiConfigFileSchema,
|
|
22
|
+
runnerConfigFileSchema: () => runnerConfigFileSchema,
|
|
23
|
+
runnerOptionsSchema: () => runnerOptionsSchema
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(runnerConfigSchema_exports);
|
|
26
|
+
var import_zod = require("zod");
|
|
27
|
+
const runnerOptionsSchema = import_zod.z.object({
|
|
28
|
+
headless: import_zod.z.boolean(),
|
|
29
|
+
outputDir: import_zod.z.string().min(1),
|
|
30
|
+
topN: import_zod.z.number().int().min(1)
|
|
31
|
+
}).partial();
|
|
32
|
+
const aiConfigFileSchema = import_zod.z.object({
|
|
33
|
+
enabled: import_zod.z.boolean(),
|
|
34
|
+
model: import_zod.z.string().min(1),
|
|
35
|
+
temperature: import_zod.z.number().min(0).max(2)
|
|
36
|
+
}).partial();
|
|
37
|
+
const runnerConfigFileSchema = import_zod.z.object({
|
|
38
|
+
runner: runnerOptionsSchema,
|
|
39
|
+
ai: aiConfigFileSchema
|
|
40
|
+
}).partial().strict();
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var cliOverrideConfigSource_exports = {};
|
|
20
|
+
__export(cliOverrideConfigSource_exports, {
|
|
21
|
+
CliOverrideConfigSource: () => CliOverrideConfigSource
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(cliOverrideConfigSource_exports);
|
|
24
|
+
class CliOverrideConfigSource {
|
|
25
|
+
constructor(overrides) {
|
|
26
|
+
this.overrides = overrides;
|
|
27
|
+
}
|
|
28
|
+
overrides;
|
|
29
|
+
priority = 3;
|
|
30
|
+
name = "cli";
|
|
31
|
+
load() {
|
|
32
|
+
const runner = {};
|
|
33
|
+
if (this.overrides.headless !== void 0) {
|
|
34
|
+
runner.headless = this.overrides.headless;
|
|
35
|
+
}
|
|
36
|
+
if (this.overrides.outputDir !== void 0) {
|
|
37
|
+
runner.outputDir = this.overrides.outputDir;
|
|
38
|
+
}
|
|
39
|
+
if (this.overrides.topN !== void 0) {
|
|
40
|
+
runner.topN = this.overrides.topN;
|
|
41
|
+
}
|
|
42
|
+
return Object.keys(runner).length === 0 ? {} : { runner };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var configSource_exports = {};
|
|
20
|
+
__export(configSource_exports, {
|
|
21
|
+
BUILT_IN_DEFAULTS: () => BUILT_IN_DEFAULTS
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(configSource_exports);
|
|
24
|
+
const BUILT_IN_DEFAULTS = {
|
|
25
|
+
runner: {
|
|
26
|
+
headless: true,
|
|
27
|
+
outputDir: "./leak-reports/",
|
|
28
|
+
topN: 5
|
|
29
|
+
},
|
|
30
|
+
ai: {
|
|
31
|
+
enabled: false,
|
|
32
|
+
model: "Claude3.7",
|
|
33
|
+
temperature: 0.3
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var envVarConfigSource_exports = {};
|
|
20
|
+
__export(envVarConfigSource_exports, {
|
|
21
|
+
EnvVarConfigSource: () => EnvVarConfigSource
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(envVarConfigSource_exports);
|
|
24
|
+
class EnvVarConfigSource {
|
|
25
|
+
priority = 2;
|
|
26
|
+
name = "env";
|
|
27
|
+
load() {
|
|
28
|
+
const runner = {};
|
|
29
|
+
if (process.env.HEADLESS !== void 0) {
|
|
30
|
+
runner.headless = process.env.HEADLESS !== "false";
|
|
31
|
+
}
|
|
32
|
+
if (process.env.LEAK_OUTPUT_DIR) {
|
|
33
|
+
runner.outputDir = process.env.LEAK_OUTPUT_DIR;
|
|
34
|
+
}
|
|
35
|
+
if (process.env.LEAK_TOP_N) {
|
|
36
|
+
const parsed = parseInt(process.env.LEAK_TOP_N, 10);
|
|
37
|
+
if (Number.isFinite(parsed) && parsed > 0) runner.topN = parsed;
|
|
38
|
+
}
|
|
39
|
+
return Object.keys(runner).length === 0 ? {} : { runner };
|
|
40
|
+
}
|
|
41
|
+
}
|