Skip to content

Commit 32ed4b5

Browse files
committed
feat: add 1280x800 viewport support and update Yutori templates default
- Add 1280x800@60 viewport option to browser create/update commands - Update Yutori computer-use templates (TypeScript & Python) to use 1280x800 as default viewport - Update documentation and help text to reflect new viewport option
1 parent 4960398 commit 32ed4b5

File tree

10 files changed

+15
-15
lines changed

10 files changed

+15
-15
lines changed

cmd/browsers.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ func getAvailableViewports() []string {
126126
"1440x900@25",
127127
"1024x768@60",
128128
"1200x800@60",
129+
"1280x800@60",
129130
}
130131
}
131132

@@ -2069,7 +2070,7 @@ func init() {
20692070
browsersUpdateCmd.Flags().String("profile-id", "", "Profile ID to load into the browser session (mutually exclusive with --profile-name)")
20702071
browsersUpdateCmd.Flags().String("profile-name", "", "Profile name to load into the browser session (mutually exclusive with --profile-id)")
20712072
browsersUpdateCmd.Flags().Bool("save-changes", false, "If set, save changes back to the profile when the session ends")
2072-
browsersUpdateCmd.Flags().String("viewport", "", "Browser viewport size (e.g., 1920x1080@25). Supported: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1024x768@60, 1200x800@60")
2073+
browsersUpdateCmd.Flags().String("viewport", "", "Browser viewport size (e.g., 1920x1080@25). Supported: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1024x768@60, 1200x800@60, 1280x800@60")
20732074

20742075
browsersCmd.AddCommand(browsersListCmd)
20752076
browsersCmd.AddCommand(browsersCreateCmd)
@@ -2304,7 +2305,7 @@ func init() {
23042305
browsersCreateCmd.Flags().Bool("save-changes", false, "If set, save changes back to the profile when the session ends")
23052306
browsersCreateCmd.Flags().String("proxy-id", "", "Proxy ID to use for the browser session")
23062307
browsersCreateCmd.Flags().StringSlice("extension", []string{}, "Extension IDs or names to load (repeatable; may be passed multiple times or comma-separated)")
2307-
browsersCreateCmd.Flags().String("viewport", "", "Browser viewport size (e.g., 1920x1080@25). Supported: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1024x768@60, 1200x800@60")
2308+
browsersCreateCmd.Flags().String("viewport", "", "Browser viewport size (e.g., 1920x1080@25). Supported: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1024x768@60, 1200x800@60, 1280x800@60")
23082309
browsersCreateCmd.Flags().Bool("viewport-interactive", false, "Interactively select viewport size from list")
23092310
browsersCreateCmd.Flags().String("pool-id", "", "Browser pool ID to acquire from (mutually exclusive with --pool-name)")
23102311
browsersCreateCmd.Flags().String("pool-name", "", "Browser pool name to acquire from (mutually exclusive with --pool-id)")

cmd/browsers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ func TestBrowsersDelete_Failure(t *testing.T) {
280280
assert.True(t, strings.Contains(errMsg, "right failed") || strings.Contains(errMsg, "left failed"), "expected error message to contain either 'right failed' or 'left failed', got: %s", errMsg)
281281
}
282282

283-
284283
func TestBrowsersView_ByID_PrintsURL(t *testing.T) {
285284
// Capture both pterm output and raw stdout
286285
setupStdoutCapture(t)
@@ -1153,6 +1152,7 @@ func TestGetAvailableViewports_ReturnsExpectedOptions(t *testing.T) {
11531152
assert.Contains(t, viewports, "1920x1200@25")
11541153
assert.Contains(t, viewports, "1440x900@25")
11551154
assert.Contains(t, viewports, "1200x800@60")
1155+
assert.Contains(t, viewports, "1280x800@60")
11561156
assert.Contains(t, viewports, "1024x768@60")
11571157
}
11581158

pkg/templates/python/yutori-computer-use/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ When enabled, the response will include a `replay_url` field with a link to view
3737

3838
## Viewport Configuration
3939

40-
Yutori n1 recommends a **1280×800 (WXGA, 16:10)** viewport for best grounding accuracy. Kernel's closest supported viewport is **1200×800 at 25Hz**, which this template uses by default.
40+
Yutori n1 recommends a **1280×800 (WXGA, 16:10)** viewport for best grounding accuracy.
4141

42-
> **Note:** n1 outputs coordinates in a 1000×1000 relative space, which are automatically scaled to the actual viewport dimensions. The slight width difference (1200 vs 1280) should have minimal impact on accuracy.
42+
> **Note:** n1 outputs coordinates in a 1000×1000 relative space, which are automatically scaled to the actual viewport dimensions.
4343
4444
See [Kernel Viewport Documentation](https://www.kernel.sh/docs/browsers/viewport) for all supported configurations.
4545

pkg/templates/python/yutori-computer-use/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class KernelBrowserSession:
3232
stealth: bool = True
3333
timeout_seconds: int = 300
3434

35-
viewport_width: int = 1200
35+
viewport_width: int = 1280
3636
viewport_height: int = 800
3737

3838
# Replay recording options

pkg/templates/python/yutori-computer-use/tools/computer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class N1Action(TypedDict, total=False):
9191

9292

9393
class ComputerTool:
94-
def __init__(self, kernel: Kernel, session_id: str, width: int = 1200, height: int = 800):
94+
def __init__(self, kernel: Kernel, session_id: str, width: int = 1280, height: int = 800):
9595
self.kernel = kernel
9696
self.session_id = session_id
9797
self.width = width

pkg/templates/python/yutori-computer-use/tools/playwright_computer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939

4040
class PlaywrightComputerTool:
41-
def __init__(self, cdp_ws_url: str, width: int = 1200, height: int = 800):
41+
def __init__(self, cdp_ws_url: str, width: int = 1280, height: int = 800):
4242
self.cdp_ws_url = cdp_ws_url
4343
self.width = width
4444
self.height = height

pkg/templates/typescript/yutori-computer-use/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ When enabled, the response will include a `replay_url` field with a link to view
3737

3838
## Viewport Configuration
3939

40-
Yutori n1 recommends a **1280×800 (WXGA, 16:10)** viewport for best grounding accuracy. Kernel's closest supported viewport is **1200×800 at 25Hz**, which this template uses by default.
40+
Yutori n1 recommends a **1280×800 (WXGA, 16:10)** viewport for best grounding accuracy.
4141

42-
> **Note:** n1 outputs coordinates in a 1000×1000 relative space, which are automatically scaled to the actual viewport dimensions. The slight width difference (1200 vs 1280) should have minimal impact on accuracy.
42+
> **Note:** n1 outputs coordinates in a 1000×1000 relative space, which are automatically scaled to the actual viewport dimensions.
4343
4444
See [Kernel Viewport Documentation](https://www.kernel.sh/docs/browsers/viewport) for all supported configurations.
4545

pkg/templates/typescript/yutori-computer-use/loop.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ interface SamplingLoopOptions {
5353
cdpWsUrl?: string;
5454
maxTokens?: number;
5555
maxIterations?: number;
56-
/** Viewport width for coordinate scaling (default: 1200, closest to Yutori's 1280 recommendation) */
56+
/** Viewport width for coordinate scaling (default: 1280 per Yutori recommendation) */
5757
viewportWidth?: number;
5858
/** Viewport height for coordinate scaling (default: 800 per Yutori recommendation) */
5959
viewportHeight?: number;
@@ -80,8 +80,7 @@ export async function samplingLoop({
8080
cdpWsUrl,
8181
maxTokens = 4096,
8282
maxIterations = 50,
83-
// Default viewport: 1200x800 (closest Kernel-supported size to Yutori's recommended 1280x800)
84-
viewportWidth = 1200,
83+
viewportWidth = 1280,
8584
viewportHeight = 800,
8685
mode = 'computer_use',
8786
}: SamplingLoopOptions): Promise<SamplingLoopResult> {

pkg/templates/typescript/yutori-computer-use/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface SessionOptions {
1616
recordReplay?: boolean;
1717
/** Grace period in seconds before stopping replay */
1818
replayGracePeriod?: number;
19-
/** Viewport width (default: 1200, closest to Yutori's 1280 recommendation) */
19+
/** Viewport width (default: 1280 per Yutori recommendation) */
2020
viewportWidth?: number;
2121
/** Viewport height (default: 800 per Yutori recommendation) */
2222
viewportHeight?: number;

pkg/templates/typescript/yutori-computer-use/tools/computer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class ComputerTool {
9898
private width: number;
9999
private height: number;
100100

101-
constructor(kernel: Kernel, sessionId: string, width = 1200, height = 800) {
101+
constructor(kernel: Kernel, sessionId: string, width = 1280, height = 800) {
102102
this.kernel = kernel;
103103
this.sessionId = sessionId;
104104
this.width = width;

0 commit comments

Comments
 (0)