wuying-agentbay-sdk 0.1.0 → 0.4.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 +124 -61
- package/dist/index.cjs +6621 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +2633 -0
- package/dist/index.d.ts +2633 -0
- package/dist/index.mjs +6637 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +84 -48
- 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.mts
ADDED
|
@@ -0,0 +1,2633 @@
|
|
|
1
|
+
import * as $dara from '@darabonba/typescript';
|
|
2
|
+
import OpenApi, { $OpenApiUtil } from '@alicloud/openapi-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*/
|
|
6
|
+
declare class ApplyMqttTokenResponseBodyData extends $dara.Model {
|
|
7
|
+
accessKeyId?: string;
|
|
8
|
+
clientId?: string;
|
|
9
|
+
expiration?: string;
|
|
10
|
+
instanceId?: string;
|
|
11
|
+
regionId?: string;
|
|
12
|
+
securityToken?: string;
|
|
13
|
+
static names(): {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
};
|
|
16
|
+
static types(): {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
validate(): void;
|
|
20
|
+
constructor(map?: {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare class CreateMcpSessionRequestPersistenceDataList extends $dara.Model {
|
|
26
|
+
contextId?: string;
|
|
27
|
+
path?: string;
|
|
28
|
+
policy?: string;
|
|
29
|
+
static names(): {
|
|
30
|
+
[key: string]: string;
|
|
31
|
+
};
|
|
32
|
+
static types(): {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
};
|
|
35
|
+
validate(): void;
|
|
36
|
+
constructor(map?: {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare class CreateMcpSessionResponseBodyData extends $dara.Model {
|
|
42
|
+
appInstanceId?: string;
|
|
43
|
+
errMsg?: string;
|
|
44
|
+
resourceId?: string;
|
|
45
|
+
resourceUrl?: string;
|
|
46
|
+
sessionId?: string;
|
|
47
|
+
success?: boolean;
|
|
48
|
+
static names(): {
|
|
49
|
+
[key: string]: string;
|
|
50
|
+
};
|
|
51
|
+
static types(): {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
};
|
|
54
|
+
validate(): void;
|
|
55
|
+
constructor(map?: {
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare class GetContextResponseBodyData extends $dara.Model {
|
|
61
|
+
createTime?: string;
|
|
62
|
+
id?: string;
|
|
63
|
+
lastUsedTime?: string;
|
|
64
|
+
name?: string;
|
|
65
|
+
osType?: string;
|
|
66
|
+
state?: string;
|
|
67
|
+
static names(): {
|
|
68
|
+
[key: string]: string;
|
|
69
|
+
};
|
|
70
|
+
static types(): {
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
};
|
|
73
|
+
validate(): void;
|
|
74
|
+
constructor(map?: {
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
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
|
+
|
|
93
|
+
declare class GetLabelResponseBodyData extends $dara.Model {
|
|
94
|
+
labels?: string;
|
|
95
|
+
static names(): {
|
|
96
|
+
[key: string]: string;
|
|
97
|
+
};
|
|
98
|
+
static types(): {
|
|
99
|
+
[key: string]: any;
|
|
100
|
+
};
|
|
101
|
+
validate(): void;
|
|
102
|
+
constructor(map?: {
|
|
103
|
+
[key: string]: any;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
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
|
+
|
|
121
|
+
declare class GetMcpResourceResponseBodyDataDesktopInfo extends $dara.Model {
|
|
122
|
+
appId?: string;
|
|
123
|
+
authCode?: string;
|
|
124
|
+
connectionProperties?: string;
|
|
125
|
+
resourceId?: string;
|
|
126
|
+
resourceType?: string;
|
|
127
|
+
ticket?: string;
|
|
128
|
+
static names(): {
|
|
129
|
+
[key: string]: string;
|
|
130
|
+
};
|
|
131
|
+
static types(): {
|
|
132
|
+
[key: string]: any;
|
|
133
|
+
};
|
|
134
|
+
validate(): void;
|
|
135
|
+
constructor(map?: {
|
|
136
|
+
[key: string]: any;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
declare class GetMcpResourceResponseBodyData extends $dara.Model {
|
|
141
|
+
desktopInfo?: GetMcpResourceResponseBodyDataDesktopInfo;
|
|
142
|
+
resourceUrl?: string;
|
|
143
|
+
sessionId?: string;
|
|
144
|
+
static names(): {
|
|
145
|
+
[key: string]: string;
|
|
146
|
+
};
|
|
147
|
+
static types(): {
|
|
148
|
+
[key: string]: any;
|
|
149
|
+
};
|
|
150
|
+
validate(): void;
|
|
151
|
+
constructor(map?: {
|
|
152
|
+
[key: string]: any;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare class ListContextsResponseBodyData extends $dara.Model {
|
|
157
|
+
createTime?: string;
|
|
158
|
+
id?: string;
|
|
159
|
+
lastUsedTime?: string;
|
|
160
|
+
name?: string;
|
|
161
|
+
osType?: string;
|
|
162
|
+
state?: string;
|
|
163
|
+
static names(): {
|
|
164
|
+
[key: string]: string;
|
|
165
|
+
};
|
|
166
|
+
static types(): {
|
|
167
|
+
[key: string]: any;
|
|
168
|
+
};
|
|
169
|
+
validate(): void;
|
|
170
|
+
constructor(map?: {
|
|
171
|
+
[key: string]: any;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare class ListSessionResponseBodyData extends $dara.Model {
|
|
176
|
+
sessionId?: string;
|
|
177
|
+
static names(): {
|
|
178
|
+
[key: string]: string;
|
|
179
|
+
};
|
|
180
|
+
static types(): {
|
|
181
|
+
[key: string]: any;
|
|
182
|
+
};
|
|
183
|
+
validate(): void;
|
|
184
|
+
constructor(map?: {
|
|
185
|
+
[key: string]: any;
|
|
186
|
+
});
|
|
187
|
+
}
|
|
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
|
+
|
|
241
|
+
declare class CallMcpToolRequest extends $dara.Model {
|
|
242
|
+
args?: string;
|
|
243
|
+
authorization?: string;
|
|
244
|
+
externalUserId?: string;
|
|
245
|
+
imageId?: string;
|
|
246
|
+
name?: string;
|
|
247
|
+
server?: string;
|
|
248
|
+
sessionId?: string;
|
|
249
|
+
tool?: string;
|
|
250
|
+
static names(): {
|
|
251
|
+
[key: string]: string;
|
|
252
|
+
};
|
|
253
|
+
static types(): {
|
|
254
|
+
[key: string]: any;
|
|
255
|
+
};
|
|
256
|
+
validate(): void;
|
|
257
|
+
constructor(map?: {
|
|
258
|
+
[key: string]: any;
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
declare class CallMcpToolResponseBody extends $dara.Model {
|
|
263
|
+
code?: string;
|
|
264
|
+
data?: any;
|
|
265
|
+
httpStatusCode?: number;
|
|
266
|
+
message?: string;
|
|
267
|
+
requestId?: string;
|
|
268
|
+
success?: boolean;
|
|
269
|
+
static names(): {
|
|
270
|
+
[key: string]: string;
|
|
271
|
+
};
|
|
272
|
+
static types(): {
|
|
273
|
+
[key: string]: any;
|
|
274
|
+
};
|
|
275
|
+
validate(): void;
|
|
276
|
+
constructor(map?: {
|
|
277
|
+
[key: string]: any;
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare class CallMcpToolResponse extends $dara.Model {
|
|
282
|
+
headers?: {
|
|
283
|
+
[key: string]: string;
|
|
284
|
+
};
|
|
285
|
+
statusCode?: number;
|
|
286
|
+
body?: CallMcpToolResponseBody;
|
|
287
|
+
static names(): {
|
|
288
|
+
[key: string]: string;
|
|
289
|
+
};
|
|
290
|
+
static types(): {
|
|
291
|
+
[key: string]: any;
|
|
292
|
+
};
|
|
293
|
+
validate(): void;
|
|
294
|
+
constructor(map?: {
|
|
295
|
+
[key: string]: any;
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
declare class CreateMcpSessionRequest extends $dara.Model {
|
|
300
|
+
authorization?: string;
|
|
301
|
+
contextId?: string;
|
|
302
|
+
externalUserId?: string;
|
|
303
|
+
imageId?: string;
|
|
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;
|
|
326
|
+
sessionId?: string;
|
|
327
|
+
static names(): {
|
|
328
|
+
[key: string]: string;
|
|
329
|
+
};
|
|
330
|
+
static types(): {
|
|
331
|
+
[key: string]: any;
|
|
332
|
+
};
|
|
333
|
+
validate(): void;
|
|
334
|
+
constructor(map?: {
|
|
335
|
+
[key: string]: any;
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
declare class CreateMcpSessionResponseBody extends $dara.Model {
|
|
340
|
+
code?: string;
|
|
341
|
+
data?: CreateMcpSessionResponseBodyData;
|
|
342
|
+
httpStatusCode?: number;
|
|
343
|
+
message?: string;
|
|
344
|
+
requestId?: string;
|
|
345
|
+
success?: boolean;
|
|
346
|
+
static names(): {
|
|
347
|
+
[key: string]: string;
|
|
348
|
+
};
|
|
349
|
+
static types(): {
|
|
350
|
+
[key: string]: any;
|
|
351
|
+
};
|
|
352
|
+
validate(): void;
|
|
353
|
+
constructor(map?: {
|
|
354
|
+
[key: string]: any;
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
declare class CreateMcpSessionResponse extends $dara.Model {
|
|
359
|
+
headers?: {
|
|
360
|
+
[key: string]: string;
|
|
361
|
+
};
|
|
362
|
+
statusCode?: number;
|
|
363
|
+
body?: CreateMcpSessionResponseBody;
|
|
364
|
+
static names(): {
|
|
365
|
+
[key: string]: string;
|
|
366
|
+
};
|
|
367
|
+
static types(): {
|
|
368
|
+
[key: string]: any;
|
|
369
|
+
};
|
|
370
|
+
validate(): void;
|
|
371
|
+
constructor(map?: {
|
|
372
|
+
[key: string]: any;
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
declare class DeleteContextRequest extends $dara.Model {
|
|
377
|
+
authorization?: string;
|
|
378
|
+
id?: string;
|
|
379
|
+
static names(): {
|
|
380
|
+
[key: string]: string;
|
|
381
|
+
};
|
|
382
|
+
static types(): {
|
|
383
|
+
[key: string]: any;
|
|
384
|
+
};
|
|
385
|
+
validate(): void;
|
|
386
|
+
constructor(map?: {
|
|
387
|
+
[key: string]: any;
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
declare class DeleteContextResponseBody extends $dara.Model {
|
|
392
|
+
code?: string;
|
|
393
|
+
httpStatusCode?: number;
|
|
394
|
+
message?: string;
|
|
395
|
+
requestId?: string;
|
|
396
|
+
success?: boolean;
|
|
397
|
+
static names(): {
|
|
398
|
+
[key: string]: string;
|
|
399
|
+
};
|
|
400
|
+
static types(): {
|
|
401
|
+
[key: string]: any;
|
|
402
|
+
};
|
|
403
|
+
validate(): void;
|
|
404
|
+
constructor(map?: {
|
|
405
|
+
[key: string]: any;
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
declare class DeleteContextResponse extends $dara.Model {
|
|
410
|
+
headers?: {
|
|
411
|
+
[key: string]: string;
|
|
412
|
+
};
|
|
413
|
+
statusCode?: number;
|
|
414
|
+
body?: DeleteContextResponseBody;
|
|
415
|
+
static names(): {
|
|
416
|
+
[key: string]: string;
|
|
417
|
+
};
|
|
418
|
+
static types(): {
|
|
419
|
+
[key: string]: any;
|
|
420
|
+
};
|
|
421
|
+
validate(): void;
|
|
422
|
+
constructor(map?: {
|
|
423
|
+
[key: string]: any;
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
declare class GetContextRequest extends $dara.Model {
|
|
428
|
+
allowCreate?: boolean;
|
|
429
|
+
authorization?: string;
|
|
430
|
+
name?: string;
|
|
431
|
+
static names(): {
|
|
432
|
+
[key: string]: string;
|
|
433
|
+
};
|
|
434
|
+
static types(): {
|
|
435
|
+
[key: string]: any;
|
|
436
|
+
};
|
|
437
|
+
validate(): void;
|
|
438
|
+
constructor(map?: {
|
|
439
|
+
[key: string]: any;
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
declare class GetContextResponseBody extends $dara.Model {
|
|
444
|
+
code?: string;
|
|
445
|
+
data?: GetContextResponseBodyData;
|
|
446
|
+
httpStatusCode?: number;
|
|
447
|
+
message?: string;
|
|
448
|
+
requestId?: string;
|
|
449
|
+
success?: boolean;
|
|
450
|
+
static names(): {
|
|
451
|
+
[key: string]: string;
|
|
452
|
+
};
|
|
453
|
+
static types(): {
|
|
454
|
+
[key: string]: any;
|
|
455
|
+
};
|
|
456
|
+
validate(): void;
|
|
457
|
+
constructor(map?: {
|
|
458
|
+
[key: string]: any;
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
declare class GetContextResponse extends $dara.Model {
|
|
463
|
+
headers?: {
|
|
464
|
+
[key: string]: string;
|
|
465
|
+
};
|
|
466
|
+
statusCode?: number;
|
|
467
|
+
body?: GetContextResponseBody;
|
|
468
|
+
static names(): {
|
|
469
|
+
[key: string]: string;
|
|
470
|
+
};
|
|
471
|
+
static types(): {
|
|
472
|
+
[key: string]: any;
|
|
473
|
+
};
|
|
474
|
+
validate(): void;
|
|
475
|
+
constructor(map?: {
|
|
476
|
+
[key: string]: any;
|
|
477
|
+
});
|
|
478
|
+
}
|
|
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
|
+
|
|
535
|
+
declare class GetLabelRequest extends $dara.Model {
|
|
536
|
+
authorization?: string;
|
|
537
|
+
maxResults?: number;
|
|
538
|
+
nextToken?: string;
|
|
539
|
+
sessionId?: string;
|
|
540
|
+
static names(): {
|
|
541
|
+
[key: string]: string;
|
|
542
|
+
};
|
|
543
|
+
static types(): {
|
|
544
|
+
[key: string]: any;
|
|
545
|
+
};
|
|
546
|
+
validate(): void;
|
|
547
|
+
constructor(map?: {
|
|
548
|
+
[key: string]: any;
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
declare class GetLabelResponseBody extends $dara.Model {
|
|
553
|
+
code?: string;
|
|
554
|
+
data?: GetLabelResponseBodyData;
|
|
555
|
+
httpStatusCode?: number;
|
|
556
|
+
maxResults?: number;
|
|
557
|
+
message?: string;
|
|
558
|
+
nextToken?: string;
|
|
559
|
+
requestId?: string;
|
|
560
|
+
success?: boolean;
|
|
561
|
+
totalCount?: number;
|
|
562
|
+
static names(): {
|
|
563
|
+
[key: string]: string;
|
|
564
|
+
};
|
|
565
|
+
static types(): {
|
|
566
|
+
[key: string]: any;
|
|
567
|
+
};
|
|
568
|
+
validate(): void;
|
|
569
|
+
constructor(map?: {
|
|
570
|
+
[key: string]: any;
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
declare class GetLabelResponse extends $dara.Model {
|
|
575
|
+
headers?: {
|
|
576
|
+
[key: string]: string;
|
|
577
|
+
};
|
|
578
|
+
statusCode?: number;
|
|
579
|
+
body?: GetLabelResponseBody;
|
|
580
|
+
static names(): {
|
|
581
|
+
[key: string]: string;
|
|
582
|
+
};
|
|
583
|
+
static types(): {
|
|
584
|
+
[key: string]: any;
|
|
585
|
+
};
|
|
586
|
+
validate(): void;
|
|
587
|
+
constructor(map?: {
|
|
588
|
+
[key: string]: any;
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
declare class GetLinkRequest extends $dara.Model {
|
|
593
|
+
authorization?: string;
|
|
594
|
+
port?: number;
|
|
595
|
+
protocolType?: string;
|
|
596
|
+
sessionId?: string;
|
|
597
|
+
static names(): {
|
|
598
|
+
[key: string]: string;
|
|
599
|
+
};
|
|
600
|
+
static types(): {
|
|
601
|
+
[key: string]: any;
|
|
602
|
+
};
|
|
603
|
+
validate(): void;
|
|
604
|
+
constructor(map?: {
|
|
605
|
+
[key: string]: any;
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
declare class GetLinkResponseBody extends $dara.Model {
|
|
610
|
+
code?: string;
|
|
611
|
+
data?: GetLinkResponseBodyData;
|
|
612
|
+
httpStatusCode?: number;
|
|
613
|
+
message?: string;
|
|
614
|
+
requestId?: string;
|
|
615
|
+
success?: boolean;
|
|
616
|
+
static names(): {
|
|
617
|
+
[key: string]: string;
|
|
618
|
+
};
|
|
619
|
+
static types(): {
|
|
620
|
+
[key: string]: any;
|
|
621
|
+
};
|
|
622
|
+
validate(): void;
|
|
623
|
+
constructor(map?: {
|
|
624
|
+
[key: string]: any;
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
|
|
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 {
|
|
737
|
+
headers?: {
|
|
738
|
+
[key: string]: string;
|
|
739
|
+
};
|
|
740
|
+
statusCode?: number;
|
|
741
|
+
body?: ListContextsResponseBody;
|
|
742
|
+
static names(): {
|
|
743
|
+
[key: string]: string;
|
|
744
|
+
};
|
|
745
|
+
static types(): {
|
|
746
|
+
[key: string]: any;
|
|
747
|
+
};
|
|
748
|
+
validate(): void;
|
|
749
|
+
constructor(map?: {
|
|
750
|
+
[key: string]: any;
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
declare class ListMcpToolsRequest extends $dara.Model {
|
|
755
|
+
authorization?: string;
|
|
756
|
+
imageId?: string;
|
|
757
|
+
static names(): {
|
|
758
|
+
[key: string]: string;
|
|
759
|
+
};
|
|
760
|
+
static types(): {
|
|
761
|
+
[key: string]: any;
|
|
762
|
+
};
|
|
763
|
+
validate(): void;
|
|
764
|
+
constructor(map?: {
|
|
765
|
+
[key: string]: any;
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
declare class ListMcpToolsResponseBody extends $dara.Model {
|
|
770
|
+
code?: string;
|
|
771
|
+
data?: string;
|
|
772
|
+
httpStatusCode?: number;
|
|
773
|
+
message?: string;
|
|
774
|
+
requestId?: string;
|
|
775
|
+
success?: boolean;
|
|
776
|
+
static names(): {
|
|
777
|
+
[key: string]: string;
|
|
778
|
+
};
|
|
779
|
+
static types(): {
|
|
780
|
+
[key: string]: any;
|
|
781
|
+
};
|
|
782
|
+
validate(): void;
|
|
783
|
+
constructor(map?: {
|
|
784
|
+
[key: string]: any;
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
declare class ListMcpToolsResponse extends $dara.Model {
|
|
789
|
+
headers?: {
|
|
790
|
+
[key: string]: string;
|
|
791
|
+
};
|
|
792
|
+
statusCode?: number;
|
|
793
|
+
body?: ListMcpToolsResponseBody;
|
|
794
|
+
static names(): {
|
|
795
|
+
[key: string]: string;
|
|
796
|
+
};
|
|
797
|
+
static types(): {
|
|
798
|
+
[key: string]: any;
|
|
799
|
+
};
|
|
800
|
+
validate(): void;
|
|
801
|
+
constructor(map?: {
|
|
802
|
+
[key: string]: any;
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
declare class ListSessionRequest extends $dara.Model {
|
|
807
|
+
authorization?: string;
|
|
808
|
+
labels?: string;
|
|
809
|
+
maxResults?: number;
|
|
810
|
+
nextToken?: string;
|
|
811
|
+
static names(): {
|
|
812
|
+
[key: string]: string;
|
|
813
|
+
};
|
|
814
|
+
static types(): {
|
|
815
|
+
[key: string]: any;
|
|
816
|
+
};
|
|
817
|
+
validate(): void;
|
|
818
|
+
constructor(map?: {
|
|
819
|
+
[key: string]: any;
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
declare class ListSessionResponseBody extends $dara.Model {
|
|
824
|
+
code?: string;
|
|
825
|
+
data?: ListSessionResponseBodyData[];
|
|
826
|
+
httpStatusCode?: number;
|
|
827
|
+
maxResults?: number;
|
|
828
|
+
message?: string;
|
|
829
|
+
nextToken?: string;
|
|
830
|
+
requestId?: string;
|
|
831
|
+
success?: boolean;
|
|
832
|
+
totalCount?: number;
|
|
833
|
+
static names(): {
|
|
834
|
+
[key: string]: string;
|
|
835
|
+
};
|
|
836
|
+
static types(): {
|
|
837
|
+
[key: string]: any;
|
|
838
|
+
};
|
|
839
|
+
validate(): void;
|
|
840
|
+
constructor(map?: {
|
|
841
|
+
[key: string]: any;
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
declare class ListSessionResponse extends $dara.Model {
|
|
846
|
+
headers?: {
|
|
847
|
+
[key: string]: string;
|
|
848
|
+
};
|
|
849
|
+
statusCode?: number;
|
|
850
|
+
body?: ListSessionResponseBody;
|
|
851
|
+
static names(): {
|
|
852
|
+
[key: string]: string;
|
|
853
|
+
};
|
|
854
|
+
static types(): {
|
|
855
|
+
[key: string]: any;
|
|
856
|
+
};
|
|
857
|
+
validate(): void;
|
|
858
|
+
constructor(map?: {
|
|
859
|
+
[key: string]: any;
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
declare class ModifyContextRequest extends $dara.Model {
|
|
864
|
+
authorization?: string;
|
|
865
|
+
id?: string;
|
|
866
|
+
name?: string;
|
|
867
|
+
static names(): {
|
|
868
|
+
[key: string]: string;
|
|
869
|
+
};
|
|
870
|
+
static types(): {
|
|
871
|
+
[key: string]: any;
|
|
872
|
+
};
|
|
873
|
+
validate(): void;
|
|
874
|
+
constructor(map?: {
|
|
875
|
+
[key: string]: any;
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
declare class ModifyContextResponseBody extends $dara.Model {
|
|
880
|
+
code?: string;
|
|
881
|
+
httpStatusCode?: number;
|
|
882
|
+
message?: string;
|
|
883
|
+
requestId?: string;
|
|
884
|
+
success?: boolean;
|
|
885
|
+
static names(): {
|
|
886
|
+
[key: string]: string;
|
|
887
|
+
};
|
|
888
|
+
static types(): {
|
|
889
|
+
[key: string]: any;
|
|
890
|
+
};
|
|
891
|
+
validate(): void;
|
|
892
|
+
constructor(map?: {
|
|
893
|
+
[key: string]: any;
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
declare class ModifyContextResponse extends $dara.Model {
|
|
898
|
+
headers?: {
|
|
899
|
+
[key: string]: string;
|
|
900
|
+
};
|
|
901
|
+
statusCode?: number;
|
|
902
|
+
body?: ModifyContextResponseBody;
|
|
903
|
+
static names(): {
|
|
904
|
+
[key: string]: string;
|
|
905
|
+
};
|
|
906
|
+
static types(): {
|
|
907
|
+
[key: string]: any;
|
|
908
|
+
};
|
|
909
|
+
validate(): void;
|
|
910
|
+
constructor(map?: {
|
|
911
|
+
[key: string]: any;
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
declare class ReleaseMcpSessionRequest extends $dara.Model {
|
|
916
|
+
authorization?: string;
|
|
917
|
+
sessionId?: string;
|
|
918
|
+
static names(): {
|
|
919
|
+
[key: string]: string;
|
|
920
|
+
};
|
|
921
|
+
static types(): {
|
|
922
|
+
[key: string]: any;
|
|
923
|
+
};
|
|
924
|
+
validate(): void;
|
|
925
|
+
constructor(map?: {
|
|
926
|
+
[key: string]: any;
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
declare class ReleaseMcpSessionResponseBody extends $dara.Model {
|
|
931
|
+
code?: string;
|
|
932
|
+
httpStatusCode?: number;
|
|
933
|
+
message?: string;
|
|
934
|
+
requestId?: string;
|
|
935
|
+
success?: boolean;
|
|
936
|
+
static names(): {
|
|
937
|
+
[key: string]: string;
|
|
938
|
+
};
|
|
939
|
+
static types(): {
|
|
940
|
+
[key: string]: any;
|
|
941
|
+
};
|
|
942
|
+
validate(): void;
|
|
943
|
+
constructor(map?: {
|
|
944
|
+
[key: string]: any;
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
declare class ReleaseMcpSessionResponse extends $dara.Model {
|
|
949
|
+
headers?: {
|
|
950
|
+
[key: string]: string;
|
|
951
|
+
};
|
|
952
|
+
statusCode?: number;
|
|
953
|
+
body?: ReleaseMcpSessionResponseBody;
|
|
954
|
+
static names(): {
|
|
955
|
+
[key: string]: string;
|
|
956
|
+
};
|
|
957
|
+
static types(): {
|
|
958
|
+
[key: string]: any;
|
|
959
|
+
};
|
|
960
|
+
validate(): void;
|
|
961
|
+
constructor(map?: {
|
|
962
|
+
[key: string]: any;
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
declare class SetLabelRequest extends $dara.Model {
|
|
967
|
+
authorization?: string;
|
|
968
|
+
labels?: string;
|
|
969
|
+
sessionId?: string;
|
|
970
|
+
static names(): {
|
|
971
|
+
[key: string]: string;
|
|
972
|
+
};
|
|
973
|
+
static types(): {
|
|
974
|
+
[key: string]: any;
|
|
975
|
+
};
|
|
976
|
+
validate(): void;
|
|
977
|
+
constructor(map?: {
|
|
978
|
+
[key: string]: any;
|
|
979
|
+
});
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
declare class SetLabelResponseBody extends $dara.Model {
|
|
983
|
+
code?: string;
|
|
984
|
+
httpStatusCode?: number;
|
|
985
|
+
message?: string;
|
|
986
|
+
requestId?: string;
|
|
987
|
+
success?: boolean;
|
|
988
|
+
static names(): {
|
|
989
|
+
[key: string]: string;
|
|
990
|
+
};
|
|
991
|
+
static types(): {
|
|
992
|
+
[key: string]: any;
|
|
993
|
+
};
|
|
994
|
+
validate(): void;
|
|
995
|
+
constructor(map?: {
|
|
996
|
+
[key: string]: any;
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
declare class SetLabelResponse extends $dara.Model {
|
|
1001
|
+
headers?: {
|
|
1002
|
+
[key: string]: string;
|
|
1003
|
+
};
|
|
1004
|
+
statusCode?: number;
|
|
1005
|
+
body?: SetLabelResponseBody;
|
|
1006
|
+
static names(): {
|
|
1007
|
+
[key: string]: string;
|
|
1008
|
+
};
|
|
1009
|
+
static types(): {
|
|
1010
|
+
[key: string]: any;
|
|
1011
|
+
};
|
|
1012
|
+
validate(): void;
|
|
1013
|
+
constructor(map?: {
|
|
1014
|
+
[key: string]: any;
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
declare class SyncContextRequest extends $dara.Model {
|
|
1019
|
+
authorization?: string;
|
|
1020
|
+
contextId?: string;
|
|
1021
|
+
mode?: string;
|
|
1022
|
+
path?: string;
|
|
1023
|
+
sessionId?: string;
|
|
1024
|
+
static names(): {
|
|
1025
|
+
[key: string]: string;
|
|
1026
|
+
};
|
|
1027
|
+
static types(): {
|
|
1028
|
+
[key: string]: any;
|
|
1029
|
+
};
|
|
1030
|
+
validate(): void;
|
|
1031
|
+
constructor(map?: {
|
|
1032
|
+
[key: string]: any;
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
declare class SyncContextResponseBody extends $dara.Model {
|
|
1037
|
+
code?: string;
|
|
1038
|
+
httpStatusCode?: number;
|
|
1039
|
+
message?: string;
|
|
1040
|
+
requestId?: string;
|
|
1041
|
+
success?: boolean;
|
|
1042
|
+
static names(): {
|
|
1043
|
+
[key: string]: string;
|
|
1044
|
+
};
|
|
1045
|
+
static types(): {
|
|
1046
|
+
[key: string]: any;
|
|
1047
|
+
};
|
|
1048
|
+
validate(): void;
|
|
1049
|
+
constructor(map?: {
|
|
1050
|
+
[key: string]: any;
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
declare class SyncContextResponse extends $dara.Model {
|
|
1055
|
+
headers?: {
|
|
1056
|
+
[key: string]: string;
|
|
1057
|
+
};
|
|
1058
|
+
statusCode?: number;
|
|
1059
|
+
body?: SyncContextResponseBody;
|
|
1060
|
+
static names(): {
|
|
1061
|
+
[key: string]: string;
|
|
1062
|
+
};
|
|
1063
|
+
static types(): {
|
|
1064
|
+
[key: string]: any;
|
|
1065
|
+
};
|
|
1066
|
+
validate(): void;
|
|
1067
|
+
constructor(map?: {
|
|
1068
|
+
[key: string]: any;
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
declare class Client extends OpenApi {
|
|
1073
|
+
constructor(config: $OpenApiUtil.Config);
|
|
1074
|
+
getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {
|
|
1075
|
+
[key: string]: string;
|
|
1076
|
+
}, endpoint: string): string;
|
|
1077
|
+
/**
|
|
1078
|
+
* 调用mcp工具
|
|
1079
|
+
*
|
|
1080
|
+
* @param request - CallMcpToolRequest
|
|
1081
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1082
|
+
* @returns CallMcpToolResponse
|
|
1083
|
+
*/
|
|
1084
|
+
callMcpToolWithOptions(request: CallMcpToolRequest, runtime: $dara.RuntimeOptions): Promise<CallMcpToolResponse>;
|
|
1085
|
+
/**
|
|
1086
|
+
* 调用mcp工具
|
|
1087
|
+
*
|
|
1088
|
+
* @param request - CallMcpToolRequest
|
|
1089
|
+
* @returns CallMcpToolResponse
|
|
1090
|
+
*/
|
|
1091
|
+
callMcpTool(request: CallMcpToolRequest): Promise<CallMcpToolResponse>;
|
|
1092
|
+
/**
|
|
1093
|
+
* 创建 mcp session
|
|
1094
|
+
*
|
|
1095
|
+
* @param tmpReq - CreateMcpSessionRequest
|
|
1096
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1097
|
+
* @returns CreateMcpSessionResponse
|
|
1098
|
+
*/
|
|
1099
|
+
createMcpSessionWithOptions(tmpReq: CreateMcpSessionRequest, runtime: $dara.RuntimeOptions): Promise<CreateMcpSessionResponse>;
|
|
1100
|
+
/**
|
|
1101
|
+
* 创建 mcp session
|
|
1102
|
+
*
|
|
1103
|
+
* @param request - CreateMcpSessionRequest
|
|
1104
|
+
* @returns CreateMcpSessionResponse
|
|
1105
|
+
*/
|
|
1106
|
+
createMcpSession(request: CreateMcpSessionRequest): Promise<CreateMcpSessionResponse>;
|
|
1107
|
+
/**
|
|
1108
|
+
* 删除持久化上下文
|
|
1109
|
+
*
|
|
1110
|
+
* @param request - DeleteContextRequest
|
|
1111
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1112
|
+
* @returns DeleteContextResponse
|
|
1113
|
+
*/
|
|
1114
|
+
deleteContextWithOptions(request: DeleteContextRequest, runtime: $dara.RuntimeOptions): Promise<DeleteContextResponse>;
|
|
1115
|
+
/**
|
|
1116
|
+
* 删除持久化上下文
|
|
1117
|
+
*
|
|
1118
|
+
* @param request - DeleteContextRequest
|
|
1119
|
+
* @returns DeleteContextResponse
|
|
1120
|
+
*/
|
|
1121
|
+
deleteContext(request: DeleteContextRequest): Promise<DeleteContextResponse>;
|
|
1122
|
+
/**
|
|
1123
|
+
* 获取上下文
|
|
1124
|
+
*
|
|
1125
|
+
* @param request - GetContextRequest
|
|
1126
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1127
|
+
* @returns GetContextResponse
|
|
1128
|
+
*/
|
|
1129
|
+
getContextWithOptions(request: GetContextRequest, runtime: $dara.RuntimeOptions): Promise<GetContextResponse>;
|
|
1130
|
+
/**
|
|
1131
|
+
* 获取上下文
|
|
1132
|
+
*
|
|
1133
|
+
* @param request - GetContextRequest
|
|
1134
|
+
* @returns GetContextResponse
|
|
1135
|
+
*/
|
|
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>;
|
|
1152
|
+
/**
|
|
1153
|
+
* 获取标签
|
|
1154
|
+
*
|
|
1155
|
+
* @param request - GetLabelRequest
|
|
1156
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1157
|
+
* @returns GetLabelResponse
|
|
1158
|
+
*/
|
|
1159
|
+
getLabelWithOptions(request: GetLabelRequest, runtime: $dara.RuntimeOptions): Promise<GetLabelResponse>;
|
|
1160
|
+
/**
|
|
1161
|
+
* 获取标签
|
|
1162
|
+
*
|
|
1163
|
+
* @param request - GetLabelRequest
|
|
1164
|
+
* @returns GetLabelResponse
|
|
1165
|
+
*/
|
|
1166
|
+
getLabel(request: GetLabelRequest): Promise<GetLabelResponse>;
|
|
1167
|
+
/**
|
|
1168
|
+
* 获取特定端口的转发链接
|
|
1169
|
+
*
|
|
1170
|
+
* @param request - GetLinkRequest
|
|
1171
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1172
|
+
* @returns GetLinkResponse
|
|
1173
|
+
*/
|
|
1174
|
+
getLinkWithOptions(request: GetLinkRequest, runtime: $dara.RuntimeOptions): Promise<GetLinkResponse>;
|
|
1175
|
+
/**
|
|
1176
|
+
* 获取特定端口的转发链接
|
|
1177
|
+
*
|
|
1178
|
+
* @param request - GetLinkRequest
|
|
1179
|
+
* @returns GetLinkResponse
|
|
1180
|
+
*/
|
|
1181
|
+
getLink(request: GetLinkRequest): Promise<GetLinkResponse>;
|
|
1182
|
+
/**
|
|
1183
|
+
* 获取mcp资源信息
|
|
1184
|
+
*
|
|
1185
|
+
* @param request - GetMcpResourceRequest
|
|
1186
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1187
|
+
* @returns GetMcpResourceResponse
|
|
1188
|
+
*/
|
|
1189
|
+
getMcpResourceWithOptions(request: GetMcpResourceRequest, runtime: $dara.RuntimeOptions): Promise<GetMcpResourceResponse>;
|
|
1190
|
+
/**
|
|
1191
|
+
* 获取mcp资源信息
|
|
1192
|
+
*
|
|
1193
|
+
* @param request - GetMcpResourceRequest
|
|
1194
|
+
* @returns GetMcpResourceResponse
|
|
1195
|
+
*/
|
|
1196
|
+
getMcpResource(request: GetMcpResourceRequest): Promise<GetMcpResourceResponse>;
|
|
1197
|
+
/**
|
|
1198
|
+
* 获取上下文列表
|
|
1199
|
+
*
|
|
1200
|
+
* @param request - ListContextsRequest
|
|
1201
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1202
|
+
* @returns ListContextsResponse
|
|
1203
|
+
*/
|
|
1204
|
+
listContextsWithOptions(request: ListContextsRequest, runtime: $dara.RuntimeOptions): Promise<ListContextsResponse>;
|
|
1205
|
+
/**
|
|
1206
|
+
* 获取上下文列表
|
|
1207
|
+
*
|
|
1208
|
+
* @param request - ListContextsRequest
|
|
1209
|
+
* @returns ListContextsResponse
|
|
1210
|
+
*/
|
|
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>;
|
|
1227
|
+
/**
|
|
1228
|
+
* 根据Lable查询Session列表
|
|
1229
|
+
*
|
|
1230
|
+
* @param request - ListSessionRequest
|
|
1231
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1232
|
+
* @returns ListSessionResponse
|
|
1233
|
+
*/
|
|
1234
|
+
listSessionWithOptions(request: ListSessionRequest, runtime: $dara.RuntimeOptions): Promise<ListSessionResponse>;
|
|
1235
|
+
/**
|
|
1236
|
+
* 根据Lable查询Session列表
|
|
1237
|
+
*
|
|
1238
|
+
* @param request - ListSessionRequest
|
|
1239
|
+
* @returns ListSessionResponse
|
|
1240
|
+
*/
|
|
1241
|
+
listSession(request: ListSessionRequest): Promise<ListSessionResponse>;
|
|
1242
|
+
/**
|
|
1243
|
+
* 修改上下文
|
|
1244
|
+
*
|
|
1245
|
+
* @param request - ModifyContextRequest
|
|
1246
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1247
|
+
* @returns ModifyContextResponse
|
|
1248
|
+
*/
|
|
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);
|
|
1676
|
+
/**
|
|
1677
|
+
* Lists all available contexts.
|
|
1678
|
+
* Corresponds to Python's list() method
|
|
1679
|
+
*
|
|
1680
|
+
* @returns ContextListResult with contexts list and requestId
|
|
1681
|
+
*/
|
|
1682
|
+
list(): Promise<ContextListResult>;
|
|
1683
|
+
/**
|
|
1684
|
+
* Gets a context by name. Optionally creates it if it doesn't exist.
|
|
1685
|
+
* Corresponds to Python's get() method
|
|
1686
|
+
*
|
|
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
|
|
1690
|
+
*/
|
|
1691
|
+
get(name: string, create?: boolean): Promise<ContextResult>;
|
|
1692
|
+
/**
|
|
1693
|
+
* Creates a new context with the given name.
|
|
1694
|
+
* Corresponds to Python's create() method
|
|
1695
|
+
*
|
|
1696
|
+
* @param name - The name for the new context.
|
|
1697
|
+
* @returns ContextResult with created context data and requestId
|
|
1698
|
+
*/
|
|
1699
|
+
create(name: string): Promise<ContextResult>;
|
|
1700
|
+
/**
|
|
1701
|
+
* Updates the specified context.
|
|
1702
|
+
* Corresponds to Python's update() method
|
|
1703
|
+
*
|
|
1704
|
+
* @param context - The Context object to update.
|
|
1705
|
+
* @returns OperationResult with updated context data and requestId
|
|
1706
|
+
*/
|
|
1707
|
+
update(context: Context): Promise<OperationResult>;
|
|
1708
|
+
/**
|
|
1709
|
+
* Deletes the specified context.
|
|
1710
|
+
* Corresponds to Python's delete() method
|
|
1711
|
+
*
|
|
1712
|
+
* @param context - The Context object to delete.
|
|
1713
|
+
* @returns OperationResult with requestId
|
|
1714
|
+
*/
|
|
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;
|
|
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
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* Represents an installed application.
|
|
1759
|
+
*/
|
|
1760
|
+
interface InstalledApp {
|
|
1761
|
+
name: string;
|
|
1762
|
+
start_cmd: string;
|
|
1763
|
+
stop_cmd?: string;
|
|
1764
|
+
work_directory?: string;
|
|
1765
|
+
}
|
|
1766
|
+
/**
|
|
1767
|
+
* Represents a running process.
|
|
1768
|
+
*/
|
|
1769
|
+
interface Process {
|
|
1770
|
+
pname: string;
|
|
1771
|
+
pid: number;
|
|
1772
|
+
cmdline?: string;
|
|
1773
|
+
path?: string;
|
|
1774
|
+
}
|
|
1775
|
+
/**
|
|
1776
|
+
* Handles application management operations in the AgentBay cloud environment.
|
|
1777
|
+
*/
|
|
1778
|
+
declare class Application {
|
|
1779
|
+
private session;
|
|
1780
|
+
/**
|
|
1781
|
+
* Creates a new Application instance.
|
|
1782
|
+
* @param session The session object that provides access to the AgentBay API.
|
|
1783
|
+
*/
|
|
1784
|
+
constructor(session: {
|
|
1785
|
+
getAPIKey(): string;
|
|
1786
|
+
getClient(): Client;
|
|
1787
|
+
getSessionId(): string;
|
|
1788
|
+
});
|
|
1789
|
+
/**
|
|
1790
|
+
* Helper method to call MCP tools and handle common response processing
|
|
1791
|
+
*
|
|
1792
|
+
* @param toolName - Name of the MCP tool to call
|
|
1793
|
+
* @param args - Arguments to pass to the tool
|
|
1794
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
1795
|
+
* @returns A CallMcpToolResult with the response data
|
|
1796
|
+
* @throws APIError if the call fails
|
|
1797
|
+
*/
|
|
1798
|
+
private callMcpTool;
|
|
1799
|
+
/**
|
|
1800
|
+
* Helper method to parse JSON string into objects
|
|
1801
|
+
*/
|
|
1802
|
+
private parseJSON;
|
|
1803
|
+
/**
|
|
1804
|
+
* Retrieves a list of installed applications.
|
|
1805
|
+
* Corresponds to Python's get_installed_apps() method
|
|
1806
|
+
*
|
|
1807
|
+
* @param startMenu Whether to include applications from the start menu. Defaults to true.
|
|
1808
|
+
* @param desktop Whether to include applications from the desktop. Defaults to true.
|
|
1809
|
+
* @param ignoreSystemApps Whether to ignore system applications. Defaults to true.
|
|
1810
|
+
* @returns InstalledAppListResult with installed apps and requestId
|
|
1811
|
+
* @throws Error if the operation fails.
|
|
1812
|
+
*/
|
|
1813
|
+
getInstalledApps(startMenu?: boolean, desktop?: boolean, ignoreSystemApps?: boolean): Promise<InstalledAppListResult>;
|
|
1814
|
+
/**
|
|
1815
|
+
* Starts an application with the given command and optional working directory.
|
|
1816
|
+
* Corresponds to Python's start_app() method
|
|
1817
|
+
*
|
|
1818
|
+
* @param startCmd The command to start the application.
|
|
1819
|
+
* @param workDirectory The working directory for the application. Defaults to an empty string.
|
|
1820
|
+
* @param activity Activity name to launch (e.g. ".SettingsActivity" or "com.package/.Activity"). Defaults to an empty string.
|
|
1821
|
+
* @returns ProcessListResult with started processes and requestId
|
|
1822
|
+
* @throws Error if the operation fails.
|
|
1823
|
+
*/
|
|
1824
|
+
startApp(startCmd: string, workDirectory?: string, activity?: string): Promise<ProcessListResult>;
|
|
1825
|
+
/**
|
|
1826
|
+
* Stops an application by process name.
|
|
1827
|
+
* Corresponds to Python's stop_app_by_pname() method
|
|
1828
|
+
*
|
|
1829
|
+
* @param pname The name of the process to stop.
|
|
1830
|
+
* @returns AppOperationResult with requestId
|
|
1831
|
+
* @throws Error if the operation fails.
|
|
1832
|
+
*/
|
|
1833
|
+
stopAppByPName(pname: string): Promise<AppOperationResult>;
|
|
1834
|
+
/**
|
|
1835
|
+
* Stops an application by process ID.
|
|
1836
|
+
* Corresponds to Python's stop_app_by_pid() method
|
|
1837
|
+
*
|
|
1838
|
+
* @param pid The ID of the process to stop.
|
|
1839
|
+
* @returns AppOperationResult with requestId
|
|
1840
|
+
* @throws Error if the operation fails.
|
|
1841
|
+
*/
|
|
1842
|
+
stopAppByPID(pid: number): Promise<AppOperationResult>;
|
|
1843
|
+
/**
|
|
1844
|
+
* Stops an application by stop command.
|
|
1845
|
+
* Corresponds to Python's stop_app_by_cmd() method
|
|
1846
|
+
*
|
|
1847
|
+
* @param stopCmd The command to stop the application.
|
|
1848
|
+
* @returns AppOperationResult with requestId
|
|
1849
|
+
* @throws Error if the operation fails.
|
|
1850
|
+
*/
|
|
1851
|
+
stopAppByCmd(stopCmd: string): Promise<AppOperationResult>;
|
|
1852
|
+
/**
|
|
1853
|
+
* Lists all currently visible applications.
|
|
1854
|
+
* Corresponds to Python's list_visible_apps() method
|
|
1855
|
+
*
|
|
1856
|
+
* @returns ProcessListResult with visible processes and requestId
|
|
1857
|
+
* @throws Error if the operation fails.
|
|
1858
|
+
*/
|
|
1859
|
+
listVisibleApps(): Promise<ProcessListResult>;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
/**
|
|
1863
|
+
* Handles command execution operations in the AgentBay cloud environment.
|
|
1864
|
+
*/
|
|
1865
|
+
declare class Command {
|
|
1866
|
+
private session;
|
|
1867
|
+
private client;
|
|
1868
|
+
private baseUrl;
|
|
1869
|
+
/**
|
|
1870
|
+
* Initialize a Command object.
|
|
1871
|
+
*
|
|
1872
|
+
* @param session - The Session instance that this Command belongs to.
|
|
1873
|
+
*/
|
|
1874
|
+
constructor(session: Session);
|
|
1875
|
+
/**
|
|
1876
|
+
* Helper method to call MCP tools and handle common response processing
|
|
1877
|
+
*
|
|
1878
|
+
* @param toolName - Name of the MCP tool to call
|
|
1879
|
+
* @param args - Arguments to pass to the tool
|
|
1880
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
1881
|
+
* @returns A CallMcpToolResult with the response data
|
|
1882
|
+
* @throws APIError if the call fails
|
|
1883
|
+
*/
|
|
1884
|
+
private callMcpTool;
|
|
1885
|
+
/**
|
|
1886
|
+
* Execute a command in the cloud environment with a specified timeout.
|
|
1887
|
+
* Corresponds to Python's execute_command() method
|
|
1888
|
+
*
|
|
1889
|
+
* @param command - The command to execute.
|
|
1890
|
+
* @param timeoutMs - The timeout for the command execution in milliseconds. Default is 1000ms.
|
|
1891
|
+
* @returns CommandResult with command output and requestId
|
|
1892
|
+
*/
|
|
1893
|
+
executeCommand(command: string, timeoutMs?: number): Promise<CommandResult>;
|
|
1894
|
+
/**
|
|
1895
|
+
* Execute code in the specified language with a timeout.
|
|
1896
|
+
* Corresponds to Python's run_code() method
|
|
1897
|
+
*
|
|
1898
|
+
* @param code - The code to execute.
|
|
1899
|
+
* @param language - The programming language of the code. Must be either 'python' or 'javascript'.
|
|
1900
|
+
* @param timeoutS - The timeout for the code execution in seconds. Default is 300s.
|
|
1901
|
+
* @returns CodeExecutionResult with code execution output and requestId
|
|
1902
|
+
* @throws Error if an unsupported language is specified.
|
|
1903
|
+
*/
|
|
1904
|
+
runCode(code: string, language: string, timeoutS?: number): Promise<CodeExecutionResult>;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
interface ContextStatusData {
|
|
1908
|
+
contextId: string;
|
|
1909
|
+
path: string;
|
|
1910
|
+
errorMessage: string;
|
|
1911
|
+
status: string;
|
|
1912
|
+
startTime: number;
|
|
1913
|
+
finishTime: number;
|
|
1914
|
+
taskType: string;
|
|
1915
|
+
}
|
|
1916
|
+
interface ContextInfoResult extends ApiResponse {
|
|
1917
|
+
contextStatusData: ContextStatusData[];
|
|
1918
|
+
}
|
|
1919
|
+
interface ContextSyncResult extends ApiResponse {
|
|
1920
|
+
success: boolean;
|
|
1921
|
+
}
|
|
1922
|
+
interface SessionInterface {
|
|
1923
|
+
getAPIKey(): string;
|
|
1924
|
+
getClient(): Client;
|
|
1925
|
+
getSessionId(): string;
|
|
1926
|
+
}
|
|
1927
|
+
declare class ContextManager {
|
|
1928
|
+
private session;
|
|
1929
|
+
constructor(session: SessionInterface);
|
|
1930
|
+
info(): Promise<ContextInfoResult>;
|
|
1931
|
+
infoWithParams(contextId?: string, path?: string, taskType?: string): Promise<ContextInfoResult>;
|
|
1932
|
+
sync(): Promise<ContextSyncResult>;
|
|
1933
|
+
syncWithParams(contextId?: string, path?: string, mode?: string): Promise<ContextSyncResult>;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* FileInfo represents information about a file or directory
|
|
1938
|
+
*/
|
|
1939
|
+
interface FileInfo {
|
|
1940
|
+
name: string;
|
|
1941
|
+
path: string;
|
|
1942
|
+
size: number;
|
|
1943
|
+
isDirectory: boolean;
|
|
1944
|
+
modTime: string;
|
|
1945
|
+
mode: string;
|
|
1946
|
+
owner?: string;
|
|
1947
|
+
group?: string;
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* DirectoryEntry represents an entry in a directory listing
|
|
1951
|
+
*/
|
|
1952
|
+
interface DirectoryEntry {
|
|
1953
|
+
name: string;
|
|
1954
|
+
isDirectory: boolean;
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Handles file operations in the AgentBay cloud environment.
|
|
1958
|
+
*/
|
|
1959
|
+
declare class FileSystem {
|
|
1960
|
+
private session;
|
|
1961
|
+
private client;
|
|
1962
|
+
private baseUrl;
|
|
1963
|
+
/**
|
|
1964
|
+
* Initialize a FileSystem object.
|
|
1965
|
+
*
|
|
1966
|
+
* @param session - The Session instance that this FileSystem belongs to.
|
|
1967
|
+
*/
|
|
1968
|
+
constructor(session: Session);
|
|
1969
|
+
/**
|
|
1970
|
+
* Helper method to call MCP tools and handle common response processing
|
|
1971
|
+
*
|
|
1972
|
+
* @param toolName - Name of the MCP tool to call
|
|
1973
|
+
* @param args - Arguments to pass to the tool
|
|
1974
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
1975
|
+
* @returns A CallMcpToolResult with the response data
|
|
1976
|
+
* @throws APIError if the call fails
|
|
1977
|
+
*/
|
|
1978
|
+
private callMcpTool;
|
|
1979
|
+
/**
|
|
1980
|
+
* Creates a new directory at the specified path.
|
|
1981
|
+
* Corresponds to Python's create_directory() method
|
|
1982
|
+
*
|
|
1983
|
+
* @param path - Path to the directory to create.
|
|
1984
|
+
* @returns BoolResult with creation result and requestId
|
|
1985
|
+
*/
|
|
1986
|
+
createDirectory(path: string): Promise<BoolResult>;
|
|
1987
|
+
/**
|
|
1988
|
+
* Edits a file by replacing occurrences of oldText with newText.
|
|
1989
|
+
* Corresponds to Python's edit_file() method
|
|
1990
|
+
*
|
|
1991
|
+
* @param path - Path to the file to edit.
|
|
1992
|
+
* @param edits - Array of edit operations, each containing oldText and newText.
|
|
1993
|
+
* @param dryRun - Optional: If true, preview changes without applying them.
|
|
1994
|
+
* @returns BoolResult with edit result and requestId
|
|
1995
|
+
*/
|
|
1996
|
+
editFile(path: string, edits: Array<{
|
|
1997
|
+
oldText: string;
|
|
1998
|
+
newText: string;
|
|
1999
|
+
}>, dryRun?: boolean): Promise<BoolResult>;
|
|
2000
|
+
/**
|
|
2001
|
+
* Gets information about a file or directory.
|
|
2002
|
+
* Corresponds to Python's get_file_info() method
|
|
2003
|
+
*
|
|
2004
|
+
* @param path - Path to the file or directory to inspect.
|
|
2005
|
+
* @returns FileInfoResult with file info and requestId
|
|
2006
|
+
*/
|
|
2007
|
+
getFileInfo(path: string): Promise<FileInfoResult>;
|
|
2008
|
+
/**
|
|
2009
|
+
* Lists the contents of a directory.
|
|
2010
|
+
* Corresponds to Python's list_directory() method
|
|
2011
|
+
*
|
|
2012
|
+
* @param path - Path to the directory to list.
|
|
2013
|
+
* @returns DirectoryListResult with directory entries and requestId
|
|
2014
|
+
*/
|
|
2015
|
+
listDirectory(path: string): Promise<DirectoryListResult>;
|
|
2016
|
+
/**
|
|
2017
|
+
* Moves a file or directory from source to destination.
|
|
2018
|
+
* Corresponds to Python's move_file() method
|
|
2019
|
+
*
|
|
2020
|
+
* @param source - Path to the source file or directory.
|
|
2021
|
+
* @param destination - Path to the destination file or directory.
|
|
2022
|
+
* @returns BoolResult with move result and requestId
|
|
2023
|
+
*/
|
|
2024
|
+
moveFile(source: string, destination: string): Promise<BoolResult>;
|
|
2025
|
+
/**
|
|
2026
|
+
* Reads the content of a file.
|
|
2027
|
+
* Corresponds to Python's read_file() method
|
|
2028
|
+
*
|
|
2029
|
+
* @param path - Path to the file to read.
|
|
2030
|
+
* @param offset - Optional: Line offset to start reading from.
|
|
2031
|
+
* @param length - Optional: Number of lines to read. If 0, reads the entire file.
|
|
2032
|
+
* @returns FileContentResult with file content and requestId
|
|
2033
|
+
*/
|
|
2034
|
+
readFile(path: string, offset?: number, length?: number): Promise<FileContentResult>;
|
|
2035
|
+
/**
|
|
2036
|
+
* Reads the content of multiple files.
|
|
2037
|
+
* Corresponds to Python's read_multiple_files() method
|
|
2038
|
+
*
|
|
2039
|
+
* @param paths - Array of file paths to read.
|
|
2040
|
+
* @returns MultipleFileContentResult with file contents and requestId
|
|
2041
|
+
*/
|
|
2042
|
+
readMultipleFiles(paths: string[]): Promise<MultipleFileContentResult>;
|
|
2043
|
+
/**
|
|
2044
|
+
* Searches for files in a directory that match a pattern.
|
|
2045
|
+
* Corresponds to Python's search_files() method
|
|
2046
|
+
*
|
|
2047
|
+
* @param path - Path to the directory to search in.
|
|
2048
|
+
* @param pattern - Pattern to search for. Supports glob patterns.
|
|
2049
|
+
* @param excludePatterns - Optional: Array of patterns to exclude.
|
|
2050
|
+
* @returns FileSearchResult with search results and requestId
|
|
2051
|
+
*/
|
|
2052
|
+
searchFiles(path: string, pattern: string, excludePatterns?: string[]): Promise<FileSearchResult>;
|
|
2053
|
+
/**
|
|
2054
|
+
* Writes content to a file.
|
|
2055
|
+
* Corresponds to Python's write_file() method
|
|
2056
|
+
*
|
|
2057
|
+
* @param path - Path to the file to write.
|
|
2058
|
+
* @param content - Content to write to the file.
|
|
2059
|
+
* @param mode - Optional: Write mode. One of "overwrite", "append", or "create_new". Default is "overwrite".
|
|
2060
|
+
* @returns BoolResult with write result and requestId
|
|
2061
|
+
*/
|
|
2062
|
+
writeFile(path: string, content: string, mode?: string): Promise<BoolResult>;
|
|
2063
|
+
/**
|
|
2064
|
+
* Reads a large file in chunks to handle size limitations of the underlying API.
|
|
2065
|
+
* Corresponds to Python's read_large_file() method
|
|
2066
|
+
*
|
|
2067
|
+
* @param path - Path to the file to read.
|
|
2068
|
+
* @param chunkSize - Optional: Size of each chunk in bytes. Default is 60KB.
|
|
2069
|
+
* @returns FileContentResult with complete file content and requestId
|
|
2070
|
+
*/
|
|
2071
|
+
readLargeFile(path: string, chunkSize?: number): Promise<FileContentResult>;
|
|
2072
|
+
/**
|
|
2073
|
+
* Writes a large file in chunks to handle size limitations of the underlying API.
|
|
2074
|
+
* Corresponds to Python's write_large_file() method
|
|
2075
|
+
*
|
|
2076
|
+
* @param path - Path to the file to write.
|
|
2077
|
+
* @param content - Content to write to the file.
|
|
2078
|
+
* @param chunkSize - Optional: Size of each chunk in bytes. Default is 60KB.
|
|
2079
|
+
* @returns BoolResult indicating success or failure with requestId
|
|
2080
|
+
*/
|
|
2081
|
+
writeLargeFile(path: string, content: string, chunkSize?: number): Promise<BoolResult>;
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
/**
|
|
2085
|
+
* Handles Object Storage Service operations in the AgentBay cloud environment.
|
|
2086
|
+
*/
|
|
2087
|
+
declare class Oss {
|
|
2088
|
+
private session;
|
|
2089
|
+
private client;
|
|
2090
|
+
private baseUrl;
|
|
2091
|
+
/**
|
|
2092
|
+
* Initialize an Oss object.
|
|
2093
|
+
*
|
|
2094
|
+
* @param session - The Session instance that this Oss belongs to.
|
|
2095
|
+
*/
|
|
2096
|
+
constructor(session: Session);
|
|
2097
|
+
/**
|
|
2098
|
+
* Helper method to call MCP tools and handle common response processing
|
|
2099
|
+
*
|
|
2100
|
+
* @param toolName - Name of the MCP tool to call
|
|
2101
|
+
* @param args - Arguments to pass to the tool
|
|
2102
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
2103
|
+
* @returns A CallMcpToolResult with the response data
|
|
2104
|
+
* @throws APIError if the call fails
|
|
2105
|
+
*/
|
|
2106
|
+
private callMcpTool;
|
|
2107
|
+
/**
|
|
2108
|
+
* Initialize OSS environment variables with the specified credentials.
|
|
2109
|
+
* Corresponds to Python's env_init() method
|
|
2110
|
+
*
|
|
2111
|
+
* @param accessKeyId - The Access Key ID for OSS authentication.
|
|
2112
|
+
* @param accessKeySecret - The Access Key Secret for OSS authentication.
|
|
2113
|
+
* @param securityToken - The security token for OSS authentication.
|
|
2114
|
+
* @param endpoint - The OSS service endpoint. If not specified, the default is used.
|
|
2115
|
+
* @param region - The OSS region. If not specified, the default is used.
|
|
2116
|
+
* @returns OSSClientResult with initialization result and requestId
|
|
2117
|
+
*/
|
|
2118
|
+
envInit(accessKeyId: string, accessKeySecret: string, securityToken?: string, endpoint?: string, region?: string): Promise<OSSClientResult>;
|
|
2119
|
+
/**
|
|
2120
|
+
* Upload a local file or directory to OSS.
|
|
2121
|
+
* Corresponds to Python's upload() method
|
|
2122
|
+
*
|
|
2123
|
+
* @param bucket - OSS bucket name.
|
|
2124
|
+
* @param object - ObjectS.
|
|
2125
|
+
* @param path - Local file or directory path to upload.
|
|
2126
|
+
* @returns OSSUploadResult with upload result and requestId
|
|
2127
|
+
*/
|
|
2128
|
+
upload(bucket: string, object: string, path: string): Promise<OSSUploadResult>;
|
|
2129
|
+
/**
|
|
2130
|
+
* Upload a local file or directory to OSS using a pre-signed URL.
|
|
2131
|
+
* Corresponds to Python's upload_anonymous() method
|
|
2132
|
+
*
|
|
2133
|
+
* @param url - Pre-signed URL for anonymous upload.
|
|
2134
|
+
* @param path - Local file or directory path to upload.
|
|
2135
|
+
* @returns OSSUploadResult with upload result and requestId
|
|
2136
|
+
*/
|
|
2137
|
+
uploadAnonymous(url: string, path: string): Promise<OSSUploadResult>;
|
|
2138
|
+
/**
|
|
2139
|
+
* Download an object from OSS to a local file or directory.
|
|
2140
|
+
* Corresponds to Python's download() method
|
|
2141
|
+
*
|
|
2142
|
+
* @param bucket - OSS bucket name.
|
|
2143
|
+
* @param object - Object key in OSS.
|
|
2144
|
+
* @param path - Local file or directory path to save the downloaded content.
|
|
2145
|
+
* @returns OSSDownloadResult with download result and requestId
|
|
2146
|
+
*/
|
|
2147
|
+
download(bucket: string, object: string, path: string): Promise<OSSDownloadResult>;
|
|
2148
|
+
/**
|
|
2149
|
+
* Download an object from OSS using a pre-signed URL.
|
|
2150
|
+
* Corresponds to Python's download_anonymous() method
|
|
2151
|
+
*
|
|
2152
|
+
* @param url - Pre-signed URL for anonymous download.
|
|
2153
|
+
* @param path - Local file or directory path to save the downloaded content.
|
|
2154
|
+
* @returns OSSDownloadResult with download result and requestId
|
|
2155
|
+
*/
|
|
2156
|
+
downloadAnonymous(url: string, path: string): Promise<OSSDownloadResult>;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
/**
|
|
2160
|
+
* Interface representing a UI element in the UI hierarchy
|
|
2161
|
+
*/
|
|
2162
|
+
interface UIElement {
|
|
2163
|
+
bounds: string;
|
|
2164
|
+
className: string;
|
|
2165
|
+
text: string;
|
|
2166
|
+
type: string;
|
|
2167
|
+
resourceId: string;
|
|
2168
|
+
index: number;
|
|
2169
|
+
isParent: boolean;
|
|
2170
|
+
children?: UIElement[];
|
|
2171
|
+
}
|
|
2172
|
+
/**
|
|
2173
|
+
* KeyCode constants for mobile device input
|
|
2174
|
+
*/
|
|
2175
|
+
declare const KeyCode: {
|
|
2176
|
+
HOME: number;
|
|
2177
|
+
BACK: number;
|
|
2178
|
+
VOLUME_UP: number;
|
|
2179
|
+
VOLUME_DOWN: number;
|
|
2180
|
+
POWER: number;
|
|
2181
|
+
MENU: number;
|
|
2182
|
+
};
|
|
2183
|
+
/**
|
|
2184
|
+
* UI handles UI operations in the AgentBay cloud environment.
|
|
2185
|
+
*/
|
|
2186
|
+
declare class UI {
|
|
2187
|
+
private session;
|
|
2188
|
+
/**
|
|
2189
|
+
* Initialize a UI object.
|
|
2190
|
+
*
|
|
2191
|
+
* @param session - The Session instance that this UI belongs to.
|
|
2192
|
+
*/
|
|
2193
|
+
constructor(session: Session);
|
|
2194
|
+
/**
|
|
2195
|
+
* Helper method to call MCP tools and handle common response processing
|
|
2196
|
+
*
|
|
2197
|
+
* @param toolName - Name of the MCP tool to call
|
|
2198
|
+
* @param args - Arguments to pass to the tool
|
|
2199
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
2200
|
+
* @returns A CallMcpToolResult with the response data
|
|
2201
|
+
* @throws APIError if the call fails
|
|
2202
|
+
*/
|
|
2203
|
+
private callMcpTool;
|
|
2204
|
+
/**
|
|
2205
|
+
* Retrieves all clickable UI elements within the specified timeout.
|
|
2206
|
+
* Corresponds to Python's get_clickable_ui_elements() method
|
|
2207
|
+
*
|
|
2208
|
+
* @param timeoutMs - The timeout in milliseconds. Default is 2000ms.
|
|
2209
|
+
* @returns UIElementListResult with clickable UI elements and requestId
|
|
2210
|
+
*/
|
|
2211
|
+
getClickableUIElements(timeoutMs?: number): Promise<UIElementListResult>;
|
|
2212
|
+
/**
|
|
2213
|
+
* Retrieves all UI elements within the specified timeout.
|
|
2214
|
+
* Corresponds to Python's get_all_ui_elements() method
|
|
2215
|
+
*
|
|
2216
|
+
* @param timeoutMs - The timeout in milliseconds. Default is 2000ms.
|
|
2217
|
+
* @returns UIElementListResult with all UI elements and requestId
|
|
2218
|
+
*/
|
|
2219
|
+
getAllUIElements(timeoutMs?: number): Promise<UIElementListResult>;
|
|
2220
|
+
/**
|
|
2221
|
+
* Sends a key press event.
|
|
2222
|
+
* Corresponds to Python's send_key() method
|
|
2223
|
+
*
|
|
2224
|
+
* @param key - The key code to send.
|
|
2225
|
+
* @returns BoolResult with key press result and requestId
|
|
2226
|
+
*/
|
|
2227
|
+
sendKey(key: number): Promise<BoolResult>;
|
|
2228
|
+
/**
|
|
2229
|
+
* Inputs text into the active field.
|
|
2230
|
+
* Corresponds to Python's input_text() method
|
|
2231
|
+
*
|
|
2232
|
+
* @param text - The text to input.
|
|
2233
|
+
* @returns BoolResult with input result and requestId
|
|
2234
|
+
*/
|
|
2235
|
+
inputText(text: string): Promise<BoolResult>;
|
|
2236
|
+
/**
|
|
2237
|
+
* Performs a swipe gesture on the screen.
|
|
2238
|
+
* Corresponds to Python's swipe() method
|
|
2239
|
+
*
|
|
2240
|
+
* @param startX - The starting X coordinate.
|
|
2241
|
+
* @param startY - The starting Y coordinate.
|
|
2242
|
+
* @param endX - The ending X coordinate.
|
|
2243
|
+
* @param endY - The ending Y coordinate.
|
|
2244
|
+
* @param durationMs - The duration of the swipe in milliseconds. Default is 300ms.
|
|
2245
|
+
* @returns BoolResult with swipe result and requestId
|
|
2246
|
+
*/
|
|
2247
|
+
swipe(startX: number, startY: number, endX: number, endY: number, durationMs?: number): Promise<BoolResult>;
|
|
2248
|
+
/**
|
|
2249
|
+
* Performs a click at the specified coordinates.
|
|
2250
|
+
* Corresponds to Python's click() method
|
|
2251
|
+
*
|
|
2252
|
+
* @param x - The X coordinate.
|
|
2253
|
+
* @param y - The Y coordinate.
|
|
2254
|
+
* @param button - The mouse button to click. Default is 'left'.
|
|
2255
|
+
* @returns BoolResult with click result and requestId
|
|
2256
|
+
*/
|
|
2257
|
+
click(x: number, y: number, button?: string): Promise<BoolResult>;
|
|
2258
|
+
/**
|
|
2259
|
+
* Takes a screenshot of the current screen.
|
|
2260
|
+
* Corresponds to Python's screenshot() method
|
|
2261
|
+
*
|
|
2262
|
+
* @returns OperationResult with screenshot data and requestId
|
|
2263
|
+
*/
|
|
2264
|
+
screenshot(): Promise<OperationResult>;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
/**
|
|
2268
|
+
* Handles window management operations in the AgentBay cloud environment.
|
|
2269
|
+
*/
|
|
2270
|
+
declare class WindowManager {
|
|
2271
|
+
private session;
|
|
2272
|
+
/**
|
|
2273
|
+
* Creates a new WindowManager instance.
|
|
2274
|
+
* @param session The session object that provides access to the AgentBay API.
|
|
2275
|
+
*/
|
|
2276
|
+
constructor(session: {
|
|
2277
|
+
getAPIKey(): string;
|
|
2278
|
+
getClient(): any;
|
|
2279
|
+
getSessionId(): string;
|
|
2280
|
+
});
|
|
2281
|
+
/**
|
|
2282
|
+
* Helper method to call MCP tools and handle common response processing
|
|
2283
|
+
*
|
|
2284
|
+
* @param toolName - Name of the MCP tool to call
|
|
2285
|
+
* @param args - Arguments to pass to the tool
|
|
2286
|
+
* @param defaultErrorMsg - Default error message if specific error details are not available
|
|
2287
|
+
* @returns A CallMcpToolResult with the response data
|
|
2288
|
+
* @throws APIError if the call fails
|
|
2289
|
+
*/
|
|
2290
|
+
private callMcpTool;
|
|
2291
|
+
/**
|
|
2292
|
+
* Helper method to parse JSON string into Window objects
|
|
2293
|
+
* @param jsonStr - JSON string to parse
|
|
2294
|
+
* @returns Array of Window objects or single Window object
|
|
2295
|
+
*/
|
|
2296
|
+
private parseWindowsFromJSON;
|
|
2297
|
+
/**
|
|
2298
|
+
* Lists all root windows in the system.
|
|
2299
|
+
* Corresponds to Python's list_root_windows() method
|
|
2300
|
+
*
|
|
2301
|
+
* @param timeoutMs - The timeout in milliseconds. Default is 3000ms.
|
|
2302
|
+
* @returns WindowListResult with windows array and requestId
|
|
2303
|
+
*/
|
|
2304
|
+
listRootWindows(timeoutMs?: number): Promise<WindowListResult>;
|
|
2305
|
+
/**
|
|
2306
|
+
* Gets the currently active window.
|
|
2307
|
+
* Corresponds to Python's get_active_window() method
|
|
2308
|
+
*
|
|
2309
|
+
* @param timeoutMs - The timeout in milliseconds. Default is 3000ms.
|
|
2310
|
+
* @returns WindowInfoResult with active window data and requestId
|
|
2311
|
+
*/
|
|
2312
|
+
getActiveWindow(timeoutMs?: number): Promise<WindowInfoResult>;
|
|
2313
|
+
/**
|
|
2314
|
+
* Activates a window by ID.
|
|
2315
|
+
* Corresponds to Python's activate_window() method
|
|
2316
|
+
*
|
|
2317
|
+
* @param windowId The ID of the window to activate.
|
|
2318
|
+
* @returns BoolResult with requestId
|
|
2319
|
+
*/
|
|
2320
|
+
activateWindow(windowId: number): Promise<BoolResult>;
|
|
2321
|
+
/**
|
|
2322
|
+
* Maximizes a window by ID.
|
|
2323
|
+
* Corresponds to Python's maximize_window() method
|
|
2324
|
+
*
|
|
2325
|
+
* @param windowId The ID of the window to maximize.
|
|
2326
|
+
* @returns BoolResult with requestId
|
|
2327
|
+
*/
|
|
2328
|
+
maximizeWindow(windowId: number): Promise<BoolResult>;
|
|
2329
|
+
/**
|
|
2330
|
+
* Minimizes a window by ID.
|
|
2331
|
+
* Corresponds to Python's minimize_window() method
|
|
2332
|
+
*
|
|
2333
|
+
* @param windowId The ID of the window to minimize.
|
|
2334
|
+
* @returns BoolResult with requestId
|
|
2335
|
+
*/
|
|
2336
|
+
minimizeWindow(windowId: number): Promise<BoolResult>;
|
|
2337
|
+
/**
|
|
2338
|
+
* Restores a window by ID.
|
|
2339
|
+
* Corresponds to Python's restore_window() method
|
|
2340
|
+
*
|
|
2341
|
+
* @param windowId The ID of the window to restore.
|
|
2342
|
+
* @returns BoolResult with requestId
|
|
2343
|
+
*/
|
|
2344
|
+
restoreWindow(windowId: number): Promise<BoolResult>;
|
|
2345
|
+
/**
|
|
2346
|
+
* Closes a window by ID.
|
|
2347
|
+
* Corresponds to Python's close_window() method
|
|
2348
|
+
*
|
|
2349
|
+
* @param windowId The ID of the window to close.
|
|
2350
|
+
* @returns BoolResult with requestId
|
|
2351
|
+
*/
|
|
2352
|
+
closeWindow(windowId: number): Promise<BoolResult>;
|
|
2353
|
+
/**
|
|
2354
|
+
* Sets a window to fullscreen by ID.
|
|
2355
|
+
* Corresponds to Python's fullscreen_window() method
|
|
2356
|
+
*
|
|
2357
|
+
* @param windowId The ID of the window to set to fullscreen.
|
|
2358
|
+
* @returns BoolResult with requestId
|
|
2359
|
+
*/
|
|
2360
|
+
fullscreenWindow(windowId: number): Promise<BoolResult>;
|
|
2361
|
+
/**
|
|
2362
|
+
* Resizes a window by ID.
|
|
2363
|
+
* Corresponds to Python's resize_window() method
|
|
2364
|
+
*
|
|
2365
|
+
* @param windowId The ID of the window to resize.
|
|
2366
|
+
* @param width The new width of the window.
|
|
2367
|
+
* @param height The new height of the window.
|
|
2368
|
+
* @returns BoolResult with requestId
|
|
2369
|
+
*/
|
|
2370
|
+
resizeWindow(windowId: number, width: number, height: number): Promise<BoolResult>;
|
|
2371
|
+
/**
|
|
2372
|
+
* Enables or disables focus mode.
|
|
2373
|
+
* Corresponds to Python's focus_mode() method
|
|
2374
|
+
*
|
|
2375
|
+
* @param on Whether to enable focus mode.
|
|
2376
|
+
* @returns BoolResult with requestId
|
|
2377
|
+
*/
|
|
2378
|
+
focusMode(on: boolean): Promise<BoolResult>;
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
/**
|
|
2382
|
+
* Represents a session in the AgentBay cloud environment.
|
|
2383
|
+
*/
|
|
2384
|
+
declare class Session {
|
|
2385
|
+
private agentBay;
|
|
2386
|
+
sessionId: string;
|
|
2387
|
+
resourceUrl: string;
|
|
2388
|
+
fileSystem: FileSystem;
|
|
2389
|
+
command: Command;
|
|
2390
|
+
oss: Oss;
|
|
2391
|
+
application: Application;
|
|
2392
|
+
window: WindowManager;
|
|
2393
|
+
ui: UI;
|
|
2394
|
+
context: ContextManager;
|
|
2395
|
+
/**
|
|
2396
|
+
* Initialize a Session object.
|
|
2397
|
+
*
|
|
2398
|
+
* @param agentBay - The AgentBay instance that created this session.
|
|
2399
|
+
* @param sessionId - The ID of this session.
|
|
2400
|
+
*/
|
|
2401
|
+
constructor(agentBay: AgentBay, sessionId: string);
|
|
2402
|
+
/**
|
|
2403
|
+
* Return the API key for this session.
|
|
2404
|
+
*/
|
|
2405
|
+
getAPIKey(): string;
|
|
2406
|
+
/**
|
|
2407
|
+
* Return the HTTP client for this session.
|
|
2408
|
+
*/
|
|
2409
|
+
getClient(): Client;
|
|
2410
|
+
/**
|
|
2411
|
+
* Return the session_id for this session.
|
|
2412
|
+
*/
|
|
2413
|
+
getSessionId(): string;
|
|
2414
|
+
/**
|
|
2415
|
+
* Delete this session.
|
|
2416
|
+
*
|
|
2417
|
+
* @returns DeleteResult indicating success or failure and request ID
|
|
2418
|
+
*/
|
|
2419
|
+
delete(): Promise<DeleteResult>;
|
|
2420
|
+
/**
|
|
2421
|
+
* Sets the labels for this session.
|
|
2422
|
+
*
|
|
2423
|
+
* @param labels - The labels to set for the session.
|
|
2424
|
+
* @returns OperationResult indicating success or failure with request ID
|
|
2425
|
+
* @throws Error if the operation fails (matching Python SessionError)
|
|
2426
|
+
*/
|
|
2427
|
+
setLabels(labels: Record<string, string>): Promise<OperationResult>;
|
|
2428
|
+
/**
|
|
2429
|
+
* Gets the labels for this session.
|
|
2430
|
+
*
|
|
2431
|
+
* @returns OperationResult containing the labels as data and request ID
|
|
2432
|
+
* @throws Error if the operation fails (matching Python SessionError)
|
|
2433
|
+
*/
|
|
2434
|
+
getLabels(): Promise<OperationResult>;
|
|
2435
|
+
/**
|
|
2436
|
+
* Gets information about this session.
|
|
2437
|
+
*
|
|
2438
|
+
* @returns OperationResult containing the session information as data and request ID
|
|
2439
|
+
* @throws Error if the operation fails (matching Python SessionError)
|
|
2440
|
+
*/
|
|
2441
|
+
info(): Promise<OperationResult>;
|
|
2442
|
+
/**
|
|
2443
|
+
* Get a link associated with the current session.
|
|
2444
|
+
*
|
|
2445
|
+
* @param protocolType - Optional protocol type to use for the link
|
|
2446
|
+
* @param port - Optional port to use for the link
|
|
2447
|
+
* @returns OperationResult containing the link as data and request ID
|
|
2448
|
+
* @throws Error if the operation fails (matching Python SessionError)
|
|
2449
|
+
*/
|
|
2450
|
+
getLink(protocolType?: string, port?: number): Promise<OperationResult>;
|
|
2451
|
+
/**
|
|
2452
|
+
* Asynchronously get a link associated with the current session.
|
|
2453
|
+
*
|
|
2454
|
+
* @param protocolType - Optional protocol type to use for the link
|
|
2455
|
+
* @param port - Optional port to use for the link
|
|
2456
|
+
* @returns OperationResult containing the link as data and request ID
|
|
2457
|
+
* @throws Error if the operation fails (matching Python SessionError)
|
|
2458
|
+
*/
|
|
2459
|
+
getLinkAsync(protocolType?: string, port?: number): Promise<OperationResult>;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
/**
|
|
2463
|
+
* Parameters for listing sessions with pagination support
|
|
2464
|
+
*/
|
|
2465
|
+
interface ListSessionParams {
|
|
2466
|
+
/** Number of results per page (default: 10) */
|
|
2467
|
+
maxResults?: number;
|
|
2468
|
+
/** Token for the next page */
|
|
2469
|
+
nextToken?: string;
|
|
2470
|
+
/** Labels to filter by */
|
|
2471
|
+
labels: Record<string, string>;
|
|
2472
|
+
}
|
|
2473
|
+
/**
|
|
2474
|
+
* Result type for session listing with pagination information
|
|
2475
|
+
* Maintain consistency with the existing TypeScript SDK return structure and use the data field
|
|
2476
|
+
*/
|
|
2477
|
+
interface SessionListResult extends ApiResponse {
|
|
2478
|
+
/** Array of sessions */
|
|
2479
|
+
data: Session[];
|
|
2480
|
+
/** Token for the next page (if available) */
|
|
2481
|
+
nextToken?: string;
|
|
2482
|
+
/** Number of results per page */
|
|
2483
|
+
maxResults?: number;
|
|
2484
|
+
/** Total number of results */
|
|
2485
|
+
totalCount?: number;
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
/**
|
|
2489
|
+
* Parameters for creating a session.
|
|
2490
|
+
*/
|
|
2491
|
+
interface CreateSessionParams {
|
|
2492
|
+
contextId?: string;
|
|
2493
|
+
labels?: Record<string, string>;
|
|
2494
|
+
imageId?: string;
|
|
2495
|
+
contextSync?: ContextSync[];
|
|
2496
|
+
}
|
|
2497
|
+
/**
|
|
2498
|
+
* Main class for interacting with the AgentBay cloud runtime environment.
|
|
2499
|
+
*/
|
|
2500
|
+
declare class AgentBay {
|
|
2501
|
+
private apiKey;
|
|
2502
|
+
private client;
|
|
2503
|
+
private regionId;
|
|
2504
|
+
private endpoint;
|
|
2505
|
+
private sessions;
|
|
2506
|
+
/**
|
|
2507
|
+
* Context service for managing persistent contexts.
|
|
2508
|
+
*/
|
|
2509
|
+
context: ContextService;
|
|
2510
|
+
/**
|
|
2511
|
+
* Initialize the AgentBay client.
|
|
2512
|
+
*
|
|
2513
|
+
* @param options - Configuration options
|
|
2514
|
+
* @param options.apiKey - API key for authentication. If not provided, will look for AGENTBAY_API_KEY environment variable.
|
|
2515
|
+
* @param options.config - Custom configuration object. If not provided, will use environment-based configuration.
|
|
2516
|
+
*/
|
|
2517
|
+
constructor(options?: {
|
|
2518
|
+
apiKey?: string;
|
|
2519
|
+
config?: Config;
|
|
2520
|
+
});
|
|
2521
|
+
/**
|
|
2522
|
+
* Create a new session in the AgentBay cloud environment.
|
|
2523
|
+
*
|
|
2524
|
+
* @param params - Optional parameters for creating the session
|
|
2525
|
+
* @returns SessionResult containing the created session and request ID
|
|
2526
|
+
*/
|
|
2527
|
+
create(params?: CreateSessionParams): Promise<SessionResult>;
|
|
2528
|
+
/**
|
|
2529
|
+
* List all available sessions.
|
|
2530
|
+
*
|
|
2531
|
+
* @returns A list of session objects.
|
|
2532
|
+
*/
|
|
2533
|
+
list(): Session[];
|
|
2534
|
+
/**
|
|
2535
|
+
* List sessions filtered by the provided labels with pagination support.
|
|
2536
|
+
* It returns sessions that match all the specified labels.
|
|
2537
|
+
*
|
|
2538
|
+
* **Breaking Change**: This method currently only accepts ListSessionParams parameters,
|
|
2539
|
+
*
|
|
2540
|
+
* @param params - Parameters including labels and pagination options (required)
|
|
2541
|
+
* @returns API response with sessions list and pagination info
|
|
2542
|
+
*/
|
|
2543
|
+
listByLabels(params?: ListSessionParams): Promise<SessionListResult>;
|
|
2544
|
+
/**
|
|
2545
|
+
* Delete a session by session object.
|
|
2546
|
+
*
|
|
2547
|
+
* @param session - The session to delete.
|
|
2548
|
+
* @returns DeleteResult indicating success or failure and request ID
|
|
2549
|
+
*/
|
|
2550
|
+
delete(session: Session): Promise<DeleteResult>;
|
|
2551
|
+
/**
|
|
2552
|
+
*
|
|
2553
|
+
* @param sessionId - The ID of the session to remove.
|
|
2554
|
+
*/
|
|
2555
|
+
removeSession(sessionId: string): void;
|
|
2556
|
+
getClient(): Client;
|
|
2557
|
+
getAPIKey(): string;
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
/**
|
|
2561
|
+
* Base exception for all AgentBay SDK errors.
|
|
2562
|
+
*/
|
|
2563
|
+
declare class AgentBayError extends Error {
|
|
2564
|
+
extra: Record<string, any>;
|
|
2565
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2566
|
+
}
|
|
2567
|
+
/**
|
|
2568
|
+
* Raised when there is an authentication error.
|
|
2569
|
+
*/
|
|
2570
|
+
declare class AuthenticationError extends AgentBayError {
|
|
2571
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2572
|
+
}
|
|
2573
|
+
/**
|
|
2574
|
+
* Raised when there is an error with the API.
|
|
2575
|
+
*/
|
|
2576
|
+
declare class APIError extends AgentBayError {
|
|
2577
|
+
statusCode?: number;
|
|
2578
|
+
constructor(message?: string, statusCode?: number, extra?: Record<string, any>);
|
|
2579
|
+
}
|
|
2580
|
+
/**
|
|
2581
|
+
* Raised for errors related to file operations.
|
|
2582
|
+
*/
|
|
2583
|
+
declare class FileError extends AgentBayError {
|
|
2584
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2585
|
+
}
|
|
2586
|
+
/**
|
|
2587
|
+
* Raised for errors related to command execution.
|
|
2588
|
+
*/
|
|
2589
|
+
declare class CommandError extends AgentBayError {
|
|
2590
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2591
|
+
}
|
|
2592
|
+
/**
|
|
2593
|
+
* Raised for errors related to session operations.
|
|
2594
|
+
*/
|
|
2595
|
+
declare class SessionError extends AgentBayError {
|
|
2596
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2597
|
+
}
|
|
2598
|
+
/**
|
|
2599
|
+
* Raised for errors related to OSS operations.
|
|
2600
|
+
*/
|
|
2601
|
+
declare class OssError extends AgentBayError {
|
|
2602
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2603
|
+
}
|
|
2604
|
+
/**
|
|
2605
|
+
* Raised for errors related to application operations.
|
|
2606
|
+
*/
|
|
2607
|
+
declare class ApplicationError extends AgentBayError {
|
|
2608
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2609
|
+
}
|
|
2610
|
+
/**
|
|
2611
|
+
* Raised for errors related to UI operations.
|
|
2612
|
+
*/
|
|
2613
|
+
declare class UIError extends AgentBayError {
|
|
2614
|
+
constructor(message?: string, extra?: Record<string, any>);
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2617
|
+
/**
|
|
2618
|
+
* Utility functions for logging in a clean format
|
|
2619
|
+
*/
|
|
2620
|
+
/**
|
|
2621
|
+
* Log a message without the log prefix and file location
|
|
2622
|
+
* @param message The message to log
|
|
2623
|
+
* @param args Optional arguments to log
|
|
2624
|
+
*/
|
|
2625
|
+
declare function log(message: string, ...args: any[]): void;
|
|
2626
|
+
/**
|
|
2627
|
+
* Log an error message
|
|
2628
|
+
* @param message The error message to log
|
|
2629
|
+
* @param error Optional error object
|
|
2630
|
+
*/
|
|
2631
|
+
declare function logError(message: string, error?: any): void;
|
|
2632
|
+
|
|
2633
|
+
export { APIError, AgentBay, AgentBayError, Application, ApplicationError, ApplyMqttTokenRequest, ApplyMqttTokenResponse, ApplyMqttTokenResponseBody, ApplyMqttTokenResponseBodyData, AuthenticationError, CallMcpToolRequest, CallMcpToolResponse, CallMcpToolResponseBody, Client, Command, CommandError, Context, ContextService, CreateMcpSessionRequest, CreateMcpSessionRequestPersistenceDataList, CreateMcpSessionResponse, CreateMcpSessionResponseBody, CreateMcpSessionResponseBodyData, CreateMcpSessionShrinkRequest, DeleteContextRequest, DeleteContextResponse, DeleteContextResponseBody, type DirectoryEntry, 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, SetLabelRequest, SetLabelResponse, SetLabelResponseBody, SyncContextRequest, SyncContextResponse, SyncContextResponseBody, UI, type UIElement, UIError, log, logError };
|