@dynamicu/chromedebug-mcp 2.6.6 → 2.7.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 (46) hide show
  1. package/CLAUDE.md +1 -1
  2. package/README.md +1 -1
  3. package/chrome-extension/activation-manager.js +18 -4
  4. package/chrome-extension/background.js +1044 -552
  5. package/chrome-extension/browser-recording-manager.js +256 -0
  6. package/chrome-extension/chrome-debug-logger.js +168 -0
  7. package/chrome-extension/console-interception-library.js +430 -0
  8. package/chrome-extension/content.css +16 -16
  9. package/chrome-extension/content.js +617 -215
  10. package/chrome-extension/data-buffer.js +206 -17
  11. package/chrome-extension/extension-config.js +1 -1
  12. package/chrome-extension/frame-capture.js +52 -15
  13. package/chrome-extension/license-helper.js +26 -0
  14. package/chrome-extension/manifest.free.json +3 -6
  15. package/chrome-extension/options.js +1 -1
  16. package/chrome-extension/popup.html +315 -181
  17. package/chrome-extension/popup.js +673 -526
  18. package/chrome-extension/pro/enhanced-capture.js +406 -0
  19. package/chrome-extension/pro/frame-editor.html +410 -0
  20. package/chrome-extension/pro/frame-editor.js +1496 -0
  21. package/chrome-extension/pro/function-tracker.js +843 -0
  22. package/chrome-extension/pro/jszip.min.js +13 -0
  23. package/config/chromedebug-config.json +101 -0
  24. package/dist/chromedebug-extension-free.zip +0 -0
  25. package/package.json +3 -1
  26. package/scripts/package-pro-extension.js +1 -1
  27. package/scripts/webpack.config.free.cjs +11 -8
  28. package/scripts/webpack.config.pro.cjs +5 -0
  29. package/src/chrome-controller.js +7 -7
  30. package/src/cli.js +2 -2
  31. package/src/database.js +61 -9
  32. package/src/http-server.js +3 -2
  33. package/src/index.js +9 -6
  34. package/src/mcp/server.js +2 -2
  35. package/src/services/process-manager.js +10 -6
  36. package/src/services/process-tracker.js +10 -5
  37. package/src/services/profile-manager.js +17 -2
  38. package/src/validation/schemas.js +36 -6
  39. package/src/index-direct.js +0 -157
  40. package/src/index-modular.js +0 -219
  41. package/src/index-monolithic-backup.js +0 -2230
  42. package/src/legacy/chrome-controller-old.js +0 -1406
  43. package/src/legacy/index-express.js +0 -625
  44. package/src/legacy/index-old.js +0 -977
  45. package/src/legacy/routes.js +0 -260
  46. package/src/legacy/shared-storage.js +0 -101
