Skip to content

Commit 55a539c

Browse files
authored
Add Muse Wonder support to Meta Computer Use models (#130)
1 parent eec9a15 commit 55a539c

3 files changed

Lines changed: 82 additions & 72 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyperbrowser/sdk",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Node SDK for Hyperbrowser API",
55
"author": "",
66
"repository": {

‎src/types/constants.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ export type GrokComputerUseLlm = "grok-4.7" | "grok-4.6" | "grok-4.5";
124124

125125
export type GrokReasoningEffort = "low" | "medium" | "high";
126126

127-
export type MetaComputerUseLlm = "muse-spark-1.1" | "muse-spark-1.2" | "muse-spark-1.3";
127+
export type MetaComputerUseLlm =
128+
| "muse-spark-1.1"
129+
| "muse-spark-1.2"
130+
| "muse-spark-1.3"
131+
| "muse-wonder-1.0";
128132

129133
export type MetaReasoningEffort = "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
130134

‎tests/integration/client-http.test.ts‎

Lines changed: 76 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import http, { IncomingMessage, ServerResponse } from "node:http";
22
import { afterEach, describe, expect, test } from "vitest";
33
import { HyperbrowserClient } from "../../src/client";
4+
import type { MetaComputerUseLlm } from "../../src/types";
45

56
type RecordedRequest = {
67
method?: string;
@@ -38,7 +39,9 @@ const sendJson = (response: ServerResponse, statusCode: number, payload: unknown
3839
response.end(encoded);
3940
};
4041

41-
const startServer = async (): Promise<TestServer> => {
42+
const startServer = async (
43+
metaModel: MetaComputerUseLlm = "muse-spark-1.3"
44+
): Promise<TestServer> => {
4245
const requests: RecordedRequest[] = [];
4346
const server = http.createServer(async (request, response) => {
4447
const body = await readJsonBody(request);
@@ -90,7 +93,7 @@ const startServer = async (): Promise<TestServer> => {
9093
output_text: "Second sentence in the Ecology section.",
9194
error: null,
9295
incomplete_details: null,
93-
model: "muse-spark-1.3",
96+
model: metaModel,
9497
output: [
9598
{
9699
type: "function_call",
@@ -389,76 +392,79 @@ describe("client HTTP integration", () => {
389392
]);
390393
});
391394

392-
test("Meta Computer Use starts, polls, reads, and stops a task", async () => {
393-
const server = await startServer();
394-
servers.push(server);
395-
const client = new HyperbrowserClient({
396-
apiKey: "test-api-key",
397-
baseUrl: server.baseUrl,
398-
});
399-
400-
const started = await client.agents.metaComputerUse.start({
401-
task: "Complete the task",
402-
llm: "muse-spark-1.3",
403-
reasoningEffort: "max",
404-
useCustomApiKeys: true,
405-
apiKeys: { meta: "meta-key" },
406-
});
407-
const status = await client.agents.metaComputerUse.getStatus(started.jobId);
408-
const result = await client.agents.metaComputerUse.get(started.jobId);
409-
const stopped = await client.agents.metaComputerUse.stop(started.jobId);
410-
411-
expect(started).toEqual({ jobId: "meta_job_123", liveUrl: null });
412-
expect(status).toEqual({ status: "completed" });
413-
expect(result.data?.finalResult).toBe("done");
414-
expect(result.data?.steps[0]).toMatchObject({
415-
created_at: 1788743504,
416-
completed_at: 1788743511,
417-
model: "muse-spark-1.3",
418-
reasoning: { effort: "medium", summary: "concise" },
419-
});
420-
expect(result.data?.steps[0].output?.[0]).toMatchObject({
421-
type: "function_call",
422-
name: "computer.computer",
423-
});
424-
expect(stopped).toEqual({ success: true });
425-
expect(server.requests).toEqual([
426-
{
427-
method: "POST",
428-
url: "/api/task/meta-computer-use",
395+
test.each(["muse-spark-1.3", "muse-wonder-1.0"] as const)(
396+
"Meta Computer Use starts, polls, reads, and stops a %s task",
397+
async (llm) => {
398+
const server = await startServer(llm);
399+
servers.push(server);
400+
const client = new HyperbrowserClient({
429401
apiKey: "test-api-key",
430-
contentType: "application/json",
431-
body: {
432-
task: "Complete the task",
433-
llm: "muse-spark-1.3",
434-
reasoningEffort: "max",
435-
useCustomApiKeys: true,
436-
apiKeys: { meta: "meta-key" },
402+
baseUrl: server.baseUrl,
403+
});
404+
405+
const started = await client.agents.metaComputerUse.start({
406+
task: "Complete the task",
407+
llm,
408+
reasoningEffort: "max",
409+
useCustomApiKeys: true,
410+
apiKeys: { meta: "meta-key" },
411+
});
412+
const status = await client.agents.metaComputerUse.getStatus(started.jobId);
413+
const result = await client.agents.metaComputerUse.get(started.jobId);
414+
const stopped = await client.agents.metaComputerUse.stop(started.jobId);
415+
416+
expect(started).toEqual({ jobId: "meta_job_123", liveUrl: null });
417+
expect(status).toEqual({ status: "completed" });
418+
expect(result.data?.finalResult).toBe("done");
419+
expect(result.data?.steps[0]).toMatchObject({
420+
created_at: 1788743504,
421+
completed_at: 1788743511,
422+
model: llm,
423+
reasoning: { effort: "medium", summary: "concise" },
424+
});
425+
expect(result.data?.steps[0].output?.[0]).toMatchObject({
426+
type: "function_call",
427+
name: "computer.computer",
428+
});
429+
expect(stopped).toEqual({ success: true });
430+
expect(server.requests).toEqual([
431+
{
432+
method: "POST",
433+
url: "/api/task/meta-computer-use",
434+
apiKey: "test-api-key",
435+
contentType: "application/json",
436+
body: {
437+
task: "Complete the task",
438+
llm,
439+
reasoningEffort: "max",
440+
useCustomApiKeys: true,
441+
apiKeys: { meta: "meta-key" },
442+
},
437443
},
438-
},
439-
{
440-
method: "GET",
441-
url: "/api/task/meta-computer-use/meta_job_123/status",
442-
apiKey: "test-api-key",
443-
contentType: "application/json",
444-
body: undefined,
445-
},
446-
{
447-
method: "GET",
448-
url: "/api/task/meta-computer-use/meta_job_123",
449-
apiKey: "test-api-key",
450-
contentType: "application/json",
451-
body: undefined,
452-
},
453-
{
454-
method: "PUT",
455-
url: "/api/task/meta-computer-use/meta_job_123/stop",
456-
apiKey: "test-api-key",
457-
contentType: "application/json",
458-
body: undefined,
459-
},
460-
]);
461-
});
444+
{
445+
method: "GET",
446+
url: "/api/task/meta-computer-use/meta_job_123/status",
447+
apiKey: "test-api-key",
448+
contentType: "application/json",
449+
body: undefined,
450+
},
451+
{
452+
method: "GET",
453+
url: "/api/task/meta-computer-use/meta_job_123",
454+
apiKey: "test-api-key",
455+
contentType: "application/json",
456+
body: undefined,
457+
},
458+
{
459+
method: "PUT",
460+
url: "/api/task/meta-computer-use/meta_job_123/stop",
461+
apiKey: "test-api-key",
462+
contentType: "application/json",
463+
body: undefined,
464+
},
465+
]);
466+
}
467+
);
462468

463469
test("Jev Computer Use starts, polls, reads, and stops a task", async () => {
464470
const server = await startServer();

0 commit comments

Comments
 (0)