wuying-agentbay-sdk 0.3.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -79
- package/dist/index.cjs +4301 -1946
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1498 -597
- package/dist/index.d.ts +1498 -597
- package/dist/index.mjs +4468 -2113
- package/dist/index.mjs.map +1 -1
- package/package.json +83 -55
package/dist/index.d.ts
CHANGED
|
@@ -1,302 +1,41 @@
|
|
|
1
1
|
import * as $dara from '@darabonba/typescript';
|
|
2
|
-
import
|
|
3
|
-
import { $OpenApiUtil } from '@alicloud/openapi-core';
|
|
2
|
+
import OpenApi, { $OpenApiUtil } from '@alicloud/openapi-core';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
|
-
* FileInfo represents information about a file or directory
|
|
7
|
-
*/
|
|
8
|
-
interface FileInfo {
|
|
9
|
-
name: string;
|
|
10
|
-
path: string;
|
|
11
|
-
size: number;
|
|
12
|
-
isDirectory: boolean;
|
|
13
|
-
modTime: string;
|
|
14
|
-
mode: string;
|
|
15
|
-
owner?: string;
|
|
16
|
-
group?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* DirectoryEntry represents an entry in a directory listing
|
|
20
|
-
*/
|
|
21
|
-
interface DirectoryEntry {
|
|
22
|
-
name: string;
|
|
23
|
-
isDirectory: boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Handles file operations in the AgentBay cloud environment.
|
|
27
|
-
*/
|
|
28
|
-
declare class FileSystem {
|
|
29
|
-
private session;
|
|
30
|
-
private client;
|
|
31
|
-
private baseUrl;
|
|
32
|
-
/**
|
|
33
|
-
* Initialize a FileSystem object.
|
|
34
|
-
*
|
|
35
|
-
* @param session - The Session instance that this FileSystem belongs to.
|
|
36
|
-
*/
|
|
37
|
-
constructor(session: Session);
|
|
38
|
-
/**
|
|
39
|
-
* Helper method to call MCP tools and handle common response processing
|
|
40
|
-
*
|
|
41
|
-
* @param toolName - Name of the MCP tool to call
|
|
42
|
-
* @param args - Arguments to pass to the tool
|
|
43
|
-
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
44
|
-
* @returns A CallMcpToolResult with the response data
|
|
45
|
-
* @throws APIError if the call fails
|
|
46
|
-
*/
|
|
47
|
-
private callMcpTool;
|
|
48
|
-
/**
|
|
49
|
-
* Creates a new directory at the specified path.
|
|
50
|
-
*
|
|
51
|
-
* @param path - Path to the directory to create.
|
|
52
|
-
* @returns The extracted text content from the API response
|
|
53
|
-
* @throws APIError if the operation fails.
|
|
54
|
-
*/
|
|
55
|
-
createDirectory(path: string): Promise<string>;
|
|
56
|
-
/**
|
|
57
|
-
* Edits a file by replacing occurrences of oldText with newText.
|
|
58
|
-
*
|
|
59
|
-
* @param path - Path to the file to edit.
|
|
60
|
-
* @param edits - Array of edit operations, each containing oldText and newText.
|
|
61
|
-
* @param dryRun - Optional: If true, preview changes without applying them.
|
|
62
|
-
* @returns The extracted text content from the API response
|
|
63
|
-
* @throws APIError if the operation fails.
|
|
64
|
-
*/
|
|
65
|
-
editFile(path: string, edits: Array<{
|
|
66
|
-
oldText: string;
|
|
67
|
-
newText: string;
|
|
68
|
-
}>, dryRun?: boolean): Promise<string>;
|
|
69
|
-
/**
|
|
70
|
-
* Gets information about a file or directory.
|
|
71
|
-
*
|
|
72
|
-
* @param path - Path to the file or directory to inspect.
|
|
73
|
-
* @returns The extracted text content from the API response
|
|
74
|
-
* @throws APIError if the operation fails.
|
|
75
|
-
*/
|
|
76
|
-
getFileInfo(path: string): Promise<FileInfo>;
|
|
77
|
-
/**
|
|
78
|
-
* Lists the contents of a directory.
|
|
79
|
-
*
|
|
80
|
-
* @param path - Path to the directory to list.
|
|
81
|
-
* @returns Array of directory entries with properties like name, isDirectory
|
|
82
|
-
* @throws APIError if the operation fails.
|
|
83
|
-
*/
|
|
84
|
-
listDirectory(path: string): Promise<DirectoryEntry[]>;
|
|
85
|
-
/**
|
|
86
|
-
* Moves a file or directory from source to destination.
|
|
87
|
-
*
|
|
88
|
-
* @param source - Path to the source file or directory.
|
|
89
|
-
* @param destination - Path to the destination file or directory.
|
|
90
|
-
* @returns The extracted text content from the API response
|
|
91
|
-
* @throws APIError if the operation fails.
|
|
92
|
-
*/
|
|
93
|
-
moveFile(source: string, destination: string): Promise<string>;
|
|
94
|
-
/**
|
|
95
|
-
* Reads the content of a file.
|
|
96
|
-
*
|
|
97
|
-
* @param path - Path to the file to read.
|
|
98
|
-
* @param offset - Optional: Line offset to start reading from.
|
|
99
|
-
* @param length - Optional: Number of lines to read. If 0, reads the entire file.
|
|
100
|
-
* @returns The extracted text content from the API response
|
|
101
|
-
* @throws APIError if the operation fails.
|
|
102
|
-
*/
|
|
103
|
-
readFile(path: string, offset?: number, length?: number): Promise<string>;
|
|
104
|
-
/**
|
|
105
|
-
* Reads the content of multiple files.
|
|
106
|
-
*
|
|
107
|
-
* @param paths - Array of file paths to read.
|
|
108
|
-
* @returns The extracted text content from the API response
|
|
109
|
-
* @throws APIError if the operation fails.
|
|
110
|
-
*/
|
|
111
|
-
readMultipleFiles(paths: string[]): Promise<Record<string, string>>;
|
|
112
|
-
/**
|
|
113
|
-
* Searches for files in a directory that match a pattern.
|
|
114
|
-
*
|
|
115
|
-
* @param path - Path to the directory to search in.
|
|
116
|
-
* @param pattern - Pattern to search for. Supports glob patterns.
|
|
117
|
-
* @param excludePatterns - Optional: Array of patterns to exclude.
|
|
118
|
-
* @returns Array of search results with properties like path
|
|
119
|
-
* @throws APIError if the operation fails.
|
|
120
|
-
*/
|
|
121
|
-
searchFiles(path: string, pattern: string, excludePatterns?: string[]): Promise<string[]>;
|
|
122
|
-
/**
|
|
123
|
-
* Writes content to a file.
|
|
124
|
-
*
|
|
125
|
-
* @param path - Path to the file to write.
|
|
126
|
-
* @param content - Content to write to the file.
|
|
127
|
-
* @param mode - Optional: Write mode. One of "overwrite", "append", or "create_new". Default is "overwrite".
|
|
128
|
-
* @returns The extracted text content from the API response
|
|
129
|
-
* @throws APIError if the operation fails.
|
|
130
|
-
*/
|
|
131
|
-
writeFile(path: string, content: string, mode?: string): Promise<string>;
|
|
132
|
-
/**
|
|
133
|
-
* Reads a large file in chunks to handle size limitations of the underlying API.
|
|
134
|
-
* It automatically splits the read operation into multiple requests of chunkSize bytes each.
|
|
135
|
-
*
|
|
136
|
-
* @param path - Path to the file to read.
|
|
137
|
-
* @param chunkSize - Optional: Size of each chunk in bytes. Default is 60KB.
|
|
138
|
-
* @returns The complete file content as a string
|
|
139
|
-
* @throws APIError if the operation fails.
|
|
140
|
-
*/
|
|
141
|
-
readLargeFile(path: string, chunkSize?: number): Promise<string>;
|
|
142
|
-
/**
|
|
143
|
-
* Writes a large file in chunks to handle size limitations of the underlying API.
|
|
144
|
-
* It automatically splits the write operation into multiple requests of chunkSize bytes each.
|
|
145
|
-
*
|
|
146
|
-
* @param path - Path to the file to write.
|
|
147
|
-
* @param content - Content to write to the file.
|
|
148
|
-
* @param chunkSize - Optional: Size of each chunk in bytes. Default is 60KB.
|
|
149
|
-
* @returns True if the operation was successful
|
|
150
|
-
* @throws APIError if the operation fails.
|
|
151
|
-
*/
|
|
152
|
-
writeLargeFile(path: string, content: string, chunkSize?: number): Promise<boolean>;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Represents the result of a command execution
|
|
157
|
-
*/
|
|
158
|
-
interface CommandResult {
|
|
159
|
-
output: string;
|
|
160
|
-
exitCode?: number;
|
|
161
|
-
durationMs?: number;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Represents the result of code execution
|
|
165
|
-
*/
|
|
166
|
-
interface CodeExecutionResult {
|
|
167
|
-
output: string;
|
|
168
|
-
durationMs?: number;
|
|
169
|
-
memoryKb?: number;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Handles command execution operations in the AgentBay cloud environment.
|
|
173
5
|
*/
|
|
174
|
-
declare class
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
* @throws APIError if the call fails
|
|
192
|
-
*/
|
|
193
|
-
private callMcpTool;
|
|
194
|
-
/**
|
|
195
|
-
* Helper method to parse JSON string or return a simple object with output
|
|
196
|
-
*/
|
|
197
|
-
private parseCommandResult;
|
|
198
|
-
/**
|
|
199
|
-
* Execute a command in the cloud environment with a specified timeout.
|
|
200
|
-
*
|
|
201
|
-
* @param command - The command to execute.
|
|
202
|
-
* @param timeoutMs - The timeout for the command execution in milliseconds. Default is 1000ms.
|
|
203
|
-
* @returns A string containing the command output
|
|
204
|
-
*/
|
|
205
|
-
executeCommand(command: string, timeoutMs?: number): Promise<string>;
|
|
206
|
-
/**
|
|
207
|
-
* Helper method to parse JSON string or return a simple object with output
|
|
208
|
-
*/
|
|
209
|
-
private parseCodeExecutionResult;
|
|
210
|
-
/**
|
|
211
|
-
* Execute code in the specified language with a timeout.
|
|
212
|
-
*
|
|
213
|
-
* @param code - The code to execute.
|
|
214
|
-
* @param language - The programming language of the code. Must be either 'python' or 'javascript'.
|
|
215
|
-
* @param timeoutS - The timeout for the code execution in seconds. Default is 300s.
|
|
216
|
-
* @returns A string containing the code execution output
|
|
217
|
-
* @throws APIError if the code execution fails or if an unsupported language is specified.
|
|
218
|
-
*/
|
|
219
|
-
runCode(code: string, language: string, timeoutS?: number): Promise<string>;
|
|
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
|
+
});
|
|
220
23
|
}
|
|
221
24
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
* Helper method to call MCP tools and handle common response processing
|
|
237
|
-
*
|
|
238
|
-
* @param toolName - Name of the MCP tool to call
|
|
239
|
-
* @param args - Arguments to pass to the tool
|
|
240
|
-
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
241
|
-
* @returns A CallMcpToolResult with the response data
|
|
242
|
-
* @throws APIError if the call fails
|
|
243
|
-
*/
|
|
244
|
-
private callMcpTool;
|
|
245
|
-
/**
|
|
246
|
-
* Initialize OSS environment variables with the specified credentials.
|
|
247
|
-
*
|
|
248
|
-
* @param accessKeyId - The Access Key ID for OSS authentication.
|
|
249
|
-
* @param accessKeySecret - The Access Key Secret for OSS authentication.
|
|
250
|
-
* @param securityToken - The security token for OSS authentication.
|
|
251
|
-
* @param endpoint - The OSS service endpoint. If not specified, the default is used.
|
|
252
|
-
* @param region - The OSS region. If not specified, the default is used.
|
|
253
|
-
* @returns The extracted text content from the API response
|
|
254
|
-
*/
|
|
255
|
-
envInit(accessKeyId: string, accessKeySecret: string, securityToken: string, endpoint?: string, region?: string): Promise<string>;
|
|
256
|
-
/**
|
|
257
|
-
* Create an OSS client with the provided credentials.
|
|
258
|
-
*
|
|
259
|
-
* @param accessKeyId - The Access Key ID for OSS authentication.
|
|
260
|
-
* @param accessKeySecret - The Access Key Secret for OSS authentication.
|
|
261
|
-
* @param endpoint - The OSS service endpoint. If not specified, the default is used.
|
|
262
|
-
* @param region - The OSS region. If not specified, the default is used.
|
|
263
|
-
* @returns The extracted text content from the API response
|
|
264
|
-
*/
|
|
265
|
-
createClient(accessKeyId: string, accessKeySecret: string, endpoint?: string, region?: string): Promise<string>;
|
|
266
|
-
/**
|
|
267
|
-
* Upload a local file or directory to OSS.
|
|
268
|
-
*
|
|
269
|
-
* @param bucket - OSS bucket name.
|
|
270
|
-
* @param object - Object key in OSS.
|
|
271
|
-
* @param path - Local file or directory path to upload.
|
|
272
|
-
* @returns The extracted text content from the API response
|
|
273
|
-
*/
|
|
274
|
-
upload(bucket: string, object: string, path: string): Promise<string>;
|
|
275
|
-
/**
|
|
276
|
-
* Upload a local file or directory to OSS using a pre-signed URL.
|
|
277
|
-
*
|
|
278
|
-
* @param url - Pre-signed URL for anonymous upload.
|
|
279
|
-
* @param path - Local file or directory path to upload.
|
|
280
|
-
* @returns The extracted text content from the API response
|
|
281
|
-
*/
|
|
282
|
-
uploadAnonymous(url: string, path: string): Promise<string>;
|
|
283
|
-
/**
|
|
284
|
-
* Download an object from OSS to a local file or directory.
|
|
285
|
-
*
|
|
286
|
-
* @param bucket - OSS bucket name.
|
|
287
|
-
* @param object - Object key in OSS.
|
|
288
|
-
* @param path - Local file or directory path to save the downloaded content.
|
|
289
|
-
* @returns The extracted text content from the API response
|
|
290
|
-
*/
|
|
291
|
-
download(bucket: string, object: string, path: string): Promise<string>;
|
|
292
|
-
/**
|
|
293
|
-
* Download an object from OSS using a pre-signed URL.
|
|
294
|
-
*
|
|
295
|
-
* @param url - Pre-signed URL for anonymous download.
|
|
296
|
-
* @param path - Local file or directory path to save the downloaded content.
|
|
297
|
-
* @returns The extracted text content from the API response
|
|
298
|
-
*/
|
|
299
|
-
downloadAnonymous(url: string, path: string): Promise<string>;
|
|
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
|
+
});
|
|
300
39
|
}
|
|
301
40
|
|
|
302
41
|
declare class CreateMcpSessionResponseBodyData extends $dara.Model {
|
|
@@ -337,6 +76,20 @@ declare class GetContextResponseBodyData extends $dara.Model {
|
|
|
337
76
|
});
|
|
338
77
|
}
|
|
339
78
|
|
|
79
|
+
declare class GetContextInfoResponseBodyData extends $dara.Model {
|
|
80
|
+
contextStatus?: string;
|
|
81
|
+
static names(): {
|
|
82
|
+
[key: string]: string;
|
|
83
|
+
};
|
|
84
|
+
static types(): {
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
};
|
|
87
|
+
validate(): void;
|
|
88
|
+
constructor(map?: {
|
|
89
|
+
[key: string]: any;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
340
93
|
declare class GetLabelResponseBodyData extends $dara.Model {
|
|
341
94
|
labels?: string;
|
|
342
95
|
static names(): {
|
|
@@ -351,12 +104,27 @@ declare class GetLabelResponseBodyData extends $dara.Model {
|
|
|
351
104
|
});
|
|
352
105
|
}
|
|
353
106
|
|
|
107
|
+
declare class GetLinkResponseBodyData extends $dara.Model {
|
|
108
|
+
url?: string;
|
|
109
|
+
static names(): {
|
|
110
|
+
[key: string]: string;
|
|
111
|
+
};
|
|
112
|
+
static types(): {
|
|
113
|
+
[key: string]: any;
|
|
114
|
+
};
|
|
115
|
+
validate(): void;
|
|
116
|
+
constructor(map?: {
|
|
117
|
+
[key: string]: any;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
354
121
|
declare class GetMcpResourceResponseBodyDataDesktopInfo extends $dara.Model {
|
|
355
122
|
appId?: string;
|
|
356
123
|
authCode?: string;
|
|
357
124
|
connectionProperties?: string;
|
|
358
125
|
resourceId?: string;
|
|
359
126
|
resourceType?: string;
|
|
127
|
+
ticket?: string;
|
|
360
128
|
static names(): {
|
|
361
129
|
[key: string]: string;
|
|
362
130
|
};
|
|
@@ -418,6 +186,58 @@ declare class ListSessionResponseBodyData extends $dara.Model {
|
|
|
418
186
|
});
|
|
419
187
|
}
|
|
420
188
|
|
|
189
|
+
declare class ApplyMqttTokenRequest extends $dara.Model {
|
|
190
|
+
desktopId?: string;
|
|
191
|
+
sessionToken?: string;
|
|
192
|
+
static names(): {
|
|
193
|
+
[key: string]: string;
|
|
194
|
+
};
|
|
195
|
+
static types(): {
|
|
196
|
+
[key: string]: any;
|
|
197
|
+
};
|
|
198
|
+
validate(): void;
|
|
199
|
+
constructor(map?: {
|
|
200
|
+
[key: string]: any;
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
declare class ApplyMqttTokenResponseBody extends $dara.Model {
|
|
205
|
+
code?: string;
|
|
206
|
+
data?: ApplyMqttTokenResponseBodyData;
|
|
207
|
+
httpStatusCode?: number;
|
|
208
|
+
message?: string;
|
|
209
|
+
requestId?: string;
|
|
210
|
+
success?: boolean;
|
|
211
|
+
static names(): {
|
|
212
|
+
[key: string]: string;
|
|
213
|
+
};
|
|
214
|
+
static types(): {
|
|
215
|
+
[key: string]: any;
|
|
216
|
+
};
|
|
217
|
+
validate(): void;
|
|
218
|
+
constructor(map?: {
|
|
219
|
+
[key: string]: any;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
declare class ApplyMqttTokenResponse extends $dara.Model {
|
|
224
|
+
headers?: {
|
|
225
|
+
[key: string]: string;
|
|
226
|
+
};
|
|
227
|
+
statusCode?: number;
|
|
228
|
+
body?: ApplyMqttTokenResponseBody;
|
|
229
|
+
static names(): {
|
|
230
|
+
[key: string]: string;
|
|
231
|
+
};
|
|
232
|
+
static types(): {
|
|
233
|
+
[key: string]: any;
|
|
234
|
+
};
|
|
235
|
+
validate(): void;
|
|
236
|
+
constructor(map?: {
|
|
237
|
+
[key: string]: any;
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
421
241
|
declare class CallMcpToolRequest extends $dara.Model {
|
|
422
242
|
args?: string;
|
|
423
243
|
authorization?: string;
|
|
@@ -482,6 +302,27 @@ declare class CreateMcpSessionRequest extends $dara.Model {
|
|
|
482
302
|
externalUserId?: string;
|
|
483
303
|
imageId?: string;
|
|
484
304
|
labels?: string;
|
|
305
|
+
persistenceDataList?: CreateMcpSessionRequestPersistenceDataList[];
|
|
306
|
+
sessionId?: string;
|
|
307
|
+
static names(): {
|
|
308
|
+
[key: string]: string;
|
|
309
|
+
};
|
|
310
|
+
static types(): {
|
|
311
|
+
[key: string]: any;
|
|
312
|
+
};
|
|
313
|
+
validate(): void;
|
|
314
|
+
constructor(map?: {
|
|
315
|
+
[key: string]: any;
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
declare class CreateMcpSessionShrinkRequest extends $dara.Model {
|
|
320
|
+
authorization?: string;
|
|
321
|
+
contextId?: string;
|
|
322
|
+
externalUserId?: string;
|
|
323
|
+
imageId?: string;
|
|
324
|
+
labels?: string;
|
|
325
|
+
persistenceDataListShrink?: string;
|
|
485
326
|
sessionId?: string;
|
|
486
327
|
static names(): {
|
|
487
328
|
[key: string]: string;
|
|
@@ -636,6 +477,61 @@ declare class GetContextResponse extends $dara.Model {
|
|
|
636
477
|
});
|
|
637
478
|
}
|
|
638
479
|
|
|
480
|
+
declare class GetContextInfoRequest extends $dara.Model {
|
|
481
|
+
authorization?: string;
|
|
482
|
+
contextId?: string;
|
|
483
|
+
path?: string;
|
|
484
|
+
sessionId?: string;
|
|
485
|
+
taskType?: string;
|
|
486
|
+
static names(): {
|
|
487
|
+
[key: string]: string;
|
|
488
|
+
};
|
|
489
|
+
static types(): {
|
|
490
|
+
[key: string]: any;
|
|
491
|
+
};
|
|
492
|
+
validate(): void;
|
|
493
|
+
constructor(map?: {
|
|
494
|
+
[key: string]: any;
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
declare class GetContextInfoResponseBody extends $dara.Model {
|
|
499
|
+
code?: string;
|
|
500
|
+
data?: GetContextInfoResponseBodyData;
|
|
501
|
+
httpStatusCode?: number;
|
|
502
|
+
message?: string;
|
|
503
|
+
requestId?: string;
|
|
504
|
+
success?: boolean;
|
|
505
|
+
static names(): {
|
|
506
|
+
[key: string]: string;
|
|
507
|
+
};
|
|
508
|
+
static types(): {
|
|
509
|
+
[key: string]: any;
|
|
510
|
+
};
|
|
511
|
+
validate(): void;
|
|
512
|
+
constructor(map?: {
|
|
513
|
+
[key: string]: any;
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
declare class GetContextInfoResponse extends $dara.Model {
|
|
518
|
+
headers?: {
|
|
519
|
+
[key: string]: string;
|
|
520
|
+
};
|
|
521
|
+
statusCode?: number;
|
|
522
|
+
body?: GetContextInfoResponseBody;
|
|
523
|
+
static names(): {
|
|
524
|
+
[key: string]: string;
|
|
525
|
+
};
|
|
526
|
+
static types(): {
|
|
527
|
+
[key: string]: any;
|
|
528
|
+
};
|
|
529
|
+
validate(): void;
|
|
530
|
+
constructor(map?: {
|
|
531
|
+
[key: string]: any;
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
|
|
639
535
|
declare class GetLabelRequest extends $dara.Model {
|
|
640
536
|
authorization?: string;
|
|
641
537
|
maxResults?: number;
|
|
@@ -695,6 +591,8 @@ declare class GetLabelResponse extends $dara.Model {
|
|
|
695
591
|
|
|
696
592
|
declare class GetLinkRequest extends $dara.Model {
|
|
697
593
|
authorization?: string;
|
|
594
|
+
port?: number;
|
|
595
|
+
protocolType?: string;
|
|
698
596
|
sessionId?: string;
|
|
699
597
|
static names(): {
|
|
700
598
|
[key: string]: string;
|
|
@@ -710,7 +608,7 @@ declare class GetLinkRequest extends $dara.Model {
|
|
|
710
608
|
|
|
711
609
|
declare class GetLinkResponseBody extends $dara.Model {
|
|
712
610
|
code?: string;
|
|
713
|
-
data?:
|
|
611
|
+
data?: GetLinkResponseBodyData;
|
|
714
612
|
httpStatusCode?: number;
|
|
715
613
|
message?: string;
|
|
716
614
|
requestId?: string;
|
|
@@ -727,12 +625,120 @@ declare class GetLinkResponseBody extends $dara.Model {
|
|
|
727
625
|
});
|
|
728
626
|
}
|
|
729
627
|
|
|
730
|
-
declare class GetLinkResponse extends $dara.Model {
|
|
628
|
+
declare class GetLinkResponse extends $dara.Model {
|
|
629
|
+
headers?: {
|
|
630
|
+
[key: string]: string;
|
|
631
|
+
};
|
|
632
|
+
statusCode?: number;
|
|
633
|
+
body?: GetLinkResponseBody;
|
|
634
|
+
static names(): {
|
|
635
|
+
[key: string]: string;
|
|
636
|
+
};
|
|
637
|
+
static types(): {
|
|
638
|
+
[key: string]: any;
|
|
639
|
+
};
|
|
640
|
+
validate(): void;
|
|
641
|
+
constructor(map?: {
|
|
642
|
+
[key: string]: any;
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
declare class GetMcpResourceRequest extends $dara.Model {
|
|
647
|
+
authorization?: string;
|
|
648
|
+
sessionId?: string;
|
|
649
|
+
static names(): {
|
|
650
|
+
[key: string]: string;
|
|
651
|
+
};
|
|
652
|
+
static types(): {
|
|
653
|
+
[key: string]: any;
|
|
654
|
+
};
|
|
655
|
+
validate(): void;
|
|
656
|
+
constructor(map?: {
|
|
657
|
+
[key: string]: any;
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
declare class GetMcpResourceResponseBody extends $dara.Model {
|
|
662
|
+
code?: string;
|
|
663
|
+
data?: GetMcpResourceResponseBodyData;
|
|
664
|
+
httpStatusCode?: number;
|
|
665
|
+
message?: string;
|
|
666
|
+
requestId?: string;
|
|
667
|
+
success?: boolean;
|
|
668
|
+
static names(): {
|
|
669
|
+
[key: string]: string;
|
|
670
|
+
};
|
|
671
|
+
static types(): {
|
|
672
|
+
[key: string]: any;
|
|
673
|
+
};
|
|
674
|
+
validate(): void;
|
|
675
|
+
constructor(map?: {
|
|
676
|
+
[key: string]: any;
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
declare class GetMcpResourceResponse extends $dara.Model {
|
|
681
|
+
headers?: {
|
|
682
|
+
[key: string]: string;
|
|
683
|
+
};
|
|
684
|
+
statusCode?: number;
|
|
685
|
+
body?: GetMcpResourceResponseBody;
|
|
686
|
+
static names(): {
|
|
687
|
+
[key: string]: string;
|
|
688
|
+
};
|
|
689
|
+
static types(): {
|
|
690
|
+
[key: string]: any;
|
|
691
|
+
};
|
|
692
|
+
validate(): void;
|
|
693
|
+
constructor(map?: {
|
|
694
|
+
[key: string]: any;
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
declare class ListContextsRequest extends $dara.Model {
|
|
699
|
+
authorization?: string;
|
|
700
|
+
maxResults?: number;
|
|
701
|
+
nextToken?: string;
|
|
702
|
+
static names(): {
|
|
703
|
+
[key: string]: string;
|
|
704
|
+
};
|
|
705
|
+
static types(): {
|
|
706
|
+
[key: string]: any;
|
|
707
|
+
};
|
|
708
|
+
validate(): void;
|
|
709
|
+
constructor(map?: {
|
|
710
|
+
[key: string]: any;
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
declare class ListContextsResponseBody extends $dara.Model {
|
|
715
|
+
code?: string;
|
|
716
|
+
data?: ListContextsResponseBodyData[];
|
|
717
|
+
httpStatusCode?: number;
|
|
718
|
+
maxResults?: number;
|
|
719
|
+
message?: string;
|
|
720
|
+
nextToken?: string;
|
|
721
|
+
requestId?: string;
|
|
722
|
+
success?: boolean;
|
|
723
|
+
totalCount?: 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
|
+
}
|
|
735
|
+
|
|
736
|
+
declare class ListContextsResponse extends $dara.Model {
|
|
731
737
|
headers?: {
|
|
732
738
|
[key: string]: string;
|
|
733
739
|
};
|
|
734
740
|
statusCode?: number;
|
|
735
|
-
body?:
|
|
741
|
+
body?: ListContextsResponseBody;
|
|
736
742
|
static names(): {
|
|
737
743
|
[key: string]: string;
|
|
738
744
|
};
|
|
@@ -745,9 +751,9 @@ declare class GetLinkResponse extends $dara.Model {
|
|
|
745
751
|
});
|
|
746
752
|
}
|
|
747
753
|
|
|
748
|
-
declare class
|
|
754
|
+
declare class ListMcpToolsRequest extends $dara.Model {
|
|
749
755
|
authorization?: string;
|
|
750
|
-
|
|
756
|
+
imageId?: string;
|
|
751
757
|
static names(): {
|
|
752
758
|
[key: string]: string;
|
|
753
759
|
};
|
|
@@ -760,9 +766,9 @@ declare class GetMcpResourceRequest extends $dara.Model {
|
|
|
760
766
|
});
|
|
761
767
|
}
|
|
762
768
|
|
|
763
|
-
declare class
|
|
769
|
+
declare class ListMcpToolsResponseBody extends $dara.Model {
|
|
764
770
|
code?: string;
|
|
765
|
-
data?:
|
|
771
|
+
data?: string;
|
|
766
772
|
httpStatusCode?: number;
|
|
767
773
|
message?: string;
|
|
768
774
|
requestId?: string;
|
|
@@ -779,12 +785,12 @@ declare class GetMcpResourceResponseBody extends $dara.Model {
|
|
|
779
785
|
});
|
|
780
786
|
}
|
|
781
787
|
|
|
782
|
-
declare class
|
|
788
|
+
declare class ListMcpToolsResponse extends $dara.Model {
|
|
783
789
|
headers?: {
|
|
784
790
|
[key: string]: string;
|
|
785
791
|
};
|
|
786
792
|
statusCode?: number;
|
|
787
|
-
body?:
|
|
793
|
+
body?: ListMcpToolsResponseBody;
|
|
788
794
|
static names(): {
|
|
789
795
|
[key: string]: string;
|
|
790
796
|
};
|
|
@@ -797,8 +803,9 @@ declare class GetMcpResourceResponse extends $dara.Model {
|
|
|
797
803
|
});
|
|
798
804
|
}
|
|
799
805
|
|
|
800
|
-
declare class
|
|
806
|
+
declare class ListSessionRequest extends $dara.Model {
|
|
801
807
|
authorization?: string;
|
|
808
|
+
labels?: string;
|
|
802
809
|
maxResults?: number;
|
|
803
810
|
nextToken?: string;
|
|
804
811
|
static names(): {
|
|
@@ -813,9 +820,9 @@ declare class ListContextsRequest extends $dara.Model {
|
|
|
813
820
|
});
|
|
814
821
|
}
|
|
815
822
|
|
|
816
|
-
declare class
|
|
823
|
+
declare class ListSessionResponseBody extends $dara.Model {
|
|
817
824
|
code?: string;
|
|
818
|
-
data?:
|
|
825
|
+
data?: ListSessionResponseBodyData[];
|
|
819
826
|
httpStatusCode?: number;
|
|
820
827
|
maxResults?: number;
|
|
821
828
|
message?: string;
|
|
@@ -835,12 +842,12 @@ declare class ListContextsResponseBody extends $dara.Model {
|
|
|
835
842
|
});
|
|
836
843
|
}
|
|
837
844
|
|
|
838
|
-
declare class
|
|
845
|
+
declare class ListSessionResponse extends $dara.Model {
|
|
839
846
|
headers?: {
|
|
840
847
|
[key: string]: string;
|
|
841
848
|
};
|
|
842
849
|
statusCode?: number;
|
|
843
|
-
body?:
|
|
850
|
+
body?: ListSessionResponseBody;
|
|
844
851
|
static names(): {
|
|
845
852
|
[key: string]: string;
|
|
846
853
|
};
|
|
@@ -853,11 +860,10 @@ declare class ListContextsResponse extends $dara.Model {
|
|
|
853
860
|
});
|
|
854
861
|
}
|
|
855
862
|
|
|
856
|
-
declare class
|
|
863
|
+
declare class ModifyContextRequest extends $dara.Model {
|
|
857
864
|
authorization?: string;
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
nextToken?: string;
|
|
865
|
+
id?: string;
|
|
866
|
+
name?: string;
|
|
861
867
|
static names(): {
|
|
862
868
|
[key: string]: string;
|
|
863
869
|
};
|
|
@@ -870,16 +876,12 @@ declare class ListSessionRequest extends $dara.Model {
|
|
|
870
876
|
});
|
|
871
877
|
}
|
|
872
878
|
|
|
873
|
-
declare class
|
|
879
|
+
declare class ModifyContextResponseBody extends $dara.Model {
|
|
874
880
|
code?: string;
|
|
875
|
-
data?: ListSessionResponseBodyData[];
|
|
876
881
|
httpStatusCode?: number;
|
|
877
|
-
maxResults?: number;
|
|
878
882
|
message?: string;
|
|
879
|
-
nextToken?: string;
|
|
880
883
|
requestId?: string;
|
|
881
884
|
success?: boolean;
|
|
882
|
-
totalCount?: number;
|
|
883
885
|
static names(): {
|
|
884
886
|
[key: string]: string;
|
|
885
887
|
};
|
|
@@ -892,12 +894,12 @@ declare class ListSessionResponseBody extends $dara.Model {
|
|
|
892
894
|
});
|
|
893
895
|
}
|
|
894
896
|
|
|
895
|
-
declare class
|
|
897
|
+
declare class ModifyContextResponse extends $dara.Model {
|
|
896
898
|
headers?: {
|
|
897
899
|
[key: string]: string;
|
|
898
900
|
};
|
|
899
901
|
statusCode?: number;
|
|
900
|
-
body?:
|
|
902
|
+
body?: ModifyContextResponseBody;
|
|
901
903
|
static names(): {
|
|
902
904
|
[key: string]: string;
|
|
903
905
|
};
|
|
@@ -910,10 +912,9 @@ declare class ListSessionResponse extends $dara.Model {
|
|
|
910
912
|
});
|
|
911
913
|
}
|
|
912
914
|
|
|
913
|
-
declare class
|
|
915
|
+
declare class ReleaseMcpSessionRequest extends $dara.Model {
|
|
914
916
|
authorization?: string;
|
|
915
|
-
|
|
916
|
-
name?: string;
|
|
917
|
+
sessionId?: string;
|
|
917
918
|
static names(): {
|
|
918
919
|
[key: string]: string;
|
|
919
920
|
};
|
|
@@ -926,7 +927,7 @@ declare class ModifyContextRequest extends $dara.Model {
|
|
|
926
927
|
});
|
|
927
928
|
}
|
|
928
929
|
|
|
929
|
-
declare class
|
|
930
|
+
declare class ReleaseMcpSessionResponseBody extends $dara.Model {
|
|
930
931
|
code?: string;
|
|
931
932
|
httpStatusCode?: number;
|
|
932
933
|
message?: string;
|
|
@@ -944,12 +945,12 @@ declare class ModifyContextResponseBody extends $dara.Model {
|
|
|
944
945
|
});
|
|
945
946
|
}
|
|
946
947
|
|
|
947
|
-
declare class
|
|
948
|
+
declare class ReleaseMcpSessionResponse extends $dara.Model {
|
|
948
949
|
headers?: {
|
|
949
950
|
[key: string]: string;
|
|
950
951
|
};
|
|
951
952
|
statusCode?: number;
|
|
952
|
-
body?:
|
|
953
|
+
body?: ReleaseMcpSessionResponseBody;
|
|
953
954
|
static names(): {
|
|
954
955
|
[key: string]: string;
|
|
955
956
|
};
|
|
@@ -962,8 +963,9 @@ declare class ModifyContextResponse extends $dara.Model {
|
|
|
962
963
|
});
|
|
963
964
|
}
|
|
964
965
|
|
|
965
|
-
declare class
|
|
966
|
+
declare class SetLabelRequest extends $dara.Model {
|
|
966
967
|
authorization?: string;
|
|
968
|
+
labels?: string;
|
|
967
969
|
sessionId?: string;
|
|
968
970
|
static names(): {
|
|
969
971
|
[key: string]: string;
|
|
@@ -977,7 +979,7 @@ declare class ReleaseMcpSessionRequest extends $dara.Model {
|
|
|
977
979
|
});
|
|
978
980
|
}
|
|
979
981
|
|
|
980
|
-
declare class
|
|
982
|
+
declare class SetLabelResponseBody extends $dara.Model {
|
|
981
983
|
code?: string;
|
|
982
984
|
httpStatusCode?: number;
|
|
983
985
|
message?: string;
|
|
@@ -995,12 +997,12 @@ declare class ReleaseMcpSessionResponseBody extends $dara.Model {
|
|
|
995
997
|
});
|
|
996
998
|
}
|
|
997
999
|
|
|
998
|
-
declare class
|
|
1000
|
+
declare class SetLabelResponse extends $dara.Model {
|
|
999
1001
|
headers?: {
|
|
1000
1002
|
[key: string]: string;
|
|
1001
1003
|
};
|
|
1002
1004
|
statusCode?: number;
|
|
1003
|
-
body?:
|
|
1005
|
+
body?: SetLabelResponseBody;
|
|
1004
1006
|
static names(): {
|
|
1005
1007
|
[key: string]: string;
|
|
1006
1008
|
};
|
|
@@ -1013,9 +1015,11 @@ declare class ReleaseMcpSessionResponse extends $dara.Model {
|
|
|
1013
1015
|
});
|
|
1014
1016
|
}
|
|
1015
1017
|
|
|
1016
|
-
declare class
|
|
1018
|
+
declare class SyncContextRequest extends $dara.Model {
|
|
1017
1019
|
authorization?: string;
|
|
1018
|
-
|
|
1020
|
+
contextId?: string;
|
|
1021
|
+
mode?: string;
|
|
1022
|
+
path?: string;
|
|
1019
1023
|
sessionId?: string;
|
|
1020
1024
|
static names(): {
|
|
1021
1025
|
[key: string]: string;
|
|
@@ -1029,7 +1033,7 @@ declare class SetLabelRequest extends $dara.Model {
|
|
|
1029
1033
|
});
|
|
1030
1034
|
}
|
|
1031
1035
|
|
|
1032
|
-
declare class
|
|
1036
|
+
declare class SyncContextResponseBody extends $dara.Model {
|
|
1033
1037
|
code?: string;
|
|
1034
1038
|
httpStatusCode?: number;
|
|
1035
1039
|
message?: string;
|
|
@@ -1047,12 +1051,12 @@ declare class SetLabelResponseBody extends $dara.Model {
|
|
|
1047
1051
|
});
|
|
1048
1052
|
}
|
|
1049
1053
|
|
|
1050
|
-
declare class
|
|
1054
|
+
declare class SyncContextResponse extends $dara.Model {
|
|
1051
1055
|
headers?: {
|
|
1052
1056
|
[key: string]: string;
|
|
1053
1057
|
};
|
|
1054
1058
|
statusCode?: number;
|
|
1055
|
-
body?:
|
|
1059
|
+
body?: SyncContextResponseBody;
|
|
1056
1060
|
static names(): {
|
|
1057
1061
|
[key: string]: string;
|
|
1058
1062
|
};
|
|
@@ -1065,8 +1069,6 @@ declare class SetLabelResponse extends $dara.Model {
|
|
|
1065
1069
|
});
|
|
1066
1070
|
}
|
|
1067
1071
|
|
|
1068
|
-
declare const OpenApi: typeof OpenApiDefault.default;
|
|
1069
|
-
|
|
1070
1072
|
declare class Client extends OpenApi {
|
|
1071
1073
|
constructor(config: $OpenApiUtil.Config);
|
|
1072
1074
|
getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {
|
|
@@ -1090,11 +1092,11 @@ declare class Client extends OpenApi {
|
|
|
1090
1092
|
/**
|
|
1091
1093
|
* 创建 mcp session
|
|
1092
1094
|
*
|
|
1093
|
-
* @param
|
|
1095
|
+
* @param tmpReq - CreateMcpSessionRequest
|
|
1094
1096
|
* @param runtime - runtime options for this request RuntimeOptions
|
|
1095
1097
|
* @returns CreateMcpSessionResponse
|
|
1096
1098
|
*/
|
|
1097
|
-
createMcpSessionWithOptions(
|
|
1099
|
+
createMcpSessionWithOptions(tmpReq: CreateMcpSessionRequest, runtime: $dara.RuntimeOptions): Promise<CreateMcpSessionResponse>;
|
|
1098
1100
|
/**
|
|
1099
1101
|
* 创建 mcp session
|
|
1100
1102
|
*
|
|
@@ -1132,6 +1134,21 @@ declare class Client extends OpenApi {
|
|
|
1132
1134
|
* @returns GetContextResponse
|
|
1133
1135
|
*/
|
|
1134
1136
|
getContext(request: GetContextRequest): Promise<GetContextResponse>;
|
|
1137
|
+
/**
|
|
1138
|
+
* 获取上下文信息
|
|
1139
|
+
*
|
|
1140
|
+
* @param request - GetContextInfoRequest
|
|
1141
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1142
|
+
* @returns GetContextInfoResponse
|
|
1143
|
+
*/
|
|
1144
|
+
getContextInfoWithOptions(request: GetContextInfoRequest, runtime: $dara.RuntimeOptions): Promise<GetContextInfoResponse>;
|
|
1145
|
+
/**
|
|
1146
|
+
* 获取上下文信息
|
|
1147
|
+
*
|
|
1148
|
+
* @param request - GetContextInfoRequest
|
|
1149
|
+
* @returns GetContextInfoResponse
|
|
1150
|
+
*/
|
|
1151
|
+
getContextInfo(request: GetContextInfoRequest): Promise<GetContextInfoResponse>;
|
|
1135
1152
|
/**
|
|
1136
1153
|
* 获取标签
|
|
1137
1154
|
*
|
|
@@ -1192,6 +1209,21 @@ declare class Client extends OpenApi {
|
|
|
1192
1209
|
* @returns ListContextsResponse
|
|
1193
1210
|
*/
|
|
1194
1211
|
listContexts(request: ListContextsRequest): Promise<ListContextsResponse>;
|
|
1212
|
+
/**
|
|
1213
|
+
* ListMcpTools
|
|
1214
|
+
*
|
|
1215
|
+
* @param request - ListMcpToolsRequest
|
|
1216
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1217
|
+
* @returns ListMcpToolsResponse
|
|
1218
|
+
*/
|
|
1219
|
+
listMcpToolsWithOptions(request: ListMcpToolsRequest, runtime: $dara.RuntimeOptions): Promise<ListMcpToolsResponse>;
|
|
1220
|
+
/**
|
|
1221
|
+
* ListMcpTools
|
|
1222
|
+
*
|
|
1223
|
+
* @param request - ListMcpToolsRequest
|
|
1224
|
+
* @returns ListMcpToolsResponse
|
|
1225
|
+
*/
|
|
1226
|
+
listMcpTools(request: ListMcpToolsRequest): Promise<ListMcpToolsResponse>;
|
|
1195
1227
|
/**
|
|
1196
1228
|
* 根据Lable查询Session列表
|
|
1197
1229
|
*
|
|
@@ -1214,45 +1246,518 @@ declare class Client extends OpenApi {
|
|
|
1214
1246
|
* @param runtime - runtime options for this request RuntimeOptions
|
|
1215
1247
|
* @returns ModifyContextResponse
|
|
1216
1248
|
*/
|
|
1217
|
-
modifyContextWithOptions(request: ModifyContextRequest, runtime: $dara.RuntimeOptions): Promise<ModifyContextResponse>;
|
|
1249
|
+
modifyContextWithOptions(request: ModifyContextRequest, runtime: $dara.RuntimeOptions): Promise<ModifyContextResponse>;
|
|
1250
|
+
/**
|
|
1251
|
+
* 修改上下文
|
|
1252
|
+
*
|
|
1253
|
+
* @param request - ModifyContextRequest
|
|
1254
|
+
* @returns ModifyContextResponse
|
|
1255
|
+
*/
|
|
1256
|
+
modifyContext(request: ModifyContextRequest): Promise<ModifyContextResponse>;
|
|
1257
|
+
/**
|
|
1258
|
+
* 释放 mcp session
|
|
1259
|
+
*
|
|
1260
|
+
* @param request - ReleaseMcpSessionRequest
|
|
1261
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1262
|
+
* @returns ReleaseMcpSessionResponse
|
|
1263
|
+
*/
|
|
1264
|
+
releaseMcpSessionWithOptions(request: ReleaseMcpSessionRequest, runtime: $dara.RuntimeOptions): Promise<ReleaseMcpSessionResponse>;
|
|
1265
|
+
/**
|
|
1266
|
+
* 释放 mcp session
|
|
1267
|
+
*
|
|
1268
|
+
* @param request - ReleaseMcpSessionRequest
|
|
1269
|
+
* @returns ReleaseMcpSessionResponse
|
|
1270
|
+
*/
|
|
1271
|
+
releaseMcpSession(request: ReleaseMcpSessionRequest): Promise<ReleaseMcpSessionResponse>;
|
|
1272
|
+
/**
|
|
1273
|
+
* 设置标签
|
|
1274
|
+
*
|
|
1275
|
+
* @param request - SetLabelRequest
|
|
1276
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1277
|
+
* @returns SetLabelResponse
|
|
1278
|
+
*/
|
|
1279
|
+
setLabelWithOptions(request: SetLabelRequest, runtime: $dara.RuntimeOptions): Promise<SetLabelResponse>;
|
|
1280
|
+
/**
|
|
1281
|
+
* 设置标签
|
|
1282
|
+
*
|
|
1283
|
+
* @param request - SetLabelRequest
|
|
1284
|
+
* @returns SetLabelResponse
|
|
1285
|
+
*/
|
|
1286
|
+
setLabel(request: SetLabelRequest): Promise<SetLabelResponse>;
|
|
1287
|
+
/**
|
|
1288
|
+
* 同步上下文
|
|
1289
|
+
*
|
|
1290
|
+
* @param request - SyncContextRequest
|
|
1291
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1292
|
+
* @returns SyncContextResponse
|
|
1293
|
+
*/
|
|
1294
|
+
syncContextWithOptions(request: SyncContextRequest, runtime: $dara.RuntimeOptions): Promise<SyncContextResponse>;
|
|
1295
|
+
/**
|
|
1296
|
+
* 同步上下文
|
|
1297
|
+
*
|
|
1298
|
+
* @param request - SyncContextRequest
|
|
1299
|
+
* @returns SyncContextResponse
|
|
1300
|
+
*/
|
|
1301
|
+
syncContext(request: SyncContextRequest): Promise<SyncContextResponse>;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
interface Config {
|
|
1305
|
+
region_id: string;
|
|
1306
|
+
endpoint: string;
|
|
1307
|
+
timeout_ms: number;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* Base interface for API responses
|
|
1312
|
+
*/
|
|
1313
|
+
interface ApiResponse {
|
|
1314
|
+
/** Optional request identifier for tracking API calls */
|
|
1315
|
+
requestId?: string;
|
|
1316
|
+
/** Optional error message if the operation failed */
|
|
1317
|
+
errorMessage?: string;
|
|
1318
|
+
/** Optional status code if the operation failed */
|
|
1319
|
+
success?: boolean;
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Interface for delete operation responses
|
|
1323
|
+
*/
|
|
1324
|
+
interface DeleteResult extends ApiResponse {
|
|
1325
|
+
/** Whether the delete operation was successful */
|
|
1326
|
+
success: boolean;
|
|
1327
|
+
/** Optional error message if the operation failed */
|
|
1328
|
+
errorMessage?: string;
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* Interface for session creation operation responses
|
|
1332
|
+
* Corresponds to Python's SessionResult type
|
|
1333
|
+
*/
|
|
1334
|
+
interface SessionResult extends ApiResponse {
|
|
1335
|
+
/** Request identifier for tracking API calls */
|
|
1336
|
+
requestId: string;
|
|
1337
|
+
/** Whether the session creation was successful */
|
|
1338
|
+
success: boolean;
|
|
1339
|
+
/** The created session object (only present if successful) */
|
|
1340
|
+
session?: any;
|
|
1341
|
+
/** Error message if the operation failed */
|
|
1342
|
+
errorMessage?: string;
|
|
1343
|
+
}
|
|
1344
|
+
/**
|
|
1345
|
+
* Interface for operation results
|
|
1346
|
+
* Corresponds to Python's OperationResult type
|
|
1347
|
+
*/
|
|
1348
|
+
interface OperationResult extends ApiResponse {
|
|
1349
|
+
/** Request identifier for tracking API calls */
|
|
1350
|
+
requestId: string;
|
|
1351
|
+
/** Whether the operation was successful */
|
|
1352
|
+
success: boolean;
|
|
1353
|
+
/** Optional data payload */
|
|
1354
|
+
data?: any;
|
|
1355
|
+
/** Optional error message if the operation failed */
|
|
1356
|
+
errorMessage?: string;
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* Interface for process list operation responses
|
|
1360
|
+
* Corresponds to Python's ProcessListResult type
|
|
1361
|
+
*/
|
|
1362
|
+
interface ProcessListResult extends ApiResponse {
|
|
1363
|
+
/** Request identifier for tracking API calls */
|
|
1364
|
+
requestId: string;
|
|
1365
|
+
/** Whether the operation was successful */
|
|
1366
|
+
success: boolean;
|
|
1367
|
+
/** The list of process objects */
|
|
1368
|
+
data: any[];
|
|
1369
|
+
/** Optional error message if the operation failed */
|
|
1370
|
+
errorMessage?: string;
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* Interface for installed app list operation responses
|
|
1374
|
+
* Corresponds to Python's InstalledAppListResult type
|
|
1375
|
+
*/
|
|
1376
|
+
interface InstalledAppListResult extends ApiResponse {
|
|
1377
|
+
/** Request identifier for tracking API calls */
|
|
1378
|
+
requestId: string;
|
|
1379
|
+
/** Whether the operation was successful */
|
|
1380
|
+
success: boolean;
|
|
1381
|
+
/** The list of installed app objects */
|
|
1382
|
+
data: any[];
|
|
1383
|
+
/** Optional error message if the operation failed */
|
|
1384
|
+
errorMessage?: string;
|
|
1385
|
+
}
|
|
1386
|
+
/**
|
|
1387
|
+
* Interface for application operation responses
|
|
1388
|
+
* Corresponds to Python's AppOperationResult type
|
|
1389
|
+
*/
|
|
1390
|
+
interface AppOperationResult extends ApiResponse {
|
|
1391
|
+
/** Request identifier for tracking API calls */
|
|
1392
|
+
requestId: string;
|
|
1393
|
+
/** Whether the operation was successful */
|
|
1394
|
+
success: boolean;
|
|
1395
|
+
/** Optional error message if the operation failed */
|
|
1396
|
+
errorMessage?: string;
|
|
1397
|
+
}
|
|
1398
|
+
/**
|
|
1399
|
+
* Interface for command execution operation responses
|
|
1400
|
+
* Corresponds to Python's CommandResult type
|
|
1401
|
+
*/
|
|
1402
|
+
interface CommandResult extends ApiResponse {
|
|
1403
|
+
/** Request identifier for tracking API calls */
|
|
1404
|
+
requestId: string;
|
|
1405
|
+
/** Whether the command execution was successful */
|
|
1406
|
+
success: boolean;
|
|
1407
|
+
/** The command output */
|
|
1408
|
+
output: string;
|
|
1409
|
+
/** Optional error message if the operation failed */
|
|
1410
|
+
errorMessage?: string;
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* Interface for code execution operation responses
|
|
1414
|
+
* Corresponds to Python's CodeExecutionResult type
|
|
1415
|
+
*/
|
|
1416
|
+
interface CodeExecutionResult extends ApiResponse {
|
|
1417
|
+
/** Request identifier for tracking API calls */
|
|
1418
|
+
requestId: string;
|
|
1419
|
+
/** Whether the code execution was successful */
|
|
1420
|
+
success: boolean;
|
|
1421
|
+
/** The execution result */
|
|
1422
|
+
result: string;
|
|
1423
|
+
/** Optional error message if the operation failed */
|
|
1424
|
+
errorMessage?: string;
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* Interface for boolean operation responses
|
|
1428
|
+
* Corresponds to Python's BoolResult type
|
|
1429
|
+
*/
|
|
1430
|
+
interface BoolResult extends ApiResponse {
|
|
1431
|
+
/** Request identifier for tracking API calls */
|
|
1432
|
+
requestId: string;
|
|
1433
|
+
/** Whether the operation was successful */
|
|
1434
|
+
success: boolean;
|
|
1435
|
+
/** Boolean data result */
|
|
1436
|
+
data?: boolean;
|
|
1437
|
+
/** Optional error message if the operation failed */
|
|
1438
|
+
errorMessage?: string;
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* Interface for file info operation responses
|
|
1442
|
+
* Corresponds to Python's FileInfoResult type
|
|
1443
|
+
*/
|
|
1444
|
+
interface FileInfoResult extends ApiResponse {
|
|
1445
|
+
/** Request identifier for tracking API calls */
|
|
1446
|
+
requestId: string;
|
|
1447
|
+
/** Whether the operation was successful */
|
|
1448
|
+
success: boolean;
|
|
1449
|
+
/** File information object */
|
|
1450
|
+
fileInfo?: Record<string, any>;
|
|
1451
|
+
/** Optional error message if the operation failed */
|
|
1452
|
+
errorMessage?: string;
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* Interface for directory list operation responses
|
|
1456
|
+
* Corresponds to Python's DirectoryListResult type
|
|
1457
|
+
*/
|
|
1458
|
+
interface DirectoryListResult extends ApiResponse {
|
|
1459
|
+
/** Request identifier for tracking API calls */
|
|
1460
|
+
requestId: string;
|
|
1461
|
+
/** Whether the operation was successful */
|
|
1462
|
+
success: boolean;
|
|
1463
|
+
/** Directory entries */
|
|
1464
|
+
entries: Record<string, any>[];
|
|
1465
|
+
/** Optional error message if the operation failed */
|
|
1466
|
+
errorMessage?: string;
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* Interface for file content operation responses
|
|
1470
|
+
* Corresponds to Python's FileContentResult type
|
|
1471
|
+
*/
|
|
1472
|
+
interface FileContentResult extends ApiResponse {
|
|
1473
|
+
/** Request identifier for tracking API calls */
|
|
1474
|
+
requestId: string;
|
|
1475
|
+
/** Whether the operation was successful */
|
|
1476
|
+
success: boolean;
|
|
1477
|
+
/** File content */
|
|
1478
|
+
content: string;
|
|
1479
|
+
/** Optional error message if the operation failed */
|
|
1480
|
+
errorMessage?: string;
|
|
1481
|
+
}
|
|
1482
|
+
/**
|
|
1483
|
+
* Interface for multiple file content operation responses
|
|
1484
|
+
* Corresponds to Python's MultipleFileContentResult type
|
|
1485
|
+
*/
|
|
1486
|
+
interface MultipleFileContentResult extends ApiResponse {
|
|
1487
|
+
/** Request identifier for tracking API calls */
|
|
1488
|
+
requestId: string;
|
|
1489
|
+
/** Whether the operation was successful */
|
|
1490
|
+
success: boolean;
|
|
1491
|
+
/** Multiple file contents */
|
|
1492
|
+
contents: Record<string, string>;
|
|
1493
|
+
/** Optional error message if the operation failed */
|
|
1494
|
+
errorMessage?: string;
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Interface for file search operation responses
|
|
1498
|
+
* Corresponds to Python's FileSearchResult type
|
|
1499
|
+
*/
|
|
1500
|
+
interface FileSearchResult extends ApiResponse {
|
|
1501
|
+
/** Request identifier for tracking API calls */
|
|
1502
|
+
requestId: string;
|
|
1503
|
+
/** Whether the operation was successful */
|
|
1504
|
+
success: boolean;
|
|
1505
|
+
/** Matching file paths */
|
|
1506
|
+
matches: string[];
|
|
1507
|
+
/** Optional error message if the operation failed */
|
|
1508
|
+
errorMessage?: string;
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* Interface for OSS client creation operation responses
|
|
1512
|
+
* Corresponds to Python's OSSClientResult type
|
|
1513
|
+
*/
|
|
1514
|
+
interface OSSClientResult extends ApiResponse {
|
|
1515
|
+
/** Request identifier for tracking API calls */
|
|
1516
|
+
requestId: string;
|
|
1517
|
+
/** Whether the operation was successful */
|
|
1518
|
+
success: boolean;
|
|
1519
|
+
/** OSS client configuration */
|
|
1520
|
+
clientConfig: Record<string, any>;
|
|
1521
|
+
/** Optional error message if the operation failed */
|
|
1522
|
+
errorMessage?: string;
|
|
1523
|
+
}
|
|
1524
|
+
/**
|
|
1525
|
+
* Interface for OSS upload operation responses
|
|
1526
|
+
* Corresponds to Python's OSSUploadResult type
|
|
1527
|
+
*/
|
|
1528
|
+
interface OSSUploadResult extends ApiResponse {
|
|
1529
|
+
/** Request identifier for tracking API calls */
|
|
1530
|
+
requestId: string;
|
|
1531
|
+
/** Whether the operation was successful */
|
|
1532
|
+
success: boolean;
|
|
1533
|
+
/** Result of the upload operation */
|
|
1534
|
+
content: string;
|
|
1535
|
+
/** Optional error message if the operation failed */
|
|
1536
|
+
errorMessage?: string;
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Interface for OSS download operation responses
|
|
1540
|
+
* Corresponds to Python's OSSDownloadResult type
|
|
1541
|
+
*/
|
|
1542
|
+
interface OSSDownloadResult extends ApiResponse {
|
|
1543
|
+
/** Request identifier for tracking API calls */
|
|
1544
|
+
requestId: string;
|
|
1545
|
+
/** Whether the operation was successful */
|
|
1546
|
+
success: boolean;
|
|
1547
|
+
/** Result of the download operation */
|
|
1548
|
+
content: string;
|
|
1549
|
+
/** Optional error message if the operation failed */
|
|
1550
|
+
errorMessage?: string;
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Interface for UI element list operation responses
|
|
1554
|
+
* Corresponds to Python's UIElementListResult type
|
|
1555
|
+
*/
|
|
1556
|
+
interface UIElementListResult extends ApiResponse {
|
|
1557
|
+
/** Request identifier for tracking API calls */
|
|
1558
|
+
requestId: string;
|
|
1559
|
+
/** Whether the operation was successful */
|
|
1560
|
+
success: boolean;
|
|
1561
|
+
/** UI elements */
|
|
1562
|
+
elements: Record<string, any>[];
|
|
1563
|
+
/** Optional error message if the operation failed */
|
|
1564
|
+
errorMessage?: string;
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* Interface for window list operation responses
|
|
1568
|
+
* Corresponds to Python's WindowListResult type
|
|
1569
|
+
*/
|
|
1570
|
+
interface WindowListResult extends ApiResponse {
|
|
1571
|
+
/** Request identifier for tracking API calls */
|
|
1572
|
+
requestId: string;
|
|
1573
|
+
/** Whether the operation was successful */
|
|
1574
|
+
success: boolean;
|
|
1575
|
+
/** List of windows */
|
|
1576
|
+
windows: any[];
|
|
1577
|
+
/** Optional error message if the operation failed */
|
|
1578
|
+
errorMessage?: string;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Interface for window info operation responses
|
|
1582
|
+
* Corresponds to Python's WindowInfoResult type
|
|
1583
|
+
*/
|
|
1584
|
+
interface WindowInfoResult extends ApiResponse {
|
|
1585
|
+
/** Request identifier for tracking API calls */
|
|
1586
|
+
requestId: string;
|
|
1587
|
+
/** Whether the operation was successful */
|
|
1588
|
+
success: boolean;
|
|
1589
|
+
/** Window object */
|
|
1590
|
+
window?: any;
|
|
1591
|
+
/** Optional error message if the operation failed */
|
|
1592
|
+
errorMessage?: string;
|
|
1593
|
+
}
|
|
1594
|
+
/**
|
|
1595
|
+
* Interface for context operation responses
|
|
1596
|
+
* Corresponds to Python's ContextResult type
|
|
1597
|
+
*/
|
|
1598
|
+
interface ContextResult extends ApiResponse {
|
|
1599
|
+
/** Request identifier for tracking API calls */
|
|
1600
|
+
requestId: string;
|
|
1601
|
+
/** Whether the operation was successful */
|
|
1602
|
+
success: boolean;
|
|
1603
|
+
/** The context ID */
|
|
1604
|
+
contextId: string;
|
|
1605
|
+
/** The context object (only present if successful) */
|
|
1606
|
+
context?: any;
|
|
1607
|
+
/** Optional error message if the operation failed */
|
|
1608
|
+
errorMessage?: string;
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* Interface for context list operation responses
|
|
1612
|
+
* Corresponds to Python's ContextListResult type
|
|
1613
|
+
*/
|
|
1614
|
+
interface ContextListResult extends ApiResponse {
|
|
1615
|
+
/** Request identifier for tracking API calls */
|
|
1616
|
+
requestId: string;
|
|
1617
|
+
/** Whether the operation was successful */
|
|
1618
|
+
success: boolean;
|
|
1619
|
+
/** List of contexts */
|
|
1620
|
+
contexts: any[];
|
|
1621
|
+
/** Optional error message if the operation failed */
|
|
1622
|
+
errorMessage?: string;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
/**
|
|
1626
|
+
* Represents a persistent storage context in the AgentBay cloud environment.
|
|
1627
|
+
*/
|
|
1628
|
+
declare class Context {
|
|
1629
|
+
/**
|
|
1630
|
+
* The unique identifier of the context.
|
|
1631
|
+
*/
|
|
1632
|
+
id: string;
|
|
1633
|
+
/**
|
|
1634
|
+
* The name of the context.
|
|
1635
|
+
*/
|
|
1636
|
+
name: string;
|
|
1637
|
+
/**
|
|
1638
|
+
* The current state of the context (e.g., "available", "in-use").
|
|
1639
|
+
*/
|
|
1640
|
+
state: string;
|
|
1641
|
+
/**
|
|
1642
|
+
* Date and time when the Context was created.
|
|
1643
|
+
*/
|
|
1644
|
+
createdAt?: string;
|
|
1645
|
+
/**
|
|
1646
|
+
* Date and time when the Context was last used.
|
|
1647
|
+
*/
|
|
1648
|
+
lastUsedAt?: string;
|
|
1649
|
+
/**
|
|
1650
|
+
* The operating system type this context is bound to.
|
|
1651
|
+
*/
|
|
1652
|
+
osType?: string;
|
|
1653
|
+
/**
|
|
1654
|
+
* Initialize a Context object.
|
|
1655
|
+
*
|
|
1656
|
+
* @param id - The unique identifier of the context.
|
|
1657
|
+
* @param name - The name of the context.
|
|
1658
|
+
* @param state - The current state of the context.
|
|
1659
|
+
* @param createdAt - Date and time when the Context was created.
|
|
1660
|
+
* @param lastUsedAt - Date and time when the Context was last used.
|
|
1661
|
+
* @param osType - The operating system type this context is bound to.
|
|
1662
|
+
*/
|
|
1663
|
+
constructor(id: string, name: string, state?: string, createdAt?: string, lastUsedAt?: string, osType?: string);
|
|
1664
|
+
}
|
|
1665
|
+
/**
|
|
1666
|
+
* Provides methods to manage persistent contexts in the AgentBay cloud environment.
|
|
1667
|
+
*/
|
|
1668
|
+
declare class ContextService {
|
|
1669
|
+
private agentBay;
|
|
1670
|
+
/**
|
|
1671
|
+
* Initialize the ContextService.
|
|
1672
|
+
*
|
|
1673
|
+
* @param agentBay - The AgentBay instance.
|
|
1674
|
+
*/
|
|
1675
|
+
constructor(agentBay: AgentBay);
|
|
1218
1676
|
/**
|
|
1219
|
-
*
|
|
1677
|
+
* Lists all available contexts.
|
|
1678
|
+
* Corresponds to Python's list() method
|
|
1220
1679
|
*
|
|
1221
|
-
* @
|
|
1222
|
-
* @returns ModifyContextResponse
|
|
1680
|
+
* @returns ContextListResult with contexts list and requestId
|
|
1223
1681
|
*/
|
|
1224
|
-
|
|
1682
|
+
list(): Promise<ContextListResult>;
|
|
1225
1683
|
/**
|
|
1226
|
-
*
|
|
1684
|
+
* Gets a context by name. Optionally creates it if it doesn't exist.
|
|
1685
|
+
* Corresponds to Python's get() method
|
|
1227
1686
|
*
|
|
1228
|
-
* @param
|
|
1229
|
-
* @param
|
|
1230
|
-
* @returns
|
|
1687
|
+
* @param name - The name of the context to get.
|
|
1688
|
+
* @param create - Whether to create the context if it doesn't exist.
|
|
1689
|
+
* @returns ContextResult with context data and requestId
|
|
1231
1690
|
*/
|
|
1232
|
-
|
|
1691
|
+
get(name: string, create?: boolean): Promise<ContextResult>;
|
|
1233
1692
|
/**
|
|
1234
|
-
*
|
|
1693
|
+
* Creates a new context with the given name.
|
|
1694
|
+
* Corresponds to Python's create() method
|
|
1235
1695
|
*
|
|
1236
|
-
* @param
|
|
1237
|
-
* @returns
|
|
1696
|
+
* @param name - The name for the new context.
|
|
1697
|
+
* @returns ContextResult with created context data and requestId
|
|
1238
1698
|
*/
|
|
1239
|
-
|
|
1699
|
+
create(name: string): Promise<ContextResult>;
|
|
1240
1700
|
/**
|
|
1241
|
-
*
|
|
1701
|
+
* Updates the specified context.
|
|
1702
|
+
* Corresponds to Python's update() method
|
|
1242
1703
|
*
|
|
1243
|
-
* @param
|
|
1244
|
-
* @
|
|
1245
|
-
* @returns SetLabelResponse
|
|
1704
|
+
* @param context - The Context object to update.
|
|
1705
|
+
* @returns OperationResult with updated context data and requestId
|
|
1246
1706
|
*/
|
|
1247
|
-
|
|
1707
|
+
update(context: Context): Promise<OperationResult>;
|
|
1248
1708
|
/**
|
|
1249
|
-
*
|
|
1709
|
+
* Deletes the specified context.
|
|
1710
|
+
* Corresponds to Python's delete() method
|
|
1250
1711
|
*
|
|
1251
|
-
* @param
|
|
1252
|
-
* @returns
|
|
1712
|
+
* @param context - The Context object to delete.
|
|
1713
|
+
* @returns OperationResult with requestId
|
|
1253
1714
|
*/
|
|
1254
|
-
|
|
1715
|
+
delete(context: Context): Promise<OperationResult>;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
declare enum UploadStrategy {
|
|
1719
|
+
UploadBeforeResourceRelease = "UploadBeforeResourceRelease"
|
|
1720
|
+
}
|
|
1721
|
+
declare enum DownloadStrategy {
|
|
1722
|
+
DownloadAsync = "DownloadAsync"
|
|
1723
|
+
}
|
|
1724
|
+
interface UploadPolicy {
|
|
1725
|
+
autoUpload: boolean;
|
|
1726
|
+
uploadStrategy: UploadStrategy;
|
|
1727
|
+
period?: number;
|
|
1728
|
+
}
|
|
1729
|
+
interface DownloadPolicy {
|
|
1730
|
+
autoDownload: boolean;
|
|
1731
|
+
downloadStrategy: DownloadStrategy;
|
|
1732
|
+
}
|
|
1733
|
+
interface DeletePolicy {
|
|
1734
|
+
syncLocalFile: boolean;
|
|
1255
1735
|
}
|
|
1736
|
+
interface WhiteList {
|
|
1737
|
+
path: string;
|
|
1738
|
+
excludePaths?: string[];
|
|
1739
|
+
}
|
|
1740
|
+
interface BWList {
|
|
1741
|
+
whiteLists?: WhiteList[];
|
|
1742
|
+
}
|
|
1743
|
+
interface SyncPolicy {
|
|
1744
|
+
uploadPolicy?: UploadPolicy;
|
|
1745
|
+
downloadPolicy?: DownloadPolicy;
|
|
1746
|
+
deletePolicy?: DeletePolicy;
|
|
1747
|
+
bwList?: BWList;
|
|
1748
|
+
}
|
|
1749
|
+
declare class ContextSync {
|
|
1750
|
+
contextId: string;
|
|
1751
|
+
path: string;
|
|
1752
|
+
policy?: SyncPolicy;
|
|
1753
|
+
constructor(contextId: string, path: string, policy?: SyncPolicy);
|
|
1754
|
+
withPolicy(policy: SyncPolicy): ContextSync;
|
|
1755
|
+
}
|
|
1756
|
+
declare function newUploadPolicy(): UploadPolicy;
|
|
1757
|
+
declare function newDownloadPolicy(): DownloadPolicy;
|
|
1758
|
+
declare function newDeletePolicy(): DeletePolicy;
|
|
1759
|
+
declare function newSyncPolicy(): SyncPolicy;
|
|
1760
|
+
declare function newContextSync(contextId: string, path: string, policy?: SyncPolicy): ContextSync;
|
|
1256
1761
|
|
|
1257
1762
|
/**
|
|
1258
1763
|
* Represents an installed application.
|
|
@@ -1302,75 +1807,175 @@ declare class Application {
|
|
|
1302
1807
|
private parseJSON;
|
|
1303
1808
|
/**
|
|
1304
1809
|
* Retrieves a list of installed applications.
|
|
1810
|
+
* Corresponds to Python's get_installed_apps() method
|
|
1811
|
+
*
|
|
1305
1812
|
* @param startMenu Whether to include applications from the start menu. Defaults to true.
|
|
1306
1813
|
* @param desktop Whether to include applications from the desktop. Defaults to true.
|
|
1307
1814
|
* @param ignoreSystemApps Whether to ignore system applications. Defaults to true.
|
|
1308
|
-
* @returns
|
|
1815
|
+
* @returns InstalledAppListResult with installed apps and requestId
|
|
1309
1816
|
* @throws Error if the operation fails.
|
|
1310
1817
|
*/
|
|
1311
|
-
getInstalledApps(startMenu?: boolean, desktop?: boolean, ignoreSystemApps?: boolean): Promise<
|
|
1818
|
+
getInstalledApps(startMenu?: boolean, desktop?: boolean, ignoreSystemApps?: boolean): Promise<InstalledAppListResult>;
|
|
1312
1819
|
/**
|
|
1313
1820
|
* Starts an application with the given command and optional working directory.
|
|
1821
|
+
* Corresponds to Python's start_app() method
|
|
1822
|
+
*
|
|
1314
1823
|
* @param startCmd The command to start the application.
|
|
1315
1824
|
* @param workDirectory The working directory for the application. Defaults to an empty string.
|
|
1316
|
-
* @
|
|
1825
|
+
* @param activity Activity name to launch (e.g. ".SettingsActivity" or "com.package/.Activity"). Defaults to an empty string.
|
|
1826
|
+
* @returns ProcessListResult with started processes and requestId
|
|
1317
1827
|
* @throws Error if the operation fails.
|
|
1318
1828
|
*/
|
|
1319
|
-
startApp(startCmd: string, workDirectory?: string): Promise<
|
|
1829
|
+
startApp(startCmd: string, workDirectory?: string, activity?: string): Promise<ProcessListResult>;
|
|
1320
1830
|
/**
|
|
1321
1831
|
* Stops an application by process name.
|
|
1832
|
+
* Corresponds to Python's stop_app_by_pname() method
|
|
1833
|
+
*
|
|
1322
1834
|
* @param pname The name of the process to stop.
|
|
1835
|
+
* @returns AppOperationResult with requestId
|
|
1323
1836
|
* @throws Error if the operation fails.
|
|
1324
1837
|
*/
|
|
1325
|
-
stopAppByPName(pname: string): Promise<
|
|
1838
|
+
stopAppByPName(pname: string): Promise<AppOperationResult>;
|
|
1326
1839
|
/**
|
|
1327
1840
|
* Stops an application by process ID.
|
|
1841
|
+
* Corresponds to Python's stop_app_by_pid() method
|
|
1842
|
+
*
|
|
1328
1843
|
* @param pid The ID of the process to stop.
|
|
1844
|
+
* @returns AppOperationResult with requestId
|
|
1329
1845
|
* @throws Error if the operation fails.
|
|
1330
1846
|
*/
|
|
1331
|
-
stopAppByPID(pid: number): Promise<
|
|
1847
|
+
stopAppByPID(pid: number): Promise<AppOperationResult>;
|
|
1332
1848
|
/**
|
|
1333
1849
|
* Stops an application by stop command.
|
|
1850
|
+
* Corresponds to Python's stop_app_by_cmd() method
|
|
1851
|
+
*
|
|
1334
1852
|
* @param stopCmd The command to stop the application.
|
|
1853
|
+
* @returns AppOperationResult with requestId
|
|
1335
1854
|
* @throws Error if the operation fails.
|
|
1336
1855
|
*/
|
|
1337
|
-
stopAppByCmd(stopCmd: string): Promise<
|
|
1856
|
+
stopAppByCmd(stopCmd: string): Promise<AppOperationResult>;
|
|
1338
1857
|
/**
|
|
1339
1858
|
* Lists all currently visible applications.
|
|
1340
|
-
*
|
|
1859
|
+
* Corresponds to Python's list_visible_apps() method
|
|
1860
|
+
*
|
|
1861
|
+
* @returns ProcessListResult with visible processes and requestId
|
|
1341
1862
|
* @throws Error if the operation fails.
|
|
1342
1863
|
*/
|
|
1343
|
-
listVisibleApps(): Promise<
|
|
1864
|
+
listVisibleApps(): Promise<ProcessListResult>;
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
/**
|
|
1868
|
+
* Handles command execution operations in the AgentBay cloud environment.
|
|
1869
|
+
*/
|
|
1870
|
+
declare class Command {
|
|
1871
|
+
private session;
|
|
1872
|
+
private client;
|
|
1873
|
+
private baseUrl;
|
|
1874
|
+
/**
|
|
1875
|
+
* Initialize a Command object.
|
|
1876
|
+
*
|
|
1877
|
+
* @param session - The Session instance that this Command belongs to.
|
|
1878
|
+
*/
|
|
1879
|
+
constructor(session: Session);
|
|
1880
|
+
/**
|
|
1881
|
+
* Helper method to call MCP tools and handle common response processing
|
|
1882
|
+
*
|
|
1883
|
+
* @param toolName - Name of the MCP tool to call
|
|
1884
|
+
* @param args - Arguments to pass to the tool
|
|
1885
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
1886
|
+
* @returns A CallMcpToolResult with the response data
|
|
1887
|
+
* @throws APIError if the call fails
|
|
1888
|
+
*/
|
|
1889
|
+
private callMcpTool;
|
|
1890
|
+
/**
|
|
1891
|
+
* Execute a command in the cloud environment with a specified timeout.
|
|
1892
|
+
* Corresponds to Python's execute_command() method
|
|
1893
|
+
*
|
|
1894
|
+
* @param command - The command to execute.
|
|
1895
|
+
* @param timeoutMs - The timeout for the command execution in milliseconds. Default is 1000ms.
|
|
1896
|
+
* @returns CommandResult with command output and requestId
|
|
1897
|
+
*/
|
|
1898
|
+
executeCommand(command: string, timeoutMs?: number): Promise<CommandResult>;
|
|
1899
|
+
/**
|
|
1900
|
+
* Execute code in the specified language with a timeout.
|
|
1901
|
+
* Corresponds to Python's run_code() method
|
|
1902
|
+
*
|
|
1903
|
+
* @param code - The code to execute.
|
|
1904
|
+
* @param language - The programming language of the code. Must be either 'python' or 'javascript'.
|
|
1905
|
+
* @param timeoutS - The timeout for the code execution in seconds. Default is 300s.
|
|
1906
|
+
* @returns CodeExecutionResult with code execution output and requestId
|
|
1907
|
+
* @throws Error if an unsupported language is specified.
|
|
1908
|
+
*/
|
|
1909
|
+
runCode(code: string, language: string, timeoutS?: number): Promise<CodeExecutionResult>;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
interface ContextStatusData {
|
|
1913
|
+
contextId: string;
|
|
1914
|
+
path: string;
|
|
1915
|
+
errorMessage: string;
|
|
1916
|
+
status: string;
|
|
1917
|
+
startTime: number;
|
|
1918
|
+
finishTime: number;
|
|
1919
|
+
taskType: string;
|
|
1920
|
+
}
|
|
1921
|
+
interface ContextStatusItem {
|
|
1922
|
+
type: string;
|
|
1923
|
+
data: string;
|
|
1924
|
+
}
|
|
1925
|
+
interface ContextInfoResult extends ApiResponse {
|
|
1926
|
+
contextStatusData: ContextStatusData[];
|
|
1927
|
+
}
|
|
1928
|
+
interface ContextSyncResult extends ApiResponse {
|
|
1929
|
+
success: boolean;
|
|
1344
1930
|
}
|
|
1931
|
+
interface SessionInterface {
|
|
1932
|
+
getAPIKey(): string;
|
|
1933
|
+
getClient(): Client;
|
|
1934
|
+
getSessionId(): string;
|
|
1935
|
+
}
|
|
1936
|
+
declare class ContextManager {
|
|
1937
|
+
private session;
|
|
1938
|
+
constructor(session: SessionInterface);
|
|
1939
|
+
info(): Promise<ContextInfoResult>;
|
|
1940
|
+
infoWithParams(contextId?: string, path?: string, taskType?: string): Promise<ContextInfoResult>;
|
|
1941
|
+
sync(): Promise<ContextSyncResult>;
|
|
1942
|
+
syncWithParams(contextId?: string, path?: string, mode?: string): Promise<ContextSyncResult>;
|
|
1943
|
+
}
|
|
1944
|
+
declare function newContextManager(session: SessionInterface): ContextManager;
|
|
1345
1945
|
|
|
1346
1946
|
/**
|
|
1347
|
-
*
|
|
1947
|
+
* FileInfo represents information about a file or directory
|
|
1948
|
+
*/
|
|
1949
|
+
interface FileInfo {
|
|
1950
|
+
name: string;
|
|
1951
|
+
path: string;
|
|
1952
|
+
size: number;
|
|
1953
|
+
isDirectory: boolean;
|
|
1954
|
+
modTime: string;
|
|
1955
|
+
mode: string;
|
|
1956
|
+
owner?: string;
|
|
1957
|
+
group?: string;
|
|
1958
|
+
}
|
|
1959
|
+
/**
|
|
1960
|
+
* DirectoryEntry represents an entry in a directory listing
|
|
1348
1961
|
*/
|
|
1349
|
-
interface
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
absolute_upper_left_x?: number;
|
|
1353
|
-
absolute_upper_left_y?: number;
|
|
1354
|
-
width?: number;
|
|
1355
|
-
height?: number;
|
|
1356
|
-
pid?: number;
|
|
1357
|
-
pname?: string;
|
|
1358
|
-
child_windows?: Window[];
|
|
1962
|
+
interface DirectoryEntry {
|
|
1963
|
+
name: string;
|
|
1964
|
+
isDirectory: boolean;
|
|
1359
1965
|
}
|
|
1360
1966
|
/**
|
|
1361
|
-
* Handles
|
|
1967
|
+
* Handles file operations in the AgentBay cloud environment.
|
|
1362
1968
|
*/
|
|
1363
|
-
declare class
|
|
1969
|
+
declare class FileSystem {
|
|
1364
1970
|
private session;
|
|
1971
|
+
private client;
|
|
1972
|
+
private baseUrl;
|
|
1365
1973
|
/**
|
|
1366
|
-
*
|
|
1367
|
-
*
|
|
1974
|
+
* Initialize a FileSystem object.
|
|
1975
|
+
*
|
|
1976
|
+
* @param session - The Session instance that this FileSystem belongs to.
|
|
1368
1977
|
*/
|
|
1369
|
-
constructor(session:
|
|
1370
|
-
getAPIKey(): string;
|
|
1371
|
-
getClient(): any;
|
|
1372
|
-
getSessionId(): string;
|
|
1373
|
-
});
|
|
1978
|
+
constructor(session: Session);
|
|
1374
1979
|
/**
|
|
1375
1980
|
* Helper method to call MCP tools and handle common response processing
|
|
1376
1981
|
*
|
|
@@ -1382,73 +1987,183 @@ declare class WindowManager {
|
|
|
1382
1987
|
*/
|
|
1383
1988
|
private callMcpTool;
|
|
1384
1989
|
/**
|
|
1385
|
-
*
|
|
1386
|
-
*
|
|
1387
|
-
*
|
|
1990
|
+
* Creates a new directory at the specified path.
|
|
1991
|
+
* Corresponds to Python's create_directory() method
|
|
1992
|
+
*
|
|
1993
|
+
* @param path - Path to the directory to create.
|
|
1994
|
+
* @returns BoolResult with creation result and requestId
|
|
1388
1995
|
*/
|
|
1389
|
-
|
|
1996
|
+
createDirectory(path: string): Promise<BoolResult>;
|
|
1390
1997
|
/**
|
|
1391
|
-
*
|
|
1392
|
-
*
|
|
1393
|
-
*
|
|
1998
|
+
* Edits a file by replacing occurrences of oldText with newText.
|
|
1999
|
+
* Corresponds to Python's edit_file() method
|
|
2000
|
+
*
|
|
2001
|
+
* @param path - Path to the file to edit.
|
|
2002
|
+
* @param edits - Array of edit operations, each containing oldText and newText.
|
|
2003
|
+
* @param dryRun - Optional: If true, preview changes without applying them.
|
|
2004
|
+
* @returns BoolResult with edit result and requestId
|
|
1394
2005
|
*/
|
|
1395
|
-
|
|
2006
|
+
editFile(path: string, edits: Array<{
|
|
2007
|
+
oldText: string;
|
|
2008
|
+
newText: string;
|
|
2009
|
+
}>, dryRun?: boolean): Promise<BoolResult>;
|
|
1396
2010
|
/**
|
|
1397
|
-
* Gets
|
|
1398
|
-
*
|
|
1399
|
-
*
|
|
2011
|
+
* Gets information about a file or directory.
|
|
2012
|
+
* Corresponds to Python's get_file_info() method
|
|
2013
|
+
*
|
|
2014
|
+
* @param path - Path to the file or directory to inspect.
|
|
2015
|
+
* @returns FileInfoResult with file info and requestId
|
|
1400
2016
|
*/
|
|
1401
|
-
|
|
2017
|
+
getFileInfo(path: string): Promise<FileInfoResult>;
|
|
1402
2018
|
/**
|
|
1403
|
-
*
|
|
1404
|
-
*
|
|
1405
|
-
*
|
|
2019
|
+
* Lists the contents of a directory.
|
|
2020
|
+
* Corresponds to Python's list_directory() method
|
|
2021
|
+
*
|
|
2022
|
+
* @param path - Path to the directory to list.
|
|
2023
|
+
* @returns DirectoryListResult with directory entries and requestId
|
|
1406
2024
|
*/
|
|
1407
|
-
|
|
2025
|
+
listDirectory(path: string): Promise<DirectoryListResult>;
|
|
1408
2026
|
/**
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1411
|
-
*
|
|
2027
|
+
* Moves a file or directory from source to destination.
|
|
2028
|
+
* Corresponds to Python's move_file() method
|
|
2029
|
+
*
|
|
2030
|
+
* @param source - Path to the source file or directory.
|
|
2031
|
+
* @param destination - Path to the destination file or directory.
|
|
2032
|
+
* @returns BoolResult with move result and requestId
|
|
1412
2033
|
*/
|
|
1413
|
-
|
|
2034
|
+
moveFile(source: string, destination: string): Promise<BoolResult>;
|
|
1414
2035
|
/**
|
|
1415
|
-
*
|
|
1416
|
-
*
|
|
1417
|
-
*
|
|
2036
|
+
* Reads the content of a file.
|
|
2037
|
+
* Corresponds to Python's read_file() method
|
|
2038
|
+
*
|
|
2039
|
+
* @param path - Path to the file to read.
|
|
2040
|
+
* @param offset - Optional: Line offset to start reading from.
|
|
2041
|
+
* @param length - Optional: Number of lines to read. If 0, reads the entire file.
|
|
2042
|
+
* @returns FileContentResult with file content and requestId
|
|
1418
2043
|
*/
|
|
1419
|
-
|
|
2044
|
+
readFile(path: string, offset?: number, length?: number): Promise<FileContentResult>;
|
|
1420
2045
|
/**
|
|
1421
|
-
*
|
|
1422
|
-
*
|
|
1423
|
-
*
|
|
2046
|
+
* Reads the content of multiple files.
|
|
2047
|
+
* Corresponds to Python's read_multiple_files() method
|
|
2048
|
+
*
|
|
2049
|
+
* @param paths - Array of file paths to read.
|
|
2050
|
+
* @returns MultipleFileContentResult with file contents and requestId
|
|
1424
2051
|
*/
|
|
1425
|
-
|
|
2052
|
+
readMultipleFiles(paths: string[]): Promise<MultipleFileContentResult>;
|
|
1426
2053
|
/**
|
|
1427
|
-
*
|
|
1428
|
-
*
|
|
1429
|
-
*
|
|
2054
|
+
* Searches for files in a directory that match a pattern.
|
|
2055
|
+
* Corresponds to Python's search_files() method
|
|
2056
|
+
*
|
|
2057
|
+
* @param path - Path to the directory to search in.
|
|
2058
|
+
* @param pattern - Pattern to search for. Supports glob patterns.
|
|
2059
|
+
* @param excludePatterns - Optional: Array of patterns to exclude.
|
|
2060
|
+
* @returns FileSearchResult with search results and requestId
|
|
1430
2061
|
*/
|
|
1431
|
-
|
|
2062
|
+
searchFiles(path: string, pattern: string, excludePatterns?: string[]): Promise<FileSearchResult>;
|
|
1432
2063
|
/**
|
|
1433
|
-
*
|
|
1434
|
-
*
|
|
1435
|
-
*
|
|
2064
|
+
* Writes content to a file.
|
|
2065
|
+
* Corresponds to Python's write_file() method
|
|
2066
|
+
*
|
|
2067
|
+
* @param path - Path to the file to write.
|
|
2068
|
+
* @param content - Content to write to the file.
|
|
2069
|
+
* @param mode - Optional: Write mode. One of "overwrite", "append", or "create_new". Default is "overwrite".
|
|
2070
|
+
* @returns BoolResult with write result and requestId
|
|
2071
|
+
*/
|
|
2072
|
+
writeFile(path: string, content: string, mode?: string): Promise<BoolResult>;
|
|
2073
|
+
/**
|
|
2074
|
+
* Reads a large file in chunks to handle size limitations of the underlying API.
|
|
2075
|
+
* Corresponds to Python's read_large_file() method
|
|
2076
|
+
*
|
|
2077
|
+
* @param path - Path to the file to read.
|
|
2078
|
+
* @param chunkSize - Optional: Size of each chunk in bytes. Default is 60KB.
|
|
2079
|
+
* @returns FileContentResult with complete file content and requestId
|
|
2080
|
+
*/
|
|
2081
|
+
readLargeFile(path: string, chunkSize?: number): Promise<FileContentResult>;
|
|
2082
|
+
/**
|
|
2083
|
+
* Writes a large file in chunks to handle size limitations of the underlying API.
|
|
2084
|
+
* Corresponds to Python's write_large_file() method
|
|
2085
|
+
*
|
|
2086
|
+
* @param path - Path to the file to write.
|
|
2087
|
+
* @param content - Content to write to the file.
|
|
2088
|
+
* @param chunkSize - Optional: Size of each chunk in bytes. Default is 60KB.
|
|
2089
|
+
* @returns BoolResult indicating success or failure with requestId
|
|
2090
|
+
*/
|
|
2091
|
+
writeLargeFile(path: string, content: string, chunkSize?: number): Promise<BoolResult>;
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
/**
|
|
2095
|
+
* Handles Object Storage Service operations in the AgentBay cloud environment.
|
|
2096
|
+
*/
|
|
2097
|
+
declare class Oss {
|
|
2098
|
+
private session;
|
|
2099
|
+
private client;
|
|
2100
|
+
private baseUrl;
|
|
2101
|
+
/**
|
|
2102
|
+
* Initialize an Oss object.
|
|
2103
|
+
*
|
|
2104
|
+
* @param session - The Session instance that this Oss belongs to.
|
|
2105
|
+
*/
|
|
2106
|
+
constructor(session: Session);
|
|
2107
|
+
/**
|
|
2108
|
+
* Helper method to call MCP tools and handle common response processing
|
|
2109
|
+
*
|
|
2110
|
+
* @param toolName - Name of the MCP tool to call
|
|
2111
|
+
* @param args - Arguments to pass to the tool
|
|
2112
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
2113
|
+
* @returns A CallMcpToolResult with the response data
|
|
2114
|
+
* @throws APIError if the call fails
|
|
2115
|
+
*/
|
|
2116
|
+
private callMcpTool;
|
|
2117
|
+
/**
|
|
2118
|
+
* Initialize OSS environment variables with the specified credentials.
|
|
2119
|
+
* Corresponds to Python's env_init() method
|
|
2120
|
+
*
|
|
2121
|
+
* @param accessKeyId - The Access Key ID for OSS authentication.
|
|
2122
|
+
* @param accessKeySecret - The Access Key Secret for OSS authentication.
|
|
2123
|
+
* @param securityToken - The security token for OSS authentication.
|
|
2124
|
+
* @param endpoint - The OSS service endpoint. If not specified, the default is used.
|
|
2125
|
+
* @param region - The OSS region. If not specified, the default is used.
|
|
2126
|
+
* @returns OSSClientResult with initialization result and requestId
|
|
2127
|
+
*/
|
|
2128
|
+
envInit(accessKeyId: string, accessKeySecret: string, securityToken?: string, endpoint?: string, region?: string): Promise<OSSClientResult>;
|
|
2129
|
+
/**
|
|
2130
|
+
* Upload a local file or directory to OSS.
|
|
2131
|
+
* Corresponds to Python's upload() method
|
|
2132
|
+
*
|
|
2133
|
+
* @param bucket - OSS bucket name.
|
|
2134
|
+
* @param object - ObjectS.
|
|
2135
|
+
* @param path - Local file or directory path to upload.
|
|
2136
|
+
* @returns OSSUploadResult with upload result and requestId
|
|
2137
|
+
*/
|
|
2138
|
+
upload(bucket: string, object: string, path: string): Promise<OSSUploadResult>;
|
|
2139
|
+
/**
|
|
2140
|
+
* Upload a local file or directory to OSS using a pre-signed URL.
|
|
2141
|
+
* Corresponds to Python's upload_anonymous() method
|
|
2142
|
+
*
|
|
2143
|
+
* @param url - Pre-signed URL for anonymous upload.
|
|
2144
|
+
* @param path - Local file or directory path to upload.
|
|
2145
|
+
* @returns OSSUploadResult with upload result and requestId
|
|
1436
2146
|
*/
|
|
1437
|
-
|
|
2147
|
+
uploadAnonymous(url: string, path: string): Promise<OSSUploadResult>;
|
|
1438
2148
|
/**
|
|
1439
|
-
*
|
|
1440
|
-
*
|
|
1441
|
-
*
|
|
1442
|
-
* @param
|
|
1443
|
-
* @
|
|
2149
|
+
* Download an object from OSS to a local file or directory.
|
|
2150
|
+
* Corresponds to Python's download() method
|
|
2151
|
+
*
|
|
2152
|
+
* @param bucket - OSS bucket name.
|
|
2153
|
+
* @param object - Object key in OSS.
|
|
2154
|
+
* @param path - Local file or directory path to save the downloaded content.
|
|
2155
|
+
* @returns OSSDownloadResult with download result and requestId
|
|
1444
2156
|
*/
|
|
1445
|
-
|
|
2157
|
+
download(bucket: string, object: string, path: string): Promise<OSSDownloadResult>;
|
|
1446
2158
|
/**
|
|
1447
|
-
*
|
|
1448
|
-
*
|
|
1449
|
-
*
|
|
2159
|
+
* Download an object from OSS using a pre-signed URL.
|
|
2160
|
+
* Corresponds to Python's download_anonymous() method
|
|
2161
|
+
*
|
|
2162
|
+
* @param url - Pre-signed URL for anonymous download.
|
|
2163
|
+
* @param path - Local file or directory path to save the downloaded content.
|
|
2164
|
+
* @returns OSSDownloadResult with download result and requestId
|
|
1450
2165
|
*/
|
|
1451
|
-
|
|
2166
|
+
downloadAnonymous(url: string, path: string): Promise<OSSDownloadResult>;
|
|
1452
2167
|
}
|
|
1453
2168
|
|
|
1454
2169
|
/**
|
|
@@ -1498,246 +2213,298 @@ declare class UI {
|
|
|
1498
2213
|
private callMcpTool;
|
|
1499
2214
|
/**
|
|
1500
2215
|
* Retrieves all clickable UI elements within the specified timeout.
|
|
2216
|
+
* Corresponds to Python's get_clickable_ui_elements() method
|
|
1501
2217
|
*
|
|
1502
2218
|
* @param timeoutMs - The timeout in milliseconds. Default is 2000ms.
|
|
1503
|
-
* @returns
|
|
1504
|
-
* @throws Error if the operation fails.
|
|
2219
|
+
* @returns UIElementListResult with clickable UI elements and requestId
|
|
1505
2220
|
*/
|
|
1506
|
-
getClickableUIElements(timeoutMs?: number): Promise<
|
|
2221
|
+
getClickableUIElements(timeoutMs?: number): Promise<UIElementListResult>;
|
|
1507
2222
|
/**
|
|
1508
2223
|
* Retrieves all UI elements within the specified timeout.
|
|
2224
|
+
* Corresponds to Python's get_all_ui_elements() method
|
|
1509
2225
|
*
|
|
1510
2226
|
* @param timeoutMs - The timeout in milliseconds. Default is 2000ms.
|
|
1511
|
-
* @returns
|
|
1512
|
-
* @throws Error if the operation fails.
|
|
2227
|
+
* @returns UIElementListResult with all UI elements and requestId
|
|
1513
2228
|
*/
|
|
1514
|
-
getAllUIElements(timeoutMs?: number): Promise<
|
|
2229
|
+
getAllUIElements(timeoutMs?: number): Promise<UIElementListResult>;
|
|
1515
2230
|
/**
|
|
1516
2231
|
* Sends a key press event.
|
|
2232
|
+
* Corresponds to Python's send_key() method
|
|
1517
2233
|
*
|
|
1518
2234
|
* @param key - The key code to send.
|
|
1519
|
-
* @returns
|
|
1520
|
-
* @throws Error if the operation fails.
|
|
2235
|
+
* @returns BoolResult with key press result and requestId
|
|
1521
2236
|
*/
|
|
1522
|
-
sendKey(key: number): Promise<
|
|
2237
|
+
sendKey(key: number): Promise<BoolResult>;
|
|
1523
2238
|
/**
|
|
1524
2239
|
* Inputs text into the active field.
|
|
2240
|
+
* Corresponds to Python's input_text() method
|
|
1525
2241
|
*
|
|
1526
2242
|
* @param text - The text to input.
|
|
1527
|
-
* @returns
|
|
1528
|
-
* @throws Error if the operation fails.
|
|
2243
|
+
* @returns BoolResult with input result and requestId
|
|
1529
2244
|
*/
|
|
1530
|
-
inputText(text: string): Promise<
|
|
2245
|
+
inputText(text: string): Promise<BoolResult>;
|
|
1531
2246
|
/**
|
|
1532
2247
|
* Performs a swipe gesture on the screen.
|
|
2248
|
+
* Corresponds to Python's swipe() method
|
|
1533
2249
|
*
|
|
1534
2250
|
* @param startX - The starting X coordinate.
|
|
1535
2251
|
* @param startY - The starting Y coordinate.
|
|
1536
2252
|
* @param endX - The ending X coordinate.
|
|
1537
2253
|
* @param endY - The ending Y coordinate.
|
|
1538
2254
|
* @param durationMs - The duration of the swipe in milliseconds. Default is 300ms.
|
|
1539
|
-
* @returns
|
|
1540
|
-
* @throws Error if the operation fails.
|
|
2255
|
+
* @returns BoolResult with swipe result and requestId
|
|
1541
2256
|
*/
|
|
1542
|
-
swipe(startX: number, startY: number, endX: number, endY: number, durationMs?: number): Promise<
|
|
2257
|
+
swipe(startX: number, startY: number, endX: number, endY: number, durationMs?: number): Promise<BoolResult>;
|
|
1543
2258
|
/**
|
|
1544
2259
|
* Performs a click at the specified coordinates.
|
|
2260
|
+
* Corresponds to Python's click() method
|
|
1545
2261
|
*
|
|
1546
2262
|
* @param x - The X coordinate.
|
|
1547
2263
|
* @param y - The Y coordinate.
|
|
1548
2264
|
* @param button - The mouse button to click. Default is 'left'.
|
|
1549
|
-
* @returns
|
|
1550
|
-
* @throws Error if the operation fails.
|
|
2265
|
+
* @returns BoolResult with click result and requestId
|
|
1551
2266
|
*/
|
|
1552
|
-
click(x: number, y: number, button?: string): Promise<
|
|
2267
|
+
click(x: number, y: number, button?: string): Promise<BoolResult>;
|
|
1553
2268
|
/**
|
|
1554
2269
|
* Takes a screenshot of the current screen.
|
|
2270
|
+
* Corresponds to Python's screenshot() method
|
|
1555
2271
|
*
|
|
1556
|
-
* @returns
|
|
1557
|
-
* @throws Error if the operation fails.
|
|
2272
|
+
* @returns OperationResult with screenshot data and requestId
|
|
1558
2273
|
*/
|
|
1559
|
-
screenshot(): Promise<
|
|
2274
|
+
screenshot(): Promise<OperationResult>;
|
|
1560
2275
|
}
|
|
1561
2276
|
|
|
1562
2277
|
/**
|
|
1563
|
-
*
|
|
1564
|
-
*/
|
|
1565
|
-
interface SessionInfo {
|
|
1566
|
-
sessionId: string;
|
|
1567
|
-
resourceUrl: string;
|
|
1568
|
-
appId?: string;
|
|
1569
|
-
authCode?: string;
|
|
1570
|
-
connectionProperties?: string;
|
|
1571
|
-
resourceId?: string;
|
|
1572
|
-
resourceType?: string;
|
|
1573
|
-
}
|
|
1574
|
-
/**
|
|
1575
|
-
* Represents a session in the AgentBay cloud environment.
|
|
2278
|
+
* Handles window management operations in the AgentBay cloud environment.
|
|
1576
2279
|
*/
|
|
1577
|
-
declare class
|
|
1578
|
-
private
|
|
1579
|
-
client: Client;
|
|
1580
|
-
sessionId: string;
|
|
1581
|
-
resourceUrl: string;
|
|
1582
|
-
filesystem: FileSystem;
|
|
1583
|
-
command: Command;
|
|
1584
|
-
oss: Oss;
|
|
1585
|
-
Application: Application;
|
|
1586
|
-
window: WindowManager;
|
|
1587
|
-
ui: UI;
|
|
2280
|
+
declare class WindowManager {
|
|
2281
|
+
private session;
|
|
1588
2282
|
/**
|
|
1589
|
-
*
|
|
1590
|
-
*
|
|
1591
|
-
* @param agentBay - The AgentBay instance that created this session.
|
|
1592
|
-
* @param sessionId - The ID of this session.
|
|
2283
|
+
* Creates a new WindowManager instance.
|
|
2284
|
+
* @param session The session object that provides access to the AgentBay API.
|
|
1593
2285
|
*/
|
|
1594
|
-
constructor(
|
|
2286
|
+
constructor(session: {
|
|
2287
|
+
getAPIKey(): string;
|
|
2288
|
+
getClient(): any;
|
|
2289
|
+
getSessionId(): string;
|
|
2290
|
+
});
|
|
1595
2291
|
/**
|
|
1596
|
-
*
|
|
2292
|
+
* Helper method to call MCP tools and handle common response processing
|
|
1597
2293
|
*
|
|
1598
|
-
* @
|
|
2294
|
+
* @param toolName - Name of the MCP tool to call
|
|
2295
|
+
* @param args - Arguments to pass to the tool
|
|
2296
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
2297
|
+
* @returns A CallMcpToolResult with the response data
|
|
2298
|
+
* @throws APIError if the call fails
|
|
1599
2299
|
*/
|
|
2300
|
+
private callMcpTool;
|
|
1600
2301
|
/**
|
|
1601
|
-
*
|
|
1602
|
-
*
|
|
1603
|
-
* @returns
|
|
2302
|
+
* Helper method to parse JSON string into Window objects
|
|
2303
|
+
* @param jsonStr - JSON string to parse
|
|
2304
|
+
* @returns Array of Window objects or single Window object
|
|
1604
2305
|
*/
|
|
1605
|
-
|
|
2306
|
+
private parseWindowsFromJSON;
|
|
1606
2307
|
/**
|
|
1607
|
-
*
|
|
2308
|
+
* Lists all root windows in the system.
|
|
2309
|
+
* Corresponds to Python's list_root_windows() method
|
|
1608
2310
|
*
|
|
1609
|
-
* @param
|
|
1610
|
-
* @
|
|
2311
|
+
* @param timeoutMs - The timeout in milliseconds. Default is 3000ms.
|
|
2312
|
+
* @returns WindowListResult with windows array and requestId
|
|
1611
2313
|
*/
|
|
1612
|
-
|
|
2314
|
+
listRootWindows(timeoutMs?: number): Promise<WindowListResult>;
|
|
1613
2315
|
/**
|
|
1614
|
-
* Gets the
|
|
2316
|
+
* Gets the currently active window.
|
|
2317
|
+
* Corresponds to Python's get_active_window() method
|
|
1615
2318
|
*
|
|
1616
|
-
* @
|
|
1617
|
-
* @
|
|
2319
|
+
* @param timeoutMs - The timeout in milliseconds. Default is 3000ms.
|
|
2320
|
+
* @returns WindowInfoResult with active window data and requestId
|
|
1618
2321
|
*/
|
|
1619
|
-
|
|
2322
|
+
getActiveWindow(timeoutMs?: number): Promise<WindowInfoResult>;
|
|
1620
2323
|
/**
|
|
1621
|
-
*
|
|
2324
|
+
* Activates a window by ID.
|
|
2325
|
+
* Corresponds to Python's activate_window() method
|
|
1622
2326
|
*
|
|
1623
|
-
* @
|
|
2327
|
+
* @param windowId The ID of the window to activate.
|
|
2328
|
+
* @returns BoolResult with requestId
|
|
1624
2329
|
*/
|
|
1625
|
-
|
|
2330
|
+
activateWindow(windowId: number): Promise<BoolResult>;
|
|
1626
2331
|
/**
|
|
1627
|
-
*
|
|
2332
|
+
* Maximizes a window by ID.
|
|
2333
|
+
* Corresponds to Python's maximize_window() method
|
|
1628
2334
|
*
|
|
1629
|
-
* @
|
|
2335
|
+
* @param windowId The ID of the window to maximize.
|
|
2336
|
+
* @returns BoolResult with requestId
|
|
1630
2337
|
*/
|
|
1631
|
-
|
|
2338
|
+
maximizeWindow(windowId: number): Promise<BoolResult>;
|
|
1632
2339
|
/**
|
|
1633
|
-
*
|
|
2340
|
+
* Minimizes a window by ID.
|
|
2341
|
+
* Corresponds to Python's minimize_window() method
|
|
1634
2342
|
*
|
|
1635
|
-
* @
|
|
2343
|
+
* @param windowId The ID of the window to minimize.
|
|
2344
|
+
* @returns BoolResult with requestId
|
|
1636
2345
|
*/
|
|
1637
|
-
|
|
2346
|
+
minimizeWindow(windowId: number): Promise<BoolResult>;
|
|
1638
2347
|
/**
|
|
1639
|
-
*
|
|
2348
|
+
* Restores a window by ID.
|
|
2349
|
+
* Corresponds to Python's restore_window() method
|
|
1640
2350
|
*
|
|
1641
|
-
* @
|
|
1642
|
-
* @
|
|
2351
|
+
* @param windowId The ID of the window to restore.
|
|
2352
|
+
* @returns BoolResult with requestId
|
|
1643
2353
|
*/
|
|
1644
|
-
|
|
2354
|
+
restoreWindow(windowId: number): Promise<BoolResult>;
|
|
1645
2355
|
/**
|
|
1646
|
-
*
|
|
2356
|
+
* Closes a window by ID.
|
|
2357
|
+
* Corresponds to Python's close_window() method
|
|
1647
2358
|
*
|
|
1648
|
-
* @
|
|
1649
|
-
* @
|
|
2359
|
+
* @param windowId The ID of the window to close.
|
|
2360
|
+
* @returns BoolResult with requestId
|
|
1650
2361
|
*/
|
|
1651
|
-
|
|
1652
|
-
}
|
|
1653
|
-
|
|
1654
|
-
/**
|
|
1655
|
-
* Represents a persistent storage context in the AgentBay cloud environment.
|
|
1656
|
-
*/
|
|
1657
|
-
declare class Context {
|
|
2362
|
+
closeWindow(windowId: number): Promise<BoolResult>;
|
|
1658
2363
|
/**
|
|
1659
|
-
*
|
|
2364
|
+
* Sets a window to fullscreen by ID.
|
|
2365
|
+
* Corresponds to Python's fullscreen_window() method
|
|
2366
|
+
*
|
|
2367
|
+
* @param windowId The ID of the window to set to fullscreen.
|
|
2368
|
+
* @returns BoolResult with requestId
|
|
1660
2369
|
*/
|
|
1661
|
-
|
|
2370
|
+
fullscreenWindow(windowId: number): Promise<BoolResult>;
|
|
1662
2371
|
/**
|
|
1663
|
-
*
|
|
2372
|
+
* Resizes a window by ID.
|
|
2373
|
+
* Corresponds to Python's resize_window() method
|
|
2374
|
+
*
|
|
2375
|
+
* @param windowId The ID of the window to resize.
|
|
2376
|
+
* @param width The new width of the window.
|
|
2377
|
+
* @param height The new height of the window.
|
|
2378
|
+
* @returns BoolResult with requestId
|
|
1664
2379
|
*/
|
|
1665
|
-
|
|
2380
|
+
resizeWindow(windowId: number, width: number, height: number): Promise<BoolResult>;
|
|
1666
2381
|
/**
|
|
1667
|
-
*
|
|
2382
|
+
* Enables or disables focus mode.
|
|
2383
|
+
* Corresponds to Python's focus_mode() method
|
|
2384
|
+
*
|
|
2385
|
+
* @param on Whether to enable focus mode.
|
|
2386
|
+
* @returns BoolResult with requestId
|
|
1668
2387
|
*/
|
|
1669
|
-
|
|
2388
|
+
focusMode(on: boolean): Promise<BoolResult>;
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
/**
|
|
2392
|
+
* Represents a session in the AgentBay cloud environment.
|
|
2393
|
+
*/
|
|
2394
|
+
declare class Session {
|
|
2395
|
+
private agentBay;
|
|
2396
|
+
sessionId: string;
|
|
2397
|
+
resourceUrl: string;
|
|
2398
|
+
fileSystem: FileSystem;
|
|
2399
|
+
command: Command;
|
|
2400
|
+
oss: Oss;
|
|
2401
|
+
application: Application;
|
|
2402
|
+
window: WindowManager;
|
|
2403
|
+
ui: UI;
|
|
2404
|
+
context: ContextManager;
|
|
1670
2405
|
/**
|
|
1671
|
-
*
|
|
2406
|
+
* Initialize a Session object.
|
|
2407
|
+
*
|
|
2408
|
+
* @param agentBay - The AgentBay instance that created this session.
|
|
2409
|
+
* @param sessionId - The ID of this session.
|
|
1672
2410
|
*/
|
|
1673
|
-
|
|
2411
|
+
constructor(agentBay: AgentBay, sessionId: string);
|
|
1674
2412
|
/**
|
|
1675
|
-
*
|
|
2413
|
+
* Return the API key for this session.
|
|
1676
2414
|
*/
|
|
1677
|
-
|
|
2415
|
+
getAPIKey(): string;
|
|
1678
2416
|
/**
|
|
1679
|
-
*
|
|
2417
|
+
* Return the HTTP client for this session.
|
|
1680
2418
|
*/
|
|
1681
|
-
|
|
2419
|
+
getClient(): Client;
|
|
1682
2420
|
/**
|
|
1683
|
-
*
|
|
1684
|
-
*
|
|
1685
|
-
* @param id - The unique identifier of the context.
|
|
1686
|
-
* @param name - The name of the context.
|
|
1687
|
-
* @param state - The current state of the context.
|
|
1688
|
-
* @param createdAt - Date and time when the Context was created.
|
|
1689
|
-
* @param lastUsedAt - Date and time when the Context was last used.
|
|
1690
|
-
* @param osType - The operating system type this context is bound to.
|
|
2421
|
+
* Return the session_id for this session.
|
|
1691
2422
|
*/
|
|
1692
|
-
|
|
1693
|
-
}
|
|
1694
|
-
/**
|
|
1695
|
-
* Provides methods to manage persistent contexts in the AgentBay cloud environment.
|
|
1696
|
-
*/
|
|
1697
|
-
declare class ContextService {
|
|
1698
|
-
private agentBay;
|
|
2423
|
+
getSessionId(): string;
|
|
1699
2424
|
/**
|
|
1700
|
-
*
|
|
2425
|
+
* Delete this session.
|
|
1701
2426
|
*
|
|
1702
|
-
* @param
|
|
2427
|
+
* @param syncContext - Whether to sync context data (trigger file uploads) before deleting the session. Defaults to false.
|
|
2428
|
+
* @returns DeleteResult indicating success or failure and request ID
|
|
1703
2429
|
*/
|
|
1704
|
-
|
|
2430
|
+
delete(syncContext?: boolean): Promise<DeleteResult>;
|
|
1705
2431
|
/**
|
|
1706
|
-
*
|
|
2432
|
+
* Sets the labels for this session.
|
|
1707
2433
|
*
|
|
1708
|
-
* @
|
|
2434
|
+
* @param labels - The labels to set for the session.
|
|
2435
|
+
* @returns OperationResult indicating success or failure with request ID
|
|
2436
|
+
* @throws Error if the operation fails (matching Python SessionError)
|
|
1709
2437
|
*/
|
|
1710
|
-
|
|
2438
|
+
setLabels(labels: Record<string, string>): Promise<OperationResult>;
|
|
1711
2439
|
/**
|
|
1712
|
-
* Gets
|
|
2440
|
+
* Gets the labels for this session.
|
|
1713
2441
|
*
|
|
1714
|
-
* @
|
|
1715
|
-
* @
|
|
1716
|
-
* @returns The Context object if found or created, null if not found and create is false.
|
|
2442
|
+
* @returns OperationResult containing the labels as data and request ID
|
|
2443
|
+
* @throws Error if the operation fails (matching Python SessionError)
|
|
1717
2444
|
*/
|
|
1718
|
-
|
|
2445
|
+
getLabels(): Promise<OperationResult>;
|
|
1719
2446
|
/**
|
|
1720
|
-
*
|
|
2447
|
+
* Gets information about this session.
|
|
1721
2448
|
*
|
|
1722
|
-
* @
|
|
1723
|
-
* @
|
|
2449
|
+
* @returns OperationResult containing the session information as data and request ID
|
|
2450
|
+
* @throws Error if the operation fails (matching Python SessionError)
|
|
1724
2451
|
*/
|
|
1725
|
-
|
|
2452
|
+
info(): Promise<OperationResult>;
|
|
1726
2453
|
/**
|
|
1727
|
-
*
|
|
2454
|
+
* Get a link associated with the current session.
|
|
1728
2455
|
*
|
|
1729
|
-
* @param
|
|
1730
|
-
* @
|
|
2456
|
+
* @param protocolType - Optional protocol type to use for the link
|
|
2457
|
+
* @param port - Optional port to use for the link
|
|
2458
|
+
* @returns OperationResult containing the link as data and request ID
|
|
2459
|
+
* @throws Error if the operation fails (matching Python SessionError)
|
|
1731
2460
|
*/
|
|
1732
|
-
|
|
2461
|
+
getLink(protocolType?: string, port?: number): Promise<OperationResult>;
|
|
1733
2462
|
/**
|
|
1734
|
-
*
|
|
2463
|
+
* Asynchronously get a link associated with the current session.
|
|
1735
2464
|
*
|
|
1736
|
-
* @param
|
|
2465
|
+
* @param protocolType - Optional protocol type to use for the link
|
|
2466
|
+
* @param port - Optional port to use for the link
|
|
2467
|
+
* @returns OperationResult containing the link as data and request ID
|
|
2468
|
+
* @throws Error if the operation fails (matching Python SessionError)
|
|
1737
2469
|
*/
|
|
1738
|
-
|
|
2470
|
+
getLinkAsync(protocolType?: string, port?: number): Promise<OperationResult>;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
/**
|
|
2474
|
+
* Parameters for listing sessions with pagination support
|
|
2475
|
+
*/
|
|
2476
|
+
interface ListSessionParams {
|
|
2477
|
+
/** Number of results per page (default: 10) */
|
|
2478
|
+
maxResults?: number;
|
|
2479
|
+
/** Token for the next page */
|
|
2480
|
+
nextToken?: string;
|
|
2481
|
+
/** Labels to filter by */
|
|
2482
|
+
labels: Record<string, string>;
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* Result type for session listing with pagination information
|
|
2486
|
+
* Maintain consistency with the existing TypeScript SDK return structure and use the data field
|
|
2487
|
+
*/
|
|
2488
|
+
interface SessionListResult extends ApiResponse {
|
|
2489
|
+
/** Array of sessions */
|
|
2490
|
+
data: Session[];
|
|
2491
|
+
/** Token for the next page (if available) */
|
|
2492
|
+
nextToken?: string;
|
|
2493
|
+
/** Number of results per page */
|
|
2494
|
+
maxResults?: number;
|
|
2495
|
+
/** Total number of results */
|
|
2496
|
+
totalCount?: number;
|
|
1739
2497
|
}
|
|
1740
2498
|
|
|
2499
|
+
/**
|
|
2500
|
+
* Parameters for creating a session.
|
|
2501
|
+
*/
|
|
2502
|
+
interface CreateSessionParams$1 {
|
|
2503
|
+
contextId?: string;
|
|
2504
|
+
labels?: Record<string, string>;
|
|
2505
|
+
imageId?: string;
|
|
2506
|
+
contextSync?: ContextSync[];
|
|
2507
|
+
}
|
|
1741
2508
|
/**
|
|
1742
2509
|
* Main class for interacting with the AgentBay cloud runtime environment.
|
|
1743
2510
|
*/
|
|
@@ -1756,23 +2523,19 @@ declare class AgentBay {
|
|
|
1756
2523
|
*
|
|
1757
2524
|
* @param options - Configuration options
|
|
1758
2525
|
* @param options.apiKey - API key for authentication. If not provided, will look for AGENTBAY_API_KEY environment variable.
|
|
2526
|
+
* @param options.config - Custom configuration object. If not provided, will use environment-based configuration.
|
|
1759
2527
|
*/
|
|
1760
2528
|
constructor(options?: {
|
|
1761
2529
|
apiKey?: string;
|
|
2530
|
+
config?: Config;
|
|
1762
2531
|
});
|
|
1763
2532
|
/**
|
|
1764
2533
|
* Create a new session in the AgentBay cloud environment.
|
|
1765
2534
|
*
|
|
1766
|
-
* @param
|
|
1767
|
-
* @
|
|
1768
|
-
* @param options.labels - Custom labels for the session
|
|
1769
|
-
* @returns A new Session object.
|
|
2535
|
+
* @param params - Optional parameters for creating the session
|
|
2536
|
+
* @returns SessionResult containing the created session and request ID
|
|
1770
2537
|
*/
|
|
1771
|
-
create(
|
|
1772
|
-
contextId?: string;
|
|
1773
|
-
labels?: Record<string, string>;
|
|
1774
|
-
imageId?: string;
|
|
1775
|
-
}): Promise<Session>;
|
|
2538
|
+
create(params?: CreateSessionParams$1): Promise<SessionResult>;
|
|
1776
2539
|
/**
|
|
1777
2540
|
* List all available sessions.
|
|
1778
2541
|
*
|
|
@@ -1780,20 +2543,23 @@ declare class AgentBay {
|
|
|
1780
2543
|
*/
|
|
1781
2544
|
list(): Session[];
|
|
1782
2545
|
/**
|
|
1783
|
-
* List sessions filtered by the provided labels.
|
|
2546
|
+
* List sessions filtered by the provided labels with pagination support.
|
|
1784
2547
|
* It returns sessions that match all the specified labels.
|
|
1785
2548
|
*
|
|
1786
|
-
*
|
|
1787
|
-
*
|
|
2549
|
+
* **Breaking Change**: This method currently only accepts ListSessionParams parameters,
|
|
2550
|
+
*
|
|
2551
|
+
* @param params - Parameters including labels and pagination options (required)
|
|
2552
|
+
* @returns API response with sessions list and pagination info
|
|
1788
2553
|
*/
|
|
1789
|
-
listByLabels(
|
|
2554
|
+
listByLabels(params?: ListSessionParams): Promise<SessionListResult>;
|
|
1790
2555
|
/**
|
|
1791
|
-
* Delete a session by
|
|
2556
|
+
* Delete a session by session object.
|
|
1792
2557
|
*
|
|
1793
|
-
* @param
|
|
1794
|
-
* @
|
|
2558
|
+
* @param session - The session to delete.
|
|
2559
|
+
* @param syncContext - Whether to sync context data (trigger file uploads) before deleting the session. Defaults to false.
|
|
2560
|
+
* @returns DeleteResult indicating success or failure and request ID
|
|
1795
2561
|
*/
|
|
1796
|
-
delete(session: Session): Promise<
|
|
2562
|
+
delete(session: Session, syncContext?: boolean): Promise<DeleteResult>;
|
|
1797
2563
|
/**
|
|
1798
2564
|
*
|
|
1799
2565
|
* @param sessionId - The ID of the session to remove.
|
|
@@ -1804,34 +2570,169 @@ declare class AgentBay {
|
|
|
1804
2570
|
}
|
|
1805
2571
|
|
|
1806
2572
|
/**
|
|
1807
|
-
* Base exception for all AgentBay errors.
|
|
2573
|
+
* Base exception for all AgentBay SDK errors.
|
|
1808
2574
|
*/
|
|
1809
2575
|
declare class AgentBayError extends Error {
|
|
1810
|
-
|
|
2576
|
+
extra: Record<string, any>;
|
|
2577
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
1811
2578
|
}
|
|
1812
2579
|
/**
|
|
1813
2580
|
* Raised when there is an authentication error.
|
|
1814
2581
|
*/
|
|
1815
2582
|
declare class AuthenticationError extends AgentBayError {
|
|
1816
|
-
constructor(message
|
|
2583
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
1817
2584
|
}
|
|
1818
2585
|
/**
|
|
1819
2586
|
* Raised when there is an error with the API.
|
|
1820
2587
|
*/
|
|
1821
2588
|
declare class APIError extends AgentBayError {
|
|
1822
|
-
|
|
2589
|
+
statusCode?: number;
|
|
2590
|
+
constructor(message?: string, statusCode?: number, extra?: Record<string, any>);
|
|
1823
2591
|
}
|
|
1824
2592
|
/**
|
|
1825
|
-
* Raised
|
|
2593
|
+
* Raised for errors related to file operations.
|
|
1826
2594
|
*/
|
|
1827
2595
|
declare class FileError extends AgentBayError {
|
|
1828
|
-
constructor(message
|
|
2596
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
1829
2597
|
}
|
|
1830
2598
|
/**
|
|
1831
|
-
* Raised
|
|
2599
|
+
* Raised for errors related to command execution.
|
|
1832
2600
|
*/
|
|
1833
2601
|
declare class CommandError extends AgentBayError {
|
|
1834
|
-
constructor(message
|
|
2602
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2603
|
+
}
|
|
2604
|
+
/**
|
|
2605
|
+
* Raised for errors related to session operations.
|
|
2606
|
+
*/
|
|
2607
|
+
declare class SessionError extends AgentBayError {
|
|
2608
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2609
|
+
}
|
|
2610
|
+
/**
|
|
2611
|
+
* Raised for errors related to OSS operations.
|
|
2612
|
+
*/
|
|
2613
|
+
declare class OssError extends AgentBayError {
|
|
2614
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2615
|
+
}
|
|
2616
|
+
/**
|
|
2617
|
+
* Raised for errors related to application operations.
|
|
2618
|
+
*/
|
|
2619
|
+
declare class ApplicationError extends AgentBayError {
|
|
2620
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2621
|
+
}
|
|
2622
|
+
/**
|
|
2623
|
+
* Raised for errors related to UI operations.
|
|
2624
|
+
*/
|
|
2625
|
+
declare class UIError extends AgentBayError {
|
|
2626
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
/**
|
|
2630
|
+
* Configuration interface for CreateSessionParams
|
|
2631
|
+
*/
|
|
2632
|
+
interface CreateSessionParamsConfig {
|
|
2633
|
+
labels: Record<string, string>;
|
|
2634
|
+
/**
|
|
2635
|
+
* @deprecated This field is deprecated and will be removed in a future version.
|
|
2636
|
+
* Please use contextSync instead for more flexible and powerful data persistence.
|
|
2637
|
+
*/
|
|
2638
|
+
contextId?: string;
|
|
2639
|
+
imageId?: string;
|
|
2640
|
+
contextSync: ContextSync[];
|
|
2641
|
+
}
|
|
2642
|
+
/**
|
|
2643
|
+
* CreateSessionParams provides a way to configure the parameters for creating a new session
|
|
2644
|
+
* in the AgentBay cloud environment.
|
|
2645
|
+
*/
|
|
2646
|
+
declare class CreateSessionParams implements CreateSessionParamsConfig {
|
|
2647
|
+
/** Custom labels for the Session. These can be used for organizing and filtering sessions. */
|
|
2648
|
+
labels: Record<string, string>;
|
|
2649
|
+
/**
|
|
2650
|
+
* ID of the context to bind to the session.
|
|
2651
|
+
* The context can include various types of persistence like file system (volume) and cookies.
|
|
2652
|
+
*
|
|
2653
|
+
* @deprecated This field is deprecated and will be removed in a future version.
|
|
2654
|
+
* Please use contextSync instead for more flexible and powerful data persistence.
|
|
2655
|
+
*
|
|
2656
|
+
* Important Limitations:
|
|
2657
|
+
* 1. One session at a time: A context can only be used by one session at a time.
|
|
2658
|
+
* If you try to create a session with a context ID that is already in use by another active session,
|
|
2659
|
+
* the session creation will fail.
|
|
2660
|
+
*
|
|
2661
|
+
* 2. OS binding: A context is bound to the operating system of the first session that uses it.
|
|
2662
|
+
* When a context is first used with a session, it becomes bound to that session's OS.
|
|
2663
|
+
* Any attempt to use the context with a session running on a different OS will fail.
|
|
2664
|
+
* For example, if a context is first used with a Linux session, it cannot later be used
|
|
2665
|
+
* with a Windows or Android session.
|
|
2666
|
+
*/
|
|
2667
|
+
contextId?: string;
|
|
2668
|
+
/** Image ID to use for the session. */
|
|
2669
|
+
imageId?: string;
|
|
2670
|
+
/**
|
|
2671
|
+
* List of context synchronization configurations.
|
|
2672
|
+
* These configurations define how contexts should be synchronized and mounted.
|
|
2673
|
+
*/
|
|
2674
|
+
contextSync: ContextSync[];
|
|
2675
|
+
constructor();
|
|
2676
|
+
/**
|
|
2677
|
+
* WithLabels sets the labels for the session parameters and returns the updated parameters.
|
|
2678
|
+
*/
|
|
2679
|
+
withLabels(labels: Record<string, string>): CreateSessionParams;
|
|
2680
|
+
/**
|
|
2681
|
+
* WithContextID sets the context ID for the session parameters and returns the updated parameters.
|
|
2682
|
+
*/
|
|
2683
|
+
withContextID(contextId: string): CreateSessionParams;
|
|
2684
|
+
/**
|
|
2685
|
+
* WithImageId sets the image ID for the session parameters and returns the updated parameters.
|
|
2686
|
+
*/
|
|
2687
|
+
withImageId(imageId: string): CreateSessionParams;
|
|
2688
|
+
/**
|
|
2689
|
+
* GetLabelsJSON returns the labels as a JSON string.
|
|
2690
|
+
* Returns an object with success status and result/error message to match Go version behavior.
|
|
2691
|
+
*/
|
|
2692
|
+
getLabelsJSON(): {
|
|
2693
|
+
result: string;
|
|
2694
|
+
error?: string;
|
|
2695
|
+
};
|
|
2696
|
+
/**
|
|
2697
|
+
* AddContextSync adds a context sync configuration to the session parameters.
|
|
2698
|
+
*/
|
|
2699
|
+
addContextSync(contextId: string, path: string, policy?: SyncPolicy): CreateSessionParams;
|
|
2700
|
+
/**
|
|
2701
|
+
* AddContextSyncConfig adds a pre-configured context sync to the session parameters.
|
|
2702
|
+
*/
|
|
2703
|
+
addContextSyncConfig(contextSync: ContextSync): CreateSessionParams;
|
|
2704
|
+
/**
|
|
2705
|
+
* WithContextSync sets the context sync configurations for the session parameters.
|
|
2706
|
+
*/
|
|
2707
|
+
withContextSync(contextSyncs: ContextSync[]): CreateSessionParams;
|
|
2708
|
+
/**
|
|
2709
|
+
* Convert to plain object for JSON serialization
|
|
2710
|
+
*/
|
|
2711
|
+
toJSON(): CreateSessionParamsConfig;
|
|
2712
|
+
/**
|
|
2713
|
+
* Create from plain object
|
|
2714
|
+
*/
|
|
2715
|
+
static fromJSON(config: CreateSessionParamsConfig): CreateSessionParams;
|
|
1835
2716
|
}
|
|
2717
|
+
/**
|
|
2718
|
+
* NewCreateSessionParams creates a new CreateSessionParams with default values.
|
|
2719
|
+
*/
|
|
2720
|
+
declare function newCreateSessionParams(): CreateSessionParams;
|
|
2721
|
+
|
|
2722
|
+
/**
|
|
2723
|
+
* Utility functions for logging in a clean format
|
|
2724
|
+
*/
|
|
2725
|
+
/**
|
|
2726
|
+
* Log a message without the log prefix and file location
|
|
2727
|
+
* @param message The message to log
|
|
2728
|
+
* @param args Optional arguments to log
|
|
2729
|
+
*/
|
|
2730
|
+
declare function log(message: string, ...args: any[]): void;
|
|
2731
|
+
/**
|
|
2732
|
+
* Log an error message
|
|
2733
|
+
* @param message The error message to log
|
|
2734
|
+
* @param error Optional error object
|
|
2735
|
+
*/
|
|
2736
|
+
declare function logError(message: string, error?: any): void;
|
|
1836
2737
|
|
|
1837
|
-
export { APIError, AgentBay, AgentBayError, Application, AuthenticationError, CallMcpToolRequest, CallMcpToolResponse, CallMcpToolResponseBody, Client, type
|
|
2738
|
+
export { APIError, AgentBay, AgentBayError, Application, ApplicationError, ApplyMqttTokenRequest, ApplyMqttTokenResponse, ApplyMqttTokenResponseBody, ApplyMqttTokenResponseBodyData, AuthenticationError, type BWList, 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$1 as CreateSessionParams, type CreateSessionParamsConfig, DeleteContextRequest, DeleteContextResponse, DeleteContextResponseBody, type DeletePolicy, type DirectoryEntry, type DownloadPolicy, DownloadStrategy, 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, type InstalledApp, KeyCode, ListContextsRequest, ListContextsResponse, ListContextsResponseBody, ListContextsResponseBodyData, ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsResponseBody, type ListSessionParams, ListSessionRequest, ListSessionResponse, ListSessionResponseBody, ListSessionResponseBodyData, ModifyContextRequest, ModifyContextResponse, ModifyContextResponseBody, Oss, OssError, type Process, ReleaseMcpSessionRequest, ReleaseMcpSessionResponse, ReleaseMcpSessionResponseBody, Session, SessionError, type SessionInterface, SetLabelRequest, SetLabelResponse, SetLabelResponseBody, SyncContextRequest, SyncContextResponse, SyncContextResponseBody, type SyncPolicy, UI, type UIElement, UIError, type UploadPolicy, UploadStrategy, type WhiteList, log, logError, newContextManager, newContextSync, newCreateSessionParams, newDeletePolicy, newDownloadPolicy, newSyncPolicy, newUploadPolicy };
|