Commit 755c2b9
authored
Some updates to
## Overview
Allows hot loading a profile and view port into an existing browser
cc @dprevoznik
## Testing
Built + ran against local/staging
profile:
```bash
~/kernel/cli ❯❯❯ ./bin/kernel browser create
(grab SESSION_ID)
~/kernel/cli ❯❯❯ ./bin/kernel browser update --profile-name $PROFILE $SESSION_ID
INFO Updating browser ....
SUCCESS Updated browser
```
view port:
```
~/kernel/cli ❯❯❯ ./bin/kernel browser update --viewport 1440x900 $SESSION_ID
INFO Updating browser ...
ERROR Viewport_configuration_failed: resize refused: live view or recording/replay active
~/kernel/cli ❯❯❯ ./bin/kernel browser update --viewport 1234x900 $SESSION_ID
INFO Updating browser ...
ERROR Invalid_viewport: No matching viewport configuration found for dimensions 1234x900. Allowed: 1024x768@60,
1920x1080@25, 2560x1440@10, 1920x1200@25, 1440x900@25, 1200x800@60
~/kernel/cli ❯❯❯ ./bin/kernel browser update --viewport 1440x900 $SESSION_ID
INFO Updating browser ...
SUCCESS Updated browser
```
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds hot profile and viewport management to `browsers update`, plus
improved UX and validation.
>
> - Support loading a profile (`--profile-id` or `--profile-name`) with
optional `--save-changes`; build `Profile` param accordingly
> - Support changing viewport via `--viewport` (e.g., `1920x1080@25`),
parsing width/height/refresh and setting `Viewport` param
> - New validations: profile flags mutually exclusive; `--save-changes`
requires a profile; forbid `--proxy-id` with `--clear-proxy`; require at
least one update flag
> - CLI output streamlined to a single "Updating.../Updated" message;
command help expanded to list supported operations
> - Wire new flags into `runBrowsersUpdate`; add helper `parseViewport`
and list of supported sizes
> - Script `scripts/go-mod-replace-kernel.sh`: switch replace target to
`github.com/kernel/kernel-go-sdk` pointing to
`github.com/stainless-sdks/kernel-go`
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f9eb2bc. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->browser update (#91)1 parent 3067d18 commit 755c2b9
2 files changed
Lines changed: 83 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
| |||
532 | 536 | | |
533 | 537 | | |
534 | 538 | | |
535 | | - | |
536 | | - | |
537 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
538 | 542 | | |
539 | 543 | | |
540 | 544 | | |
541 | 545 | | |
542 | 546 | | |
543 | 547 | | |
544 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
545 | 563 | | |
| 564 | + | |
| 565 | + | |
546 | 566 | | |
547 | | - | |
548 | 567 | | |
549 | 568 | | |
550 | 569 | | |
551 | 570 | | |
552 | 571 | | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
558 | 597 | | |
559 | 598 | | |
560 | 599 | | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
561 | 604 | | |
562 | 605 | | |
563 | 606 | | |
| |||
567 | 610 | | |
568 | 611 | | |
569 | 612 | | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
| 613 | + | |
575 | 614 | | |
576 | 615 | | |
577 | 616 | | |
| |||
1990 | 2029 | | |
1991 | 2030 | | |
1992 | 2031 | | |
1993 | | - | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
1994 | 2040 | | |
1995 | 2041 | | |
1996 | 2042 | | |
| |||
2020 | 2066 | | |
2021 | 2067 | | |
2022 | 2068 | | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
2023 | 2073 | | |
2024 | 2074 | | |
2025 | 2075 | | |
| |||
2457 | 2507 | | |
2458 | 2508 | | |
2459 | 2509 | | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
2460 | 2514 | | |
2461 | 2515 | | |
2462 | 2516 | | |
2463 | 2517 | | |
2464 | | - | |
2465 | | - | |
2466 | | - | |
2467 | | - | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
2468 | 2526 | | |
2469 | 2527 | | |
2470 | 2528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
0 commit comments