wuying-agentbay-sdk 0.5.1 → 0.6.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 +84 -153
- package/dist/index.cjs +1153 -167
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +455 -33
- package/dist/index.d.ts +455 -33
- package/dist/index.mjs +1140 -154
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -305,6 +305,7 @@ declare class CreateMcpSessionRequest extends $dara.Model {
|
|
|
305
305
|
externalUserId?: string;
|
|
306
306
|
imageId?: string;
|
|
307
307
|
labels?: string;
|
|
308
|
+
mcpPolicyId?: string;
|
|
308
309
|
persistenceDataList?: CreateMcpSessionRequestPersistenceDataList[];
|
|
309
310
|
sessionId?: string;
|
|
310
311
|
vpcResource?: boolean;
|
|
@@ -326,6 +327,7 @@ declare class CreateMcpSessionShrinkRequest extends $dara.Model {
|
|
|
326
327
|
externalUserId?: string;
|
|
327
328
|
imageId?: string;
|
|
328
329
|
labels?: string;
|
|
330
|
+
mcpPolicyId?: string;
|
|
329
331
|
persistenceDataListShrink?: string;
|
|
330
332
|
sessionId?: string;
|
|
331
333
|
vpcResource?: boolean;
|
|
@@ -704,6 +706,9 @@ declare class InitBrowserRequest extends $dara.Model {
|
|
|
704
706
|
authorization?: string;
|
|
705
707
|
persistentPath?: string;
|
|
706
708
|
sessionId?: string;
|
|
709
|
+
browserOption?: {
|
|
710
|
+
[key: string]: any;
|
|
711
|
+
};
|
|
707
712
|
static names(): {
|
|
708
713
|
[key: string]: string;
|
|
709
714
|
};
|
|
@@ -1153,6 +1158,268 @@ declare class SyncContextResponse extends $dara.Model {
|
|
|
1153
1158
|
});
|
|
1154
1159
|
}
|
|
1155
1160
|
|
|
1161
|
+
declare class DeleteContextFileRequest extends $dara.Model {
|
|
1162
|
+
authorization?: string;
|
|
1163
|
+
contextId?: string;
|
|
1164
|
+
filePath?: string;
|
|
1165
|
+
static names(): {
|
|
1166
|
+
[key: string]: string;
|
|
1167
|
+
};
|
|
1168
|
+
static types(): {
|
|
1169
|
+
[key: string]: any;
|
|
1170
|
+
};
|
|
1171
|
+
validate(): void;
|
|
1172
|
+
constructor(map?: {
|
|
1173
|
+
[key: string]: any;
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
declare class DeleteContextFileResponseBody extends $dara.Model {
|
|
1178
|
+
code?: string;
|
|
1179
|
+
httpStatusCode?: number;
|
|
1180
|
+
message?: string;
|
|
1181
|
+
requestId?: string;
|
|
1182
|
+
success?: boolean;
|
|
1183
|
+
static names(): {
|
|
1184
|
+
[key: string]: string;
|
|
1185
|
+
};
|
|
1186
|
+
static types(): {
|
|
1187
|
+
[key: string]: any;
|
|
1188
|
+
};
|
|
1189
|
+
validate(): void;
|
|
1190
|
+
constructor(map?: {
|
|
1191
|
+
[key: string]: any;
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
declare class DeleteContextFileResponse extends $dara.Model {
|
|
1196
|
+
headers?: {
|
|
1197
|
+
[key: string]: string;
|
|
1198
|
+
};
|
|
1199
|
+
statusCode?: number;
|
|
1200
|
+
body?: DeleteContextFileResponseBody;
|
|
1201
|
+
static names(): {
|
|
1202
|
+
[key: string]: string;
|
|
1203
|
+
};
|
|
1204
|
+
static types(): {
|
|
1205
|
+
[key: string]: any;
|
|
1206
|
+
};
|
|
1207
|
+
validate(): void;
|
|
1208
|
+
constructor(map?: {
|
|
1209
|
+
[key: string]: any;
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
declare class DescribeContextFilesRequest extends $dara.Model {
|
|
1214
|
+
authorization?: string;
|
|
1215
|
+
pageNumber?: number;
|
|
1216
|
+
pageSize?: number;
|
|
1217
|
+
parentFolderPath?: string;
|
|
1218
|
+
contextId?: string;
|
|
1219
|
+
static names(): {
|
|
1220
|
+
[key: string]: string;
|
|
1221
|
+
};
|
|
1222
|
+
static types(): {
|
|
1223
|
+
[key: string]: any;
|
|
1224
|
+
};
|
|
1225
|
+
validate(): void;
|
|
1226
|
+
constructor(map?: {
|
|
1227
|
+
[key: string]: any;
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
declare class DescribeContextFilesResponseBodyData extends $dara.Model {
|
|
1232
|
+
fileId?: string;
|
|
1233
|
+
fileName?: string;
|
|
1234
|
+
filePath?: string;
|
|
1235
|
+
fileType?: string;
|
|
1236
|
+
gmtCreate?: string;
|
|
1237
|
+
gmtModified?: string;
|
|
1238
|
+
size?: number;
|
|
1239
|
+
status?: string;
|
|
1240
|
+
static names(): {
|
|
1241
|
+
[key: string]: string;
|
|
1242
|
+
};
|
|
1243
|
+
static types(): {
|
|
1244
|
+
[key: string]: any;
|
|
1245
|
+
};
|
|
1246
|
+
validate(): void;
|
|
1247
|
+
constructor(map?: {
|
|
1248
|
+
[key: string]: any;
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
declare class DescribeContextFilesResponseBody extends $dara.Model {
|
|
1252
|
+
code?: string;
|
|
1253
|
+
count?: number;
|
|
1254
|
+
data?: DescribeContextFilesResponseBodyData[];
|
|
1255
|
+
httpStatusCode?: number;
|
|
1256
|
+
message?: string;
|
|
1257
|
+
requestId?: string;
|
|
1258
|
+
success?: boolean;
|
|
1259
|
+
static names(): {
|
|
1260
|
+
[key: string]: string;
|
|
1261
|
+
};
|
|
1262
|
+
static types(): {
|
|
1263
|
+
[key: string]: any;
|
|
1264
|
+
};
|
|
1265
|
+
validate(): void;
|
|
1266
|
+
constructor(map?: {
|
|
1267
|
+
[key: string]: any;
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
declare class DescribeContextFilesResponse extends $dara.Model {
|
|
1272
|
+
headers?: {
|
|
1273
|
+
[key: string]: string;
|
|
1274
|
+
};
|
|
1275
|
+
statusCode?: number;
|
|
1276
|
+
body?: DescribeContextFilesResponseBody;
|
|
1277
|
+
static names(): {
|
|
1278
|
+
[key: string]: string;
|
|
1279
|
+
};
|
|
1280
|
+
static types(): {
|
|
1281
|
+
[key: string]: any;
|
|
1282
|
+
};
|
|
1283
|
+
validate(): void;
|
|
1284
|
+
constructor(map?: {
|
|
1285
|
+
[key: string]: any;
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
declare class GetContextFileDownloadUrlRequest extends $dara.Model {
|
|
1290
|
+
authorization?: string;
|
|
1291
|
+
contextId?: string;
|
|
1292
|
+
filePath?: string;
|
|
1293
|
+
static names(): {
|
|
1294
|
+
[key: string]: string;
|
|
1295
|
+
};
|
|
1296
|
+
static types(): {
|
|
1297
|
+
[key: string]: any;
|
|
1298
|
+
};
|
|
1299
|
+
validate(): void;
|
|
1300
|
+
constructor(map?: {
|
|
1301
|
+
[key: string]: any;
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
declare class GetContextFileDownloadUrlResponseBodyData extends $dara.Model {
|
|
1306
|
+
expireTime?: number;
|
|
1307
|
+
url?: string;
|
|
1308
|
+
static names(): {
|
|
1309
|
+
[key: string]: string;
|
|
1310
|
+
};
|
|
1311
|
+
static types(): {
|
|
1312
|
+
[key: string]: any;
|
|
1313
|
+
};
|
|
1314
|
+
validate(): void;
|
|
1315
|
+
constructor(map?: {
|
|
1316
|
+
[key: string]: any;
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
declare class GetContextFileDownloadUrlResponseBody extends $dara.Model {
|
|
1320
|
+
code?: string;
|
|
1321
|
+
data?: GetContextFileDownloadUrlResponseBodyData;
|
|
1322
|
+
httpStatusCode?: number;
|
|
1323
|
+
message?: string;
|
|
1324
|
+
requestId?: string;
|
|
1325
|
+
success?: boolean;
|
|
1326
|
+
static names(): {
|
|
1327
|
+
[key: string]: string;
|
|
1328
|
+
};
|
|
1329
|
+
static types(): {
|
|
1330
|
+
[key: string]: any;
|
|
1331
|
+
};
|
|
1332
|
+
validate(): void;
|
|
1333
|
+
constructor(map?: {
|
|
1334
|
+
[key: string]: any;
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
declare class GetContextFileDownloadUrlResponse extends $dara.Model {
|
|
1339
|
+
headers?: {
|
|
1340
|
+
[key: string]: string;
|
|
1341
|
+
};
|
|
1342
|
+
statusCode?: number;
|
|
1343
|
+
body?: GetContextFileDownloadUrlResponseBody;
|
|
1344
|
+
static names(): {
|
|
1345
|
+
[key: string]: string;
|
|
1346
|
+
};
|
|
1347
|
+
static types(): {
|
|
1348
|
+
[key: string]: any;
|
|
1349
|
+
};
|
|
1350
|
+
validate(): void;
|
|
1351
|
+
constructor(map?: {
|
|
1352
|
+
[key: string]: any;
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
declare class GetContextFileUploadUrlRequest extends $dara.Model {
|
|
1357
|
+
authorization?: string;
|
|
1358
|
+
contextId?: string;
|
|
1359
|
+
filePath?: string;
|
|
1360
|
+
static names(): {
|
|
1361
|
+
[key: string]: string;
|
|
1362
|
+
};
|
|
1363
|
+
static types(): {
|
|
1364
|
+
[key: string]: any;
|
|
1365
|
+
};
|
|
1366
|
+
validate(): void;
|
|
1367
|
+
constructor(map?: {
|
|
1368
|
+
[key: string]: any;
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
declare class GetContextFileUploadUrlResponseBodyData extends $dara.Model {
|
|
1373
|
+
expireTime?: number;
|
|
1374
|
+
url?: string;
|
|
1375
|
+
static names(): {
|
|
1376
|
+
[key: string]: string;
|
|
1377
|
+
};
|
|
1378
|
+
static types(): {
|
|
1379
|
+
[key: string]: any;
|
|
1380
|
+
};
|
|
1381
|
+
validate(): void;
|
|
1382
|
+
constructor(map?: {
|
|
1383
|
+
[key: string]: any;
|
|
1384
|
+
});
|
|
1385
|
+
}
|
|
1386
|
+
declare class GetContextFileUploadUrlResponseBody extends $dara.Model {
|
|
1387
|
+
code?: string;
|
|
1388
|
+
data?: GetContextFileUploadUrlResponseBodyData;
|
|
1389
|
+
httpStatusCode?: number;
|
|
1390
|
+
message?: string;
|
|
1391
|
+
requestId?: string;
|
|
1392
|
+
success?: boolean;
|
|
1393
|
+
static names(): {
|
|
1394
|
+
[key: string]: string;
|
|
1395
|
+
};
|
|
1396
|
+
static types(): {
|
|
1397
|
+
[key: string]: any;
|
|
1398
|
+
};
|
|
1399
|
+
validate(): void;
|
|
1400
|
+
constructor(map?: {
|
|
1401
|
+
[key: string]: any;
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
declare class GetContextFileUploadUrlResponse extends $dara.Model {
|
|
1406
|
+
headers?: {
|
|
1407
|
+
[key: string]: string;
|
|
1408
|
+
};
|
|
1409
|
+
statusCode?: number;
|
|
1410
|
+
body?: GetContextFileUploadUrlResponseBody;
|
|
1411
|
+
static names(): {
|
|
1412
|
+
[key: string]: string;
|
|
1413
|
+
};
|
|
1414
|
+
static types(): {
|
|
1415
|
+
[key: string]: any;
|
|
1416
|
+
};
|
|
1417
|
+
validate(): void;
|
|
1418
|
+
constructor(map?: {
|
|
1419
|
+
[key: string]: any;
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1156
1423
|
declare class Client extends OpenApi {
|
|
1157
1424
|
constructor(config: $OpenApiUtil.Config);
|
|
1158
1425
|
getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {
|
|
@@ -1405,6 +1672,66 @@ declare class Client extends OpenApi {
|
|
|
1405
1672
|
* @returns InitBrowserResponse
|
|
1406
1673
|
*/
|
|
1407
1674
|
initBrowserSync(request: InitBrowserRequest): InitBrowserResponse;
|
|
1675
|
+
/**
|
|
1676
|
+
* 获取上传context文件url
|
|
1677
|
+
*
|
|
1678
|
+
* @param request - DeleteContextFileRequest
|
|
1679
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1680
|
+
* @returns DeleteContextFileResponse
|
|
1681
|
+
*/
|
|
1682
|
+
deleteContextFileWithOptions(request: DeleteContextFileRequest, runtime: $dara.RuntimeOptions): Promise<DeleteContextFileResponse>;
|
|
1683
|
+
/**
|
|
1684
|
+
* 获取上传context文件url
|
|
1685
|
+
*
|
|
1686
|
+
* @param request - DeleteContextFileRequest
|
|
1687
|
+
* @returns DeleteContextFileResponse
|
|
1688
|
+
*/
|
|
1689
|
+
deleteContextFile(request: DeleteContextFileRequest): Promise<DeleteContextFileResponse>;
|
|
1690
|
+
/**
|
|
1691
|
+
* 查询context特定目录文件
|
|
1692
|
+
*
|
|
1693
|
+
* @param request - DescribeContextFilesRequest
|
|
1694
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1695
|
+
* @returns DescribeContextFilesResponse
|
|
1696
|
+
*/
|
|
1697
|
+
describeContextFilesWithOptions(request: DescribeContextFilesRequest, runtime: $dara.RuntimeOptions): Promise<DescribeContextFilesResponse>;
|
|
1698
|
+
/**
|
|
1699
|
+
* 查询context特定目录文件
|
|
1700
|
+
*
|
|
1701
|
+
* @param request - DescribeContextFilesRequest
|
|
1702
|
+
* @returns DescribeContextFilesResponse
|
|
1703
|
+
*/
|
|
1704
|
+
describeContextFiles(request: DescribeContextFilesRequest): Promise<DescribeContextFilesResponse>;
|
|
1705
|
+
/**
|
|
1706
|
+
* 获取上传context文件url
|
|
1707
|
+
*
|
|
1708
|
+
* @param request - GetContextFileDownloadUrlRequest
|
|
1709
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1710
|
+
* @returns GetContextFileDownloadUrlResponse
|
|
1711
|
+
*/
|
|
1712
|
+
getContextFileDownloadUrlWithOptions(request: GetContextFileDownloadUrlRequest, runtime: $dara.RuntimeOptions): Promise<GetContextFileDownloadUrlResponse>;
|
|
1713
|
+
/**
|
|
1714
|
+
* 获取上传context文件url
|
|
1715
|
+
*
|
|
1716
|
+
* @param request - GetContextFileDownloadUrlRequest
|
|
1717
|
+
* @returns GetContextFileDownloadUrlResponse
|
|
1718
|
+
*/
|
|
1719
|
+
getContextFileDownloadUrl(request: GetContextFileDownloadUrlRequest): Promise<GetContextFileDownloadUrlResponse>;
|
|
1720
|
+
/**
|
|
1721
|
+
* 获取上传context文件url
|
|
1722
|
+
*
|
|
1723
|
+
* @param request - GetContextFileUploadUrlRequest
|
|
1724
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1725
|
+
* @returns GetContextFileUploadUrlResponse
|
|
1726
|
+
*/
|
|
1727
|
+
getContextFileUploadUrlWithOptions(request: GetContextFileUploadUrlRequest, runtime: $dara.RuntimeOptions): Promise<GetContextFileUploadUrlResponse>;
|
|
1728
|
+
/**
|
|
1729
|
+
* 获取上传context文件url
|
|
1730
|
+
*
|
|
1731
|
+
* @param request - GetContextFileUploadUrlRequest
|
|
1732
|
+
* @returns GetContextFileUploadUrlResponse
|
|
1733
|
+
*/
|
|
1734
|
+
getContextFileUploadUrl(request: GetContextFileUploadUrlRequest): Promise<GetContextFileUploadUrlResponse>;
|
|
1408
1735
|
}
|
|
1409
1736
|
|
|
1410
1737
|
interface Config {
|
|
@@ -1733,6 +2060,49 @@ interface ContextListResult extends ApiResponse {
|
|
|
1733
2060
|
/** Optional error message if the operation failed */
|
|
1734
2061
|
errorMessage?: string;
|
|
1735
2062
|
}
|
|
2063
|
+
/**
|
|
2064
|
+
* Result of a presigned URL request
|
|
2065
|
+
*/
|
|
2066
|
+
interface FileUrlResult extends ApiResponse {
|
|
2067
|
+
/** Request identifier for tracking API calls */
|
|
2068
|
+
requestId: string;
|
|
2069
|
+
/** Whether the operation was successful */
|
|
2070
|
+
success: boolean;
|
|
2071
|
+
/** The presigned URL */
|
|
2072
|
+
url: string;
|
|
2073
|
+
/** Optional expire time (epoch seconds) */
|
|
2074
|
+
expireTime?: number;
|
|
2075
|
+
/** Optional error message if the operation failed */
|
|
2076
|
+
errorMessage?: string;
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* Represents a file item in a context
|
|
2080
|
+
*/
|
|
2081
|
+
interface ContextFileEntry {
|
|
2082
|
+
fileId?: string;
|
|
2083
|
+
fileName?: string;
|
|
2084
|
+
filePath: string;
|
|
2085
|
+
fileType?: string;
|
|
2086
|
+
gmtCreate?: string;
|
|
2087
|
+
gmtModified?: string;
|
|
2088
|
+
size?: number;
|
|
2089
|
+
status?: string;
|
|
2090
|
+
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Result of context file listing
|
|
2093
|
+
*/
|
|
2094
|
+
interface ContextFileListResult extends ApiResponse {
|
|
2095
|
+
/** Request identifier for tracking API calls */
|
|
2096
|
+
requestId: string;
|
|
2097
|
+
/** Whether the operation was successful */
|
|
2098
|
+
success: boolean;
|
|
2099
|
+
/** File entries under a folder */
|
|
2100
|
+
entries: ContextFileEntry[];
|
|
2101
|
+
/** Optional total count returned by backend */
|
|
2102
|
+
count?: number;
|
|
2103
|
+
/** Optional error message if the operation failed */
|
|
2104
|
+
errorMessage?: string;
|
|
2105
|
+
}
|
|
1736
2106
|
|
|
1737
2107
|
/**
|
|
1738
2108
|
* Represents a persistent storage context in the AgentBay cloud environment.
|
|
@@ -1840,6 +2210,22 @@ declare class ContextService {
|
|
|
1840
2210
|
* @returns OperationResult with requestId
|
|
1841
2211
|
*/
|
|
1842
2212
|
delete(context: Context): Promise<OperationResult>;
|
|
2213
|
+
/**
|
|
2214
|
+
* Get a presigned upload URL for a file in a context.
|
|
2215
|
+
*/
|
|
2216
|
+
getFileUploadUrl(contextId: string, filePath: string): Promise<FileUrlResult>;
|
|
2217
|
+
/**
|
|
2218
|
+
* Get a presigned download URL for a file in a context.
|
|
2219
|
+
*/
|
|
2220
|
+
getFileDownloadUrl(contextId: string, filePath: string): Promise<FileUrlResult>;
|
|
2221
|
+
/**
|
|
2222
|
+
* Delete a file in a context.
|
|
2223
|
+
*/
|
|
2224
|
+
deleteFile(contextId: string, filePath: string): Promise<OperationResult>;
|
|
2225
|
+
/**
|
|
2226
|
+
* List files under a specific folder path in a context.
|
|
2227
|
+
*/
|
|
2228
|
+
listFiles(contextId: string, parentFolderPath: string, pageNumber?: number, pageSize?: number): Promise<ContextFileListResult>;
|
|
1843
2229
|
}
|
|
1844
2230
|
|
|
1845
2231
|
declare enum UploadStrategy {
|
|
@@ -2643,6 +3029,7 @@ interface ObserveOptions {
|
|
|
2643
3029
|
interface ExtractOptions<T = any> {
|
|
2644
3030
|
instruction: string;
|
|
2645
3031
|
schema: new (...args: any[]) => T;
|
|
3032
|
+
use_text_extract: boolean;
|
|
2646
3033
|
selector?: string;
|
|
2647
3034
|
iframe?: boolean;
|
|
2648
3035
|
domSettleTimeoutsMS?: number;
|
|
@@ -2695,8 +3082,59 @@ declare class BrowserAgent {
|
|
|
2695
3082
|
private _callMcpTool;
|
|
2696
3083
|
}
|
|
2697
3084
|
|
|
3085
|
+
interface BrowserViewport {
|
|
3086
|
+
width: number;
|
|
3087
|
+
height: number;
|
|
3088
|
+
}
|
|
3089
|
+
interface BrowserScreen {
|
|
3090
|
+
width: number;
|
|
3091
|
+
height: number;
|
|
3092
|
+
}
|
|
3093
|
+
interface BrowserFingerprint {
|
|
3094
|
+
devices?: Array<'desktop' | 'mobile'>;
|
|
3095
|
+
operatingSystems?: Array<'windows' | 'macos' | 'linux' | 'android' | 'ios'>;
|
|
3096
|
+
locales?: string[];
|
|
3097
|
+
}
|
|
3098
|
+
interface BrowserProxy {
|
|
3099
|
+
type: 'custom' | 'wuying';
|
|
3100
|
+
server?: string;
|
|
3101
|
+
username?: string;
|
|
3102
|
+
password?: string;
|
|
3103
|
+
strategy?: 'restricted' | 'polling';
|
|
3104
|
+
pollsize?: number;
|
|
3105
|
+
toMap(): Record<string, any>;
|
|
3106
|
+
}
|
|
3107
|
+
declare class BrowserProxyClass implements BrowserProxy {
|
|
3108
|
+
type: 'custom' | 'wuying';
|
|
3109
|
+
server?: string;
|
|
3110
|
+
username?: string;
|
|
3111
|
+
password?: string;
|
|
3112
|
+
strategy?: 'restricted' | 'polling';
|
|
3113
|
+
pollsize?: number;
|
|
3114
|
+
constructor(proxyType: 'custom' | 'wuying', server?: string, username?: string, password?: string, strategy?: 'restricted' | 'polling', pollsize?: number);
|
|
3115
|
+
toMap(): Record<string, any>;
|
|
3116
|
+
static fromMap(m: Record<string, any> | null | undefined): BrowserProxyClass | null;
|
|
3117
|
+
}
|
|
2698
3118
|
interface BrowserOption {
|
|
2699
3119
|
persistentPath?: string;
|
|
3120
|
+
useStealth?: boolean;
|
|
3121
|
+
userAgent?: string;
|
|
3122
|
+
viewport?: BrowserViewport;
|
|
3123
|
+
screen?: BrowserScreen;
|
|
3124
|
+
fingerprint?: BrowserFingerprint;
|
|
3125
|
+
proxies?: BrowserProxy[];
|
|
3126
|
+
}
|
|
3127
|
+
declare class BrowserOptionClass implements BrowserOption {
|
|
3128
|
+
persistentPath?: string;
|
|
3129
|
+
useStealth?: boolean;
|
|
3130
|
+
userAgent?: string;
|
|
3131
|
+
viewport?: BrowserViewport;
|
|
3132
|
+
screen?: BrowserScreen;
|
|
3133
|
+
fingerprint?: BrowserFingerprint;
|
|
3134
|
+
proxies?: BrowserProxy[];
|
|
3135
|
+
constructor(useStealth?: boolean, userAgent?: string, viewport?: BrowserViewport, screen?: BrowserScreen, fingerprint?: BrowserFingerprint, proxies?: BrowserProxy[]);
|
|
3136
|
+
toMap(): Record<string, any>;
|
|
3137
|
+
fromMap(m: Record<string, any> | null | undefined): BrowserOptionClass;
|
|
2700
3138
|
}
|
|
2701
3139
|
declare class Browser {
|
|
2702
3140
|
private session;
|
|
@@ -2709,12 +3147,12 @@ declare class Browser {
|
|
|
2709
3147
|
* Initialize the browser instance with the given options.
|
|
2710
3148
|
* Returns true if successful, false otherwise.
|
|
2711
3149
|
*/
|
|
2712
|
-
initialize(option: BrowserOption): boolean;
|
|
3150
|
+
initialize(option: BrowserOptionClass | BrowserOption): boolean;
|
|
2713
3151
|
/**
|
|
2714
3152
|
* Initialize the browser instance with the given options asynchronously.
|
|
2715
3153
|
* Returns true if successful, false otherwise.
|
|
2716
3154
|
*/
|
|
2717
|
-
initializeAsync(option: BrowserOption): Promise<boolean>;
|
|
3155
|
+
initializeAsync(option: BrowserOptionClass | BrowserOption): Promise<boolean>;
|
|
2718
3156
|
/**
|
|
2719
3157
|
* Returns the endpoint URL if the browser is initialized, otherwise throws an exception.
|
|
2720
3158
|
* When initialized, always fetches the latest CDP url from session.getLink().
|
|
@@ -2723,11 +3161,15 @@ declare class Browser {
|
|
|
2723
3161
|
/**
|
|
2724
3162
|
* Returns the current BrowserOption used to initialize the browser, or null if not set.
|
|
2725
3163
|
*/
|
|
2726
|
-
getOption():
|
|
3164
|
+
getOption(): BrowserOptionClass | null;
|
|
2727
3165
|
/**
|
|
2728
3166
|
* Returns true if the browser was initialized, false otherwise.
|
|
2729
3167
|
*/
|
|
2730
3168
|
isInitialized(): boolean;
|
|
3169
|
+
/**
|
|
3170
|
+
* Stop the browser instance, internal use only.
|
|
3171
|
+
*/
|
|
3172
|
+
private _stopBrowser;
|
|
2731
3173
|
}
|
|
2732
3174
|
|
|
2733
3175
|
/**
|
|
@@ -2887,17 +3329,14 @@ interface BrowserContext {
|
|
|
2887
3329
|
*/
|
|
2888
3330
|
interface CreateSessionParamsConfig {
|
|
2889
3331
|
labels: Record<string, string>;
|
|
2890
|
-
/**
|
|
2891
|
-
* @deprecated This field is deprecated and will be removed in a future version.
|
|
2892
|
-
* Please use contextSync instead for more flexible and powerful data persistence.
|
|
2893
|
-
*/
|
|
2894
|
-
contextId?: string;
|
|
2895
3332
|
imageId?: string;
|
|
2896
3333
|
contextSync: ContextSync[];
|
|
2897
3334
|
/** Optional configuration for browser data synchronization */
|
|
2898
3335
|
browserContext?: BrowserContext;
|
|
2899
3336
|
/** Whether to create a VPC-based session. Defaults to false. */
|
|
2900
3337
|
isVpc?: boolean;
|
|
3338
|
+
/** MCP policy id to apply when creating the session. */
|
|
3339
|
+
mcpPolicyId?: string;
|
|
2901
3340
|
}
|
|
2902
3341
|
/**
|
|
2903
3342
|
* CreateSessionParams provides a way to configure the parameters for creating a new session
|
|
@@ -2906,25 +3345,6 @@ interface CreateSessionParamsConfig {
|
|
|
2906
3345
|
declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
|
|
2907
3346
|
/** Custom labels for the Session. These can be used for organizing and filtering sessions. */
|
|
2908
3347
|
labels: Record<string, string>;
|
|
2909
|
-
/**
|
|
2910
|
-
* ID of the context to bind to the session.
|
|
2911
|
-
* The context can include various types of persistence like file system (volume) and cookies.
|
|
2912
|
-
*
|
|
2913
|
-
* @deprecated This field is deprecated and will be removed in a future version.
|
|
2914
|
-
* Please use contextSync instead for more flexible and powerful data persistence.
|
|
2915
|
-
*
|
|
2916
|
-
* Important Limitations:
|
|
2917
|
-
* 1. One session at a time: A context can only be used by one session at a time.
|
|
2918
|
-
* If you try to create a session with a context ID that is already in use by another active session,
|
|
2919
|
-
* the session creation will fail.
|
|
2920
|
-
*
|
|
2921
|
-
* 2. OS binding: A context is bound to the operating system of the first session that uses it.
|
|
2922
|
-
* When a context is first used with a session, it becomes bound to that session's OS.
|
|
2923
|
-
* Any attempt to use the context with a session running on a different OS will fail.
|
|
2924
|
-
* For example, if a context is first used with a Linux session, it cannot later be used
|
|
2925
|
-
* with a Windows or Android session.
|
|
2926
|
-
*/
|
|
2927
|
-
contextId?: string;
|
|
2928
3348
|
/** Image ID to use for the session. */
|
|
2929
3349
|
imageId?: string;
|
|
2930
3350
|
/**
|
|
@@ -2936,15 +3356,13 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
|
|
|
2936
3356
|
browserContext?: BrowserContext;
|
|
2937
3357
|
/** Whether to create a VPC-based session. Defaults to false. */
|
|
2938
3358
|
isVpc: boolean;
|
|
3359
|
+
/** MCP policy id to apply when creating the session. */
|
|
3360
|
+
mcpPolicyId?: string;
|
|
2939
3361
|
constructor();
|
|
2940
3362
|
/**
|
|
2941
3363
|
* WithLabels sets the labels for the session parameters and returns the updated parameters.
|
|
2942
3364
|
*/
|
|
2943
3365
|
withLabels(labels: Record<string, string>): CreateSessionParams$1;
|
|
2944
|
-
/**
|
|
2945
|
-
* WithContextID sets the context ID for the session parameters and returns the updated parameters.
|
|
2946
|
-
*/
|
|
2947
|
-
withContextID(contextId: string): CreateSessionParams$1;
|
|
2948
3366
|
/**
|
|
2949
3367
|
* WithImageId sets the image ID for the session parameters and returns the updated parameters.
|
|
2950
3368
|
*/
|
|
@@ -2957,6 +3375,10 @@ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
|
|
|
2957
3375
|
* WithIsVpc sets the VPC flag for the session parameters and returns the updated parameters.
|
|
2958
3376
|
*/
|
|
2959
3377
|
withIsVpc(isVpc: boolean): CreateSessionParams$1;
|
|
3378
|
+
/**
|
|
3379
|
+
* WithMcpPolicyId sets the MCP policy id for the session parameters and returns the updated parameters.
|
|
3380
|
+
*/
|
|
3381
|
+
withMcpPolicyId(mcpPolicyId: string): CreateSessionParams$1;
|
|
2960
3382
|
/**
|
|
2961
3383
|
* GetLabelsJSON returns the labels as a JSON string.
|
|
2962
3384
|
* Returns an object with success status and result/error message to match Go version behavior.
|
|
@@ -3021,12 +3443,12 @@ interface SessionListResult extends ApiResponse {
|
|
|
3021
3443
|
* Parameters for creating a session.
|
|
3022
3444
|
*/
|
|
3023
3445
|
interface CreateSessionParams {
|
|
3024
|
-
contextId?: string;
|
|
3025
3446
|
labels?: Record<string, string>;
|
|
3026
3447
|
imageId?: string;
|
|
3027
3448
|
contextSync?: ContextSync[];
|
|
3028
3449
|
browserContext?: BrowserContext;
|
|
3029
3450
|
isVpc?: boolean;
|
|
3451
|
+
mcpPolicyId?: string;
|
|
3030
3452
|
}
|
|
3031
3453
|
/**
|
|
3032
3454
|
* Main class for interacting with the AgentBay cloud runtime environment.
|
|
@@ -3171,4 +3593,4 @@ declare function log(message: string, ...args: any[]): void;
|
|
|
3171
3593
|
*/
|
|
3172
3594
|
declare function logError(message: string, error?: any): void;
|
|
3173
3595
|
|
|
3174
|
-
export { APIError, type ActOptions, ActResult, Agent, AgentBay, AgentBayError, Application, ApplicationError, ApplyMqttTokenRequest, ApplyMqttTokenResponse, ApplyMqttTokenResponseBody, ApplyMqttTokenResponseBodyData, AuthenticationError, type BWList, Browser, BrowserAgent, type BrowserContext, BrowserError, type BrowserOption, CallMcpToolRequest, CallMcpToolResponse, CallMcpToolResponseBody, Client, Command, CommandError, Context, type ContextInfoResult, ContextManager, ContextService, type ContextStatusData, type ContextStatusItem, ContextSync, type ContextSyncResult, CreateMcpSessionRequest, CreateMcpSessionRequestPersistenceDataList, CreateMcpSessionResponse, CreateMcpSessionResponseBody, CreateMcpSessionResponseBodyData, CreateMcpSessionShrinkRequest, type CreateSessionParams, type CreateSessionParamsConfig, DeleteContextRequest, DeleteContextResponse, DeleteContextResponseBody, type DeletePolicy, type DirectoryEntry, type DownloadPolicy, DownloadStrategy, type ExecutionResult, type ExtractOptions, FileError, type FileInfo, FileSystem, GetContextInfoRequest, GetContextInfoResponse, GetContextInfoResponseBody, GetContextInfoResponseBodyData, GetContextRequest, GetContextResponse, GetContextResponseBody, GetContextResponseBodyData, GetLabelRequest, GetLabelResponse, GetLabelResponseBody, GetLabelResponseBodyData, GetLinkRequest, GetLinkResponse, GetLinkResponseBody, GetLinkResponseBodyData, GetMcpResourceRequest, GetMcpResourceResponse, GetMcpResourceResponseBody, GetMcpResourceResponseBodyData, GetMcpResourceResponseBodyDataDesktopInfo, InitBrowserRequest, InitBrowserResponse, InitBrowserResponseBody, InitBrowserResponseBodyData, type InstalledApp, KeyCode, ListContextsRequest, ListContextsResponse, ListContextsResponseBody, ListContextsResponseBodyData, ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsResponseBody, type ListSessionParams, ListSessionRequest, ListSessionResponse, ListSessionResponseBody, ListSessionResponseBodyData, type McpSession, type McpToolResult, ModifyContextRequest, ModifyContextResponse, ModifyContextResponseBody, type ObserveOptions, ObserveResult, Oss, OssError, type Process, type QueryResult, ReleaseMcpSessionRequest, ReleaseMcpSessionResponse, ReleaseMcpSessionResponseBody, Session, SessionError, type SessionInterface, SetLabelRequest, SetLabelResponse, SetLabelResponseBody, SyncContextRequest, SyncContextResponse, SyncContextResponseBody, type SyncPolicy, SyncPolicyImpl, UI, type UIElement, UIError, type UploadPolicy, UploadStrategy, type WhiteList, log, logError, newContextManager, newContextSync, newCreateSessionParams, newDeletePolicy, newDownloadPolicy, newSyncPolicy, newSyncPolicyWithDefaults, newUploadPolicy };
|
|
3596
|
+
export { APIError, type ActOptions, ActResult, Agent, AgentBay, AgentBayError, Application, ApplicationError, ApplyMqttTokenRequest, ApplyMqttTokenResponse, ApplyMqttTokenResponseBody, ApplyMqttTokenResponseBodyData, AuthenticationError, type BWList, Browser, BrowserAgent, type BrowserContext, BrowserError, type BrowserFingerprint, type BrowserOption, BrowserOptionClass, type BrowserProxy, BrowserProxyClass, type BrowserScreen, type BrowserViewport, CallMcpToolRequest, CallMcpToolResponse, CallMcpToolResponseBody, Client, Command, CommandError, Context, type ContextInfoResult, ContextManager, ContextService, type ContextStatusData, type ContextStatusItem, ContextSync, type ContextSyncResult, CreateMcpSessionRequest, CreateMcpSessionRequestPersistenceDataList, CreateMcpSessionResponse, CreateMcpSessionResponseBody, CreateMcpSessionResponseBodyData, CreateMcpSessionShrinkRequest, type CreateSessionParams, type CreateSessionParamsConfig, DeleteContextFileRequest, DeleteContextFileResponse, DeleteContextFileResponseBody, DeleteContextRequest, DeleteContextResponse, DeleteContextResponseBody, type DeletePolicy, DescribeContextFilesRequest, DescribeContextFilesResponse, DescribeContextFilesResponseBody, type DirectoryEntry, type DownloadPolicy, DownloadStrategy, type ExecutionResult, type ExtractOptions, FileError, type FileInfo, FileSystem, GetContextFileDownloadUrlRequest, GetContextFileDownloadUrlResponse, GetContextFileDownloadUrlResponseBody, GetContextFileUploadUrlRequest, GetContextFileUploadUrlResponse, GetContextFileUploadUrlResponseBody, GetContextInfoRequest, GetContextInfoResponse, GetContextInfoResponseBody, GetContextInfoResponseBodyData, GetContextRequest, GetContextResponse, GetContextResponseBody, GetContextResponseBodyData, GetLabelRequest, GetLabelResponse, GetLabelResponseBody, GetLabelResponseBodyData, GetLinkRequest, GetLinkResponse, GetLinkResponseBody, GetLinkResponseBodyData, GetMcpResourceRequest, GetMcpResourceResponse, GetMcpResourceResponseBody, GetMcpResourceResponseBodyData, GetMcpResourceResponseBodyDataDesktopInfo, InitBrowserRequest, InitBrowserResponse, InitBrowserResponseBody, InitBrowserResponseBodyData, type InstalledApp, KeyCode, ListContextsRequest, ListContextsResponse, ListContextsResponseBody, ListContextsResponseBodyData, ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsResponseBody, type ListSessionParams, ListSessionRequest, ListSessionResponse, ListSessionResponseBody, ListSessionResponseBodyData, type McpSession, type McpToolResult, ModifyContextRequest, ModifyContextResponse, ModifyContextResponseBody, type ObserveOptions, ObserveResult, Oss, OssError, type Process, type QueryResult, ReleaseMcpSessionRequest, ReleaseMcpSessionResponse, ReleaseMcpSessionResponseBody, Session, SessionError, type SessionInterface, SetLabelRequest, SetLabelResponse, SetLabelResponseBody, SyncContextRequest, SyncContextResponse, SyncContextResponseBody, type SyncPolicy, SyncPolicyImpl, UI, type UIElement, UIError, type UploadPolicy, UploadStrategy, type WhiteList, log, logError, newContextManager, newContextSync, newCreateSessionParams, newDeletePolicy, newDownloadPolicy, newSyncPolicy, newSyncPolicyWithDefaults, newUploadPolicy };
|