summaryrefslogtreecommitdiff
path: root/tools_playwright.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-03-02 19:20:54 +0300
committerGrail Finder <wohilas@gmail.com>2026-03-02 19:20:54 +0300
commitcad1bd46c191f811729ab1cd5f044931c7d10269 (patch)
tree5bdd1760a1d964cc3a685b58d2da38e209c59924 /tools_playwright.go
parent4bddce37009f93c6b931e852aa4770212fe7654d (diff)
Feat: playwright tools
Diffstat (limited to 'tools_playwright.go')
-rw-r--r--tools_playwright.go62
1 files changed, 62 insertions, 0 deletions
diff --git a/tools_playwright.go b/tools_playwright.go
new file mode 100644
index 0000000..e8b3db5
--- /dev/null
+++ b/tools_playwright.go
@@ -0,0 +1,62 @@
+package main
+
+var browserToolSysMsg = `
+Additional browser automation tools (Playwright):
+[
+{
+ "name": "pw_start",
+ "args": [],
+ "when_to_use": "start a browser instance before doing any browser automation. Must be called first."
+},
+{
+ "name": "pw_stop",
+ "args": [],
+ "when_to_use": "stop the browser instance when done with automation."
+},
+{
+ "name": "pw_is_running",
+ "args": [],
+ "when_to_use": "check if browser is currently running."
+},
+{
+ "name": "pw_navigate",
+ "args": ["url"],
+ "when_to_use": "when asked to open a specific URL in a web browser."
+},
+{
+ "name": "pw_click",
+ "args": ["selector", "index"],
+ "when_to_use": "when asked to click on an element on the current webpage. 'index' is optional (default 0) to handle multiple matches."
+},
+{
+ "name": "pw_fill",
+ "args": ["selector", "text", "index"],
+ "when_to_use": "when asked to type text into an input field. 'index' is optional."
+},
+{
+ "name": "pw_extract_text",
+ "args": ["selector"],
+ "when_to_use": "when asked to get text content from the page or specific elements. Use selector 'body' for all page text."
+},
+{
+ "name": "pw_screenshot",
+ "args": ["selector", "full_page"],
+ "when_to_use": "when asked to take a screenshot of the page or a specific element. Returns a file path to the image."
+},
+{
+ "name": "pw_screenshot_and_view",
+ "args": ["selector", "full_page"],
+ "when_to_use": "when asked to take a screenshot and show it to the model. Returns image for viewing."
+},
+{
+ "name": "pw_wait_for_selector",
+ "args": ["selector", "timeout"],
+ "when_to_use": "when asked to wait for an element to appear on the page before proceeding."
+},
+{
+ "name": "pw_drag",
+ "args": ["x1", "y1", "x2", "y2"],
+ "when_to_use": "drag the mouse from point (x1,y1) to (x2,y2)"
+}
+]
+`