@hyperbrowser/sdk 0.89.6 → 0.89.8

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.
@@ -15,4 +15,5 @@ export declare class ComputerActionService extends BaseService {
15
15
  mouseUp(session: SessionDetail | string, button?: ComputerActionMouseButton, returnScreenshot?: boolean): Promise<ComputerActionResponse>;
16
16
  getClipboardText(session: SessionDetail | string, returnScreenshot?: boolean): Promise<ComputerActionResponse>;
17
17
  putSelectionText(session: SessionDetail | string, text: string, returnScreenshot?: boolean): Promise<ComputerActionResponse>;
18
+ listWindows(session: SessionDetail | string, returnScreenshot?: boolean): Promise<ComputerActionResponse>;
18
19
  }
@@ -118,5 +118,11 @@ class ComputerActionService extends base_1.BaseService {
118
118
  returnScreenshot,
119
119
  });
120
120
  }
121
+ async listWindows(session, returnScreenshot = false) {
122
+ return this.executeRequest(session, {
123
+ action: computer_action_1.ComputerAction.LIST_WINDOWS,
124
+ returnScreenshot,
125
+ });
126
+ }
121
127
  }
122
128
  exports.ComputerActionService = ComputerActionService;
@@ -1,4 +1,4 @@
1
- import { BasicResponse, CreateSessionParams, GetActiveSessionsCountResponse, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse, SessionEventLogListParams, SessionEventLogListResponse, UpdateSessionProfileParams, UpdateSessionProxyParams, SessionGetParams } from "../types/session";
1
+ import { BasicResponse, CreateSessionParams, GetActiveSessionsCountResponse, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse, SessionEventLogListParams, SessionEventLogListResponse, UpdateSessionProfileParams, UpdateSessionProxyParams, UpdateSessionScreenParams, SessionGetParams } from "../types/session";
2
2
  import { BaseService } from "./base";
3
3
  /**
4
4
  * Service for managing session event logs
@@ -80,6 +80,7 @@ export declare class SessionsService extends BaseService {
80
80
  /** @deprecated Pass an UpdateSessionProfileParams object instead of a boolean. */
81
81
  updateProfileParams(id: string, persistChanges: boolean): Promise<BasicResponse>;
82
82
  updateProxyParams(id: string, params: UpdateSessionProxyParams): Promise<BasicResponse>;
83
+ updateScreenSize(id: string, params: UpdateSessionScreenParams): Promise<BasicResponse>;
83
84
  private static hasWarnedUpdateSessionProfileParamsBooleanDeprecated;
84
85
  private warnUpdateSessionProfileParamsBooleanDeprecated;
85
86
  }
@@ -359,6 +359,20 @@ class SessionsService extends base_1.BaseService {
359
359
  throw new client_1.HyperbrowserError(`Failed to update proxy for session ${id}`, undefined);
360
360
  }
361
361
  }
