Commit b1a3793
authored
Danny/kernel 716 cli gemini cua template action broken (#58)
## Fix: Update Gemini Computer Use template for Stagehand v3
compatibility
### Description
Updates the Gemini Computer Use template to work with Stagehand v3 API,
which introduced breaking changes from v2.
### Changes
#### 🔧 Stagehand v3 Migration (`index.ts`)
- **Removed OpenAI dependency**: The template now only requires
`GOOGLE_API_KEY` (Stagehand v3 no longer requires a separate OpenAI key
for its internal operations)
- **Updated Stagehand initialization**:
- `domSettleTimeoutMs` → `domSettleTimeout`
- Removed `modelName` and `modelClientOptions` from constructor
- **Updated page access**: `stagehand.page` →
`stagehand.context.pages()[0]`
- **Updated agent configuration** to v3 format:
// v2 (old)
stagehand.agent({
provider: "google",
model: "gemini-2.5-...",
instructions: "...",
options: { apiKey: ... }
})
// v3 (new)
stagehand.agent({
cua: true,
model: { modelName: "google/gemini-2.5-...", apiKey: ... },
systemPrompt: "..."
})
#### ✨ Template Improvements
- Made task configurable via `startingUrl` and `instruction` payload
parameters
- Changed default example to use magnitasks.com Kanban board demo (more
reliable than YCombinator search)
- Added `CuaTaskInput` interface for typed payload support
#### 📚 Documentation Updates
- Removed `OPENAI_API_KEY` from setup requirements
- Added "Alternative Model Providers" section showing how to switch to
OpenAI or Anthropic
- Improved deployment instructions to use `--env-file .env` approach
- Updated `.env.example` to remove unnecessary OpenAI key
### Testing
- [x] `make build` passes
- [x] `make test` passes
- [x] `/qa` cursor command passes
### Related
Fixes KERNEL-716
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is
generating a summary for commit
5678806. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent b0321ad commit b1a3793
File tree
5 files changed
+61
-44
lines changed- .cursor/commands
- pkg/templates/typescript/gemini-computer-use
5 files changed
+61
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 161 | + | |
165 | 162 | | |
166 | 163 | | |
167 | 164 | | |
| |||
214 | 211 | | |
215 | 212 | | |
216 | 213 | | |
217 | | - | |
| 214 | + | |
218 | 215 | | |
219 | 216 | | |
220 | 217 | | |
| |||
232 | 229 | | |
233 | 230 | | |
234 | 231 | | |
235 | | - | |
236 | | - | |
237 | 232 | | |
238 | 233 | | |
239 | 234 | | |
| |||
258 | 253 | | |
259 | 254 | | |
260 | 255 | | |
261 | | - | |
262 | 256 | | |
263 | 257 | | |
264 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
| 27 | + | |
29 | 28 | | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 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 | + | |
40 | 64 | | |
41 | 65 | | |
42 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
16 | | - | |
| 21 | + | |
17 | 22 | | |
18 | | - | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 55 | + | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| |||
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
67 | | - | |
| 66 | + | |
68 | 67 | | |
69 | 68 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 77 | | |
79 | 78 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 79 | + | |
| 80 | + | |
85 | 81 | | |
86 | 82 | | |
87 | 83 | | |
| |||
105 | 101 | | |
106 | 102 | | |
107 | 103 | | |
108 | | - | |
| 104 | + | |
109 | 105 | | |
110 | | - | |
111 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
0 commit comments