@eddym06/custom-chrome-mcp 1.0.4 → 1.1.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.
- package/CONDITIONAL_DESCRIPTIONS.md +174 -0
- package/FUTURE_FEATURES.txt +1503 -0
- package/README.md +300 -3
- package/TEST_WORKFLOW.md +311 -0
- package/USAGE_GUIDE.md +393 -0
- package/demo_features.ts +115 -0
- package/dist/chrome-connector.d.ts +31 -4
- package/dist/chrome-connector.d.ts.map +1 -1
- package/dist/chrome-connector.js +402 -53
- package/dist/chrome-connector.js.map +1 -1
- package/dist/index.js +69 -12
- package/dist/index.js.map +1 -1
- package/dist/tests/execute-script-tests.d.ts +62 -0
- package/dist/tests/execute-script-tests.d.ts.map +1 -0
- package/dist/tests/execute-script-tests.js +280 -0
- package/dist/tests/execute-script-tests.js.map +1 -0
- package/dist/tests/run-execute-tests.d.ts +7 -0
- package/dist/tests/run-execute-tests.d.ts.map +1 -0
- package/dist/tests/run-execute-tests.js +88 -0
- package/dist/tests/run-execute-tests.js.map +1 -0
- package/dist/tools/advanced-network.backup.d.ts +245 -0
- package/dist/tools/advanced-network.backup.d.ts.map +1 -0
- package/dist/tools/advanced-network.backup.js +996 -0
- package/dist/tools/advanced-network.backup.js.map +1 -0
- package/dist/tools/advanced-network.d.ts +580 -0
- package/dist/tools/advanced-network.d.ts.map +1 -0
- package/dist/tools/advanced-network.js +1325 -0
- package/dist/tools/advanced-network.js.map +1 -0
- package/dist/tools/anti-detection.d.ts.map +1 -1
- package/dist/tools/anti-detection.js +13 -8
- package/dist/tools/anti-detection.js.map +1 -1
- package/dist/tools/capture.d.ts +15 -9
- package/dist/tools/capture.d.ts.map +1 -1
- package/dist/tools/capture.js +21 -12
- package/dist/tools/capture.js.map +1 -1
- package/dist/tools/interaction.d.ts +84 -10
- package/dist/tools/interaction.d.ts.map +1 -1
- package/dist/tools/interaction.js +88 -33
- package/dist/tools/interaction.js.map +1 -1
- package/dist/tools/navigation.d.ts.map +1 -1
- package/dist/tools/navigation.js +43 -21
- package/dist/tools/navigation.js.map +1 -1
- package/dist/tools/network-accessibility.d.ts +67 -0
- package/dist/tools/network-accessibility.d.ts.map +1 -0
- package/dist/tools/network-accessibility.js +367 -0
- package/dist/tools/network-accessibility.js.map +1 -0
- package/dist/tools/playwright-launcher.d.ts +1 -1
- package/dist/tools/playwright-launcher.js +6 -6
- package/dist/tools/playwright-launcher.js.map +1 -1
- package/dist/tools/service-worker.d.ts +2 -2
- package/dist/tools/service-worker.d.ts.map +1 -1
- package/dist/tools/service-worker.js +22 -12
- package/dist/tools/service-worker.js.map +1 -1
- package/dist/tools/session.d.ts.map +1 -1
- package/dist/tools/session.js +23 -14
- package/dist/tools/session.js.map +1 -1
- package/dist/tools/system.d.ts +2 -2
- package/dist/tools/system.d.ts.map +1 -1
- package/dist/tools/system.js +9 -5
- package/dist/tools/system.js.map +1 -1
- package/dist/utils/truncate.d.ts +29 -0
- package/dist/utils/truncate.d.ts.map +1 -0
- package/dist/utils/truncate.js +46 -0
- package/dist/utils/truncate.js.map +1 -0
- package/dist/verify-tools.d.ts +7 -0
- package/dist/verify-tools.d.ts.map +1 -0
- package/dist/verify-tools.js +137 -0
- package/dist/verify-tools.js.map +1 -0
- package/package.json +3 -3
- package/recordings/demo_recording.har +3036 -0
- package/.npmrc.example +0 -2
- package/test-playwright.js +0 -57
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network Interception and Accessibility Tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { withTimeout } from '../utils/helpers.js';
|
|
6
|
+
// Store for intercepted requests (per tab)
|
|
7
|
+
const interceptedRequests = new Map();
|
|
8
|
+
export function createNetworkAccessibilityTools(connector) {
|
|
9
|
+
return [
|
|
10
|
+
// Enable network interception
|
|
11
|
+
{
|
|
12
|
+
name: 'enable_network_interception',
|
|
13
|
+
description: '🔒 Enables REQUEST interception (modify/block requests before they send). USE THIS WHEN: 1️⃣ Modifying request URLs (redirect API calls). 2️⃣ Changing request headers/method (test API variations). 3️⃣ Blocking specific resources (speed testing without ads). WORKFLOW: enable_network_interception → list_intercepted_requests → modify_intercepted_request/fail_intercepted_request. DIFFERENT FROM: enable_response_interception (responses, not requests). PATTERNS: ["*"] = all, ["*.js"] = JS only.',
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
patterns: z.array(z.string()).default(['*']).describe('URL patterns to intercept (e.g., ["*.js", "*.css", "*api*"]). Use "*" for all requests.'),
|
|
16
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
17
|
+
}),
|
|
18
|
+
handler: async ({ patterns = ['*'], tabId }) => {
|
|
19
|
+
await connector.verifyConnection();
|
|
20
|
+
const client = await connector.getTabClient(tabId);
|
|
21
|
+
const { Network, Fetch } = client;
|
|
22
|
+
// Enable Network domain
|
|
23
|
+
await Network.enable();
|
|
24
|
+
// Enable Fetch domain for interception
|
|
25
|
+
await Fetch.enable({
|
|
26
|
+
patterns: patterns.map((pattern) => ({
|
|
27
|
+
urlPattern: pattern,
|
|
28
|
+
requestStage: 'Request'
|
|
29
|
+
}))
|
|
30
|
+
});
|
|
31
|
+
// Initialize storage for this tab
|
|
32
|
+
const effectiveTabId = tabId || 'default';
|
|
33
|
+
if (!interceptedRequests.has(effectiveTabId)) {
|
|
34
|
+
interceptedRequests.set(effectiveTabId, new Map());
|
|
35
|
+
}
|
|
36
|
+
// Listen for intercepted requests
|
|
37
|
+
Fetch.requestPaused((params) => {
|
|
38
|
+
const requests = interceptedRequests.get(effectiveTabId);
|
|
39
|
+
requests.set(params.requestId, params);
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
success: true,
|
|
43
|
+
message: `Network interception enabled for patterns: ${patterns.join(', ')}`,
|
|
44
|
+
interceptedCount: 0
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
// List intercepted requests
|
|
49
|
+
{
|
|
50
|
+
name: 'list_intercepted_requests',
|
|
51
|
+
description: '📝 Lists paused requests (after enable_network_interception). USE THIS WHEN: 1️⃣ After enable_network_interception (see what\'s paused). 2️⃣ Getting requestId for modification/blocking. 3️⃣ Checking request details (URL, method, headers). PREREQUISITE: enable_network_interception must be called first. RETURNS: Array with requestId, URL, method, resourceType. NEXT STEPS: Use requestId with modify_intercepted_request, fail_intercepted_request, or continue_intercepted_request.',
|
|
52
|
+
inputSchema: z.object({
|
|
53
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
54
|
+
}),
|
|
55
|
+
handler: async ({ tabId }) => {
|
|
56
|
+
await connector.verifyConnection();
|
|
57
|
+
const effectiveTabId = tabId || 'default';
|
|
58
|
+
const requests = interceptedRequests.get(effectiveTabId);
|
|
59
|
+
if (!requests || requests.size === 0) {
|
|
60
|
+
return {
|
|
61
|
+
success: true,
|
|
62
|
+
interceptedRequests: [],
|
|
63
|
+
count: 0,
|
|
64
|
+
message: 'No requests currently intercepted. Use enable_network_interception first.'
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const requestList = Array.from(requests.values()).map((req) => ({
|
|
68
|
+
requestId: req.requestId,
|
|
69
|
+
url: req.request.url,
|
|
70
|
+
method: req.request.method,
|
|
71
|
+
resourceType: req.resourceType,
|
|
72
|
+
headers: req.request.headers
|
|
73
|
+
}));
|
|
74
|
+
return {
|
|
75
|
+
success: true,
|
|
76
|
+
interceptedRequests: requestList,
|
|
77
|
+
count: requestList.length
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
// Modify and continue intercepted request
|
|
82
|
+
{
|
|
83
|
+
name: 'modify_intercepted_request',
|
|
84
|
+
description: '✏️ Modifies paused request before sending. USE THIS WHEN: 1️⃣ Redirecting request (change URL to different API). 2️⃣ Modifying headers (add auth token, change User-Agent). 3️⃣ Changing HTTP method (POST → GET for testing). 4️⃣ Testing API variations (modify request body). PREREQUISITE: Get requestId from list_intercepted_requests. PARAMETERS: All optional - only provide what needs changing. EFFECT: Modified request sent to server.',
|
|
85
|
+
inputSchema: z.object({
|
|
86
|
+
requestId: z.string().describe('Request ID from list_intercepted_requests'),
|
|
87
|
+
modifiedUrl: z.string().optional().describe('New URL to request'),
|
|
88
|
+
modifiedMethod: z.string().optional().describe('New HTTP method (GET, POST, etc.)'),
|
|
89
|
+
modifiedHeaders: z.record(z.string()).optional().describe('New/modified headers'),
|
|
90
|
+
modifiedPostData: z.string().optional().describe('New POST body data'),
|
|
91
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
92
|
+
}),
|
|
93
|
+
handler: async ({ requestId, modifiedUrl, modifiedMethod, modifiedHeaders, modifiedPostData, tabId }) => {
|
|
94
|
+
await connector.verifyConnection();
|
|
95
|
+
const client = await connector.getTabClient(tabId);
|
|
96
|
+
const { Fetch } = client;
|
|
97
|
+
const effectiveTabId = tabId || 'default';
|
|
98
|
+
const requests = interceptedRequests.get(effectiveTabId);
|
|
99
|
+
const originalRequest = requests?.get(requestId);
|
|
100
|
+
if (!originalRequest) {
|
|
101
|
+
throw new Error(`Request ${requestId} not found. It may have already been processed.`);
|
|
102
|
+
}
|
|
103
|
+
// Prepare modified headers
|
|
104
|
+
let headers;
|
|
105
|
+
if (modifiedHeaders) {
|
|
106
|
+
headers = Object.entries(modifiedHeaders).map(([name, value]) => ({ name, value }));
|
|
107
|
+
}
|
|
108
|
+
// Continue request with modifications
|
|
109
|
+
await Fetch.continueRequest({
|
|
110
|
+
requestId,
|
|
111
|
+
url: modifiedUrl,
|
|
112
|
+
method: modifiedMethod,
|
|
113
|
+
headers,
|
|
114
|
+
postData: modifiedPostData
|
|
115
|
+
});
|
|
116
|
+
// Remove from pending requests
|
|
117
|
+
requests?.delete(requestId);
|
|
118
|
+
return {
|
|
119
|
+
success: true,
|
|
120
|
+
message: `Request ${requestId} modified and continued`,
|
|
121
|
+
originalUrl: originalRequest.request.url,
|
|
122
|
+
modifiedUrl: modifiedUrl || originalRequest.request.url
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
// Fail intercepted request
|
|
127
|
+
{
|
|
128
|
+
name: 'fail_intercepted_request',
|
|
129
|
+
description: '⛔ Blocks intercepted request (network error). USE THIS WHEN: 1️⃣ Simulating network failures (test offline behavior). 2️⃣ Blocking ads/trackers (prevent resource load). 3️⃣ Testing error handling (force API failure). 4️⃣ Speed testing (block slow resources). PREREQUISITE: Get requestId from list_intercepted_requests. ERROR REASONS: Failed, Aborted, TimedOut, AccessDenied, ConnectionClosed, ConnectionReset, ConnectionRefused. EFFECT: Request fails as if network error occurred.',
|
|
130
|
+
inputSchema: z.object({
|
|
131
|
+
requestId: z.string().describe('Request ID from list_intercepted_requests'),
|
|
132
|
+
errorReason: z.enum([
|
|
133
|
+
'Failed',
|
|
134
|
+
'Aborted',
|
|
135
|
+
'TimedOut',
|
|
136
|
+
'AccessDenied',
|
|
137
|
+
'ConnectionClosed',
|
|
138
|
+
'ConnectionReset',
|
|
139
|
+
'ConnectionRefused',
|
|
140
|
+
'ConnectionAborted',
|
|
141
|
+
'ConnectionFailed',
|
|
142
|
+
'NameNotResolved',
|
|
143
|
+
'InternetDisconnected',
|
|
144
|
+
'AddressUnreachable',
|
|
145
|
+
'BlockedByClient',
|
|
146
|
+
'BlockedByResponse'
|
|
147
|
+
]).default('Failed').describe('Reason for failing the request'),
|
|
148
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
149
|
+
}),
|
|
150
|
+
handler: async ({ requestId, errorReason = 'Failed', tabId }) => {
|
|
151
|
+
await connector.verifyConnection();
|
|
152
|
+
const client = await connector.getTabClient(tabId);
|
|
153
|
+
const { Fetch } = client;
|
|
154
|
+
const effectiveTabId = tabId || 'default';
|
|
155
|
+
const requests = interceptedRequests.get(effectiveTabId);
|
|
156
|
+
const originalRequest = requests?.get(requestId);
|
|
157
|
+
if (!originalRequest) {
|
|
158
|
+
throw new Error(`Request ${requestId} not found. It may have already been processed.`);
|
|
159
|
+
}
|
|
160
|
+
// Fail the request
|
|
161
|
+
await Fetch.failRequest({
|
|
162
|
+
requestId,
|
|
163
|
+
errorReason
|
|
164
|
+
});
|
|
165
|
+
// Remove from pending requests
|
|
166
|
+
requests?.delete(requestId);
|
|
167
|
+
return {
|
|
168
|
+
success: true,
|
|
169
|
+
message: `Request ${requestId} failed with reason: ${errorReason}`,
|
|
170
|
+
url: originalRequest.request.url
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
// Continue intercepted request (without modifications)
|
|
175
|
+
{
|
|
176
|
+
name: 'continue_intercepted_request',
|
|
177
|
+
description: '▶️ Continues paused request without changes. USE THIS WHEN: 1️⃣ Inspected request but don\'t need to modify (let it proceed). 2️⃣ Conditionally modifying (if condition not met, continue). 3️⃣ Analyzing requests without altering behavior. PREREQUISITE: Get requestId from list_intercepted_requests. EFFECT: Request proceeds normally to server. TIP: Must call this, modify_intercepted_request, or fail_intercepted_request for ALL intercepted requests.',
|
|
178
|
+
inputSchema: z.object({
|
|
179
|
+
requestId: z.string().describe('Request ID from list_intercepted_requests'),
|
|
180
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
181
|
+
}),
|
|
182
|
+
handler: async ({ requestId, tabId }) => {
|
|
183
|
+
await connector.verifyConnection();
|
|
184
|
+
const client = await connector.getTabClient(tabId);
|
|
185
|
+
const { Fetch } = client;
|
|
186
|
+
const effectiveTabId = tabId || 'default';
|
|
187
|
+
const requests = interceptedRequests.get(effectiveTabId);
|
|
188
|
+
const originalRequest = requests?.get(requestId);
|
|
189
|
+
if (!originalRequest) {
|
|
190
|
+
throw new Error(`Request ${requestId} not found. It may have already been processed.`);
|
|
191
|
+
}
|
|
192
|
+
// Continue without modifications
|
|
193
|
+
await Fetch.continueRequest({ requestId });
|
|
194
|
+
// Remove from pending requests
|
|
195
|
+
requests?.delete(requestId);
|
|
196
|
+
return {
|
|
197
|
+
success: true,
|
|
198
|
+
message: `Request ${requestId} continued without modifications`,
|
|
199
|
+
url: originalRequest.request.url
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
// Disable network interception
|
|
204
|
+
{
|
|
205
|
+
name: 'disable_network_interception',
|
|
206
|
+
description: '🔓 Disables request interception (cleanup). USE THIS WHEN: 1️⃣ Done testing request modifications. 2️⃣ Switching to normal browsing (no interception). 3️⃣ Cleanup after testing. EFFECT: All pending requests released, future requests not intercepted. CLEANUP: Clears intercepted request storage. TIP: Call after finishing with modify_intercepted_request workflow.',
|
|
207
|
+
inputSchema: z.object({
|
|
208
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
209
|
+
}),
|
|
210
|
+
handler: async ({ tabId }) => {
|
|
211
|
+
await connector.verifyConnection();
|
|
212
|
+
const client = await connector.getTabClient(tabId);
|
|
213
|
+
const { Fetch } = client;
|
|
214
|
+
// Disable Fetch domain
|
|
215
|
+
await Fetch.disable();
|
|
216
|
+
// Clear intercepted requests for this tab
|
|
217
|
+
const effectiveTabId = tabId || 'default';
|
|
218
|
+
interceptedRequests.delete(effectiveTabId);
|
|
219
|
+
return {
|
|
220
|
+
success: true,
|
|
221
|
+
message: 'Network interception disabled'
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
// Get accessibility tree
|
|
226
|
+
{
|
|
227
|
+
name: 'get_accessibility_tree',
|
|
228
|
+
description: '🌳 Full accessibility tree (screen reader view). USE THIS WHEN: 1️⃣ Testing accessibility compliance (ARIA roles, labels). 2️⃣ Debugging screen reader behavior (what\'s announced). 3️⃣ Verifying semantic HTML structure. 4️⃣ Finding accessibility issues (missing labels, invalid roles). RETURNS: Hierarchical tree with roles, names, values, children. COMMON ROLES: button, link, heading, textbox, region. TIP: Use get_accessibility_snapshot for simplified view.',
|
|
229
|
+
inputSchema: z.object({
|
|
230
|
+
tabId: z.string().optional().describe('Tab ID (optional)'),
|
|
231
|
+
depth: z.number().default(-1).describe('Depth of the tree to retrieve (-1 for full tree)'),
|
|
232
|
+
includeIgnored: z.boolean().default(false).describe('Include ignored accessibility nodes')
|
|
233
|
+
}),
|
|
234
|
+
handler: async ({ tabId, depth = -1, includeIgnored = false }) => {
|
|
235
|
+
await connector.verifyConnection();
|
|
236
|
+
const client = await connector.getTabClient(tabId);
|
|
237
|
+
const { Accessibility } = client;
|
|
238
|
+
// Get the full accessibility tree
|
|
239
|
+
const result = await withTimeout(Accessibility.getFullAXTree({ depth }), 30000, 'Accessibility tree retrieval timed out');
|
|
240
|
+
const nodes = result.nodes || [];
|
|
241
|
+
// Filter out ignored nodes if requested
|
|
242
|
+
const filteredNodes = includeIgnored
|
|
243
|
+
? nodes
|
|
244
|
+
: nodes.filter((node) => !node.ignored);
|
|
245
|
+
// Format tree in a more readable structure
|
|
246
|
+
const formatNode = (node) => {
|
|
247
|
+
const formatted = {
|
|
248
|
+
nodeId: node.nodeId,
|
|
249
|
+
role: node.role?.value || 'unknown',
|
|
250
|
+
name: node.name?.value || '',
|
|
251
|
+
};
|
|
252
|
+
// Add additional properties if present
|
|
253
|
+
if (node.description?.value)
|
|
254
|
+
formatted.description = node.description.value;
|
|
255
|
+
if (node.value?.value)
|
|
256
|
+
formatted.value = node.value.value;
|
|
257
|
+
if (node.properties) {
|
|
258
|
+
formatted.properties = node.properties.reduce((acc, prop) => {
|
|
259
|
+
acc[prop.name] = prop.value.value;
|
|
260
|
+
return acc;
|
|
261
|
+
}, {});
|
|
262
|
+
}
|
|
263
|
+
// Add children references
|
|
264
|
+
if (node.childIds && node.childIds.length > 0) {
|
|
265
|
+
formatted.childIds = node.childIds;
|
|
266
|
+
}
|
|
267
|
+
return formatted;
|
|
268
|
+
};
|
|
269
|
+
const formattedTree = filteredNodes.map(formatNode);
|
|
270
|
+
// Create a hierarchical view (root nodes)
|
|
271
|
+
const rootNodes = formattedTree.filter((node) => {
|
|
272
|
+
// Root nodes are those not referenced as children by others
|
|
273
|
+
const allChildIds = new Set(formattedTree.flatMap((n) => n.childIds || []));
|
|
274
|
+
return !allChildIds.has(node.nodeId);
|
|
275
|
+
});
|
|
276
|
+
return {
|
|
277
|
+
success: true,
|
|
278
|
+
totalNodes: formattedTree.length,
|
|
279
|
+
rootNodes: rootNodes.map((n) => ({
|
|
280
|
+
nodeId: n.nodeId,
|
|
281
|
+
role: n.role,
|
|
282
|
+
name: n.name
|
|
283
|
+
})),
|
|
284
|
+
nodes: formattedTree,
|
|
285
|
+
message: `Retrieved ${formattedTree.length} accessibility nodes (${rootNodes.length} root nodes)`
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
// Get accessibility snapshot (simpler, Playwright-style)
|
|
290
|
+
{
|
|
291
|
+
name: 'get_accessibility_snapshot',
|
|
292
|
+
description: '📸 Simplified accessibility snapshot (key info only). USE THIS WHEN: 1️⃣ Quick accessibility check (don\'t need full tree). 2️⃣ Finding interactive elements (buttons, links). 3️⃣ Verifying labels exist (form inputs have names). 4️⃣ Smaller output than get_accessibility_tree. RETURNS: Flat list with role, name, value for each element. FASTER: Less data than full tree. USE CASE: Playwright-style accessibility testing.',
|
|
293
|
+
inputSchema: z.object({
|
|
294
|
+
tabId: z.string().optional().describe('Tab ID (optional)'),
|
|
295
|
+
interestingOnly: z.boolean().default(true).describe('Only include interesting nodes (buttons, links, inputs, etc.)')
|
|
296
|
+
}),
|
|
297
|
+
handler: async ({ tabId, interestingOnly = true }) => {
|
|
298
|
+
await connector.verifyConnection();
|
|
299
|
+
const client = await connector.getTabClient(tabId);
|
|
300
|
+
const { Accessibility } = client;
|
|
301
|
+
// Get the accessibility snapshot
|
|
302
|
+
const result = await withTimeout(Accessibility.getFullAXTree({}), 30000, 'Accessibility snapshot retrieval timed out');
|
|
303
|
+
const nodes = result.nodes || [];
|
|
304
|
+
// Filter interesting roles if requested
|
|
305
|
+
const interestingRoles = new Set([
|
|
306
|
+
'button', 'link', 'textbox', 'searchbox', 'checkbox', 'radio',
|
|
307
|
+
'combobox', 'listbox', 'menuitem', 'tab', 'heading', 'article',
|
|
308
|
+
'navigation', 'main', 'banner', 'form', 'dialog', 'alert'
|
|
309
|
+
]);
|
|
310
|
+
const filteredNodes = nodes.filter((node) => {
|
|
311
|
+
if (node.ignored)
|
|
312
|
+
return false;
|
|
313
|
+
if (!interestingOnly)
|
|
314
|
+
return true;
|
|
315
|
+
return interestingRoles.has(node.role?.value?.toLowerCase() || '');
|
|
316
|
+
});
|
|
317
|
+
// Build a YAML-like string representation
|
|
318
|
+
const lines = [];
|
|
319
|
+
const nodeMap = new Map(nodes.map((n) => [n.nodeId, n]));
|
|
320
|
+
const processed = new Set();
|
|
321
|
+
function renderNode(node, indent = 0) {
|
|
322
|
+
if (processed.has(node.nodeId))
|
|
323
|
+
return;
|
|
324
|
+
processed.add(node.nodeId);
|
|
325
|
+
const prefix = ' '.repeat(indent) + '- ';
|
|
326
|
+
const role = node.role?.value || 'unknown';
|
|
327
|
+
const name = node.name?.value || '';
|
|
328
|
+
const value = node.value?.value || '';
|
|
329
|
+
let line = `${prefix}${role}`;
|
|
330
|
+
if (name)
|
|
331
|
+
line += ` "${name}"`;
|
|
332
|
+
if (value && value !== name)
|
|
333
|
+
line += ` [value: "${value}"]`;
|
|
334
|
+
if (node.nodeId)
|
|
335
|
+
line += ` [ref=${node.nodeId.substring(0, 8)}]`;
|
|
336
|
+
lines.push(line);
|
|
337
|
+
// Render children
|
|
338
|
+
if (node.childIds) {
|
|
339
|
+
for (const childId of node.childIds) {
|
|
340
|
+
const childNode = nodeMap.get(childId);
|
|
341
|
+
if (childNode && !processed.has(childId)) {
|
|
342
|
+
const isInteresting = !interestingOnly ||
|
|
343
|
+
interestingRoles.has(childNode.role?.value?.toLowerCase() || '');
|
|
344
|
+
if (isInteresting) {
|
|
345
|
+
renderNode(childNode, indent + 1);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
// Find root node
|
|
352
|
+
const rootNode = nodes.find((n) => n.role?.value === 'RootWebArea' || n.role?.value === 'WebArea');
|
|
353
|
+
if (rootNode) {
|
|
354
|
+
renderNode(rootNode, 0);
|
|
355
|
+
}
|
|
356
|
+
const snapshot = lines.join('\n');
|
|
357
|
+
return {
|
|
358
|
+
success: true,
|
|
359
|
+
snapshot,
|
|
360
|
+
nodeCount: filteredNodes.length,
|
|
361
|
+
totalNodes: nodes.length
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
];
|
|
366
|
+
}
|
|
367
|
+
//# sourceMappingURL=network-accessibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-accessibility.js","sourceRoot":"","sources":["../../src/tools/network-accessibility.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,2CAA2C;AAC3C,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAEhE,MAAM,UAAU,+BAA+B,CAAC,SAA0B;IACxE,OAAO;QACL,8BAA8B;QAC9B;YACE,IAAI,EAAE,6BAA6B;YACnC,WAAW,EAAE,+eAA+e;YAC5f,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,yFAAyF,CAAC;gBAChJ,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;aAC3D,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,EAAE,QAAQ,GAAG,CAAC,GAAG,CAAC,EAAE,KAAK,EAAO,EAAE,EAAE;gBAClD,MAAM,SAAS,CAAC,gBAAgB,EAAE,CAAC;gBACnC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,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E,SAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;gCAC5E,IAAI,aAAa,EAAE,CAAC;oCAClB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;gCACpC,CAAC;4BACH,CAAC;wBACH,CAAC;oBACH,CAAC;gBACH,CAAC;gBAED,iBAAiB;gBACjB,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,aAAa,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC;gBACxG,IAAI,QAAQ,EAAE,CAAC;oBACb,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBAC1B,CAAC;gBAED,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAElC,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,QAAQ;oBACR,SAAS,EAAE,aAAa,CAAC,MAAM;oBAC/B,UAAU,EAAE,KAAK,CAAC,MAAM;iBACzB,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -8,7 +8,7 @@ export declare function createPlaywrightLauncherTools(connector: ChromeConnector
|
|
|
8
8
|
name: string;
|
|
9
9
|
description: string;
|
|
10
10
|
inputSchema: z.ZodObject<{
|
|
11
|
-
profileDirectory: z.ZodDefault<z.
|
|
11
|
+
profileDirectory: z.ZodDefault<z.ZodString>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
13
|
profileDirectory: string;
|
|
14
14
|
}, {
|
|
@@ -7,9 +7,9 @@ export function createPlaywrightLauncherTools(connector) {
|
|
|
7
7
|
return [
|
|
8
8
|
{
|
|
9
9
|
name: 'launch_chrome_with_profile',
|
|
10
|
-
description: '
|
|
10
|
+
description: '🚀 Launches Chrome with YOUR profile (cookies, extensions, sessions). USE THIS WHEN: 1️⃣ Starting automation (first tool to call). 2️⃣ Need existing login sessions (avoid re-login). 3️⃣ Testing with extensions enabled. 4️⃣ Keeping browsing history/bookmarks. PROFILES: "Default" (main), "Profile 1", "Profile 2". PREREQUISITE: Close ALL Chrome windows first (conflict error otherwise). RECOMMENDED: Always use this instead of connecting to external Chrome.',
|
|
11
11
|
inputSchema: z.object({
|
|
12
|
-
profileDirectory: z.string().
|
|
12
|
+
profileDirectory: z.string().default('Default').describe('Profile directory name: "Default", "Profile 1", "Profile 2", etc.'),
|
|
13
13
|
userDataDir: z.string().optional().describe('Full path to Chrome User Data directory. Leave empty for default location.')
|
|
14
14
|
}),
|
|
15
15
|
handler: async ({ profileDirectory, userDataDir }) => {
|
|
@@ -40,9 +40,9 @@ export function createPlaywrightLauncherTools(connector) {
|
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
name: 'launch_edge_with_profile',
|
|
43
|
-
description: '
|
|
43
|
+
description: '🧭Launches Microsoft Edge with YOUR profile (Edge-specific). USE THIS WHEN: 1️⃣ Testing Edge-specific features. 2️⃣ Need Edge browser specifically (not Chrome). 3️⃣ Using Edge profile with saved logins. PROFILES: "Default", "Profile 1". PREREQUISITE: Close all Edge windows. NOTE: Most features work identically to Chrome (Chromium-based).',
|
|
44
44
|
inputSchema: z.object({
|
|
45
|
-
profileDirectory: z.string().
|
|
45
|
+
profileDirectory: z.string().default('Default').describe('Profile directory name')
|
|
46
46
|
}),
|
|
47
47
|
handler: async ({ profileDirectory }) => {
|
|
48
48
|
try {
|
|
@@ -70,7 +70,7 @@ export function createPlaywrightLauncherTools(connector) {
|
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
name: 'close_browser',
|
|
73
|
-
description: '
|
|
73
|
+
description: '🚪 Closes Playwright-managed browser (cleanup). USE THIS WHEN: 1️⃣ Done with automation session. 2️⃣ Want to release browser lock (launch again). 3️⃣ Cleaning up after testing. PREREQUISITE: Browser launched with launch_chrome_with_profile. EFFECT: Browser closes, profile unlocked. NOTE: Only works for Playwright-managed browsers (not external connections).',
|
|
74
74
|
inputSchema: z.object({}),
|
|
75
75
|
handler: async () => {
|
|
76
76
|
try {
|
|
@@ -96,7 +96,7 @@ export function createPlaywrightLauncherTools(connector) {
|
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
name: 'get_browser_status',
|
|
99
|
-
description: '
|
|
99
|
+
description: '📊 Checks browser connection status. USE THIS WHEN: 1️⃣ Verifying browser launched successfully. 2️⃣ Debugging connection issues. 3️⃣ Checking if Playwright-managed or external. RETURNS: connected (boolean), playwrightManaged (boolean), port (CDP port), status (string). STATES: "Running via Playwright", "Connected to external Chrome", "Not connected".',
|
|
100
100
|
inputSchema: z.object({}),
|
|
101
101
|
handler: async () => {
|
|
102
102
|
const isConnected = connector.isConnected();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-launcher.js","sourceRoot":"","sources":["../../src/tools/playwright-launcher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,6BAA6B,CAAC,SAA0B;IACtE,OAAO;QACL;YACE,IAAI,EAAE,4BAA4B;YAClC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"playwright-launcher.js","sourceRoot":"","sources":["../../src/tools/playwright-launcher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,6BAA6B,CAAC,SAA0B;IACtE,OAAO;QACL;YACE,IAAI,EAAE,4BAA4B;YAClC,WAAW,EAAE,0cAA0c;YACvd,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,mEAAmE,CAAC;gBAC7H,WAAW,EAAE,CAAC,CAAC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AC;gBAErD,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,SAAS,EAAE,WAAW;oBACtB,iBAAiB,EAAE,YAAY;oBAC/B,IAAI,EAAE,SAAS,CAAC,OAAO,EAAE;oBACzB,MAAM,EAAE,WAAW;wBACjB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,8BAA8B,CAAC;wBAC5E,CAAC,CAAC,eAAe;iBACpB,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -23,8 +23,8 @@ export declare function createServiceWorkerTools(connector: ChromeConnector): ({
|
|
|
23
23
|
description: string;
|
|
24
24
|
inputSchema: z.ZodObject<{
|
|
25
25
|
targetId: z.ZodString;
|
|
26
|
-
executeTestLogs: z.ZodDefault<z.
|
|
27
|
-
captureTimeMs: z.ZodDefault<z.
|
|
26
|
+
executeTestLogs: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
+
captureTimeMs: z.ZodDefault<z.ZodNumber>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
29
|
targetId: string;
|
|
30
30
|
executeTestLogs: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-worker.d.ts","sourceRoot":"","sources":["../../src/tools/service-worker.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG9D,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,eAAe;;;;;;;;;;yBASlC,GAAG;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"service-worker.d.ts","sourceRoot":"","sources":["../../src/tools/service-worker.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG9D,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,eAAe;;;;;;;;;;yBASlC,GAAG;;;;;;;;;;;;;;;;;;;;;4DA4C8C,GAAG;;;;;kBAUpD,MAAM;oBAAU,MAAM;kBAAQ,MAAM;qBAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;oCAwG1C,GAAG;;;;;;;;;;;;;;;;;;;;;;;;mCAoCJ,GAAG;;;;;;;;;;;;;;;;;oCAmGF,GAAG;;;;;;;;;;;;;;yBAoEd,GAAG;;;;;KAqBnC"}
|