362
+ async updateScreenSize(id, params) {
363
+ try {
364
+ return await this.request(`/session/${id}/update`, {
365
+ method: "PUT",
366
+ body: JSON.stringify({ type: "screen", params }),
367
+ });
368
+ }
369
+ catch (error) {
370
+ if (error instanceof client_1.HyperbrowserError) {
371
+ throw error;
372
+ }
373
+ throw new client_1.HyperbrowserError(`Failed to update screen for session ${id}`, undefined);
374
+ }
375
+ }
362
376
  warnUpdateSessionProfileParamsBooleanDeprecated() {
363
377
  if (SessionsService.hasWarnedUpdateSessionProfileParamsBooleanDeprecated) {
364
378
  return;
@@ -13,7 +13,8 @@ export declare enum ComputerAction {
13
13
  SCROLL = "scroll",
14
14
  TYPE_TEXT = "type_text",
15
15
  GET_CLIPBOARD_TEXT = "get_clipboard_text",
16
- PUT_SELECTION_TEXT = "put_selection_text"
16
+ PUT_SELECTION_TEXT = "put_selection_text",
17
+ LIST_WINDOWS = "list_windows"
17
18
  }
18
19
  export type ComputerActionMouseButton = "left" | "right" | "middle" | "back" | "forward" | "wheel";
19
20
  /**
@@ -118,14 +119,36 @@ export interface PutSelectionTextActionParams {
118
119
  text: string;
119
120
  returnScreenshot?: boolean;
120
121
  }
122
+ /**
123
+ * Parameters for list windows action.
124
+ */
125
+ export interface ListWindowsActionParams {
126
+ action: ComputerAction.LIST_WINDOWS;
127
+ returnScreenshot?: boolean;
128
+ }
121
129
  /**
122
130
  * Union type for all computer action parameters
123
131
  */
124
- export type ComputerActionParams = ClickActionParams | DragActionParams | PressKeysActionParams | MoveMouseActionParams | ScreenshotActionParams | ScrollActionParams | TypeTextActionParams | HoldKeyActionParams | MouseDownActionParams | MouseUpActionParams | GetClipboardTextActionParams | PutSelectionTextActionParams;
132
+ export type ComputerActionParams = ClickActionParams | DragActionParams | PressKeysActionParams | MoveMouseActionParams | ScreenshotActionParams | ScrollActionParams | TypeTextActionParams | HoldKeyActionParams | MouseDownActionParams | MouseUpActionParams | GetClipboardTextActionParams | PutSelectionTextActionParams | ListWindowsActionParams;
125
133
  export interface ComputerActionResponseDataClipboardText {
126
134
  clipboardText?: string;
127
135
  }
128
- export type ComputerActionResponseData = ComputerActionResponseDataClipboardText;
136
+ /**
137
+ * A single visible top-level X11/native window entry.
138
+ */
139
+ export interface ComputerActionWindow {
140
+ id: string;
141
+ name: string;
142
+ active: boolean;
143
+ }
144
+ /**
145
+ * Response data for the list windows action.
146
+ */
147
+ export interface ComputerActionResponseDataListWindows {
148
+ activeWindowId: string;
149
+ windows: ComputerActionWindow[];
150
+ }
151
+ export type ComputerActionResponseData = ComputerActionResponseDataClipboardText | ComputerActionResponseDataListWindows;
129
152
  /**
130
153
  * Response from computer action API
131
154
  */
@@ -18,4 +18,5 @@ var ComputerAction;
18
18
  ComputerAction["TYPE_TEXT"] = "type_text";
19
19
  ComputerAction["GET_CLIPBOARD_TEXT"] = "get_clipboard_text";
20
20
  ComputerAction["PUT_SELECTION_TEXT"] = "put_selection_text";
21
+ ComputerAction["LIST_WINDOWS"] = "list_windows";
21
22
  })(ComputerAction || (exports.ComputerAction = ComputerAction = {}));
