@shadowcoderr/context-graph 0.3.0

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.
Files changed (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +185 -0
  3. package/dist/analyzers/a11y-extractor.d.ts +15 -0
  4. package/dist/analyzers/a11y-extractor.d.ts.map +1 -0
  5. package/dist/analyzers/a11y-extractor.js +148 -0
  6. package/dist/analyzers/a11y-extractor.js.map +1 -0
  7. package/dist/analyzers/dom-analyzer.d.ts +20 -0
  8. package/dist/analyzers/dom-analyzer.d.ts.map +1 -0
  9. package/dist/analyzers/dom-analyzer.js +126 -0
  10. package/dist/analyzers/dom-analyzer.js.map +1 -0
  11. package/dist/analyzers/locator-generator.d.ts +13 -0
  12. package/dist/analyzers/locator-generator.d.ts.map +1 -0
  13. package/dist/analyzers/locator-generator.js +381 -0
  14. package/dist/analyzers/locator-generator.js.map +1 -0
  15. package/dist/analyzers/network-logger.d.ts +15 -0
  16. package/dist/analyzers/network-logger.d.ts.map +1 -0
  17. package/dist/analyzers/network-logger.js +71 -0
  18. package/dist/analyzers/network-logger.js.map +1 -0
  19. package/dist/cli/index.d.ts +2 -0
  20. package/dist/cli/index.d.ts.map +1 -0
  21. package/dist/cli/index.js +155 -0
  22. package/dist/cli/index.js.map +1 -0
  23. package/dist/config/defaults.d.ts +3 -0
  24. package/dist/config/defaults.d.ts.map +1 -0
  25. package/dist/config/defaults.js +54 -0
  26. package/dist/config/defaults.js.map +1 -0
  27. package/dist/config/loader.d.ts +3 -0
  28. package/dist/config/loader.d.ts.map +1 -0
  29. package/dist/config/loader.js +75 -0
  30. package/dist/config/loader.js.map +1 -0
  31. package/dist/config/schema.d.ts +168 -0
  32. package/dist/config/schema.d.ts.map +1 -0
  33. package/dist/config/schema.js +104 -0
  34. package/dist/config/schema.js.map +1 -0
  35. package/dist/core/browser-adapter.d.ts +24 -0
  36. package/dist/core/browser-adapter.d.ts.map +1 -0
  37. package/dist/core/browser-adapter.js +208 -0
  38. package/dist/core/browser-adapter.js.map +1 -0
  39. package/dist/core/capture-engine.d.ts +52 -0
  40. package/dist/core/capture-engine.d.ts.map +1 -0
  41. package/dist/core/capture-engine.js +593 -0
  42. package/dist/core/capture-engine.js.map +1 -0
  43. package/dist/core/runtime.d.ts +38 -0
  44. package/dist/core/runtime.d.ts.map +1 -0
  45. package/dist/core/runtime.js +648 -0
  46. package/dist/core/runtime.js.map +1 -0
  47. package/dist/prompts/init-prompt.d.ts +12 -0
  48. package/dist/prompts/init-prompt.d.ts.map +1 -0
  49. package/dist/prompts/init-prompt.js +128 -0
  50. package/dist/prompts/init-prompt.js.map +1 -0
  51. package/dist/registry/components-registry.d.ts +97 -0
  52. package/dist/registry/components-registry.d.ts.map +1 -0
  53. package/dist/registry/components-registry.js +469 -0
  54. package/dist/registry/components-registry.js.map +1 -0
  55. package/dist/registry/index.d.ts +2 -0
  56. package/dist/registry/index.d.ts.map +1 -0
  57. package/dist/registry/index.js +7 -0
  58. package/dist/registry/index.js.map +1 -0
  59. package/dist/security/patterns.d.ts +4 -0
  60. package/dist/security/patterns.d.ts.map +1 -0
  61. package/dist/security/patterns.js +65 -0
  62. package/dist/security/patterns.js.map +1 -0
  63. package/dist/security/redactor.d.ts +26 -0
  64. package/dist/security/redactor.d.ts.map +1 -0
  65. package/dist/security/redactor.js +128 -0
  66. package/dist/security/redactor.js.map +1 -0
  67. package/dist/security/validator.d.ts +11 -0
  68. package/dist/security/validator.d.ts.map +1 -0
  69. package/dist/security/validator.js +62 -0
  70. package/dist/security/validator.js.map +1 -0
  71. package/dist/storage/engine.d.ts +45 -0
  72. package/dist/storage/engine.d.ts.map +1 -0
  73. package/dist/storage/engine.js +479 -0
  74. package/dist/storage/engine.js.map +1 -0
  75. package/dist/storage/manifest.d.ts +10 -0
  76. package/dist/storage/manifest.d.ts.map +1 -0
  77. package/dist/storage/manifest.js +98 -0
  78. package/dist/storage/manifest.js.map +1 -0
  79. package/dist/storage/serializer.d.ts +9 -0
  80. package/dist/storage/serializer.d.ts.map +1 -0
  81. package/dist/storage/serializer.js +22 -0
  82. package/dist/storage/serializer.js.map +1 -0
  83. package/dist/types/capture.d.ts +206 -0
  84. package/dist/types/capture.d.ts.map +1 -0
  85. package/dist/types/capture.js +3 -0
  86. package/dist/types/capture.js.map +1 -0
  87. package/dist/types/config.d.ts +63 -0
  88. package/dist/types/config.d.ts.map +1 -0
  89. package/dist/types/config.js +3 -0
  90. package/dist/types/config.js.map +1 -0
  91. package/dist/types/registry.d.ts +94 -0
  92. package/dist/types/registry.d.ts.map +1 -0
  93. package/dist/types/registry.js +3 -0
  94. package/dist/types/registry.js.map +1 -0
  95. package/dist/types/storage.d.ts +57 -0
  96. package/dist/types/storage.d.ts.map +1 -0
  97. package/dist/types/storage.js +3 -0
  98. package/dist/types/storage.js.map +1 -0
  99. package/dist/utils/hash.d.ts +3 -0
  100. package/dist/utils/hash.d.ts.map +1 -0
  101. package/dist/utils/hash.js +26 -0
  102. package/dist/utils/hash.js.map +1 -0
  103. package/dist/utils/logger.d.ts +20 -0
  104. package/dist/utils/logger.d.ts.map +1 -0
  105. package/dist/utils/logger.js +86 -0
  106. package/dist/utils/logger.js.map +1 -0
  107. package/dist/utils/pom-generator.d.ts +12 -0
  108. package/dist/utils/pom-generator.d.ts.map +1 -0
  109. package/dist/utils/pom-generator.js +83 -0
  110. package/dist/utils/pom-generator.js.map +1 -0
  111. package/dist/utils/validators.d.ts +7 -0
  112. package/dist/utils/validators.d.ts.map +1 -0
  113. package/dist/utils/validators.js +51 -0
  114. package/dist/utils/validators.js.map +1 -0
  115. package/package.json +70 -0
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ // Developer: Shadow Coderr, Architect
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const commander_1 = require("commander");
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const ora_1 = __importDefault(require("ora"));
10
+ const inquirer_1 = __importDefault(require("inquirer"));
11
+ const runtime_1 = require("../core/runtime");
12
+ const loader_1 = require("../config/loader");
13
+ const validators_1 = require("../utils/validators");
14
+ const logger_1 = require("../utils/logger");
15
+ const program = new commander_1.Command();
16
+ program
17
+ .name('context-graph')
18
+ .description('A deterministic "Flight Data Recorder" for web applications')
19
+ .version('0.3.0');
20
+ program
21
+ .argument('[startUrl]', 'Starting URL (optional)')
22
+ .option('-m, --mode <type>', 'Operating mode (browser|recorder)', 'browser')
23
+ .option('-u, --url <url>', 'Starting URL (optional)')
24
+ .option('-o, --output <path>', 'Output directory', './context-graph-output')
25
+ .option('-c, --config <path>', 'Custom config file path')
26
+ .option('-v, --viewport <WxH>', 'Viewport size (default: 1920x1080)', '1920x1080')
27
+ .option('--headless', 'Run in headless mode', false)
28
+ .option('--no-screenshots', 'Disable screenshot capture')
29
+ .option('--no-network', 'Disable network logging')
30
+ .option('--recorder-capture', 'In recorder mode, replay the recorded script to capture full artifacts (DOM/a11y/locators/network/screenshots)', false)
31
+ .option('--verbose', 'Enable verbose logging', false);
32
+ program.action(async (startUrl, options) => {
33
+ // Handle unhandled rejections
34
+ process.on('unhandledRejection', (reason, promise) => {
35
+ logger_1.logger.error(`Unhandled Rejection at:${promise}, reason:${reason}`);
36
+ });
37
+ try {
38
+ // Load configuration
39
+ const configPath = options.config;
40
+ let config = await (0, loader_1.loadConfig)(configPath);
41
+ // Override config with CLI options
42
+ if (options.output)
43
+ config.storage.outputDir = options.output;
44
+ if (options.headless)
45
+ config.browser.headless = true;
46
+ if (options.viewport) {
47
+ const [width, height] = options.viewport.split('x').map(Number);
48
+ config.browser.viewport = { width, height };
49
+ }
50
+ if (options.noScreenshots)
51
+ config.capture.screenshots.enabled = false;
52
+ if (options.noNetwork)
53
+ config.capture.network.enabled = false;
54
+ if (options.verbose)
55
+ logger_1.logger.level = 0; // DEBUG
56
+ // Validate mode or ask for it
57
+ let mode;
58
+ if (options.mode && ['browser', 'recorder'].includes(options.mode)) {
59
+ mode = options.mode;
60
+ }
61
+ else {
62
+ const modeAnswers = await inquirer_1.default.prompt([
63
+ {
64
+ type: 'list',
65
+ name: 'mode',
66
+ message: 'Select operation mode:',
67
+ choices: [
68
+ { name: 'Browser (Capture Context)', value: 'browser' },
69
+ { name: 'Recorder (Generate Script)', value: 'recorder' }
70
+ ],
71
+ },
72
+ ]);
73
+ mode = modeAnswers.mode;
74
+ }
75
+ // Determine start URL (CLI option takes precedence, then positional arg)
76
+ let finalStartUrl = options.url || startUrl;
77
+ if (finalStartUrl && !(0, validators_1.isValidUrl)(finalStartUrl)) {
78
+ throw new Error(`Invalid URL: ${finalStartUrl}`);
79
+ }
80
+ // If no URL provided, ask for it
81
+ if (!finalStartUrl) {
82
+ const answers = await inquirer_1.default.prompt([
83
+ {
84
+ type: 'input',
85
+ name: 'url',
86
+ message: 'Enter starting URL:',
87
+ validate: (input) => (0, validators_1.isValidUrl)(input) || 'Please enter a valid URL',
88
+ },
89
+ ]);
90
+ finalStartUrl = answers.url;
91
+ }
92
+ // Initialize runtime
93
+ const spinner = (0, ora_1.default)('Initializing...').start();
94
+ const runtime = new runtime_1.RuntimeController(config, mode);
95
+ await runtime.initialize();
96
+ // Branch based on mode
97
+ if (mode === runtime_1.RuntimeMode.RECORDER) {
98
+ // Recorder mode - start Playwright codegen
99
+ spinner.succeed('Runtime initialized');
100
+ await runtime.startRecorder(finalStartUrl, { captureArtifacts: Boolean(options.recorderCapture) });
101
+ return;
102
+ }
103
+ // Browser mode - proceed with existing logic
104
+ // Launch browser
105
+ spinner.text = 'Launching browser...';
106
+ const browser = await runtime.launchBrowser();
107
+ const context = await runtime.createContext(browser);
108
+ // Create page and navigate
109
+ spinner.text = 'Setting up page...';
110
+ const page = await context.newPage();
111
+ await runtime.setupPage(page);
112
+ if (finalStartUrl) {
113
+ spinner.text = `Navigating to ${finalStartUrl}...`;
114
+ await page.goto(finalStartUrl, { waitUntil: 'networkidle' });
115
+ // Give a moment for any post-load scripts to run
116
+ await new Promise(r => setTimeout(r, 1000));
117
+ // Ensure initial page is captured (fallback if events didn't fire)
118
+ await runtime.capturePageIfNeeded(page);
119
+ }
120
+ spinner.stop();
121
+ console.log(chalk_1.default.green('✓ Browser ready!'));
122
+ console.log(chalk_1.default.blue('Navigate through the application. Each page will be captured automatically.'));
123
+ console.log(chalk_1.default.yellow('Press Ctrl+C to stop and save all data...'));
124
+ // Handle browser close event
125
+ let isShuttingDown = false;
126
+ const shutdown = async () => {
127
+ if (isShuttingDown)
128
+ return;
129
+ isShuttingDown = true;
130
+ try {
131
+ console.log('\n' + chalk_1.default.yellow('Shutting down gracefully...'));
132
+ await runtime.shutdown();
133
+ console.log(chalk_1.default.green('✓ All data saved!'));
134
+ console.log(chalk_1.default.blue(`View manifest: ${config.storage.outputDir}/global_manifest.json`));
135
+ setTimeout(() => process.exit(0), 100);
136
+ }
137
+ catch (error) {
138
+ const err = error;
139
+ console.error(chalk_1.default.red(`Error during shutdown: ${err.message}`));
140
+ setTimeout(() => process.exit(1), 100);
141
+ }
142
+ };
143
+ // Listen for browser disconnect
144
+ runtime.onBrowserDisconnect(shutdown);
145
+ // Wait for user to finish
146
+ process.on('SIGINT', shutdown);
147
+ }
148
+ catch (error) {
149
+ const err = error;
150
+ console.error(chalk_1.default.red(`Error: ${err.message}`));
151
+ process.exit(1);
152
+ }
153
+ });
154
+ program.parse();
155
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAAA,sCAAsC;;;;;AAEtC,yCAAoC;AACpC,kDAA0B;AAC1B,8CAAsB;AACtB,wDAAgC;AAChC,6CAAiE;AACjE,6CAA8C;AAC9C,oDAAiD;AACjD,4CAAyC;AAEzC,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,eAAe,CAAC;K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AC,mBAAmB,CAAC,CAAC,CAAC;gBAC9C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,kBAAkB,MAAM,CAAC,OAAO,CAAC,SAAS,uBAAuB,CAAC,CAAC,CAAC;gBAC3F,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACzC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,GAAG,GAAG,KAAc,CAAC;gBAC3B,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,0BAA0B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBAClE,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACzC,CAAC;QACH,CAAC,CAAC;QAEF,gCAAgC;QAChC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAEtC,0BAA0B;QAC1B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,KAAc,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Config } from '../types/config';
2
+ export declare const DEFAULT_CONFIG: Config;
3
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,eAAO,MAAM,cAAc,EAAE,MAiD5B,CAAC"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_CONFIG = void 0;
4
+ exports.DEFAULT_CONFIG = {
5
+ browser: {
6
+ channel: 'msedge',
7
+ headless: false,
8
+ viewport: {
9
+ width: 1920,
10
+ height: 1080,
11
+ },
12
+ slowMo: 0,
13
+ devtools: false,
14
+ },
15
+ capture: {
16
+ screenshots: {
17
+ enabled: true,
18
+ fullPage: true,
19
+ elementTargeting: true,
20
+ },
21
+ network: {
22
+ enabled: true,
23
+ captureHeaders: true,
24
+ captureBody: false,
25
+ },
26
+ accessibility: {
27
+ enabled: true,
28
+ includeHidden: false,
29
+ },
30
+ locators: {
31
+ enabled: true,
32
+ maxElements: 500,
33
+ maxCandidatesPerElement: 6,
34
+ includeUniquenessChecks: true,
35
+ },
36
+ components: {
37
+ enabled: true,
38
+ minOccurrences: 1,
39
+ maxComponents: 1000,
40
+ },
41
+ forceCapture: false,
42
+ },
43
+ security: {
44
+ redactPatterns: ['jwt', 'creditcard', 'ssn'],
45
+ redactHeaders: ['authorization', 'cookie', 'x-api-key'],
46
+ customPatterns: [],
47
+ },
48
+ storage: {
49
+ outputDir: './context-graph-output',
50
+ compression: false,
51
+ prettyJson: true,
52
+ },
53
+ };
54
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":";;;AAGa,QAAA,cAAc,GAAW;IACpC,OAAO,EAAE;QACP,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE;YACR,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;SACb;QACD,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,KAAK;KAChB;IACD,OAAO,EAAE;QACP,WAAW,EAAE;YACX,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,gBAAgB,EAAE,IAAI;SACvB;QACD,OAAO,EAAE;YACP,OAAO,EAAE,IAAI;YACb,cAAc,EAAE,IAAI;YACpB,WAAW,EAAE,KAAK;SACnB;QACD,aAAa,EAAE;YACb,OAAO,EAAE,IAAI;YACb,aAAa,EAAE,KAAK;SACrB;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,GAAG;YAChB,uBAAuB,EAAE,CAAC;YAC1B,uBAAuB,EAAE,IAAI;SAC9B;QACD,UAAU,EAAE;YACV,OAAO,EAAE,IAAI;YACb,cAAc,EAAE,CAAC;YACjB,aAAa,EAAE,IAAI;SACpB;QACD,YAAY,EAAE,KAAK;KACpB;IACD,QAAQ,EAAE;QACR,cAAc,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,CAAC;QAC5C,aAAa,EAAE,CAAC,eAAe,EAAE,QAAQ,EAAE,WAAW,CAAC;QACvD,cAAc,EAAE,EAAE;KACnB;IACD,OAAO,EAAE;QACP,SAAS,EAAE,wBAAwB;QACnC,WAAW,EAAE,KAAK;QAClB,UAAU,EAAE,IAAI;KACjB;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Config } from '../types/config';
2
+ export declare function loadConfig(configPath?: string): Promise<Config>;
3
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKzC,wBAAsB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBrE"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.loadConfig = loadConfig;
37
+ // Developer: Shadow Coderr, Architect
38
+ const fs = __importStar(require("fs-extra"));
39
+ const path = __importStar(require("path"));
40
+ const defaults_1 = require("./defaults");
41
+ const validators_1 = require("../utils/validators");
42
+ const logger_1 = require("../utils/logger");
43
+ async function loadConfig(configPath) {
44
+ let config = { ...defaults_1.DEFAULT_CONFIG };
45
+ if (configPath) {
46
+ const fullPath = path.resolve(configPath);
47
+ if (await fs.pathExists(fullPath)) {
48
+ try {
49
+ const userConfig = await fs.readJson(fullPath);
50
+ config = mergeConfigs(config, userConfig);
51
+ logger_1.logger.info(`Loaded config from ${fullPath}`);
52
+ }
53
+ catch (error) {
54
+ logger_1.logger.warn(`Failed to load config from ${fullPath}: ${error}`);
55
+ }
56
+ }
57
+ else {
58
+ logger_1.logger.warn(`Config file not found: ${fullPath}`);
59
+ }
60
+ }
61
+ const validation = (0, validators_1.validateConfig)(config);
62
+ if (!validation.valid) {
63
+ throw new Error(`Invalid configuration: ${validation.errors.join(', ')}`);
64
+ }
65
+ return config;
66
+ }
67
+ function mergeConfigs(base, override) {
68
+ return {
69
+ browser: { ...base.browser, ...override.browser },
70
+ capture: { ...base.capture, ...override.capture },
71
+ security: { ...base.security, ...override.security },
72
+ storage: { ...base.storage, ...override.storage },
73
+ };
74
+ }
75
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,gCAwBC;AAhCD,sCAAsC;AACtC,6CAA+B;AAC/B,2CAA6B;AAE7B,yCAA4C;AAC5C,oDAAqD;AACrD,4CAAyC;AAElC,KAAK,UAAU,UAAU,CAAC,UAAmB;IAClD,IAAI,MAAM,GAAG,EAAE,GAAG,yBAAc,EAAE,CAAC;IAEnC,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClC,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBAC/C,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;gBAC1C,eAAM,CAAC,IAAI,CAAC,sBAAsB,QAAQ,EAAE,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,eAAM,CAAC,IAAI,CAAC,8BAA8B,QAAQ,KAAK,KAAK,EAAE,CAAC,CAAC;YAClE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,eAAM,CAAC,IAAI,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,IAAA,2BAAc,EAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,0BAA0B,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,QAAyB;IAC3D,OAAO;QACL,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE;QACjD,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE;QACjD,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE;QACpD,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE;KAClD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,168 @@
1
+ export declare const CONFIG_SCHEMA: {
2
+ type: string;
3
+ properties: {
4
+ browser: {
5
+ type: string;
6
+ properties: {
7
+ channel: {
8
+ enum: string[];
9
+ };
10
+ headless: {
11
+ type: string;
12
+ };
13
+ viewport: {
14
+ type: string;
15
+ properties: {
16
+ width: {
17
+ type: string;
18
+ };
19
+ height: {
20
+ type: string;
21
+ };
22
+ };
23
+ required: string[];
24
+ };
25
+ slowMo: {
26
+ type: string;
27
+ };
28
+ devtools: {
29
+ type: string;
30
+ };
31
+ };
32
+ required: string[];
33
+ };
34
+ capture: {
35
+ type: string;
36
+ properties: {
37
+ screenshots: {
38
+ type: string;
39
+ properties: {
40
+ enabled: {
41
+ type: string;
42
+ };
43
+ fullPage: {
44
+ type: string;
45
+ };
46
+ elementTargeting: {
47
+ type: string;
48
+ };
49
+ };
50
+ };
51
+ network: {
52
+ type: string;
53
+ properties: {
54
+ enabled: {
55
+ type: string;
56
+ };
57
+ captureHeaders: {
58
+ type: string;
59
+ };
60
+ captureBody: {
61
+ type: string;
62
+ };
63
+ };
64
+ };
65
+ accessibility: {
66
+ type: string;
67
+ properties: {
68
+ enabled: {
69
+ type: string;
70
+ };
71
+ includeHidden: {
72
+ type: string;
73
+ };
74
+ };
75
+ };
76
+ locators: {
77
+ type: string;
78
+ properties: {
79
+ enabled: {
80
+ type: string;
81
+ };
82
+ maxElements: {
83
+ type: string;
84
+ };
85
+ maxCandidatesPerElement: {
86
+ type: string;
87
+ };
88
+ includeUniquenessChecks: {
89
+ type: string;
90
+ };
91
+ };
92
+ };
93
+ components: {
94
+ type: string;
95
+ properties: {
96
+ enabled: {
97
+ type: string;
98
+ };
99
+ minOccurrences: {
100
+ type: string;
101
+ };
102
+ maxComponents: {
103
+ type: string;
104
+ };
105
+ };
106
+ };
107
+ forceCapture: {
108
+ type: string;
109
+ };
110
+ };
111
+ };
112
+ security: {
113
+ type: string;
114
+ properties: {
115
+ redactPatterns: {
116
+ type: string;
117
+ items: {
118
+ type: string;
119
+ };
120
+ };
121
+ redactHeaders: {
122
+ type: string;
123
+ items: {
124
+ type: string;
125
+ };
126
+ };
127
+ customPatterns: {
128
+ type: string;
129
+ items: {
130
+ type: string;
131
+ properties: {
132
+ name: {
133
+ type: string;
134
+ };
135
+ pattern: {
136
+ type: string;
137
+ };
138
+ replacement: {
139
+ type: string;
140
+ };
141
+ severity: {
142
+ enum: string[];
143
+ };
144
+ };
145
+ required: string[];
146
+ };
147
+ };
148
+ };
149
+ };
150
+ storage: {
151
+ type: string;
152
+ properties: {
153
+ outputDir: {
154
+ type: string;
155
+ };
156
+ compression: {
157
+ type: string;
158
+ };
159
+ prettyJson: {
160
+ type: string;
161
+ };
162
+ };
163
+ required: string[];
164
+ };
165
+ };
166
+ required: string[];
167
+ };
168
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkGzB,CAAC"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONFIG_SCHEMA = void 0;
4
+ // Developer: Shadow Coderr, Architect
5
+ exports.CONFIG_SCHEMA = {
6
+ type: 'object',
7
+ properties: {
8
+ browser: {
9
+ type: 'object',
10
+ properties: {
11
+ channel: { enum: ['msedge', 'chromium', 'firefox'] },
12
+ headless: { type: 'boolean' },
13
+ viewport: {
14
+ type: 'object',
15
+ properties: {
16
+ width: { type: 'number' },
17
+ height: { type: 'number' },
18
+ },
19
+ required: ['width', 'height'],
20
+ },
21
+ slowMo: { type: 'number' },
22
+ devtools: { type: 'boolean' },
23
+ },
24
+ required: ['channel', 'headless', 'viewport', 'slowMo', 'devtools'],
25
+ },
26
+ capture: {
27
+ type: 'object',
28
+ properties: {
29
+ screenshots: {
30
+ type: 'object',
31
+ properties: {
32
+ enabled: { type: 'boolean' },
33
+ fullPage: { type: 'boolean' },
34
+ elementTargeting: { type: 'boolean' },
35
+ },
36
+ },
37
+ network: {
38
+ type: 'object',
39
+ properties: {
40
+ enabled: { type: 'boolean' },
41
+ captureHeaders: { type: 'boolean' },
42
+ captureBody: { type: 'boolean' },
43
+ },
44
+ },
45
+ accessibility: {
46
+ type: 'object',
47
+ properties: {
48
+ enabled: { type: 'boolean' },
49
+ includeHidden: { type: 'boolean' },
50
+ },
51
+ },
52
+ locators: {
53
+ type: 'object',
54
+ properties: {
55
+ enabled: { type: 'boolean' },
56
+ maxElements: { type: 'number' },
57
+ maxCandidatesPerElement: { type: 'number' },
58
+ includeUniquenessChecks: { type: 'boolean' },
59
+ },
60
+ },
61
+ components: {
62
+ type: 'object',
63
+ properties: {
64
+ enabled: { type: 'boolean' },
65
+ minOccurrences: { type: 'number' },
66
+ maxComponents: { type: 'number' },
67
+ },
68
+ },
69
+ forceCapture: { type: 'boolean' },
70
+ },
71
+ },
72
+ security: {
73
+ type: 'object',
74
+ properties: {
75
+ redactPatterns: { type: 'array', items: { type: 'string' } },
76
+ redactHeaders: { type: 'array', items: { type: 'string' } },
77
+ customPatterns: {
78
+ type: 'array',
79
+ items: {
80
+ type: 'object',
81
+ properties: {
82
+ name: { type: 'string' },
83
+ pattern: { type: 'string' },
84
+ replacement: { type: 'string' },
85
+ severity: { enum: ['critical', 'high', 'medium'] },
86
+ },
87
+ required: ['name', 'pattern', 'replacement', 'severity'],
88
+ },
89
+ },
90
+ },
91
+ },
92
+ storage: {
93
+ type: 'object',
94
+ properties: {
95
+ outputDir: { type: 'string' },
96
+ compression: { type: 'boolean' },
97
+ prettyJson: { type: 'boolean' },
98
+ },
99
+ required: ['outputDir', 'compression', 'prettyJson'],
100
+ },
101
+ },
102
+ required: ['browser', 'capture', 'security', 'storage'],
103
+ };
104
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,aAAa,GAAG;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE;gBACpD,QAAQ,EAAE,EAAE,IAAI,EAAE,S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AS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC7B,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAChC,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;aAChC;YACD,QAAQ,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,YAAY,CAAC;SACrD;KACF;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC;CACxD,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Browser, BrowserContext, Page } from '@playwright/test';
2
+ import { Config } from '../types/config';
3
+ import { FrameHierarchy } from '../types/capture';
4
+ export declare class BrowserAdapter {
5
+ private browser?;
6
+ private context?;
7
+ private isClosed;
8
+ launchBrowser(config: Config): Promise<Browser>;
9
+ createContext(browser: Browser, config?: any): Promise<BrowserContext>;
10
+ private consoleMessages;
11
+ getConsoleMessages(): Array<{
12
+ type: string;
13
+ message: string;
14
+ location: any;
15
+ timestamp: string;
16
+ stack?: string | undefined;
17
+ }>;
18
+ clearConsoleMessages(): void;
19
+ attachPageListeners(page: Page): Promise<void>;
20
+ onBrowserDisconnect(callback: () => void): void;
21
+ getFrameHierarchy(page: Page): Promise<FrameHierarchy>;
22
+ close(): Promise<void>;
23
+ }
24
+ //# sourceMappingURL=browser-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-adapter.d.ts","sourceRoot":"","sources":["../../src/core/browser-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAC,CAAU;IAC1B,OAAO,CAAC,OAAO,CAAC,CAAiB;IACjC,OAAO,CAAC,QAAQ,CAAS;IAEnB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA2D/C,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC;IAgC5E,OAAO,CAAC,eAAe,CAA8G;IAErI,kBAAkB,IAAI,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,GAAG,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAI5H,oBAAoB,IAAI,IAAI;IAItB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCpD,mBAAmB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAazC,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC;IActD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAsB7B"}