@hyperbrowser/sdk 0.90.4 → 0.91.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, CaptchaEvaluationParams, CaptchaEvaluationResponse, CreateSessionParams, GetActiveSessionsCountResponse, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse, SessionEventLogListParams, SessionEventLogListResponse, UpdateSessionProfileParams, UpdateSessionProxyParams, UpdateSessionScreenParams, UpdateSessionSolveCaptchasParams, UpdateSessionSolveCaptchasResponse, SessionGetParams } from "../types/session";
1
+ import { BasicResponse, CaptchaEvaluationParams, CaptchaEvaluationResponse, CreateSessionParams, CreateSessionSnapshotResponse, GetActiveSessionsCountResponse, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse, SessionEventLogListParams, SessionEventLogListResponse, UpdateSessionProfileParams, UpdateSessionProxyParams, UpdateSessionScreenParams, UpdateSessionSolveCaptchasParams, UpdateSessionSolveCaptchasResponse, SessionGetParams } from "../types/session";
2
2
  import { BaseService } from "./base";
3
3
  /**
4
4
  * Service for managing session event logs
@@ -29,6 +29,11 @@ export declare class SessionsService extends BaseService {
29
29
  * @param id The ID of the session to stop
30
30
  */
31
31
  stop(id: string): Promise<BasicResponse>;
32
+ /**
33
+ * Create a restorable snapshot from a running browser session.
34
+ * @param id The ID of the session to snapshot
35
+ */
36
+ createSnapshot(id: string): Promise<CreateSessionSnapshotResponse>;
32
37
  /**
33
38
  * Manually evaluate captchas in a running session.
34
39
  * @param id The ID of the session to evaluate
@@ -114,6 +114,24 @@ class SessionsService extends base_1.BaseService {
114
114
  throw new client_1.HyperbrowserError(`Failed to stop session ${id}`, undefined);
115
115
  }
116
116
  }
117
+ /**
118
+ * Create a restorable snapshot from a running browser session.
119
+ * @param id The ID of the session to snapshot
120
+ */
121
+ async createSnapshot(id) {
122
+ try {
123
+ return await this.request(`/session/${id}/snapshot`, {
124
+ method: "POST",
125
+ body: JSON.stringify({}),
126
+ });
127
+ }
128
+ catch (error) {
129
+ if (error instanceof client_1.HyperbrowserError) {
130
+ throw error;
131
+ }
132
+ throw new client_1.HyperbrowserError(`Failed to create snapshot for session ${id}`, undefined);
133
+ }
134
+ }
117
135
  /**
118
136
  * Manually evaluate captchas in a running session.
119
137
  * @param id The ID of the session to evaluate
@@ -7,7 +7,7 @@ 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, CaptchaEvaluationPageResult, CaptchaEvaluationParams, CaptchaEvaluationResponse, CaptchaEvaluationTarget, CaptchaEvaluationType, CaptchaSolverType, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, SessionCreditBreakdown, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, UpdateSessionScreenParams, UpdateSessionSolveCaptchasParams, UpdateSessionSolveCaptchasResponse, } from "./session";
10
+ export { BasicResponse, SessionStatus, Session, SessionDetail, SessionGetParams, SessionListParams, SessionListResponse, ScreenConfig, CaptchaEvaluationPageResult, CaptchaEvaluationParams, CaptchaEvaluationResponse, CaptchaEvaluationTarget, CaptchaEvaluationType, CaptchaSolverType, CreateSessionParams, CreateSessionSnapshotResponse, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, SessionCreditBreakdown, StartSessionFromSnapshotParams, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, UpdateSessionScreenParams, UpdateSessionSolveCaptchasParams, UpdateSessionSolveCaptchasResponse, } 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, ForkProfileParams, ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile";
@@ -120,6 +120,9 @@ export interface CaptchaEvaluationResponse {
120
120
  solvedCaptchas: CaptchaEvaluationType[];
121
121
  pages: CaptchaEvaluationPageResult[];
122
122
  }
123
+ export interface StartSessionFromSnapshotParams {
124
+ snapshotId: string;
125
+ }
123
126
  export interface CreateSessionParams {
124
127
  useUltraStealth?: boolean;
125
128
  useStealth?: boolean;
@@ -166,6 +169,18 @@ export interface CreateSessionParams {
166
169
  liveViewTtlSeconds?: number;
167
170
  replaceNativeElements?: boolean;
168
171
  disablePostQuantumKeyAgreement?: boolean;
172
+ startFromSnapshot?: StartSessionFromSnapshotParams;
173
+ }
174
+ export interface CreateSessionSnapshotResponse {
175
+ snapshotName: string;
176
+ snapshotId: string;
177
+ namespace: string;
178
+ status: string;
179
+ uploaded: boolean;
180
+ ready: boolean;
181
+ imageName: string;
182
+ imageId: string;
183
+ imageNamespace: string;
169
184
  }
170
185
  export interface SessionRecording {
171
186
  type: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbrowser/sdk",
3
- "version": "0.90.4",
3
+ "version": "0.91.0",
4
4
  "description": "Node SDK for Hyperbrowser API",
5
5
  "author": "",
6
6
  "repository": {