@hyperbrowser/sdk 0.85.0 → 0.87.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/services/sandboxes.d.ts +4 -1
- package/dist/services/sandboxes.js +40 -0
- package/dist/services/sessions.d.ts +2 -1
- package/dist/services/sessions.js +14 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/sandbox.d.ts +44 -0
- package/dist/types/session.d.ts +10 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { SandboxFilesApi } from "../sandbox/files";
|
|
|
2
2
|
import { SandboxProcessHandle, SandboxProcessesApi } from "../sandbox/process";
|
|
3
3
|
import { SandboxTerminalApi } from "../sandbox/terminal";
|
|
4
4
|
import { BasicResponse } from "../types/session";
|
|
5
|
-
import { CreateSandboxParams, SandboxDetail, SandboxExposeParams, SandboxExposeResult, SandboxExecParams, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxProcessResult, SandboxRuntimeTarget } from "../types/sandbox";
|
|
5
|
+
import { CreateSandboxParams, SandboxDetail, SandboxExposeParams, SandboxExposeResult, SandboxExecParams, SandboxImageListResponse, SandboxListParams, SandboxListResponse, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxProcessResult, SandboxRuntimeTarget, SandboxSnapshotListParams, SandboxSnapshotListResponse } from "../types/sandbox";
|
|
6
6
|
import { BaseService } from "./base";
|
|
7
7
|
export declare class SandboxHandle {
|
|
8
8
|
private readonly service;
|
|
@@ -47,6 +47,9 @@ export declare class SandboxesService extends BaseService {
|
|
|
47
47
|
create(params: CreateSandboxParams): Promise<SandboxHandle>;
|
|
48
48
|
get(id: string): Promise<SandboxHandle>;
|
|
49
49
|
connect(id: string): Promise<SandboxHandle>;
|
|
50
|
+
list(params?: SandboxListParams): Promise<SandboxListResponse>;
|
|
51
|
+
listImages(): Promise<SandboxImageListResponse>;
|
|
52
|
+
listSnapshots(params?: SandboxSnapshotListParams): Promise<SandboxSnapshotListResponse>;
|
|
50
53
|
stop(id: string): Promise<BasicResponse>;
|
|
51
54
|
getDetail(id: string): Promise<SandboxDetail>;
|
|
52
55
|
attach(detail: SandboxDetail): SandboxHandle;
|
|
@@ -194,6 +194,46 @@ class SandboxesService extends base_2.BaseService {
|
|
|
194
194
|
await handle.connect();
|
|
195
195
|
return handle;
|
|
196
196
|
}
|
|
197
|
+
async list(params = {}) {
|
|
198
|
+
try {
|
|
199
|
+
return await this.request("/sandboxes", undefined, {
|
|
200
|
+
status: params.status,
|
|
201
|
+
page: params.page,
|
|
202
|
+
limit: params.limit,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
if (error instanceof client_1.HyperbrowserError) {
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
throw new client_1.HyperbrowserError("Failed to list sandboxes", undefined);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async listImages() {
|
|
213
|
+
try {
|
|
214
|
+
return await this.request("/images");
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
if (error instanceof client_1.HyperbrowserError) {
|
|
218
|
+
throw error;
|
|
219
|
+
}
|
|
220
|
+
throw new client_1.HyperbrowserError("Failed to list sandbox images", undefined);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
async listSnapshots(params = {}) {
|
|
224
|
+
try {
|
|
225
|
+
return await this.request("/snapshots", undefined, {
|
|
226
|
+
status: params.status,
|
|
227
|
+
limit: params.limit,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
if (error instanceof client_1.HyperbrowserError) {
|
|
232
|
+
throw error;
|
|
233
|
+
}
|
|
234
|
+
throw new client_1.HyperbrowserError("Failed to list sandbox snapshots", undefined);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
197
237
|
async stop(id) {
|
|
198
238
|
try {
|
|
199
239
|
return await this.request(`/sandbox/${id}/stop`, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BasicResponse, CreateSessionParams, GetActiveSessionsCountResponse, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse, SessionEventLogListParams, SessionEventLogListResponse, UpdateSessionProfileParams, SessionGetParams } from "../types/session";
|
|
1
|
+
import { BasicResponse, CreateSessionParams, GetActiveSessionsCountResponse, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse, SessionEventLogListParams, SessionEventLogListResponse, UpdateSessionProfileParams, UpdateSessionProxyParams, SessionGetParams } from "../types/session";
|
|
2
2
|
import { BaseService } from "./base";
|
|
3
3
|
/**
|
|
4
4
|
* Service for managing session event logs
|
|
@@ -79,6 +79,7 @@ export declare class SessionsService extends BaseService {
|
|
|
79
79
|
updateProfileParams(id: string, params: UpdateSessionProfileParams): Promise<BasicResponse>;
|
|
80
80
|
/** @deprecated Pass an UpdateSessionProfileParams object instead of a boolean. */
|
|
81
81
|
updateProfileParams(id: string, persistChanges: boolean): Promise<BasicResponse>;
|
|
82
|
+
updateProxyParams(id: string, params: UpdateSessionProxyParams): Promise<BasicResponse>;
|
|
82
83
|
private static hasWarnedUpdateSessionProfileParamsBooleanDeprecated;
|
|
83
84
|
private warnUpdateSessionProfileParamsBooleanDeprecated;
|
|
84
85
|
}
|
|
@@ -345,6 +345,20 @@ class SessionsService extends base_1.BaseService {
|
|
|
345
345
|
throw new client_1.HyperbrowserError(`Failed to update profile for session ${id}`, undefined);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
+
async updateProxyParams(id, params) {
|
|
349
|
+
try {
|
|
350
|
+
return await this.request(`/session/${id}/update`, {
|
|
351
|
+
method: "PUT",
|
|
352
|
+
body: JSON.stringify({ type: "proxy", params }),
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
if (error instanceof client_1.HyperbrowserError) {
|
|
357
|
+
throw error;
|
|
358
|
+
}
|
|
359
|
+
throw new client_1.HyperbrowserError(`Failed to update proxy for session ${id}`, undefined);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
348
362
|
warnUpdateSessionProfileParamsBooleanDeprecated() {
|
|
349
363
|
if (SessionsService.hasWarnedUpdateSessionProfileParamsBooleanDeprecated) {
|
|
350
364
|
return;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ 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, UpdateSessionProfileParams, } from "./session";
|
|
11
|
-
export { SandboxStatus, SandboxRuntimeTarget, Sandbox, SandboxDetail, CreateSandboxParams, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxExposeParams, SandboxExposeResult, SandboxProcessStatus, SandboxExecParams, 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";
|
|
10
|
+
export { BasicResponse, SessionStatus, Session, SessionDetail, SessionGetParams, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, } from "./session";
|
|
11
|
+
export { SandboxStatus, SandboxRuntimeTarget, Sandbox, SandboxDetail, SandboxListParams, SandboxListResponse, SandboxImageSummary, SandboxImageListResponse, SandboxSnapshotStatus, SandboxSnapshotSummary, SandboxSnapshotListParams, SandboxSnapshotListResponse, CreateSandboxParams, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxExposeParams, SandboxExposeResult, SandboxProcessStatus, SandboxExecParams, 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 { CreateProfileParams, ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile";
|
|
13
13
|
export { CreateExtensionParams, CreateExtensionResponse, ListExtensionsResponse, } from "./extension";
|
|
14
14
|
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";
|
package/dist/types/sandbox.d.ts
CHANGED
|
@@ -49,6 +49,50 @@ export type CreateSandboxParams = (SandboxCreateCommonParams & {
|
|
|
49
49
|
imageName: string;
|
|
50
50
|
imageId?: string;
|
|
51
51
|
});
|
|
52
|
+
export interface SandboxListParams {
|
|
53
|
+
status?: SandboxStatus;
|
|
54
|
+
page?: number;
|
|
55
|
+
limit?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface SandboxListResponse {
|
|
58
|
+
sandboxes: Sandbox[];
|
|
59
|
+
totalCount: number;
|
|
60
|
+
page: number;
|
|
61
|
+
perPage: number;
|
|
62
|
+
}
|
|
63
|
+
export interface SandboxImageSummary {
|
|
64
|
+
id: string;
|
|
65
|
+
imageName: string;
|
|
66
|
+
namespace: string;
|
|
67
|
+
uploaded: boolean;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
updatedAt: string;
|
|
70
|
+
}
|
|
71
|
+
export interface SandboxImageListResponse {
|
|
72
|
+
images: SandboxImageSummary[];
|
|
73
|
+
}
|
|
74
|
+
export type SandboxSnapshotStatus = "creating" | "created" | "failed";
|
|
75
|
+
export interface SandboxSnapshotSummary {
|
|
76
|
+
id: string;
|
|
77
|
+
snapshotName: string;
|
|
78
|
+
namespace: string;
|
|
79
|
+
imageNamespace: string;
|
|
80
|
+
imageName: string;
|
|
81
|
+
imageId: string;
|
|
82
|
+
status: SandboxSnapshotStatus;
|
|
83
|
+
compatibilityTag: string;
|
|
84
|
+
metadata: Record<string, unknown>;
|
|
85
|
+
uploaded: boolean;
|
|
86
|
+
createdAt: string;
|
|
87
|
+
updatedAt: string;
|
|
88
|
+
}
|
|
89
|
+
export interface SandboxSnapshotListParams {
|
|
90
|
+
status?: SandboxSnapshotStatus;
|
|
91
|
+
limit?: number;
|
|
92
|
+
}
|
|
93
|
+
export interface SandboxSnapshotListResponse {
|
|
94
|
+
snapshots: SandboxSnapshotSummary[];
|
|
95
|
+
}
|
|
52
96
|
export interface SandboxMemorySnapshotParams {
|
|
53
97
|
snapshotName?: string;
|
|
54
98
|
}
|
package/dist/types/session.d.ts
CHANGED
|
@@ -186,3 +186,13 @@ export interface UpdateSessionProfileParams {
|
|
|
186
186
|
persistChanges?: boolean;
|
|
187
187
|
persistNetworkCache?: boolean;
|
|
188
188
|
}
|
|
189
|
+
export interface UpdateSessionProxyLocationParams {
|
|
190
|
+
country?: Country;
|
|
191
|
+
state?: State;
|
|
192
|
+
city?: string;
|
|
193
|
+
}
|
|
194
|
+
export interface UpdateSessionProxyParams {
|
|
195
|
+
enabled: boolean;
|
|
196
|
+
staticIpId?: string;
|
|
197
|
+
location?: UpdateSessionProxyLocationParams;
|
|
198
|
+
}
|