@@ -7,14 +7,14 @@ export { StartClaudeComputerUseTaskParams, StartClaudeComputerUseTaskResponse, C
7
7
  export { StartCuaTaskParams, StartCuaTaskResponse, CuaTaskStatusResponse, CuaTaskResponse, CuaTaskData, CuaStepResponse, CuaApiKeys, CuaTaskMetadata, } from "./agents/cua";
8
8
  export { StartHyperAgentTaskParams, StartHyperAgentTaskResponse, HyperAgentTaskStatusResponse, HyperAgentTaskResponse, HyperAgentTaskData, HyperAgentStep, HyperAgentOutput, HyperAgentActionOutput, HyperAgentApiKeys, HyperAgentTaskMetadata, HyperAgentOutputV110, HyperAgentStepV110, } from "./agents/hyper-agent";
9
9
  export { StartGeminiComputerUseTaskParams, StartGeminiComputerUseTaskResponse, GeminiComputerUseTaskStatusResponse, GeminiComputerUseTaskResponse, GeminiComputerUseTaskData, GeminiComputerUseStepResponse, GeminiComputerUseApiKeys, GeminiComputerUseTaskMetadata, } from "./agents/gemini-computer-use";
10
- export { BasicResponse, SessionStatus, Session, SessionDetail, SessionGetParams, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, SessionCreditBreakdown, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, } from "./session";
10
+ export { BasicResponse, SessionStatus, Session, SessionDetail, SessionGetParams, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, SessionCreditBreakdown, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, UpdateSessionScreenParams, } from "./session";
11
11
  export { SandboxStatus, SandboxRuntimeTarget, Sandbox, SandboxDetail, SandboxVolumeMountType, SandboxVolumeMount, SandboxListParams, SandboxListResponse, SandboxImageSummary, SandboxImageListResponse, SandboxSnapshotStatus, SandboxSnapshotSummary, SandboxSnapshotListParams, SandboxSnapshotListResponse, CreateSandboxParams, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxExposeParams, SandboxExposeResult, SandboxUnexposeResult, SandboxProcessStatus, SandboxExecParams, SandboxExecOptions, SandboxProcessSummary, SandboxProcessResult, SandboxProcessListParams, SandboxProcessListResponse, SandboxProcessWaitParams, SandboxProcessSignal, SandboxProcessStdinParams, SandboxProcessStreamEvent, SandboxFileType, SandboxFileInfo, SandboxFileWriteInfo, SandboxFileListOptions, SandboxFileReadFormat, SandboxFileReadOptions, SandboxFileWriteData, SandboxFileWriteEntry, SandboxFileTextWriteOptions, SandboxFileBytesWriteOptions, SandboxFileMakeDirOptions, SandboxFileCopyParams, SandboxFileChmodParams, SandboxFileChownParams, SandboxFileTransferResult, SandboxFileSystemEventType, SandboxFileSystemEvent, SandboxWatchDirOptions, SandboxPresignFileParams, SandboxPresignedUrl, SandboxTerminalCreateParams, SandboxTerminalOutputChunk, SandboxTerminalStatus, SandboxTerminalWaitParams, SandboxTerminalKillParams, SandboxTerminalEvent, } from "./sandbox";
12
12
  export { CreateVolumeParams, Volume, VolumeListResponse } from "./volume";
13
13
  export { CreateProfileParams, ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile";
14
14
  export { CreateExtensionParams, CreateExtensionResponse, ListExtensionsResponse, } from "./extension";
15
15
  export { ExtractJobStatus, BrowserUseTaskStatus, BrowserUseLlm, ClaudeComputerUseLlm, CuaLlm, GeminiComputerUseLlm, ScrapeScreenshotFormat, ScrapeJobStatus, CrawlJobStatus, Country, State, ISO639_1, OperatingSystem, Platform, ScrapeFormat, ScrapeWaitUntil, ScrapePageStatus, CrawlPageStatus, RecordingStatus, DownloadsStatus, HyperAgentLlm, HyperAgentTaskStatus, ClaudeComputerUseTaskStatus, CuaTaskStatus, GeminiComputerUseTaskStatus, SessionEventLogType, SessionRegion, BrowserUseVersion, HyperAgentVersion, } from "./constants";
16
16
  export { TeamCreditInfo } from "./team";
17
- export { ComputerAction, Coordinate, ClickActionParams, DragActionParams, PressKeysActionParams, MoveMouseActionParams, ScreenshotActionParams, ScrollActionParams, TypeTextActionParams, ComputerActionParams, ComputerActionResponse, ComputerActionMouseButton, ComputerActionResponseData, HoldKeyActionParams, MouseDownActionParams, MouseUpActionParams, GetClipboardTextActionParams, PutSelectionTextActionParams, ComputerActionResponseDataClipboardText, } from "./computer-action";
17
+ export { ComputerAction, Coordinate, ClickActionParams, DragActionParams, PressKeysActionParams, MoveMouseActionParams, ScreenshotActionParams, ScrollActionParams, TypeTextActionParams, ComputerActionParams, ComputerActionResponse, ComputerActionMouseButton, ComputerActionResponseData, HoldKeyActionParams, MouseDownActionParams, MouseUpActionParams, GetClipboardTextActionParams, PutSelectionTextActionParams, ComputerActionResponseDataClipboardText, ListWindowsActionParams, ComputerActionWindow, ComputerActionResponseDataListWindows, } from "./computer-action";
18
18
  export { FetchParams, FetchResponse, FetchResponseData, FetchStatus } from "./web/fetch";
19
19
  export { StartBatchFetchJobParams, GetBatchFetchJobParams, StartBatchFetchJobResponse, BatchFetchJobStatusResponse, BatchFetchJobResponse, BatchFetchJobStatus, } from "./web/batch-fetch";
20
20
  export { WebSearchParams, WebSearchResponse, WebSearchResponseData, WebSearchResultItem, WebSearchFilters, WebSearchLocation, WebSearchFiletype, WebSearchStatus, } from "./web/search";
@@ -202,3 +202,7 @@ export interface UpdateSessionProxyParams {
202
202
  staticIpId?: string;
203
203
  location?: UpdateSessionProxyLocationParams;
204
204
  }
205
+ export interface UpdateSessionScreenParams {
206
+ width: number;
207
+ height: number;
208
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbrowser/sdk",
3
- "version": "0.89.6",
3
+ "version": "0.89.8",
4
4
  "description": "Node SDK for Hyperbrowser API",
5
5
  "author": "",
6
6
  "repository": {