-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent.yaml
More file actions
419 lines (415 loc) · 13.2 KB
/
agent.yaml
File metadata and controls
419 lines (415 loc) · 13.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
apiVersion: adl.dev/v1
kind: Agent
metadata:
name: browser-agent
description: AI agent for browser automation and web testing using Playwright
version: 0.2.1
spec:
capabilities:
streaming: true
pushNotifications: false
stateTransitionHistory: false
config:
browser:
user_agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
viewport_width: 1920
viewport_height: 1080
header_accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
header_accept_language: "en-US,en;q=0.9"
header_accept_encoding: "gzip, deflate, br"
header_dnt: "1"
header_connection: "keep-alive"
header_upgrade_insecure_requests: "1"
data_dir: "/tmp/playwright/artifacts"
args:
- "--disable-blink-features=AutomationControlled"
- "--disable-features=VizDisplayCompositor"
- "--no-first-run"
- "--disable-default-apps"
- "--disable-extensions"
- "--disable-plugins"
- "--disable-sync"
- "--disable-translate"
- "--hide-scrollbars"
- "--mute-audio"
- "--no-zygote"
- "--disable-background-timer-throttling"
- "--disable-backgrounding-occluded-windows"
- "--disable-renderer-backgrounding"
- "--disable-ipc-flooding-protection"
skills:
- id: navigate_to_url
name: navigate_to_url
description: Navigate to a specific URL and wait for the page to fully load
tags:
- navigation
- browser
- playwright
schema:
type: object
properties:
url:
type: string
description: The URL to navigate to
wait_until:
type: string
description: When to consider navigation succeeded (domcontentloaded, load, networkidle)
default: load
timeout:
type: integer
description: Maximum navigation timeout in milliseconds
default: 30000
required:
- url
inject:
- logger
- playwright
- id: click_element
name: click_element
description: Click on an element identified by selector, text, or other locator strategies
tags:
- interaction
- click
- playwright
schema:
type: object
properties:
selector:
type: string
description: CSS selector, XPath, or text to identify the element
click_count:
type: integer
description: Number of times to click
default: 1
button:
type: string
description: Mouse button to use (left, right, middle)
default: left
force:
type: boolean
description: Force click even if element is not visible
default: false
timeout:
type: integer
description: Maximum time to wait for element in milliseconds
default: 30000
required:
- selector
inject:
- logger
- playwright
- id: fill_form
name: fill_form
description: Fill form fields with provided data, handling various input types
tags:
- form
- input
- automation
- playwright
schema:
type: object
properties:
fields:
type: array
items:
type: object
properties:
selector:
type: string
description: Selector for the form field
value:
type: string
description: Value to fill in the field
type:
type: string
description: Type of input (text, select, checkbox, radio)
required:
- selector
- value
description: List of form fields to fill
submit:
type: boolean
description: Whether to submit the form after filling
default: false
submit_selector:
type: string
description: Selector for the submit button if submit is true
required:
- fields
inject:
- logger
- playwright
- id: extract_data
name: extract_data
description: Extract data from the page using selectors and return structured information
tags:
- scraping
- extraction
- data
- playwright
schema:
type: object
properties:
extractors:
type: array
items:
type: object
properties:
name:
type: string
description: Name for the extracted data field
selector:
type: string
description: CSS selector or XPath to extract data from
attribute:
type: string
description: Attribute to extract (text, href, src, etc.)
default: text
multiple:
type: boolean
description: Extract all matching elements or just the first
default: false
required:
- name
- selector
description: List of data extractors to run
format:
type: string
description: Output format (json, csv, text)
default: json
required:
- extractors
inject:
- logger
- playwright
- id: take_screenshot
name: take_screenshot
description: Capture a screenshot of the current page or specific element
tags:
- screenshot
- capture
- visual
- playwright
schema:
type: object
properties:
full_page:
type: boolean
description: Capture the entire scrollable page
default: false
selector:
type: string
description: Optional selector to screenshot specific element
type:
type: string
description: Image format (png, jpeg)
default: png
quality:
type: integer
description: Quality for jpeg images (0-100)
default: 80
required: []
inject:
- logger
- playwright
- id: execute_script
name: execute_script
description: Execute custom JavaScript code in the browser context
tags:
- javascript
- execution
- custom
- playwright
schema:
type: object
properties:
script:
type: string
description: JavaScript code to execute
args:
type: array
items:
type: string
description: Arguments to pass to the script
return_value:
type: boolean
description: Whether to return the script execution result
default: true
required:
- script
inject:
- logger
- playwright
- id: handle_authentication
name: handle_authentication
description: Handle various authentication scenarios including basic auth, OAuth, and custom login forms
tags:
- authentication
- login
- security
- playwright
schema:
type: object
properties:
type:
type: string
description: Authentication type (basic, form, oauth)
username:
type: string
description: Username or email for authentication
password:
type: string
description: Password for authentication
login_url:
type: string
description: URL of the login page for form authentication
username_selector:
type: string
description: Selector for username field in form authentication
password_selector:
type: string
description: Selector for password field in form authentication
submit_selector:
type: string
description: Selector for submit button in form authentication
required:
- type
inject:
- logger
- playwright
- id: wait_for_condition
name: wait_for_condition
description: Wait for specific conditions before proceeding with automation
tags:
- wait
- synchronization
- timing
- playwright
schema:
type: object
properties:
condition:
type: string
description: Type of condition (selector, navigation, function, timeout, networkidle)
selector:
type: string
description: Selector to wait for if condition is 'selector'
state:
type: string
description: State to wait for (visible, hidden, attached, detached)
default: visible
timeout:
type: integer
description: Maximum time to wait in milliseconds
default: 30000
custom_function:
type: string
description: Custom JavaScript function to evaluate for 'function' condition
required:
- condition
inject:
- logger
- playwright
- id: write_to_csv
name: write_to_csv
description: Write structured data to CSV files with support for custom headers and file paths
tags:
- export
- csv
- data
- file
schema:
type: object
properties:
data:
type: array
items:
type: object
description: Array of objects to write to CSV, each object represents a row
filename:
type: string
description: Name of the CSV file (without path, will be saved to configured data directory)
headers:
type: array
items:
type: string
description: Custom column headers for the CSV file (optional, will use object keys if not provided)
append:
type: boolean
description: Whether to append to existing file or create new file
default: false
include_headers:
type: boolean
description: Whether to include headers in the CSV output
default: true
required:
- data
- filename
inject:
- logger
- playwright
agent:
provider: ""
model: ""
systemPrompt: |
You are an expert Playwright browser automation assistant. Your primary role is to help users automate web browser tasks efficiently and reliably.
Your core capabilities include:
1. **Web Navigation**: Navigate to URLs, handle redirects, and manage page loads
2. **Element Interaction**: Click buttons, fill forms, select dropdowns, and interact with any web element
3. **Data Extraction**: Scrape and extract structured data from web pages
4. **Form Automation**: Fill and submit complex forms with validation
5. **Screenshot Capture**: Take full-page or element-specific screenshots
6. **JavaScript Execution**: Run custom scripts in the browser context
7. **Authentication Handling**: Manage various authentication methods
8. **Synchronization**: Wait for specific conditions and handle dynamic content
Key expertise areas:
- Modern web technologies (SPA, dynamic content, AJAX)
- Selector strategies (CSS, XPath, text, accessibility)
- Browser automation best practices
- Error handling and retry mechanisms
- Cross-browser compatibility (Chromium, Firefox, WebKit)
- Performance optimization for automation scripts
- Handling pop-ups, alerts, and iframes
- File uploads and downloads
- Network interception and modification
- Mobile and responsive testing
When helping users:
- Always use robust selectors that won't break easily
- Implement proper wait strategies for dynamic content
- Handle errors gracefully with informative messages
- Suggest efficient approaches for the task
- Consider accessibility and best practices
- Provide clear explanations of automation steps
- Optimize for speed while maintaining reliability
Your automation solutions should be maintainable, efficient, and production-ready.
services:
playwright:
type: service
interface: BrowserAutomation
factory: NewPlaywrightService
description: Playwright service for browser automation and web testing
server:
port: 8080
debug: false
language:
go:
module: github.com/inference-gateway/browser-agent
version: "1.25"
acronyms:
- DOM
- CSS
- XPath
- URL
- API
- SPA
- AJAX
scm:
provider: github
url: https://github.com/inference-gateway/browser-agent
github_app: true
issue_templates: true
sandbox:
flox:
enabled: true
artifacts:
enabled: true