@hyperbrowser/sdk 0.88.3 → 0.89.1
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/README.md +5 -3
- package/dist/sandbox/files.d.ts +5 -1
- package/dist/sandbox/files.js +41 -18
- package/dist/sandbox/process.d.ts +3 -1
- package/dist/sandbox/process.js +34 -6
- package/dist/services/sandboxes.d.ts +3 -2
- package/dist/services/sandboxes.js +5 -7
- package/dist/types/crawl.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/sandbox.d.ts +4 -0
- package/dist/types/scrape.d.ts +2 -2
- package/dist/types/web/common.d.ts +2 -2
- package/dist/types/web/fetch.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -192,9 +192,11 @@ const main = async () => {
|
|
|
192
192
|
await sandbox.files.writeText("/tmp/watch-demo.txt", "watch me");
|
|
193
193
|
await watch.stop();
|
|
194
194
|
|
|
195
|
-
const proc = await sandbox.processes.start(
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
const proc = await sandbox.processes.start(
|
|
196
|
+
"echo process-started && sleep 1 && echo process-finished",
|
|
197
|
+
{
|
|
198
|
+
runAs: "root",
|
|
199
|
+
}
|
|
198
200
|
});
|
|
199
201
|
|
|
200
202
|
for await (const event of proc.stream()) {
|
package/dist/sandbox/files.d.ts
CHANGED
|
@@ -51,7 +51,9 @@ export declare class SandboxFilesApi {
|
|
|
51
51
|
private readonly transport;
|
|
52
52
|
private readonly getConnectionInfo;
|
|
53
53
|
private readonly runtimeProxyOverride?;
|
|
54
|
-
|
|
54
|
+
private readonly defaultRunAs?;
|
|
55
|
+
constructor(transport: RuntimeTransport, getConnectionInfo: () => Promise<RuntimeConnectionInfo>, runtimeProxyOverride?: string | undefined, defaultRunAs?: string | undefined);
|
|
56
|
+
withRunAs(runAs?: string): SandboxFilesApi;
|
|
55
57
|
exists(path: string): Promise<boolean>;
|
|
56
58
|
getInfo(path: string): Promise<SandboxFileInfo>;
|
|
57
59
|
list(path: string, options?: SandboxFileListOptions): Promise<SandboxFileInfo[]>;
|
|
@@ -88,5 +90,7 @@ export declare class SandboxFilesApi {
|
|
|
88
90
|
downloadUrl(path: string, options?: Omit<SandboxPresignFileParams, "path">): Promise<SandboxPresignedUrl>;
|
|
89
91
|
private readWire;
|
|
90
92
|
private writeSingle;
|
|
93
|
+
private withRunAsQuery;
|
|
94
|
+
private withRunAsBody;
|
|
91
95
|
}
|
|
92
96
|
export {};
|
package/dist/sandbox/files.js
CHANGED
|
@@ -248,10 +248,15 @@ class SandboxWatchDirHandle {
|
|
|
248
248
|
}
|
|
249
249
|
exports.SandboxWatchDirHandle = SandboxWatchDirHandle;
|
|
250
250
|
class SandboxFilesApi {
|
|
251
|
-
constructor(transport, getConnectionInfo, runtimeProxyOverride) {
|
|
251
|
+
constructor(transport, getConnectionInfo, runtimeProxyOverride, defaultRunAs) {
|
|
252
252
|
this.transport = transport;
|
|
253
253
|
this.getConnectionInfo = getConnectionInfo;
|
|
254
254
|
this.runtimeProxyOverride = runtimeProxyOverride;
|
|
255
|
+
this.defaultRunAs = defaultRunAs;
|
|
256
|
+
}
|
|
257
|
+
withRunAs(runAs) {
|
|
258
|
+
const normalized = runAs?.trim();
|
|
259
|
+
return new SandboxFilesApi(this.transport, this.getConnectionInfo, this.runtimeProxyOverride, normalized ? normalized : undefined);
|
|
255
260
|
}
|
|
256
261
|
async exists(path) {
|
|
257
262
|
try {
|
|
@@ -269,17 +274,17 @@ class SandboxFilesApi {
|
|
|
269
274
|
}
|
|
270
275
|
}
|
|
271
276
|
async getInfo(path) {
|
|
272
|
-
const response = await this.transport.requestJSON("/sandbox/files/stat", undefined, { path });
|
|
277
|
+
const response = await this.transport.requestJSON("/sandbox/files/stat", undefined, this.withRunAsQuery({ path }));
|
|
273
278
|
return normalizeFileInfo(response.file);
|
|
274
279
|
}
|
|
275
280
|
async list(path, options = {}) {
|
|
276
281
|
if (options.depth !== undefined && options.depth < 1) {
|
|
277
282
|
throw new Error("depth should be at least one");
|
|
278
283
|
}
|
|
279
|
-
const response = await this.transport.requestJSON("/sandbox/files", undefined, {
|
|
284
|
+
const response = await this.transport.requestJSON("/sandbox/files", undefined, this.withRunAsQuery({
|
|
280
285
|
path,
|
|
281
286
|
depth: options.depth ?? 1,
|
|
282
|
-
});
|
|
287
|
+
}));
|
|
283
288
|
return response.entries.map(normalizeFileInfo);
|
|
284
289
|
}
|
|
285
290
|
async read(path, options = {}) {
|
|
@@ -332,7 +337,7 @@ class SandboxFilesApi {
|
|
|
332
337
|
}));
|
|
333
338
|
const response = await this.transport.requestJSON("/sandbox/files/write", {
|
|
334
339
|
method: "POST",
|
|
335
|
-
body:
|
|
340
|
+
body: this.withRunAsBody({ files: encodedFiles }),
|
|
336
341
|
headers: {
|
|
337
342
|
"content-type": "application/json",
|
|
338
343
|
},
|
|
@@ -351,7 +356,7 @@ class SandboxFilesApi {
|
|
|
351
356
|
const response = await this.transport.requestJSON("/sandbox/files/upload", {
|
|
352
357
|
method: "PUT",
|
|
353
358
|
body,
|
|
354
|
-
}, { path });
|
|
359
|
+
}, this.withRunAsQuery({ path }));
|
|
355
360
|
return {
|
|
356
361
|
path: response.path,
|
|
357
362
|
bytesWritten: response.bytesWritten,
|
|
@@ -359,13 +364,13 @@ class SandboxFilesApi {
|
|
|
359
364
|
}
|
|
360
365
|
async download(path) {
|
|
361
366
|
return this.transport.requestBuffer("/sandbox/files/download", undefined, {
|
|
362
|
-
path,
|
|
367
|
+
...this.withRunAsQuery({ path }),
|
|
363
368
|
});
|
|
364
369
|
}
|
|
365
370
|
async makeDir(path, options = {}) {
|
|
366
371
|
const response = await this.transport.requestJSON("/sandbox/files/mkdir", {
|
|
367
372
|
method: "POST",
|
|
368
|
-
body:
|
|
373
|
+
body: this.withRunAsBody({
|
|
369
374
|
path,
|
|
370
375
|
parents: options.parents,
|
|
371
376
|
mode: options.mode,
|
|
@@ -379,7 +384,7 @@ class SandboxFilesApi {
|
|
|
379
384
|
async rename(oldPath, newPath) {
|
|
380
385
|
const response = await this.transport.requestJSON("/sandbox/files/move", {
|
|
381
386
|
method: "POST",
|
|
382
|
-
body:
|
|
387
|
+
body: this.withRunAsBody({
|
|
383
388
|
from: oldPath,
|
|
384
389
|
to: newPath,
|
|
385
390
|
}),
|
|
@@ -392,7 +397,7 @@ class SandboxFilesApi {
|
|
|
392
397
|
async remove(path, options = {}) {
|
|
393
398
|
await this.transport.requestJSON("/sandbox/files/delete", {
|
|
394
399
|
method: "POST",
|
|
395
|
-
body:
|
|
400
|
+
body: this.withRunAsBody({
|
|
396
401
|
path,
|
|
397
402
|
recursive: options.recursive,
|
|
398
403
|
}),
|
|
@@ -404,7 +409,7 @@ class SandboxFilesApi {
|
|
|
404
409
|
async copy(params) {
|
|
405
410
|
const response = await this.transport.requestJSON("/sandbox/files/copy", {
|
|
406
411
|
method: "POST",
|
|
407
|
-
body:
|
|
412
|
+
body: this.withRunAsBody({
|
|
408
413
|
from: params.source,
|
|
409
414
|
to: params.destination,
|
|
410
415
|
recursive: params.recursive,
|
|
@@ -419,7 +424,7 @@ class SandboxFilesApi {
|
|
|
419
424
|
async chmod(params) {
|
|
420
425
|
await this.transport.requestJSON("/sandbox/files/chmod", {
|
|
421
426
|
method: "POST",
|
|
422
|
-
body:
|
|
427
|
+
body: this.withRunAsBody(params),
|
|
423
428
|
headers: {
|
|
424
429
|
"content-type": "application/json",
|
|
425
430
|
},
|
|
@@ -428,7 +433,7 @@ class SandboxFilesApi {
|
|
|
428
433
|
async chown(params) {
|
|
429
434
|
await this.transport.requestJSON("/sandbox/files/chown", {
|
|
430
435
|
method: "POST",
|
|
431
|
-
body:
|
|
436
|
+
body: this.withRunAsBody(params),
|
|
432
437
|
headers: {
|
|
433
438
|
"content-type": "application/json",
|
|
434
439
|
},
|
|
@@ -437,7 +442,7 @@ class SandboxFilesApi {
|
|
|
437
442
|
async watchDir(path, onEvent, options = {}) {
|
|
438
443
|
const response = await this.transport.requestJSON("/sandbox/files/watch", {
|
|
439
444
|
method: "POST",
|
|
440
|
-
body:
|
|
445
|
+
body: this.withRunAsBody({
|
|
441
446
|
path,
|
|
442
447
|
recursive: options.recursive,
|
|
443
448
|
}),
|
|
@@ -451,7 +456,7 @@ class SandboxFilesApi {
|
|
|
451
456
|
async uploadUrl(path, options = {}) {
|
|
452
457
|
return this.transport.requestJSON("/sandbox/files/presign-upload", {
|
|
453
458
|
method: "POST",
|
|
454
|
-
body:
|
|
459
|
+
body: this.withRunAsBody({
|
|
455
460
|
path,
|
|
456
461
|
expiresInSeconds: options.expiresInSeconds,
|
|
457
462
|
oneTime: options.oneTime,
|
|
@@ -464,7 +469,7 @@ class SandboxFilesApi {
|
|
|
464
469
|
async downloadUrl(path, options = {}) {
|
|
465
470
|
return this.transport.requestJSON("/sandbox/files/presign-download", {
|
|
466
471
|
method: "POST",
|
|
467
|
-
body:
|
|
472
|
+
body: this.withRunAsBody({
|
|
468
473
|
path,
|
|
469
474
|
expiresInSeconds: options.expiresInSeconds,
|
|
470
475
|
oneTime: options.oneTime,
|
|
@@ -477,7 +482,7 @@ class SandboxFilesApi {
|
|
|
477
482
|
async readWire(path, options, encoding) {
|
|
478
483
|
return this.transport.requestJSON("/sandbox/files/read", {
|
|
479
484
|
method: "POST",
|
|
480
|
-
body:
|
|
485
|
+
body: this.withRunAsBody({
|
|
481
486
|
path,
|
|
482
487
|
offset: options.offset,
|
|
483
488
|
length: options.length,
|
|
@@ -491,7 +496,7 @@ class SandboxFilesApi {
|
|
|
491
496
|
async writeSingle(path, data, encoding, options) {
|
|
492
497
|
const response = await this.transport.requestJSON("/sandbox/files/write", {
|
|
493
498
|
method: "POST",
|
|
494
|
-
body:
|
|
499
|
+
body: this.withRunAsBody({
|
|
495
500
|
path,
|
|
496
501
|
data,
|
|
497
502
|
encoding,
|
|
@@ -504,5 +509,23 @@ class SandboxFilesApi {
|
|
|
504
509
|
});
|
|
505
510
|
return normalizeWriteInfo(response.files[0]);
|
|
506
511
|
}
|
|
512
|
+
withRunAsQuery(params) {
|
|
513
|
+
if (!this.defaultRunAs) {
|
|
514
|
+
return params;
|
|
515
|
+
}
|
|
516
|
+
return {
|
|
517
|
+
...params,
|
|
518
|
+
runAs: this.defaultRunAs,
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
withRunAsBody(body) {
|
|
522
|
+
if (!this.defaultRunAs) {
|
|
523
|
+
return JSON.stringify(body);
|
|
524
|
+
}
|
|
525
|
+
return JSON.stringify({
|
|
526
|
+
...body,
|
|
527
|
+
runAs: this.defaultRunAs,
|
|
528
|
+
});
|
|
529
|
+
}
|
|
507
530
|
}
|
|
508
531
|
exports.SandboxFilesApi = SandboxFilesApi;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RuntimeTransport } from "./base";
|
|
2
|
-
import { SandboxExecParams, SandboxProcessListParams, SandboxProcessListResponse, SandboxProcessResult, SandboxProcessSignal, SandboxProcessStdinParams, SandboxProcessStreamEvent, SandboxProcessSummary, SandboxProcessWaitParams } from "../types/sandbox";
|
|
2
|
+
import { SandboxExecParams, SandboxExecOptions, SandboxProcessListParams, SandboxProcessListResponse, SandboxProcessResult, SandboxProcessSignal, SandboxProcessStdinParams, SandboxProcessStreamEvent, SandboxProcessSummary, SandboxProcessWaitParams } from "../types/sandbox";
|
|
3
3
|
export declare class SandboxProcessHandle {
|
|
4
4
|
private readonly transport;
|
|
5
5
|
private summary;
|
|
@@ -18,7 +18,9 @@ export declare class SandboxProcessHandle {
|
|
|
18
18
|
export declare class SandboxProcessesApi {
|
|
19
19
|
private readonly transport;
|
|
20
20
|
constructor(transport: RuntimeTransport);
|
|
21
|
+
exec(command: string, options?: SandboxExecOptions): Promise<SandboxProcessResult>;
|
|
21
22
|
exec(input: SandboxExecParams): Promise<SandboxProcessResult>;
|
|
23
|
+
start(command: string, options?: SandboxExecOptions): Promise<SandboxProcessHandle>;
|
|
22
24
|
start(input: SandboxExecParams): Promise<SandboxProcessHandle>;
|
|
23
25
|
get(processId: string): Promise<SandboxProcessHandle>;
|
|
24
26
|
list(params?: SandboxProcessListParams): Promise<SandboxProcessListResponse>;
|
package/dist/sandbox/process.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SandboxProcessesApi = exports.SandboxProcessHandle = void 0;
|
|
4
4
|
const DEFAULT_PROCESS_KILL_WAIT_MS = 5000;
|
|
5
|
+
const SHELL_SAFE_TOKEN_PATTERN = /^[A-Za-z0-9_@%+=:,./-]+$/;
|
|
5
6
|
const normalizeProcessSummary = (process) => ({
|
|
6
7
|
id: process.id,
|
|
7
8
|
status: process.status,
|
|
@@ -50,15 +51,40 @@ const normalizeStreamEvent = (event) => {
|
|
|
50
51
|
}
|
|
51
52
|
return null;
|
|
52
53
|
};
|
|
54
|
+
const quoteShellToken = (token) => {
|
|
55
|
+
if (token.length === 0) {
|
|
56
|
+
return "''";
|
|
57
|
+
}
|
|
58
|
+
return SHELL_SAFE_TOKEN_PATTERN.test(token)
|
|
59
|
+
? token
|
|
60
|
+
: `'${token.replace(/'/g, `'\"'\"'`)}'`;
|
|
61
|
+
};
|
|
62
|
+
const buildShellCommand = (command, args) => {
|
|
63
|
+
if (!args || args.length === 0) {
|
|
64
|
+
return command;
|
|
65
|
+
}
|
|
66
|
+
return [command, ...args].map((token) => quoteShellToken(token)).join(" ");
|
|
67
|
+
};
|
|
68
|
+
const normalizeLegacyProcessParams = (input) => ({
|
|
69
|
+
...input,
|
|
70
|
+
command: buildShellCommand(input.command, input.args),
|
|
71
|
+
args: undefined,
|
|
72
|
+
useShell: undefined,
|
|
73
|
+
});
|
|
53
74
|
const buildProcessPayload = (input) => ({
|
|
54
75
|
command: input.command,
|
|
55
|
-
args: input.args,
|
|
56
76
|
cwd: input.cwd,
|
|
57
77
|
env: input.env,
|
|
58
78
|
timeoutMs: input.timeoutMs,
|
|
59
79
|
timeout_sec: input.timeoutSec,
|
|
60
|
-
|
|
80
|
+
runAs: input.runAs,
|
|
61
81
|
});
|
|
82
|
+
const normalizeExecParams = (input, options) => typeof input === "string"
|
|
83
|
+
? normalizeLegacyProcessParams({
|
|
84
|
+
command: input,
|
|
85
|
+
...options,
|
|
86
|
+
})
|
|
87
|
+
: normalizeLegacyProcessParams(input);
|
|
62
88
|
const encodeStdinPayload = (input) => {
|
|
63
89
|
if (input.data === undefined) {
|
|
64
90
|
return {
|
|
@@ -184,20 +210,22 @@ class SandboxProcessesApi {
|
|
|
184
210
|
constructor(transport) {
|
|
185
211
|
this.transport = transport;
|
|
186
212
|
}
|
|
187
|
-
async exec(input) {
|
|
213
|
+
async exec(input, options) {
|
|
214
|
+
const params = normalizeExecParams(input, options);
|
|
188
215
|
const response = await this.transport.requestJSON("/sandbox/exec", {
|
|
189
216
|
method: "POST",
|
|
190
|
-
body: JSON.stringify(buildProcessPayload(
|
|
217
|
+
body: JSON.stringify(buildProcessPayload(params)),
|
|
191
218
|
headers: {
|
|
192
219
|
"content-type": "application/json",
|
|
193
220
|
},
|
|
194
221
|
});
|
|
195
222
|
return normalizeProcessResult(response.result);
|
|
196
223
|
}
|
|
197
|
-
async start(input) {
|
|
224
|
+
async start(input, options) {
|
|
225
|
+
const params = normalizeExecParams(input, options);
|
|
198
226
|
const response = await this.transport.requestJSON("/sandbox/processes", {
|
|
199
227
|
method: "POST",
|
|
200
|
-
body: JSON.stringify(buildProcessPayload(
|
|
228
|
+
body: JSON.stringify(buildProcessPayload(params)),
|
|
201
229
|
headers: {
|
|
202
230
|
"content-type": "application/json",
|
|
203
231
|
},
|
|
@@ -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, SandboxImageListResponse, SandboxListParams, SandboxListResponse, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxProcessResult, SandboxSnapshotListParams, SandboxSnapshotListResponse, SandboxUnexposeResult } from "../types/sandbox";
|
|
5
|
+
import { CreateSandboxParams, SandboxDetail, SandboxExposeParams, SandboxExposeResult, SandboxExecParams, SandboxExecOptions, SandboxImageListResponse, SandboxListParams, SandboxListResponse, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxProcessResult, SandboxSnapshotListParams, SandboxSnapshotListResponse, SandboxUnexposeResult } from "../types/sandbox";
|
|
6
6
|
import { BaseService } from "./base";
|
|
7
7
|
export declare class SandboxHandle {
|
|
8
8
|
private readonly service;
|
|
@@ -33,7 +33,8 @@ export declare class SandboxHandle {
|
|
|
33
33
|
expose(params: SandboxExposeParams): Promise<SandboxExposeResult>;
|
|
34
34
|
unexpose(port: number): Promise<SandboxUnexposeResult>;
|
|
35
35
|
getExposedUrl(port: number): string;
|
|
36
|
-
exec(input: string
|
|
36
|
+
exec(input: string, options?: SandboxExecOptions): Promise<SandboxProcessResult>;
|
|
37
|
+
exec(input: SandboxExecParams): Promise<SandboxProcessResult>;
|
|
37
38
|
getProcess(processId: string): Promise<SandboxProcessHandle>;
|
|
38
39
|
private hydrate;
|
|
39
40
|
private resolveRuntimeConnection;
|
|
@@ -161,13 +161,11 @@ class SandboxHandle {
|
|
|
161
161
|
getExposedUrl(port) {
|
|
162
162
|
return buildSandboxExposedUrl(this.runtime, port);
|
|
163
163
|
}
|
|
164
|
-
async exec(input) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
: input;
|
|
170
|
-
return this.processes.exec(params);
|
|
164
|
+
async exec(input, options) {
|
|
165
|
+
if (typeof input === "string") {
|
|
166
|
+
return this.processes.exec(input, options);
|
|
167
|
+
}
|
|
168
|
+
return this.processes.exec(input);
|
|
171
169
|
}
|
|
172
170
|
async getProcess(processId) {
|
|
173
171
|
return this.processes.get(processId);
|
package/dist/types/crawl.d.ts
CHANGED
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, SessionCreditBreakdown, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, } from "./session";
|
|
11
|
-
export { SandboxStatus, SandboxRuntimeTarget, Sandbox, SandboxDetail, SandboxListParams, SandboxListResponse, SandboxImageSummary, SandboxImageListResponse, SandboxSnapshotStatus, SandboxSnapshotSummary, SandboxSnapshotListParams, SandboxSnapshotListResponse, CreateSandboxParams, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxExposeParams, SandboxExposeResult, SandboxUnexposeResult, 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, 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 { 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
|
@@ -138,13 +138,17 @@ export interface SandboxUnexposeResult {
|
|
|
138
138
|
export type SandboxProcessStatus = "queued" | "running" | "exited" | "failed" | "killed" | "timed_out";
|
|
139
139
|
export interface SandboxExecParams {
|
|
140
140
|
command: string;
|
|
141
|
+
/** @deprecated Legacy compatibility only. Converted into a single shell command string. */
|
|
141
142
|
args?: string[];
|
|
142
143
|
cwd?: string;
|
|
143
144
|
env?: Record<string, string>;
|
|
144
145
|
timeoutMs?: number;
|
|
145
146
|
timeoutSec?: number;
|
|
147
|
+
runAs?: string;
|
|
148
|
+
/** @deprecated Ignored for process APIs. Commands always execute via `/bin/sh -lc` server-side. */
|
|
146
149
|
useShell?: boolean;
|
|
147
150
|
}
|
|
151
|
+
export type SandboxExecOptions = Omit<SandboxExecParams, "command">;
|
|
148
152
|
export interface SandboxProcessSummary {
|
|
149
153
|
id: string;
|
|
150
154
|
status: SandboxProcessStatus;
|
package/dist/types/scrape.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface ScrapeJobStatusResponse {
|
|
|
35
35
|
status: ScrapeJobStatus;
|
|
36
36
|
}
|
|
37
37
|
export interface ScrapeJobData {
|
|
38
|
-
metadata?: Record<string,
|
|
38
|
+
metadata?: Record<string, unknown>;
|
|
39
39
|
markdown?: string;
|
|
40
40
|
html?: string;
|
|
41
41
|
links?: string[];
|
|
@@ -56,7 +56,7 @@ export interface ScrapedPage {
|
|
|
56
56
|
url: string;
|
|
57
57
|
status: ScrapePageStatus;
|
|
58
58
|
error?: string | null;
|
|
59
|
-
metadata?: Record<string,
|
|
59
|
+
metadata?: Record<string, unknown>;
|
|
60
60
|
markdown?: string;
|
|
61
61
|
html?: string;
|
|
62
62
|
links?: string[];
|
|
@@ -25,7 +25,7 @@ export interface PageData {
|
|
|
25
25
|
url: string;
|
|
26
26
|
status: PageStatus;
|
|
27
27
|
error?: string;
|
|
28
|
-
metadata?: Record<string,
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
29
|
markdown?: string;
|
|
30
30
|
html?: string;
|
|
31
31
|
links?: string[];
|
|
@@ -62,7 +62,7 @@ export interface FetchOutputOptions {
|
|
|
62
62
|
export interface FetchBrowserOptions {
|
|
63
63
|
screen?: ScreenConfig;
|
|
64
64
|
profileId?: string;
|
|
65
|
-
solveCaptchas?:
|
|
65
|
+
solveCaptchas?: boolean;
|
|
66
66
|
location?: FetchBrowserLocationOptions;
|
|
67
67
|
}
|
|
68
68
|
export interface FetchNavigationOptions {
|