Repository navigation
Commit 8a21ef1
authored
Add named Playwright executor support to browsers playwright commands (#281)
## Summary
Adds named Playwright executor support to `kernel browsers playwright`.
- `kernel browsers playwright execute --executor <name>`: runs the call
in a named executor (sent only when set). Help text explains concurrency
across executors, serialization within one, the always-present `default`
executor bound to the active tab, named executors owning a background
tab that `page` is bound to, and the limit of 8 named executors.
- The execute result now shows the `tab` the call was bound to (`Tab
Target ID`, `Tab Created`) in the table output; JSON output passes it
through from the API response.
- A 409 from execute (executor limit reached) is rendered as the API
message followed by the current executors (name, busy marker, tab URL)
and the delete command to run, instead of the generic error formatting.
- New `kernel browsers playwright executors list <id-or-name>`: table of
name, busy, created at, last used at, target ID, URL (default first);
supports `-o json`.
- New `kernel browsers playwright executors delete <id-or-name>
<executor> [--close-tab]`: `--close-tab` defaults to true and is only
sent when set explicitly. Deleting `default` reports a restart rather
than a deletion, matching API semantics.
- The playwright command group is now built by
`newBrowsersPlaywrightCommand()` so it can be exercised in tests the
same way the webmcp group is.
- README command reference and examples updated.
## Dependencies
Bumps `github.com/kernel/kernel-go-sdk` to v0.120.0 (released), which
adds the executors surface: `BrowserPlaywrightExecuteParams.Executor`,
`Tab` on the execute response,
`BrowserPlaywrightExecutorService.List/Delete`, `Executor`, and
`ExecutorList`.
## Tests
`cmd/browsers_playwright_executors_test.go` covers command wiring and
flag defaults, the `executor` request param (absent vs set), tab
rendering in table and JSON output, the 409 limit error, list table/JSON
rendering, delete path and `close_tab` query handling, API error
cleanup, and argument validation, using an `httptest` server like the
webmcp tests.
`go build ./...`, `go vet ./...`, `go test ./...`, and `golangci-lint
run` all pass locally.
---------
Co-authored-by: rgarcia <72655+rgarcia@users.noreply.github.com>1 parent 38a711c commit 8a21ef1
4 files changed
Lines changed: 607 additions & 107 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
| 1012 | + | |
1012 | 1013 | | |
1013 | 1014 | | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
1014 | 1018 | | |
1015 | 1019 | | |
1016 | 1020 | | |
| |||
1524 | 1528 | | |
1525 | 1529 | | |
1526 | 1530 | | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
1527 | 1540 | | |
1528 | 1541 | | |
1529 | 1542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 93 | | |
99 | 94 | | |
100 | 95 | | |
| |||
517 | 512 | | |
518 | 513 | | |
519 | 514 | | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
530 | 526 | | |
531 | 527 | | |
532 | 528 | | |
| |||
1836 | 1832 | | |
1837 | 1833 | | |
1838 | 1834 | | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
1842 | | - | |
1843 | | - | |
1844 | | - | |
1845 | | - | |
1846 | | - | |
1847 | | - | |
1848 | | - | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
1854 | | - | |
1855 | | - | |
1856 | | - | |
1857 | | - | |
1858 | | - | |
1859 | | - | |
1860 | | - | |
1861 | | - | |
1862 | | - | |
1863 | | - | |
1864 | | - | |
1865 | | - | |
1866 | | - | |
1867 | | - | |
1868 | | - | |
1869 | | - | |
1870 | | - | |
1871 | | - | |
1872 | | - | |
1873 | | - | |
1874 | | - | |
1875 | | - | |
1876 | | - | |
1877 | | - | |
1878 | | - | |
1879 | | - | |
1880 | | - | |
1881 | | - | |
1882 | | - | |
1883 | | - | |
1884 | | - | |
1885 | | - | |
1886 | | - | |
1887 | | - | |
1888 | | - | |
1889 | | - | |
1890 | | - | |
1891 | | - | |
1892 | | - | |
1893 | | - | |
1894 | | - | |
1895 | | - | |
1896 | | - | |
1897 | 1835 | | |
1898 | 1836 | | |
1899 | 1837 | | |
| |||
3201 | 3139 | | |
3202 | 3140 | | |
3203 | 3141 | | |
3204 | | - | |
3205 | | - | |
3206 | | - | |
3207 | | - | |
3208 | | - | |
3209 | | - | |
3210 | | - | |
| 3142 | + | |
3211 | 3143 | | |
3212 | 3144 | | |
3213 | 3145 | | |
| |||
3828 | 3760 | | |
3829 | 3761 | | |
3830 | 3762 | | |
3831 | | - | |
3832 | | - | |
3833 | | - | |
3834 | | - | |
3835 | | - | |
3836 | | - | |
3837 | | - | |
3838 | | - | |
3839 | | - | |
3840 | | - | |
3841 | | - | |
3842 | | - | |
3843 | | - | |
3844 | | - | |
3845 | | - | |
3846 | | - | |
3847 | | - | |
3848 | | - | |
3849 | | - | |
3850 | | - | |
3851 | | - | |
3852 | | - | |
3853 | | - | |
3854 | | - | |
3855 | | - | |
3856 | | - | |
3857 | | - | |
3858 | 3763 | | |
3859 | 3764 | | |
3860 | 3765 | | |
| |||
0 commit comments