@hyperbrowser/sdk 0.91.8 → 0.92.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, SandboxExecOptions, SandboxImageListResponse, SandboxListParams, SandboxListResponse, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxProcessResult, SandboxSnapshotListParams, SandboxSnapshotListResponse, SandboxUnexposeResult } from "../types/sandbox";
5
+ import { CompleteSandboxImageBuildParams, CreateSandboxImageBuildParams, CreateSandboxParams, SandboxDetail, SandboxExposeParams, SandboxExposeResult, SandboxExecParams, SandboxExecOptions, SandboxImageBuild, SandboxImageBuildCreateResult, SandboxImageBuildListParams, SandboxImageBuildListResponse, SandboxImageListParams, SandboxImageListResponse, SandboxListParams, SandboxListResponse, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxNetworkPolicyPatch, SandboxNetworkUpdateResult, SandboxProcessResult, SandboxSnapshotDeleteResult, SandboxSnapshotListParams, SandboxSnapshotListResponse, SandboxSnapshotSummary, SandboxUnexposeResult } from "../types/sandbox";
6
6
  import { BaseService } from "./base";
7
7
  export declare class SandboxHandle {
8
8
  private readonly service;
@@ -23,6 +23,7 @@ export declare class SandboxHandle {
23
23
  get cpu(): number | null | undefined;
24
24
  get memoryMiB(): number | null | undefined;
25
25
  get diskMiB(): number | null | undefined;
26
+ get timeoutMinutes(): number | null | undefined;
26
27
  get exposedPorts(): SandboxExposeResult[];
27
28
  toJSON(): SandboxDetail;
28
29
  info(): Promise<SandboxDetail>;
@@ -33,6 +34,9 @@ export declare class SandboxHandle {
33
34
  expose(params: SandboxExposeParams): Promise<SandboxExposeResult>;
34
35
  unexpose(port: number): Promise<SandboxUnexposeResult>;
35
36
  getExposedUrl(port: number): string;
37
+ get network(): SandboxDetail["network"];
38
+ updateNetwork(policy: SandboxNetworkPolicyPatch): Promise<SandboxNetworkUpdateResult>;
39
+ clearNetwork(): Promise<SandboxNetworkUpdateResult>;
36
40
  exec(input: string, options?: SandboxExecOptions): Promise<SandboxProcessResult>;
37
41
  exec(input: SandboxExecParams): Promise<SandboxProcessResult>;
38
42
  getProcess(processId: string): Promise<SandboxProcessHandle>;
@@ -54,13 +58,21 @@ export declare class SandboxesService extends BaseService {
54
58
  get(id: string): Promise<SandboxHandle>;
55
59
  connect(id: string): Promise<SandboxHandle>;
56
60
  list(params?: SandboxListParams): Promise<SandboxListResponse>;
57
- listImages(): Promise<SandboxImageListResponse>;
61
+ listImages(params?: SandboxImageListParams): Promise<SandboxImageListResponse>;
58
62
  listSnapshots(params?: SandboxSnapshotListParams): Promise<SandboxSnapshotListResponse>;
59
63
  stop(id: string): Promise<BasicResponse>;
60
64
  getDetail(id: string): Promise<SandboxDetail>;
61
65
  attach(detail: SandboxDetail): SandboxHandle;
62
66
  createMemorySnapshot(id: string, params?: SandboxMemorySnapshotParams): Promise<SandboxMemorySnapshotResult>;
63
67
  expose(id: string, params: SandboxExposeParams): Promise<SandboxExposeResult>;
68
+ getSnapshot(snapshot: string): Promise<SandboxSnapshotSummary>;
69
+ deleteSnapshot(snapshot: string): Promise<SandboxSnapshotDeleteResult>;
70
+ createImageBuild(params: CreateSandboxImageBuildParams): Promise<SandboxImageBuildCreateResult>;
71
+ getImageBuild(buildId: string): Promise<SandboxImageBuild>;
72
+ listImageBuilds(params?: SandboxImageBuildListParams): Promise<SandboxImageBuildListResponse>;
73
+ completeImageBuild(buildId: string, params: CompleteSandboxImageBuildParams): Promise<SandboxImageBuild>;
74
+ cancelImageBuild(buildId: string): Promise<SandboxImageBuild>;
75
+ updateNetwork(id: string, policy: SandboxNetworkPolicyPatch): Promise<SandboxNetworkUpdateResult>;
64
76
  unexpose(id: string, port: number): Promise<SandboxUnexposeResult>;
65
77
  private createDetail;
66
78
  }
@@ -9,14 +9,6 @@ const process_1 = require("../sandbox/process");
9
9
  const terminal_1 = require("../sandbox/terminal");
10
10
  const base_2 = require("./base");
11
11
  const RUNTIME_SESSION_REFRESH_BUFFER_MS = 60000;
12
- const validateOptionalPositiveInteger = (value, fieldName) => {
13
- if (value === undefined) {
14
- return;
15
- }
16
- if (!Number.isInteger(value) || value < 1) {
17
- throw new client_1.HyperbrowserError(`${fieldName} must be a positive integer`, undefined);
18
- }
19
- };
20
12
  const normalizeSandbox = (sandbox) => {
21
13
  const { vcpus, memMiB, diskSizeMiB, ...rest } = sandbox;
22
14
  return {
@@ -39,10 +31,7 @@ const normalizeSandboxListResponse = (response) => ({
39
31
  sandboxes: response.sandboxes.map(normalizeSandbox),
40
32
  });
41
33
  const serializeCreateSandboxParams = (params) => {
42
- if ("imageName" in params) {
43
- validateOptionalPositiveInteger(params.cpu, "cpu");
44
- validateOptionalPositiveInteger(params.memoryMiB, "memoryMiB");
45
- validateOptionalPositiveInteger(params.diskMiB, "diskMiB");
34
+ if (typeof params.imageName === "string") {
46
35
  return {
47
36
  imageName: params.imageName,
48
37
  imageId: params.imageId,
@@ -54,6 +43,9 @@ const serializeCreateSandboxParams = (params) => {
54
43
  vcpus: params.cpu,
55
44
  memMiB: params.memoryMiB,
56
45
  diskSizeMiB: params.diskMiB,
46
+ allowInternetAccess: params.allowInternetAccess,
47
+ allowOut: params.allowOut,
48
+ denyOut: params.denyOut,
57
49
  };
58
50
  }
59
51
  const snapshotParams = params;
@@ -70,6 +62,9 @@ const serializeCreateSandboxParams = (params) => {
70
62
  exposedPorts: snapshotParams.exposedPorts,
71
63
  mounts: snapshotParams.mounts,
72
64
  timeoutMinutes: snapshotParams.timeoutMinutes,
65
+ allowInternetAccess: snapshotParams.allowInternetAccess,
66
+ allowOut: snapshotParams.allowOut,
67
+ denyOut: snapshotParams.denyOut,
73
68
  };
74
69
  };
75
70
  const resolveSandboxRuntimeSessionHost = (runtime, baseUrl) => {
@@ -142,6 +137,9 @@ class SandboxHandle {
142
137
  get diskMiB() {
143
138
  return this.detail.diskMiB;
144
139
  }
140
+ get timeoutMinutes() {
141
+ return this.detail.timeoutMinutes;
142
+ }
145
143
  get exposedPorts() {
146
144
  return (this.detail.exposedPorts ?? []).map((entry) => ({ ...entry }));
147
145
  }
@@ -188,6 +186,24 @@ class SandboxHandle {
188
186
  getExposedUrl(port) {
189
187
  return buildSandboxExposedUrl(this.runtime, port);
190
188
  }
189
+ get network() {
190
+ return this.detail.network;
191
+ }
192
+ async updateNetwork(policy) {
193
+ const result = await this.service.updateNetwork(this.id, policy);
194
+ this.detail = {
195
+ ...this.detail,
196
+ network: result.network,
197
+ };
198
+ return result;
199
+ }
200
+ async clearNetwork() {
201
+ return this.updateNetwork({
202
+ allowInternetAccess: true,
203
+ allowOut: [],
204
+ denyOut: [],
205
+ });
206
+ }
191
207
  async exec(input, options) {
192
208
  if (typeof input === "string") {
193
209
  return this.processes.exec(input, options);
@@ -265,7 +281,9 @@ class SandboxHandle {
265
281
  };
266
282
  }
267
283
  assertRuntimeAvailable() {
268
- if (this.detail.status === "closed" || this.detail.status === "error") {
284
+ if (this.detail.status === "closed" ||
285
+ this.detail.status === "close-error" ||
286
+ this.detail.status === "error") {
269
287
  throw new client_1.HyperbrowserError(`Sandbox ${this.id} is not running`, {
270
288
  statusCode: 409,
271
289
  code: "sandbox_not_running",
@@ -327,9 +345,14 @@ class SandboxesService extends base_2.BaseService {
327
345
  throw new client_1.HyperbrowserError("Failed to list sandboxes", undefined);
328
346
  }
329
347
  }
330
- async listImages() {
348
+ async listImages(params = {}) {
331
349
  try {
332
- return await this.request("/images");
350
+ return await this.request("/images", undefined, {
351
+ source: params.source,
352
+ search: params.search,
353
+ page: params.page,
354
+ limit: params.limit,
355
+ });
333
356
  }
334
357
  catch (error) {
335
358
  if (error instanceof client_1.HyperbrowserError) {
@@ -343,6 +366,8 @@ class SandboxesService extends base_2.BaseService {
343
366
  return await this.request("/snapshots", undefined, {
344
367
  status: params.status,
345
368
  imageName: params.imageName,
369
+ search: params.search,
370
+ page: params.page,
346
371
  limit: params.limit,
347
372
  });
348
373
  }
@@ -409,6 +434,110 @@ class SandboxesService extends base_2.BaseService {
409
434
  throw new client_1.HyperbrowserError(`Failed to expose port ${params.port} for sandbox ${id}`);
410
435
  }
411
436
  }
437
+ async getSnapshot(snapshot) {
438
+ try {
439
+ const response = await this.request(`/snapshots/${encodeURIComponent(snapshot)}`);
440
+ return response.snapshot;
441
+ }
442
+ catch (error) {
443
+ if (error instanceof client_1.HyperbrowserError) {
444
+ throw error;
445
+ }
446
+ throw new client_1.HyperbrowserError(`Failed to get snapshot ${snapshot}`);
447
+ }
448
+ }
449
+ async deleteSnapshot(snapshot) {
450
+ try {
451
+ return await this.request(`/snapshots/${encodeURIComponent(snapshot)}`, { method: "DELETE" });
452
+ }
453
+ catch (error) {
454
+ if (error instanceof client_1.HyperbrowserError) {
455
+ throw error;
456
+ }
457
+ throw new client_1.HyperbrowserError(`Failed to delete snapshot ${snapshot}`);
458
+ }
459
+ }
460
+ async createImageBuild(params) {
461
+ try {
462
+ return await this.request("/images/builds", {
463
+ method: "POST",
464
+ body: JSON.stringify(params),
465
+ });
466
+ }
467
+ catch (error) {
468
+ if (error instanceof client_1.HyperbrowserError) {
469
+ throw error;
470
+ }
471
+ throw new client_1.HyperbrowserError("Failed to create image build");
472
+ }
473
+ }
474
+ async getImageBuild(buildId) {
475
+ try {
476
+ const response = await this.request(`/images/builds/${encodeURIComponent(buildId)}`);
477
+ return response.build;
478
+ }
479
+ catch (error) {
480
+ if (error instanceof client_1.HyperbrowserError) {
481
+ throw error;
482
+ }
483
+ throw new client_1.HyperbrowserError(`Failed to get image build ${buildId}`);
484
+ }
485
+ }
486
+ async listImageBuilds(params = {}) {
487
+ try {
488
+ return await this.request("/images/builds", undefined, {
489
+ status: params.status,
490
+ limit: params.limit,
491
+ });
492
+ }
493
+ catch (error) {
494
+ if (error instanceof client_1.HyperbrowserError) {
495
+ throw error;
496
+ }
497
+ throw new client_1.HyperbrowserError("Failed to list image builds");
498
+ }
499
+ }
500
+ async completeImageBuild(buildId, params) {
501
+ try {
502
+ const response = await this.request(`/images/builds/${encodeURIComponent(buildId)}/complete`, {
503
+ method: "POST",
504
+ body: JSON.stringify(params),
505
+ });
506
+ return response.build;
507
+ }
508
+ catch (error) {
509
+ if (error instanceof client_1.HyperbrowserError) {
510
+ throw error;
511
+ }
512
+ throw new client_1.HyperbrowserError(`Failed to complete image build ${buildId}`);
513
+ }
514
+ }
515
+ async cancelImageBuild(buildId) {
516
+ try {
517
+ const response = await this.request(`/images/builds/${encodeURIComponent(buildId)}/cancel`, { method: "POST" });
518
+ return response.build;
519
+ }
520
+ catch (error) {
521
+ if (error instanceof client_1.HyperbrowserError) {
522
+ throw error;
523
+ }
524
+ throw new client_1.HyperbrowserError(`Failed to cancel image build ${buildId}`);
525
+ }
526
+ }
527
+ async updateNetwork(id, policy) {
528
+ try {
529
+ return await this.request(`/sandbox/${id}/network`, {
530
+ method: "PUT",
531
+ body: JSON.stringify(policy),
532
+ });
533
+ }
534
+ catch (error) {
535
+ if (error instanceof client_1.HyperbrowserError) {
536
+ throw error;
537
+ }
538
+ throw new client_1.HyperbrowserError(`Failed to update network policy for sandbox ${id}`);
539
+ }
540
+ }
412
541
  async unexpose(id, port) {
413
542
  try {
414
543
  return await this.request(`/sandbox/${id}/unexpose`, {
@@ -1,4 +1,4 @@
1
- import { CreateVolumeParams, Volume, VolumeListResponse } from "../types/volume";
1
+ import { CreateVolumeParams, Volume, VolumeListParams, VolumeListResponse } from "../types/volume";
2
2
  import { BaseService } from "./base";
3
3
  export declare class VolumesService extends BaseService {
4
4
  /**
@@ -8,7 +8,7 @@ export declare class VolumesService extends BaseService {
8
8
  /**
9
9
  * List sandbox volumes for the current team.
10
10
  */
11
- list(): Promise<VolumeListResponse>;
11
+ list(params?: VolumeListParams): Promise<VolumeListResponse>;
12
12
  /**
13
13
  * Get a single sandbox volume.
14
14
  */
@@ -24,9 +24,13 @@ class VolumesService extends base_1.BaseService {
24
24
  /**
25
25
  * List sandbox volumes for the current team.
26
26
  */
27
- async list() {
27
+ async list(params = {}) {
28
28
  try {
29
- return await this.request("/volume");
29
+ return await this.request("/volume", undefined, {
30
+ search: params.search,
31
+ page: params.page,
32
+ limit: params.limit,
33
+ });
30
34
  }
31
35
  catch (error) {
32
36
  if (error instanceof client_1.HyperbrowserError) {
@@ -25,7 +25,7 @@ export type HyperAgentLlm = "gpt-5.6-luna" | "gpt-5.5" | "gpt-5.2" | "gpt-5.1" |
25
25
  export type GeminiComputerUseLlm = "gemini-3.6-flash" | "gemini-3.5-flash" | "gemini-3.5-flash-lite" | "gemini-3-flash-preview" | "gemini-2.5-computer-use-preview-10-2025";
26
26
  export type GrokComputerUseLlm = "grok-4.5";
27
27
  export type GrokReasoningEffort = "low" | "medium" | "high";
28
- export type SessionRegion = "us-central" | "asia-south" | "us-dev" | "europe-west" | "us-west" | "us-east";
28
+ export type SessionRegion = "us" | "us-central" | "asia-south" | "us-dev" | "europe-west" | "us-west" | "us-east";
29
29
  export type Country = "AD" | "AE" | "AF" | "AL" | "AM" | "AO" | "AR" | "AT" | "AU" | "AW" | "AZ" | "BA" | "BD" | "BE" | "BG" | "BH" | "BJ" | "BO" | "BR" | "BS" | "BT" | "BY" | "BZ" | "CA" | "CF" | "CH" | "CI" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "EC" | "EE" | "EG" | "ES" | "ET" | "EU" | "FI" | "FJ" | "FR" | "GB" | "GE" | "GH" | "GM" | "GR" | "HK" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IN" | "IQ" | "IR" | "IS" | "IT" | "JM" | "JO" | "JP" | "KE" | "KH" | "KR" | "KW" | "KZ" | "LB" | "LI" | "LR" | "LT" | "LU" | "LV" | "MA" | "MC" | "MD" | "ME" | "MG" | "MK" | "ML" | "MM" | "MN" | "MR" | "MT" | "MU" | "MV" | "MX" | "MY" | "MZ" | "NG" | "NL" | "NO" | "NZ" | "OM" | "PA" | "PE" | "PH" | "PK" | "PL" | "PR" | "PT" | "PY" | "QA" | "RANDOM_COUNTRY" | "RO" | "RS" | "RU" | "SA" | "SC" | "SD" | "SE" | "SG" | "SI" | "SK" | "SN" | "SS" | "TD" | "TG" | "TH" | "TM" | "TN" | "TR" | "TT" | "TW" | "UA" | "UG" | "US" | "UY" | "UZ" | "VE" | "VG" | "VN" | "YE" | "ZA" | "ZM" | "ZW" | "ad" | "ae" | "af" | "al" | "am" | "ao" | "ar" | "at" | "au" | "aw" | "az" | "ba" | "bd" | "be" | "bg" | "bh" | "bj" | "bo" | "br" | "bs" | "bt" | "by" | "bz" | "ca" | "cf" | "ch" | "ci" | "cl" | "cm" | "cn" | "co" | "cr" | "cu" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "ec" | "ee" | "eg" | "es" | "et" | "eu" | "fi" | "fj" | "fr" | "gb" | "ge" | "gh" | "gm" | "gr" | "hk" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "in" | "iq" | "ir" | "is" | "it" | "jm" | "jo" | "jp" | "ke" | "kh" | "kr" | "kw" | "kz" | "lb" | "li" | "lr" | "lt" | "lu" | "lv" | "ma" | "mc" | "md" | "me" | "mg" | "mk" | "ml" | "mm" | "mn" | "mr" | "mt" | "mu" | "mv" | "mx" | "my" | "mz" | "ng" | "nl" | "no" | "nz" | "om" | "pa" | "pe" | "ph" | "pk" | "pl" | "pr" | "pt" | "py" | "qa" | "ro" | "rs" | "ru" | "sa" | "sc" | "sd" | "se" | "sg" | "si" | "sk" | "sn" | "ss" | "td" | "tg" | "th" | "tm" | "tn" | "tr" | "tt" | "tw" | "ua" | "ug" | "us" | "uy" | "uz" | "ve" | "vg" | "vn" | "ye" | "za" | "zm" | "zw";
30
30
  export type OperatingSystem = "windows" | "android" | "macos" | "linux" | "ios";
31
31
  export type Platform = "chrome" | "firefox" | "safari" | "edge";
@@ -9,8 +9,8 @@ export { StartHyperAgentTaskParams, StartHyperAgentTaskResponse, HyperAgentTaskS
9
9
  export { StartGeminiComputerUseTaskParams, StartGeminiComputerUseTaskResponse, GeminiComputerUseTaskStatusResponse, GeminiComputerUseTaskResponse, GeminiComputerUseTaskData, GeminiComputerUseStepResponse, GeminiComputerUseApiKeys, GeminiComputerUseTaskMetadata, } from "./agents/gemini-computer-use";
10
10
  export { StartGrokComputerUseTaskParams, StartGrokComputerUseTaskResponse, GrokComputerUseTaskStatusResponse, GrokComputerUseTaskResponse, GrokComputerUseTaskData, GrokComputerUseStepResponse, GrokComputerUseApiKeys, GrokComputerUseTaskMetadata, } from "./agents/grok-computer-use";
11
11
  export { BasicResponse, BrowserMemorySize, 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";
12
- 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";
13
- export { CreateVolumeParams, Volume, VolumeListResponse } from "./volume";
12
+ export { SandboxStatus, SandboxRuntimeTarget, SandboxNetworkPolicy, SandboxNetworkPolicyPatch, SandboxNetworkUpdateResult, Sandbox, SandboxDetail, SandboxVolumeMountType, SandboxVolumeMount, SandboxListParams, SandboxListResponse, SandboxImageSource, SandboxImageSummary, SandboxImageListParams, SandboxImageListResponse, SandboxSnapshotStatus, SandboxSnapshotSummary, SandboxSnapshotListParams, SandboxSnapshotListResponse, SandboxSnapshotDeleteResult, SandboxImageBuildStatus, SandboxImageBuildUpload, SandboxImageBuild, CreateSandboxImageBuildParams, CompleteSandboxImageBuildParams, SandboxImageBuildCreateResult, SandboxImageBuildListParams, SandboxImageBuildListResponse, 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";
13
+ export { CreateVolumeParams, Volume, VolumeListParams, VolumeListResponse } from "./volume";
14
14
  export { CreateProfileParams, ForkProfileParams, ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile";
15
15
  export { CreateExtensionParams, CreateExtensionResponse, ListExtensionsResponse, } from "./extension";
16
16
  export { ExtractJobStatus, BrowserUseTaskStatus, BrowserUseLlm, ClaudeComputerUseLlm, CuaLlm, GeminiComputerUseLlm, GrokComputerUseLlm, GrokReasoningEffort, ScrapeScreenshotFormat, ScrapeJobStatus, CrawlJobStatus, Country, State, ISO639_1, OperatingSystem, Platform, ScrapeFormat, ScrapeWaitUntil, ScrapePageStatus, CrawlPageStatus, RecordingStatus, DownloadsStatus, HyperAgentLlm, HyperAgentTaskStatus, ClaudeComputerUseTaskStatus, CuaTaskStatus, GeminiComputerUseTaskStatus, GrokComputerUseTaskStatus, SessionEventLogType, SessionRegion, BrowserUseVersion, HyperAgentVersion, } from "./constants";
@@ -3,6 +3,19 @@ import type { ReadableStream } from "node:stream/web";
3
3
  import { SessionRegion } from "./constants";
4
4
  import { SessionLaunchState, SessionStatus } from "./session";
5
5
  export type SandboxStatus = SessionStatus;
6
+ export interface SandboxNetworkPolicy {
7
+ allowInternetAccess: boolean;
8
+ allowOut: string[];
9
+ denyOut: string[];
10
+ }
11
+ export interface SandboxNetworkPolicyPatch {
12
+ allowInternetAccess?: boolean;
13
+ allowOut?: string[];
14
+ denyOut?: string[];
15
+ }
16
+ export interface SandboxNetworkUpdateResult {
17
+ network: SandboxNetworkPolicy;
18
+ }
6
19
  export interface SandboxRuntimeTarget {
7
20
  transport: "regional_proxy";
8
21
  host: string;
@@ -30,6 +43,8 @@ export interface Sandbox {
30
43
  cpu?: number | null;
31
44
  memoryMiB?: number | null;
32
45
  diskMiB?: number | null;
46
+ timeoutMinutes?: number | null;
47
+ network?: SandboxNetworkPolicy;
33
48
  runtime: SandboxRuntimeTarget;
34
49
  exposedPorts: SandboxExposeResult[];
35
50
  }
@@ -49,6 +64,9 @@ interface SandboxCreateCommonParams {
49
64
  exposedPorts?: SandboxExposeParams[];
50
65
  mounts?: Record<string, SandboxVolumeMount>;
51
66
  timeoutMinutes?: number;
67
+ allowInternetAccess?: boolean;
68
+ allowOut?: string[];
69
+ denyOut?: string[];
52
70
  }
53
71
  export type CreateSandboxParams = (SandboxCreateCommonParams & {
54
72
  snapshotName: string;
@@ -81,16 +99,28 @@ export interface SandboxListResponse {
81
99
  page: number;
82
100
  perPage: number;
83
101
  }
102
+ export type SandboxImageSource = "public" | "team";
84
103
  export interface SandboxImageSummary {
85
104
  id: string;
86
105
  imageName: string;
87
106
  namespace: string;
107
+ source?: SandboxImageSource;
108
+ imageInit?: Record<string, unknown> | null;
88
109
  uploaded: boolean;
89
110
  createdAt: string;
90
111
  updatedAt: string;
91
112
  }
113
+ export interface SandboxImageListParams {
114
+ source?: SandboxImageSource | SandboxImageSource[];
115
+ search?: string;
116
+ page?: number;
117
+ limit?: number;
118
+ }
92
119
  export interface SandboxImageListResponse {
93
120
  images: SandboxImageSummary[];
121
+ totalCount?: number;
122
+ page?: number;
123
+ perPage?: number;
94
124
  }
95
125
  export type SandboxSnapshotStatus = "creating" | "created" | "failed";
96
126
  export interface SandboxSnapshotSummary {
@@ -101,6 +131,9 @@ export interface SandboxSnapshotSummary {
101
131
  imageName: string;
102
132
  imageId: string;
103
133
  status: SandboxSnapshotStatus;
134
+ vcpus?: number | null;
135
+ memMiB?: number | null;
136
+ diskSizeMiB?: number | null;
104
137
  compatibilityTag: string;
105
138
  metadata: Record<string, unknown>;
106
139
  uploaded: boolean;
@@ -108,12 +141,80 @@ export interface SandboxSnapshotSummary {
108
141
  updatedAt: string;
109
142
  }
110
143
  export interface SandboxSnapshotListParams {
111
- status?: SandboxSnapshotStatus;
144
+ status?: SandboxSnapshotStatus | SandboxSnapshotStatus[];
112
145
  imageName?: string;
146
+ search?: string;
147
+ page?: number;
113
148
  limit?: number;
114
149
  }
115
150
  export interface SandboxSnapshotListResponse {
116
151
  snapshots: SandboxSnapshotSummary[];
152
+ totalCount?: number;
153
+ page?: number;
154
+ perPage?: number;
155
+ }
156
+ export interface SandboxSnapshotDeleteResult {
157
+ deleted: boolean;
158
+ }
159
+ export type SandboxImageBuildStatus = "awaiting_upload" | "upload_verified" | "dispatching" | "building" | "verifying" | "completed" | "failed" | "canceled";
160
+ export interface SandboxImageBuildUpload {
161
+ url: string;
162
+ method: string;
163
+ headers: Record<string, string>;
164
+ objectKey: string;
165
+ expiresInSeconds: number;
166
+ maxUploadBytes: number;
167
+ }
168
+ export interface SandboxImageBuild {
169
+ id: string;
170
+ teamId?: string | null;
171
+ userId?: string | null;
172
+ namespace?: string | null;
173
+ imageName: string;
174
+ imageId?: string | null;
175
+ status: SandboxImageBuildStatus;
176
+ inputBucket?: string | null;
177
+ inputKey?: string | null;
178
+ inputSha256?: string | null;
179
+ inputSizeBytes?: number | null;
180
+ outputBucket?: string | null;
181
+ outputKey?: string | null;
182
+ vmId?: string | null;
183
+ errorCode?: string | null;
184
+ errorMessage?: string | null;
185
+ metadata?: Record<string, unknown> | null;
186
+ completedAt?: string | null;
187
+ createdAt?: string | null;
188
+ updatedAt?: string | null;
189
+ }
190
+ export interface CreateSandboxImageBuildParams {
191
+ imageName: string;
192
+ inputSha256: string;
193
+ inputSizeBytes: number;
194
+ inputFormat?: "rootfs_export_tar_gz";
195
+ sourcePlatform?: "linux/amd64";
196
+ imageConfigUser?: string;
197
+ imageInit?: {
198
+ env?: Record<string, string>;
199
+ command?: string;
200
+ args?: string[];
201
+ };
202
+ }
203
+ export interface CompleteSandboxImageBuildParams {
204
+ inputSha256: string;
205
+ inputSizeBytes: number;
206
+ inputFormat?: "rootfs_export_tar_gz";
207
+ }
208
+ export interface SandboxImageBuildCreateResult {
209
+ build: SandboxImageBuild;
210
+ upload: SandboxImageBuildUpload;
211
+ }
212
+ export interface SandboxImageBuildListParams {
213
+ status?: SandboxImageBuildStatus;
214
+ limit?: number;
215
+ }
216
+ export interface SandboxImageBuildListResponse {
217
+ builds: SandboxImageBuild[];
117
218
  }
118
219
  export interface SandboxMemorySnapshotParams {
119
220
  snapshotName?: string;
@@ -152,7 +253,7 @@ export interface SandboxExecParams {
152
253
  timeoutMs?: number;
153
254
  timeoutSec?: number;
154
255
  runAs?: string;
155
- /** @deprecated Ignored for process APIs. Commands always execute via `/bin/sh -lc` server-side. */
256
+ /** @deprecated Ignored for process APIs. */
156
257
  useShell?: boolean;
157
258
  }
158
259
  export type SandboxExecOptions = Omit<SandboxExecParams, "command">;
@@ -1,6 +1,6 @@
1
1
  import fs from "fs";
2
2
  import { Country, DownloadsStatus, ISO639_1, OperatingSystem, Platform, RecordingStatus, SessionEventLogType, SessionRegion, State } from "./constants";
3
- export type SessionStatus = "active" | "closed" | "error";
3
+ export type SessionStatus = "active" | "closed" | "close-error" | "error";
4
4
  export type BrowserMemorySize = "small" | "medium" | "large";
5
5
  export interface BasicResponse {
6
6
  success: boolean;
@@ -7,6 +7,14 @@ export interface Volume {
7
7
  size?: number;
8
8
  transferAmount?: number;
9
9
  }
10
+ export interface VolumeListParams {
11
+ search?: string;
12
+ page?: number;
13
+ limit?: number;
14
+ }
10
15
  export interface VolumeListResponse {
11
16
  volumes: Volume[];
17
+ totalCount?: number;
18
+ page?: number;
19
+ perPage?: number;
12
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbrowser/sdk",
3
- "version": "0.91.8",
3
+ "version": "0.92.0",
4
4
  "description": "Node SDK for Hyperbrowser API",
5
5
  "author": "",
6
6
  "repository": {
@@ -41,6 +41,9 @@
41
41
  "ai"
42
42
  ],
43
43
  "dependencies": {
44
+ "@types/node": "^22.9.1",
45
+ "@types/node-fetch": "^2.6.4",
46
+ "@types/ws": "^8.18.1",
44
47
  "form-data": "^4.0.1",
45
48
  "node-fetch": "2.7.0",
46
49
  "ws": "^8.19.0",
@@ -48,9 +51,6 @@
48
51
  "zod-to-json-schema": "^3.25.0"
49
52
  },
50
53
  "devDependencies": {
51
- "@types/node": "^22.9.1",
52
- "@types/node-fetch": "^2.6.4",
53
- "@types/ws": "^8.18.1",
54
54
  "@typescript-eslint/eslint-plugin": "^8.15.0",
55
55
  "@typescript-eslint/parser": "^8.15.0",
56
56
  "dotenv": "^17.3.1",