@@ -1,219 +0,0 @@
1
- /**
2
- * Chrome Debug MCP Server - Modular Architecture
3
- * Refactored from monolithic design to modular components
4
- * Maintains all security fixes and functionality while improving maintainability
5
- */
6
-
7
- import { ChromeController } from './chrome-controller.js';
8
- import { MCPServer } from './mcp/server.js';
9
- import { ChromeService } from './services/chrome-service.js';
10
- import { ProcessManager } from './services/process-manager.js';
11
-
12
- /**
13
- * Main application class that orchestrates all components
14
- */
15
- class ChromePilotApp {
16
- constructor() {
17
- this.chromeController = null;
18
- this.chromeService = null;
19
- this.mcpServer = null;
20
- this.processManager = null;
21
- this.initialized = false;
22
- }
23
-
24
- /**
25
- * Initializes all components
26
- * @param {Object} options - Initialization options
27
- */
28
- async initialize(options = {}) {
29
- try {
30
- // Parse command line arguments
31
- const args = this.parseArguments();
32
- const finalOptions = { ...options, ...args };
33
-
34
- // Create Chrome controller instance
35
- this.chromeController = new ChromeController();
36
-
37
- // Create Chrome service wrapper with process management
38
- this.chromeService = new ChromeService(this.chromeController);
39
- this.processManager = this.chromeService.getProcessManager();
40
-
41
- // Initialize Chrome service (starts HTTP server if needed)
42
- const serviceResult = await this.chromeService.initialize(finalOptions);
43
-
44
- if (serviceResult.httpServer) {
45
- console.error(`Chrome service initialized with HTTP server on port ${serviceResult.httpServer.port}`);
46
- }
47
-
48
- // Create and configure MCP server
49
- this.mcpServer = new MCPServer(this.chromeService);
50
-
51
- this.initialized = true;
52
- return {
53
- status: 'initialized',
54
- options: finalOptions,
55
- serviceResult
56
- };
57
- } catch (error) {
58
- console.error('Failed to initialize Chrome Debug:', error);
59
- throw error;
60
- }
61
- }
62
-
63
- /**
64
- * Starts the MCP server
65
- */
66
- async start() {
67
- if (!this.initialized) {
68
- await this.initialize();
69
- }
70
-
71
- try {
72
- // Clean up any existing Chrome Debug processes
73
- const cleanupResult = await this.processManager.cleanupChromePilotProcesses();
74
- if (cleanupResult.total > 0) {
75
- console.error(`Cleaned up ${cleanupResult.killed.length} existing processes`);
76
- }
77
-
78
- // Start the MCP server
79
- await this.mcpServer.start();
80
- } catch (error) {
81
- console.error('Failed to start Chrome Debug MCP server:', error);
82
- process.exit(1);
83
- }
84
- }
85
-
86
- /**
87
- * Gets the status of all components
88
- */
89
- async getStatus() {
90
- if (!this.initialized) {
91
- return { status: 'not_initialized' };
92
- }
93
-
94
- return {
95
- status: 'running',
96
- components: {
97
- chromeService: await this.chromeService.getStatus(),
98
- processManager: this.processManager.getStatistics(),
99
- mcpServer: {
100
- initialized: !!this.mcpServer,
101
- tools: this.mcpServer ? this.mcpServer.toolRegistry.getAllTools().length : 0
102
- }
103
- },
104
- timestamp: new Date().toISOString()
105
- };
106
- }
107
-
108
- /**
109
- * Parses command line arguments
110
- * @returns {Object} Parsed arguments
111
- */
112
- parseArguments() {
113
- const args = {
114
- singleServer: false,
115
- watch: false,
116
- debug: false
117
- };
118
-
119
- for (const arg of process.argv.slice(2)) {
120
- switch (arg) {
121
- case '--single-server':
122
- args.singleServer = true;
123
- break;
124
- case '--watch':
125
- args.watch = true;
126
- break;
127
- case '--debug':
128
- args.debug = true;
129
- break;
130
- case '--help':
131
- this.showHelp();
132
- process.exit(0);
133
- break;
134
- }
135
- }
136
-
137
- return args;
138
- }
139
-
140
- /**
141
- * Shows help information
142
- */
143
- showHelp() {
144
- console.error(`
145
- Chrome Debug MCP Server - Modular Architecture
146
-
147
- Usage: node src/index.js [options]
148
-
149
- Options:
150
- --single-server Run without HTTP server (MCP only)
151
- --watch Watch for file changes (development mode)
152
- --debug Enable debug logging
153
- --help Show this help message
154
-
155
- Environment Variables:
156
- NODE_ENV Set to 'development' for debug mode
157
- CHROME_PILOT_PORT Configure HTTP server port
158
-
159
- For more information, see the documentation in CLAUDE.md
160
- `);
161
- }
162
-
163
- /**
164
- * Graceful shutdown
165
- */
166
- async shutdown() {
167
- console.error('Shutting down Chrome Debug...');
168
-
169
- try {
170
- if (this.chromeService) {
171
- await this.chromeService.cleanup();
172
- }
173
-
174
- if (this.processManager) {
175
- await this.processManager.killAllManagedProcesses();
176
- }
177
-
178
- console.error('Chrome Debug shutdown complete');
179
- } catch (error) {
180
- console.error('Error during shutdown:', error);
181
- }
182
- }
183
- }
184
-
185
- /**
186
- * Main entry point
187
- */
188
- async function main() {
189
- const app = new ChromePilotApp();
190
-
191
- try {
192
- await app.start();
193
- } catch (error) {
194
- console.error('Fatal error starting Chrome Debug:', error);
195
- process.exit(1);
196
- }
197
- }
198
-
199
- // Handle graceful shutdown
200
- process.on('SIGINT', async () => {
201
- console.error('Received SIGINT, shutting down gracefully...');
202
- process.exit(0);
203
- });
204
-
205
- process.on('SIGTERM', async () => {
206
- console.error('Received SIGTERM, shutting down gracefully...');
207
- process.exit(0);
208
- });
209
-
210
- // Export for testing
211
- export { ChromePilotApp };
212
-
213
- // Run if this is the main module
214
- if (import.meta.url === `file://${process.argv[1]}`) {
215
- main().catch((error) => {
216
- console.error('Unhandled error:', error);
217
- process.exit(1);
218
- });
219
- }