@hyperbrowser/sdk 0.85.0 → 0.86.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.
|
@@ -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`, {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { StartCuaTaskParams, StartCuaTaskResponse, CuaTaskStatusResponse, CuaTas
|
|
|
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
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";
|
|
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
|
}
|