@mcp-b/chrome-devtools-mcp 2.3.0 → 2.3.1-beta.20260528050333
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/package.json +1 -1
- package/build/src/DevToolsConnectionAdapter.js +0 -70
- package/build/src/DevtoolsUtils.js +0 -290
- package/build/src/McpContext.js +0 -687
- package/build/src/McpPage.js +0 -95
- package/build/src/McpResponse.js +0 -588
- package/build/src/Mutex.js +0 -37
- package/build/src/PageCollector.js +0 -308
- package/build/src/SlimMcpResponse.js +0 -18
- package/build/src/WaitForHelper.js +0 -135
- package/build/src/bin/chrome-devtools-cli-options.js +0 -651
- package/build/src/bin/chrome-devtools-mcp-cli-options.js +0 -317
- package/build/src/bin/chrome-devtools-mcp-main.js +0 -35
- package/build/src/bin/chrome-devtools-mcp.js +0 -21
- package/build/src/bin/chrome-devtools.js +0 -185
- package/build/src/bin/cliDefinitions.js +0 -615
- package/build/src/browser.js +0 -198
- package/build/src/daemon/client.js +0 -152
- package/build/src/daemon/daemon.js +0 -206
- package/build/src/daemon/types.js +0 -6
- package/build/src/daemon/utils.js +0 -108
- package/build/src/formatters/ConsoleFormatter.js +0 -234
- package/build/src/formatters/IssueFormatter.js +0 -192
- package/build/src/formatters/NetworkFormatter.js +0 -215
- package/build/src/formatters/SnapshotFormatter.js +0 -131
- package/build/src/index.js +0 -202
- package/build/src/issue-descriptions.js +0 -39
- package/build/src/logger.js +0 -36
- package/build/src/polyfill.js +0 -7
- package/build/src/telemetry/ClearcutLogger.js +0 -102
- package/build/src/telemetry/WatchdogClient.js +0 -60
- package/build/src/telemetry/flagUtils.js +0 -45
- package/build/src/telemetry/metricUtils.js +0 -14
- package/build/src/telemetry/persistence.js +0 -53
- package/build/src/telemetry/types.js +0 -33
- package/build/src/telemetry/watchdog/ClearcutSender.js +0 -203
- package/build/src/telemetry/watchdog/main.js +0 -127
- package/build/src/third_party/devtools-formatter-worker.js +0 -7
- package/build/src/third_party/index.js +0 -26
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +0 -54183
- package/build/src/tools/ToolDefinition.js +0 -72
- package/build/src/tools/categories.js +0 -24
- package/build/src/tools/console.js +0 -85
- package/build/src/tools/emulation.js +0 -55
- package/build/src/tools/extensions.js +0 -96
- package/build/src/tools/input.js +0 -368
- package/build/src/tools/lighthouse.js +0 -123
- package/build/src/tools/memory.js +0 -28
- package/build/src/tools/network.js +0 -120
- package/build/src/tools/pages.js +0 -319
- package/build/src/tools/performance.js +0 -190
- package/build/src/tools/screencast.js +0 -79
- package/build/src/tools/screenshot.js +0 -84
- package/build/src/tools/script.js +0 -119
- package/build/src/tools/slim/tools.js +0 -81
- package/build/src/tools/snapshot.js +0 -56
- package/build/src/tools/tools.js +0 -52
- package/build/src/tools/webmcp.js +0 -416
- package/build/src/trace-processing/parse.js +0 -84
- package/build/src/types.js +0 -6
- package/build/src/utils/ExtensionRegistry.js +0 -35
- package/build/src/utils/files.js +0 -19
- package/build/src/utils/keyboard.js +0 -296
- package/build/src/utils/pagination.js +0 -49
- package/build/src/utils/string.js +0 -36
- package/build/src/utils/types.js +0 -6
- package/build/src/version.js +0 -9
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
// See the KeyInput type for the list of supported keys.
|
|
7
|
-
const validKeys = new Set([
|
|
8
|
-
'0',
|
|
9
|
-
'1',
|
|
10
|
-
'2',
|
|
11
|
-
'3',
|
|
12
|
-
'4',
|
|
13
|
-
'5',
|
|
14
|
-
'6',
|
|
15
|
-
'7',
|
|
16
|
-
'8',
|
|
17
|
-
'9',
|
|
18
|
-
'Power',
|
|
19
|
-
'Eject',
|
|
20
|
-
'Abort',
|
|
21
|
-
'Help',
|
|
22
|
-
'Backspace',
|
|
23
|
-
'Tab',
|
|
24
|
-
'Numpad5',
|
|
25
|
-
'NumpadEnter',
|
|
26
|
-
'Enter',
|
|
27
|
-
'\r',
|
|
28
|
-
'\n',
|
|
29
|
-
'ShiftLeft',
|
|
30
|
-
'ShiftRight',
|
|
31
|
-
'ControlLeft',
|
|
32
|
-
'ControlRight',
|
|
33
|
-
'AltLeft',
|
|
34
|
-
'AltRight',
|
|
35
|
-
'Pause',
|
|
36
|
-
'CapsLock',
|
|
37
|
-
'Escape',
|
|
38
|
-
'Convert',
|
|
39
|
-
'NonConvert',
|
|
40
|
-
'Space',
|
|
41
|
-
'Numpad9',
|
|
42
|
-
'PageUp',
|
|
43
|
-
'Numpad3',
|
|
44
|
-
'PageDown',
|
|
45
|
-
'End',
|
|
46
|
-
'Numpad1',
|
|
47
|
-
'Home',
|
|
48
|
-
'Numpad7',
|
|
49
|
-
'ArrowLeft',
|
|
50
|
-
'Numpad4',
|
|
51
|
-
'Numpad8',
|
|
52
|
-
'ArrowUp',
|
|
53
|
-
'ArrowRight',
|
|
54
|
-
'Numpad6',
|
|
55
|
-
'Numpad2',
|
|
56
|
-
'ArrowDown',
|
|
57
|
-
'Select',
|
|
58
|
-
'Open',
|
|
59
|
-
'PrintScreen',
|
|
60
|
-
'Insert',
|
|
61
|
-
'Numpad0',
|
|
62
|
-
'Delete',
|
|
63
|
-
'NumpadDecimal',
|
|
64
|
-
'Digit0',
|
|
65
|
-
'Digit1',
|
|
66
|
-
'Digit2',
|
|
67
|
-
'Digit3',
|
|
68
|
-
'Digit4',
|
|
69
|
-
'Digit5',
|
|
70
|
-
'Digit6',
|
|
71
|
-
'Digit7',
|
|
72
|
-
'Digit8',
|
|
73
|
-
'Digit9',
|
|
74
|
-
'KeyA',
|
|
75
|
-
'KeyB',
|
|
76
|
-
'KeyC',
|
|
77
|
-
'KeyD',
|
|
78
|
-
'KeyE',
|
|
79
|
-
'KeyF',
|
|
80
|
-
'KeyG',
|
|
81
|
-
'KeyH',
|
|
82
|
-
'KeyI',
|
|
83
|
-
'KeyJ',
|
|
84
|
-
'KeyK',
|
|
85
|
-
'KeyL',
|
|
86
|
-
'KeyM',
|
|
87
|
-
'KeyN',
|
|
88
|
-
'KeyO',
|
|
89
|
-
'KeyP',
|
|
90
|
-
'KeyQ',
|
|
91
|
-
'KeyR',
|
|
92
|
-
'KeyS',
|
|
93
|
-
'KeyT',
|
|
94
|
-
'KeyU',
|
|
95
|
-
'KeyV',
|
|
96
|
-
'KeyW',
|
|
97
|
-
'KeyX',
|
|
98
|
-
'KeyY',
|
|
99
|
-
'KeyZ',
|
|
100
|
-
'MetaLeft',
|
|
101
|
-
'MetaRight',
|
|
102
|
-
'ContextMenu',
|
|
103
|
-
'NumpadMultiply',
|
|
104
|
-
'NumpadAdd',
|
|
105
|
-
'NumpadSubtract',
|
|
106
|
-
'NumpadDivide',
|
|
107
|
-
'F1',
|
|
108
|
-
'F2',
|
|
109
|
-
'F3',
|
|
110
|
-
'F4',
|
|
111
|
-
'F5',
|
|
112
|
-
'F6',
|
|
113
|
-
'F7',
|
|
114
|
-
'F8',
|
|
115
|
-
'F9',
|
|
116
|
-
'F10',
|
|
117
|
-
'F11',
|
|
118
|
-
'F12',
|
|
119
|
-
'F13',
|
|
120
|
-
'F14',
|
|
121
|
-
'F15',
|
|
122
|
-
'F16',
|
|
123
|
-
'F17',
|
|
124
|
-
'F18',
|
|
125
|
-
'F19',
|
|
126
|
-
'F20',
|
|
127
|
-
'F21',
|
|
128
|
-
'F22',
|
|
129
|
-
'F23',
|
|
130
|
-
'F24',
|
|
131
|
-
'NumLock',
|
|
132
|
-
'ScrollLock',
|
|
133
|
-
'AudioVolumeMute',
|
|
134
|
-
'AudioVolumeDown',
|
|
135
|
-
'AudioVolumeUp',
|
|
136
|
-
'MediaTrackNext',
|
|
137
|
-
'MediaTrackPrevious',
|
|
138
|
-
'MediaStop',
|
|
139
|
-
'MediaPlayPause',
|
|
140
|
-
'Semicolon',
|
|
141
|
-
'Equal',
|
|
142
|
-
'NumpadEqual',
|
|
143
|
-
'Comma',
|
|
144
|
-
'Minus',
|
|
145
|
-
'Period',
|
|
146
|
-
'Slash',
|
|
147
|
-
'Backquote',
|
|
148
|
-
'BracketLeft',
|
|
149
|
-
'Backslash',
|
|
150
|
-
'BracketRight',
|
|
151
|
-
'Quote',
|
|
152
|
-
'AltGraph',
|
|
153
|
-
'Props',
|
|
154
|
-
'Cancel',
|
|
155
|
-
'Clear',
|
|
156
|
-
'Shift',
|
|
157
|
-
'Control',
|
|
158
|
-
'Alt',
|
|
159
|
-
'Accept',
|
|
160
|
-
'ModeChange',
|
|
161
|
-
' ',
|
|
162
|
-
'Print',
|
|
163
|
-
'Execute',
|
|
164
|
-
'\u0000',
|
|
165
|
-
'a',
|
|
166
|
-
'b',
|
|
167
|
-
'c',
|
|
168
|
-
'd',
|
|
169
|
-
'e',
|
|
170
|
-
'f',
|
|
171
|
-
'g',
|
|
172
|
-
'h',
|
|
173
|
-
'i',
|
|
174
|
-
'j',
|
|
175
|
-
'k',
|
|
176
|
-
'l',
|
|
177
|
-
'm',
|
|
178
|
-
'n',
|
|
179
|
-
'o',
|
|
180
|
-
'p',
|
|
181
|
-
'q',
|
|
182
|
-
'r',
|
|
183
|
-
's',
|
|
184
|
-
't',
|
|
185
|
-
'u',
|
|
186
|
-
'v',
|
|
187
|
-
'w',
|
|
188
|
-
'x',
|
|
189
|
-
'y',
|
|
190
|
-
'z',
|
|
191
|
-
'Meta',
|
|
192
|
-
'*',
|
|
193
|
-
'+',
|
|
194
|
-
'-',
|
|
195
|
-
'/',
|
|
196
|
-
';',
|
|
197
|
-
'=',
|
|
198
|
-
',',
|
|
199
|
-
'.',
|
|
200
|
-
'`',
|
|
201
|
-
'[',
|
|
202
|
-
'\\',
|
|
203
|
-
']',
|
|
204
|
-
"'",
|
|
205
|
-
'Attn',
|
|
206
|
-
'CrSel',
|
|
207
|
-
'ExSel',
|
|
208
|
-
'EraseEof',
|
|
209
|
-
'Play',
|
|
210
|
-
'ZoomOut',
|
|
211
|
-
')',
|
|
212
|
-
'!',
|
|
213
|
-
'@',
|
|
214
|
-
'#',
|
|
215
|
-
'$',
|
|
216
|
-
'%',
|
|
217
|
-
'^',
|
|
218
|
-
'&',
|
|
219
|
-
'(',
|
|
220
|
-
'A',
|
|
221
|
-
'B',
|
|
222
|
-
'C',
|
|
223
|
-
'D',
|
|
224
|
-
'E',
|
|
225
|
-
'F',
|
|
226
|
-
'G',
|
|
227
|
-
'H',
|
|
228
|
-
'I',
|
|
229
|
-
'J',
|
|
230
|
-
'K',
|
|
231
|
-
'L',
|
|
232
|
-
'M',
|
|
233
|
-
'N',
|
|
234
|
-
'O',
|
|
235
|
-
'P',
|
|
236
|
-
'Q',
|
|
237
|
-
'R',
|
|
238
|
-
'S',
|
|
239
|
-
'T',
|
|
240
|
-
'U',
|
|
241
|
-
'V',
|
|
242
|
-
'W',
|
|
243
|
-
'X',
|
|
244
|
-
'Y',
|
|
245
|
-
'Z',
|
|
246
|
-
':',
|
|
247
|
-
'<',
|
|
248
|
-
'_',
|
|
249
|
-
'>',
|
|
250
|
-
'?',
|
|
251
|
-
'~',
|
|
252
|
-
'{',
|
|
253
|
-
'|',
|
|
254
|
-
'}',
|
|
255
|
-
'"',
|
|
256
|
-
'SoftLeft',
|
|
257
|
-
'SoftRight',
|
|
258
|
-
'Camera',
|
|
259
|
-
'Call',
|
|
260
|
-
'EndCall',
|
|
261
|
-
'VolumeDown',
|
|
262
|
-
'VolumeUp',
|
|
263
|
-
]);
|
|
264
|
-
function throwIfInvalidKey(key) {
|
|
265
|
-
if (validKeys.has(key)) {
|
|
266
|
-
return key;
|
|
267
|
-
}
|
|
268
|
-
throw new Error(`${key} is invalid. Valid keys are: ${Array.from(validKeys.values()).join(',')}.`);
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Returns the primary key, followed by modifiers in original order.
|
|
272
|
-
*/
|
|
273
|
-
export function parseKey(keyInput) {
|
|
274
|
-
let key = '';
|
|
275
|
-
const result = [];
|
|
276
|
-
for (const ch of keyInput) {
|
|
277
|
-
// Handle cases like Shift++.
|
|
278
|
-
if (ch === '+' && key) {
|
|
279
|
-
result.push(throwIfInvalidKey(key));
|
|
280
|
-
key = '';
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
key += ch;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
if (key) {
|
|
287
|
-
result.push(throwIfInvalidKey(key));
|
|
288
|
-
}
|
|
289
|
-
if (result.length === 0) {
|
|
290
|
-
throw new Error(`Key ${keyInput} could not be parsed.`);
|
|
291
|
-
}
|
|
292
|
-
if (new Set(result).size !== result.length) {
|
|
293
|
-
throw new Error(`Key ${keyInput} contains duplicate keys.`);
|
|
294
|
-
}
|
|
295
|
-
return [result.at(-1), ...result.slice(0, -1)];
|
|
296
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
const DEFAULT_PAGE_SIZE = 20;
|
|
7
|
-
export function paginate(items, options) {
|
|
8
|
-
const total = items.length;
|
|
9
|
-
if (!options || noPaginationOptions(options)) {
|
|
10
|
-
return {
|
|
11
|
-
items,
|
|
12
|
-
currentPage: 0,
|
|
13
|
-
totalPages: 1,
|
|
14
|
-
hasNextPage: false,
|
|
15
|
-
hasPreviousPage: false,
|
|
16
|
-
startIndex: 0,
|
|
17
|
-
endIndex: total,
|
|
18
|
-
invalidPage: false,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const pageSize = options.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
22
|
-
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
23
|
-
const { currentPage, invalidPage } = resolvePageIndex(options.pageIdx, totalPages);
|
|
24
|
-
const startIndex = currentPage * pageSize;
|
|
25
|
-
const pageItems = items.slice(startIndex, startIndex + pageSize);
|
|
26
|
-
const endIndex = startIndex + pageItems.length;
|
|
27
|
-
return {
|
|
28
|
-
items: pageItems,
|
|
29
|
-
currentPage,
|
|
30
|
-
totalPages,
|
|
31
|
-
hasNextPage: currentPage < totalPages - 1,
|
|
32
|
-
hasPreviousPage: currentPage > 0,
|
|
33
|
-
startIndex,
|
|
34
|
-
endIndex,
|
|
35
|
-
invalidPage,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function noPaginationOptions(options) {
|
|
39
|
-
return options.pageSize === undefined && options.pageIdx === undefined;
|
|
40
|
-
}
|
|
41
|
-
function resolvePageIndex(pageIdx, totalPages) {
|
|
42
|
-
if (pageIdx === undefined) {
|
|
43
|
-
return { currentPage: 0, invalidPage: false };
|
|
44
|
-
}
|
|
45
|
-
if (pageIdx < 0 || pageIdx >= totalPages) {
|
|
46
|
-
return { currentPage: 0, invalidPage: true };
|
|
47
|
-
}
|
|
48
|
-
return { currentPage: pageIdx, invalidPage: false };
|
|
49
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2026 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Converts a given string to snake_case.
|
|
8
|
-
* This function handles camelCase, PascalCase, and acronyms, including transitions between letters and numbers.
|
|
9
|
-
* It uses Unicode-aware regular expressions (`\p{L}`, `\p{N}`, `\p{Lu}`, `\p{Ll}` with the `u` flag)
|
|
10
|
-
* to correctly process letters and numbers from various languages.
|
|
11
|
-
*
|
|
12
|
-
* @param text The input string to convert to snake_case.
|
|
13
|
-
* @returns The snake_case version of the input string.
|
|
14
|
-
*/
|
|
15
|
-
export function toSnakeCase(text) {
|
|
16
|
-
if (!text) {
|
|
17
|
-
return '';
|
|
18
|
-
}
|
|
19
|
-
// First, handle case-based transformations to insert underscores correctly.
|
|
20
|
-
// 1. Add underscore between a letter and a number.
|
|
21
|
-
// e.g., "version2" -> "version_2"
|
|
22
|
-
// 2. Add underscore between an uppercase letter sequence and a following uppercase+lowercase sequence.
|
|
23
|
-
// e.g., "APIFlags" -> "API_Flags"
|
|
24
|
-
// 3. Add underscore between a lowercase/number and an uppercase letter.
|
|
25
|
-
// e.g., "lastName" -> "last_Name", "version_2Update" -> "version_2_Update"
|
|
26
|
-
// 4. Replace sequences of non-alphanumeric with a single underscore
|
|
27
|
-
// 5. Remove any leading or trailing underscores.
|
|
28
|
-
const result = text
|
|
29
|
-
.replace(/(\p{L})(\p{N})/gu, '$1_$2') // 1
|
|
30
|
-
.replace(/(\p{Lu}+)(\p{Lu}\p{Ll})/gu, '$1_$2') // 2
|
|
31
|
-
.replace(/(\p{Ll}|\p{N})(\p{Lu})/gu, '$1_$2') // 3
|
|
32
|
-
.toLowerCase()
|
|
33
|
-
.replace(/[^\p{L}\p{N}]+/gu, '_') // 4
|
|
34
|
-
.replace(/^_|_$/g, ''); // 5
|
|
35
|
-
return result;
|
|
36
|
-
}
|
package/build/src/utils/types.js
DELETED
package/build/src/version.js
DELETED