wuying-agentbay-sdk 0.1.0 → 0.3.3

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.
Files changed (176) hide show
  1. package/README.md +124 -61
  2. package/dist/index.cjs +7848 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.mts +3174 -0
  5. package/dist/index.d.ts +3174 -0
  6. package/dist/index.mjs +7864 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +86 -48
  9. package/dist/src/adb/adb.d.ts +0 -20
  10. package/dist/src/adb/adb.js +0 -57
  11. package/dist/src/adb/index.d.ts +0 -1
  12. package/dist/src/adb/index.js +0 -17
  13. package/dist/src/agent-bay.d.ts +0 -68
  14. package/dist/src/agent-bay.js +0 -213
  15. package/dist/src/api/client.d.ts +0 -191
  16. package/dist/src/api/client.js +0 -629
  17. package/dist/src/api/index.d.ts +0 -4
  18. package/dist/src/api/index.js +0 -26
  19. package/dist/src/api/models/CallMcpToolRequest.d.ts +0 -21
  20. package/dist/src/api/models/CallMcpToolRequest.js +0 -71
  21. package/dist/src/api/models/CallMcpToolResponse.d.ts +0 -19
  22. package/dist/src/api/models/CallMcpToolResponse.js +0 -68
  23. package/dist/src/api/models/CallMcpToolResponseBody.d.ts +0 -19
  24. package/dist/src/api/models/CallMcpToolResponseBody.js +0 -67
  25. package/dist/src/api/models/CreateMcpSessionRequest.d.ts +0 -19
  26. package/dist/src/api/models/CreateMcpSessionRequest.js +0 -67
  27. package/dist/src/api/models/CreateMcpSessionResponse.d.ts +0 -19
  28. package/dist/src/api/models/CreateMcpSessionResponse.js +0 -68
  29. package/dist/src/api/models/CreateMcpSessionResponseBody.d.ts +0 -20
  30. package/dist/src/api/models/CreateMcpSessionResponseBody.js +0 -71
  31. package/dist/src/api/models/CreateMcpSessionResponseBodyData.d.ts +0 -19
  32. package/dist/src/api/models/CreateMcpSessionResponseBodyData.js +0 -67
  33. package/dist/src/api/models/DeleteContextRequest.d.ts +0 -15
  34. package/dist/src/api/models/DeleteContextRequest.js +0 -59
  35. package/dist/src/api/models/DeleteContextResponse.d.ts +0 -19
  36. package/dist/src/api/models/DeleteContextResponse.js +0 -68
  37. package/dist/src/api/models/DeleteContextResponseBody.d.ts +0 -18
  38. package/dist/src/api/models/DeleteContextResponseBody.js +0 -65
  39. package/dist/src/api/models/GetContextRequest.d.ts +0 -16
  40. package/dist/src/api/models/GetContextRequest.js +0 -61
  41. package/dist/src/api/models/GetContextResponse.d.ts +0 -19
  42. package/dist/src/api/models/GetContextResponse.js +0 -68
  43. package/dist/src/api/models/GetContextResponseBody.d.ts +0 -20
  44. package/dist/src/api/models/GetContextResponseBody.js +0 -71
  45. package/dist/src/api/models/GetContextResponseBodyData.d.ts +0 -19
  46. package/dist/src/api/models/GetContextResponseBodyData.js +0 -67
  47. package/dist/src/api/models/GetLabelRequest.d.ts +0 -17
  48. package/dist/src/api/models/GetLabelRequest.js +0 -63
  49. package/dist/src/api/models/GetLabelResponse.d.ts +0 -19
  50. package/dist/src/api/models/GetLabelResponse.js +0 -68
  51. package/dist/src/api/models/GetLabelResponseBody.d.ts +0 -23
  52. package/dist/src/api/models/GetLabelResponseBody.js +0 -77
  53. package/dist/src/api/models/GetLabelResponseBodyData.d.ts +0 -14
  54. package/dist/src/api/models/GetLabelResponseBodyData.js +0 -57
  55. package/dist/src/api/models/GetLinkRequest.d.ts +0 -15
  56. package/dist/src/api/models/GetLinkRequest.js +0 -59
  57. package/dist/src/api/models/GetLinkResponse.d.ts +0 -19
  58. package/dist/src/api/models/GetLinkResponse.js +0 -68
  59. package/dist/src/api/models/GetLinkResponseBody.d.ts +0 -19
  60. package/dist/src/api/models/GetLinkResponseBody.js +0 -67
  61. package/dist/src/api/models/GetMcpResourceRequest.d.ts +0 -15
  62. package/dist/src/api/models/GetMcpResourceRequest.js +0 -59
  63. package/dist/src/api/models/GetMcpResourceResponse.d.ts +0 -19
  64. package/dist/src/api/models/GetMcpResourceResponse.js +0 -68
  65. package/dist/src/api/models/GetMcpResourceResponseBody.d.ts +0 -20
  66. package/dist/src/api/models/GetMcpResourceResponseBody.js +0 -71
  67. package/dist/src/api/models/GetMcpResourceResponseBodyData.d.ts +0 -17
  68. package/dist/src/api/models/GetMcpResourceResponseBodyData.js +0 -65
  69. package/dist/src/api/models/GetMcpResourceResponseBodyDataDesktopInfo.d.ts +0 -18
  70. package/dist/src/api/models/GetMcpResourceResponseBodyDataDesktopInfo.js +0 -65
  71. package/dist/src/api/models/ListContextsRequest.d.ts +0 -16
  72. package/dist/src/api/models/ListContextsRequest.js +0 -61
  73. package/dist/src/api/models/ListContextsResponse.d.ts +0 -19
  74. package/dist/src/api/models/ListContextsResponse.js +0 -68
  75. package/dist/src/api/models/ListContextsResponseBody.d.ts +0 -23
  76. package/dist/src/api/models/ListContextsResponseBody.js +0 -77
  77. package/dist/src/api/models/ListContextsResponseBodyData.d.ts +0 -19
  78. package/dist/src/api/models/ListContextsResponseBodyData.js +0 -67
  79. package/dist/src/api/models/ListSessionRequest.d.ts +0 -17
  80. package/dist/src/api/models/ListSessionRequest.js +0 -63
  81. package/dist/src/api/models/ListSessionResponse.d.ts +0 -19
  82. package/dist/src/api/models/ListSessionResponse.js +0 -68
  83. package/dist/src/api/models/ListSessionResponseBody.d.ts +0 -23
  84. package/dist/src/api/models/ListSessionResponseBody.js +0 -77
  85. package/dist/src/api/models/ListSessionResponseBodyData.d.ts +0 -14
  86. package/dist/src/api/models/ListSessionResponseBodyData.js +0 -57
  87. package/dist/src/api/models/ModifyContextRequest.d.ts +0 -16
  88. package/dist/src/api/models/ModifyContextRequest.js +0 -61
  89. package/dist/src/api/models/ModifyContextResponse.d.ts +0 -19
  90. package/dist/src/api/models/ModifyContextResponse.js +0 -68
  91. package/dist/src/api/models/ModifyContextResponseBody.d.ts +0 -18
  92. package/dist/src/api/models/ModifyContextResponseBody.js +0 -65
  93. package/dist/src/api/models/ReleaseMcpSessionRequest.d.ts +0 -15
  94. package/dist/src/api/models/ReleaseMcpSessionRequest.js +0 -59
  95. package/dist/src/api/models/ReleaseMcpSessionResponse.d.ts +0 -19
  96. package/dist/src/api/models/ReleaseMcpSessionResponse.js +0 -68
  97. package/dist/src/api/models/ReleaseMcpSessionResponseBody.d.ts +0 -18
  98. package/dist/src/api/models/ReleaseMcpSessionResponseBody.js +0 -65
  99. package/dist/src/api/models/SetLabelRequest.d.ts +0 -16
  100. package/dist/src/api/models/SetLabelRequest.js +0 -61
  101. package/dist/src/api/models/SetLabelResponse.d.ts +0 -19
  102. package/dist/src/api/models/SetLabelResponse.js +0 -68
  103. package/dist/src/api/models/SetLabelResponseBody.d.ts +0 -18
  104. package/dist/src/api/models/SetLabelResponseBody.js +0 -65
  105. package/dist/src/api/models/model.d.ts +0 -43
  106. package/dist/src/api/models/model.js +0 -89
  107. package/dist/src/application/application.d.ts +0 -88
  108. package/dist/src/application/application.js +0 -172
  109. package/dist/src/application/index.d.ts +0 -1
  110. package/dist/src/application/index.js +0 -17
  111. package/dist/src/command/command.d.ts +0 -43
  112. package/dist/src/command/command.js +0 -120
  113. package/dist/src/command/index.d.ts +0 -1
  114. package/dist/src/command/index.js +0 -17
  115. package/dist/src/config.d.ts +0 -15
  116. package/dist/src/config.js +0 -114
  117. package/dist/src/context.d.ts +0 -87
  118. package/dist/src/context.js +0 -208
  119. package/dist/src/exceptions.d.ts +0 -30
  120. package/dist/src/exceptions.js +0 -58
  121. package/dist/src/filesystem/filesystem.d.ts +0 -109
  122. package/dist/src/filesystem/filesystem.js +0 -245
  123. package/dist/src/filesystem/index.d.ts +0 -1
  124. package/dist/src/filesystem/index.js +0 -17
  125. package/dist/src/index.d.ts +0 -10
  126. package/dist/src/index.js +0 -32
  127. package/dist/src/oss/index.d.ts +0 -1
  128. package/dist/src/oss/index.js +0 -5
  129. package/dist/src/oss/oss.d.ts +0 -80
  130. package/dist/src/oss/oss.js +0 -233
  131. package/dist/src/session.d.ts +0 -99
  132. package/dist/src/session.js +0 -226
  133. package/dist/src/ui/index.d.ts +0 -1
  134. package/dist/src/ui/index.js +0 -17
  135. package/dist/src/ui/ui.d.ts +0 -95
  136. package/dist/src/ui/ui.js +0 -206
  137. package/dist/src/utils/logger.d.ts +0 -15
  138. package/dist/src/utils/logger.js +0 -48
  139. package/dist/src/window/index.d.ts +0 -1
  140. package/dist/src/window/index.js +0 -17
  141. package/dist/src/window/window.d.ts +0 -109
  142. package/dist/src/window/window.js +0 -220
  143. package/dist/tests/agent-bay.test.d.ts +0 -1
  144. package/dist/tests/agent-bay.test.js +0 -366
  145. package/dist/tests/integration/context-persistence.test.d.ts +0 -1
  146. package/dist/tests/integration/context-persistence.test.js +0 -226
  147. package/dist/tests/integration/context-session.test.d.ts +0 -1
  148. package/dist/tests/integration/context-session.test.js +0 -223
  149. package/dist/tests/integration/window-operations.test.d.ts +0 -1
  150. package/dist/tests/integration/window-operations.test.js +0 -228
  151. package/dist/tests/unit/adb.test.d.ts +0 -1
  152. package/dist/tests/unit/adb.test.js +0 -60
  153. package/dist/tests/unit/agent-bay.test.d.ts +0 -1
  154. package/dist/tests/unit/agent-bay.test.js +0 -182
  155. package/dist/tests/unit/application.test.d.ts +0 -1
  156. package/dist/tests/unit/application.test.js +0 -260
  157. package/dist/tests/unit/command.test.d.ts +0 -1
  158. package/dist/tests/unit/command.test.js +0 -252
  159. package/dist/tests/unit/context.test.d.ts +0 -1
  160. package/dist/tests/unit/context.test.js +0 -199
  161. package/dist/tests/unit/filesystem.test.d.ts +0 -1
  162. package/dist/tests/unit/filesystem.test.js +0 -493
  163. package/dist/tests/unit/oss.test.d.ts +0 -1
  164. package/dist/tests/unit/oss.test.js +0 -243
  165. package/dist/tests/unit/session-labels.test.d.ts +0 -1
  166. package/dist/tests/unit/session-labels.test.js +0 -138
  167. package/dist/tests/unit/session-params.test.d.ts +0 -1
  168. package/dist/tests/unit/session-params.test.js +0 -78
  169. package/dist/tests/unit/session.test.d.ts +0 -1
  170. package/dist/tests/unit/session.test.js +0 -204
  171. package/dist/tests/unit/ui.test.d.ts +0 -1
  172. package/dist/tests/unit/ui.test.js +0 -158
  173. package/dist/tests/unit/window.test.d.ts +0 -1
  174. package/dist/tests/unit/window.test.js +0 -331
  175. package/dist/tests/utils/test-helpers.d.ts +0 -35
  176. package/dist/tests/utils/test-helpers.js +0 -79
