Commit 7a4e155
authored
Refactor API: Move automate to agent client and remove extract.schema (#5)
## Summary
- Moves automate functionality behind a new `agent` client
(`tabs.agent.automate()`)
- Removes `extract.schema()` method entirely
- Updates all documentation, examples, and tests to reflect the new API
## Changes
- **New Agent Client**: Created `Agent` class to handle automation
- **API Simplification**: Removed `extract.schema()` method and
`ExtractSchemaOptions` type
- **Updated Documentation**: README and examples now reflect the new API
- **Test Coverage**: All 233 tests pass
## Migration Guide
### Before
```typescript
for await (const event of tabs.automate.execute(task, options)) {
...
}
const schema = await tabs.extract.schema(url, { instructions: "..." });
```
### After
```typescript
for await (const event of tabs.agent.automate(task, options)) {
...
}
// extract.schema() removed - use predefined schemas instead
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent a466e4e commit 7a4e155
File tree
23 files changed
+268
-506
lines changed- src
- util
- test
- e2e
- types
23 files changed
+268
-506
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
179 | 190 | | |
180 | 191 | | |
181 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
7 | | - | |
| 10 | + | |
8 | 11 | | |
9 | | - | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | | - | |
| 78 | + | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| |||
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
111 | | - | |
| 114 | + | |
112 | 115 | | |
113 | | - | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | 174 | | |
186 | 175 | | |
187 | 176 | | |
| |||
220 | 209 | | |
221 | 210 | | |
222 | 211 | | |
223 | | - | |
| 212 | + | |
224 | 213 | | |
225 | 214 | | |
226 | 215 | | |
| |||
240 | 229 | | |
241 | 230 | | |
242 | 231 | | |
243 | | - | |
244 | | - | |
245 | | - | |
| 232 | + | |
246 | 233 | | |
247 | 234 | | |
248 | 235 | | |
| |||
280 | 267 | | |
281 | 268 | | |
282 | 269 | | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | 270 | | |
298 | 271 | | |
299 | 272 | | |
300 | 273 | | |
301 | 274 | | |
302 | 275 | | |
303 | | - | |
| 276 | + | |
304 | 277 | | |
305 | 278 | | |
306 | 279 | | |
| |||
314 | 287 | | |
315 | 288 | | |
316 | 289 | | |
317 | | - | |
| 290 | + | |
318 | 291 | | |
319 | 292 | | |
320 | 293 | | |
321 | 294 | | |
322 | 295 | | |
323 | 296 | | |
324 | 297 | | |
325 | | - | |
| 298 | + | |
326 | 299 | | |
327 | 300 | | |
328 | 301 | | |
| |||
333 | 306 | | |
334 | 307 | | |
335 | 308 | | |
336 | | - | |
| 309 | + | |
337 | 310 | | |
338 | 311 | | |
339 | 312 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments