Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperbrowser/sdk",
"version": "0.92.5",
"version": "0.92.6",
"description": "Node SDK for Hyperbrowser API",
"author": "",
"repository": {
Expand Down
7 changes: 6 additions & 1 deletion src/types/agents/claude-computer-use.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { ClaudeComputerUseLlm, ClaudeComputerUseTaskStatus } from "../constants";
import {
ClaudeComputerUseLlm,
ClaudeComputerUseReasoningEffort,
ClaudeComputerUseTaskStatus,
} from "../constants";
import { CreateSessionParams } from "../session";

export interface ClaudeComputerUseApiKeys {
Expand All @@ -8,6 +12,7 @@ export interface ClaudeComputerUseApiKeys {
export interface StartClaudeComputerUseTaskParams {
task: string;
llm?: ClaudeComputerUseLlm;
reasoningEffort?: ClaudeComputerUseReasoningEffort;
sessionId?: string;
maxFailures?: number;
maxSteps?: number;
Expand Down
3 changes: 2 additions & 1 deletion src/types/agents/cua.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CuaLlm, CuaTaskStatus } from "../constants";
import { CuaLlm, CuaReasoningEffort, CuaTaskStatus } from "../constants";
import { CreateSessionParams } from "../session";

export interface CuaApiKeys {
Expand All @@ -12,6 +12,7 @@ export interface CuaBaseUrls {
export interface StartCuaTaskParams {
task: string;
llm?: CuaLlm;
reasoningEffort?: CuaReasoningEffort;
sessionId?: string;
maxFailures?: number;
maxSteps?: number;
Expand Down
4 changes: 4 additions & 0 deletions src/types/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export type ClaudeComputerUseLlm =
| "claude-sonnet-4-20250514"
| "claude-3-7-sonnet-20250219";

export type ClaudeComputerUseReasoningEffort = "low" | "medium" | "high" | "xhigh" | "max";

export type CuaLlm =
| "computer-use-preview"
| "gpt-6-astra"
Expand All @@ -76,6 +78,8 @@ export type CuaLlm =
| "gpt-5.4"
| "gpt-5.4-mini";

export type CuaReasoningEffort = "none" | "low" | "medium" | "high" | "xhigh" | "max";

export type HyperAgentVersion = "0.8.0" | "1.1.0";

export type HyperAgentLlm =
Expand Down
2 changes: 2 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ export {
BrowserUseTaskStatus,
BrowserUseLlm,
ClaudeComputerUseLlm,
ClaudeComputerUseReasoningEffort,
CuaLlm,
CuaReasoningEffort,
GeminiComputerUseLlm,
GrokComputerUseLlm,
GrokReasoningEffort,
Expand Down
37 changes: 37 additions & 0 deletions tests/integration/client-http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ const startServer = async (): Promise<TestServer> => {
return;
}

if (request.method === "POST" && request.url === "/api/task/claude-computer-use") {
sendJson(response, 200, { jobId: "claude_job_123", liveUrl: null });
return;
}

if (request.method === "POST" && request.url === "/api/task/meta-computer-use") {
sendJson(response, 200, { jobId: "meta_job_123", liveUrl: null });
return;
Expand Down Expand Up @@ -281,6 +286,7 @@ describe("client HTTP integration", () => {
const started = await client.agents.cua.start({
task: "Complete the task",
llm: "gpt-5.4-mini",
reasoningEffort: "high",
useCustomApiKeys: true,
apiKeys: { openai: "openai-key" },
baseUrls: { openai: "https://example.openai.azure.com/openai/v1/" },
Expand All @@ -296,6 +302,7 @@ describe("client HTTP integration", () => {
body: {
task: "Complete the task",
llm: "gpt-5.4-mini",
reasoningEffort: "high",
useCustomApiKeys: true,
apiKeys: { openai: "openai-key" },
baseUrls: { openai: "https://example.openai.azure.com/openai/v1/" },
Expand All @@ -304,6 +311,36 @@ describe("client HTTP integration", () => {
]);
});

test("Claude Computer Use forwards reasoning effort on start", async () => {
const server = await startServer();
servers.push(server);
const client = new HyperbrowserClient({
apiKey: "test-api-key",
baseUrl: server.baseUrl,
});

const started = await client.agents.claudeComputerUse.start({
task: "Complete the task",
llm: "claude-opus-5",
reasoningEffort: "xhigh",
});

expect(started).toEqual({ jobId: "claude_job_123", liveUrl: null });
expect(server.requests).toEqual([
{
method: "POST",
url: "/api/task/claude-computer-use",
apiKey: "test-api-key",
contentType: "application/json",
body: {
task: "Complete the task",
llm: "claude-opus-5",
reasoningEffort: "xhigh",
},
},
]);
});

test("Meta Computer Use starts, polls, reads, and stops a task", async () => {
const server = await startServer();
servers.push(server);
Expand Down