@hyperbrowser/sdk 0.50.0 → 0.52.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.
- package/dist/client.d.ts +2 -0
- package/dist/client.js +2 -0
- package/dist/services/sessions.d.ts +5 -1
- package/dist/services/sessions.js +14 -0
- package/dist/services/team.d.ts +8 -0
- package/dist/services/team.js +22 -0
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/session.d.ts +3 -0
- package/dist/types/team.d.ts +5 -0
- package/dist/types/team.js +2 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { BrowserUseService } from "./services/agents/browser-use";
|
|
|
9
9
|
import { CuaService } from "./services/agents/cua";
|
|
10
10
|
import { ClaudeComputerUseService } from "./services/agents/claude-computer-use";
|
|
11
11
|
import { HyperAgentService } from "./services/agents/hyper-agent";
|
|
12
|
+
import { TeamService } from "./services/team";
|
|
12
13
|
export declare class HyperbrowserError extends Error {
|
|
13
14
|
statusCode?: number | undefined;
|
|
14
15
|
constructor(message: string, statusCode?: number | undefined);
|
|
@@ -26,5 +27,6 @@ export declare class HyperbrowserClient {
|
|
|
26
27
|
cua: CuaService;
|
|
27
28
|
hyperAgent: HyperAgentService;
|
|
28
29
|
};
|
|
30
|
+
readonly team: TeamService;
|
|
29
31
|
constructor(config?: HyperbrowserConfig);
|
|
30
32
|
}
|
package/dist/client.js
CHANGED
|
@@ -11,6 +11,7 @@ const browser_use_1 = require("./services/agents/browser-use");
|
|
|
11
11
|
const cua_1 = require("./services/agents/cua");
|
|
12
12
|
const claude_computer_use_1 = require("./services/agents/claude-computer-use");
|
|
13
13
|
const hyper_agent_1 = require("./services/agents/hyper-agent");
|
|
14
|
+
const team_1 = require("./services/team");
|
|
14
15
|
class HyperbrowserError extends Error {
|
|
15
16
|
constructor(message, statusCode) {
|
|
16
17
|
super(`[Hyperbrowser]: ${message}`);
|
|
@@ -33,6 +34,7 @@ class HyperbrowserClient {
|
|
|
33
34
|
this.extract = new extract_1.ExtractService(apiKey, baseUrl, timeout);
|
|
34
35
|
this.profiles = new profiles_1.ProfilesService(apiKey, baseUrl, timeout);
|
|
35
36
|
this.extensions = new extensions_1.ExtensionService(apiKey, baseUrl, timeout);
|
|
37
|
+
this.team = new team_1.TeamService(apiKey, baseUrl, timeout);
|
|
36
38
|
this.agents = {
|
|
37
39
|
browserUse: new browser_use_1.BrowserUseService(apiKey, baseUrl, timeout),
|
|
38
40
|
claudeComputerUse: new claude_computer_use_1.ClaudeComputerUseService(apiKey, baseUrl, timeout),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BasicResponse, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse } from "../types/session";
|
|
1
|
+
import { BasicResponse, CreateSessionParams, GetActiveSessionsCountResponse, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse } from "../types/session";
|
|
2
2
|
import { BaseService } from "./base";
|
|
3
3
|
export declare class SessionsService extends BaseService {
|
|
4
4
|
/**
|
|
@@ -53,4 +53,8 @@ export declare class SessionsService extends BaseService {
|
|
|
53
53
|
* Helper method to check if input is a readable stream
|
|
54
54
|
*/
|
|
55
55
|
private isReadableStream;
|
|
56
|
+
/**
|
|
57
|
+
* Get the number of active sessions
|
|
58
|
+
*/
|
|
59
|
+
getActiveSessionsCount(): Promise<GetActiveSessionsCountResponse>;
|
|
56
60
|
}
|
|
@@ -256,5 +256,19 @@ class SessionsService extends base_1.BaseService {
|
|
|
256
256
|
typeof obj.on === "function" &&
|
|
257
257
|
obj.readable !== false);
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Get the number of active sessions
|
|
261
|
+
*/
|
|
262
|
+
async getActiveSessionsCount() {
|
|
263
|
+
try {
|
|
264
|
+
return await this.request("/sessions/active-count");
|
|
265
|
+
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
if (error instanceof client_1.HyperbrowserError) {
|
|
268
|
+
throw error;
|
|
269
|
+
}
|
|
270
|
+
throw new client_1.HyperbrowserError("Failed to get active sessions count", undefined);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
259
273
|
}
|
|
260
274
|
exports.SessionsService = SessionsService;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TeamService = void 0;
|
|
4
|
+
const client_1 = require("../client");
|
|
5
|
+
const base_1 = require("./base");
|
|
6
|
+
class TeamService extends base_1.BaseService {
|
|
7
|
+
/**
|
|
8
|
+
* Get the credit info for the team
|
|
9
|
+
*/
|
|
10
|
+
async getCreditInfo() {
|
|
11
|
+
try {
|
|
12
|
+
return await this.request("/team/credit-info");
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (error instanceof client_1.HyperbrowserError) {
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
throw new client_1.HyperbrowserError("Failed to get team credit info", undefined);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.TeamService = TeamService;
|
|
@@ -13,7 +13,7 @@ export type ScrapeScreenshotFormat = "jpeg" | "png" | "webp";
|
|
|
13
13
|
export type RecordingStatus = "not_enabled" | "pending" | "in_progress" | "completed" | "failed";
|
|
14
14
|
export type DownloadsStatus = "not_enabled" | "pending" | "in_progress" | "completed" | "failed";
|
|
15
15
|
export declare const POLLING_ATTEMPTS = 5;
|
|
16
|
-
export type BrowserUseLlm = "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "claude-sonnet-4-20250514" | "claude-3-7-sonnet-20250219" | "claude-3-5-sonnet-20241022" | "claude-3-5-haiku-20241022" | "gemini-2.0-flash";
|
|
16
|
+
export type BrowserUseLlm = "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "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";
|
|
17
17
|
export type ClaudeComputerUseLlm = "claude-3-7-sonnet-20250219" | "claude-sonnet-4-20250514";
|
|
18
18
|
export type HyperAgentLlm = "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano";
|
|
19
19
|
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/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export { StartBrowserUseTaskParams, StartBrowserUseTaskResponse, BrowserUseTaskS
|
|
|
6
6
|
export { StartClaudeComputerUseTaskParams, StartClaudeComputerUseTaskResponse, ClaudeComputerUseTaskStatusResponse, ClaudeComputerUseTaskResponse, ClaudeComputerUseTaskData, ClaudeComputerUseStepResponse, } from "./agents/claude-computer-use";
|
|
7
7
|
export { StartCuaTaskParams, StartCuaTaskResponse, CuaTaskStatusResponse, CuaTaskResponse, CuaTaskData, CuaStepResponse, } from "./agents/cua";
|
|
8
8
|
export { StartHyperAgentTaskParams, StartHyperAgentTaskResponse, HyperAgentTaskStatusResponse, HyperAgentTaskResponse, HyperAgentTaskData, HyperAgentStep, HyperAgentOutput, HyperAgentActionOutput, } from "./agents/hyper-agent";
|
|
9
|
-
export { BasicResponse, SessionStatus, Session, SessionDetail, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, } from "./session";
|
|
9
|
+
export { BasicResponse, SessionStatus, Session, SessionDetail, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, } from "./session";
|
|
10
10
|
export { CreateProfileParams, ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile";
|
|
11
11
|
export { CreateExtensionParams, CreateExtensionResponse, ListExtensionsResponse, } from "./extension";
|
|
12
12
|
export { ExtractJobStatus, BrowserUseTaskStatus, BrowserUseLlm, ClaudeComputerUseLlm, ScrapeScreenshotFormat, ScrapeJobStatus, CrawlJobStatus, Country, State, ISO639_1, OperatingSystem, Platform, ScrapeFormat, ScrapeWaitUntil, ScrapePageStatus, CrawlPageStatus, RecordingStatus, DownloadsStatus, HyperAgentLlm, HyperAgentTaskStatus, ClaudeComputerUseTaskStatus, CuaTaskStatus, } from "./constants";
|
|
13
|
+
export { TeamCreditInfo } from "./team";
|
package/dist/types/session.d.ts
CHANGED