wuying-agentbay-sdk 0.1.0 → 0.3.0
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 +24 -4
- package/dist/index.cjs +4534 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +1837 -0
- package/dist/index.d.ts +1837 -0
- package/dist/index.mjs +4550 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +16 -8
- package/dist/src/adb/adb.d.ts +0 -20
- package/dist/src/adb/adb.js +0 -57
- package/dist/src/adb/index.d.ts +0 -1
- package/dist/src/adb/index.js +0 -17
- package/dist/src/agent-bay.d.ts +0 -68
- package/dist/src/agent-bay.js +0 -213
- package/dist/src/api/client.d.ts +0 -191
- package/dist/src/api/client.js +0 -629
- package/dist/src/api/index.d.ts +0 -4
- package/dist/src/api/index.js +0 -26
- package/dist/src/api/models/CallMcpToolRequest.d.ts +0 -21
- package/dist/src/api/models/CallMcpToolRequest.js +0 -71
- package/dist/src/api/models/CallMcpToolResponse.d.ts +0 -19
- package/dist/src/api/models/CallMcpToolResponse.js +0 -68
- package/dist/src/api/models/CallMcpToolResponseBody.d.ts +0 -19
- package/dist/src/api/models/CallMcpToolResponseBody.js +0 -67
- package/dist/src/api/models/CreateMcpSessionRequest.d.ts +0 -19
- package/dist/src/api/models/CreateMcpSessionRequest.js +0 -67
- package/dist/src/api/models/CreateMcpSessionResponse.d.ts +0 -19
- package/dist/src/api/models/CreateMcpSessionResponse.js +0 -68
- package/dist/src/api/models/CreateMcpSessionResponseBody.d.ts +0 -20
- package/dist/src/api/models/CreateMcpSessionResponseBody.js +0 -71
- package/dist/src/api/models/CreateMcpSessionResponseBodyData.d.ts +0 -19
- package/dist/src/api/models/CreateMcpSessionResponseBodyData.js +0 -67
- package/dist/src/api/models/DeleteContextRequest.d.ts +0 -15
- package/dist/src/api/models/DeleteContextRequest.js +0 -59
- package/dist/src/api/models/DeleteContextResponse.d.ts +0 -19
- package/dist/src/api/models/DeleteContextResponse.js +0 -68
- package/dist/src/api/models/DeleteContextResponseBody.d.ts +0 -18
- package/dist/src/api/models/DeleteContextResponseBody.js +0 -65
- package/dist/src/api/models/GetContextRequest.d.ts +0 -16
- package/dist/src/api/models/GetContextRequest.js +0 -61
- package/dist/src/api/models/GetContextResponse.d.ts +0 -19
- package/dist/src/api/models/GetContextResponse.js +0 -68
- package/dist/src/api/models/GetContextResponseBody.d.ts +0 -20
- package/dist/src/api/models/GetContextResponseBody.js +0 -71
- package/dist/src/api/models/GetContextResponseBodyData.d.ts +0 -19
- package/dist/src/api/models/GetContextResponseBodyData.js +0 -67
- package/dist/src/api/models/GetLabelRequest.d.ts +0 -17
- package/dist/src/api/models/GetLabelRequest.js +0 -63
- package/dist/src/api/models/GetLabelResponse.d.ts +0 -19
- package/dist/src/api/models/GetLabelResponse.js +0 -68
- package/dist/src/api/models/GetLabelResponseBody.d.ts +0 -23
- package/dist/src/api/models/GetLabelResponseBody.js +0 -77
- package/dist/src/api/models/GetLabelResponseBodyData.d.ts +0 -14
- package/dist/src/api/models/GetLabelResponseBodyData.js +0 -57
- package/dist/src/api/models/GetLinkRequest.d.ts +0 -15
- package/dist/src/api/models/GetLinkRequest.js +0 -59
- package/dist/src/api/models/GetLinkResponse.d.ts +0 -19
- package/dist/src/api/models/GetLinkResponse.js +0 -68
- package/dist/src/api/models/GetLinkResponseBody.d.ts +0 -19
- package/dist/src/api/models/GetLinkResponseBody.js +0 -67
- package/dist/src/api/models/GetMcpResourceRequest.d.ts +0 -15
- package/dist/src/api/models/GetMcpResourceRequest.js +0 -59
- package/dist/src/api/models/GetMcpResourceResponse.d.ts +0 -19
- package/dist/src/api/models/GetMcpResourceResponse.js +0 -68
- package/dist/src/api/models/GetMcpResourceResponseBody.d.ts +0 -20
- package/dist/src/api/models/GetMcpResourceResponseBody.js +0 -71
- package/dist/src/api/models/GetMcpResourceResponseBodyData.d.ts +0 -17
- package/dist/src/api/models/GetMcpResourceResponseBodyData.js +0 -65
- package/dist/src/api/models/GetMcpResourceResponseBodyDataDesktopInfo.d.ts +0 -18
- package/dist/src/api/models/GetMcpResourceResponseBodyDataDesktopInfo.js +0 -65
- package/dist/src/api/models/ListContextsRequest.d.ts +0 -16
- package/dist/src/api/models/ListContextsRequest.js +0 -61
- package/dist/src/api/models/ListContextsResponse.d.ts +0 -19
- package/dist/src/api/models/ListContextsResponse.js +0 -68
- package/dist/src/api/models/ListContextsResponseBody.d.ts +0 -23
- package/dist/src/api/models/ListContextsResponseBody.js +0 -77
- package/dist/src/api/models/ListContextsResponseBodyData.d.ts +0 -19
- package/dist/src/api/models/ListContextsResponseBodyData.js +0 -67
- package/dist/src/api/models/ListSessionRequest.d.ts +0 -17
- package/dist/src/api/models/ListSessionRequest.js +0 -63
- package/dist/src/api/models/ListSessionResponse.d.ts +0 -19
- package/dist/src/api/models/ListSessionResponse.js +0 -68
- package/dist/src/api/models/ListSessionResponseBody.d.ts +0 -23
- package/dist/src/api/models/ListSessionResponseBody.js +0 -77
- package/dist/src/api/models/ListSessionResponseBodyData.d.ts +0 -14
- package/dist/src/api/models/ListSessionResponseBodyData.js +0 -57
- package/dist/src/api/models/ModifyContextRequest.d.ts +0 -16
- package/dist/src/api/models/ModifyContextRequest.js +0 -61
- package/dist/src/api/models/ModifyContextResponse.d.ts +0 -19
- package/dist/src/api/models/ModifyContextResponse.js +0 -68
- package/dist/src/api/models/ModifyContextResponseBody.d.ts +0 -18
- package/dist/src/api/models/ModifyContextResponseBody.js +0 -65
- package/dist/src/api/models/ReleaseMcpSessionRequest.d.ts +0 -15
- package/dist/src/api/models/ReleaseMcpSessionRequest.js +0 -59
- package/dist/src/api/models/ReleaseMcpSessionResponse.d.ts +0 -19
- package/dist/src/api/models/ReleaseMcpSessionResponse.js +0 -68
- package/dist/src/api/models/ReleaseMcpSessionResponseBody.d.ts +0 -18
- package/dist/src/api/models/ReleaseMcpSessionResponseBody.js +0 -65
- package/dist/src/api/models/SetLabelRequest.d.ts +0 -16
- package/dist/src/api/models/SetLabelRequest.js +0 -61
- package/dist/src/api/models/SetLabelResponse.d.ts +0 -19
- package/dist/src/api/models/SetLabelResponse.js +0 -68
- package/dist/src/api/models/SetLabelResponseBody.d.ts +0 -18
- package/dist/src/api/models/SetLabelResponseBody.js +0 -65
- package/dist/src/api/models/model.d.ts +0 -43
- package/dist/src/api/models/model.js +0 -89
- package/dist/src/application/application.d.ts +0 -88
- package/dist/src/application/application.js +0 -172
- package/dist/src/application/index.d.ts +0 -1
- package/dist/src/application/index.js +0 -17
- package/dist/src/command/command.d.ts +0 -43
- package/dist/src/command/command.js +0 -120
- package/dist/src/command/index.d.ts +0 -1
- package/dist/src/command/index.js +0 -17
- package/dist/src/config.d.ts +0 -15
- package/dist/src/config.js +0 -114
- package/dist/src/context.d.ts +0 -87
- package/dist/src/context.js +0 -208
- package/dist/src/exceptions.d.ts +0 -30
- package/dist/src/exceptions.js +0 -58
- package/dist/src/filesystem/filesystem.d.ts +0 -109
- package/dist/src/filesystem/filesystem.js +0 -245
- package/dist/src/filesystem/index.d.ts +0 -1
- package/dist/src/filesystem/index.js +0 -17
- package/dist/src/index.d.ts +0 -10
- package/dist/src/index.js +0 -32
- package/dist/src/oss/index.d.ts +0 -1
- package/dist/src/oss/index.js +0 -5
- package/dist/src/oss/oss.d.ts +0 -80
- package/dist/src/oss/oss.js +0 -233
- package/dist/src/session.d.ts +0 -99
- package/dist/src/session.js +0 -226
- package/dist/src/ui/index.d.ts +0 -1
- package/dist/src/ui/index.js +0 -17
- package/dist/src/ui/ui.d.ts +0 -95
- package/dist/src/ui/ui.js +0 -206
- package/dist/src/utils/logger.d.ts +0 -15
- package/dist/src/utils/logger.js +0 -48
- package/dist/src/window/index.d.ts +0 -1
- package/dist/src/window/index.js +0 -17
- package/dist/src/window/window.d.ts +0 -109
- package/dist/src/window/window.js +0 -220
- package/dist/tests/agent-bay.test.d.ts +0 -1
- package/dist/tests/agent-bay.test.js +0 -366
- package/dist/tests/integration/context-persistence.test.d.ts +0 -1
- package/dist/tests/integration/context-persistence.test.js +0 -226
- package/dist/tests/integration/context-session.test.d.ts +0 -1
- package/dist/tests/integration/context-session.test.js +0 -223
- package/dist/tests/integration/window-operations.test.d.ts +0 -1
- package/dist/tests/integration/window-operations.test.js +0 -228
- package/dist/tests/unit/adb.test.d.ts +0 -1
- package/dist/tests/unit/adb.test.js +0 -60
- package/dist/tests/unit/agent-bay.test.d.ts +0 -1
- package/dist/tests/unit/agent-bay.test.js +0 -182
- package/dist/tests/unit/application.test.d.ts +0 -1
- package/dist/tests/unit/application.test.js +0 -260
- package/dist/tests/unit/command.test.d.ts +0 -1
- package/dist/tests/unit/command.test.js +0 -252
- package/dist/tests/unit/context.test.d.ts +0 -1
- package/dist/tests/unit/context.test.js +0 -199
- package/dist/tests/unit/filesystem.test.d.ts +0 -1
- package/dist/tests/unit/filesystem.test.js +0 -493
- package/dist/tests/unit/oss.test.d.ts +0 -1
- package/dist/tests/unit/oss.test.js +0 -243
- package/dist/tests/unit/session-labels.test.d.ts +0 -1
- package/dist/tests/unit/session-labels.test.js +0 -138
- package/dist/tests/unit/session-params.test.d.ts +0 -1
- package/dist/tests/unit/session-params.test.js +0 -78
- package/dist/tests/unit/session.test.d.ts +0 -1
- package/dist/tests/unit/session.test.js +0 -204
- package/dist/tests/unit/ui.test.d.ts +0 -1
- package/dist/tests/unit/ui.test.js +0 -158
- package/dist/tests/unit/window.test.d.ts +0 -1
- package/dist/tests/unit/window.test.js +0 -331
- package/dist/tests/utils/test-helpers.d.ts +0 -35
- package/dist/tests/utils/test-helpers.js +0 -79
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1837 @@
|
|
|
1
|
+
import * as $dara from '@darabonba/typescript';
|
|
2
|
+
import * as OpenApiDefault from '@alicloud/openapi-core';
|
|
3
|
+
import { $OpenApiUtil } from '@alicloud/openapi-core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
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
|
+
*/
|
|
174
|
+
declare class Command {
|
|
175
|
+
private session;
|
|
176
|
+
private client;
|
|
177
|
+
private baseUrl;
|
|
178
|
+
/**
|
|
179
|
+
* Initialize a Command object.
|
|
180
|
+
*
|
|
181
|
+
* @param session - The Session instance that this Command belongs to.
|
|
182
|
+
*/
|
|
183
|
+
constructor(session: Session);
|
|
184
|
+
/**
|
|
185
|
+
* Helper method to call MCP tools and handle common response processing
|
|
186
|
+
*
|
|
187
|
+
* @param toolName - Name of the MCP tool to call
|
|
188
|
+
* @param args - Arguments to pass to the tool
|
|
189
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
190
|
+
* @returns A CallMcpToolResult with the response data
|
|
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>;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Handles Object Storage Service operations in the AgentBay cloud environment.
|
|
224
|
+
*/
|
|
225
|
+
declare class Oss {
|
|
226
|
+
private session;
|
|
227
|
+
private client;
|
|
228
|
+
private baseUrl;
|
|
229
|
+
/**
|
|
230
|
+
* Initialize an Oss object.
|
|
231
|
+
*
|
|
232
|
+
* @param session - The Session instance that this Oss belongs to.
|
|
233
|
+
*/
|
|
234
|
+
constructor(session: Session);
|
|
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>;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare class CreateMcpSessionResponseBodyData extends $dara.Model {
|
|
303
|
+
appInstanceId?: string;
|
|
304
|
+
errMsg?: string;
|
|
305
|
+
resourceId?: string;
|
|
306
|
+
resourceUrl?: string;
|
|
307
|
+
sessionId?: string;
|
|
308
|
+
success?: boolean;
|
|
309
|
+
static names(): {
|
|
310
|
+
[key: string]: string;
|
|
311
|
+
};
|
|
312
|
+
static types(): {
|
|
313
|
+
[key: string]: any;
|
|
314
|
+
};
|
|
315
|
+
validate(): void;
|
|
316
|
+
constructor(map?: {
|
|
317
|
+
[key: string]: any;
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
declare class GetContextResponseBodyData extends $dara.Model {
|
|
322
|
+
createTime?: string;
|
|
323
|
+
id?: string;
|
|
324
|
+
lastUsedTime?: string;
|
|
325
|
+
name?: string;
|
|
326
|
+
osType?: string;
|
|
327
|
+
state?: string;
|
|
328
|
+
static names(): {
|
|
329
|
+
[key: string]: string;
|
|
330
|
+
};
|
|
331
|
+
static types(): {
|
|
332
|
+
[key: string]: any;
|
|
333
|
+
};
|
|
334
|
+
validate(): void;
|
|
335
|
+
constructor(map?: {
|
|
336
|
+
[key: string]: any;
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
declare class GetLabelResponseBodyData extends $dara.Model {
|
|
341
|
+
labels?: string;
|
|
342
|
+
static names(): {
|
|
343
|
+
[key: string]: string;
|
|
344
|
+
};
|
|
345
|
+
static types(): {
|
|
346
|
+
[key: string]: any;
|
|
347
|
+
};
|
|
348
|
+
validate(): void;
|
|
349
|
+
constructor(map?: {
|
|
350
|
+
[key: string]: any;
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
declare class GetMcpResourceResponseBodyDataDesktopInfo extends $dara.Model {
|
|
355
|
+
appId?: string;
|
|
356
|
+
authCode?: string;
|
|
357
|
+
connectionProperties?: string;
|
|
358
|
+
resourceId?: string;
|
|
359
|
+
resourceType?: string;
|
|
360
|
+
static names(): {
|
|
361
|
+
[key: string]: string;
|
|
362
|
+
};
|
|
363
|
+
static types(): {
|
|
364
|
+
[key: string]: any;
|
|
365
|
+
};
|
|
366
|
+
validate(): void;
|
|
367
|
+
constructor(map?: {
|
|
368
|
+
[key: string]: any;
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
declare class GetMcpResourceResponseBodyData extends $dara.Model {
|
|
373
|
+
desktopInfo?: GetMcpResourceResponseBodyDataDesktopInfo;
|
|
374
|
+
resourceUrl?: string;
|
|
375
|
+
sessionId?: string;
|
|
376
|
+
static names(): {
|
|
377
|
+
[key: string]: string;
|
|
378
|
+
};
|
|
379
|
+
static types(): {
|
|
380
|
+
[key: string]: any;
|
|
381
|
+
};
|
|
382
|
+
validate(): void;
|
|
383
|
+
constructor(map?: {
|
|
384
|
+
[key: string]: any;
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
declare class ListContextsResponseBodyData extends $dara.Model {
|
|
389
|
+
createTime?: string;
|
|
390
|
+
id?: string;
|
|
391
|
+
lastUsedTime?: string;
|
|
392
|
+
name?: string;
|
|
393
|
+
osType?: string;
|
|
394
|
+
state?: string;
|
|
395
|
+
static names(): {
|
|
396
|
+
[key: string]: string;
|
|
397
|
+
};
|
|
398
|
+
static types(): {
|
|
399
|
+
[key: string]: any;
|
|
400
|
+
};
|
|
401
|
+
validate(): void;
|
|
402
|
+
constructor(map?: {
|
|
403
|
+
[key: string]: any;
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
declare class ListSessionResponseBodyData extends $dara.Model {
|
|
408
|
+
sessionId?: string;
|
|
409
|
+
static names(): {
|
|
410
|
+
[key: string]: string;
|
|
411
|
+
};
|
|
412
|
+
static types(): {
|
|
413
|
+
[key: string]: any;
|
|
414
|
+
};
|
|
415
|
+
validate(): void;
|
|
416
|
+
constructor(map?: {
|
|
417
|
+
[key: string]: any;
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
declare class CallMcpToolRequest extends $dara.Model {
|
|
422
|
+
args?: string;
|
|
423
|
+
authorization?: string;
|
|
424
|
+
externalUserId?: string;
|
|
425
|
+
imageId?: string;
|
|
426
|
+
name?: string;
|
|
427
|
+
server?: string;
|
|
428
|
+
sessionId?: string;
|
|
429
|
+
tool?: string;
|
|
430
|
+
static names(): {
|
|
431
|
+
[key: string]: string;
|
|
432
|
+
};
|
|
433
|
+
static types(): {
|
|
434
|
+
[key: string]: any;
|
|
435
|
+
};
|
|
436
|
+
validate(): void;
|
|
437
|
+
constructor(map?: {
|
|
438
|
+
[key: string]: any;
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
declare class CallMcpToolResponseBody extends $dara.Model {
|
|
443
|
+
code?: string;
|
|
444
|
+
data?: any;
|
|
445
|
+
httpStatusCode?: number;
|
|
446
|
+
message?: string;
|
|
447
|
+
requestId?: string;
|
|
448
|
+
success?: boolean;
|
|
449
|
+
static names(): {
|
|
450
|
+
[key: string]: string;
|
|
451
|
+
};
|
|
452
|
+
static types(): {
|
|
453
|
+
[key: string]: any;
|
|
454
|
+
};
|
|
455
|
+
validate(): void;
|
|
456
|
+
constructor(map?: {
|
|
457
|
+
[key: string]: any;
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
declare class CallMcpToolResponse extends $dara.Model {
|
|
462
|
+
headers?: {
|
|
463
|
+
[key: string]: string;
|
|
464
|
+
};
|
|
465
|
+
statusCode?: number;
|
|
466
|
+
body?: CallMcpToolResponseBody;
|
|
467
|
+
static names(): {
|
|
468
|
+
[key: string]: string;
|
|
469
|
+
};
|
|
470
|
+
static types(): {
|
|
471
|
+
[key: string]: any;
|
|
472
|
+
};
|
|
473
|
+
validate(): void;
|
|
474
|
+
constructor(map?: {
|
|
475
|
+
[key: string]: any;
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
declare class CreateMcpSessionRequest extends $dara.Model {
|
|
480
|
+
authorization?: string;
|
|
481
|
+
contextId?: string;
|
|
482
|
+
externalUserId?: string;
|
|
483
|
+
imageId?: string;
|
|
484
|
+
labels?: string;
|
|
485
|
+
sessionId?: 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 CreateMcpSessionResponseBody extends $dara.Model {
|
|
499
|
+
code?: string;
|
|
500
|
+
data?: CreateMcpSessionResponseBodyData;
|
|
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 CreateMcpSessionResponse extends $dara.Model {
|
|
518
|
+
headers?: {
|
|
519
|
+
[key: string]: string;
|
|
520
|
+
};
|
|
521
|
+
statusCode?: number;
|
|
522
|
+
body?: CreateMcpSessionResponseBody;
|
|
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
|
+
|
|
535
|
+
declare class DeleteContextRequest extends $dara.Model {
|
|
536
|
+
authorization?: string;
|
|
537
|
+
id?: string;
|
|
538
|
+
static names(): {
|
|
539
|
+
[key: string]: string;
|
|
540
|
+
};
|
|
541
|
+
static types(): {
|
|
542
|
+
[key: string]: any;
|
|
543
|
+
};
|
|
544
|
+
validate(): void;
|
|
545
|
+
constructor(map?: {
|
|
546
|
+
[key: string]: any;
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
declare class DeleteContextResponseBody extends $dara.Model {
|
|
551
|
+
code?: string;
|
|
552
|
+
httpStatusCode?: number;
|
|
553
|
+
message?: string;
|
|
554
|
+
requestId?: string;
|
|
555
|
+
success?: boolean;
|
|
556
|
+
static names(): {
|
|
557
|
+
[key: string]: string;
|
|
558
|
+
};
|
|
559
|
+
static types(): {
|
|
560
|
+
[key: string]: any;
|
|
561
|
+
};
|
|
562
|
+
validate(): void;
|
|
563
|
+
constructor(map?: {
|
|
564
|
+
[key: string]: any;
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
declare class DeleteContextResponse extends $dara.Model {
|
|
569
|
+
headers?: {
|
|
570
|
+
[key: string]: string;
|
|
571
|
+
};
|
|
572
|
+
statusCode?: number;
|
|
573
|
+
body?: DeleteContextResponseBody;
|
|
574
|
+
static names(): {
|
|
575
|
+
[key: string]: string;
|
|
576
|
+
};
|
|
577
|
+
static types(): {
|
|
578
|
+
[key: string]: any;
|
|
579
|
+
};
|
|
580
|
+
validate(): void;
|
|
581
|
+
constructor(map?: {
|
|
582
|
+
[key: string]: any;
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
declare class GetContextRequest extends $dara.Model {
|
|
587
|
+
allowCreate?: boolean;
|
|
588
|
+
authorization?: string;
|
|
589
|
+
name?: string;
|
|
590
|
+
static names(): {
|
|
591
|
+
[key: string]: string;
|
|
592
|
+
};
|
|
593
|
+
static types(): {
|
|
594
|
+
[key: string]: any;
|
|
595
|
+
};
|
|
596
|
+
validate(): void;
|
|
597
|
+
constructor(map?: {
|
|
598
|
+
[key: string]: any;
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
declare class GetContextResponseBody extends $dara.Model {
|
|
603
|
+
code?: string;
|
|
604
|
+
data?: GetContextResponseBodyData;
|
|
605
|
+
httpStatusCode?: number;
|
|
606
|
+
message?: string;
|
|
607
|
+
requestId?: string;
|
|
608
|
+
success?: boolean;
|
|
609
|
+
static names(): {
|
|
610
|
+
[key: string]: string;
|
|
611
|
+
};
|
|
612
|
+
static types(): {
|
|
613
|
+
[key: string]: any;
|
|
614
|
+
};
|
|
615
|
+
validate(): void;
|
|
616
|
+
constructor(map?: {
|
|
617
|
+
[key: string]: any;
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
declare class GetContextResponse extends $dara.Model {
|
|
622
|
+
headers?: {
|
|
623
|
+
[key: string]: string;
|
|
624
|
+
};
|
|
625
|
+
statusCode?: number;
|
|
626
|
+
body?: GetContextResponseBody;
|
|
627
|
+
static names(): {
|
|
628
|
+
[key: string]: string;
|
|
629
|
+
};
|
|
630
|
+
static types(): {
|
|
631
|
+
[key: string]: any;
|
|
632
|
+
};
|
|
633
|
+
validate(): void;
|
|
634
|
+
constructor(map?: {
|
|
635
|
+
[key: string]: any;
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
declare class GetLabelRequest extends $dara.Model {
|
|
640
|
+
authorization?: string;
|
|
641
|
+
maxResults?: number;
|
|
642
|
+
nextToken?: string;
|
|
643
|
+
sessionId?: string;
|
|
644
|
+
static names(): {
|
|
645
|
+
[key: string]: string;
|
|
646
|
+
};
|
|
647
|
+
static types(): {
|
|
648
|
+
[key: string]: any;
|
|
649
|
+
};
|
|
650
|
+
validate(): void;
|
|
651
|
+
constructor(map?: {
|
|
652
|
+
[key: string]: any;
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
declare class GetLabelResponseBody extends $dara.Model {
|
|
657
|
+
code?: string;
|
|
658
|
+
data?: GetLabelResponseBodyData;
|
|
659
|
+
httpStatusCode?: number;
|
|
660
|
+
maxResults?: number;
|
|
661
|
+
message?: string;
|
|
662
|
+
nextToken?: string;
|
|
663
|
+
requestId?: string;
|
|
664
|
+
success?: boolean;
|
|
665
|
+
totalCount?: number;
|
|
666
|
+
static names(): {
|
|
667
|
+
[key: string]: string;
|
|
668
|
+
};
|
|
669
|
+
static types(): {
|
|
670
|
+
[key: string]: any;
|
|
671
|
+
};
|
|
672
|
+
validate(): void;
|
|
673
|
+
constructor(map?: {
|
|
674
|
+
[key: string]: any;
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
declare class GetLabelResponse extends $dara.Model {
|
|
679
|
+
headers?: {
|
|
680
|
+
[key: string]: string;
|
|
681
|
+
};
|
|
682
|
+
statusCode?: number;
|
|
683
|
+
body?: GetLabelResponseBody;
|
|
684
|
+
static names(): {
|
|
685
|
+
[key: string]: string;
|
|
686
|
+
};
|
|
687
|
+
static types(): {
|
|
688
|
+
[key: string]: any;
|
|
689
|
+
};
|
|
690
|
+
validate(): void;
|
|
691
|
+
constructor(map?: {
|
|
692
|
+
[key: string]: any;
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
declare class GetLinkRequest extends $dara.Model {
|
|
697
|
+
authorization?: string;
|
|
698
|
+
sessionId?: string;
|
|
699
|
+
static names(): {
|
|
700
|
+
[key: string]: string;
|
|
701
|
+
};
|
|
702
|
+
static types(): {
|
|
703
|
+
[key: string]: any;
|
|
704
|
+
};
|
|
705
|
+
validate(): void;
|
|
706
|
+
constructor(map?: {
|
|
707
|
+
[key: string]: any;
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
declare class GetLinkResponseBody extends $dara.Model {
|
|
712
|
+
code?: string;
|
|
713
|
+
data?: string;
|
|
714
|
+
httpStatusCode?: number;
|
|
715
|
+
message?: string;
|
|
716
|
+
requestId?: string;
|
|
717
|
+
success?: boolean;
|
|
718
|
+
static names(): {
|
|
719
|
+
[key: string]: string;
|
|
720
|
+
};
|
|
721
|
+
static types(): {
|
|
722
|
+
[key: string]: any;
|
|
723
|
+
};
|
|
724
|
+
validate(): void;
|
|
725
|
+
constructor(map?: {
|
|
726
|
+
[key: string]: any;
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
declare class GetLinkResponse extends $dara.Model {
|
|
731
|
+
headers?: {
|
|
732
|
+
[key: string]: string;
|
|
733
|
+
};
|
|
734
|
+
statusCode?: number;
|
|
735
|
+
body?: GetLinkResponseBody;
|
|
736
|
+
static names(): {
|
|
737
|
+
[key: string]: string;
|
|
738
|
+
};
|
|
739
|
+
static types(): {
|
|
740
|
+
[key: string]: any;
|
|
741
|
+
};
|
|
742
|
+
validate(): void;
|
|
743
|
+
constructor(map?: {
|
|
744
|
+
[key: string]: any;
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
declare class GetMcpResourceRequest extends $dara.Model {
|
|
749
|
+
authorization?: string;
|
|
750
|
+
sessionId?: string;
|
|
751
|
+
static names(): {
|
|
752
|
+
[key: string]: string;
|
|
753
|
+
};
|
|
754
|
+
static types(): {
|
|
755
|
+
[key: string]: any;
|
|
756
|
+
};
|
|
757
|
+
validate(): void;
|
|
758
|
+
constructor(map?: {
|
|
759
|
+
[key: string]: any;
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
declare class GetMcpResourceResponseBody extends $dara.Model {
|
|
764
|
+
code?: string;
|
|
765
|
+
data?: GetMcpResourceResponseBodyData;
|
|
766
|
+
httpStatusCode?: number;
|
|
767
|
+
message?: string;
|
|
768
|
+
requestId?: string;
|
|
769
|
+
success?: boolean;
|
|
770
|
+
static names(): {
|
|
771
|
+
[key: string]: string;
|
|
772
|
+
};
|
|
773
|
+
static types(): {
|
|
774
|
+
[key: string]: any;
|
|
775
|
+
};
|
|
776
|
+
validate(): void;
|
|
777
|
+
constructor(map?: {
|
|
778
|
+
[key: string]: any;
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
declare class GetMcpResourceResponse extends $dara.Model {
|
|
783
|
+
headers?: {
|
|
784
|
+
[key: string]: string;
|
|
785
|
+
};
|
|
786
|
+
statusCode?: number;
|
|
787
|
+
body?: GetMcpResourceResponseBody;
|
|
788
|
+
static names(): {
|
|
789
|
+
[key: string]: string;
|
|
790
|
+
};
|
|
791
|
+
static types(): {
|
|
792
|
+
[key: string]: any;
|
|
793
|
+
};
|
|
794
|
+
validate(): void;
|
|
795
|
+
constructor(map?: {
|
|
796
|
+
[key: string]: any;
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
declare class ListContextsRequest extends $dara.Model {
|
|
801
|
+
authorization?: string;
|
|
802
|
+
maxResults?: number;
|
|
803
|
+
nextToken?: string;
|
|
804
|
+
static names(): {
|
|
805
|
+
[key: string]: string;
|
|
806
|
+
};
|
|
807
|
+
static types(): {
|
|
808
|
+
[key: string]: any;
|
|
809
|
+
};
|
|
810
|
+
validate(): void;
|
|
811
|
+
constructor(map?: {
|
|
812
|
+
[key: string]: any;
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
declare class ListContextsResponseBody extends $dara.Model {
|
|
817
|
+
code?: string;
|
|
818
|
+
data?: ListContextsResponseBodyData[];
|
|
819
|
+
httpStatusCode?: number;
|
|
820
|
+
maxResults?: number;
|
|
821
|
+
message?: string;
|
|
822
|
+
nextToken?: string;
|
|
823
|
+
requestId?: string;
|
|
824
|
+
success?: boolean;
|
|
825
|
+
totalCount?: number;
|
|
826
|
+
static names(): {
|
|
827
|
+
[key: string]: string;
|
|
828
|
+
};
|
|
829
|
+
static types(): {
|
|
830
|
+
[key: string]: any;
|
|
831
|
+
};
|
|
832
|
+
validate(): void;
|
|
833
|
+
constructor(map?: {
|
|
834
|
+
[key: string]: any;
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
declare class ListContextsResponse extends $dara.Model {
|
|
839
|
+
headers?: {
|
|
840
|
+
[key: string]: string;
|
|
841
|
+
};
|
|
842
|
+
statusCode?: number;
|
|
843
|
+
body?: ListContextsResponseBody;
|
|
844
|
+
static names(): {
|
|
845
|
+
[key: string]: string;
|
|
846
|
+
};
|
|
847
|
+
static types(): {
|
|
848
|
+
[key: string]: any;
|
|
849
|
+
};
|
|
850
|
+
validate(): void;
|
|
851
|
+
constructor(map?: {
|
|
852
|
+
[key: string]: any;
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
declare class ListSessionRequest extends $dara.Model {
|
|
857
|
+
authorization?: string;
|
|
858
|
+
labels?: string;
|
|
859
|
+
maxResults?: number;
|
|
860
|
+
nextToken?: string;
|
|
861
|
+
static names(): {
|
|
862
|
+
[key: string]: string;
|
|
863
|
+
};
|
|
864
|
+
static types(): {
|
|
865
|
+
[key: string]: any;
|
|
866
|
+
};
|
|
867
|
+
validate(): void;
|
|
868
|
+
constructor(map?: {
|
|
869
|
+
[key: string]: any;
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
declare class ListSessionResponseBody extends $dara.Model {
|
|
874
|
+
code?: string;
|
|
875
|
+
data?: ListSessionResponseBodyData[];
|
|
876
|
+
httpStatusCode?: number;
|
|
877
|
+
maxResults?: number;
|
|
878
|
+
message?: string;
|
|
879
|
+
nextToken?: string;
|
|
880
|
+
requestId?: string;
|
|
881
|
+
success?: boolean;
|
|
882
|
+
totalCount?: number;
|
|
883
|
+
static names(): {
|
|
884
|
+
[key: string]: string;
|
|
885
|
+
};
|
|
886
|
+
static types(): {
|
|
887
|
+
[key: string]: any;
|
|
888
|
+
};
|
|
889
|
+
validate(): void;
|
|
890
|
+
constructor(map?: {
|
|
891
|
+
[key: string]: any;
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
declare class ListSessionResponse extends $dara.Model {
|
|
896
|
+
headers?: {
|
|
897
|
+
[key: string]: string;
|
|
898
|
+
};
|
|
899
|
+
statusCode?: number;
|
|
900
|
+
body?: ListSessionResponseBody;
|
|
901
|
+
static names(): {
|
|
902
|
+
[key: string]: string;
|
|
903
|
+
};
|
|
904
|
+
static types(): {
|
|
905
|
+
[key: string]: any;
|
|
906
|
+
};
|
|
907
|
+
validate(): void;
|
|
908
|
+
constructor(map?: {
|
|
909
|
+
[key: string]: any;
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
declare class ModifyContextRequest extends $dara.Model {
|
|
914
|
+
authorization?: string;
|
|
915
|
+
id?: string;
|
|
916
|
+
name?: string;
|
|
917
|
+
static names(): {
|
|
918
|
+
[key: string]: string;
|
|
919
|
+
};
|
|
920
|
+
static types(): {
|
|
921
|
+
[key: string]: any;
|
|
922
|
+
};
|
|
923
|
+
validate(): void;
|
|
924
|
+
constructor(map?: {
|
|
925
|
+
[key: string]: any;
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
declare class ModifyContextResponseBody extends $dara.Model {
|
|
930
|
+
code?: string;
|
|
931
|
+
httpStatusCode?: number;
|
|
932
|
+
message?: string;
|
|
933
|
+
requestId?: string;
|
|
934
|
+
success?: boolean;
|
|
935
|
+
static names(): {
|
|
936
|
+
[key: string]: string;
|
|
937
|
+
};
|
|
938
|
+
static types(): {
|
|
939
|
+
[key: string]: any;
|
|
940
|
+
};
|
|
941
|
+
validate(): void;
|
|
942
|
+
constructor(map?: {
|
|
943
|
+
[key: string]: any;
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
declare class ModifyContextResponse extends $dara.Model {
|
|
948
|
+
headers?: {
|
|
949
|
+
[key: string]: string;
|
|
950
|
+
};
|
|
951
|
+
statusCode?: number;
|
|
952
|
+
body?: ModifyContextResponseBody;
|
|
953
|
+
static names(): {
|
|
954
|
+
[key: string]: string;
|
|
955
|
+
};
|
|
956
|
+
static types(): {
|
|
957
|
+
[key: string]: any;
|
|
958
|
+
};
|
|
959
|
+
validate(): void;
|
|
960
|
+
constructor(map?: {
|
|
961
|
+
[key: string]: any;
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
declare class ReleaseMcpSessionRequest extends $dara.Model {
|
|
966
|
+
authorization?: string;
|
|
967
|
+
sessionId?: string;
|
|
968
|
+
static names(): {
|
|
969
|
+
[key: string]: string;
|
|
970
|
+
};
|
|
971
|
+
static types(): {
|
|
972
|
+
[key: string]: any;
|
|
973
|
+
};
|
|
974
|
+
validate(): void;
|
|
975
|
+
constructor(map?: {
|
|
976
|
+
[key: string]: any;
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
declare class ReleaseMcpSessionResponseBody extends $dara.Model {
|
|
981
|
+
code?: string;
|
|
982
|
+
httpStatusCode?: number;
|
|
983
|
+
message?: string;
|
|
984
|
+
requestId?: string;
|
|
985
|
+
success?: boolean;
|
|
986
|
+
static names(): {
|
|
987
|
+
[key: string]: string;
|
|
988
|
+
};
|
|
989
|
+
static types(): {
|
|
990
|
+
[key: string]: any;
|
|
991
|
+
};
|
|
992
|
+
validate(): void;
|
|
993
|
+
constructor(map?: {
|
|
994
|
+
[key: string]: any;
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
declare class ReleaseMcpSessionResponse extends $dara.Model {
|
|
999
|
+
headers?: {
|
|
1000
|
+
[key: string]: string;
|
|
1001
|
+
};
|
|
1002
|
+
statusCode?: number;
|
|
1003
|
+
body?: ReleaseMcpSessionResponseBody;
|
|
1004
|
+
static names(): {
|
|
1005
|
+
[key: string]: string;
|
|
1006
|
+
};
|
|
1007
|
+
static types(): {
|
|
1008
|
+
[key: string]: any;
|
|
1009
|
+
};
|
|
1010
|
+
validate(): void;
|
|
1011
|
+
constructor(map?: {
|
|
1012
|
+
[key: string]: any;
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
declare class SetLabelRequest extends $dara.Model {
|
|
1017
|
+
authorization?: string;
|
|
1018
|
+
labels?: string;
|
|
1019
|
+
sessionId?: string;
|
|
1020
|
+
static names(): {
|
|
1021
|
+
[key: string]: string;
|
|
1022
|
+
};
|
|
1023
|
+
static types(): {
|
|
1024
|
+
[key: string]: any;
|
|
1025
|
+
};
|
|
1026
|
+
validate(): void;
|
|
1027
|
+
constructor(map?: {
|
|
1028
|
+
[key: string]: any;
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
declare class SetLabelResponseBody extends $dara.Model {
|
|
1033
|
+
code?: string;
|
|
1034
|
+
httpStatusCode?: number;
|
|
1035
|
+
message?: string;
|
|
1036
|
+
requestId?: string;
|
|
1037
|
+
success?: boolean;
|
|
1038
|
+
static names(): {
|
|
1039
|
+
[key: string]: string;
|
|
1040
|
+
};
|
|
1041
|
+
static types(): {
|
|
1042
|
+
[key: string]: any;
|
|
1043
|
+
};
|
|
1044
|
+
validate(): void;
|
|
1045
|
+
constructor(map?: {
|
|
1046
|
+
[key: string]: any;
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
declare class SetLabelResponse extends $dara.Model {
|
|
1051
|
+
headers?: {
|
|
1052
|
+
[key: string]: string;
|
|
1053
|
+
};
|
|
1054
|
+
statusCode?: number;
|
|
1055
|
+
body?: SetLabelResponseBody;
|
|
1056
|
+
static names(): {
|
|
1057
|
+
[key: string]: string;
|
|
1058
|
+
};
|
|
1059
|
+
static types(): {
|
|
1060
|
+
[key: string]: any;
|
|
1061
|
+
};
|
|
1062
|
+
validate(): void;
|
|
1063
|
+
constructor(map?: {
|
|
1064
|
+
[key: string]: any;
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
declare const OpenApi: typeof OpenApiDefault.default;
|
|
1069
|
+
|
|
1070
|
+
declare class Client extends OpenApi {
|
|
1071
|
+
constructor(config: $OpenApiUtil.Config);
|
|
1072
|
+
getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {
|
|
1073
|
+
[key: string]: string;
|
|
1074
|
+
}, endpoint: string): string;
|
|
1075
|
+
/**
|
|
1076
|
+
* 调用mcp工具
|
|
1077
|
+
*
|
|
1078
|
+
* @param request - CallMcpToolRequest
|
|
1079
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1080
|
+
* @returns CallMcpToolResponse
|
|
1081
|
+
*/
|
|
1082
|
+
callMcpToolWithOptions(request: CallMcpToolRequest, runtime: $dara.RuntimeOptions): Promise<CallMcpToolResponse>;
|
|
1083
|
+
/**
|
|
1084
|
+
* 调用mcp工具
|
|
1085
|
+
*
|
|
1086
|
+
* @param request - CallMcpToolRequest
|
|
1087
|
+
* @returns CallMcpToolResponse
|
|
1088
|
+
*/
|
|
1089
|
+
callMcpTool(request: CallMcpToolRequest): Promise<CallMcpToolResponse>;
|
|
1090
|
+
/**
|
|
1091
|
+
* 创建 mcp session
|
|
1092
|
+
*
|
|
1093
|
+
* @param request - CreateMcpSessionRequest
|
|
1094
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1095
|
+
* @returns CreateMcpSessionResponse
|
|
1096
|
+
*/
|
|
1097
|
+
createMcpSessionWithOptions(request: CreateMcpSessionRequest, runtime: $dara.RuntimeOptions): Promise<CreateMcpSessionResponse>;
|
|
1098
|
+
/**
|
|
1099
|
+
* 创建 mcp session
|
|
1100
|
+
*
|
|
1101
|
+
* @param request - CreateMcpSessionRequest
|
|
1102
|
+
* @returns CreateMcpSessionResponse
|
|
1103
|
+
*/
|
|
1104
|
+
createMcpSession(request: CreateMcpSessionRequest): Promise<CreateMcpSessionResponse>;
|
|
1105
|
+
/**
|
|
1106
|
+
* 删除持久化上下文
|
|
1107
|
+
*
|
|
1108
|
+
* @param request - DeleteContextRequest
|
|
1109
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1110
|
+
* @returns DeleteContextResponse
|
|
1111
|
+
*/
|
|
1112
|
+
deleteContextWithOptions(request: DeleteContextRequest, runtime: $dara.RuntimeOptions): Promise<DeleteContextResponse>;
|
|
1113
|
+
/**
|
|
1114
|
+
* 删除持久化上下文
|
|
1115
|
+
*
|
|
1116
|
+
* @param request - DeleteContextRequest
|
|
1117
|
+
* @returns DeleteContextResponse
|
|
1118
|
+
*/
|
|
1119
|
+
deleteContext(request: DeleteContextRequest): Promise<DeleteContextResponse>;
|
|
1120
|
+
/**
|
|
1121
|
+
* 获取上下文
|
|
1122
|
+
*
|
|
1123
|
+
* @param request - GetContextRequest
|
|
1124
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1125
|
+
* @returns GetContextResponse
|
|
1126
|
+
*/
|
|
1127
|
+
getContextWithOptions(request: GetContextRequest, runtime: $dara.RuntimeOptions): Promise<GetContextResponse>;
|
|
1128
|
+
/**
|
|
1129
|
+
* 获取上下文
|
|
1130
|
+
*
|
|
1131
|
+
* @param request - GetContextRequest
|
|
1132
|
+
* @returns GetContextResponse
|
|
1133
|
+
*/
|
|
1134
|
+
getContext(request: GetContextRequest): Promise<GetContextResponse>;
|
|
1135
|
+
/**
|
|
1136
|
+
* 获取标签
|
|
1137
|
+
*
|
|
1138
|
+
* @param request - GetLabelRequest
|
|
1139
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1140
|
+
* @returns GetLabelResponse
|
|
1141
|
+
*/
|
|
1142
|
+
getLabelWithOptions(request: GetLabelRequest, runtime: $dara.RuntimeOptions): Promise<GetLabelResponse>;
|
|
1143
|
+
/**
|
|
1144
|
+
* 获取标签
|
|
1145
|
+
*
|
|
1146
|
+
* @param request - GetLabelRequest
|
|
1147
|
+
* @returns GetLabelResponse
|
|
1148
|
+
*/
|
|
1149
|
+
getLabel(request: GetLabelRequest): Promise<GetLabelResponse>;
|
|
1150
|
+
/**
|
|
1151
|
+
* 获取特定端口的转发链接
|
|
1152
|
+
*
|
|
1153
|
+
* @param request - GetLinkRequest
|
|
1154
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1155
|
+
* @returns GetLinkResponse
|
|
1156
|
+
*/
|
|
1157
|
+
getLinkWithOptions(request: GetLinkRequest, runtime: $dara.RuntimeOptions): Promise<GetLinkResponse>;
|
|
1158
|
+
/**
|
|
1159
|
+
* 获取特定端口的转发链接
|
|
1160
|
+
*
|
|
1161
|
+
* @param request - GetLinkRequest
|
|
1162
|
+
* @returns GetLinkResponse
|
|
1163
|
+
*/
|
|
1164
|
+
getLink(request: GetLinkRequest): Promise<GetLinkResponse>;
|
|
1165
|
+
/**
|
|
1166
|
+
* 获取mcp资源信息
|
|
1167
|
+
*
|
|
1168
|
+
* @param request - GetMcpResourceRequest
|
|
1169
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1170
|
+
* @returns GetMcpResourceResponse
|
|
1171
|
+
*/
|
|
1172
|
+
getMcpResourceWithOptions(request: GetMcpResourceRequest, runtime: $dara.RuntimeOptions): Promise<GetMcpResourceResponse>;
|
|
1173
|
+
/**
|
|
1174
|
+
* 获取mcp资源信息
|
|
1175
|
+
*
|
|
1176
|
+
* @param request - GetMcpResourceRequest
|
|
1177
|
+
* @returns GetMcpResourceResponse
|
|
1178
|
+
*/
|
|
1179
|
+
getMcpResource(request: GetMcpResourceRequest): Promise<GetMcpResourceResponse>;
|
|
1180
|
+
/**
|
|
1181
|
+
* 获取上下文列表
|
|
1182
|
+
*
|
|
1183
|
+
* @param request - ListContextsRequest
|
|
1184
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1185
|
+
* @returns ListContextsResponse
|
|
1186
|
+
*/
|
|
1187
|
+
listContextsWithOptions(request: ListContextsRequest, runtime: $dara.RuntimeOptions): Promise<ListContextsResponse>;
|
|
1188
|
+
/**
|
|
1189
|
+
* 获取上下文列表
|
|
1190
|
+
*
|
|
1191
|
+
* @param request - ListContextsRequest
|
|
1192
|
+
* @returns ListContextsResponse
|
|
1193
|
+
*/
|
|
1194
|
+
listContexts(request: ListContextsRequest): Promise<ListContextsResponse>;
|
|
1195
|
+
/**
|
|
1196
|
+
* 根据Lable查询Session列表
|
|
1197
|
+
*
|
|
1198
|
+
* @param request - ListSessionRequest
|
|
1199
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1200
|
+
* @returns ListSessionResponse
|
|
1201
|
+
*/
|
|
1202
|
+
listSessionWithOptions(request: ListSessionRequest, runtime: $dara.RuntimeOptions): Promise<ListSessionResponse>;
|
|
1203
|
+
/**
|
|
1204
|
+
* 根据Lable查询Session列表
|
|
1205
|
+
*
|
|
1206
|
+
* @param request - ListSessionRequest
|
|
1207
|
+
* @returns ListSessionResponse
|
|
1208
|
+
*/
|
|
1209
|
+
listSession(request: ListSessionRequest): Promise<ListSessionResponse>;
|
|
1210
|
+
/**
|
|
1211
|
+
* 修改上下文
|
|
1212
|
+
*
|
|
1213
|
+
* @param request - ModifyContextRequest
|
|
1214
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1215
|
+
* @returns ModifyContextResponse
|
|
1216
|
+
*/
|
|
1217
|
+
modifyContextWithOptions(request: ModifyContextRequest, runtime: $dara.RuntimeOptions): Promise<ModifyContextResponse>;
|
|
1218
|
+
/**
|
|
1219
|
+
* 修改上下文
|
|
1220
|
+
*
|
|
1221
|
+
* @param request - ModifyContextRequest
|
|
1222
|
+
* @returns ModifyContextResponse
|
|
1223
|
+
*/
|
|
1224
|
+
modifyContext(request: ModifyContextRequest): Promise<ModifyContextResponse>;
|
|
1225
|
+
/**
|
|
1226
|
+
* 释放 mcp session
|
|
1227
|
+
*
|
|
1228
|
+
* @param request - ReleaseMcpSessionRequest
|
|
1229
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1230
|
+
* @returns ReleaseMcpSessionResponse
|
|
1231
|
+
*/
|
|
1232
|
+
releaseMcpSessionWithOptions(request: ReleaseMcpSessionRequest, runtime: $dara.RuntimeOptions): Promise<ReleaseMcpSessionResponse>;
|
|
1233
|
+
/**
|
|
1234
|
+
* 释放 mcp session
|
|
1235
|
+
*
|
|
1236
|
+
* @param request - ReleaseMcpSessionRequest
|
|
1237
|
+
* @returns ReleaseMcpSessionResponse
|
|
1238
|
+
*/
|
|
1239
|
+
releaseMcpSession(request: ReleaseMcpSessionRequest): Promise<ReleaseMcpSessionResponse>;
|
|
1240
|
+
/**
|
|
1241
|
+
* 设置标签
|
|
1242
|
+
*
|
|
1243
|
+
* @param request - SetLabelRequest
|
|
1244
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1245
|
+
* @returns SetLabelResponse
|
|
1246
|
+
*/
|
|
1247
|
+
setLabelWithOptions(request: SetLabelRequest, runtime: $dara.RuntimeOptions): Promise<SetLabelResponse>;
|
|
1248
|
+
/**
|
|
1249
|
+
* 设置标签
|
|
1250
|
+
*
|
|
1251
|
+
* @param request - SetLabelRequest
|
|
1252
|
+
* @returns SetLabelResponse
|
|
1253
|
+
*/
|
|
1254
|
+
setLabel(request: SetLabelRequest): Promise<SetLabelResponse>;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* Represents an installed application.
|
|
1259
|
+
*/
|
|
1260
|
+
interface InstalledApp {
|
|
1261
|
+
name: string;
|
|
1262
|
+
start_cmd: string;
|
|
1263
|
+
stop_cmd?: string;
|
|
1264
|
+
work_directory?: string;
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* Represents a running process.
|
|
1268
|
+
*/
|
|
1269
|
+
interface Process {
|
|
1270
|
+
pname: string;
|
|
1271
|
+
pid: number;
|
|
1272
|
+
cmdline?: string;
|
|
1273
|
+
path?: string;
|
|
1274
|
+
}
|
|
1275
|
+
/**
|
|
1276
|
+
* Handles application management operations in the AgentBay cloud environment.
|
|
1277
|
+
*/
|
|
1278
|
+
declare class Application {
|
|
1279
|
+
private session;
|
|
1280
|
+
/**
|
|
1281
|
+
* Creates a new Application instance.
|
|
1282
|
+
* @param session The session object that provides access to the AgentBay API.
|
|
1283
|
+
*/
|
|
1284
|
+
constructor(session: {
|
|
1285
|
+
getAPIKey(): string;
|
|
1286
|
+
getClient(): Client;
|
|
1287
|
+
getSessionId(): string;
|
|
1288
|
+
});
|
|
1289
|
+
/**
|
|
1290
|
+
* Helper method to call MCP tools and handle common response processing
|
|
1291
|
+
*
|
|
1292
|
+
* @param toolName - Name of the MCP tool to call
|
|
1293
|
+
* @param args - Arguments to pass to the tool
|
|
1294
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
1295
|
+
* @returns A CallMcpToolResult with the response data
|
|
1296
|
+
* @throws APIError if the call fails
|
|
1297
|
+
*/
|
|
1298
|
+
private callMcpTool;
|
|
1299
|
+
/**
|
|
1300
|
+
* Helper method to parse JSON string into objects
|
|
1301
|
+
*/
|
|
1302
|
+
private parseJSON;
|
|
1303
|
+
/**
|
|
1304
|
+
* Retrieves a list of installed applications.
|
|
1305
|
+
* @param startMenu Whether to include applications from the start menu. Defaults to true.
|
|
1306
|
+
* @param desktop Whether to include applications from the desktop. Defaults to true.
|
|
1307
|
+
* @param ignoreSystemApps Whether to ignore system applications. Defaults to true.
|
|
1308
|
+
* @returns Array of InstalledApp objects
|
|
1309
|
+
* @throws Error if the operation fails.
|
|
1310
|
+
*/
|
|
1311
|
+
getInstalledApps(startMenu?: boolean, desktop?: boolean, ignoreSystemApps?: boolean): Promise<InstalledApp[]>;
|
|
1312
|
+
/**
|
|
1313
|
+
* Starts an application with the given command and optional working directory.
|
|
1314
|
+
* @param startCmd The command to start the application.
|
|
1315
|
+
* @param workDirectory The working directory for the application. Defaults to an empty string.
|
|
1316
|
+
* @returns Array of Process objects representing the started processes
|
|
1317
|
+
* @throws Error if the operation fails.
|
|
1318
|
+
*/
|
|
1319
|
+
startApp(startCmd: string, workDirectory?: string): Promise<Process[]>;
|
|
1320
|
+
/**
|
|
1321
|
+
* Stops an application by process name.
|
|
1322
|
+
* @param pname The name of the process to stop.
|
|
1323
|
+
* @throws Error if the operation fails.
|
|
1324
|
+
*/
|
|
1325
|
+
stopAppByPName(pname: string): Promise<void>;
|
|
1326
|
+
/**
|
|
1327
|
+
* Stops an application by process ID.
|
|
1328
|
+
* @param pid The ID of the process to stop.
|
|
1329
|
+
* @throws Error if the operation fails.
|
|
1330
|
+
*/
|
|
1331
|
+
stopAppByPID(pid: number): Promise<void>;
|
|
1332
|
+
/**
|
|
1333
|
+
* Stops an application by stop command.
|
|
1334
|
+
* @param stopCmd The command to stop the application.
|
|
1335
|
+
* @throws Error if the operation fails.
|
|
1336
|
+
*/
|
|
1337
|
+
stopAppByCmd(stopCmd: string): Promise<void>;
|
|
1338
|
+
/**
|
|
1339
|
+
* Lists all currently visible applications.
|
|
1340
|
+
* @returns Array of Process objects representing the visible processes
|
|
1341
|
+
* @throws Error if the operation fails.
|
|
1342
|
+
*/
|
|
1343
|
+
listVisibleApps(): Promise<Process[]>;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
/**
|
|
1347
|
+
* Represents a window in the system.
|
|
1348
|
+
*/
|
|
1349
|
+
interface Window {
|
|
1350
|
+
window_id: number;
|
|
1351
|
+
title: string;
|
|
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[];
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Handles window management operations in the AgentBay cloud environment.
|
|
1362
|
+
*/
|
|
1363
|
+
declare class WindowManager {
|
|
1364
|
+
private session;
|
|
1365
|
+
/**
|
|
1366
|
+
* Creates a new WindowManager instance.
|
|
1367
|
+
* @param session The session object that provides access to the AgentBay API.
|
|
1368
|
+
*/
|
|
1369
|
+
constructor(session: {
|
|
1370
|
+
getAPIKey(): string;
|
|
1371
|
+
getClient(): any;
|
|
1372
|
+
getSessionId(): string;
|
|
1373
|
+
});
|
|
1374
|
+
/**
|
|
1375
|
+
* Helper method to call MCP tools and handle common response processing
|
|
1376
|
+
*
|
|
1377
|
+
* @param toolName - Name of the MCP tool to call
|
|
1378
|
+
* @param args - Arguments to pass to the tool
|
|
1379
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
1380
|
+
* @returns A CallMcpToolResult with the response data
|
|
1381
|
+
* @throws APIError if the call fails
|
|
1382
|
+
*/
|
|
1383
|
+
private callMcpTool;
|
|
1384
|
+
/**
|
|
1385
|
+
* Helper method to parse JSON string into Window objects
|
|
1386
|
+
* @param jsonStr - JSON string to parse
|
|
1387
|
+
* @returns Array of Window objects or single Window object
|
|
1388
|
+
*/
|
|
1389
|
+
private parseWindowsFromJSON;
|
|
1390
|
+
/**
|
|
1391
|
+
* Lists all root windows in the system.
|
|
1392
|
+
* @returns Array of Window objects
|
|
1393
|
+
* @throws Error if the operation fails.
|
|
1394
|
+
*/
|
|
1395
|
+
listRootWindows(): Promise<Window[]>;
|
|
1396
|
+
/**
|
|
1397
|
+
* Gets the currently active window.
|
|
1398
|
+
* @returns Window object or null if no active window
|
|
1399
|
+
* @throws Error if the operation fails.
|
|
1400
|
+
*/
|
|
1401
|
+
getActiveWindow(): Promise<Window | null>;
|
|
1402
|
+
/**
|
|
1403
|
+
* Activates a window by ID.
|
|
1404
|
+
* @param windowId The ID of the window to activate.
|
|
1405
|
+
* @throws Error if the operation fails.
|
|
1406
|
+
*/
|
|
1407
|
+
activateWindow(windowId: number): Promise<void>;
|
|
1408
|
+
/**
|
|
1409
|
+
* Maximizes a window by ID.
|
|
1410
|
+
* @param windowId The ID of the window to maximize.
|
|
1411
|
+
* @throws Error if the operation fails.
|
|
1412
|
+
*/
|
|
1413
|
+
maximizeWindow(windowId: number): Promise<void>;
|
|
1414
|
+
/**
|
|
1415
|
+
* Minimizes a window by ID.
|
|
1416
|
+
* @param windowId The ID of the window to minimize.
|
|
1417
|
+
* @throws Error if the operation fails.
|
|
1418
|
+
*/
|
|
1419
|
+
minimizeWindow(windowId: number): Promise<void>;
|
|
1420
|
+
/**
|
|
1421
|
+
* Restores a window by ID.
|
|
1422
|
+
* @param windowId The ID of the window to restore.
|
|
1423
|
+
* @throws Error if the operation fails.
|
|
1424
|
+
*/
|
|
1425
|
+
restoreWindow(windowId: number): Promise<void>;
|
|
1426
|
+
/**
|
|
1427
|
+
* Closes a window by ID.
|
|
1428
|
+
* @param windowId The ID of the window to close.
|
|
1429
|
+
* @throws Error if the operation fails.
|
|
1430
|
+
*/
|
|
1431
|
+
closeWindow(windowId: number): Promise<void>;
|
|
1432
|
+
/**
|
|
1433
|
+
* Sets a window to fullscreen by ID.
|
|
1434
|
+
* @param windowId The ID of the window to set to fullscreen.
|
|
1435
|
+
* @throws Error if the operation fails.
|
|
1436
|
+
*/
|
|
1437
|
+
fullscreenWindow(windowId: number): Promise<void>;
|
|
1438
|
+
/**
|
|
1439
|
+
* Resizes a window by ID.
|
|
1440
|
+
* @param windowId The ID of the window to resize.
|
|
1441
|
+
* @param width The new width of the window.
|
|
1442
|
+
* @param height The new height of the window.
|
|
1443
|
+
* @throws Error if the operation fails.
|
|
1444
|
+
*/
|
|
1445
|
+
resizeWindow(windowId: number, width: number, height: number): Promise<void>;
|
|
1446
|
+
/**
|
|
1447
|
+
* Enables or disables focus mode.
|
|
1448
|
+
* @param on Whether to enable focus mode.
|
|
1449
|
+
* @throws Error if the operation fails.
|
|
1450
|
+
*/
|
|
1451
|
+
focusMode(on: boolean): Promise<void>;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
/**
|
|
1455
|
+
* Interface representing a UI element in the UI hierarchy
|
|
1456
|
+
*/
|
|
1457
|
+
interface UIElement {
|
|
1458
|
+
bounds: string;
|
|
1459
|
+
className: string;
|
|
1460
|
+
text: string;
|
|
1461
|
+
type: string;
|
|
1462
|
+
resourceId: string;
|
|
1463
|
+
index: number;
|
|
1464
|
+
isParent: boolean;
|
|
1465
|
+
children?: UIElement[];
|
|
1466
|
+
}
|
|
1467
|
+
/**
|
|
1468
|
+
* KeyCode constants for mobile device input
|
|
1469
|
+
*/
|
|
1470
|
+
declare const KeyCode: {
|
|
1471
|
+
HOME: number;
|
|
1472
|
+
BACK: number;
|
|
1473
|
+
VOLUME_UP: number;
|
|
1474
|
+
VOLUME_DOWN: number;
|
|
1475
|
+
POWER: number;
|
|
1476
|
+
MENU: number;
|
|
1477
|
+
};
|
|
1478
|
+
/**
|
|
1479
|
+
* UI handles UI operations in the AgentBay cloud environment.
|
|
1480
|
+
*/
|
|
1481
|
+
declare class UI {
|
|
1482
|
+
private session;
|
|
1483
|
+
/**
|
|
1484
|
+
* Initialize a UI object.
|
|
1485
|
+
*
|
|
1486
|
+
* @param session - The Session instance that this UI belongs to.
|
|
1487
|
+
*/
|
|
1488
|
+
constructor(session: Session);
|
|
1489
|
+
/**
|
|
1490
|
+
* Helper method to call MCP tools and handle common response processing
|
|
1491
|
+
*
|
|
1492
|
+
* @param toolName - Name of the MCP tool to call
|
|
1493
|
+
* @param args - Arguments to pass to the tool
|
|
1494
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
1495
|
+
* @returns A CallMcpToolResult with the response data
|
|
1496
|
+
* @throws APIError if the call fails
|
|
1497
|
+
*/
|
|
1498
|
+
private callMcpTool;
|
|
1499
|
+
/**
|
|
1500
|
+
* Retrieves all clickable UI elements within the specified timeout.
|
|
1501
|
+
*
|
|
1502
|
+
* @param timeoutMs - The timeout in milliseconds. Default is 2000ms.
|
|
1503
|
+
* @returns An array of UIElement objects
|
|
1504
|
+
* @throws Error if the operation fails.
|
|
1505
|
+
*/
|
|
1506
|
+
getClickableUIElements(timeoutMs?: number): Promise<UIElement[]>;
|
|
1507
|
+
/**
|
|
1508
|
+
* Retrieves all UI elements within the specified timeout.
|
|
1509
|
+
*
|
|
1510
|
+
* @param timeoutMs - The timeout in milliseconds. Default is 2000ms.
|
|
1511
|
+
* @returns An array of UIElement objects
|
|
1512
|
+
* @throws Error if the operation fails.
|
|
1513
|
+
*/
|
|
1514
|
+
getAllUIElements(timeoutMs?: number): Promise<UIElement[]>;
|
|
1515
|
+
/**
|
|
1516
|
+
* Sends a key press event.
|
|
1517
|
+
*
|
|
1518
|
+
* @param key - The key code to send.
|
|
1519
|
+
* @returns The extracted text content from the API response
|
|
1520
|
+
* @throws Error if the operation fails.
|
|
1521
|
+
*/
|
|
1522
|
+
sendKey(key: number): Promise<string>;
|
|
1523
|
+
/**
|
|
1524
|
+
* Inputs text into the active field.
|
|
1525
|
+
*
|
|
1526
|
+
* @param text - The text to input.
|
|
1527
|
+
* @returns The extracted text content from the API response
|
|
1528
|
+
* @throws Error if the operation fails.
|
|
1529
|
+
*/
|
|
1530
|
+
inputText(text: string): Promise<string>;
|
|
1531
|
+
/**
|
|
1532
|
+
* Performs a swipe gesture on the screen.
|
|
1533
|
+
*
|
|
1534
|
+
* @param startX - The starting X coordinate.
|
|
1535
|
+
* @param startY - The starting Y coordinate.
|
|
1536
|
+
* @param endX - The ending X coordinate.
|
|
1537
|
+
* @param endY - The ending Y coordinate.
|
|
1538
|
+
* @param durationMs - The duration of the swipe in milliseconds. Default is 300ms.
|
|
1539
|
+
* @returns The extracted text content from the API response
|
|
1540
|
+
* @throws Error if the operation fails.
|
|
1541
|
+
*/
|
|
1542
|
+
swipe(startX: number, startY: number, endX: number, endY: number, durationMs?: number): Promise<string>;
|
|
1543
|
+
/**
|
|
1544
|
+
* Performs a click at the specified coordinates.
|
|
1545
|
+
*
|
|
1546
|
+
* @param x - The X coordinate.
|
|
1547
|
+
* @param y - The Y coordinate.
|
|
1548
|
+
* @param button - The mouse button to click. Default is 'left'.
|
|
1549
|
+
* @returns The extracted text content from the API response
|
|
1550
|
+
* @throws Error if the operation fails.
|
|
1551
|
+
*/
|
|
1552
|
+
click(x: number, y: number, button?: string): Promise<string>;
|
|
1553
|
+
/**
|
|
1554
|
+
* Takes a screenshot of the current screen.
|
|
1555
|
+
*
|
|
1556
|
+
* @returns The extracted text content from the API response (usually a base64-encoded image)
|
|
1557
|
+
* @throws Error if the operation fails.
|
|
1558
|
+
*/
|
|
1559
|
+
screenshot(): Promise<string>;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* Contains information about a session.
|
|
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.
|
|
1576
|
+
*/
|
|
1577
|
+
declare class Session {
|
|
1578
|
+
private agentBay;
|
|
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;
|
|
1588
|
+
/**
|
|
1589
|
+
* Initialize a Session object.
|
|
1590
|
+
*
|
|
1591
|
+
* @param agentBay - The AgentBay instance that created this session.
|
|
1592
|
+
* @param sessionId - The ID of this session.
|
|
1593
|
+
*/
|
|
1594
|
+
constructor(agentBay: AgentBay, sessionId: string);
|
|
1595
|
+
/**
|
|
1596
|
+
* Get information about this session.
|
|
1597
|
+
*
|
|
1598
|
+
* @returns Session information.
|
|
1599
|
+
*/
|
|
1600
|
+
/**
|
|
1601
|
+
* Delete this session.
|
|
1602
|
+
*
|
|
1603
|
+
* @returns True if the session was successfully deleted.
|
|
1604
|
+
*/
|
|
1605
|
+
delete(): Promise<boolean>;
|
|
1606
|
+
/**
|
|
1607
|
+
* Sets the labels for this session.
|
|
1608
|
+
*
|
|
1609
|
+
* @param labels - The labels to set for the session.
|
|
1610
|
+
* @throws APIError if the operation fails.
|
|
1611
|
+
*/
|
|
1612
|
+
setLabels(labels: Record<string, string>): Promise<void>;
|
|
1613
|
+
/**
|
|
1614
|
+
* Gets the labels for this session.
|
|
1615
|
+
*
|
|
1616
|
+
* @returns The labels for the session.
|
|
1617
|
+
* @throws APIError if the operation fails.
|
|
1618
|
+
*/
|
|
1619
|
+
getLabels(): Promise<Record<string, string>>;
|
|
1620
|
+
/**
|
|
1621
|
+
* Get the API key.
|
|
1622
|
+
*
|
|
1623
|
+
* @returns The API key.
|
|
1624
|
+
*/
|
|
1625
|
+
getAPIKey(): string;
|
|
1626
|
+
/**
|
|
1627
|
+
* Get the client.
|
|
1628
|
+
*
|
|
1629
|
+
* @returns The client.
|
|
1630
|
+
*/
|
|
1631
|
+
getClient(): Client;
|
|
1632
|
+
/**
|
|
1633
|
+
* Get the session ID.
|
|
1634
|
+
*
|
|
1635
|
+
* @returns The session ID.
|
|
1636
|
+
*/
|
|
1637
|
+
getSessionId(): string;
|
|
1638
|
+
/**
|
|
1639
|
+
* Gets information about this session.
|
|
1640
|
+
*
|
|
1641
|
+
* @returns Information about the session.
|
|
1642
|
+
* @throws APIError if the operation fails.
|
|
1643
|
+
*/
|
|
1644
|
+
info(): Promise<SessionInfo>;
|
|
1645
|
+
/**
|
|
1646
|
+
* Gets the link for this session.
|
|
1647
|
+
*
|
|
1648
|
+
* @returns The link for the session.
|
|
1649
|
+
* @throws APIError if the operation fails.
|
|
1650
|
+
*/
|
|
1651
|
+
getLink(): Promise<string>;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
/**
|
|
1655
|
+
* Represents a persistent storage context in the AgentBay cloud environment.
|
|
1656
|
+
*/
|
|
1657
|
+
declare class Context {
|
|
1658
|
+
/**
|
|
1659
|
+
* The unique identifier of the context.
|
|
1660
|
+
*/
|
|
1661
|
+
id: string;
|
|
1662
|
+
/**
|
|
1663
|
+
* The name of the context.
|
|
1664
|
+
*/
|
|
1665
|
+
name: string;
|
|
1666
|
+
/**
|
|
1667
|
+
* The current state of the context (e.g., "available", "in-use").
|
|
1668
|
+
*/
|
|
1669
|
+
state: string;
|
|
1670
|
+
/**
|
|
1671
|
+
* Date and time when the Context was created.
|
|
1672
|
+
*/
|
|
1673
|
+
createdAt?: string;
|
|
1674
|
+
/**
|
|
1675
|
+
* Date and time when the Context was last used.
|
|
1676
|
+
*/
|
|
1677
|
+
lastUsedAt?: string;
|
|
1678
|
+
/**
|
|
1679
|
+
* The operating system type this context is bound to.
|
|
1680
|
+
*/
|
|
1681
|
+
osType?: string;
|
|
1682
|
+
/**
|
|
1683
|
+
* Initialize a Context object.
|
|
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.
|
|
1691
|
+
*/
|
|
1692
|
+
constructor(id: string, name: string, state?: string, createdAt?: string, lastUsedAt?: string, osType?: string);
|
|
1693
|
+
}
|
|
1694
|
+
/**
|
|
1695
|
+
* Provides methods to manage persistent contexts in the AgentBay cloud environment.
|
|
1696
|
+
*/
|
|
1697
|
+
declare class ContextService {
|
|
1698
|
+
private agentBay;
|
|
1699
|
+
/**
|
|
1700
|
+
* Initialize the ContextService.
|
|
1701
|
+
*
|
|
1702
|
+
* @param agentBay - The AgentBay instance.
|
|
1703
|
+
*/
|
|
1704
|
+
constructor(agentBay: AgentBay);
|
|
1705
|
+
/**
|
|
1706
|
+
* Lists all available contexts.
|
|
1707
|
+
*
|
|
1708
|
+
* @returns A list of Context objects.
|
|
1709
|
+
*/
|
|
1710
|
+
list(): Promise<Context[]>;
|
|
1711
|
+
/**
|
|
1712
|
+
* Gets a context by name. Optionally creates it if it doesn't exist.
|
|
1713
|
+
*
|
|
1714
|
+
* @param name - The name of the context to get.
|
|
1715
|
+
* @param create - Whether to create the context if it doesn't exist.
|
|
1716
|
+
* @returns The Context object if found or created, null if not found and create is false.
|
|
1717
|
+
*/
|
|
1718
|
+
get(name: string, create?: boolean): Promise<Context | null>;
|
|
1719
|
+
/**
|
|
1720
|
+
* Creates a new context with the given name.
|
|
1721
|
+
*
|
|
1722
|
+
* @param name - The name for the new context.
|
|
1723
|
+
* @returns The created Context object.
|
|
1724
|
+
*/
|
|
1725
|
+
create(name: string): Promise<Context>;
|
|
1726
|
+
/**
|
|
1727
|
+
* Updates the specified context.
|
|
1728
|
+
*
|
|
1729
|
+
* @param context - The Context object to update.
|
|
1730
|
+
* @returns The updated Context object.
|
|
1731
|
+
*/
|
|
1732
|
+
update(context: Context): Promise<Context>;
|
|
1733
|
+
/**
|
|
1734
|
+
* Deletes the specified context.
|
|
1735
|
+
*
|
|
1736
|
+
* @param context - The Context object to delete.
|
|
1737
|
+
*/
|
|
1738
|
+
delete(context: Context): Promise<void>;
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* Main class for interacting with the AgentBay cloud runtime environment.
|
|
1743
|
+
*/
|
|
1744
|
+
declare class AgentBay {
|
|
1745
|
+
private apiKey;
|
|
1746
|
+
private client;
|
|
1747
|
+
private regionId;
|
|
1748
|
+
private endpoint;
|
|
1749
|
+
private sessions;
|
|
1750
|
+
/**
|
|
1751
|
+
* Context service for managing persistent contexts.
|
|
1752
|
+
*/
|
|
1753
|
+
context: ContextService;
|
|
1754
|
+
/**
|
|
1755
|
+
* Initialize the AgentBay client.
|
|
1756
|
+
*
|
|
1757
|
+
* @param options - Configuration options
|
|
1758
|
+
* @param options.apiKey - API key for authentication. If not provided, will look for AGENTBAY_API_KEY environment variable.
|
|
1759
|
+
*/
|
|
1760
|
+
constructor(options?: {
|
|
1761
|
+
apiKey?: string;
|
|
1762
|
+
});
|
|
1763
|
+
/**
|
|
1764
|
+
* Create a new session in the AgentBay cloud environment.
|
|
1765
|
+
*
|
|
1766
|
+
* @param options - Optional parameters for creating the session
|
|
1767
|
+
* @param options.contextId - ID of the context to bind to the session
|
|
1768
|
+
* @param options.labels - Custom labels for the session
|
|
1769
|
+
* @returns A new Session object.
|
|
1770
|
+
*/
|
|
1771
|
+
create(options?: {
|
|
1772
|
+
contextId?: string;
|
|
1773
|
+
labels?: Record<string, string>;
|
|
1774
|
+
imageId?: string;
|
|
1775
|
+
}): Promise<Session>;
|
|
1776
|
+
/**
|
|
1777
|
+
* List all available sessions.
|
|
1778
|
+
*
|
|
1779
|
+
* @returns A list of session objects.
|
|
1780
|
+
*/
|
|
1781
|
+
list(): Session[];
|
|
1782
|
+
/**
|
|
1783
|
+
* List sessions filtered by the provided labels.
|
|
1784
|
+
* It returns sessions that match all the specified labels.
|
|
1785
|
+
*
|
|
1786
|
+
* @param labels - The labels to filter by.
|
|
1787
|
+
* @returns A list of session objects that match the labels.
|
|
1788
|
+
*/
|
|
1789
|
+
listByLabels(labels: Record<string, string>): Promise<Session[]>;
|
|
1790
|
+
/**
|
|
1791
|
+
* Delete a session by ID.
|
|
1792
|
+
*
|
|
1793
|
+
* @param sessionId - The ID of the session to delete.
|
|
1794
|
+
* @returns True if the session was successfully deleted.
|
|
1795
|
+
*/
|
|
1796
|
+
delete(session: Session): Promise<boolean>;
|
|
1797
|
+
/**
|
|
1798
|
+
*
|
|
1799
|
+
* @param sessionId - The ID of the session to remove.
|
|
1800
|
+
*/
|
|
1801
|
+
removeSession(sessionId: string): void;
|
|
1802
|
+
getClient(): Client;
|
|
1803
|
+
getAPIKey(): string;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
/**
|
|
1807
|
+
* Base exception for all AgentBay errors.
|
|
1808
|
+
*/
|
|
1809
|
+
declare class AgentBayError extends Error {
|
|
1810
|
+
constructor(message: string);
|
|
1811
|
+
}
|
|
1812
|
+
/**
|
|
1813
|
+
* Raised when there is an authentication error.
|
|
1814
|
+
*/
|
|
1815
|
+
declare class AuthenticationError extends AgentBayError {
|
|
1816
|
+
constructor(message: string);
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* Raised when there is an error with the API.
|
|
1820
|
+
*/
|
|
1821
|
+
declare class APIError extends AgentBayError {
|
|
1822
|
+
constructor(message: string);
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* Raised when there is an error with file operations.
|
|
1826
|
+
*/
|
|
1827
|
+
declare class FileError extends AgentBayError {
|
|
1828
|
+
constructor(message: string);
|
|
1829
|
+
}
|
|
1830
|
+
/**
|
|
1831
|
+
* Raised when there is an error with command execution.
|
|
1832
|
+
*/
|
|
1833
|
+
declare class CommandError extends AgentBayError {
|
|
1834
|
+
constructor(message: string);
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
export { APIError, AgentBay, AgentBayError, Application, AuthenticationError, CallMcpToolRequest, CallMcpToolResponse, CallMcpToolResponseBody, Client, type CodeExecutionResult, Command, CommandError, type CommandResult, Context, ContextService, CreateMcpSessionRequest, CreateMcpSessionResponse, CreateMcpSessionResponseBody, CreateMcpSessionResponseBodyData, DeleteContextRequest, DeleteContextResponse, DeleteContextResponseBody, type DirectoryEntry, FileError, type FileInfo, FileSystem, GetContextRequest, GetContextResponse, GetContextResponseBody, GetContextResponseBodyData, GetLabelRequest, GetLabelResponse, GetLabelResponseBody, GetLabelResponseBodyData, GetLinkRequest, GetLinkResponse, GetLinkResponseBody, GetMcpResourceRequest, GetMcpResourceResponse, GetMcpResourceResponseBody, GetMcpResourceResponseBodyData, GetMcpResourceResponseBodyDataDesktopInfo, type InstalledApp, KeyCode, ListContextsRequest, ListContextsResponse, ListContextsResponseBody, ListContextsResponseBodyData, ListSessionRequest, ListSessionResponse, ListSessionResponseBody, ListSessionResponseBodyData, ModifyContextRequest, ModifyContextResponse, ModifyContextResponseBody, Oss, type Process, ReleaseMcpSessionRequest, ReleaseMcpSessionResponse, ReleaseMcpSessionResponseBody, Session, SetLabelRequest, SetLabelResponse, SetLabelResponseBody, UI, type UIElement };
|