@hyperbrowser/sdk 1.5.0 → 1.5.2

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.
@@ -62,6 +62,18 @@ export declare const createCustomerKey: (key: CustomerKeyInput, options?: Custom
62
62
  export declare const secretEnvelopeDigest: (envelope: string) => string;
63
63
  /** @internal Checks that `key` looks like a CustomerKey before anything is sent. */
64
64
  export declare const assertCustomerKey: (key: unknown, what?: string) => CustomerKey;
65
+ /**
66
+ * @internal Checks that `keys` is a CustomerKey or a list of them before
67
+ * anything is sent. An empty list passes only with `allowEmpty`: an up-front
68
+ * check must not reject a call that never needs a key (an empty vault, or a
69
+ * rewrap with nothing to rewrap); `customerKeyFor` still rejects it when a
70
+ * key is actually needed.
71
+ */
72
+ export declare const assertCustomerKeys: (keys: unknown, what?: string, { allowEmpty }?: {
73
+ allowEmpty?: boolean;
74
+ }) => readonly CustomerKey[];
75
+ /** @internal Wraps `innerEnvelope` and checks that `wrap()` returned a non-empty string. */
76
+ export declare const wrapEnvelope: (customerKey: CustomerKey, innerEnvelope: string, encryptionContext: string) => Promise<string>;
65
77
  /**
66
78
  * @internal Unwrap a wrapped version with the key among `keys` that wrapped
67
79
  * it, and check the result is the inner envelope the version holds.
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.customerKeyFor = exports.unwrapVersion = exports.assertCustomerKey = exports.secretEnvelopeDigest = exports.createCustomerKey = exports.assertCustomerKeyId = void 0;
6
+ exports.customerKeyFor = exports.unwrapVersion = exports.wrapEnvelope = exports.assertCustomerKeys = exports.assertCustomerKey = exports.secretEnvelopeDigest = exports.createCustomerKey = exports.assertCustomerKeyId = void 0;
7
7
  const crypto_1 = __importDefault(require("crypto"));
8
8
  const error_1 = require("./error");
9
9
  const ENC = "A256GCM";
@@ -362,6 +362,38 @@ const assertCustomerKey = (key, what = "customerKey") => {
362
362
  return candidate;
363
363
  };
364
364
  exports.assertCustomerKey = assertCustomerKey;
365
+ /**
366
+ * @internal Checks that `keys` is a CustomerKey or a list of them before
367
+ * anything is sent. An empty list passes only with `allowEmpty`: an up-front
368
+ * check must not reject a call that never needs a key (an empty vault, or a
369
+ * rewrap with nothing to rewrap); `customerKeyFor` still rejects it when a
370
+ * key is actually needed.
371
+ */
372
+ const assertCustomerKeys = (keys, what = "customerKey", { allowEmpty = false } = {}) => {
373
+ if (!Array.isArray(keys)) {
374
+ return [(0, exports.assertCustomerKey)(keys, what)];
375
+ }
376
+ if (keys.length === 0 && !allowEmpty) {
377
+ throw new error_1.HyperbrowserError(`Pass at least one customer key as ${what}`, {
378
+ code: "invalid_request",
379
+ retryable: false,
380
+ });
381
+ }
382
+ return keys.map((key, index) => (0, exports.assertCustomerKey)(key, `${what}[${index}]`));
383
+ };
384
+ exports.assertCustomerKeys = assertCustomerKeys;
385
+ /** @internal Wraps `innerEnvelope` and checks that `wrap()` returned a non-empty string. */
386
+ const wrapEnvelope = async (customerKey, innerEnvelope, encryptionContext) => {
387
+ const envelope = await customerKey.wrap(innerEnvelope, encryptionContext);
388
+ if (typeof envelope !== "string" || !envelope) {
389
+ throw new error_1.HyperbrowserError("The customer key's wrap() must return the envelope as a string", {
390
+ code: "invalid_request",
391
+ retryable: false,
392
+ });
393
+ }
394
+ return envelope;
395
+ };
396
+ exports.wrapEnvelope = wrapEnvelope;
365
397
  /**
366
398
  * @internal Unwrap a wrapped version with the key among `keys` that wrapped
367
399
  * it, and check the result is the inner envelope the version holds.
@@ -377,14 +409,7 @@ const unwrapVersion = async (wrapped, keys, label) => {
377
409
  exports.unwrapVersion = unwrapVersion;
378
410
  /** @internal The key among `keys` that wrapped an envelope with this `kid`. */
379
411
  const customerKeyFor = (keys, kid, label) => {
380
- const list = (Array.isArray(keys) ? keys : [keys]);
381
- if (list.length === 0) {
382
- throw new error_1.HyperbrowserError("Pass at least one customer key", {
383
- code: "invalid_request",
384
- retryable: false,
385
- });
386
- }
387
- list.forEach((key, index) => (0, exports.assertCustomerKey)(key, `customerKey[${index}]`));
412
+ const list = (0, exports.assertCustomerKeys)(keys);
388
413
  const key = list.find((candidate) => candidate.kid === kid);
389
414
  if (!key) {
390
415
  throw new error_1.HyperbrowserError(`${label} was wrapped with customer key ${JSON.stringify(kid)}, which none of the keys given has`, { code: "customer_key_mismatch", retryable: false });
@@ -13,7 +13,14 @@ const getRequestId = (response) => {
13
13
  /** The API's machine codes, such as SECRET_NOT_FOUND. */
14
14
  const SERVER_ERROR_CODE_PATTERN = /^[A-Z][A-Z0-9]*(_[A-Z0-9]+)+$/;
15
15
  /** Codes whose retryable status default (such as 503) would be wrong. */
16
- const NON_RETRYABLE_ERROR_CODES = new Set(["SECRETS_NOT_CONFIGURED"]);
16
+ const NON_RETRYABLE_ERROR_CODES = new Set([
17
+ "SECRETS_ADMIN_REQUIRED",
18
+ "SECRETS_NOT_CONFIGURED",
19
+ "SECRET_KEY_UNAVAILABLE",
20
+ "SECRET_DECRYPT_FAILED",
21
+ "SECRET_ENVELOPE_INVALID",
22
+ "SECRET_VALUE_INVALID",
23
+ ]);
17
24
  /** The sandbox and secret an error is about, when the API names them. */
18
25
  const errorMessageContext = (errorData) => {
19
26
  let context = "";
@@ -25,6 +25,7 @@ export declare class SandboxHandle {
25
25
  get diskMiB(): number | null | undefined;
26
26
  get timeoutMinutes(): number | null | undefined;
27
27
  get exposedPorts(): SandboxExposeResult[];
28
+ get startupSecrets(): SandboxDetail["startupSecrets"];
28
29
  toJSON(): SandboxDetail;
29
30
  info(): Promise<SandboxDetail>;
30
31
  refresh(): Promise<SandboxHandle>;
@@ -48,7 +49,6 @@ export declare class SandboxHandle {
48
49
  forceRefresh?: boolean;
49
50
  }): Promise<SandboxRuntimeSession>;
50
51
  private ensureRuntimeSession;
51
- private applyRuntimeSession;
52
52
  private clearRuntimeSession;
53
53
  private assertRuntimeAvailable;
54
54
  private static toRuntimeSession;
@@ -256,6 +256,9 @@ class SandboxHandle {
256
256
  get exposedPorts() {
257
257
  return (this.detail.exposedPorts ?? []).map((entry) => ({ ...entry }));
258
258
  }
259
+ get startupSecrets() {
260
+ return this.detail.startupSecrets?.map((entry) => ({ ...entry }));
261
+ }
259
262
  toJSON() {
260
263
  return { ...this.detail };
261
264
  }
@@ -379,17 +382,6 @@ class SandboxHandle {
379
382
  }
380
383
  return { ...this.runtimeSession };
381
384
  }
382
- applyRuntimeSession(session) {
383
- this.runtimeSession = { ...session };
384
- this.detail = {
385
- ...this.detail,
386
- status: session.status,
387
- region: session.region,
388
- runtime: session.runtime,
389
- token: session.token,
390
- tokenExpiresAt: session.tokenExpiresAt,
391
- };
392
- }
393
385
  clearRuntimeSession(status = this.detail.status) {
394
386
  this.runtimeSession = null;
395
387
  this.detail = {
@@ -222,6 +222,7 @@ class SecretsService extends base_1.BaseService {
222
222
  async unwrap(secret, customerKey, options = {}) {
223
223
  const version = options?.version ?? "latest";
224
224
  assertVersion(version, true);
225
+ (0, customer_key_1.assertCustomerKeys)(customerKey);
225
226
  try {
226
227
  const resolved = await this.resolve(secret);
227
228
  const wrapped = await this.fetchWrapped(resolved.id, version);
@@ -240,6 +241,7 @@ class SecretsService extends base_1.BaseService {
240
241
  */
241
242
  async rewrap(secret, params) {
242
243
  const { from, to, versions } = params ?? {};
244
+ (0, customer_key_1.assertCustomerKeys)(from, "from", { allowEmpty: true });
243
245
  (0, customer_key_1.assertCustomerKey)(to, "to");
244
246
  if (versions !== undefined) {
245
247
  if (!Array.isArray(versions))
@@ -258,7 +260,7 @@ class SecretsService extends base_1.BaseService {
258
260
  const wrapped = await this.fetchWrapped(detail.id, version);
259
261
  const label = `Version ${version} of secret ${detail.name}`;
260
262
  const inner = await (0, customer_key_1.unwrapVersion)(wrapped, from, label);
261
- const envelope = await to.wrap(inner, detail.encryptionContext);
263
+ const envelope = await (0, customer_key_1.wrapEnvelope)(to, inner, detail.encryptionContext);
262
264
  rewrapped.push(await this.putWrapping(detail.id, version, { envelope, innerDigest: wrapped.innerDigest }));
263
265
  }
264
266
  return rewrapped;
@@ -335,7 +337,7 @@ class SecretsService extends base_1.BaseService {
335
337
  const body = customerKey === undefined
336
338
  ? { envelope: inner }
337
339
  : {
338
- envelope: await customerKey.wrap(inner, secret.encryptionContext),
340
+ envelope: await (0, customer_key_1.wrapEnvelope)(customerKey, inner, secret.encryptionContext),
339
341
  innerDigest: (0, customer_key_1.secretEnvelopeDigest)(inner),
340
342
  innerKid: sealer.kid,
341
343
  };
@@ -244,12 +244,53 @@ class SessionsService extends base_1.BaseService {
244
244
  */
245
245
  async uploadFile(id, fileOptions) {
246
246
  const { fileInput, fileName } = fileOptions;
247
+ // Our own file stream, destroyed when the upload settles. A stream the
248
+ // caller passes in stays theirs and is never destroyed here.
249
+ let ownedStream;
250
+ let sourceStream;
251
+ let streamError;
252
+ let rejectStreamError;
253
+ const streamFailure = new Promise((_, reject) => {
254
+ rejectStreamError = reject;
255
+ });
256
+ streamFailure.catch(() => { });
257
+ // Aborts the in-flight request when the body fails, so the socket is not
258
+ // held open until the request timeout.
259
+ const controller = new AbortController();
260
+ let readLabel = "";
261
+ // form-data re-emits a source stream's "error" on the FormData, and
262
+ // node-fetch pipes the body without an error listener, so an unlistened
263
+ // FormData error is thrown as an uncaught exception. Every FormData body
264
+ // therefore gets a listener, whatever the input type.
265
+ const onStreamError = (error) => {
266
+ if (!streamError) {
267
+ streamError = new client_1.HyperbrowserError(`Failed to read file ${readLabel}: ${error.message}`, undefined);
268
+ }
269
+ controller.abort();
270
+ rejectStreamError?.(streamError);
271
+ };
272
+ const buildBody = (file, filename) => {
273
+ const formData = new form_data_1.default();
274
+ formData.on("error", onStreamError);
275
+ if (!Buffer.isBuffer(file)) {
276
+ sourceStream = file;
277
+ file.on("error", onStreamError);
278
+ }
279
+ formData.append("file", file, { filename });
280
+ return {
281
+ method: "POST",
282
+ body: formData,
283
+ headers: formData.getHeaders(),
284
+ signal: controller.signal,
285
+ };
286
+ };
247
287
  try {
248
288
  let fetchOptions;
249
289
  if (typeof fileInput === "string") {
250
290
  let stats;
251
291
  try {
252
292
  stats = await fs_1.promises.stat(fileInput);
293
+ await fs_1.promises.access(fileInput, fs_1.constants.R_OK);
253
294
  }
254
295
  catch (error) {
255
296
  if (error.code === "ENOENT") {
@@ -263,61 +304,47 @@ class SessionsService extends base_1.BaseService {
263
304
  if (!stats.isFile()) {
264
305
  throw new client_1.HyperbrowserError(`Path is not a file: ${fileInput}`, undefined);
265
306
  }
266
- const formData = new form_data_1.default();
267
- const fileStream = (0, fs_1.createReadStream)(fileInput);
268
- const fileBaseName = fileName || path.basename(fileInput);
269
- fileStream.on("error", (error) => {
270
- throw new client_1.HyperbrowserError(`Failed to read file ${fileInput}: ${error.message}`, undefined);
271
- });
272
- formData.append("file", fileStream, {
273
- filename: fileBaseName,
274
- });
275
- fetchOptions = {
276
- method: "POST",
277
- body: formData,
278
- headers: formData.getHeaders(),
279
- };
307
+ readLabel = `at ${fileInput}`;
308
+ ownedStream = (0, fs_1.createReadStream)(fileInput);
309
+ fetchOptions = buildBody(ownedStream, fileName || path.basename(fileInput));
280
310
  }
281
311
  else if (this.isReadableStream(fileInput)) {
282
- const formData = new form_data_1.default();
283
312
  let tmpFileName = fileName || `file-${Date.now()}`;
284
313
  if (fileInput.path && typeof fileInput.path === "string" && !fileName) {
285
314
  tmpFileName = path.basename(fileInput.path);
286
315
  }
287
- formData.append("file", fileInput, {
288
- filename: tmpFileName,
289
- });
290
- fetchOptions = {
291
- method: "POST",
292
- body: formData,
293
- headers: formData.getHeaders(),
294
- };
316
+ readLabel = `stream ${tmpFileName}`;
317
+ fetchOptions = buildBody(fileInput, tmpFileName);
295
318
  }
296
319
  else if (Buffer.isBuffer(fileInput)) {
297
320
  if (!fileName) {
298
321
  throw new client_1.HyperbrowserError("fileName is required when uploading Buffer data", undefined);
299
322
  }
300
- const formData = new form_data_1.default();
301
- formData.append("file", fileInput, {
302
- filename: fileName,
303
- });
304
- fetchOptions = {
305
- method: "POST",
306
- body: formData,
307
- headers: formData.getHeaders(),
308
- };
323
+ readLabel = `buffer ${fileName}`;
324
+ fetchOptions = buildBody(fileInput, fileName);
309
325
  }
310
326
  else {
311
327
  throw new client_1.HyperbrowserError("Unsupported file input type. Please provide a file path string, ReadStream, or Buffer.", undefined);
312
328
  }
313
- return await this.request(`/session/${id}/uploads`, fetchOptions);
329
+ const requestPromise = this.request(`/session/${id}/uploads`, fetchOptions);
330
+ requestPromise.catch(() => { });
331
+ return await Promise.race([requestPromise, streamFailure]);
314
332
  }
315
333
  catch (error) {
334
+ if (streamError) {
335
+ throw streamError;
336
+ }
316
337
  if (error instanceof client_1.HyperbrowserError) {
317
338
  throw error;
318
339
  }
319
340
  throw new client_1.HyperbrowserError(`Failed to upload file for session ${id}: ${error}`, undefined);
320
341
  }
342
+ finally {
343
+ if (sourceStream && sourceStream !== ownedStream) {
344
+ sourceStream.removeListener("error", onStreamError);
345
+ }
346
+ ownedStream?.destroy();
347
+ }
321
348
  }
322
349
  /**
323
350
  * Helper method to check if input is a readable stream
@@ -76,6 +76,7 @@ class VaultsService extends base_1.BaseService {
76
76
  * `SECRET_VAULT_CHANGED`: unwrap the vault again.
77
77
  */
78
78
  async unwrap(vault, customerKey) {
79
+ (0, customer_key_1.assertCustomerKeys)(customerKey, "customerKey", { allowEmpty: true });
79
80
  const wrapped = await this.getWrapped(vault);
80
81
  const unwrapped = {};
81
82
  for (const [env, entry] of Object.entries(wrapped.entries ?? {})) {
@@ -65,10 +65,10 @@ WebsiteCrawlTool.openaiToolDefinition = openai_1.CRAWL_TOOL_OPENAI;
65
65
  WebsiteCrawlTool.anthropicToolDefinition = anthropic_1.CRAWL_TOOL_ANTHROPIC;
66
66
  class WebsiteExtractTool {
67
67
  static async runnable(hb, params) {
68
- if (params.schema && typeof params.schema === "string") {
69
- params.schema = JSON.parse(params.schema);
70
- }
71
- const resp = await hb.extract.startAndWait(params);
68
+ const requestParams = params.schema && typeof params.schema === "string"
69
+ ? { ...params, schema: JSON.parse(params.schema) }
70
+ : { ...params };
71
+ const resp = await hb.extract.startAndWait(requestParams);
72
72
  return resp.data ? JSON.stringify(resp.data) : "";
73
73
  }
74
74
  }
@@ -45,10 +45,10 @@ export type ClaudeComputerUseReasoningEffort = "low" | "medium" | "high" | "xhig
45
45
  export type CuaLlm = "computer-use-preview" | "gpt-6-astra" | "gpt-6.1-sol" | "gpt-6.1-terra" | "gpt-6-sol" | "gpt-6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | "gpt-5.5" | "gpt-5.4" | "gpt-5.4-mini";
46
46
  export type CuaReasoningEffort = "none" | "low" | "medium" | "high" | "xhigh" | "max";
47
47
  export type HyperAgentVersion = "0.8.0" | "1.1.0";
48
- export type HyperAgentLlm = "gpt-6-luna" | "gpt-5.6-luna" | "gpt-5.5" | "gpt-5.2" | "gpt-5.1" | "gpt-5" | "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-sonnet-5" | "claude-sonnet-4-6" | "claude-haiku-5-5"
48
+ export type HyperAgentLlm = "gpt-6.1-terra" | "gpt-6-luna" | "gpt-5.6-luna" | "gpt-5.5" | "gpt-5.2" | "gpt-5.1" | "gpt-5" | "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-sonnet-5" | "claude-sonnet-4-6" | "claude-haiku-5-5"
49
49
  /** @deprecated Retires November 30, 2026; use "claude-sonnet-5". */
50
50
  | "claude-sonnet-4-5" | "gemini-2.5-flash" | "gemini-3.8-flash" | "gemini-3.7-flash" | "gemini-3-flash-preview";
51
- export type GeminiComputerUseLlm = "gemini-4-argon" | "gemini-3.8-flash" | "gemini-3.7-flash" | "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";
51
+ export type GeminiComputerUseLlm = "gemini-4-carbon" | "gemini-4-argon" | "gemini-3.8-flash" | "gemini-3.7-flash" | "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";
52
52
  export type GeminiComputerUseReasoningEffort = "minimal" | "low" | "medium" | "high";
53
53
  export type GrokComputerUseLlm = "grok-4.7" | "grok-4.6" | "grok-4.5";
54
54
  export type GrokReasoningEffort = "low" | "medium" | "high";
@@ -1,7 +1,7 @@
1
1
  export { HyperbrowserConfig } from "./config";
2
2
  export * from "./webmcp";
3
3
  export { StartCrawlJobParams, StartCrawlJobResponse, CrawledPage, CrawlJobResponse, GetCrawlJobParams, CrawlJobStatusResponse, } from "./crawl";
4
- export { StartScrapeJobParams, StartScrapeJobResponse, ScrapeJobData, ScrapeJobResponse, ScrapeOptions, ScrapeJobStatusResponse, BatchScrapeJobStatusResponse, StorageStateOptions, } from "./scrape";
4
+ export { StartScrapeJobParams, StartScrapeJobResponse, ScrapeJobData, ScrapeJobResponse, ScrapeOptions, ScrapeJobStatusResponse, StartBatchScrapeJobParams, StartBatchScrapeJobResponse, BatchScrapeJobStatusResponse, BatchScrapeJobResponse, GetBatchScrapeJobParams, ScrapedPage, ScreenshotOptions, StorageStateOptions, } from "./scrape";
5
5
  export { StartExtractJobParams, StartExtractJobResponse, ExtractJobResponse, ExtractJobStatusResponse, ExtractJobMetadata, } from "./extract";
6
6
  export { StartBrowserUseTaskParams, StartBrowserUseTaskResponse, BrowserUseTaskStatusResponse, BrowserUseTaskResponse, BrowserUseTaskData, BrowserUseApiKeys, BrowserUseTaskMetadata, BrowserUseStep, BrowserUseAgentBrain, BrowserUseAgentOutput, BrowserUseActionResult, BrowserUseStepMetadata, BrowserUseTabInfo, BrowserUseBrowserStateHistory, BrowserUseAgentHistory, BrowserUseAgentOutputV0710, BrowserUseActionResultV0710, BrowserUseBrowserStateHistoryV0710, BrowserUseStepMetadataV0710, BrowserUseAgentHistoryV0710, BrowserUseAgentHistoryLatest, } from "./agents/browser-use";
7
7
  export { StartClaudeComputerUseTaskParams, StartClaudeComputerUseTaskResponse, ClaudeComputerUseTaskStatusResponse, ClaudeComputerUseTaskResponse, ClaudeComputerUseTaskData, ClaudeComputerUseStepResponse, ClaudeComputerUseApiKeys, ClaudeComputerUseTaskMetadata, } from "./agents/claude-computer-use";
@@ -11,7 +11,7 @@ export { StartGeminiComputerUseTaskParams, StartGeminiComputerUseTaskResponse, G
11
11
  export { StartGrokComputerUseTaskParams, StartGrokComputerUseTaskResponse, GrokComputerUseTaskStatusResponse, GrokComputerUseTaskResponse, GrokComputerUseTaskData, GrokComputerUseStepResponse, GrokComputerUseApiKeys, GrokComputerUseTaskMetadata, } from "./agents/grok-computer-use";
12
12
  export { StartMetaComputerUseTaskParams, StartMetaComputerUseTaskResponse, MetaComputerUseTaskStatusResponse, MetaComputerUseTaskResponse, MetaComputerUseTaskData, MetaComputerUseStepResponse, MetaComputerUseStepError, MetaComputerUseStepIncompleteDetails, MetaComputerUseStepReasoning, MetaComputerUseApiKeys, MetaComputerUseTaskMetadata, } from "./agents/meta-computer-use";
13
13
  export { StartJevComputerUseTaskParams, StartJevComputerUseTaskResponse, JevComputerUseTaskStatusResponse, JevComputerUseTaskResponse, JevComputerUseTaskData, JevComputerUseStepResponse, JevComputerUseApiKeys, JevComputerUseTaskMetadata, } from "./agents/jev-computer-use";
14
- 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, SessionWebBotAuth, SessionCreditBreakdown, StartSessionFromSnapshotParams, WebBotAuthParams, ProxyRoute, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, UpdateSessionScreenParams, UpdateSessionSolveCaptchasParams, UpdateSessionSolveCaptchasResponse, } from "./session";
14
+ export { BasicResponse, BrowserMemorySize, SessionStatus, Session, SessionDetail, SessionGetParams, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionProfile, CaptchaEvaluationPageResult, CaptchaEvaluationParams, CaptchaEvaluationResponse, CaptchaEvaluationTarget, CaptchaEvaluationType, CaptchaSolverType, CreateSessionParams, CreateSessionSnapshotResponse, SessionRecording, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, SessionWebBotAuth, SessionCreditBreakdown, StartSessionFromSnapshotParams, WebBotAuthParams, ProxyRoute, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, UpdateSessionScreenParams, UpdateSessionSolveCaptchasParams, UpdateSessionSolveCaptchasResponse, } from "./session";
15
15
  export { SandboxStatus, SandboxRuntimeTarget, SandboxNetworkPolicy, SandboxNetworkPolicyPatch, SandboxNetworkUpdateResult, Sandbox, SandboxDetail, SandboxVolumeMountType, SandboxVolumeMount, SandboxSecretReference, SandboxStoredSecretReference, SandboxSecrets, SandboxVaultSource, SandboxResolvedSecret, SandboxStoredSecretBinding, SandboxOnePasswordBinding, SandboxSecretSource, SandboxOnePassword, SandboxOnePasswordField, SandboxListParams, SandboxListResponse, SandboxImageSource, SandboxImageSummary, SandboxImageListParams, SandboxImageListResponse, SandboxSnapshotStatus, SandboxSnapshotSummary, SandboxSnapshotListParams, SandboxSnapshotListResponse, SandboxSnapshotDeleteResult, SandboxImageDeleteResult, SandboxImageInit, SandboxImageBuildStatus, SandboxImageBuildInputFormat, SandboxImageBuildSourcePlatform, SandboxImageBuildUpload, SandboxImageBuild, SandboxBuildContextBundle, SandboxBuildContextMode, SandboxBuildContextManifest, SandboxDockerImageConfig, SandboxDockerImageLayer, SandboxDockerImageManifest, CreateSandboxImageBuildParams, ReuseSandboxDockerImageParams, CompleteSandboxImageBuildParams, SandboxImageBuildCreateResult, SandboxDockerImageReuseResult, SandboxImageBuildResolutionOutcome, SandboxImageBuildResolution, SandboxImageBuildWaitOptions, BuildSandboxImageFromDockerImageOptions, BuildSandboxImageFromDockerfileOptions, GetOrBuildSandboxImageOptions, SandboxImageBuildListParams, SandboxImageBuildListResponse, CreateSandboxParams, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxExposeParams, SandboxExposeResult, SandboxUnexposeResult, SandboxProcessStatus, SandboxExecParams, SandboxExecOptions, SandboxProcessSummary, SandboxProcessResult, SandboxProcessListParams, SandboxProcessListResponse, SandboxProcessWaitParams, SandboxProcessSignal, SandboxProcessStdinParams, SandboxProcessOutputEvent, SandboxProcessExitEvent, 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";
16
16
  export { CreateVolumeParams, Volume, VolumeListParams, VolumeListResponse, VolumeDeleteResult, } from "./volume";
17
17
  export { SecretValue, SecretType, SecretProtection, SecretBrowserMetadata, SecretMetadata, UpdateSecretMetadata, SecretsPublicKey, SecretsPublicKeyJwk, Secret, SecretVersion, SecretDetail, CreateSecretParams, UpdateSecretParams, SecretListParams, SecretListResponse, SecretDeleteResult, SecretVersionDeleteResult, WrappedSecretVersion, UnwrappedSecretReference, UnwrapSecretOptions, AddSecretVersionOptions, ReplaceSecretVersionWrappingParams, RewrapSecretParams, } from "./secret";
@@ -26,6 +26,7 @@ export { TeamCreditInfo } from "./team";
26
26
  export { ComputerAction, Coordinate, ClickActionParams, DragActionParams, PressKeysActionParams, MoveMouseActionParams, ScreenshotActionParams, CursorPositionActionParams, ScrollAtCursorActionParams, ScrollActionParams, TypeTextActionParams, ComputerActionParams, ComputerActionResponse, ComputerActionMouseButton, ComputerActionResponseData, HoldKeyActionParams, MouseDownActionParams, MouseUpActionParams, GetClipboardTextActionParams, PutSelectionTextActionParams, ComputerActionResponseDataClipboardText, ListWindowsActionParams, ComputerActionWindow, ComputerActionResponseDataListWindows, ComputerActionResponseDataCursorPosition, } from "./computer-action";
27
27
  export { FetchParams, FetchResponse, FetchResponseData, FetchStatus } from "./web/fetch";
28
28
  export { StartBatchFetchJobParams, GetBatchFetchJobParams, StartBatchFetchJobResponse, BatchFetchJobStatusResponse, BatchFetchJobResponse, BatchFetchJobStatus, } from "./web/batch-fetch";
29
+ export { WebCrawlJobStatus, WebCrawlOptions, StartWebCrawlJobParams, GetWebCrawlJobParams, StartWebCrawlJobResponse, WebCrawlJobStatusResponse, WebCrawlJobResponse, } from "./web/crawl";
29
30
  export { WebSearchParams, WebSearchResponse, WebSearchResponseData, WebSearchResultItem, WebSearchFilters, WebSearchLocation, WebSearchFiletype, WebSearchStatus, } from "./web/search";
30
31
  export { FetchStealthMode, FetchSanitizeMode, FetchWaitUntil, FetchScreenshotFormat, PageStatus, FetchOutputScreenshotOptions, FetchStorageStateOptions, FetchBrowserLocationOptions, PageData, FetchOutputMarkdown, FetchOutputHtml, FetchOutputLinks, FetchOutputScreenshot, FetchOutputJsonOptions, FetchOutputJson, FetchOutputBranding, FetchOutputFormat, FetchOutputOptions, FetchBrowserOptions, FetchNavigationOptions, FetchCacheOptions, } from "./web/common";
31
32
  export { BrandingProfile, BrandingColors, BrandingFont, BrandingFontRole, BrandingTypography, BrandingFontFamilies, BrandingFontStacks, BrandingFontSizes, BrandingSpacing, BrandingComponents, BrandingButtonStyle, BrandingInputStyle, BrandingBorderRadiusCorners, BrandingImages, BrandingPersonality, BrandingPersonalityTone, BrandingPersonalityEnergy, BrandingDesignSystem, BrandingDesignFramework, BrandingConfidence, BrandingColorScheme, } from "./web/branding";
@@ -9,6 +9,7 @@ export interface BasicResponse {
9
9
  export interface SessionProfile {
10
10
  id: string;
11
11
  persistChanges?: boolean;
12
+ persistNetworkCache?: boolean;
12
13
  }
13
14
  /** How a session signs its requests with Web Bot Auth. */
14
15
  export interface SessionWebBotAuth {
@@ -48,6 +49,8 @@ export interface SessionLaunchState {
48
49
  enableAlwaysOpenPdfExternally?: boolean;
49
50
  appendTimestampToDownloads?: boolean;
50
51
  disablePostQuantumKeyAgreement?: boolean;
52
+ /** @deprecated Discontinued: WebGL fingerprinting was removed from the browser, and the server ignores this option. Kept so existing code still type-checks. */
53
+ enableWebglFingerprinting?: boolean;
51
54
  }
52
55
  export interface SessionCreditBreakdown {
53
56
  creditsUsed: number | null;
@@ -66,6 +69,8 @@ export interface Session {
66
69
  launchState?: SessionLaunchState | null;
67
70
  creditsUsed: number | null;
68
71
  creditBreakdown: SessionCreditBreakdown;
72
+ duration?: number;
73
+ proxyDataConsumed?: string;
69
74
  }
70
75
  export interface SessionDetail extends Session {
71
76
  wsEndpoint: string;
@@ -215,6 +220,7 @@ export interface CreateSessionParams {
215
220
  saveDownloads?: boolean;
216
221
  imageCaptchaParams?: Array<ImageCaptchaParam>;
217
222
  timeoutMinutes?: number;
223
+ /** @deprecated Discontinued: WebGL fingerprinting was removed from the browser, and the server ignores this option. Kept so existing code still type-checks. */
218
224
  enableWebglFingerprinting?: boolean;
219
225
  enableWindowManager?: boolean;
220
226
  enableWindowManagerTaskbar?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbrowser/sdk",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Node SDK for Hyperbrowser API",
5
5
  "author": "",
6
6
  "repository": {