@mastra/stagehand 0.3.4-alpha.0 → 0.3.4
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/README.md +7 -71
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -32,79 +32,15 @@ const agent = new Agent({
|
|
|
32
32
|
const result = await agent.generate('Go to google.com and search for "Mastra AI"');
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
const browser = new StagehandBrowser({
|
|
39
|
-
// Environment: 'LOCAL' or 'BROWSERBASE'
|
|
40
|
-
env: 'LOCAL',
|
|
41
|
-
|
|
42
|
-
// Model for AI operations (default: 'openai/gpt-5.4')
|
|
43
|
-
model: 'openai/gpt-5.4',
|
|
44
|
-
// Or with custom config:
|
|
45
|
-
model: {
|
|
46
|
-
modelName: 'gpt-5.4',
|
|
47
|
-
apiKey: process.env.OPENAI_API_KEY,
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
// Run headless (default: true)
|
|
51
|
-
headless: true,
|
|
52
|
-
|
|
53
|
-
// Viewport dimensions
|
|
54
|
-
viewport: { width: 1280, height: 720 },
|
|
55
|
-
|
|
56
|
-
// CDP URL for connecting to existing browser
|
|
57
|
-
cdpUrl: 'ws://localhost:9222',
|
|
58
|
-
|
|
59
|
-
// Browserbase config (when env: 'BROWSERBASE')
|
|
60
|
-
apiKey: process.env.BROWSERBASE_API_KEY,
|
|
61
|
-
projectId: process.env.BROWSERBASE_PROJECT_ID,
|
|
62
|
-
|
|
63
|
-
// Enable self-healing selectors (default: true)
|
|
64
|
-
selfHeal: true,
|
|
65
|
-
|
|
66
|
-
// DOM settle timeout in ms (default: 5000)
|
|
67
|
-
domSettleTimeout: 5000,
|
|
68
|
-
|
|
69
|
-
// Logging verbosity (0: silent, 1: errors, 2: verbose)
|
|
70
|
-
verbose: 1,
|
|
71
|
-
|
|
72
|
-
// Custom system prompt for AI operations
|
|
73
|
-
systemPrompt: 'Focus on finding interactive elements',
|
|
74
|
-
});
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Tools
|
|
78
|
-
|
|
79
|
-
StagehandBrowser exposes 6 AI-powered tools:
|
|
80
|
-
|
|
81
|
-
### Core AI Tools
|
|
82
|
-
|
|
83
|
-
- **stagehand_act** - Perform actions using natural language instructions
|
|
84
|
-
- **stagehand_extract** - Extract structured data from pages
|
|
85
|
-
- **stagehand_observe** - Discover actionable elements on the page
|
|
86
|
-
|
|
87
|
-
### Navigation & State
|
|
88
|
-
|
|
89
|
-
- **stagehand_navigate** - Navigate to a URL
|
|
90
|
-
- **stagehand_tabs** - List, switch, open, or close browser tabs
|
|
91
|
-
- **stagehand_close** - Close the browser
|
|
92
|
-
|
|
93
|
-
## Comparison with AgentBrowser
|
|
35
|
+
## Documentation
|
|
94
36
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
| Approach | Deterministic refs (@e1) | Natural language |
|
|
98
|
-
| Token cost | Low | Higher (LLM calls) |
|
|
99
|
-
| Speed | Fast | Slower |
|
|
100
|
-
| Reliability | High (exact refs) | Variable (AI interpretation) |
|
|
101
|
-
| Best for | Structured workflows | Unknown/dynamic pages |
|
|
37
|
+
- [Stagehand integration guide](https://mastra.ai/integrations/browsers/stagehand)
|
|
38
|
+
- [Stagehand browser reference](https://mastra.ai/reference/browser/stagehand-browser)
|
|
102
39
|
|
|
103
|
-
##
|
|
40
|
+
## Changelog
|
|
104
41
|
|
|
105
|
-
|
|
106
|
-
- [StagehandBrowser reference](https://mastra.ai/reference/browser/stagehand-browser) - API reference
|
|
42
|
+
See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/browser/stagehand/CHANGELOG.md) for version history and release notes.
|
|
107
43
|
|
|
108
|
-
##
|
|
44
|
+
## Support
|
|
109
45
|
|
|
110
|
-
|
|
46
|
+
We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/stagehand",
|
|
3
|
-
"version": "0.3.4
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "AI-powered browser automation for Mastra agents using Stagehand",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"typescript": "^7.0.2",
|
|
35
35
|
"vitest": "4.1.10",
|
|
36
36
|
"zod": "^4.4.3",
|
|
37
|
-
"@internal/
|
|
38
|
-
"@internal/
|
|
39
|
-
"@internal/types-builder": "0.0.
|
|
40
|
-
"@mastra/core": "1.64.0
|
|
37
|
+
"@internal/lint": "0.0.130",
|
|
38
|
+
"@internal/browser-test-utils": "0.0.49",
|
|
39
|
+
"@internal/types-builder": "0.0.105",
|
|
40
|
+
"@mastra/core": "1.64.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@mastra/core": ">=1.22.0-0 <2.0.0-0",
|