@melony/plugin-browser 0.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/dist/index.d.ts +59 -0
- package/dist/index.js +197 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { MelonyPlugin } from 'melony';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
declare const browserToolDefinitions: {
|
|
5
|
+
browser_navigate: {
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: z.ZodObject<{
|
|
8
|
+
url: z.ZodString;
|
|
9
|
+
waitUntil: z.ZodDefault<z.ZodEnum<{
|
|
10
|
+
load: "load";
|
|
11
|
+
domcontentloaded: "domcontentloaded";
|
|
12
|
+
networkidle: "networkidle";
|
|
13
|
+
commit: "commit";
|
|
14
|
+
}>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
};
|
|
17
|
+
browser_screenshot: {
|
|
18
|
+
description: string;
|
|
19
|
+
inputSchema: z.ZodObject<{
|
|
20
|
+
fullPage: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
};
|
|
23
|
+
browser_click: {
|
|
24
|
+
description: string;
|
|
25
|
+
inputSchema: z.ZodObject<{
|
|
26
|
+
selector: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
};
|
|
29
|
+
browser_type: {
|
|
30
|
+
description: string;
|
|
31
|
+
inputSchema: z.ZodObject<{
|
|
32
|
+
selector: z.ZodString;
|
|
33
|
+
text: z.ZodString;
|
|
34
|
+
delay: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
};
|
|
37
|
+
browser_getContent: {
|
|
38
|
+
description: string;
|
|
39
|
+
inputSchema: z.ZodObject<{
|
|
40
|
+
format: z.ZodDefault<z.ZodEnum<{
|
|
41
|
+
text: "text";
|
|
42
|
+
html: "html";
|
|
43
|
+
markdown: "markdown";
|
|
44
|
+
}>>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
};
|
|
47
|
+
browser_evaluate: {
|
|
48
|
+
description: string;
|
|
49
|
+
inputSchema: z.ZodObject<{
|
|
50
|
+
script: z.ZodString;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
interface BrowserPluginOptions {
|
|
55
|
+
headless?: boolean;
|
|
56
|
+
}
|
|
57
|
+
declare const browserPlugin: (options?: BrowserPluginOptions) => MelonyPlugin<any, any>;
|
|
58
|
+
|
|
59
|
+
export { type BrowserPluginOptions, browserPlugin, browserToolDefinitions };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { chromium } from "playwright";
|
|
4
|
+
var browserToolDefinitions = {
|
|
5
|
+
browser_navigate: {
|
|
6
|
+
description: "Navigate to a URL and wait for the page to load",
|
|
7
|
+
inputSchema: z.object({
|
|
8
|
+
url: z.string().describe("The URL to navigate to"),
|
|
9
|
+
waitUntil: z.enum(["load", "domcontentloaded", "networkidle", "commit"]).default("load").describe("When to consider navigation finished")
|
|
10
|
+
})
|
|
11
|
+
},
|
|
12
|
+
browser_screenshot: {
|
|
13
|
+
description: "Take a screenshot of the current page and return it as a base64 image",
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
fullPage: z.boolean().default(false).describe("Whether to take a screenshot of the full scrollable page")
|
|
16
|
+
})
|
|
17
|
+
},
|
|
18
|
+
browser_click: {
|
|
19
|
+
description: "Click an element on the page",
|
|
20
|
+
inputSchema: z.object({
|
|
21
|
+
selector: z.string().describe("CSS selector or XPath of the element to click")
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
browser_type: {
|
|
25
|
+
description: "Type text into an input field",
|
|
26
|
+
inputSchema: z.object({
|
|
27
|
+
selector: z.string().describe("CSS selector or XPath of the element to type into"),
|
|
28
|
+
text: z.string().describe("The text to type"),
|
|
29
|
+
delay: z.number().optional().describe("Delay between keystrokes in milliseconds")
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
browser_getContent: {
|
|
33
|
+
description: "Get the content of the current page",
|
|
34
|
+
inputSchema: z.object({
|
|
35
|
+
format: z.enum(["text", "html", "markdown"]).default("text").describe("The format to return the content in")
|
|
36
|
+
})
|
|
37
|
+
},
|
|
38
|
+
browser_evaluate: {
|
|
39
|
+
description: "Execute JavaScript code in the context of the page",
|
|
40
|
+
inputSchema: z.object({
|
|
41
|
+
script: z.string().describe("The JavaScript code to execute")
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var browserPlugin = (options = {}) => {
|
|
46
|
+
let browser = null;
|
|
47
|
+
let page = null;
|
|
48
|
+
const { headless = true } = options;
|
|
49
|
+
async function ensurePage() {
|
|
50
|
+
if (!browser) {
|
|
51
|
+
browser = await chromium.launch({ headless });
|
|
52
|
+
}
|
|
53
|
+
if (!page) {
|
|
54
|
+
const context = await browser.newContext({
|
|
55
|
+
viewport: { width: 1280, height: 720 }
|
|
56
|
+
});
|
|
57
|
+
page = await context.newPage();
|
|
58
|
+
}
|
|
59
|
+
return page;
|
|
60
|
+
}
|
|
61
|
+
return (builder) => {
|
|
62
|
+
builder.on("action:browser_navigate", async function* (event) {
|
|
63
|
+
const { url, waitUntil, toolCallId } = event.data;
|
|
64
|
+
try {
|
|
65
|
+
const page2 = await ensurePage();
|
|
66
|
+
await page2.goto(url, { waitUntil });
|
|
67
|
+
yield {
|
|
68
|
+
type: "action:result",
|
|
69
|
+
data: {
|
|
70
|
+
action: "browser_navigate",
|
|
71
|
+
toolCallId,
|
|
72
|
+
result: { success: true, url: page2.url(), title: await page2.title() }
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
} catch (error) {
|
|
76
|
+
yield {
|
|
77
|
+
type: "action:result",
|
|
78
|
+
data: { action: "browser_navigate", toolCallId, result: { error: error.message } }
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
builder.on("action:browser_screenshot", async function* (event) {
|
|
83
|
+
const { fullPage, toolCallId } = event.data;
|
|
84
|
+
try {
|
|
85
|
+
const page2 = await ensurePage();
|
|
86
|
+
const buffer = await page2.screenshot({ fullPage, type: "png" });
|
|
87
|
+
const base64 = buffer.toString("base64");
|
|
88
|
+
yield {
|
|
89
|
+
type: "action:result",
|
|
90
|
+
data: {
|
|
91
|
+
action: "browser_screenshot",
|
|
92
|
+
toolCallId,
|
|
93
|
+
result: { success: true, format: "png", base64: `data:image/png;base64,${base64}` }
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
yield {
|
|
97
|
+
type: "ui",
|
|
98
|
+
data: {
|
|
99
|
+
type: "card",
|
|
100
|
+
props: { title: "Page Screenshot" },
|
|
101
|
+
children: [
|
|
102
|
+
{
|
|
103
|
+
type: "image",
|
|
104
|
+
props: {
|
|
105
|
+
src: `data:image/png;base64,${base64}`,
|
|
106
|
+
alt: "Browser Screenshot",
|
|
107
|
+
width: "full"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
} catch (error) {
|
|
114
|
+
yield {
|
|
115
|
+
type: "action:result",
|
|
116
|
+
data: { action: "browser_screenshot", toolCallId, result: { error: error.message } }
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
builder.on("action:browser_click", async function* (event) {
|
|
121
|
+
const { selector, toolCallId } = event.data;
|
|
122
|
+
try {
|
|
123
|
+
const page2 = await ensurePage();
|
|
124
|
+
await page2.click(selector);
|
|
125
|
+
yield {
|
|
126
|
+
type: "action:result",
|
|
127
|
+
data: { action: "browser_click", toolCallId, result: { success: true } }
|
|
128
|
+
};
|
|
129
|
+
} catch (error) {
|
|
130
|
+
yield {
|
|
131
|
+
type: "action:result",
|
|
132
|
+
data: { action: "browser_click", toolCallId, result: { error: error.message } }
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
builder.on("action:browser_type", async function* (event) {
|
|
137
|
+
const { selector, text, delay, toolCallId } = event.data;
|
|
138
|
+
try {
|
|
139
|
+
const page2 = await ensurePage();
|
|
140
|
+
await page2.type(selector, text, { delay });
|
|
141
|
+
yield {
|
|
142
|
+
type: "action:result",
|
|
143
|
+
data: { action: "browser_type", toolCallId, result: { success: true } }
|
|
144
|
+
};
|
|
145
|
+
} catch (error) {
|
|
146
|
+
yield {
|
|
147
|
+
type: "action:result",
|
|
148
|
+
data: { action: "browser_type", toolCallId, result: { error: error.message } }
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
builder.on("action:browser_getContent", async function* (event) {
|
|
153
|
+
const { format, toolCallId } = event.data;
|
|
154
|
+
try {
|
|
155
|
+
const page2 = await ensurePage();
|
|
156
|
+
let content = "";
|
|
157
|
+
if (format === "html") {
|
|
158
|
+
content = await page2.content();
|
|
159
|
+
} else if (format === "text") {
|
|
160
|
+
content = await page2.evaluate(() => document.body.innerText);
|
|
161
|
+
} else if (format === "markdown") {
|
|
162
|
+
content = await page2.evaluate(() => document.body.innerText);
|
|
163
|
+
}
|
|
164
|
+
yield {
|
|
165
|
+
type: "action:result",
|
|
166
|
+
data: { action: "browser_getContent", toolCallId, result: { success: true, content } }
|
|
167
|
+
};
|
|
168
|
+
} catch (error) {
|
|
169
|
+
yield {
|
|
170
|
+
type: "action:result",
|
|
171
|
+
data: { action: "browser_getContent", toolCallId, result: { error: error.message } }
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
builder.on("action:browser_evaluate", async function* (event) {
|
|
176
|
+
const { script, toolCallId } = event.data;
|
|
177
|
+
try {
|
|
178
|
+
const page2 = await ensurePage();
|
|
179
|
+
const result = await page2.evaluate(script);
|
|
180
|
+
yield {
|
|
181
|
+
type: "action:result",
|
|
182
|
+
data: { action: "browser_evaluate", toolCallId, result: { success: true, result } }
|
|
183
|
+
};
|
|
184
|
+
} catch (error) {
|
|
185
|
+
yield {
|
|
186
|
+
type: "action:result",
|
|
187
|
+
data: { action: "browser_evaluate", toolCallId, result: { error: error.message } }
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
export {
|
|
194
|
+
browserPlugin,
|
|
195
|
+
browserToolDefinitions
|
|
196
|
+
};
|
|
197
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { MelonyPlugin } from \"melony\";\nimport { z } from \"zod\";\nimport { chromium, Browser, Page } from \"playwright\";\n\nexport const browserToolDefinitions = {\n browser_navigate: {\n description: \"Navigate to a URL and wait for the page to load\",\n inputSchema: z.object({\n url: z.string().describe(\"The URL to navigate to\"),\n waitUntil: z.enum([\"load\", \"domcontentloaded\", \"networkidle\", \"commit\"]).default(\"load\").describe(\"When to consider navigation finished\"),\n }),\n },\n browser_screenshot: {\n description: \"Take a screenshot of the current page and return it as a base64 image\",\n inputSchema: z.object({\n fullPage: z.boolean().default(false).describe(\"Whether to take a screenshot of the full scrollable page\"),\n }),\n },\n browser_click: {\n description: \"Click an element on the page\",\n inputSchema: z.object({\n selector: z.string().describe(\"CSS selector or XPath of the element to click\"),\n }),\n },\n browser_type: {\n description: \"Type text into an input field\",\n inputSchema: z.object({\n selector: z.string().describe(\"CSS selector or XPath of the element to type into\"),\n text: z.string().describe(\"The text to type\"),\n delay: z.number().optional().describe(\"Delay between keystrokes in milliseconds\"),\n }),\n },\n browser_getContent: {\n description: \"Get the content of the current page\",\n inputSchema: z.object({\n format: z.enum([\"text\", \"html\", \"markdown\"]).default(\"text\").describe(\"The format to return the content in\"),\n }),\n },\n browser_evaluate: {\n description: \"Execute JavaScript code in the context of the page\",\n inputSchema: z.object({\n script: z.string().describe(\"The JavaScript code to execute\"),\n }),\n },\n};\n\nexport interface BrowserPluginOptions {\n headless?: boolean;\n}\n\nexport const browserPlugin = (options: BrowserPluginOptions = {}): MelonyPlugin<any, any> => {\n let browser: Browser | null = null;\n let page: Page | null = null;\n\n const { headless = true } = options;\n\n async function ensurePage(): Promise<Page> {\n if (!browser) {\n browser = await chromium.launch({ headless });\n }\n if (!page) {\n const context = await browser.newContext({\n viewport: { width: 1280, height: 720 },\n });\n page = await context.newPage();\n }\n return page;\n }\n\n return (builder) => {\n builder.on(\"action:browser_navigate\", async function* (event) {\n const { url, waitUntil, toolCallId } = event.data;\n try {\n const page = await ensurePage();\n await page.goto(url, { waitUntil });\n yield {\n type: \"action:result\",\n data: {\n action: \"browser_navigate\",\n toolCallId,\n result: { success: true, url: page.url(), title: await page.title() },\n },\n };\n } catch (error: any) {\n yield {\n type: \"action:result\",\n data: { action: \"browser_navigate\", toolCallId, result: { error: error.message } },\n };\n }\n });\n\n builder.on(\"action:browser_screenshot\", async function* (event) {\n const { fullPage, toolCallId } = event.data;\n try {\n const page = await ensurePage();\n const buffer = await page.screenshot({ fullPage, type: \"png\" });\n const base64 = buffer.toString(\"base64\");\n \n // Return both the raw result and a UI event to show the screenshot\n yield {\n type: \"action:result\",\n data: {\n action: \"browser_screenshot\",\n toolCallId,\n result: { success: true, format: \"png\", base64: `data:image/png;base64,${base64}` },\n },\n };\n\n yield {\n type: \"ui\",\n data: {\n type: \"card\",\n props: { title: \"Page Screenshot\" },\n children: [\n {\n type: \"image\",\n props: {\n src: `data:image/png;base64,${base64}`,\n alt: \"Browser Screenshot\",\n width: \"full\",\n },\n },\n ],\n },\n };\n } catch (error: any) {\n yield {\n type: \"action:result\",\n data: { action: \"browser_screenshot\", toolCallId, result: { error: error.message } },\n };\n }\n });\n\n builder.on(\"action:browser_click\", async function* (event) {\n const { selector, toolCallId } = event.data;\n try {\n const page = await ensurePage();\n await page.click(selector);\n yield {\n type: \"action:result\",\n data: { action: \"browser_click\", toolCallId, result: { success: true } },\n };\n } catch (error: any) {\n yield {\n type: \"action:result\",\n data: { action: \"browser_click\", toolCallId, result: { error: error.message } },\n };\n }\n });\n\n builder.on(\"action:browser_type\", async function* (event) {\n const { selector, text, delay, toolCallId } = event.data;\n try {\n const page = await ensurePage();\n await page.type(selector, text, { delay });\n yield {\n type: \"action:result\",\n data: { action: \"browser_type\", toolCallId, result: { success: true } },\n };\n } catch (error: any) {\n yield {\n type: \"action:result\",\n data: { action: \"browser_type\", toolCallId, result: { error: error.message } },\n };\n }\n });\n\n builder.on(\"action:browser_getContent\", async function* (event) {\n const { format, toolCallId } = event.data;\n try {\n const page = await ensurePage();\n let content = \"\";\n if (format === \"html\") {\n content = await page.content();\n } else if (format === \"text\") {\n content = await page.evaluate(() => document.body.innerText);\n } else if (format === \"markdown\") {\n // Basic markdown conversion if needed, for now just text\n content = await page.evaluate(() => document.body.innerText);\n }\n yield {\n type: \"action:result\",\n data: { action: \"browser_getContent\", toolCallId, result: { success: true, content } },\n };\n } catch (error: any) {\n yield {\n type: \"action:result\",\n data: { action: \"browser_getContent\", toolCallId, result: { error: error.message } },\n };\n }\n });\n\n builder.on(\"action:browser_evaluate\", async function* (event) {\n const { script, toolCallId } = event.data;\n try {\n const page = await ensurePage();\n const result = await page.evaluate(script);\n yield {\n type: \"action:result\",\n data: { action: \"browser_evaluate\", toolCallId, result: { success: true, result } },\n };\n } catch (error: any) {\n yield {\n type: \"action:result\",\n data: { action: \"browser_evaluate\", toolCallId, result: { error: error.message } },\n };\n }\n });\n };\n};\n"],"mappings":";AACA,SAAS,SAAS;AAClB,SAAS,gBAA+B;AAEjC,IAAM,yBAAyB;AAAA,EACpC,kBAAkB;AAAA,IAChB,aAAa;AAAA,IACb,aAAa,EAAE,OAAO;AAAA,MACpB,KAAK,EAAE,OAAO,EAAE,SAAS,wBAAwB;AAAA,MACjD,WAAW,EAAE,KAAK,CAAC,QAAQ,oBAAoB,eAAe,QAAQ,CA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AM,QAAQ,EAAE;AAAA,QACnF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":["page"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@melony/plugin-browser",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"zod": "^3.0.0 || ^4.0.0",
|
|
20
|
+
"melony": "0.2.5"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"playwright": "^1.45.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"zod": "^4.3.5",
|
|
27
|
+
"tsup": "^8.3.0",
|
|
28
|
+
"typescript": "^5.5.4",
|
|
29
|
+
"rimraf": "^5.0.10",
|
|
30
|
+
"@types/node": "^20.14.10",
|
|
31
|
+
"melony": "0.2.5"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsup",
|
|
38
|
+
"dev": "tsup --watch",
|
|
39
|
+
"clean": "rimraf dist",
|
|
40
|
+
"typecheck": "tsc --noEmit"
|
|
41
|
+
}
|
|
42
|
+
}
|