test-wuying-agentbay-sdk 0.13.0-beta.20251212103901 → 0.13.0-beta.20251212112552

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.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('Open
3199
- * notepad', 10); console.log(`Task status: ${taskResult.taskStatus}`); await
3200
- * result.session.delete();
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
- * result.session.agent.computer.executeTask('Open notepad', 5); const
3239
- * terminateResult = await
3240
- * result.session.agent.computer.terminateTask(taskResult.taskId);
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
- * result.session.agent.browser.executeTask('Navigate to baidu and query the
3291
- * weather of Shanghai', 10); console.log(`Task status:
3292
- * ${taskResult.taskStatus}`); await result.session.delete();
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: 'windows_latest' });
3337
+ * const result = await agentBay.create({ imageId: 'linux_latest' });
3307
3338
  * if (result.success) {
3308
- * const taskResult = await
3309
- * result.session.agent.browser.executeTask(Navigate to baidu and query the
3310
- * weather of Shanghai, 10); const statusResult = await
3311
- * result.session.agent.browser.getTaskStatus(taskResult.taskId);
3312
- * console.log(`Status:
3313
- * ${JSON.parse(statusResult.output).status}`); await
3314
- * result.session.delete();
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: 'windows_latest' });
3362
+ * const result = await agentBay.create({ imageId: 'linux_latest' });
3330
3363
  * if (result.success) {
3331
- * const taskResult = await
3332
- * result.session.agent.browser.executeTask(Navigate to baidu and query the
3333
- * weather of Shanghai, 10); const terminateResult = await
3334
- * result.session.agent.browser.terminateTask(taskResult.taskId);
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('Open
3199
- * notepad', 10); console.log(`Task status: ${taskResult.taskStatus}`); await
3200
- * result.session.delete();
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
- * result.session.agent.computer.executeTask('Open notepad', 5); const
3239
- * terminateResult = await
3240
- * result.session.agent.computer.terminateTask(taskResult.taskId);
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
- * result.session.agent.browser.executeTask('Navigate to baidu and query the
3291
- * weather of Shanghai', 10); console.log(`Task status:
3292
- * ${taskResult.taskStatus}`); await result.session.delete();
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: 'windows_latest' });
3337
+ * const result = await agentBay.create({ imageId: 'linux_latest' });
3307
3338
  * if (result.success) {
3308
- * const taskResult = await
3309
- * result.session.agent.browser.executeTask(Navigate to baidu and query the
3310
- * weather of Shanghai, 10); const statusResult = await
3311
- * result.session.agent.browser.getTaskStatus(taskResult.taskId);
3312
- * console.log(`Status:
3313
- * ${JSON.parse(statusResult.output).status}`); await
3314
- * result.session.delete();
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: 'windows_latest' });
3362
+ * const result = await agentBay.create({ imageId: 'linux_latest' });
3330
3363
  * if (result.success) {
3331
- * const taskResult = await
3332
- * result.session.agent.browser.executeTask(Navigate to baidu and query the
3333
- * weather of Shanghai, 10); const terminateResult = await
3334
- * result.session.agent.browser.terminateTask(taskResult.taskId);
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('Open
3744
- * notepad', 10); console.log(`Task status: ${taskResult.taskStatus}`); await
3745
- * result.session.delete();
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
- * result.session.agent.computer.executeTask('Open notepad', 5); const
3931
- * terminateResult = await
3932
- * result.session.agent.computer.terminateTask(taskResult.taskId);
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
- * result.session.agent.browser.executeTask('Navigate to baidu and query the
4058
- * weather of Shanghai', 10); console.log(`Task status:
4059
- * ${taskResult.taskStatus}`); await result.session.delete();
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: 'windows_latest' });
4206
+ * const result = await agentBay.create({ imageId: 'linux_latest' });
4176
4207
  * if (result.success) {
4177
- * const taskResult = await
4178
- * result.session.agent.browser.executeTask(Navigate to baidu and query the
4179
- * weather of Shanghai, 10); const statusResult = await
4180
- * result.session.agent.browser.getTaskStatus(taskResult.taskId);
4181
- * console.log(`Status:
4182
- * ${JSON.parse(statusResult.output).status}`); await
4183
- * result.session.delete();
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: 'windows_latest' });
4276
+ * const result = await agentBay.create({ imageId: 'linux_latest' });
4244
4277
  * if (result.success) {
4245
- * const taskResult = await
4246
- * result.session.agent.browser.executeTask(Navigate to baidu and query the
4247
- * weather of Shanghai, 10); const terminateResult = await
4248
- * result.session.agent.browser.terminateTask(taskResult.taskId);
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
  * }