@@ -0,0 +1,3174 @@
1
+ import * as $dara from '@darabonba/typescript';
2
+ import OpenApi, { $OpenApiUtil } from '@alicloud/openapi-core';
3
+
4
+ /**
5
+ */
6
+ declare class ApplyMqttTokenResponseBodyData extends $dara.Model {
7
+ accessKeyId?: string;
8
+ clientId?: string;
9
+ expiration?: string;
10
+ instanceId?: string;
11
+ regionId?: string;
12
+ securityToken?: string;
13
+ static names(): {
14
+ [key: string]: string;
15
+ };
16
+ static types(): {
17
+ [key: string]: any;
18
+ };
19
+ validate(): void;
20
+ constructor(map?: {
21
+ [key: string]: any;
22
+ });
23
+ }
24
+
25
+ declare class CreateMcpSessionRequestPersistenceDataList extends $dara.Model {
26
+ contextId?: string;
27
+ path?: string;
28
+ policy?: string;
29
+ static names(): {
30
+ [key: string]: string;
31
+ };
32
+ static types(): {
33
+ [key: string]: any;
34
+ };
35
+ validate(): void;
36
+ constructor(map?: {
37
+ [key: string]: any;
38
+ });
39
+ }
40
+
41
+ declare class CreateMcpSessionResponseBodyData extends $dara.Model {
42
+ appInstanceId?: string;
43
+ errMsg?: string;
44
+ httpPort?: string;
45
+ networkInterfaceIp?: string;
46
+ resourceId?: string;
47
+ resourceUrl?: string;
48
+ sessionId?: string;
49
+ success?: boolean;
50
+ vpcResource?: boolean;
51
+ static names(): {
52
+ [key: string]: string;
53
+ };
54
+ static types(): {
55
+ [key: string]: any;
56
+ };
57
+ validate(): void;
58
+ constructor(map?: {
59
+ [key: string]: any;
60
+ });
61
+ }
62
+
63
+ declare class GetContextResponseBodyData extends $dara.Model {
64
+ createTime?: string;
65
+ id?: string;
66
+ lastUsedTime?: string;
67
+ name?: string;
68
+ osType?: string;
69
+ state?: string;
70
+ static names(): {
71
+ [key: string]: string;
72
+ };
73
+ static types(): {
74
+ [key: string]: any;
75
+ };
76
+ validate(): void;
77
+ constructor(map?: {
78
+ [key: string]: any;
79
+ });
80
+ }
81
+
82
+ declare class GetContextInfoResponseBodyData extends $dara.Model {
83
+ contextStatus?: string;
84
+ static names(): {
85
+ [key: string]: string;
86
+ };
87
+ static types(): {
88
+ [key: string]: any;
89
+ };
90
+ validate(): void;
91
+ constructor(map?: {
92
+ [key: string]: any;
93
+ });
94
+ }
95
+
96
+ declare class GetLabelResponseBodyData extends $dara.Model {
97
+ labels?: string;
98
+ static names(): {
99
+ [key: string]: string;
100
+ };
101
+ static types(): {
102
+ [key: string]: any;
103
+ };
104
+ validate(): void;
105
+ constructor(map?: {
106
+ [key: string]: any;
107
+ });
108
+ }
109
+
110
+ declare class GetLinkResponseBodyData extends $dara.Model {
111
+ url?: string;
112
+ static names(): {
113
+ [key: string]: string;
114
+ };
115
+ static types(): {
116
+ [key: string]: any;
117
+ };
118
+ validate(): void;
119
+ constructor(map?: {
120
+ [key: string]: any;
121
+ });
122
+ }
123
+
124
+ declare class GetMcpResourceResponseBodyDataDesktopInfo extends $dara.Model {
125
+ appId?: string;
126
+ authCode?: string;
127
+ connectionProperties?: string;
128
+ resourceId?: string;
129
+ resourceType?: string;
130
+ ticket?: string;
131
+ static names(): {
132
+ [key: string]: string;
133
+ };
134
+ static types(): {
135
+ [key: string]: any;
136
+ };
137
+ validate(): void;
138
+ constructor(map?: {
139
+ [key: string]: any;
140
+ });
141
+ }
142
+
143
+ declare class GetMcpResourceResponseBodyData extends $dara.Model {
144
+ desktopInfo?: GetMcpResourceResponseBodyDataDesktopInfo;
145
+ resourceUrl?: string;
146
+ sessionId?: string;
147
+ static names(): {
148
+ [key: string]: string;
149
+ };
150
+ static types(): {
151
+ [key: string]: any;
152
+ };
153
+ validate(): void;
154
+ constructor(map?: {
155
+ [key: string]: any;
156
+ });
157
+ }
158
+
159
+ declare class ListContextsResponseBodyData extends $dara.Model {
160
+ createTime?: string;
161
+ id?: string;
162
+ lastUsedTime?: string;
163
+ name?: string;
164
+ osType?: string;
165
+ state?: string;
166
+ static names(): {
167
+ [key: string]: string;
168
+ };
169
+ static types(): {
170
+ [key: string]: any;
171
+ };
172
+ validate(): void;
173
+ constructor(map?: {
174
+ [key: string]: any;
175
+ });
176
+ }
177
+
178
+ declare class ListSessionResponseBodyData extends $dara.Model {
179
+ sessionId?: string;
180
+ static names(): {
181
+ [key: string]: string;
182
+ };
183
+ static types(): {
184
+ [key: string]: any;
185
+ };
186
+ validate(): void;
187
+ constructor(map?: {
188
+ [key: string]: any;
189
+ });
190
+ }
191
+
192
+ declare class ApplyMqttTokenRequest extends $dara.Model {
193
+ desktopId?: string;
194
+ sessionToken?: string;
195
+ static names(): {
196
+ [key: string]: string;
197
+ };
198
+ static types(): {
199
+ [key: string]: any;
200
+ };
201
+ validate(): void;
202
+ constructor(map?: {
203
+ [key: string]: any;
204
+ });
205
+ }
206
+
207
+ declare class ApplyMqttTokenResponseBody extends $dara.Model {
208
+ code?: string;
209
+ data?: ApplyMqttTokenResponseBodyData;
210
+ httpStatusCode?: number;
211
+ message?: string;
212
+ requestId?: string;
213
+ success?: boolean;
214
+ static names(): {
215
+ [key: string]: string;
216
+ };
217
+ static types(): {
218
+ [key: string]: any;
219
+ };
220
+ validate(): void;
221
+ constructor(map?: {
222
+ [key: string]: any;
223
+ });
224
+ }
225
+
226
+ declare class ApplyMqttTokenResponse extends $dara.Model {
227
+ headers?: {
228
+ [key: string]: string;
229
+ };
230
+ statusCode?: number;
231
+ body?: ApplyMqttTokenResponseBody;
232
+ static names(): {
233
+ [key: string]: string;
234
+ };
235
+ static types(): {
236
+ [key: string]: any;
237
+ };
238
+ validate(): void;
239
+ constructor(map?: {
240
+ [key: string]: any;
241
+ });
242
+ }
243
+
244
+ declare class CallMcpToolRequest extends $dara.Model {
245
+ args?: string;
246
+ authorization?: string;
247
+ externalUserId?: string;
248
+ imageId?: string;
249
+ name?: string;
250
+ server?: string;
251
+ sessionId?: string;
252
+ tool?: string;
253
+ static names(): {
254
+ [key: string]: string;
255
+ };
256
+ static types(): {
257
+ [key: string]: any;
258
+ };
259
+ validate(): void;
260
+ constructor(map?: {
261
+ [key: string]: any;
262
+ });
263
+ }
264
+
265
+ declare class CallMcpToolResponseBody extends $dara.Model {
266
+ code?: string;
267
+ data?: any;
268
+ httpStatusCode?: number;
269
+ message?: string;
270
+ requestId?: string;
271
+ success?: boolean;
272
+ static names(): {
273
+ [key: string]: string;
274
+ };
275
+ static types(): {
276
+ [key: string]: any;
277
+ };
278
+ validate(): void;
279
+ constructor(map?: {
280
+ [key: string]: any;
281
+ });
282
+ }
283
+
284
+ declare class CallMcpToolResponse extends $dara.Model {
285
+ headers?: {
286
+ [key: string]: string;
287
+ };
288
+ statusCode?: number;
289
+ body?: CallMcpToolResponseBody;
290
+ static names(): {
291
+ [key: string]: string;
292
+ };
293
+ static types(): {
294
+ [key: string]: any;
295
+ };
296
+ validate(): void;
297
+ constructor(map?: {
298
+ [key: string]: any;
299
+ });
300
+ }
301
+
302
+ declare class CreateMcpSessionRequest extends $dara.Model {
303
+ authorization?: string;
304
+ contextId?: string;
305
+ externalUserId?: string;
306
+ imageId?: string;
307
+ labels?: string;
308
+ persistenceDataList?: CreateMcpSessionRequestPersistenceDataList[];
309
+ sessionId?: string;
310
+ vpcResource?: boolean;
311
+ static names(): {
312
+ [key: string]: string;
313
+ };
314
+ static types(): {
315
+ [key: string]: any;
316
+ };
317
+ validate(): void;
318
+ constructor(map?: {
319
+ [key: string]: any;
320
+ });
321
+ }
322
+
323
+ declare class CreateMcpSessionShrinkRequest extends $dara.Model {
324
+ authorization?: string;
325
+ contextId?: string;
326
+ externalUserId?: string;
327
+ imageId?: string;
328
+ labels?: string;
329
+ persistenceDataListShrink?: string;
330
+ sessionId?: string;
331
+ vpcResource?: boolean;
332
+ static names(): {
333
+ [key: string]: string;
334
+ };
335
+ static types(): {
336
+ [key: string]: any;
337
+ };
338
+ validate(): void;
339
+ constructor(map?: {
340
+ [key: string]: any;
341
+ });
342
+ }
343
+
344
+ declare class CreateMcpSessionResponseBody extends $dara.Model {
345
+ code?: string;
346
+ data?: CreateMcpSessionResponseBodyData;
347
+ httpStatusCode?: number;
348
+ message?: string;
349
+ requestId?: string;
350
+ success?: boolean;
351
+ static names(): {
352
+ [key: string]: string;
353
+ };
354
+ static types(): {
355
+ [key: string]: any;
356
+ };
357
+ validate(): void;
358
+ constructor(map?: {
359
+ [key: string]: any;
360
+ });
361
+ }
362
+
363
+ declare class CreateMcpSessionResponse extends $dara.Model {
364
+ headers?: {
365
+ [key: string]: string;
366
+ };
367
+ statusCode?: number;
368
+ body?: CreateMcpSessionResponseBody;
369
+ static names(): {
370
+ [key: string]: string;
371
+ };
372
+ static types(): {
373
+ [key: string]: any;
374
+ };
375
+ validate(): void;
376
+ constructor(map?: {
377
+ [key: string]: any;
378
+ });
379
+ }
380
+
381
+ declare class DeleteContextRequest extends $dara.Model {
382
+ authorization?: string;
383
+ id?: string;
384
+ static names(): {
385
+ [key: string]: string;
386
+ };
387
+ static types(): {
388
+ [key: string]: any;
389
+ };
390
+ validate(): void;
391
+ constructor(map?: {
392
+ [key: string]: any;
393
+ });
394
+ }
395
+
396
+ declare class DeleteContextResponseBody extends $dara.Model {
397
+ code?: string;
398
+ httpStatusCode?: number;
399
+ message?: string;
400
+ requestId?: string;
401
+ success?: boolean;
402
+ static names(): {
403
+ [key: string]: string;
404
+ };
405
+ static types(): {
406
+ [key: string]: any;
407
+ };
408
+ validate(): void;
409
+ constructor(map?: {
410
+ [key: string]: any;
411
+ });
412
+ }
413
+
414
+ declare class DeleteContextResponse extends $dara.Model {
415
+ headers?: {
416
+ [key: string]: string;
417
+ };
418
+ statusCode?: number;
419
+ body?: DeleteContextResponseBody;
420
+ static names(): {
421
+ [key: string]: string;
422
+ };
423
+ static types(): {
424
+ [key: string]: any;
425
+ };
426
+ validate(): void;
427
+ constructor(map?: {
428
+ [key: string]: any;
429
+ });
430
+ }
431
+
432
+ declare class GetContextRequest extends $dara.Model {
433
+ allowCreate?: boolean;
434
+ authorization?: string;
435
+ name?: string;
436
+ static names(): {
437
+ [key: string]: string;
438
+ };
439
+ static types(): {
440
+ [key: string]: any;
441
+ };
442
+ validate(): void;
443
+ constructor(map?: {
444
+ [key: string]: any;
445
+ });
446
+ }
447
+
448
+ declare class GetContextResponseBody extends $dara.Model {
449
+ code?: string;
450
+ data?: GetContextResponseBodyData;
451
+ httpStatusCode?: number;
452
+ message?: string;
453
+ requestId?: string;
454
+ success?: boolean;
455
+ static names(): {
456
+ [key: string]: string;
457
+ };
458
+ static types(): {
459
+ [key: string]: any;
460
+ };
461
+ validate(): void;
462
+ constructor(map?: {
463
+ [key: string]: any;
464
+ });
465
+ }
466
+
467
+ declare class GetContextResponse extends $dara.Model {
468
+ headers?: {
469
+ [key: string]: string;
470
+ };
471
+ statusCode?: number;
472
+ body?: GetContextResponseBody;
473
+ static names(): {
474
+ [key: string]: string;
475
+ };
476
+ static types(): {
477
+ [key: string]: any;
478
+ };
479
+ validate(): void;
480
+ constructor(map?: {
481
+ [key: string]: any;
482
+ });
483
+ }
484
+
485
+ declare class GetContextInfoRequest extends $dara.Model {
486
+ authorization?: string;
487
+ contextId?: string;
488
+ path?: string;
489
+ sessionId?: string;
490
+ taskType?: string;
491
+ static names(): {
492
+ [key: string]: string;
493
+ };
494
+ static types(): {
495
+ [key: string]: any;
496
+ };
497
+ validate(): void;
498
+ constructor(map?: {
499
+ [key: string]: any;
500
+ });
501
+ }
502
+
503
+ declare class GetContextInfoResponseBody extends $dara.Model {
504
+ code?: string;
505
+ data?: GetContextInfoResponseBodyData;
506
+ httpStatusCode?: number;
507
+ message?: string;
508
+ requestId?: string;
509
+ success?: boolean;
510
+ static names(): {
511
+ [key: string]: string;
512
+ };
513
+ static types(): {
514
+ [key: string]: any;
515
+ };
516
+ validate(): void;
517
+ constructor(map?: {
518
+ [key: string]: any;
519
+ });
520
+ }
521
+
522
+ declare class GetContextInfoResponse extends $dara.Model {
523
+ headers?: {
524
+ [key: string]: string;
525
+ };
526
+ statusCode?: number;
527
+ body?: GetContextInfoResponseBody;
528
+ static names(): {
529
+ [key: string]: string;
530
+ };
531
+ static types(): {
532
+ [key: string]: any;
533
+ };
534
+ validate(): void;
535
+ constructor(map?: {
536
+ [key: string]: any;
537
+ });
538
+ }
539
+
540
+ declare class GetLabelRequest extends $dara.Model {
541
+ authorization?: string;
542
+ maxResults?: number;
543
+ nextToken?: string;
544
+ sessionId?: string;
545
+ static names(): {
546
+ [key: string]: string;
547
+ };
548
+ static types(): {
549
+ [key: string]: any;
550
+ };
551
+ validate(): void;
552
+ constructor(map?: {
553
+ [key: string]: any;
554
+ });
555
+ }
556
+
557
+ declare class GetLabelResponseBody extends $dara.Model {
558
+ code?: string;
559
+ data?: GetLabelResponseBodyData;
560
+ httpStatusCode?: number;
561
+ maxResults?: number;
562
+ message?: string;
563
+ nextToken?: string;
564
+ requestId?: string;
565
+ success?: boolean;
566
+ totalCount?: number;
567
+ static names(): {
568
+ [key: string]: string;
569
+ };
570
+ static types(): {
571
+ [key: string]: any;
572
+ };
573
+ validate(): void;
574
+ constructor(map?: {
575
+ [key: string]: any;
576
+ });
577
+ }
578
+
579
+ declare class GetLabelResponse extends $dara.Model {
580
+ headers?: {
581
+ [key: string]: string;
582
+ };
583
+ statusCode?: number;
584
+ body?: GetLabelResponseBody;
585
+ static names(): {
586
+ [key: string]: string;
587
+ };
588
+ static types(): {
589
+ [key: string]: any;
590
+ };
591
+ validate(): void;
592
+ constructor(map?: {
593
+ [key: string]: any;
594
+ });
595
+ }
596
+
597
+ declare class GetLinkRequest extends $dara.Model {
598
+ authorization?: string;
599
+ port?: number;
600
+ protocolType?: string;
601
+ sessionId?: string;
602
+ static names(): {
603
+ [key: string]: string;
604
+ };
605
+ static types(): {
606
+ [key: string]: any;
607
+ };
608
+ validate(): void;
609
+ constructor(map?: {
610
+ [key: string]: any;
611
+ });
612
+ }
613
+
614
+ declare class GetLinkResponseBody extends $dara.Model {
615
+ code?: string;
616
+ data?: GetLinkResponseBodyData;
617
+ httpStatusCode?: number;
618
+ message?: string;
619
+ requestId?: string;
620
+ success?: boolean;
621
+ static names(): {
622
+ [key: string]: string;
623
+ };
624
+ static types(): {
625
+ [key: string]: any;
626
+ };
627
+ validate(): void;
628
+ constructor(map?: {
629
+ [key: string]: any;
630
+ });
631
+ }
632
+
633
+ declare class GetLinkResponse extends $dara.Model {
634
+ headers?: {
635
+ [key: string]: string;
636
+ };
637
+ statusCode?: number;
638
+ body?: GetLinkResponseBody;
639
+ static names(): {
640
+ [key: string]: string;
641
+ };
642
+ static types(): {
643
+ [key: string]: any;
644
+ };
645
+ validate(): void;
646
+ constructor(map?: {
647
+ [key: string]: any;
648
+ });
649
+ }
650
+
651
+ declare class GetMcpResourceRequest extends $dara.Model {
652
+ authorization?: string;
653
+ sessionId?: string;
654
+ static names(): {
655
+ [key: string]: string;
656
+ };
657
+ static types(): {
658
+ [key: string]: any;
659
+ };
660
+ validate(): void;
661
+ constructor(map?: {
662
+ [key: string]: any;
663
+ });
664
+ }
665
+
666
+ declare class GetMcpResourceResponseBody extends $dara.Model {
667
+ code?: string;
668
+ data?: GetMcpResourceResponseBodyData;
669
+ httpStatusCode?: number;
670
+ message?: string;
671
+ requestId?: string;
672
+ success?: boolean;
673
+ static names(): {
674
+ [key: string]: string;
675
+ };
676
+ static types(): {
677
+ [key: string]: any;
678
+ };
679
+ validate(): void;
680
+ constructor(map?: {
681
+ [key: string]: any;
682
+ });
683
+ }
684
+
685
+ declare class GetMcpResourceResponse extends $dara.Model {
686
+ headers?: {
687
+ [key: string]: string;
688
+ };
689
+ statusCode?: number;
690
+ body?: GetMcpResourceResponseBody;
691
+ static names(): {
692
+ [key: string]: string;
693
+ };
694
+ static types(): {
695
+ [key: string]: any;
696
+ };
697
+ validate(): void;
698
+ constructor(map?: {
699
+ [key: string]: any;
700
+ });
701
+ }
702
+
703
+ declare class InitBrowserRequest extends $dara.Model {
704
+ authorization?: string;
705
+ persistentPath?: string;
706
+ sessionId?: string;
707
+ static names(): {
708
+ [key: string]: string;
709
+ };
710
+ static types(): {
711
+ [key: string]: any;
712
+ };
713
+ validate(): void;
714
+ constructor(map?: {
715
+ [key: string]: any;
716
+ });
717
+ static fromMap(m: {
718
+ [key: string]: any;
719
+ }): InitBrowserRequest;
720
+ }
721
+
722
+ declare class InitBrowserResponseBodyData extends $dara.Model {
723
+ port?: number;
724
+ static names(): {
725
+ [key: string]: string;
726
+ };
727
+ static types(): {
728
+ [key: string]: any;
729
+ };
730
+ validate(): void;
731
+ constructor(map?: {
732
+ [key: string]: any;
733
+ });
734
+ static fromMap(m: {
735
+ [key: string]: any;
736
+ }): InitBrowserResponseBodyData;
737
+ }
738
+
739
+ declare class InitBrowserResponseBody extends $dara.Model {
740
+ code?: string;
741
+ data?: InitBrowserResponseBodyData;
742
+ httpStatusCode?: number;
743
+ message?: string;
744
+ requestId?: string;
745
+ success?: boolean;
746
+ static names(): {
747
+ [key: string]: string;
748
+ };
749
+ static types(): {
750
+ [key: string]: any;
751
+ };
752
+ validate(): void;
753
+ constructor(map?: {
754
+ [key: string]: any;
755
+ });
756
+ static fromMap(m: {
757
+ [key: string]: any;
758
+ }): InitBrowserResponseBody;
759
+ }
760
+
761
+ declare class InitBrowserResponse extends $dara.Model {
762
+ headers?: {
763
+ [key: string]: string;
764
+ };
765
+ statusCode?: number;
766
+ body?: InitBrowserResponseBody;
767
+ static names(): {
768
+ [key: string]: string;
769
+ };
770
+ static types(): {
771
+ [key: string]: any;
772
+ };
773
+ validate(): void;
774
+ constructor(map?: {
775
+ [key: string]: any;
776
+ });
777
+ static fromMap(m: {
778
+ [key: string]: any;
779
+ }): InitBrowserResponse;
780
+ }
781
+
782
+ declare class ListContextsRequest extends $dara.Model {
783
+ authorization?: string;
784
+ maxResults?: number;
785
+ nextToken?: string;
786
+ static names(): {
787
+ [key: string]: string;
788
+ };
789
+ static types(): {
790
+ [key: string]: any;
791
+ };
792
+ validate(): void;
793
+ constructor(map?: {
794
+ [key: string]: any;
795
+ });
796
+ }
797
+
798
+ declare class ListContextsResponseBody extends $dara.Model {
799
+ code?: string;
800
+ data?: ListContextsResponseBodyData[];
801
+ httpStatusCode?: number;
802
+ maxResults?: number;
803
+ message?: string;
804
+ nextToken?: string;
805
+ requestId?: string;
806
+ success?: boolean;
807
+ totalCount?: number;
808
+ static names(): {
809
+ [key: string]: string;
810
+ };
811
+ static types(): {
812
+ [key: string]: any;
813
+ };
814
+ validate(): void;
815
+ constructor(map?: {
816
+ [key: string]: any;
817
+ });
818
+ }
819
+
820
+ declare class ListContextsResponse extends $dara.Model {
821
+ headers?: {
822
+ [key: string]: string;
823
+ };
824
+ statusCode?: number;
825
+ body?: ListContextsResponseBody;
826
+ static names(): {
827
+ [key: string]: string;
828
+ };
829
+ static types(): {
830
+ [key: string]: any;
831
+ };
832
+ validate(): void;
833
+ constructor(map?: {
834
+ [key: string]: any;
835
+ });
836
+ }
837
+
838
+ declare class ListMcpToolsRequest extends $dara.Model {
839
+ authorization?: string;
840
+ imageId?: string;
841
+ static names(): {
842
+ [key: string]: string;
843
+ };
844
+ static types(): {
845
+ [key: string]: any;
846
+ };
847
+ validate(): void;
848
+ constructor(map?: {
849
+ [key: string]: any;
850
+ });
851
+ }
852
+
853
+ declare class ListMcpToolsResponseBody extends $dara.Model {
854
+ code?: string;
855
+ data?: string;
856
+ httpStatusCode?: number;
857
+ message?: string;
858
+ requestId?: string;
859
+ success?: boolean;
860
+ static names(): {
861
+ [key: string]: string;
862
+ };
863
+ static types(): {
864
+ [key: string]: any;
865
+ };
866
+ validate(): void;
867
+ constructor(map?: {
868
+ [key: string]: any;
869
+ });
870
+ }
871
+
872
+ declare class ListMcpToolsResponse extends $dara.Model {
873
+ headers?: {
874
+ [key: string]: string;
875
+ };
876
+ statusCode?: number;
877
+ body?: ListMcpToolsResponseBody;
878
+ static names(): {
879
+ [key: string]: string;
880
+ };
881
+ static types(): {
882
+ [key: string]: any;
883
+ };
884
+ validate(): void;
885
+ constructor(map?: {
886
+ [key: string]: any;
887
+ });
888
+ }
889
+
890
+ declare class ListSessionRequest extends $dara.Model {
891
+ authorization?: string;
892
+ labels?: string;
893
+ maxResults?: number;
894
+ nextToken?: string;
895
+ static names(): {
896
+ [key: string]: string;
897
+ };
898
+ static types(): {
899
+ [key: string]: any;
900
+ };
901
+ validate(): void;
902
+ constructor(map?: {
903
+ [key: string]: any;
904
+ });
905
+ }
906
+
907
+ declare class ListSessionResponseBody extends $dara.Model {
908
+ code?: string;
909
+ data?: ListSessionResponseBodyData[];
910
+ httpStatusCode?: number;
911
+ maxResults?: number;
912
+ message?: string;
913
+ nextToken?: string;
914
+ requestId?: string;
915
+ success?: boolean;
916
+ totalCount?: number;
917
+ static names(): {
918
+ [key: string]: string;
919
+ };
920
+ static types(): {
921
+ [key: string]: any;
922
+ };
923
+ validate(): void;
924
+ constructor(map?: {
925
+ [key: string]: any;
926
+ });
927
+ }
928
+
929
+ declare class ListSessionResponse extends $dara.Model {
930
+ headers?: {
931
+ [key: string]: string;
932
+ };
933
+ statusCode?: number;
934
+ body?: ListSessionResponseBody;
935
+ static names(): {
936
+ [key: string]: string;
937
+ };
938
+ static types(): {
939
+ [key: string]: any;
940
+ };
941
+ validate(): void;
942
+ constructor(map?: {
943
+ [key: string]: any;
944
+ });
945
+ }
946
+
947
+ declare class ModifyContextRequest extends $dara.Model {
948
+ authorization?: string;
949
+ id?: string;
950
+ name?: string;
951
+ static names(): {
952
+ [key: string]: string;
953
+ };
954
+ static types(): {
955
+ [key: string]: any;
956
+ };
957
+ validate(): void;
958
+ constructor(map?: {
959
+ [key: string]: any;
960
+ });
961
+ }
962
+
963
+ declare class ModifyContextResponseBody extends $dara.Model {
964
+ code?: string;
965
+ httpStatusCode?: number;
966
+ message?: string;
967
+ requestId?: string;
968
+ success?: boolean;
969
+ static names(): {
970
+ [key: string]: string;
971
+ };
972
+ static types(): {
973
+ [key: string]: any;
974
+ };
975
+ validate(): void;
976
+ constructor(map?: {
977
+ [key: string]: any;
978
+ });
979
+ }
980
+
981
+ declare class ModifyContextResponse extends $dara.Model {
982
+ headers?: {
983
+ [key: string]: string;
984
+ };
985
+ statusCode?: number;
986
+ body?: ModifyContextResponseBody;
987
+ static names(): {
988
+ [key: string]: string;
989
+ };
990
+ static types(): {
991
+ [key: string]: any;
992
+ };
993
+ validate(): void;
994
+ constructor(map?: {
995
+ [key: string]: any;
996
+ });
997
+ }
998
+
999
+ declare class ReleaseMcpSessionRequest extends $dara.Model {
1000
+ authorization?: string;
1001
+ sessionId?: string;
1002
+ static names(): {
1003
+ [key: string]: string;
1004
+ };
1005
+ static types(): {
1006
+ [key: string]: any;
1007
+ };
1008
+ validate(): void;
1009
+ constructor(map?: {
1010
+ [key: string]: any;
1011
+ });
1012
+ }
1013
+
1014
+ declare class ReleaseMcpSessionResponseBody extends $dara.Model {
1015
+ code?: string;
1016
+ httpStatusCode?: number;
1017
+ message?: string;
1018
+ requestId?: string;
1019
+ success?: boolean;
1020
+ static names(): {
1021
+ [key: string]: string;
1022
+ };
1023
+ static types(): {
1024
+ [key: string]: any;
1025
+ };
1026
+ validate(): void;
1027
+ constructor(map?: {
1028
+ [key: string]: any;
1029
+ });
1030
+ }
1031
+
1032
+ declare class ReleaseMcpSessionResponse extends $dara.Model {
1033
+ headers?: {
1034
+ [key: string]: string;
1035
+ };
1036
+ statusCode?: number;
1037
+ body?: ReleaseMcpSessionResponseBody;
1038
+ static names(): {
1039
+ [key: string]: string;
1040
+ };
1041
+ static types(): {
1042
+ [key: string]: any;
1043
+ };
1044
+ validate(): void;
1045
+ constructor(map?: {
1046
+ [key: string]: any;
1047
+ });
1048
+ }
1049
+
1050
+ declare class SetLabelRequest extends $dara.Model {
1051
+ authorization?: string;
1052
+ labels?: string;
1053
+ sessionId?: string;
1054
+ static names(): {
1055
+ [key: string]: string;
1056
+ };
1057
+ static types(): {
1058
+ [key: string]: any;
1059
+ };
1060
+ validate(): void;
1061
+ constructor(map?: {
1062
+ [key: string]: any;
1063
+ });
1064
+ }
1065
+
1066
+ declare class SetLabelResponseBody extends $dara.Model {
1067
+ code?: string;
1068
+ httpStatusCode?: number;
1069
+ message?: string;
1070
+ requestId?: string;
1071
+ success?: boolean;
1072
+ static names(): {
1073
+ [key: string]: string;
1074
+ };
1075
+ static types(): {
1076
+ [key: string]: any;
1077
+ };
1078
+ validate(): void;
1079
+ constructor(map?: {
1080
+ [key: string]: any;
1081
+ });
1082
+ }
1083
+
1084
+ declare class SetLabelResponse extends $dara.Model {
1085
+ headers?: {
1086
+ [key: string]: string;
1087
+ };
1088
+ statusCode?: number;
1089
+ body?: SetLabelResponseBody;
1090
+ static names(): {
1091
+ [key: string]: string;
1092
+ };
1093
+ static types(): {
1094
+ [key: string]: any;
1095
+ };
1096
+ validate(): void;
1097
+ constructor(map?: {
1098
+ [key: string]: any;
1099
+ });
1100
+ }
1101
+
1102
+ declare class SyncContextRequest extends $dara.Model {
1103
+ authorization?: string;
1104
+ contextId?: string;
1105
+ mode?: string;
1106
+ path?: string;
1107
+ sessionId?: string;
1108
+ static names(): {
1109
+ [key: string]: string;
1110
+ };
1111
+ static types(): {
1112
+ [key: string]: any;
1113
+ };
1114
+ validate(): void;
1115
+ constructor(map?: {
1116
+ [key: string]: any;
1117
+ });
1118
+ }
1119
+
1120
+ declare class SyncContextResponseBody extends $dara.Model {
1121
+ code?: string;
1122
+ httpStatusCode?: number;
1123
+ message?: string;
1124
+ requestId?: string;
1125
+ success?: boolean;
1126
+ static names(): {
1127
+ [key: string]: string;
1128
+ };
1129
+ static types(): {
1130
+ [key: string]: any;
1131
+ };
1132
+ validate(): void;
1133
+ constructor(map?: {
1134
+ [key: string]: any;
1135
+ });
1136
+ }
1137
+
1138
+ declare class SyncContextResponse extends $dara.Model {
1139
+ headers?: {
1140
+ [key: string]: string;
1141
+ };
1142
+ statusCode?: number;
1143
+ body?: SyncContextResponseBody;
1144
+ static names(): {
1145
+ [key: string]: string;
1146
+ };
1147
+ static types(): {
1148
+ [key: string]: any;
1149
+ };
1150
+ validate(): void;
1151
+ constructor(map?: {
1152
+ [key: string]: any;
1153
+ });
1154
+ }
1155
+
1156
+ declare class Client extends OpenApi {
1157
+ constructor(config: $OpenApiUtil.Config);
1158
+ getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {
1159
+ [key: string]: string;
1160
+ }, endpoint: string): string;
1161
+ /**
1162
+ * 调用mcp工具
1163
+ *
1164
+ * @param request - CallMcpToolRequest
1165
+ * @param runtime - runtime options for this request RuntimeOptions
1166
+ * @returns CallMcpToolResponse
1167
+ */
1168
+ callMcpToolWithOptions(request: CallMcpToolRequest, runtime: $dara.RuntimeOptions): Promise<CallMcpToolResponse>;
1169
+ /**
1170
+ * 调用mcp工具
1171
+ *
1172
+ * @param request - CallMcpToolRequest
1173
+ * @returns CallMcpToolResponse
1174
+ */
1175
+ callMcpTool(request: CallMcpToolRequest): Promise<CallMcpToolResponse>;
1176
+ /**
1177
+ * 创建 mcp session
1178
+ *
1179
+ * @param tmpReq - CreateMcpSessionRequest
1180
+ * @param runtime - runtime options for this request RuntimeOptions
1181
+ * @returns CreateMcpSessionResponse
1182
+ */
1183
+ createMcpSessionWithOptions(tmpReq: CreateMcpSessionRequest, runtime: $dara.RuntimeOptions): Promise<CreateMcpSessionResponse>;
1184
+ /**
1185
+ * 创建 mcp session
1186
+ *
1187
+ * @param request - CreateMcpSessionRequest
1188
+ * @returns CreateMcpSessionResponse
1189
+ */
1190
+ createMcpSession(request: CreateMcpSessionRequest): Promise<CreateMcpSessionResponse>;
1191
+ /**
1192
+ * 删除持久化上下文
1193
+ *
1194
+ * @param request - DeleteContextRequest
1195
+ * @param runtime - runtime options for this request RuntimeOptions
1196
+ * @returns DeleteContextResponse
1197
+ */
1198
+ deleteContextWithOptions(request: DeleteContextRequest, runtime: $dara.RuntimeOptions): Promise<DeleteContextResponse>;
1199
+ /**
1200
+ * 删除持久化上下文
1201
+ *
1202
+ * @param request - DeleteContextRequest
1203
+ * @returns DeleteContextResponse
1204
+ */
1205
+ deleteContext(request: DeleteContextRequest): Promise<DeleteContextResponse>;
1206
+ /**
1207
+ * 获取上下文
1208
+ *
1209
+ * @param request - GetContextRequest
1210
+ * @param runtime - runtime options for this request RuntimeOptions
1211
+ * @returns GetContextResponse
1212
+ */
1213
+ getContextWithOptions(request: GetContextRequest, runtime: $dara.RuntimeOptions): Promise<GetContextResponse>;
1214
+ /**
1215
+ * 获取上下文
1216
+ *
1217
+ * @param request - GetContextRequest
1218
+ * @returns GetContextResponse
1219
+ */
1220
+ getContext(request: GetContextRequest): Promise<GetContextResponse>;
1221
+ /**
1222
+ * 获取上下文信息
1223
+ *
1224
+ * @param request - GetContextInfoRequest
1225
+ * @param runtime - runtime options for this request RuntimeOptions
1226
+ * @returns GetContextInfoResponse
1227
+ */
1228
+ getContextInfoWithOptions(request: GetContextInfoRequest, runtime: $dara.RuntimeOptions): Promise<GetContextInfoResponse>;
1229
+ /**
1230
+ * 获取上下文信息
1231
+ *
1232
+ * @param request - GetContextInfoRequest
1233
+ * @returns GetContextInfoResponse
1234
+ */
1235
+ getContextInfo(request: GetContextInfoRequest): Promise<GetContextInfoResponse>;
1236
+ /**
1237
+ * 获取标签
1238
+ *
1239
+ * @param request - GetLabelRequest
1240
+ * @param runtime - runtime options for this request RuntimeOptions
1241
+ * @returns GetLabelResponse
1242
+ */
1243
+ getLabelWithOptions(request: GetLabelRequest, runtime: $dara.RuntimeOptions): Promise<GetLabelResponse>;
1244
+ /**
1245
+ * 获取标签
1246
+ *
1247
+ * @param request - GetLabelRequest
1248
+ * @returns GetLabelResponse
1249
+ */
1250
+ getLabel(request: GetLabelRequest): Promise<GetLabelResponse>;
1251
+ /**
1252
+ * 获取特定端口的转发链接
1253
+ *
1254
+ * @param request - GetLinkRequest
1255
+ * @param runtime - runtime options for this request RuntimeOptions
1256
+ * @returns GetLinkResponse
1257
+ */
1258
+ getLinkWithOptions(request: GetLinkRequest, runtime: $dara.RuntimeOptions): Promise<GetLinkResponse>;
1259
+ /**
1260
+ * 获取特定端口的转发链接
1261
+ *
1262
+ * @param request - GetLinkRequest
1263
+ * @returns GetLinkResponse
1264
+ */
1265
+ getLink(request: GetLinkRequest): Promise<GetLinkResponse>;
1266
+ /**
1267
+ * 获取mcp资源信息
1268
+ *
1269
+ * @param request - GetMcpResourceRequest
1270
+ * @param runtime - runtime options for this request RuntimeOptions
1271
+ * @returns GetMcpResourceResponse
1272
+ */
1273
+ getMcpResourceWithOptions(request: GetMcpResourceRequest, runtime: $dara.RuntimeOptions): Promise<GetMcpResourceResponse>;
1274
+ /**
1275
+ * 获取mcp资源信息
1276
+ *
1277
+ * @param request - GetMcpResourceRequest
1278
+ * @returns GetMcpResourceResponse
1279
+ */
1280
+ getMcpResource(request: GetMcpResourceRequest): Promise<GetMcpResourceResponse>;
1281
+ /**
1282
+ * 获取上下文列表
1283
+ *
1284
+ * @param request - ListContextsRequest
1285
+ * @param runtime - runtime options for this request RuntimeOptions
1286
+ * @returns ListContextsResponse
1287
+ */
1288
+ listContextsWithOptions(request: ListContextsRequest, runtime: $dara.RuntimeOptions): Promise<ListContextsResponse>;
1289
+ /**
1290
+ * 获取上下文列表
1291
+ *
1292
+ * @param request - ListContextsRequest
1293
+ * @returns ListContextsResponse
1294
+ */
1295
+ listContexts(request: ListContextsRequest): Promise<ListContextsResponse>;
1296
+ /**
1297
+ * ListMcpTools
1298
+ *
1299
+ * @param request - ListMcpToolsRequest
1300
+ * @param runtime - runtime options for this request RuntimeOptions
1301
+ * @returns ListMcpToolsResponse
1302
+ */
1303
+ listMcpToolsWithOptions(request: ListMcpToolsRequest, runtime: $dara.RuntimeOptions): Promise<ListMcpToolsResponse>;
1304
+ /**
1305
+ * ListMcpTools
1306
+ *
1307
+ * @param request - ListMcpToolsRequest
1308
+ * @returns ListMcpToolsResponse
1309
+ */
1310
+ listMcpTools(request: ListMcpToolsRequest): Promise<ListMcpToolsResponse>;
1311
+ /**
1312
+ * 根据Lable查询Session列表
1313
+ *
1314
+ * @param request - ListSessionRequest
1315
+ * @param runtime - runtime options for this request RuntimeOptions
1316
+ * @returns ListSessionResponse
1317
+ */
1318
+ listSessionWithOptions(request: ListSessionRequest, runtime: $dara.RuntimeOptions): Promise<ListSessionResponse>;
1319
+ /**
1320
+ * 根据Lable查询Session列表
1321
+ *
1322
+ * @param request - ListSessionRequest
1323
+ * @returns ListSessionResponse
1324
+ */
1325
+ listSession(request: ListSessionRequest): Promise<ListSessionResponse>;
1326
+ /**
1327
+ * 修改上下文
1328
+ *
1329
+ * @param request - ModifyContextRequest
1330
+ * @param runtime - runtime options for this request RuntimeOptions
1331
+ * @returns ModifyContextResponse
1332
+ */
1333
+ modifyContextWithOptions(request: ModifyContextRequest, runtime: $dara.RuntimeOptions): Promise<ModifyContextResponse>;
1334
+ /**
1335
+ * 修改上下文
1336
+ *
1337
+ * @param request - ModifyContextRequest
1338
+ * @returns ModifyContextResponse
1339
+ */
1340
+ modifyContext(request: ModifyContextRequest): Promise<ModifyContextResponse>;
1341
+ /**
1342
+ * 释放 mcp session
1343
+ *
1344
+ * @param request - ReleaseMcpSessionRequest
1345
+ * @param runtime - runtime options for this request RuntimeOptions
1346
+ * @returns ReleaseMcpSessionResponse
1347
+ */
1348
+ releaseMcpSessionWithOptions(request: ReleaseMcpSessionRequest, runtime: $dara.RuntimeOptions): Promise<ReleaseMcpSessionResponse>;
1349
+ /**
1350
+ * 释放 mcp session
1351
+ *
1352
+ * @param request - ReleaseMcpSessionRequest
1353
+ * @returns ReleaseMcpSessionResponse
1354
+ */
1355
+ releaseMcpSession(request: ReleaseMcpSessionRequest): Promise<ReleaseMcpSessionResponse>;
1356
+ /**
1357
+ * 设置标签
1358
+ *
1359
+ * @param request - SetLabelRequest
1360
+ * @param runtime - runtime options for this request RuntimeOptions
1361
+ * @returns SetLabelResponse
1362
+ */
1363
+ setLabelWithOptions(request: SetLabelRequest, runtime: $dara.RuntimeOptions): Promise<SetLabelResponse>;
1364
+ /**
1365
+ * 设置标签
1366
+ *
1367
+ * @param request - SetLabelRequest
1368
+ * @returns SetLabelResponse
1369
+ */
1370
+ setLabel(request: SetLabelRequest): Promise<SetLabelResponse>;
1371
+ /**
1372
+ * 同步上下文
1373
+ *
1374
+ * @param request - SyncContextRequest
1375
+ * @param runtime - runtime options for this request RuntimeOptions
1376
+ * @returns SyncContextResponse
1377
+ */
1378
+ syncContextWithOptions(request: SyncContextRequest, runtime: $dara.RuntimeOptions): Promise<SyncContextResponse>;
1379
+ /**
1380
+ * 同步上下文
1381
+ *
1382
+ * @param request - SyncContextRequest
1383
+ * @returns SyncContextResponse
1384
+ */
1385
+ syncContext(request: SyncContextRequest): Promise<SyncContextResponse>;
1386
+ /**
1387
+ * 初始化浏览器
1388
+ *
1389
+ * @param tmpReq - InitBrowserRequest
1390
+ * @param runtime - runtime options for this request RuntimeOptions
1391
+ * @returns InitBrowserResponse
1392
+ */
1393
+ initBrowserWithOptions(request: InitBrowserRequest, runtime: $dara.RuntimeOptions): Promise<InitBrowserResponse>;
1394
+ /**
1395
+ * 初始化浏览器
1396
+ *
1397
+ * @param request - InitBrowserRequest
1398
+ * @returns InitBrowserResponse
1399
+ */
1400
+ initBrowser(request: InitBrowserRequest): Promise<InitBrowserResponse>;
1401
+ /**
1402
+ * 初始化浏览器(同步版本)
1403
+ *
1404
+ * @param request - InitBrowserRequest
1405
+ * @returns InitBrowserResponse
1406
+ */
1407
+ initBrowserSync(request: InitBrowserRequest): InitBrowserResponse;
1408
+ }
1409
+
1410
+ interface Config {
1411
+ region_id: string;
1412
+ endpoint: string;
1413
+ timeout_ms: number;
1414
+ }
1415
+
1416
+ /**
1417
+ * Base interface for API responses
1418
+ */
1419
+ interface ApiResponse {
1420
+ /** Optional request identifier for tracking API calls */
1421
+ requestId?: string;
1422
+ /** Optional error message if the operation failed */
1423
+ errorMessage?: string;
1424
+ /** Optional status code if the operation failed */
1425
+ success?: boolean;
1426
+ }
1427
+ /**
1428
+ * Interface for delete operation responses
1429
+ */
1430
+ interface DeleteResult extends ApiResponse {
1431
+ /** Whether the delete operation was successful */
1432
+ success: boolean;
1433
+ /** Optional error message if the operation failed */
1434
+ errorMessage?: string;
1435
+ }
1436
+ /**
1437
+ * Interface for session creation operation responses
1438
+ * Corresponds to Python's SessionResult type
1439
+ */
1440
+ interface SessionResult extends ApiResponse {
1441
+ /** Request identifier for tracking API calls */
1442
+ requestId: string;
1443
+ /** Whether the session creation was successful */
1444
+ success: boolean;
1445
+ /** The created session object (only present if successful) */
1446
+ session?: any;
1447
+ /** Error message if the operation failed */
1448
+ errorMessage?: string;
1449
+ }
1450
+ /**
1451
+ * Interface for operation results
1452
+ * Corresponds to Python's OperationResult type
1453
+ */
1454
+ interface OperationResult extends ApiResponse {
1455
+ /** Request identifier for tracking API calls */
1456
+ requestId: string;
1457
+ /** Whether the operation was successful */
1458
+ success: boolean;
1459
+ /** Optional data payload */
1460
+ data?: any;
1461
+ /** Optional error message if the operation failed */
1462
+ errorMessage?: string;
1463
+ }
1464
+ /**
1465
+ * Interface for process list operation responses
1466
+ * Corresponds to Python's ProcessListResult type
1467
+ */
1468
+ interface ProcessListResult extends ApiResponse {
1469
+ /** Request identifier for tracking API calls */
1470
+ requestId: string;
1471
+ /** Whether the operation was successful */
1472
+ success: boolean;
1473
+ /** The list of process objects */
1474
+ data: any[];
1475
+ /** Optional error message if the operation failed */
1476
+ errorMessage?: string;
1477
+ }
1478
+ /**
1479
+ * Interface for installed app list operation responses
1480
+ * Corresponds to Python's InstalledAppListResult type
1481
+ */
1482
+ interface InstalledAppListResult extends ApiResponse {
1483
+ /** Request identifier for tracking API calls */
1484
+ requestId: string;
1485
+ /** Whether the operation was successful */
1486
+ success: boolean;
1487
+ /** The list of installed app objects */
1488
+ data: any[];
1489
+ /** Optional error message if the operation failed */
1490
+ errorMessage?: string;
1491
+ }
1492
+ /**
1493
+ * Interface for application operation responses
1494
+ * Corresponds to Python's AppOperationResult type
1495
+ */
1496
+ interface AppOperationResult extends ApiResponse {
1497
+ /** Request identifier for tracking API calls */
1498
+ requestId: string;
1499
+ /** Whether the operation was successful */
1500
+ success: boolean;
1501
+ /** Optional error message if the operation failed */
1502
+ errorMessage?: string;
1503
+ }
1504
+ /**
1505
+ * Interface for command execution operation responses
1506
+ * Corresponds to Python's CommandResult type
1507
+ */
1508
+ interface CommandResult extends ApiResponse {
1509
+ /** Request identifier for tracking API calls */
1510
+ requestId: string;
1511
+ /** Whether the command execution was successful */
1512
+ success: boolean;
1513
+ /** The command output */
1514
+ output: string;
1515
+ /** Optional error message if the operation failed */
1516
+ errorMessage?: string;
1517
+ }
1518
+ /**
1519
+ * Interface for code execution operation responses
1520
+ * Corresponds to Python's CodeExecutionResult type
1521
+ */
1522
+ interface CodeExecutionResult extends ApiResponse {
1523
+ /** Request identifier for tracking API calls */
1524
+ requestId: string;
1525
+ /** Whether the code execution was successful */
1526
+ success: boolean;
1527
+ /** The execution result */
1528
+ result: string;
1529
+ /** Optional error message if the operation failed */
1530
+ errorMessage?: string;
1531
+ }
1532
+ /**
1533
+ * Interface for boolean operation responses
1534
+ * Corresponds to Python's BoolResult type
1535
+ */
1536
+ interface BoolResult extends ApiResponse {
1537
+ /** Request identifier for tracking API calls */
1538
+ requestId: string;
1539
+ /** Whether the operation was successful */
1540
+ success: boolean;
1541
+ /** Boolean data result */
1542
+ data?: boolean;
1543
+ /** Optional error message if the operation failed */
1544
+ errorMessage?: string;
1545
+ }
1546
+ /**
1547
+ * Interface for file info operation responses
1548
+ * Corresponds to Python's FileInfoResult type
1549
+ */
1550
+ interface FileInfoResult extends ApiResponse {
1551
+ /** Request identifier for tracking API calls */
1552
+ requestId: string;
1553
+ /** Whether the operation was successful */
1554
+ success: boolean;
1555
+ /** File information object */
1556
+ fileInfo?: Record<string, any>;
1557
+ /** Optional error message if the operation failed */
1558
+ errorMessage?: string;
1559
+ }
1560
+ /**
1561
+ * Interface for directory list operation responses
1562
+ * Corresponds to Python's DirectoryListResult type
1563
+ */
1564
+ interface DirectoryListResult extends ApiResponse {
1565
+ /** Request identifier for tracking API calls */
1566
+ requestId: string;
1567
+ /** Whether the operation was successful */
1568
+ success: boolean;
1569
+ /** Directory entries */
1570
+ entries: Record<string, any>[];
1571
+ /** Optional error message if the operation failed */
1572
+ errorMessage?: string;
1573
+ }
1574
+ /**
1575
+ * Interface for file content operation responses
1576
+ * Corresponds to Python's FileContentResult type
1577
+ */
1578
+ interface FileContentResult extends ApiResponse {
1579
+ /** Request identifier for tracking API calls */
1580
+ requestId: string;
1581
+ /** Whether the operation was successful */
1582
+ success: boolean;
1583
+ /** File content */
1584
+ content: string;
1585
+ /** Optional error message if the operation failed */
1586
+ errorMessage?: string;
1587
+ }
1588
+ /**
1589
+ * Interface for multiple file content operation responses
1590
+ * Corresponds to Python's MultipleFileContentResult type
1591
+ */
1592
+ interface MultipleFileContentResult extends ApiResponse {
1593
+ /** Request identifier for tracking API calls */
1594
+ requestId: string;
1595
+ /** Whether the operation was successful */
1596
+ success: boolean;
1597
+ /** Multiple file contents */
1598
+ contents: Record<string, string>;
1599
+ /** Optional error message if the operation failed */
1600
+ errorMessage?: string;
1601
+ }
1602
+ /**
1603
+ * Interface for file search operation responses
1604
+ * Corresponds to Python's FileSearchResult type
1605
+ */
1606
+ interface FileSearchResult extends ApiResponse {
1607
+ /** Request identifier for tracking API calls */
1608
+ requestId: string;
1609
+ /** Whether the operation was successful */
1610
+ success: boolean;
1611
+ /** Matching file paths */
1612
+ matches: string[];
1613
+ /** Optional error message if the operation failed */
1614
+ errorMessage?: string;
1615
+ }
1616
+ /**
1617
+ * Interface for OSS client creation operation responses
1618
+ * Corresponds to Python's OSSClientResult type
1619
+ */
1620
+ interface OSSClientResult extends ApiResponse {
1621
+ /** Request identifier for tracking API calls */
1622
+ requestId: string;
1623
+ /** Whether the operation was successful */
1624
+ success: boolean;
1625
+ /** OSS client configuration */
1626
+ clientConfig: Record<string, any>;
1627
+ /** Optional error message if the operation failed */
1628
+ errorMessage?: string;
1629
+ }
1630
+ /**
1631
+ * Interface for OSS upload operation responses
1632
+ * Corresponds to Python's OSSUploadResult type
1633
+ */
1634
+ interface OSSUploadResult extends ApiResponse {
1635
+ /** Request identifier for tracking API calls */
1636
+ requestId: string;
1637
+ /** Whether the operation was successful */
1638
+ success: boolean;
1639
+ /** Result of the upload operation */
1640
+ content: string;
1641
+ /** Optional error message if the operation failed */
1642
+ errorMessage?: string;
1643
+ }
1644
+ /**
1645
+ * Interface for OSS download operation responses
1646
+ * Corresponds to Python's OSSDownloadResult type
1647
+ */
1648
+ interface OSSDownloadResult extends ApiResponse {
1649
+ /** Request identifier for tracking API calls */
1650
+ requestId: string;
1651
+ /** Whether the operation was successful */
1652
+ success: boolean;
1653
+ /** Result of the download operation */
1654
+ content: string;
1655
+ /** Optional error message if the operation failed */
1656
+ errorMessage?: string;
1657
+ }
1658
+ /**
1659
+ * Interface for UI element list operation responses
1660
+ * Corresponds to Python's UIElementListResult type
1661
+ */
1662
+ interface UIElementListResult extends ApiResponse {
1663
+ /** Request identifier for tracking API calls */
1664
+ requestId: string;
1665
+ /** Whether the operation was successful */
1666
+ success: boolean;
1667
+ /** UI elements */
1668
+ elements: Record<string, any>[];
1669
+ /** Optional error message if the operation failed */
1670
+ errorMessage?: string;
1671
+ }
1672
+ /**
1673
+ * Interface for window list operation responses
1674
+ * Corresponds to Python's WindowListResult type
1675
+ */
1676
+ interface WindowListResult extends ApiResponse {
1677
+ /** Request identifier for tracking API calls */
1678
+ requestId: string;
1679
+ /** Whether the operation was successful */
1680
+ success: boolean;
1681
+ /** List of windows */
1682
+ windows: any[];
1683
+ /** Optional error message if the operation failed */
1684
+ errorMessage?: string;
1685
+ }
1686
+ /**
1687
+ * Interface for window info operation responses
1688
+ * Corresponds to Python's WindowInfoResult type
1689
+ */
1690
+ interface WindowInfoResult extends ApiResponse {
1691
+ /** Request identifier for tracking API calls */
1692
+ requestId: string;
1693
+ /** Whether the operation was successful */
1694
+ success: boolean;
1695
+ /** Window object */
1696
+ window?: any;
1697
+ /** Optional error message if the operation failed */
1698
+ errorMessage?: string;
1699
+ }
1700
+ /**
1701
+ * Interface for context operation responses
1702
+ * Corresponds to Python's ContextResult type
1703
+ */
1704
+ interface ContextResult extends ApiResponse {
1705
+ /** Request identifier for tracking API calls */
1706
+ requestId: string;
1707
+ /** Whether the operation was successful */
1708
+ success: boolean;
1709
+ /** The context ID */
1710
+ contextId: string;
1711
+ /** The context object (only present if successful) */
1712
+ context?: any;
1713
+ /** Optional error message if the operation failed */
1714
+ errorMessage?: string;
1715
+ }
1716
+ /**
1717
+ * Interface for context list operation responses
1718
+ * Corresponds to Python's ContextListResult type
1719
+ */
1720
+ interface ContextListResult extends ApiResponse {
1721
+ /** Request identifier for tracking API calls */
1722
+ requestId: string;
1723
+ /** Whether the operation was successful */
1724
+ success: boolean;
1725
+ /** List of contexts */
1726
+ contexts: any[];
1727
+ /** Token for the next page of results */
1728
+ nextToken?: string;
1729
+ /** Maximum number of results per page */
1730
+ maxResults?: number;
1731
+ /** Total number of contexts available */
1732
+ totalCount?: number;
1733
+ /** Optional error message if the operation failed */
1734
+ errorMessage?: string;
1735
+ }
1736
+
1737
+ /**
1738
+ * Represents a persistent storage context in the AgentBay cloud environment.
1739
+ */
1740
+ declare class Context {
1741
+ /**
1742
+ * The unique identifier of the context.
1743
+ */
1744
+ id: string;
1745
+ /**
1746
+ * The name of the context.
1747
+ */
1748
+ name: string;
1749
+ /**
1750
+ * The current state of the context (e.g., "available", "in-use").
1751
+ */
1752
+ state: string;
1753
+ /**
1754
+ * Date and time when the Context was created.
1755
+ */
1756
+ createdAt?: string;
1757
+ /**
1758
+ * Date and time when the Context was last used.
1759
+ */
1760
+ lastUsedAt?: string;
1761
+ /**
1762
+ * The operating system type this context is bound to.
1763
+ */
1764
+ osType?: string;
1765
+ /**
1766
+ * Initialize a Context object.
1767
+ *
1768
+ * @param id - The unique identifier of the context.
1769
+ * @param name - The name of the context.
1770
+ * @param state - The current state of the context.
1771
+ * @param createdAt - Date and time when the Context was created.
1772
+ * @param lastUsedAt - Date and time when the Context was last used.
1773
+ * @param osType - The operating system type this context is bound to.
1774
+ */
1775
+ constructor(id: string, name: string, state?: string, createdAt?: string, lastUsedAt?: string, osType?: string);
1776
+ }
1777
+ /**
1778
+ * Parameters for listing contexts with pagination support.
1779
+ */
1780
+ interface ContextListParams {
1781
+ /**
1782
+ * Maximum number of results per page.
1783
+ * Defaults to 10 if not specified.
1784
+ */
1785
+ maxResults?: number;
1786
+ /**
1787
+ * Token for the next page of results.
1788
+ */
1789
+ nextToken?: string;
1790
+ }
1791
+ /**
1792
+ * Provides methods to manage persistent contexts in the AgentBay cloud environment.
1793
+ */
1794
+ declare class ContextService {
1795
+ private agentBay;
1796
+ /**
1797
+ * Initialize the ContextService.
1798
+ *
1799
+ * @param agentBay - The AgentBay instance.
1800
+ */
1801
+ constructor(agentBay: AgentBay);
1802
+ /**
1803
+ * Lists all available contexts with pagination support.
1804
+ * Corresponds to Python's list() method
1805
+ *
1806
+ * @param params - Optional parameters for listing contexts.
1807
+ * @returns ContextListResult with contexts list and pagination information
1808
+ */
1809
+ list(params?: ContextListParams): Promise<ContextListResult>;
1810
+ /**
1811
+ * Gets a context by name. Optionally creates it if it doesn't exist.
1812
+ * Corresponds to Python's get() method
1813
+ *
1814
+ * @param name - The name of the context to get.
1815
+ * @param create - Whether to create the context if it doesn't exist.
1816
+ * @returns ContextResult with context data and requestId
1817
+ */
1818
+ get(name: string, create?: boolean): Promise<ContextResult>;
1819
+ /**
1820
+ * Creates a new context with the given name.
1821
+ * Corresponds to Python's create() method
1822
+ *
1823
+ * @param name - The name for the new context.
1824
+ * @returns ContextResult with created context data and requestId
1825
+ */
1826
+ create(name: string): Promise<ContextResult>;
1827
+ /**
1828
+ * Updates the specified context.
1829
+ * Corresponds to Python's update() method
1830
+ *
1831
+ * @param context - The Context object to update.
1832
+ * @returns OperationResult with updated context data and requestId
1833
+ */
1834
+ update(context: Context): Promise<OperationResult>;
1835
+ /**
1836
+ * Deletes the specified context.
1837
+ * Corresponds to Python's delete() method
1838
+ *
1839
+ * @param context - The Context object to delete.
1840
+ * @returns OperationResult with requestId
1841
+ */
1842
+ delete(context: Context): Promise<OperationResult>;
1843
+ }
1844
+
1845
+ declare enum UploadStrategy {
1846
+ UploadBeforeResourceRelease = "UploadBeforeResourceRelease"
1847
+ }
1848
+ declare enum DownloadStrategy {
1849
+ DownloadAsync = "DownloadAsync"
1850
+ }
1851
+ interface UploadPolicy {
1852
+ autoUpload: boolean;
1853
+ uploadStrategy: UploadStrategy;
1854
+ period?: number;
1855
+ }
1856
+ interface DownloadPolicy {
1857
+ autoDownload: boolean;
1858
+ downloadStrategy: DownloadStrategy;
1859
+ }
1860
+ interface DeletePolicy {
1861
+ syncLocalFile: boolean;
1862
+ }
1863
+ interface WhiteList {
1864
+ path: string;
1865
+ excludePaths?: string[];
1866
+ }
1867
+ interface BWList {
1868
+ whiteLists?: WhiteList[];
1869
+ }
1870
+ interface SyncPolicy {
1871
+ uploadPolicy?: UploadPolicy;
1872
+ downloadPolicy?: DownloadPolicy;
1873
+ deletePolicy?: DeletePolicy;
1874
+ bwList?: BWList;
1875
+ }
1876
+ declare class SyncPolicyImpl implements SyncPolicy {
1877
+ uploadPolicy?: UploadPolicy;
1878
+ downloadPolicy?: DownloadPolicy;
1879
+ deletePolicy?: DeletePolicy;
1880
+ bwList?: BWList;
1881
+ constructor(policy?: Partial<SyncPolicy>);
1882
+ private ensureDefaults;
1883
+ toJSON(): SyncPolicy;
1884
+ }
1885
+ declare class ContextSync {
1886
+ contextId: string;
1887
+ path: string;
1888
+ policy?: SyncPolicy;
1889
+ constructor(contextId: string, path: string, policy?: SyncPolicy);
1890
+ withPolicy(policy: SyncPolicy): ContextSync;
1891
+ }
1892
+ declare function newUploadPolicy(): UploadPolicy;
1893
+ declare function newDownloadPolicy(): DownloadPolicy;
1894
+ declare function newDeletePolicy(): DeletePolicy;
1895
+ declare function newSyncPolicy(): SyncPolicy;
1896
+ declare function newSyncPolicyWithDefaults(policy?: Partial<SyncPolicy>): SyncPolicy;
1897
+ declare function newContextSync(contextId: string, path: string, policy?: SyncPolicy): ContextSync;
1898
+
1899
+ /**
1900
+ * Result of task execution.
1901
+ */
1902
+ interface ExecutionResult extends ApiResponse {
1903
+ success: boolean;
1904
+ errorMessage: string;
1905
+ taskId: string;
1906
+ taskStatus: string;
1907
+ }
1908
+ /**
1909
+ * Result of query operations.
1910
+ */
1911
+ interface QueryResult extends ApiResponse {
1912
+ success: boolean;
1913
+ output: string;
1914
+ errorMessage: string;
1915
+ }
1916
+ /**
1917
+ * Result of an MCP tool call.
1918
+ */
1919
+ interface McpToolResult {
1920
+ success: boolean;
1921
+ data: string;
1922
+ errorMessage: string;
1923
+ requestId: string;
1924
+ }
1925
+ /**
1926
+ * Interface defining the methods needed by Agent from Session.
1927
+ */
1928
+ interface McpSession {
1929
+ getAPIKey(): string;
1930
+ getSessionId(): string;
1931
+ callMcpTool(toolName: string, args: any): Promise<McpToolResult>;
1932
+ }
1933
+ /**
1934
+ * An Agent to manipulate applications to complete specific tasks.
1935
+ */
1936
+ declare class Agent {
1937
+ private session;
1938
+ /**
1939
+ * Initialize an Agent object.
1940
+ *
1941
+ * @param session - The Session instance that this Agent belongs to.
1942
+ */
1943
+ constructor(session: McpSession);
1944
+ /**
1945
+ * Execute a specific task described in human language.
1946
+ *
1947
+ * @param task - Task description in human language.
1948
+ * @param maxTryTimes - Maximum number of retry attempts.
1949
+ * @returns ExecutionResult containing success status, task output, and error message if any.
1950
+ */
1951
+ executeTask(task: string, maxTryTimes: number): Promise<ExecutionResult>;
1952
+ /**
1953
+ * Get the status of the task with the given task ID.
1954
+ *
1955
+ * @param taskId - Task ID
1956
+ * @returns QueryResult containing the task status
1957
+ */
1958
+ getTaskStatus(taskId: string): Promise<QueryResult>;
1959
+ /**
1960
+ * Terminate a task with a specified task ID.
1961
+ *
1962
+ * @param taskId - The ID of the running task.
1963
+ * @returns ExecutionResult containing success status, task output, and error message if any.
1964
+ */
1965
+ terminateTask(taskId: string): Promise<ExecutionResult>;
1966
+ }
1967
+
1968
+ /**
1969
+ * Represents an installed application
1970
+ */
1971
+ interface InstalledApp {
1972
+ name: string;
1973
+ start_cmd: string;
1974
+ stop_cmd?: string;
1975
+ work_directory?: string;
1976
+ }
1977
+ /**
1978
+ * Represents a running process
1979
+ */
1980
+ interface Process {
1981
+ pname: string;
1982
+ pid: number;
1983
+ cmdline?: string;
1984
+ path?: string;
1985
+ }
1986
+ /**
1987
+ * Handles application operations in the AgentBay cloud environment.
1988
+ */
1989
+ declare class Application {
1990
+ private session;
1991
+ /**
1992
+ * Initialize an Application object.
1993
+ *
1994
+ * @param session - The Session instance that this Application belongs to.
1995
+ */
1996
+ constructor(session: {
1997
+ getAPIKey(): string;
1998
+ getClient(): Client;
1999
+ getSessionId(): string;
2000
+ callMcpTool(toolName: string, args: any): Promise<{
2001
+ success: boolean;
2002
+ data: string;
2003
+ errorMessage: string;
2004
+ requestId: string;
2005
+ }>;
2006
+ });
2007
+ /**
2008
+ * Sanitizes error messages to remove sensitive information like API keys.
2009
+ *
2010
+ * @param error - The error to sanitize
2011
+ * @returns The sanitized error
2012
+ */
2013
+ private sanitizeError;
2014
+ /**
2015
+ * Helper method to parse JSON string into objects
2016
+ */
2017
+ private parseJSON;
2018
+ /**
2019
+ * Retrieves a list of installed applications.
2020
+ * Corresponds to Python's get_installed_apps() method
2021
+ *
2022
+ * @param startMenu - Whether to include applications from the start menu. Defaults to true.
2023
+ * @param desktop - Whether to include applications from the desktop. Defaults to true.
2024
+ * @param ignoreSystemApps - Whether to ignore system applications. Defaults to true.
2025
+ * @returns InstalledAppListResult with installed apps and requestId
2026
+ * @throws Error if the operation fails.
2027
+ */
2028
+ getInstalledApps(startMenu?: boolean, desktop?: boolean, ignoreSystemApps?: boolean): Promise<InstalledAppListResult>;
2029
+ /**
2030
+ * Starts an application with the given command and optional working directory.
2031
+ * Corresponds to Python's start_app() method
2032
+ *
2033
+ * @param startCmd - The command to start the application.
2034
+ * @param workDirectory - The working directory for the application. Defaults to an empty string.
2035
+ * @param activity - Activity name to launch (e.g. ".SettingsActivity" or "com.package/.Activity"). Defaults to an empty string.
2036
+ * @returns ProcessListResult with started processes and requestId
2037
+ * @throws Error if the operation fails.
2038
+ */
2039
+ startApp(startCmd: string, workDirectory?: string, activity?: string): Promise<ProcessListResult>;
2040
+ /**
2041
+ * Stops an application by process name.
2042
+ * Corresponds to Python's stop_app_by_pname() method
2043
+ *
2044
+ * @param pname - The process name to stop.
2045
+ * @returns AppOperationResult with operation result and requestId
2046
+ * @throws Error if the operation fails.
2047
+ */
2048
+ stopAppByPName(pname: string): Promise<AppOperationResult>;
2049
+ /**
2050
+ * Stops an application by process ID.
2051
+ * Corresponds to Python's stop_app_by_pid() method
2052
+ *
2053
+ * @param pid - The process ID to stop.
2054
+ * @returns AppOperationResult with operation result and requestId
2055
+ * @throws Error if the operation fails.
2056
+ */
2057
+ stopAppByPID(pid: number): Promise<AppOperationResult>;
2058
+ /**
2059
+ * Stops an application by stop command.
2060
+ * Corresponds to Python's stop_app_by_cmd() method
2061
+ *
2062
+ * @param stopCmd - The stop command to execute.
2063
+ * @returns AppOperationResult with operation result and requestId
2064
+ * @throws Error if the operation fails.
2065
+ */
2066
+ stopAppByCmd(stopCmd: string): Promise<AppOperationResult>;
2067
+ /**
2068
+ * Returns a list of currently visible applications.
2069
+ * Corresponds to Python's list_visible_apps() method
2070
+ *
2071
+ * @returns ProcessListResult with visible apps and requestId
2072
+ * @throws Error if the operation fails.
2073
+ */
2074
+ listVisibleApps(): Promise<ProcessListResult>;
2075
+ }
2076
+
2077
+ /**
2078
+ * Handles code execution operations in the AgentBay cloud environment.
2079
+ */
2080
+ declare class Code {
2081
+ private session;
2082
+ /**
2083
+ * Initialize a Code object.
2084
+ *
2085
+ * @param session - The Session instance that this Code belongs to.
2086
+ */
2087
+ constructor(session: {
2088
+ getAPIKey(): string;
2089
+ getSessionId(): string;
2090
+ callMcpTool(toolName: string, args: any): Promise<{
2091
+ success: boolean;
2092
+ data: string;
2093
+ errorMessage: string;
2094
+ requestId: string;
2095
+ }>;
2096
+ });
2097
+ /**
2098
+ * Execute code in the specified language with a timeout.
2099
+ * Corresponds to Python's run_code() method
2100
+ *
2101
+ * @param code - The code to execute.
2102
+ * @param language - The programming language of the code. Must be either 'python' or 'javascript'.
2103
+ * @param timeoutS - The timeout for the code execution in seconds. Default is 300s.
2104
+ * @returns CodeExecutionResult with code execution output and requestId
2105
+ * @throws Error if an unsupported language is specified.
2106
+ */
2107
+ runCode(code: string, language: string, timeoutS?: number): Promise<CodeExecutionResult>;
2108
+ }
2109
+
2110
+ /**
2111
+ * Handles command execution operations in the AgentBay cloud environment.
2112
+ */
2113
+ declare class Command {
2114
+ private session;
2115
+ /**
2116
+ * Initialize a Command object.
2117
+ *
2118
+ * @param session - The Session instance that this Command belongs to.
2119
+ */
2120
+ constructor(session: Session);
2121
+ /**
2122
+ * Sanitizes error messages to remove sensitive information like API keys.
2123
+ *
2124
+ * @param error - The error to sanitize
2125
+ * @returns The sanitized error
2126
+ */
2127
+ private sanitizeError;
2128
+ /**
2129
+ * Execute a command in the session environment.
2130
+ * Corresponds to Python's execute_command() method
2131
+ *
2132
+ * @param command - The command to execute
2133
+ * @param timeoutMs - The timeout in milliseconds. Default is 1000ms.
2134
+ * @returns CommandResult with command output and requestId
2135
+ * @throws APIError if the operation fails.
2136
+ */
2137
+ executeCommand(command: string, timeoutMs?: number): Promise<CommandResult>;
2138
+ }
2139
+
2140
+ interface ContextStatusData {
2141
+ contextId: string;
2142
+ path: string;
2143
+ errorMessage: string;
2144
+ status: string;
2145
+ startTime: number;
2146
+ finishTime: number;
2147
+ taskType: string;
2148
+ }
2149
+ interface ContextStatusItem {
2150
+ type: string;
2151
+ data: string;
2152
+ }
2153
+ interface ContextInfoResult extends ApiResponse {
2154
+ contextStatusData: ContextStatusData[];
2155
+ }
2156
+ interface ContextSyncResult extends ApiResponse {
2157
+ success: boolean;
2158
+ }
2159
+ interface SessionInterface {
2160
+ getAPIKey(): string;
2161
+ getClient(): Client;
2162
+ getSessionId(): string;
2163
+ }
2164
+ declare class ContextManager {
2165
+ private session;
2166
+ constructor(session: SessionInterface);
2167
+ info(): Promise<ContextInfoResult>;
2168
+ infoWithParams(contextId?: string, path?: string, taskType?: string): Promise<ContextInfoResult>;
2169
+ sync(): Promise<ContextSyncResult>;
2170
+ syncWithParams(contextId?: string, path?: string, mode?: string): Promise<ContextSyncResult>;
2171
+ }
2172
+ declare function newContextManager(session: SessionInterface): ContextManager;
2173
+
2174
+ /**
2175
+ * FileInfo represents information about a file or directory
2176
+ */
2177
+ interface FileInfo {
2178
+ name: string;
2179
+ path: string;
2180
+ size: number;
2181
+ isDirectory: boolean;
2182
+ modTime: string;
2183
+ mode: string;
2184
+ owner?: string;
2185
+ group?: string;
2186
+ }
2187
+ /**
2188
+ * DirectoryEntry represents an entry in a directory listing
2189
+ */
2190
+ interface DirectoryEntry {
2191
+ name: string;
2192
+ isDirectory: boolean;
2193
+ }
2194
+ /**
2195
+ * Handles file operations in the AgentBay cloud environment.
2196
+ */
2197
+ declare class FileSystem {
2198
+ private session;
2199
+ /**
2200
+ * Initialize a FileSystem object.
2201
+ *
2202
+ * @param session - The Session instance that this FileSystem belongs to.
2203
+ */
2204
+ constructor(session: {
2205
+ getAPIKey(): string;
2206
+ getSessionId(): string;
2207
+ callMcpTool(toolName: string, args: any): Promise<{
2208
+ success: boolean;
2209
+ data: string;
2210
+ errorMessage: string;
2211
+ requestId: string;
2212
+ }>;
2213
+ });
2214
+ /**
2215
+ * Creates a new directory at the specified path.
2216
+ * Corresponds to Python's create_directory() method
2217
+ *
2218
+ * @param path - Path to the directory to create.
2219
+ * @returns BoolResult with creation result and requestId
2220
+ */
2221
+ createDirectory(path: string): Promise<BoolResult>;
2222
+ /**
2223
+ * Edits a file by replacing occurrences of oldText with newText.
2224
+ * Corresponds to Python's edit_file() method
2225
+ *
2226
+ * @param path - Path to the file to edit.
2227
+ * @param edits - Array of edit operations, each containing oldText and newText.
2228
+ * @param dryRun - Optional: If true, preview changes without applying them.
2229
+ * @returns BoolResult with edit result and requestId
2230
+ */
2231
+ editFile(path: string, edits: Array<{
2232
+ oldText: string;
2233
+ newText: string;
2234
+ }>, dryRun?: boolean): Promise<BoolResult>;
2235
+ /**
2236
+ * Gets information about a file or directory.
2237
+ * Corresponds to Python's get_file_info() method
2238
+ *
2239
+ * @param path - Path to the file or directory to inspect.
2240
+ * @returns FileInfoResult with file info and requestId
2241
+ */
2242
+ getFileInfo(path: string): Promise<FileInfoResult>;
2243
+ /**
2244
+ * Lists the contents of a directory.
2245
+ * Corresponds to Python's list_directory() method
2246
+ *
2247
+ * @param path - Path to the directory to list.
2248
+ * @returns DirectoryListResult with directory entries and requestId
2249
+ */
2250
+ listDirectory(path: string): Promise<DirectoryListResult>;
2251
+ /**
2252
+ * Moves a file or directory from source to destination.
2253
+ * Corresponds to Python's move_file() method
2254
+ *
2255
+ * @param source - Path to the source file or directory.
2256
+ * @param destination - Path to the destination file or directory.
2257
+ * @returns BoolResult with move result and requestId
2258
+ */
2259
+ moveFile(source: string, destination: string): Promise<BoolResult>;
2260
+ /**
2261
+ * Reads the content of a file.
2262
+ * Corresponds to Python's read_file() method
2263
+ *
2264
+ * @param path - Path to the file to read.
2265
+ * @param offset - Optional: Byte offset to start reading from (0-based).
2266
+ * @param length - Optional: Number of bytes to read. If 0, reads the entire file from offset.
2267
+ * @returns FileContentResult with file content and requestId
2268
+ */
2269
+ readFile(path: string, offset?: number, length?: number): Promise<FileContentResult>;
2270
+ /**
2271
+ * Reads the content of multiple files.
2272
+ * Corresponds to Python's read_multiple_files() method
2273
+ *
2274
+ * @param paths - Array of file paths to read.
2275
+ * @returns MultipleFileContentResult with file contents and requestId
2276
+ */
2277
+ readMultipleFiles(paths: string[]): Promise<MultipleFileContentResult>;
2278
+ /**
2279
+ * Searches for files in a directory that match a pattern.
2280
+ * Corresponds to Python's search_files() method
2281
+ *
2282
+ * @param path - Path to the directory to search in.
2283
+ * @param pattern - Pattern to search for. Supports glob patterns.
2284
+ * @param excludePatterns - Optional: Array of patterns to exclude.
2285
+ * @returns FileSearchResult with search results and requestId
2286
+ */
2287
+ searchFiles(path: string, pattern: string, excludePatterns?: string[]): Promise<FileSearchResult>;
2288
+ /**
2289
+ * Writes content to a file.
2290
+ * Corresponds to Python's write_file() method
2291
+ *
2292
+ * @param path - Path to the file to write.
2293
+ * @param content - Content to write to the file.
2294
+ * @param mode - Optional: Write mode. One of "overwrite", "append", or "create_new". Default is "overwrite".
2295
+ * @returns BoolResult with write result and requestId
2296
+ */
2297
+ writeFile(path: string, content: string, mode?: string): Promise<BoolResult>;
2298
+ /**
2299
+ * Reads a large file in chunks to handle size limitations of the underlying API.
2300
+ * Corresponds to Python's read_large_file() method
2301
+ *
2302
+ * @param path - Path to the file to read.
2303
+ * @param chunkSize - Optional: Size of each chunk in bytes. Default is 60KB.
2304
+ * @returns FileContentResult with complete file content and requestId
2305
+ */
2306
+ readLargeFile(path: string, chunkSize?: number): Promise<FileContentResult>;
2307
+ /**
2308
+ * Writes a large file in chunks to handle size limitations of the underlying API.
2309
+ * Corresponds to Python's write_large_file() method
2310
+ *
2311
+ * @param path - Path to the file to write.
2312
+ * @param content - Content to write to the file.
2313
+ * @param chunkSize - Optional: Size of each chunk in bytes. Default is 60KB.
2314
+ * @returns BoolResult indicating success or failure with requestId
2315
+ */
2316
+ writeLargeFile(path: string, content: string, chunkSize?: number): Promise<BoolResult>;
2317
+ }
2318
+
2319
+ /**
2320
+ * Handles OSS operations in the AgentBay cloud environment.
2321
+ */
2322
+ declare class Oss {
2323
+ private session;
2324
+ /**
2325
+ * Initialize an Oss object.
2326
+ *
2327
+ * @param session - The Session instance that this Oss belongs to.
2328
+ */
2329
+ constructor(session: Session);
2330
+ /**
2331
+ * Sanitizes error messages to remove sensitive information like API keys.
2332
+ *
2333
+ * @param error - The error to sanitize
2334
+ * @returns The sanitized error
2335
+ */
2336
+ private sanitizeError;
2337
+ /**
2338
+ * Initialize OSS environment variables with the specified credentials.
2339
+ * Corresponds to Python's env_init() method
2340
+ *
2341
+ * @param accessKeyId - The access key ID
2342
+ * @param accessKeySecret - The access key secret
2343
+ * @param securityToken - The security token (optional)
2344
+ * @param endpoint - The OSS endpoint (optional)
2345
+ * @param region - The OSS region (optional)
2346
+ * @returns OSSClientResult with client configuration and requestId
2347
+ * @throws APIError if the operation fails.
2348
+ */
2349
+ envInit(accessKeyId: string, accessKeySecret: string, securityToken?: string, endpoint?: string, region?: string): Promise<OSSClientResult>;
2350
+ /**
2351
+ * Upload a file to OSS.
2352
+ * Corresponds to Python's upload() method
2353
+ *
2354
+ * @param bucket - The OSS bucket name
2355
+ * @param object - The OSS object key
2356
+ * @param path - The local file path to upload
2357
+ * @returns OSSUploadResult with upload result and requestId
2358
+ * @throws APIError if the operation fails.
2359
+ */
2360
+ upload(bucket: string, object: string, path: string): Promise<OSSUploadResult>;
2361
+ /**
2362
+ * Upload a file to OSS using an anonymous URL.
2363
+ * Corresponds to Python's upload_anonymous() method
2364
+ *
2365
+ * @param url - The anonymous upload URL
2366
+ * @param path - The local file path to upload
2367
+ * @returns OSSUploadResult with upload result and requestId
2368
+ * @throws APIError if the operation fails.
2369
+ */
2370
+ uploadAnonymous(url: string, path: string): Promise<OSSUploadResult>;
2371
+ /**
2372
+ * Download a file from OSS.
2373
+ * Corresponds to Python's download() method
2374
+ *
2375
+ * @param bucket - The OSS bucket name
2376
+ * @param object - The OSS object key
2377
+ * @param path - The local file path to save the downloaded file
2378
+ * @returns OSSDownloadResult with download result and requestId
2379
+ * @throws APIError if the operation fails.
2380
+ */
2381
+ download(bucket: string, object: string, path: string): Promise<OSSDownloadResult>;
2382
+ /**
2383
+ * Download a file from OSS using an anonymous URL.
2384
+ * Corresponds to Python's download_anonymous() method
2385
+ *
2386
+ * @param url - The anonymous download URL
2387
+ * @param path - The local file path to save the downloaded file
2388
+ * @returns OSSDownloadResult with download result and requestId
2389
+ * @throws APIError if the operation fails.
2390
+ */
2391
+ downloadAnonymous(url: string, path: string): Promise<OSSDownloadResult>;
2392
+ }
2393
+
2394
+ /**
2395
+ * Key codes for UI operations
2396
+ */
2397
+ declare enum KeyCode {
2398
+ HOME = 3,
2399
+ BACK = 4,
2400
+ VOLUME_UP = 24,
2401
+ VOLUME_DOWN = 25,
2402
+ POWER = 26,
2403
+ MENU = 82
2404
+ }
2405
+ /**
2406
+ * Interface representing a UI element in the UI hierarchy
2407
+ */
2408
+ interface UIElement {
2409
+ bounds: string;
2410
+ className: string;
2411
+ text: string;
2412
+ type: string;
2413
+ resourceId: string;
2414
+ index: number;
2415
+ isParent: boolean;
2416
+ children?: UIElement[];
2417
+ }
2418
+ /**
2419
+ * Handles UI operations in the AgentBay cloud environment.
2420
+ */
2421
+ declare class UI {
2422
+ private session;
2423
+ /**
2424
+ * Initialize a UI object.
2425
+ *
2426
+ * @param session - The Session instance that this UI belongs to.
2427
+ */
2428
+ constructor(session: {
2429
+ getAPIKey(): string;
2430
+ getClient(): any;
2431
+ getSessionId(): string;
2432
+ callMcpTool(toolName: string, args: any): Promise<{
2433
+ success: boolean;
2434
+ data: string;
2435
+ errorMessage: string;
2436
+ requestId: string;
2437
+ }>;
2438
+ });
2439
+ /**
2440
+ * Sanitizes error messages to remove sensitive information like API keys.
2441
+ *
2442
+ * @param error - The error to sanitize
2443
+ * @returns The sanitized error
2444
+ */
2445
+ private sanitizeError;
2446
+ /**
2447
+ * Retrieves all clickable UI elements within the specified timeout.
2448
+ * Corresponds to Python's get_clickable_ui_elements() method
2449
+ *
2450
+ * @param timeoutMs - The timeout in milliseconds. Default is 2000ms.
2451
+ * @returns UIElementListResult with clickable UI elements and requestId
2452
+ * @throws APIError if the operation fails.
2453
+ */
2454
+ getClickableUIElements(timeoutMs?: number): Promise<UIElementListResult>;
2455
+ /**
2456
+ * Retrieves all UI elements regardless of their clickable status.
2457
+ * Corresponds to Python's get_all_ui_elements() method
2458
+ *
2459
+ * @param timeoutMs - The timeout in milliseconds. Default is 2000ms.
2460
+ * @returns UIElementListResult with all UI elements and requestId
2461
+ * @throws APIError if the operation fails.
2462
+ */
2463
+ getAllUIElements(timeoutMs?: number): Promise<UIElementListResult>;
2464
+ /**
2465
+ * Sends a key press event.
2466
+ * Corresponds to Python's send_key() method
2467
+ *
2468
+ * @param key - The key code to send. Supported key codes are:
2469
+ * - 3 : HOME
2470
+ * - 4 : BACK
2471
+ * - 24 : VOLUME UP
2472
+ * - 25 : VOLUME DOWN
2473
+ * - 26 : POWER
2474
+ * - 82 : MENU
2475
+ * @returns BoolResult with success status and requestId
2476
+ * @throws APIError if the operation fails.
2477
+ */
2478
+ sendKey(key: number): Promise<BoolResult>;
2479
+ /**
2480
+ * Inputs text into the currently focused UI element.
2481
+ * Corresponds to Python's input_text() method
2482
+ *
2483
+ * @param text - The text to input
2484
+ * @returns BoolResult with success status and requestId
2485
+ * @throws APIError if the operation fails.
2486
+ */
2487
+ inputText(text: string): Promise<BoolResult>;
2488
+ /**
2489
+ * Performs a swipe gesture on the screen.
2490
+ * Corresponds to Python's swipe() method
2491
+ *
2492
+ * @param startX - The starting X coordinate
2493
+ * @param startY - The starting Y coordinate
2494
+ * @param endX - The ending X coordinate
2495
+ * @param endY - The ending Y coordinate
2496
+ * @param durationMs - The duration of the swipe in milliseconds. Default is 300ms.
2497
+ * @returns BoolResult with success status and requestId
2498
+ * @throws APIError if the operation fails.
2499
+ */
2500
+ swipe(startX: number, startY: number, endX: number, endY: number, durationMs?: number): Promise<BoolResult>;
2501
+ /**
2502
+ * Clicks on the screen at the specified coordinates.
2503
+ * Corresponds to Python's click() method
2504
+ *
2505
+ * @param x - The X coordinate
2506
+ * @param y - The Y coordinate
2507
+ * @param button - The mouse button to use. Default is 'left'
2508
+ * @returns BoolResult with success status and requestId
2509
+ * @throws APIError if the operation fails.
2510
+ */
2511
+ click(x: number, y: number, button?: string): Promise<BoolResult>;
2512
+ /**
2513
+ * Takes a screenshot of the current screen.
2514
+ * Corresponds to Python's screenshot() method
2515
+ *
2516
+ * @returns OperationResult with success status and requestId
2517
+ * @throws APIError if the operation fails.
2518
+ */
2519
+ screenshot(): Promise<OperationResult>;
2520
+ }
2521
+
2522
+ /**
2523
+ * Handles window management operations in the AgentBay cloud environment.
2524
+ */
2525
+ declare class WindowManager {
2526
+ private session;
2527
+ /**
2528
+ * Creates a new WindowManager instance.
2529
+ * @param session The session object that provides access to the AgentBay API.
2530
+ */
2531
+ constructor(session: {
2532
+ getAPIKey(): string;
2533
+ getSessionId(): string;
2534
+ callMcpTool(toolName: string, args: any): Promise<{
2535
+ success: boolean;
2536
+ data: string;
2537
+ errorMessage: string;
2538
+ requestId: string;
2539
+ }>;
2540
+ });
2541
+ /**
2542
+ * Helper method to parse JSON string into Window objects
2543
+ * @param jsonStr - JSON string to parse
2544
+ * @returns Array of Window objects or single Window object
2545
+ */
2546
+ private parseWindowsFromJSON;
2547
+ /**
2548
+ * Lists all root windows in the system.
2549
+ * Corresponds to Python's list_root_windows() method
2550
+ *
2551
+ * @param timeoutMs - The timeout in milliseconds. Default is 3000ms.
2552
+ * @returns WindowListResult with windows array and requestId
2553
+ */
2554
+ listRootWindows(timeoutMs?: number): Promise<WindowListResult>;
2555
+ /**
2556
+ * Gets the currently active window.
2557
+ * Corresponds to Python's get_active_window() method
2558
+ *
2559
+ * @param timeoutMs - The timeout in milliseconds. Default is 3000ms.
2560
+ * @returns WindowInfoResult with active window data and requestId
2561
+ */
2562
+ getActiveWindow(timeoutMs?: number): Promise<WindowInfoResult>;
2563
+ /**
2564
+ * Activates a window by ID.
2565
+ * Corresponds to Python's activate_window() method
2566
+ *
2567
+ * @param windowId The ID of the window to activate.
2568
+ * @returns BoolResult with requestId
2569
+ */
2570
+ activateWindow(windowId: number): Promise<BoolResult>;
2571
+ /**
2572
+ * Maximizes a window by ID.
2573
+ * Corresponds to Python's maximize_window() method
2574
+ *
2575
+ * @param windowId The ID of the window to maximize.
2576
+ * @returns BoolResult with requestId
2577
+ */
2578
+ maximizeWindow(windowId: number): Promise<BoolResult>;
2579
+ /**
2580
+ * Minimizes a window by ID.
2581
+ * Corresponds to Python's minimize_window() method
2582
+ *
2583
+ * @param windowId The ID of the window to minimize.
2584
+ * @returns BoolResult with requestId
2585
+ */
2586
+ minimizeWindow(windowId: number): Promise<BoolResult>;
2587
+ /**
2588
+ * Restores a window by ID.
2589
+ * Corresponds to Python's restore_window() method
2590
+ *
2591
+ * @param windowId The ID of the window to restore.
2592
+ * @returns BoolResult with requestId
2593
+ */
2594
+ restoreWindow(windowId: number): Promise<BoolResult>;
2595
+ /**
2596
+ * Closes a window by ID.
2597
+ * Corresponds to Python's close_window() method
2598
+ *
2599
+ * @param windowId The ID of the window to close.
2600
+ * @returns BoolResult with requestId
2601
+ */
2602
+ closeWindow(windowId: number): Promise<BoolResult>;
2603
+ /**
2604
+ * Sets a window to fullscreen by ID.
2605
+ * Corresponds to Python's fullscreen_window() method
2606
+ *
2607
+ * @param windowId The ID of the window to set to fullscreen.
2608
+ * @returns BoolResult with requestId
2609
+ */
2610
+ fullscreenWindow(windowId: number): Promise<BoolResult>;
2611
+ /**
2612
+ * Resizes a window by ID.
2613
+ * Corresponds to Python's resize_window() method
2614
+ *
2615
+ * @param windowId The ID of the window to resize.
2616
+ * @param width The new width of the window.
2617
+ * @param height The new height of the window.
2618
+ * @returns BoolResult with requestId
2619
+ */
2620
+ resizeWindow(windowId: number, width: number, height: number): Promise<BoolResult>;
2621
+ /**
2622
+ * Enables or disables focus mode.
2623
+ * Corresponds to Python's focus_mode() method
2624
+ *
2625
+ * @param on Whether to enable focus mode.
2626
+ * @returns BoolResult with requestId
2627
+ */
2628
+ focusMode(on: boolean): Promise<BoolResult>;
2629
+ }
2630
+
2631
+ interface ActOptions {
2632
+ action: string;
2633
+ timeoutMS?: number;
2634
+ iframes?: boolean;
2635
+ domSettleTimeoutMS?: number;
2636
+ }
2637
+ interface ObserveOptions {
2638
+ instruction: string;
2639
+ returnActions?: number;
2640
+ iframes?: boolean;
2641
+ domSettleTimeoutMS?: number;
2642
+ }
2643
+ interface ExtractOptions<T = any> {
2644
+ instruction: string;
2645
+ schema: new (...args: any[]) => T;
2646
+ selector?: string;
2647
+ iframe?: boolean;
2648
+ domSettleTimeoutsMS?: number;
2649
+ }
2650
+ declare class ActResult {
2651
+ success: boolean;
2652
+ message: string;
2653
+ action: string;
2654
+ constructor(success: boolean, message: string, action: string);
2655
+ }
2656
+ declare class ObserveResult {
2657
+ selector: string;
2658
+ description: string;
2659
+ method: string;
2660
+ args: Record<string, any>;
2661
+ constructor(selector: string, description: string, method: string, args: Record<string, any>);
2662
+ }
2663
+ declare class BrowserAgent {
2664
+ private session;
2665
+ private browser;
2666
+ constructor(session: Session, browser: Browser);
2667
+ /**
2668
+ * Perform an action on the given Playwright Page object, using ActOptions to configure behavior.
2669
+ * Returns the result of the action.
2670
+ */
2671
+ act(page: any, options: ActOptions): Promise<ActResult>;
2672
+ /**
2673
+ * Async version of act method for performing actions on the given Playwright Page object.
2674
+ */
2675
+ actAsync(page: any, options: ActOptions): Promise<ActResult>;
2676
+ /**
2677
+ * Observe elements or state on the given Playwright Page object.
2678
+ * Returns a tuple containing (success, results).
2679
+ */
2680
+ observe(page: any, options: ObserveOptions): Promise<[boolean, ObserveResult[]]>;
2681
+ /**
2682
+ * Async version of observe method.
2683
+ */
2684
+ observeAsync(page: any, options: ObserveOptions): Promise<[boolean, ObserveResult[]]>;
2685
+ /**
2686
+ * Extract information from the given Playwright Page object.
2687
+ */
2688
+ extract<T>(page: any, options: ExtractOptions<T>): Promise<[boolean, T[]]>;
2689
+ /**
2690
+ * Async version of extract method.
2691
+ */
2692
+ extractAsync<T>(page: any, options: ExtractOptions<T>): Promise<[boolean, T[]]>;
2693
+ private _getPageAndContextIndex;
2694
+ private _getPageAndContextIndexAsync;
2695
+ private _callMcpTool;
2696
+ }
2697
+
2698
+ interface BrowserOption {
2699
+ persistentPath?: string;
2700
+ }
2701
+ declare class Browser {
2702
+ private session;
2703
+ private _endpointUrl;
2704
+ private _initialized;
2705
+ private _option;
2706
+ agent: BrowserAgent;
2707
+ constructor(session: Session);
2708
+ /**
2709
+ * Initialize the browser instance with the given options.
2710
+ * Returns true if successful, false otherwise.
2711
+ */
2712
+ initialize(option: BrowserOption): boolean;
2713
+ /**
2714
+ * Initialize the browser instance with the given options asynchronously.
2715
+ * Returns true if successful, false otherwise.
2716
+ */
2717
+ initializeAsync(option: BrowserOption): Promise<boolean>;
2718
+ /**
2719
+ * Returns the endpoint URL if the browser is initialized, otherwise throws an exception.
2720
+ * When initialized, always fetches the latest CDP url from session.getLink().
2721
+ */
2722
+ getEndpointUrl(): Promise<string>;
2723
+ /**
2724
+ * Returns the current BrowserOption used to initialize the browser, or null if not set.
2725
+ */
2726
+ getOption(): BrowserOption | null;
2727
+ /**
2728
+ * Returns true if the browser was initialized, false otherwise.
2729
+ */
2730
+ isInitialized(): boolean;
2731
+ }
2732
+
2733
+ /**
2734
+ * Represents an MCP tool with complete information.
2735
+ */
2736
+ interface McpTool {
2737
+ name: string;
2738
+ description: string;
2739
+ inputSchema: Record<string, any>;
2740
+ server: string;
2741
+ tool: string;
2742
+ }
2743
+ /**
2744
+ * Result containing MCP tools list and request ID.
2745
+ */
2746
+ interface McpToolsResult extends OperationResult {
2747
+ tools: McpTool[];
2748
+ }
2749
+ /**
2750
+ * Represents a session in the AgentBay cloud environment.
2751
+ */
2752
+ declare class Session {
2753
+ private agentBay;
2754
+ sessionId: string;
2755
+ resourceUrl: string;
2756
+ isVpc: boolean;
2757
+ networkInterfaceIp: string;
2758
+ httpPort: string;
2759
+ fileSystem: FileSystem;
2760
+ command: Command;
2761
+ code: Code;
2762
+ oss: Oss;
2763
+ application: Application;
2764
+ window: WindowManager;
2765
+ ui: UI;
2766
+ agent: Agent;
2767
+ browser: Browser;
2768
+ context: ContextManager;
2769
+ mcpTools: McpTool[];
2770
+ /**
2771
+ * Initialize a Session object.
2772
+ *
2773
+ * @param agentBay - The AgentBay instance that created this session.
2774
+ * @param sessionId - The ID of this session.
2775
+ */
2776
+ constructor(agentBay: AgentBay, sessionId: string);
2777
+ /**
2778
+ * Return the API key for this session.
2779
+ */
2780
+ getAPIKey(): string;
2781
+ /**
2782
+ * Return the HTTP client for this session.
2783
+ */
2784
+ getClient(): Client;
2785
+ /**
2786
+ * Return the session_id for this session.
2787
+ */
2788
+ getSessionId(): string;
2789
+ /**
2790
+ * Return whether this session uses VPC resources.
2791
+ */
2792
+ isVpcEnabled(): boolean;
2793
+ /**
2794
+ * Return the network interface IP for VPC sessions.
2795
+ */
2796
+ getNetworkInterfaceIp(): string;
2797
+ /**
2798
+ * Return the HTTP port for VPC sessions.
2799
+ */
2800
+ getHttpPort(): string;
2801
+ /**
2802
+ * Find the server that provides the given tool.
2803
+ */
2804
+ findServerForTool(toolName: string): string;
2805
+ /**
2806
+ * Delete this session.
2807
+ *
2808
+ * @param syncContext - Whether to sync context data (trigger file uploads) before deleting the session. Defaults to false.
2809
+ * @returns DeleteResult indicating success or failure and request ID
2810
+ */
2811
+ delete(syncContext?: boolean): Promise<DeleteResult>;
2812
+ /**
2813
+ * Validates labels parameter for label operations.
2814
+ *
2815
+ * @param labels - The labels to validate
2816
+ * @returns null if validation passes, or OperationResult with error if validation fails
2817
+ */
2818
+ private validateLabels;
2819
+ /**
2820
+ * Sets the labels for this session.
2821
+ *
2822
+ * @param labels - The labels to set for the session.
2823
+ * @returns OperationResult indicating success or failure with request ID
2824
+ * @throws Error if the operation fails (matching Python SessionError)
2825
+ */
2826
+ setLabels(labels: Record<string, string>): Promise<OperationResult>;
2827
+ /**
2828
+ * Gets the labels for this session.
2829
+ *
2830
+ * @returns OperationResult containing the labels as data and request ID
2831
+ * @throws Error if the operation fails (matching Python SessionError)
2832
+ */
2833
+ getLabels(): Promise<OperationResult>;
2834
+ /**
2835
+ * Gets information about this session.
2836
+ *
2837
+ * @returns OperationResult containing the session information as data and request ID
2838
+ * @throws Error if the operation fails (matching Python SessionError)
2839
+ */
2840
+ info(): Promise<OperationResult>;
2841
+ /**
2842
+ * Get a link associated with the current session.
2843
+ *
2844
+ * @param protocolType - Optional protocol type to use for the link
2845
+ * @param port - Optional port to use for the link
2846
+ * @returns OperationResult containing the link as data and request ID
2847
+ * @throws Error if the operation fails (matching Python SessionError)
2848
+ */
2849
+ getLink(protocolType?: string, port?: number): Promise<OperationResult>;
2850
+ /**
2851
+ * Asynchronously get a link associated with the current session.
2852
+ *
2853
+ * @param protocolType - Optional protocol type to use for the link
2854
+ * @param port - Optional port to use for the link
2855
+ * @returns OperationResult containing the link as data and request ID
2856
+ * @throws Error if the operation fails (matching Python SessionError)
2857
+ */
2858
+ getLinkAsync(protocolType?: string, port?: number): Promise<OperationResult>;
2859
+ /**
2860
+ * List MCP tools available for this session.
2861
+ *
2862
+ * @param imageId Optional image ID, defaults to session's imageId or "linux_latest"
2863
+ * @returns McpToolsResult containing tools list and request ID
2864
+ */
2865
+ listMcpTools(imageId?: string): Promise<McpToolsResult>;
2866
+ /**
2867
+ * Call an MCP tool and return the result in a format compatible with Agent.
2868
+ *
2869
+ * @param toolName - Name of the MCP tool to call
2870
+ * @param args - Arguments to pass to the tool
2871
+ * @returns McpToolResult containing the response data
2872
+ */
2873
+ callMcpTool(toolName: string, args: any): Promise<McpToolResult>;
2874
+ }
2875
+
2876
+ /**
2877
+ * Browser context configuration for session.
2878
+ */
2879
+ interface BrowserContext {
2880
+ /** ID of the browser context to bind to the session */
2881
+ contextId: string;
2882
+ /** Whether to automatically upload browser data when the session ends */
2883
+ autoUpload: boolean;
2884
+ }
2885
+ /**
2886
+ * Configuration interface for CreateSessionParams
2887
+ */
2888
+ interface CreateSessionParamsConfig {
2889
+ 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
+ imageId?: string;
2896
+ contextSync: ContextSync[];
2897
+ /** Optional configuration for browser data synchronization */
2898
+ browserContext?: BrowserContext;
2899
+ /** Whether to create a VPC-based session. Defaults to false. */
2900
+ isVpc?: boolean;
2901
+ }
2902
+ /**
2903
+ * CreateSessionParams provides a way to configure the parameters for creating a new session
2904
+ * in the AgentBay cloud environment.
2905
+ */
2906
+ declare class CreateSessionParams$1 implements CreateSessionParamsConfig {
2907
+ /** Custom labels for the Session. These can be used for organizing and filtering sessions. */
2908
+ 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
+ /** Image ID to use for the session. */
2929
+ imageId?: string;
2930
+ /**
2931
+ * List of context synchronization configurations.
2932
+ * These configurations define how contexts should be synchronized and mounted.
2933
+ */
2934
+ contextSync: ContextSync[];
2935
+ /** Optional configuration for browser data synchronization. */
2936
+ browserContext?: BrowserContext;
2937
+ /** Whether to create a VPC-based session. Defaults to false. */
2938
+ isVpc: boolean;
2939
+ constructor();
2940
+ /**
2941
+ * WithLabels sets the labels for the session parameters and returns the updated parameters.
2942
+ */
2943
+ 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
+ /**
2949
+ * WithImageId sets the image ID for the session parameters and returns the updated parameters.
2950
+ */
2951
+ withImageId(imageId: string): CreateSessionParams$1;
2952
+ /**
2953
+ * WithBrowserContext sets the browser context for the session parameters and returns the updated parameters.
2954
+ */
2955
+ withBrowserContext(browserContext: BrowserContext): CreateSessionParams$1;
2956
+ /**
2957
+ * WithIsVpc sets the VPC flag for the session parameters and returns the updated parameters.
2958
+ */
2959
+ withIsVpc(isVpc: boolean): CreateSessionParams$1;
2960
+ /**
2961
+ * GetLabelsJSON returns the labels as a JSON string.
2962
+ * Returns an object with success status and result/error message to match Go version behavior.
2963
+ */
2964
+ getLabelsJSON(): {
2965
+ result: string;
2966
+ error?: string;
2967
+ };
2968
+ /**
2969
+ * AddContextSync adds a context sync configuration to the session parameters.
2970
+ */
2971
+ addContextSync(contextId: string, path: string, policy?: SyncPolicy): CreateSessionParams$1;
2972
+ /**
2973
+ * AddContextSyncConfig adds a pre-configured context sync to the session parameters.
2974
+ */
2975
+ addContextSyncConfig(contextSync: ContextSync): CreateSessionParams$1;
2976
+ /**
2977
+ * WithContextSync sets the context sync configurations for the session parameters.
2978
+ */
2979
+ withContextSync(contextSyncs: ContextSync[]): CreateSessionParams$1;
2980
+ /**
2981
+ * Convert to plain object for JSON serialization
2982
+ */
2983
+ toJSON(): CreateSessionParamsConfig;
2984
+ /**
2985
+ * Create from plain object
2986
+ */
2987
+ static fromJSON(config: CreateSessionParamsConfig): CreateSessionParams$1;
2988
+ }
2989
+ /**
2990
+ * NewCreateSessionParams creates a new CreateSessionParams with default values.
2991
+ */
2992
+ declare function newCreateSessionParams(): CreateSessionParams$1;
2993
+
2994
+ /**
2995
+ * Parameters for listing sessions with pagination support
2996
+ */
2997
+ interface ListSessionParams {
2998
+ /** Number of results per page (default: 10) */
2999
+ maxResults?: number;
3000
+ /** Token for the next page */
3001
+ nextToken?: string;
3002
+ /** Labels to filter by */
3003
+ labels: Record<string, string>;
3004
+ }
3005
+ /**
3006
+ * Result type for session listing with pagination information
3007
+ * Maintain consistency with the existing TypeScript SDK return structure and use the data field
3008
+ */
3009
+ interface SessionListResult extends ApiResponse {
3010
+ /** Array of sessions */
3011
+ data: Session[];
3012
+ /** Token for the next page (if available) */
3013
+ nextToken?: string;
3014
+ /** Number of results per page */
3015
+ maxResults?: number;
3016
+ /** Total number of results */
3017
+ totalCount?: number;
3018
+ }
3019
+
3020
+ /**
3021
+ * Parameters for creating a session.
3022
+ */
3023
+ interface CreateSessionParams {
3024
+ contextId?: string;
3025
+ labels?: Record<string, string>;
3026
+ imageId?: string;
3027
+ contextSync?: ContextSync[];
3028
+ browserContext?: BrowserContext;
3029
+ isVpc?: boolean;
3030
+ }
3031
+ /**
3032
+ * Main class for interacting with the AgentBay cloud runtime environment.
3033
+ */
3034
+ declare class AgentBay {
3035
+ private apiKey;
3036
+ private client;
3037
+ private regionId;
3038
+ private endpoint;
3039
+ private sessions;
3040
+ /**
3041
+ * Context service for managing persistent contexts.
3042
+ */
3043
+ context: ContextService;
3044
+ /**
3045
+ * Initialize the AgentBay client.
3046
+ *
3047
+ * @param options - Configuration options
3048
+ * @param options.apiKey - API key for authentication. If not provided, will look for AGENTBAY_API_KEY environment variable.
3049
+ * @param options.config - Custom configuration object. If not provided, will use environment-based configuration.
3050
+ */
3051
+ constructor(options?: {
3052
+ apiKey?: string;
3053
+ config?: Config;
3054
+ });
3055
+ /**
3056
+ * Create a new session in the AgentBay cloud environment.
3057
+ *
3058
+ * @param params - Optional parameters for creating the session
3059
+ * @returns SessionResult containing the created session and request ID
3060
+ */
3061
+ create(params?: CreateSessionParams): Promise<SessionResult>;
3062
+ /**
3063
+ * List all available sessions.
3064
+ *
3065
+ * @returns A list of session objects.
3066
+ */
3067
+ list(): Session[];
3068
+ /**
3069
+ * List sessions filtered by the provided labels with pagination support.
3070
+ * It returns sessions that match all the specified labels.
3071
+ *
3072
+ * **Breaking Change**: This method currently only accepts ListSessionParams parameters,
3073
+ *
3074
+ * @param params - Parameters including labels and pagination options (required)
3075
+ * @returns API response with sessions list and pagination info
3076
+ */
3077
+ listByLabels(params?: ListSessionParams): Promise<SessionListResult>;
3078
+ /**
3079
+ * Delete a session by session object.
3080
+ *
3081
+ * @param session - The session to delete.
3082
+ * @param syncContext - Whether to sync context data (trigger file uploads) before deleting the session. Defaults to false.
3083
+ * @returns DeleteResult indicating success or failure and request ID
3084
+ */
3085
+ delete(session: Session, syncContext?: boolean): Promise<DeleteResult>;
3086
+ /**
3087
+ *
3088
+ * @param sessionId - The ID of the session to remove.
3089
+ */
3090
+ removeSession(sessionId: string): void;
3091
+ getClient(): Client;
3092
+ getAPIKey(): string;
3093
+ }
3094
+
3095
+ /**
3096
+ * Base exception for all AgentBay SDK errors.
3097
+ */
3098
+ declare class AgentBayError extends Error {
3099
+ extra: Record<string, any>;
3100
+ constructor(message?: string, extra?: Record<string, any>);
3101
+ }
3102
+ /**
3103
+ * Raised when there is an authentication error.
3104
+ */
3105
+ declare class AuthenticationError extends AgentBayError {
3106
+ constructor(message?: string, extra?: Record<string, any>);
3107
+ }
3108
+ /**
3109
+ * Raised when there is an error with the API.
3110
+ */
3111
+ declare class APIError extends AgentBayError {
3112
+ statusCode?: number;
3113
+ constructor(message?: string, statusCode?: number, extra?: Record<string, any>);
3114
+ }
3115
+ /**
3116
+ * Raised for errors related to file operations.
3117
+ */
3118
+ declare class FileError extends AgentBayError {
3119
+ constructor(message?: string, extra?: Record<string, any>);
3120
+ }
3121
+ /**
3122
+ * Raised for errors related to command execution.
3123
+ */
3124
+ declare class CommandError extends AgentBayError {
3125
+ constructor(message?: string, extra?: Record<string, any>);
3126
+ }
3127
+ /**
3128
+ * Raised for errors related to session operations.
3129
+ */
3130
+ declare class SessionError extends AgentBayError {
3131
+ constructor(message?: string, extra?: Record<string, any>);
3132
+ }
3133
+ /**
3134
+ * Raised for errors related to OSS operations.
3135
+ */
3136
+ declare class OssError extends AgentBayError {
3137
+ constructor(message?: string, extra?: Record<string, any>);
3138
+ }
3139
+ /**
3140
+ * Raised for errors related to application operations.
3141
+ */
3142
+ declare class ApplicationError extends AgentBayError {
3143
+ constructor(message?: string, extra?: Record<string, any>);
3144
+ }
3145
+ /**
3146
+ * Raised for errors related to UI operations.
3147
+ */
3148
+ declare class UIError extends AgentBayError {
3149
+ constructor(message?: string, extra?: Record<string, any>);
3150
+ }
3151
+ /**
3152
+ * Raised for errors related to browser operations.
3153
+ */
3154
+ declare class BrowserError extends AgentBayError {
3155
+ constructor(message?: string, extra?: Record<string, any>);
3156
+ }
3157
+
3158
+ /**
3159
+ * Utility functions for logging in a clean format
3160
+ */
3161
+ /**
3162
+ * Log a message without the log prefix and file location
3163
+ * @param message The message to log
3164
+ * @param args Optional arguments to log
3165
+ */
3166
+ declare function log(message: string, ...args: any[]): void;
3167
+ /**
3168
+ * Log an error message
3169
+ * @param message The error message to log
3170
+ * @param error Optional error object
3171
+ */
3172
+ declare function logError(message: string, error?: any): void;
3173
+
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 };