@hyperbrowser/sdk 0.77.0 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.BrowserUseService = void 0;
|
|
7
|
-
const
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
8
6
|
const client_1 = require("../../client");
|
|
9
7
|
const constants_1 = require("../../types/constants");
|
|
10
8
|
const utils_1 = require("../../utils");
|
|
@@ -18,7 +16,12 @@ class BrowserUseService extends base_1.BaseService {
|
|
|
18
16
|
try {
|
|
19
17
|
if (params.outputModelSchema) {
|
|
20
18
|
if ((0, utils_1.isZodSchema)(params.outputModelSchema)) {
|
|
21
|
-
|
|
19
|
+
try {
|
|
20
|
+
params.outputModelSchema = (0, zod_1.toJSONSchema)(params.outputModelSchema);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
params.outputModelSchema = (0, zod_to_json_schema_1.zodToJsonSchema)(params.outputModelSchema);
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
return await this.request("/task/browser-use", {
|
package/dist/services/extract.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExtractService = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
4
5
|
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
5
6
|
const base_1 = require("./base");
|
|
6
7
|
const utils_1 = require("../utils");
|
|
@@ -18,7 +19,12 @@ class ExtractService extends base_1.BaseService {
|
|
|
18
19
|
}
|
|
19
20
|
if (params.schema) {
|
|
20
21
|
if ((0, utils_1.isZodSchema)(params.schema)) {
|
|
21
|
-
|
|
22
|
+
try {
|
|
23
|
+
params.schema = (0, zod_1.toJSONSchema)(params.schema);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
params.schema = (0, zod_to_json_schema_1.zodToJsonSchema)(params.schema);
|
|
27
|
+
}
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
return await this.request("/extract", {
|
|
@@ -70,5 +70,11 @@ export declare class SessionsService extends BaseService {
|
|
|
70
70
|
* Get the number of active sessions
|
|
71
71
|
*/
|
|
72
72
|
getActiveSessionsCount(): Promise<GetActiveSessionsCountResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Extend the duration of a session
|
|
75
|
+
* @param id The ID of the session to extend
|
|
76
|
+
* @param durationMinutes The duration in minutes to extend the session by
|
|
77
|
+
*/
|
|
78
|
+
extendSession(id: string, durationMinutes: number): Promise<BasicResponse>;
|
|
73
79
|
}
|
|
74
80
|
export {};
|
|
@@ -298,5 +298,24 @@ class SessionsService extends base_1.BaseService {
|
|
|
298
298
|
throw new client_1.HyperbrowserError("Failed to get active sessions count", undefined);
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* Extend the duration of a session
|
|
303
|
+
* @param id The ID of the session to extend
|
|
304
|
+
* @param durationMinutes The duration in minutes to extend the session by
|
|
305
|
+
*/
|
|
306
|
+
async extendSession(id, durationMinutes) {
|
|
307
|
+
try {
|
|
308
|
+
return await this.request(`/session/${id}/extend-session`, {
|
|
309
|
+
method: "PUT",
|
|
310
|
+
body: JSON.stringify({ durationMinutes }),
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
catch (error) {
|
|
314
|
+
if (error instanceof client_1.HyperbrowserError) {
|
|
315
|
+
throw error;
|
|
316
|
+
}
|
|
317
|
+
throw new client_1.HyperbrowserError(`Failed to extend session ${id}`, undefined);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
301
320
|
}
|
|
302
321
|
exports.SessionsService = SessionsService;
|
|
@@ -17,8 +17,8 @@ export type DownloadsStatus = "not_enabled" | "pending" | "in_progress" | "compl
|
|
|
17
17
|
export declare const POLLING_ATTEMPTS = 5;
|
|
18
18
|
export type BrowserUseVersion = "0.1.40" | "0.7.10" | "latest";
|
|
19
19
|
export type BrowserUseLlm = "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-5" | "gpt-5-mini" | "claude-sonnet-4-5" | "claude-sonnet-4-20250514" | "claude-3-7-sonnet-20250219" | "claude-3-5-sonnet-20241022" | "claude-3-5-haiku-20241022" | "gemini-2.0-flash" | "gemini-2.5-flash";
|
|
20
|
-
export type ClaudeComputerUseLlm = "claude-haiku-4-5-20251001" | "claude-sonnet-4-5" | "claude-sonnet-4-20250514" | "claude-3-7-sonnet-20250219";
|
|
21
|
-
export type HyperAgentLlm = "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano";
|
|
20
|
+
export type ClaudeComputerUseLlm = "claude-opus-4-5" | "claude-haiku-4-5-20251001" | "claude-sonnet-4-5" | "claude-sonnet-4-20250514" | "claude-3-7-sonnet-20250219";
|
|
21
|
+
export type HyperAgentLlm = "gpt-5.1" | "gpt-5" | "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano";
|
|
22
22
|
export type GeminiComputerUseLlm = "gemini-2.5-computer-use-preview-10-2025";
|
|
23
23
|
export type SessionRegion = "us-central" | "asia-south" | "us-dev" | "europe-west" | "us-west" | "us-east";
|
|
24
24
|
export type Country = "AD" | "AE" | "AF" | "AL" | "AM" | "AO" | "AR" | "AT" | "AU" | "AW" | "AZ" | "BA" | "BD" | "BE" | "BG" | "BH" | "BJ" | "BO" | "BR" | "BS" | "BT" | "BY" | "BZ" | "CA" | "CF" | "CH" | "CI" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "EC" | "EE" | "EG" | "ES" | "ET" | "EU" | "FI" | "FJ" | "FR" | "GB" | "GE" | "GH" | "GM" | "GR" | "HK" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IN" | "IQ" | "IR" | "IS" | "IT" | "JM" | "JO" | "JP" | "KE" | "KH" | "KR" | "KW" | "KZ" | "LB" | "LI" | "LR" | "LT" | "LU" | "LV" | "MA" | "MC" | "MD" | "ME" | "MG" | "MK" | "ML" | "MM" | "MN" | "MR" | "MT" | "MU" | "MV" | "MX" | "MY" | "MZ" | "NG" | "NL" | "NO" | "NZ" | "OM" | "PA" | "PE" | "PH" | "PK" | "PL" | "PR" | "PT" | "PY" | "QA" | "RANDOM_COUNTRY" | "RO" | "RS" | "RU" | "SA" | "SC" | "SD" | "SE" | "SG" | "SI" | "SK" | "SN" | "SS" | "TD" | "TG" | "TH" | "TM" | "TN" | "TR" | "TT" | "TW" | "UA" | "UG" | "US" | "UY" | "UZ" | "VE" | "VG" | "VN" | "YE" | "ZA" | "ZM" | "ZW" | "ad" | "ae" | "af" | "al" | "am" | "ao" | "ar" | "at" | "au" | "aw" | "az" | "ba" | "bd" | "be" | "bg" | "bh" | "bj" | "bo" | "br" | "bs" | "bt" | "by" | "bz" | "ca" | "cf" | "ch" | "ci" | "cl" | "cm" | "cn" | "co" | "cr" | "cu" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "ec" | "ee" | "eg" | "es" | "et" | "eu" | "fi" | "fj" | "fr" | "gb" | "ge" | "gh" | "gm" | "gr" | "hk" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "in" | "iq" | "ir" | "is" | "it" | "jm" | "jo" | "jp" | "ke" | "kh" | "kr" | "kw" | "kz" | "lb" | "li" | "lr" | "lt" | "lu" | "lv" | "ma" | "mc" | "md" | "me" | "mg" | "mk" | "ml" | "mm" | "mn" | "mr" | "mt" | "mu" | "mv" | "mx" | "my" | "mz" | "ng" | "nl" | "no" | "nz" | "om" | "pa" | "pe" | "ph" | "pk" | "pl" | "pr" | "pt" | "py" | "qa" | "ro" | "rs" | "ru" | "sa" | "sc" | "sd" | "se" | "sg" | "si" | "sk" | "sn" | "ss" | "td" | "tg" | "th" | "tm" | "tn" | "tr" | "tt" | "tw" | "ua" | "ug" | "us" | "uy" | "uz" | "ve" | "vg" | "vn" | "ye" | "za" | "zm" | "zw";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperbrowser/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"description": "Node SDK for Hyperbrowser API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"form-data": "^4.0.1",
|
|
34
34
|
"node-fetch": "2.7.0",
|
|
35
|
-
"zod": "^
|
|
36
|
-
"zod-to-json-schema": "^3.
|
|
35
|
+
"zod": "^4.1.12",
|
|
36
|
+
"zod-to-json-schema": "^3.25.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.9.1",
|
|
@@ -70,4 +70,4 @@
|
|
|
70
70
|
]
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
}
|
|
73
|
+
}
|