@mastra/agent-browser 0.2.0-alpha.0 → 0.2.1-alpha.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/CHANGELOG.md +22 -0
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -219,7 +219,9 @@ var dragInputSchema = z.object({
|
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
221
|
var evaluateInputSchema = z.object({
|
|
222
|
-
script: z.string().describe(
|
|
222
|
+
script: z.string().describe(
|
|
223
|
+
"JavaScript expression to evaluate in the browser and return the result. Do not use `return` \u2014 write a bare expression like `document.title` or `1 + 1`. For async code, wrap in an async IIFE: `(async () => { ... })()`."
|
|
224
|
+
),
|
|
223
225
|
arg: z.unknown().optional().describe("Argument to pass to the script (JSON-serializable)")
|
|
224
226
|
});
|
|
225
227
|
var browserSchemas = {
|
|
@@ -1461,8 +1463,7 @@ var AgentBrowser = class extends MastraBrowser {
|
|
|
1461
1463
|
async evaluate(input, threadId) {
|
|
1462
1464
|
try {
|
|
1463
1465
|
const page = await this.getPage(threadId);
|
|
1464
|
-
const
|
|
1465
|
-
const result = await page.evaluate(wrappedScript);
|
|
1466
|
+
const result = await page.evaluate(input.script);
|
|
1466
1467
|
return {
|
|
1467
1468
|
success: true,
|
|
1468
1469
|
result,
|