@hyperbrowser/sdk 0.50.0 → 0.51.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,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;
@@ -6,7 +6,7 @@ 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";
@@ -100,3 +100,6 @@ export interface UploadFileOptions {
100
100
  fileInput: string | fs.ReadStream | Buffer;
101
101
  fileName?: string;
102
102
  }
103
+ export interface GetActiveSessionsCountResponse {
104
+ activeSessionsCount: number;
105
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbrowser/sdk",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "description": "Node SDK for Hyperbrowser API",
5
5
  "author": "",
6
6
  "main": "dist/index.js",