Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cmd/browsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func getAvailableViewports() []string {
"1440x900@25",
"1024x768@60",
"1200x800@60",
"1280x800@60",
}
}

Expand Down Expand Up @@ -2069,7 +2070,7 @@ func init() {
browsersUpdateCmd.Flags().String("profile-id", "", "Profile ID to load into the browser session (mutually exclusive with --profile-name)")
browsersUpdateCmd.Flags().String("profile-name", "", "Profile name to load into the browser session (mutually exclusive with --profile-id)")
browsersUpdateCmd.Flags().Bool("save-changes", false, "If set, save changes back to the profile when the session ends")
browsersUpdateCmd.Flags().String("viewport", "", "Browser viewport size (e.g., 1920x1080@25). Supported: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1024x768@60, 1200x800@60")
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")

browsersCmd.AddCommand(browsersListCmd)
browsersCmd.AddCommand(browsersCreateCmd)
Expand Down Expand Up @@ -2304,7 +2305,7 @@ func init() {
browsersCreateCmd.Flags().Bool("save-changes", false, "If set, save changes back to the profile when the session ends")
browsersCreateCmd.Flags().String("proxy-id", "", "Proxy ID to use for the browser session")
browsersCreateCmd.Flags().StringSlice("extension", []string{}, "Extension IDs or names to load (repeatable; may be passed multiple times or comma-separated)")
browsersCreateCmd.Flags().String("viewport", "", "Browser viewport size (e.g., 1920x1080@25). Supported: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1024x768@60, 1200x800@60")
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")
browsersCreateCmd.Flags().Bool("viewport-interactive", false, "Interactively select viewport size from list")
browsersCreateCmd.Flags().String("pool-id", "", "Browser pool ID to acquire from (mutually exclusive with --pool-name)")
browsersCreateCmd.Flags().String("pool-name", "", "Browser pool name to acquire from (mutually exclusive with --pool-id)")
Expand Down
4 changes: 2 additions & 2 deletions cmd/browsers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ func TestBrowsersDelete_Failure(t *testing.T) {
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)
}


func TestBrowsersView_ByID_PrintsURL(t *testing.T) {
// Capture both pterm output and raw stdout
setupStdoutCapture(t)
Expand Down Expand Up @@ -1147,12 +1146,13 @@ func TestParseViewport_InvalidFormats(t *testing.T) {

func TestGetAvailableViewports_ReturnsExpectedOptions(t *testing.T) {
viewports := getAvailableViewports()
assert.Len(t, viewports, 6)
assert.Len(t, viewports, 7)
assert.Contains(t, viewports, "2560x1440@10")
assert.Contains(t, viewports, "1920x1080@25")
assert.Contains(t, viewports, "1920x1200@25")
assert.Contains(t, viewports, "1440x900@25")
assert.Contains(t, viewports, "1200x800@60")
assert.Contains(t, viewports, "1280x800@60")
assert.Contains(t, viewports, "1024x768@60")
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/templates/python/yutori-computer-use/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ When enabled, the response will include a `replay_url` field with a link to view

## Viewport Configuration

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.
Yutori n1 recommends a **1280×800 (WXGA, 16:10)** viewport for best grounding accuracy.

> **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.
> **Note:** n1 outputs coordinates in a 1000×1000 relative space, which are automatically scaled to the actual viewport dimensions.

See [Kernel Viewport Documentation](https://www.kernel.sh/docs/browsers/viewport) for all supported configurations.

Expand Down
2 changes: 1 addition & 1 deletion pkg/templates/python/yutori-computer-use/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def sampling_loop(
cdp_ws_url: Optional[str] = None,
max_tokens: int = 4096,
max_iterations: int = 50,
viewport_width: int = 1200,
viewport_width: int = 1280,
viewport_height: int = 800,
mode: BrowserMode = "computer_use",
) -> dict[str, Any]:
Expand Down
2 changes: 1 addition & 1 deletion pkg/templates/python/yutori-computer-use/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class KernelBrowserSession:
stealth: bool = True
timeout_seconds: int = 300

viewport_width: int = 1200
viewport_width: int = 1280
viewport_height: int = 800

# Replay recording options
Expand Down
2 changes: 1 addition & 1 deletion pkg/templates/python/yutori-computer-use/tools/computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class N1Action(TypedDict, total=False):


class ComputerTool:
def __init__(self, kernel: Kernel, session_id: str, width: int = 1200, height: int = 800):
def __init__(self, kernel: Kernel, session_id: str, width: int = 1280, height: int = 800):
self.kernel = kernel
self.session_id = session_id
self.width = width
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


class PlaywrightComputerTool:
def __init__(self, cdp_ws_url: str, width: int = 1200, height: int = 800):
def __init__(self, cdp_ws_url: str, width: int = 1280, height: int = 800):
self.cdp_ws_url = cdp_ws_url
self.width = width
self.height = height
Expand Down
4 changes: 2 additions & 2 deletions pkg/templates/typescript/yutori-computer-use/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ When enabled, the response will include a `replay_url` field with a link to view

## Viewport Configuration

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.
Yutori n1 recommends a **1280×800 (WXGA, 16:10)** viewport for best grounding accuracy.

> **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.
> **Note:** n1 outputs coordinates in a 1000×1000 relative space, which are automatically scaled to the actual viewport dimensions.

See [Kernel Viewport Documentation](https://www.kernel.sh/docs/browsers/viewport) for all supported configurations.

Expand Down
5 changes: 2 additions & 3 deletions pkg/templates/typescript/yutori-computer-use/loop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ interface SamplingLoopOptions {
cdpWsUrl?: string;
maxTokens?: number;
maxIterations?: number;
/** Viewport width for coordinate scaling (default: 1200, closest to Yutori's 1280 recommendation) */
/** Viewport width for coordinate scaling (default: 1280 per Yutori recommendation) */
viewportWidth?: number;
/** Viewport height for coordinate scaling (default: 800 per Yutori recommendation) */
viewportHeight?: number;
Expand All @@ -80,8 +80,7 @@ export async function samplingLoop({
cdpWsUrl,
maxTokens = 4096,
maxIterations = 50,
// Default viewport: 1200x800 (closest Kernel-supported size to Yutori's recommended 1280x800)
viewportWidth = 1200,
viewportWidth = 1280,
viewportHeight = 800,
mode = 'computer_use',
}: SamplingLoopOptions): Promise<SamplingLoopResult> {
Expand Down
4 changes: 2 additions & 2 deletions pkg/templates/typescript/yutori-computer-use/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface SessionOptions {
recordReplay?: boolean;
/** Grace period in seconds before stopping replay */
replayGracePeriod?: number;
/** Viewport width (default: 1200, closest to Yutori's 1280 recommendation) */
/** Viewport width (default: 1280 per Yutori recommendation) */
viewportWidth?: number;
/** Viewport height (default: 800 per Yutori recommendation) */
viewportHeight?: number;
Expand All @@ -37,7 +37,7 @@ const DEFAULT_OPTIONS: Required<SessionOptions> = {
timeoutSeconds: 300,
recordReplay: false,
replayGracePeriod: 5.0,
viewportWidth: 1200,
viewportWidth: 1280,
viewportHeight: 800,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class ComputerTool {
private width: number;
private height: number;

constructor(kernel: Kernel, sessionId: string, width = 1200, height = 800) {
constructor(kernel: Kernel, sessionId: string, width = 1280, height = 800) {
this.kernel = kernel;
this.sessionId = sessionId;
this.width = width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class PlaywrightComputerTool {
private context: BrowserContext | null = null;
private page: Page | null = null;

constructor(cdpWsUrl: string, width = 1200, height = 800) {
constructor(cdpWsUrl: string, width = 1280, height = 800) {
this.cdpWsUrl = cdpWsUrl;
this.width = width;
this.height = height;
Expand Down