test-wuying-agentbay-sdk 0.13.0-beta.20251212103901 → 0.13.0-beta.20251212114304
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/dist/index.cjs +60 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +60 -24
- package/dist/index.d.ts +60 -24
- package/dist/index.mjs +60 -24
- package/dist/index.mjs.map +1 -1
- package/docs/api/common-features/advanced/browser-use-agent.md +14 -9
- package/docs/api/common-features/advanced/computer-use-agent.md +13 -7
- package/docs/api/common-features/basics/command.md +1 -1
- package/docs/api/computer-use/computer.md +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3111,6 +3111,29 @@ declare class ContextSync {
|
|
|
3111
3111
|
contextId: string;
|
|
3112
3112
|
path: string;
|
|
3113
3113
|
policy?: SyncPolicy;
|
|
3114
|
+
/**
|
|
3115
|
+
* Defines a full context sync configuration with optional policy overrides.
|
|
3116
|
+
*
|
|
3117
|
+
* @example
|
|
3118
|
+
* ```typescript
|
|
3119
|
+
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3120
|
+
* const result = await agentBay.create();
|
|
3121
|
+
* if (result.success) {
|
|
3122
|
+
* const policy = new SyncPolicyImpl({
|
|
3123
|
+
* uploadPolicy: newUploadPolicy(),
|
|
3124
|
+
* downloadPolicy: newDownloadPolicy(),
|
|
3125
|
+
* recyclePolicy: newRecyclePolicy(),
|
|
3126
|
+
* });
|
|
3127
|
+
* const syncResult = await result.session.context.sync(
|
|
3128
|
+
* 'project-data',
|
|
3129
|
+
* '/mnt/shared',
|
|
3130
|
+
* 'upload'
|
|
3131
|
+
* );
|
|
3132
|
+
* console.log('Context sync:', syncResult.success);
|
|
3133
|
+
* await result.session.delete();
|
|
3134
|
+
* }
|
|
3135
|
+
* ```
|
|
3136
|
+
*/
|
|
3114
3137
|
constructor(contextId: string, path: string, policy?: SyncPolicy);
|
|
3115
3138
|
withPolicy(policy: SyncPolicy): ContextSync;
|
|
3116
3139
|
}
|
|
@@ -3195,9 +3218,12 @@ declare class ComputerUseAgent {
|
|
|
3195
3218
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3196
3219
|
* const result = await agentBay.create({ imageId: 'windows_latest' });
|
|
3197
3220
|
* if (result.success) {
|
|
3198
|
-
* const taskResult = await result.session.agent.computer.executeTask(
|
|
3199
|
-
* notepad',
|
|
3200
|
-
*
|
|
3221
|
+
* const taskResult = await result.session.agent.computer.executeTask(
|
|
3222
|
+
* 'Open notepad',
|
|
3223
|
+
* 10
|
|
3224
|
+
* );
|
|
3225
|
+
* console.log(`Task status: ${taskResult.taskStatus}`);
|
|
3226
|
+
* await result.session.delete();
|
|
3201
3227
|
* }
|
|
3202
3228
|
* ```
|
|
3203
3229
|
*/
|
|
@@ -3234,10 +3260,13 @@ declare class ComputerUseAgent {
|
|
|
3234
3260
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3235
3261
|
* const result = await agentBay.create({ imageId: 'windows_latest' });
|
|
3236
3262
|
* if (result.success) {
|
|
3237
|
-
* const taskResult = await
|
|
3238
|
-
*
|
|
3239
|
-
*
|
|
3240
|
-
*
|
|
3263
|
+
* const taskResult = await result.session.agent.computer.executeTask(
|
|
3264
|
+
* 'Open notepad',
|
|
3265
|
+
* 5
|
|
3266
|
+
* );
|
|
3267
|
+
* const terminateResult = await result.session.agent.computer.terminateTask(
|
|
3268
|
+
* taskResult.taskId
|
|
3269
|
+
* );
|
|
3241
3270
|
* console.log(`Terminated: ${terminateResult.taskStatus}`);
|
|
3242
3271
|
* await result.session.delete();
|
|
3243
3272
|
* }
|
|
@@ -3286,10 +3315,12 @@ declare class BrowserUseAgent {
|
|
|
3286
3315
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3287
3316
|
* const result = await agentBay.create({ imageId: 'linux_latest' });
|
|
3288
3317
|
* if (result.success) {
|
|
3289
|
-
* const taskResult = await
|
|
3290
|
-
*
|
|
3291
|
-
*
|
|
3292
|
-
*
|
|
3318
|
+
* const taskResult = await result.session.agent.browser.executeTask(
|
|
3319
|
+
* 'Navigate to baidu and query the weather of Shanghai',
|
|
3320
|
+
* 10
|
|
3321
|
+
* );
|
|
3322
|
+
* console.log(`Task status: ${taskResult.taskStatus}`);
|
|
3323
|
+
* await result.session.delete();
|
|
3293
3324
|
* }
|
|
3294
3325
|
* ```
|
|
3295
3326
|
*/
|
|
@@ -3303,15 +3334,17 @@ declare class BrowserUseAgent {
|
|
|
3303
3334
|
* @example
|
|
3304
3335
|
* ```typescript
|
|
3305
3336
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3306
|
-
* const result = await agentBay.create({ imageId: '
|
|
3337
|
+
* const result = await agentBay.create({ imageId: 'linux_latest' });
|
|
3307
3338
|
* if (result.success) {
|
|
3308
|
-
* const taskResult = await
|
|
3309
|
-
*
|
|
3310
|
-
*
|
|
3311
|
-
*
|
|
3312
|
-
*
|
|
3313
|
-
*
|
|
3314
|
-
*
|
|
3339
|
+
* const taskResult = await result.session.agent.browser.executeTask(
|
|
3340
|
+
* 'Navigate to baidu and query the weather of Shanghai',
|
|
3341
|
+
* 10
|
|
3342
|
+
* );
|
|
3343
|
+
* const statusResult = await result.session.agent.browser.getTaskStatus(
|
|
3344
|
+
* taskResult.taskId
|
|
3345
|
+
* );
|
|
3346
|
+
* console.log(`Status: ${statusResult.taskStatus}`);
|
|
3347
|
+
* await result.session.delete();
|
|
3315
3348
|
* }
|
|
3316
3349
|
* ```
|
|
3317
3350
|
*/
|
|
@@ -3326,12 +3359,15 @@ declare class BrowserUseAgent {
|
|
|
3326
3359
|
* @example
|
|
3327
3360
|
* ```typescript
|
|
3328
3361
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3329
|
-
* const result = await agentBay.create({ imageId: '
|
|
3362
|
+
* const result = await agentBay.create({ imageId: 'linux_latest' });
|
|
3330
3363
|
* if (result.success) {
|
|
3331
|
-
* const taskResult = await
|
|
3332
|
-
*
|
|
3333
|
-
*
|
|
3334
|
-
*
|
|
3364
|
+
* const taskResult = await result.session.agent.browser.executeTask(
|
|
3365
|
+
* 'Navigate to baidu and query the weather of Shanghai',
|
|
3366
|
+
* 10
|
|
3367
|
+
* );
|
|
3368
|
+
* const terminateResult = await result.session.agent.browser.terminateTask(
|
|
3369
|
+
* taskResult.taskId
|
|
3370
|
+
* );
|
|
3335
3371
|
* console.log(`Terminated: ${terminateResult.taskStatus}`);
|
|
3336
3372
|
* await result.session.delete();
|
|
3337
3373
|
* }
|
package/dist/index.d.ts
CHANGED
|
@@ -3111,6 +3111,29 @@ declare class ContextSync {
|
|
|
3111
3111
|
contextId: string;
|
|
3112
3112
|
path: string;
|
|
3113
3113
|
policy?: SyncPolicy;
|
|
3114
|
+
/**
|
|
3115
|
+
* Defines a full context sync configuration with optional policy overrides.
|
|
3116
|
+
*
|
|
3117
|
+
* @example
|
|
3118
|
+
* ```typescript
|
|
3119
|
+
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3120
|
+
* const result = await agentBay.create();
|
|
3121
|
+
* if (result.success) {
|
|
3122
|
+
* const policy = new SyncPolicyImpl({
|
|
3123
|
+
* uploadPolicy: newUploadPolicy(),
|
|
3124
|
+
* downloadPolicy: newDownloadPolicy(),
|
|
3125
|
+
* recyclePolicy: newRecyclePolicy(),
|
|
3126
|
+
* });
|
|
3127
|
+
* const syncResult = await result.session.context.sync(
|
|
3128
|
+
* 'project-data',
|
|
3129
|
+
* '/mnt/shared',
|
|
3130
|
+
* 'upload'
|
|
3131
|
+
* );
|
|
3132
|
+
* console.log('Context sync:', syncResult.success);
|
|
3133
|
+
* await result.session.delete();
|
|
3134
|
+
* }
|
|
3135
|
+
* ```
|
|
3136
|
+
*/
|
|
3114
3137
|
constructor(contextId: string, path: string, policy?: SyncPolicy);
|
|
3115
3138
|
withPolicy(policy: SyncPolicy): ContextSync;
|
|
3116
3139
|
}
|
|
@@ -3195,9 +3218,12 @@ declare class ComputerUseAgent {
|
|
|
3195
3218
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3196
3219
|
* const result = await agentBay.create({ imageId: 'windows_latest' });
|
|
3197
3220
|
* if (result.success) {
|
|
3198
|
-
* const taskResult = await result.session.agent.computer.executeTask(
|
|
3199
|
-
* notepad',
|
|
3200
|
-
*
|
|
3221
|
+
* const taskResult = await result.session.agent.computer.executeTask(
|
|
3222
|
+
* 'Open notepad',
|
|
3223
|
+
* 10
|
|
3224
|
+
* );
|
|
3225
|
+
* console.log(`Task status: ${taskResult.taskStatus}`);
|
|
3226
|
+
* await result.session.delete();
|
|
3201
3227
|
* }
|
|
3202
3228
|
* ```
|
|
3203
3229
|
*/
|
|
@@ -3234,10 +3260,13 @@ declare class ComputerUseAgent {
|
|
|
3234
3260
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3235
3261
|
* const result = await agentBay.create({ imageId: 'windows_latest' });
|
|
3236
3262
|
* if (result.success) {
|
|
3237
|
-
* const taskResult = await
|
|
3238
|
-
*
|
|
3239
|
-
*
|
|
3240
|
-
*
|
|
3263
|
+
* const taskResult = await result.session.agent.computer.executeTask(
|
|
3264
|
+
* 'Open notepad',
|
|
3265
|
+
* 5
|
|
3266
|
+
* );
|
|
3267
|
+
* const terminateResult = await result.session.agent.computer.terminateTask(
|
|
3268
|
+
* taskResult.taskId
|
|
3269
|
+
* );
|
|
3241
3270
|
* console.log(`Terminated: ${terminateResult.taskStatus}`);
|
|
3242
3271
|
* await result.session.delete();
|
|
3243
3272
|
* }
|
|
@@ -3286,10 +3315,12 @@ declare class BrowserUseAgent {
|
|
|
3286
3315
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3287
3316
|
* const result = await agentBay.create({ imageId: 'linux_latest' });
|
|
3288
3317
|
* if (result.success) {
|
|
3289
|
-
* const taskResult = await
|
|
3290
|
-
*
|
|
3291
|
-
*
|
|
3292
|
-
*
|
|
3318
|
+
* const taskResult = await result.session.agent.browser.executeTask(
|
|
3319
|
+
* 'Navigate to baidu and query the weather of Shanghai',
|
|
3320
|
+
* 10
|
|
3321
|
+
* );
|
|
3322
|
+
* console.log(`Task status: ${taskResult.taskStatus}`);
|
|
3323
|
+
* await result.session.delete();
|
|
3293
3324
|
* }
|
|
3294
3325
|
* ```
|
|
3295
3326
|
*/
|
|
@@ -3303,15 +3334,17 @@ declare class BrowserUseAgent {
|
|
|
3303
3334
|
* @example
|
|
3304
3335
|
* ```typescript
|
|
3305
3336
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3306
|
-
* const result = await agentBay.create({ imageId: '
|
|
3337
|
+
* const result = await agentBay.create({ imageId: 'linux_latest' });
|
|
3307
3338
|
* if (result.success) {
|
|
3308
|
-
* const taskResult = await
|
|
3309
|
-
*
|
|
3310
|
-
*
|
|
3311
|
-
*
|
|
3312
|
-
*
|
|
3313
|
-
*
|
|
3314
|
-
*
|
|
3339
|
+
* const taskResult = await result.session.agent.browser.executeTask(
|
|
3340
|
+
* 'Navigate to baidu and query the weather of Shanghai',
|
|
3341
|
+
* 10
|
|
3342
|
+
* );
|
|
3343
|
+
* const statusResult = await result.session.agent.browser.getTaskStatus(
|
|
3344
|
+
* taskResult.taskId
|
|
3345
|
+
* );
|
|
3346
|
+
* console.log(`Status: ${statusResult.taskStatus}`);
|
|
3347
|
+
* await result.session.delete();
|
|
3315
3348
|
* }
|
|
3316
3349
|
* ```
|
|
3317
3350
|
*/
|
|
@@ -3326,12 +3359,15 @@ declare class BrowserUseAgent {
|
|
|
3326
3359
|
* @example
|
|
3327
3360
|
* ```typescript
|
|
3328
3361
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3329
|
-
* const result = await agentBay.create({ imageId: '
|
|
3362
|
+
* const result = await agentBay.create({ imageId: 'linux_latest' });
|
|
3330
3363
|
* if (result.success) {
|
|
3331
|
-
* const taskResult = await
|
|
3332
|
-
*
|
|
3333
|
-
*
|
|
3334
|
-
*
|
|
3364
|
+
* const taskResult = await result.session.agent.browser.executeTask(
|
|
3365
|
+
* 'Navigate to baidu and query the weather of Shanghai',
|
|
3366
|
+
* 10
|
|
3367
|
+
* );
|
|
3368
|
+
* const terminateResult = await result.session.agent.browser.terminateTask(
|
|
3369
|
+
* taskResult.taskId
|
|
3370
|
+
* );
|
|
3335
3371
|
* console.log(`Terminated: ${terminateResult.taskStatus}`);
|
|
3336
3372
|
* await result.session.delete();
|
|
3337
3373
|
* }
|
package/dist/index.mjs
CHANGED
|
@@ -3585,6 +3585,29 @@ var _SyncPolicyImpl = class _SyncPolicyImpl {
|
|
|
3585
3585
|
__name(_SyncPolicyImpl, "SyncPolicyImpl");
|
|
3586
3586
|
var SyncPolicyImpl = _SyncPolicyImpl;
|
|
3587
3587
|
var _ContextSync = class _ContextSync {
|
|
3588
|
+
/**
|
|
3589
|
+
* Defines a full context sync configuration with optional policy overrides.
|
|
3590
|
+
*
|
|
3591
|
+
* @example
|
|
3592
|
+
* ```typescript
|
|
3593
|
+
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3594
|
+
* const result = await agentBay.create();
|
|
3595
|
+
* if (result.success) {
|
|
3596
|
+
* const policy = new SyncPolicyImpl({
|
|
3597
|
+
* uploadPolicy: newUploadPolicy(),
|
|
3598
|
+
* downloadPolicy: newDownloadPolicy(),
|
|
3599
|
+
* recyclePolicy: newRecyclePolicy(),
|
|
3600
|
+
* });
|
|
3601
|
+
* const syncResult = await result.session.context.sync(
|
|
3602
|
+
* 'project-data',
|
|
3603
|
+
* '/mnt/shared',
|
|
3604
|
+
* 'upload'
|
|
3605
|
+
* );
|
|
3606
|
+
* console.log('Context sync:', syncResult.success);
|
|
3607
|
+
* await result.session.delete();
|
|
3608
|
+
* }
|
|
3609
|
+
* ```
|
|
3610
|
+
*/
|
|
3588
3611
|
constructor(contextId, path6, policy) {
|
|
3589
3612
|
if (policy) {
|
|
3590
3613
|
validateSyncPolicy(policy);
|
|
@@ -3740,9 +3763,12 @@ var _ComputerUseAgent = class _ComputerUseAgent {
|
|
|
3740
3763
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3741
3764
|
* const result = await agentBay.create({ imageId: 'windows_latest' });
|
|
3742
3765
|
* if (result.success) {
|
|
3743
|
-
* const taskResult = await result.session.agent.computer.executeTask(
|
|
3744
|
-
* notepad',
|
|
3745
|
-
*
|
|
3766
|
+
* const taskResult = await result.session.agent.computer.executeTask(
|
|
3767
|
+
* 'Open notepad',
|
|
3768
|
+
* 10
|
|
3769
|
+
* );
|
|
3770
|
+
* console.log(`Task status: ${taskResult.taskStatus}`);
|
|
3771
|
+
* await result.session.delete();
|
|
3746
3772
|
* }
|
|
3747
3773
|
* ```
|
|
3748
3774
|
*/
|
|
@@ -3926,10 +3952,13 @@ var _ComputerUseAgent = class _ComputerUseAgent {
|
|
|
3926
3952
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
3927
3953
|
* const result = await agentBay.create({ imageId: 'windows_latest' });
|
|
3928
3954
|
* if (result.success) {
|
|
3929
|
-
* const taskResult = await
|
|
3930
|
-
*
|
|
3931
|
-
*
|
|
3932
|
-
*
|
|
3955
|
+
* const taskResult = await result.session.agent.computer.executeTask(
|
|
3956
|
+
* 'Open notepad',
|
|
3957
|
+
* 5
|
|
3958
|
+
* );
|
|
3959
|
+
* const terminateResult = await result.session.agent.computer.terminateTask(
|
|
3960
|
+
* taskResult.taskId
|
|
3961
|
+
* );
|
|
3933
3962
|
* console.log(`Terminated: ${terminateResult.taskStatus}`);
|
|
3934
3963
|
* await result.session.delete();
|
|
3935
3964
|
* }
|
|
@@ -4053,10 +4082,12 @@ var _BrowserUseAgent = class _BrowserUseAgent {
|
|
|
4053
4082
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
4054
4083
|
* const result = await agentBay.create({ imageId: 'linux_latest' });
|
|
4055
4084
|
* if (result.success) {
|
|
4056
|
-
* const taskResult = await
|
|
4057
|
-
*
|
|
4058
|
-
*
|
|
4059
|
-
*
|
|
4085
|
+
* const taskResult = await result.session.agent.browser.executeTask(
|
|
4086
|
+
* 'Navigate to baidu and query the weather of Shanghai',
|
|
4087
|
+
* 10
|
|
4088
|
+
* );
|
|
4089
|
+
* console.log(`Task status: ${taskResult.taskStatus}`);
|
|
4090
|
+
* await result.session.delete();
|
|
4060
4091
|
* }
|
|
4061
4092
|
* ```
|
|
4062
4093
|
*/
|
|
@@ -4172,15 +4203,17 @@ var _BrowserUseAgent = class _BrowserUseAgent {
|
|
|
4172
4203
|
* @example
|
|
4173
4204
|
* ```typescript
|
|
4174
4205
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
4175
|
-
* const result = await agentBay.create({ imageId: '
|
|
4206
|
+
* const result = await agentBay.create({ imageId: 'linux_latest' });
|
|
4176
4207
|
* if (result.success) {
|
|
4177
|
-
* const taskResult = await
|
|
4178
|
-
*
|
|
4179
|
-
*
|
|
4180
|
-
*
|
|
4181
|
-
*
|
|
4182
|
-
*
|
|
4183
|
-
*
|
|
4208
|
+
* const taskResult = await result.session.agent.browser.executeTask(
|
|
4209
|
+
* 'Navigate to baidu and query the weather of Shanghai',
|
|
4210
|
+
* 10
|
|
4211
|
+
* );
|
|
4212
|
+
* const statusResult = await result.session.agent.browser.getTaskStatus(
|
|
4213
|
+
* taskResult.taskId
|
|
4214
|
+
* );
|
|
4215
|
+
* console.log(`Status: ${statusResult.taskStatus}`);
|
|
4216
|
+
* await result.session.delete();
|
|
4184
4217
|
* }
|
|
4185
4218
|
* ```
|
|
4186
4219
|
*/
|
|
@@ -4240,12 +4273,15 @@ var _BrowserUseAgent = class _BrowserUseAgent {
|
|
|
4240
4273
|
* @example
|
|
4241
4274
|
* ```typescript
|
|
4242
4275
|
* const agentBay = new AgentBay({ apiKey: 'your_api_key' });
|
|
4243
|
-
* const result = await agentBay.create({ imageId: '
|
|
4276
|
+
* const result = await agentBay.create({ imageId: 'linux_latest' });
|
|
4244
4277
|
* if (result.success) {
|
|
4245
|
-
* const taskResult = await
|
|
4246
|
-
*
|
|
4247
|
-
*
|
|
4248
|
-
*
|
|
4278
|
+
* const taskResult = await result.session.agent.browser.executeTask(
|
|
4279
|
+
* 'Navigate to baidu and query the weather of Shanghai',
|
|
4280
|
+
* 10
|
|
4281
|
+
* );
|
|
4282
|
+
* const terminateResult = await result.session.agent.browser.terminateTask(
|
|
4283
|
+
* taskResult.taskId
|
|
4284
|
+
* );
|
|
4249
4285
|
* console.log(`Terminated: ${terminateResult.taskStatus}`);
|
|
4250
4286
|
* await result.session.delete();
|
|
4251
4287
|
* }
|