@eddym06/custom-chrome-mcp 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/.npmrc.example +2 -0
- package/CHANGELOG.md +87 -0
- package/INSTALL.md +148 -0
- package/LICENSE +21 -0
- package/README.md +403 -0
- package/dist/chrome-connector.d.ts +116 -0
- package/dist/chrome-connector.d.ts.map +1 -0
- package/dist/chrome-connector.js +452 -0
- package/dist/chrome-connector.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +211 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/anti-detection.d.ts +22 -0
- package/dist/tools/anti-detection.d.ts.map +1 -0
- package/dist/tools/anti-detection.js +220 -0
- package/dist/tools/anti-detection.js.map +1 -0
- package/dist/tools/capture.d.ts +130 -0
- package/dist/tools/capture.d.ts.map +1 -0
- package/dist/tools/capture.js +164 -0
- package/dist/tools/capture.js.map +1 -0
- package/dist/tools/interaction.d.ts +173 -0
- package/dist/tools/interaction.d.ts.map +1 -0
- package/dist/tools/interaction.js +274 -0
- package/dist/tools/interaction.js.map +1 -0
- package/dist/tools/navigation.d.ts +82 -0
- package/dist/tools/navigation.d.ts.map +1 -0
- package/dist/tools/navigation.js +196 -0
- package/dist/tools/navigation.js.map +1 -0
- package/dist/tools/playwright-launcher.d.ts +53 -0
- package/dist/tools/playwright-launcher.d.ts.map +1 -0
- package/dist/tools/playwright-launcher.js +117 -0
- package/dist/tools/playwright-launcher.js.map +1 -0
- package/dist/tools/service-worker.d.ts +128 -0
- package/dist/tools/service-worker.d.ts.map +1 -0
- package/dist/tools/service-worker.js +355 -0
- package/dist/tools/service-worker.js.map +1 -0
- package/dist/tools/session.d.ts +54 -0
- package/dist/tools/session.d.ts.map +1 -0
- package/dist/tools/session.js +311 -0
- package/dist/tools/session.js.map +1 -0
- package/dist/tools/system.d.ts +159 -0
- package/dist/tools/system.d.ts.map +1 -0
- package/dist/tools/system.js +252 -0
- package/dist/tools/system.js.map +1 -0
- package/dist/types/index.d.ts +75 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/helpers.d.ts +53 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +122 -0
- package/dist/utils/helpers.js.map +1 -0
- package/mcp-config-example.json +12 -0
- package/package.json +61 -0
- package/test-playwright.js +57 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Screenshot and Page Capture Tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export function createCaptureTools(connector) {
|
|
6
|
+
return [
|
|
7
|
+
// Take screenshot
|
|
8
|
+
{
|
|
9
|
+
name: 'screenshot',
|
|
10
|
+
description: 'Take a screenshot of the current page or a specific area',
|
|
11
|
+
inputSchema: z.object({
|
|
12
|
+
format: z.enum(['png', 'jpeg']).optional().default('png').describe('Image format'),
|
|
13
|
+
quality: z.number().min(0).max(100).optional().default(90).describe('JPEG quality (0-100)'),
|
|
14
|
+
fullPage: z.boolean().optional().default(false).describe('Capture full page'),
|
|
15
|
+
clipX: z.number().optional().describe('Clip area X coordinate'),
|
|
16
|
+
clipY: z.number().optional().describe('Clip area Y coordinate'),
|
|
17
|
+
clipWidth: z.number().optional().describe('Clip area width'),
|
|
18
|
+
clipHeight: z.number().optional().describe('Clip area height'),
|
|
19
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
20
|
+
}),
|
|
21
|
+
handler: async ({ format, quality, fullPage, clipX, clipY, clipWidth, clipHeight, tabId }) => {
|
|
22
|
+
const client = await connector.getTabClient(tabId);
|
|
23
|
+
const { Page } = client;
|
|
24
|
+
await Page.enable();
|
|
25
|
+
const options = {
|
|
26
|
+
format,
|
|
27
|
+
quality: format === 'jpeg' ? quality : undefined
|
|
28
|
+
};
|
|
29
|
+
// Handle clip area
|
|
30
|
+
if (clipX !== undefined && clipY !== undefined && clipWidth && clipHeight) {
|
|
31
|
+
options.clip = {
|
|
32
|
+
x: clipX,
|
|
33
|
+
y: clipY,
|
|
34
|
+
width: clipWidth,
|
|
35
|
+
height: clipHeight,
|
|
36
|
+
scale: 1
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// Capture screenshot
|
|
40
|
+
let screenshot;
|
|
41
|
+
if (fullPage) {
|
|
42
|
+
screenshot = await Page.captureScreenshot({
|
|
43
|
+
...options,
|
|
44
|
+
captureBeyondViewport: true
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
screenshot = await Page.captureScreenshot(options);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
success: true,
|
|
52
|
+
format,
|
|
53
|
+
fullPage,
|
|
54
|
+
data: screenshot.data,
|
|
55
|
+
message: `Screenshot captured (${format}${fullPage ? ', full page' : ''})`
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
// Get page HTML
|
|
60
|
+
{
|
|
61
|
+
name: 'get_html',
|
|
62
|
+
description: 'Get the HTML content of the current page',
|
|
63
|
+
inputSchema: z.object({
|
|
64
|
+
tabId: z.string().optional().describe('Tab ID (optional)'),
|
|
65
|
+
outerHTML: z.boolean().optional().default(true).describe('Get outer HTML (includes <html> tag)')
|
|
66
|
+
}),
|
|
67
|
+
handler: async ({ tabId, outerHTML }) => {
|
|
68
|
+
const client = await connector.getTabClient(tabId);
|
|
69
|
+
const { Runtime } = client;
|
|
70
|
+
await Runtime.enable();
|
|
71
|
+
const expression = outerHTML
|
|
72
|
+
? 'document.documentElement.outerHTML'
|
|
73
|
+
: 'document.documentElement.innerHTML';
|
|
74
|
+
const result = await Runtime.evaluate({
|
|
75
|
+
expression,
|
|
76
|
+
returnByValue: true
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
success: true,
|
|
80
|
+
html: result.result.value,
|
|
81
|
+
size: result.result.value.length
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
// Print to PDF
|
|
86
|
+
{
|
|
87
|
+
name: 'print_to_pdf',
|
|
88
|
+
description: 'Print the current page to PDF',
|
|
89
|
+
inputSchema: z.object({
|
|
90
|
+
landscape: z.boolean().optional().default(false).describe('Landscape orientation'),
|
|
91
|
+
displayHeaderFooter: z.boolean().optional().default(false).describe('Display header/footer'),
|
|
92
|
+
printBackground: z.boolean().optional().default(true).describe('Print background graphics'),
|
|
93
|
+
scale: z.number().min(0.1).max(2).optional().default(1).describe('Scale (0.1-2)'),
|
|
94
|
+
paperWidth: z.number().optional().describe('Paper width in inches'),
|
|
95
|
+
paperHeight: z.number().optional().describe('Paper height in inches'),
|
|
96
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
97
|
+
}),
|
|
98
|
+
handler: async ({ landscape, displayHeaderFooter, printBackground, scale, paperWidth, paperHeight, tabId }) => {
|
|
99
|
+
const client = await connector.getTabClient(tabId);
|
|
100
|
+
const { Page } = client;
|
|
101
|
+
await Page.enable();
|
|
102
|
+
const options = {
|
|
103
|
+
landscape,
|
|
104
|
+
displayHeaderFooter,
|
|
105
|
+
printBackground,
|
|
106
|
+
scale
|
|
107
|
+
};
|
|
108
|
+
if (paperWidth)
|
|
109
|
+
options.paperWidth = paperWidth;
|
|
110
|
+
if (paperHeight)
|
|
111
|
+
options.paperHeight = paperHeight;
|
|
112
|
+
const { data } = await Page.printToPDF(options);
|
|
113
|
+
return {
|
|
114
|
+
success: true,
|
|
115
|
+
data,
|
|
116
|
+
format: 'pdf',
|
|
117
|
+
message: 'PDF generated successfully'
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
// Get page metrics
|
|
122
|
+
{
|
|
123
|
+
name: 'get_page_metrics',
|
|
124
|
+
description: 'Get layout metrics of the page',
|
|
125
|
+
inputSchema: z.object({
|
|
126
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
127
|
+
}),
|
|
128
|
+
handler: async ({ tabId }) => {
|
|
129
|
+
const client = await connector.getTabClient(tabId);
|
|
130
|
+
const { Page } = client;
|
|
131
|
+
await Page.enable();
|
|
132
|
+
const metrics = await Page.getLayoutMetrics();
|
|
133
|
+
return {
|
|
134
|
+
success: true,
|
|
135
|
+
metrics: {
|
|
136
|
+
contentSize: metrics.contentSize,
|
|
137
|
+
layoutViewport: metrics.layoutViewport,
|
|
138
|
+
visualViewport: metrics.visualViewport
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
// Get accessibility tree
|
|
144
|
+
{
|
|
145
|
+
name: 'get_accessibility_tree',
|
|
146
|
+
description: 'Get the accessibility tree of the page',
|
|
147
|
+
inputSchema: z.object({
|
|
148
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
149
|
+
}),
|
|
150
|
+
handler: async ({ tabId }) => {
|
|
151
|
+
const client = await connector.getTabClient(tabId);
|
|
152
|
+
const { Accessibility } = client;
|
|
153
|
+
await Accessibility.enable();
|
|
154
|
+
const { nodes } = await Accessibility.getFullAXTree();
|
|
155
|
+
return {
|
|
156
|
+
success: true,
|
|
157
|
+
nodeCount: nodes.length,
|
|
158
|
+
nodes: nodes.slice(0, 100) // Limit to first 100 nodes
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=capture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/tools/capture.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,kBAAkB,CAAC,SAA0B;IAC3D,OAAO;QACL,kBAAkB;QAClB;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,0DAA0D;YACvE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;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AAC;gBAEtD,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,SAAS,EAAE,KAAK,CAAC,MAAM;oBACvB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,2BAA2B;iBACvD,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page Interaction Tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import type { ChromeConnector } from '../chrome-connector.js';
|
|
6
|
+
export declare function createInteractionTools(connector: ChromeConnector): ({
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
inputSchema: z.ZodObject<{
|
|
10
|
+
selector: z.ZodString;
|
|
11
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
waitForSelector: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
selector: string;
|
|
15
|
+
waitForSelector: boolean;
|
|
16
|
+
tabId?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
selector: string;
|
|
19
|
+
tabId?: string | undefined;
|
|
20
|
+
waitForSelector?: boolean | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
handler: ({ selector, tabId, waitForSelector }: any) => Promise<{
|
|
23
|
+
success: boolean;
|
|
24
|
+
message: string;
|
|
25
|
+
}>;
|
|
26
|
+
} | {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
inputSchema: z.ZodObject<{
|
|
30
|
+
selector: z.ZodString;
|
|
31
|
+
text: z.ZodString;
|
|
32
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
33
|
+
clearFirst: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
selector: string;
|
|
36
|
+
text: string;
|
|
37
|
+
clearFirst: boolean;
|
|
38
|
+
tabId?: string | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
selector: string;
|
|
41
|
+
text: string;
|
|
42
|
+
tabId?: string | undefined;
|
|
43
|
+
clearFirst?: boolean | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
handler: ({ selector, text, tabId, clearFirst }: any) => Promise<{
|
|
46
|
+
success: boolean;
|
|
47
|
+
message: string;
|
|
48
|
+
}>;
|
|
49
|
+
} | {
|
|
50
|
+
name: string;
|
|
51
|
+
description: string;
|
|
52
|
+
inputSchema: z.ZodObject<{
|
|
53
|
+
selector: z.ZodString;
|
|
54
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
selector: string;
|
|
57
|
+
tabId?: string | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
selector: string;
|
|
60
|
+
tabId?: string | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
handler: ({ selector, tabId }: any) => Promise<{
|
|
63
|
+
success: boolean;
|
|
64
|
+
text: any;
|
|
65
|
+
selector: any;
|
|
66
|
+
}>;
|
|
67
|
+
} | {
|
|
68
|
+
name: string;
|
|
69
|
+
description: string;
|
|
70
|
+
inputSchema: z.ZodObject<{
|
|
71
|
+
selector: z.ZodString;
|
|
72
|
+
attribute: z.ZodString;
|
|
73
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
selector: string;
|
|
76
|
+
attribute: string;
|
|
77
|
+
tabId?: string | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
selector: string;
|
|
80
|
+
attribute: string;
|
|
81
|
+
tabId?: string | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
handler: ({ selector, attribute, tabId }: any) => Promise<{
|
|
84
|
+
success: boolean;
|
|
85
|
+
value: any;
|
|
86
|
+
selector: any;
|
|
87
|
+
attribute: any;
|
|
88
|
+
}>;
|
|
89
|
+
} | {
|
|
90
|
+
name: string;
|
|
91
|
+
description: string;
|
|
92
|
+
inputSchema: z.ZodObject<{
|
|
93
|
+
script: z.ZodString;
|
|
94
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
awaitPromise: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
script: string;
|
|
98
|
+
awaitPromise: boolean;
|
|
99
|
+
tabId?: string | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
script: string;
|
|
102
|
+
tabId?: string | undefined;
|
|
103
|
+
awaitPromise?: boolean | undefined;
|
|
104
|
+
}>;
|
|
105
|
+
handler: ({ script, tabId, awaitPromise }: any) => Promise<{
|
|
106
|
+
success: boolean;
|
|
107
|
+
result: any;
|
|
108
|
+
}>;
|
|
109
|
+
} | {
|
|
110
|
+
name: string;
|
|
111
|
+
description: string;
|
|
112
|
+
inputSchema: z.ZodObject<{
|
|
113
|
+
x: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
114
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
116
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
x: number;
|
|
119
|
+
tabId?: string | undefined;
|
|
120
|
+
selector?: string | undefined;
|
|
121
|
+
y?: number | undefined;
|
|
122
|
+
}, {
|
|
123
|
+
tabId?: string | undefined;
|
|
124
|
+
selector?: string | undefined;
|
|
125
|
+
x?: number | undefined;
|
|
126
|
+
y?: number | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
handler: ({ x, y, selector, tabId }: any) => Promise<{
|
|
129
|
+
success: boolean;
|
|
130
|
+
message: string;
|
|
131
|
+
}>;
|
|
132
|
+
} | {
|
|
133
|
+
name: string;
|
|
134
|
+
description: string;
|
|
135
|
+
inputSchema: z.ZodObject<{
|
|
136
|
+
selector: z.ZodString;
|
|
137
|
+
timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
138
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
selector: string;
|
|
141
|
+
timeout: number;
|
|
142
|
+
tabId?: string | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
selector: string;
|
|
145
|
+
tabId?: string | undefined;
|
|
146
|
+
timeout?: number | undefined;
|
|
147
|
+
}>;
|
|
148
|
+
handler: ({ selector, timeout, tabId }: any) => Promise<{
|
|
149
|
+
success: boolean;
|
|
150
|
+
message: string;
|
|
151
|
+
}>;
|
|
152
|
+
} | {
|
|
153
|
+
name: string;
|
|
154
|
+
description: string;
|
|
155
|
+
inputSchema: z.ZodObject<{
|
|
156
|
+
selector: z.ZodString;
|
|
157
|
+
value: z.ZodString;
|
|
158
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
value: string;
|
|
161
|
+
selector: string;
|
|
162
|
+
tabId?: string | undefined;
|
|
163
|
+
}, {
|
|
164
|
+
value: string;
|
|
165
|
+
selector: string;
|
|
166
|
+
tabId?: string | undefined;
|
|
167
|
+
}>;
|
|
168
|
+
handler: ({ selector, value, tabId }: any) => Promise<{
|
|
169
|
+
success: boolean;
|
|
170
|
+
message: string;
|
|
171
|
+
}>;
|
|
172
|
+
})[];
|
|
173
|
+
//# sourceMappingURL=interaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../src/tools/interaction.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG9D,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,eAAe;;;;;;;;;;;;;;;;oDAWL,GAAG;;;;;;;;;;;;;;;;;;;;;;;qDAwDF,GAAG;;;;;;;;;;;;;;;;;mCAgDrB,GAAG;;;;;;;;;;;;;;;;;;;;;8CAqCQ,GAAG;;;;;;;;;;;;;;;;;;;;;;+CAkCF,GAAG;;;;;;;;;;;;;;;;;;;;;;;yCAiCT,GAAG;;;;;;;;;;;;;;;;;;;;4CA6BA,GAAG;;;;;;;;;;;;;;;;;;;;0CAiCL,GAAG;;;;KA2BpD"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page Interaction Tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { humanDelay, waitFor } from '../utils/helpers.js';
|
|
6
|
+
export function createInteractionTools(connector) {
|
|
7
|
+
return [
|
|
8
|
+
// Click element
|
|
9
|
+
{
|
|
10
|
+
name: 'click',
|
|
11
|
+
description: 'Click on an element using CSS selector',
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
selector: z.string().describe('CSS selector of element to click'),
|
|
14
|
+
tabId: z.string().optional().describe('Tab ID (optional)'),
|
|
15
|
+
waitForSelector: z.boolean().optional().default(true).describe('Wait for selector to be visible')
|
|
16
|
+
}),
|
|
17
|
+
handler: async ({ selector, tabId, waitForSelector }) => {
|
|
18
|
+
const client = await connector.getTabClient(tabId);
|
|
19
|
+
const { Runtime, DOM } = client;
|
|
20
|
+
await Runtime.enable();
|
|
21
|
+
await DOM.enable();
|
|
22
|
+
// Wait for selector if requested
|
|
23
|
+
if (waitForSelector) {
|
|
24
|
+
const found = await waitFor(async () => {
|
|
25
|
+
const result = await Runtime.evaluate({
|
|
26
|
+
expression: `document.querySelector('${selector}') !== null`
|
|
27
|
+
});
|
|
28
|
+
return result.result.value === true;
|
|
29
|
+
}, 10000);
|
|
30
|
+
if (!found) {
|
|
31
|
+
throw new Error(`Selector not found: ${selector}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Add human-like delay
|
|
35
|
+
await humanDelay(100, 300);
|
|
36
|
+
// Click the element
|
|
37
|
+
await Runtime.evaluate({
|
|
38
|
+
expression: `
|
|
39
|
+
(function() {
|
|
40
|
+
const el = document.querySelector('${selector}');
|
|
41
|
+
if (!el) throw new Error('Element not found');
|
|
42
|
+
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
43
|
+
el.click();
|
|
44
|
+
return true;
|
|
45
|
+
})()
|
|
46
|
+
`
|
|
47
|
+
});
|
|
48
|
+
await humanDelay();
|
|
49
|
+
return {
|
|
50
|
+
success: true,
|
|
51
|
+
message: `Clicked on element: ${selector}`
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
// Type text
|
|
56
|
+
{
|
|
57
|
+
name: 'type',
|
|
58
|
+
description: 'Type text into an input element',
|
|
59
|
+
inputSchema: z.object({
|
|
60
|
+
selector: z.string().describe('CSS selector of input element'),
|
|
61
|
+
text: z.string().describe('Text to type'),
|
|
62
|
+
tabId: z.string().optional().describe('Tab ID (optional)'),
|
|
63
|
+
clearFirst: z.boolean().optional().default(true).describe('Clear existing text first')
|
|
64
|
+
}),
|
|
65
|
+
handler: async ({ selector, text, tabId, clearFirst }) => {
|
|
66
|
+
const client = await connector.getTabClient(tabId);
|
|
67
|
+
const { Runtime } = client;
|
|
68
|
+
await Runtime.enable();
|
|
69
|
+
// Type with human-like delays
|
|
70
|
+
const script = `
|
|
71
|
+
(async function() {
|
|
72
|
+
const el = document.querySelector('${selector}');
|
|
73
|
+
if (!el) throw new Error('Element not found');
|
|
74
|
+
|
|
75
|
+
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
76
|
+
el.focus();
|
|
77
|
+
|
|
78
|
+
${clearFirst ? 'el.value = "";' : ''}
|
|
79
|
+
|
|
80
|
+
// Simulate typing with delays
|
|
81
|
+
const text = ${JSON.stringify(text)};
|
|
82
|
+
for (let char of text) {
|
|
83
|
+
el.value += char;
|
|
84
|
+
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
85
|
+
await new Promise(r => setTimeout(r, ${Math.random() * 50 + 30}));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
89
|
+
return true;
|
|
90
|
+
})()
|
|
91
|
+
`;
|
|
92
|
+
await Runtime.evaluate({ expression: script, awaitPromise: true });
|
|
93
|
+
await humanDelay();
|
|
94
|
+
return {
|
|
95
|
+
success: true,
|
|
96
|
+
message: `Typed text into: ${selector}`
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
// Get text content
|
|
101
|
+
{
|
|
102
|
+
name: 'get_text',
|
|
103
|
+
description: 'Get text content from an element',
|
|
104
|
+
inputSchema: z.object({
|
|
105
|
+
selector: z.string().describe('CSS selector of element'),
|
|
106
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
107
|
+
}),
|
|
108
|
+
handler: async ({ selector, tabId }) => {
|
|
109
|
+
const client = await connector.getTabClient(tabId);
|
|
110
|
+
const { Runtime } = client;
|
|
111
|
+
await Runtime.enable();
|
|
112
|
+
const result = await Runtime.evaluate({
|
|
113
|
+
expression: `
|
|
114
|
+
(function() {
|
|
115
|
+
const el = document.querySelector('${selector}');
|
|
116
|
+
if (!el) return null;
|
|
117
|
+
return el.textContent.trim();
|
|
118
|
+
})()
|
|
119
|
+
`
|
|
120
|
+
});
|
|
121
|
+
if (result.result.value === null) {
|
|
122
|
+
throw new Error(`Element not found: ${selector}`);
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
success: true,
|
|
126
|
+
text: result.result.value,
|
|
127
|
+
selector
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
// Get attribute
|
|
132
|
+
{
|
|
133
|
+
name: 'get_attribute',
|
|
134
|
+
description: 'Get attribute value from an element',
|
|
135
|
+
inputSchema: z.object({
|
|
136
|
+
selector: z.string().describe('CSS selector of element'),
|
|
137
|
+
attribute: z.string().describe('Attribute name to get'),
|
|
138
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
139
|
+
}),
|
|
140
|
+
handler: async ({ selector, attribute, tabId }) => {
|
|
141
|
+
const client = await connector.getTabClient(tabId);
|
|
142
|
+
const { Runtime } = client;
|
|
143
|
+
await Runtime.enable();
|
|
144
|
+
const result = await Runtime.evaluate({
|
|
145
|
+
expression: `
|
|
146
|
+
(function() {
|
|
147
|
+
const el = document.querySelector('${selector}');
|
|
148
|
+
if (!el) return null;
|
|
149
|
+
return el.getAttribute('${attribute}');
|
|
150
|
+
})()
|
|
151
|
+
`
|
|
152
|
+
});
|
|
153
|
+
return {
|
|
154
|
+
success: true,
|
|
155
|
+
value: result.result.value,
|
|
156
|
+
selector,
|
|
157
|
+
attribute
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
// Execute JavaScript
|
|
162
|
+
{
|
|
163
|
+
name: 'execute_script',
|
|
164
|
+
description: 'Execute JavaScript code in the page context',
|
|
165
|
+
inputSchema: z.object({
|
|
166
|
+
script: z.string().describe('JavaScript code to execute'),
|
|
167
|
+
tabId: z.string().optional().describe('Tab ID (optional)'),
|
|
168
|
+
awaitPromise: z.boolean().optional().default(false).describe('Wait for promise to resolve')
|
|
169
|
+
}),
|
|
170
|
+
handler: async ({ script, tabId, awaitPromise }) => {
|
|
171
|
+
const client = await connector.getTabClient(tabId);
|
|
172
|
+
const { Runtime } = client;
|
|
173
|
+
await Runtime.enable();
|
|
174
|
+
const result = await Runtime.evaluate({
|
|
175
|
+
expression: script,
|
|
176
|
+
awaitPromise,
|
|
177
|
+
returnByValue: true
|
|
178
|
+
});
|
|
179
|
+
if (result.exceptionDetails) {
|
|
180
|
+
throw new Error(`Script execution failed: ${result.exceptionDetails.text}`);
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
success: true,
|
|
184
|
+
result: result.result.value
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
// Scroll
|
|
189
|
+
{
|
|
190
|
+
name: 'scroll',
|
|
191
|
+
description: 'Scroll the page or an element',
|
|
192
|
+
inputSchema: z.object({
|
|
193
|
+
x: z.number().optional().default(0).describe('Horizontal scroll position'),
|
|
194
|
+
y: z.number().optional().describe('Vertical scroll position'),
|
|
195
|
+
selector: z.string().optional().describe('CSS selector to scroll (scrolls window if not provided)'),
|
|
196
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
197
|
+
}),
|
|
198
|
+
handler: async ({ x, y, selector, tabId }) => {
|
|
199
|
+
const client = await connector.getTabClient(tabId);
|
|
200
|
+
const { Runtime } = client;
|
|
201
|
+
await Runtime.enable();
|
|
202
|
+
const scrollScript = selector
|
|
203
|
+
? `document.querySelector('${selector}').scrollTo(${x}, ${y || 0})`
|
|
204
|
+
: `window.scrollTo(${x}, ${y || 0})`;
|
|
205
|
+
await Runtime.evaluate({ expression: scrollScript });
|
|
206
|
+
await humanDelay();
|
|
207
|
+
return {
|
|
208
|
+
success: true,
|
|
209
|
+
message: `Scrolled to position (${x}, ${y || 0})`
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
// Wait for selector
|
|
214
|
+
{
|
|
215
|
+
name: 'wait_for_selector',
|
|
216
|
+
description: 'Wait for an element to appear on the page',
|
|
217
|
+
inputSchema: z.object({
|
|
218
|
+
selector: z.string().describe('CSS selector to wait for'),
|
|
219
|
+
timeout: z.number().optional().default(30000).describe('Timeout in milliseconds'),
|
|
220
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
221
|
+
}),
|
|
222
|
+
handler: async ({ selector, timeout, tabId }) => {
|
|
223
|
+
const client = await connector.getTabClient(tabId);
|
|
224
|
+
const { Runtime } = client;
|
|
225
|
+
await Runtime.enable();
|
|
226
|
+
const found = await waitFor(async () => {
|
|
227
|
+
const result = await Runtime.evaluate({
|
|
228
|
+
expression: `document.querySelector('${selector}') !== null`
|
|
229
|
+
});
|
|
230
|
+
return result.result.value === true;
|
|
231
|
+
}, timeout);
|
|
232
|
+
if (!found) {
|
|
233
|
+
throw new Error(`Timeout waiting for selector: ${selector}`);
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
success: true,
|
|
237
|
+
message: `Element found: ${selector}`
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
// Select option
|
|
242
|
+
{
|
|
243
|
+
name: 'select_option',
|
|
244
|
+
description: 'Select an option from a dropdown',
|
|
245
|
+
inputSchema: z.object({
|
|
246
|
+
selector: z.string().describe('CSS selector of select element'),
|
|
247
|
+
value: z.string().describe('Value to select'),
|
|
248
|
+
tabId: z.string().optional().describe('Tab ID (optional)')
|
|
249
|
+
}),
|
|
250
|
+
handler: async ({ selector, value, tabId }) => {
|
|
251
|
+
const client = await connector.getTabClient(tabId);
|
|
252
|
+
const { Runtime } = client;
|
|
253
|
+
await Runtime.enable();
|
|
254
|
+
await Runtime.evaluate({
|
|
255
|
+
expression: `
|
|
256
|
+
(function() {
|
|
257
|
+
const select = document.querySelector('${selector}');
|
|
258
|
+
if (!select) throw new Error('Select element not found');
|
|
259
|
+
select.value = '${value}';
|
|
260
|
+
select.dispatchEvent(new Event('change', { bubbles: true }));
|
|
261
|
+
return true;
|
|
262
|
+
})()
|
|
263
|
+
`
|
|
264
|
+
});
|
|
265
|
+
await humanDelay();
|
|
266
|
+
return {
|
|
267
|
+
success: true,
|
|
268
|
+
message: `Selected option "${value}" in ${selector}`
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
];
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=interaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/tools/interaction.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM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