@agentrun/sdk 0.0.1 → 0.0.2-test.20909811203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +0 -55
  2. package/dist/index.cjs +7758 -6535
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +4296 -0
  5. package/dist/index.d.ts +4296 -0
  6. package/dist/index.js +7673 -6490
  7. package/dist/index.js.map +1 -0
  8. package/package.json +23 -21
  9. package/dist/src/add.d.ts +0 -2
  10. package/dist/src/add.d.ts.map +0 -1
  11. package/dist/src/agent-runtime/api/control.d.ts +0 -190
  12. package/dist/src/agent-runtime/api/control.d.ts.map +0 -1
  13. package/dist/src/agent-runtime/api/data.d.ts +0 -38
  14. package/dist/src/agent-runtime/api/data.d.ts.map +0 -1
  15. package/dist/src/agent-runtime/api/index.d.ts +0 -5
  16. package/dist/src/agent-runtime/api/index.d.ts.map +0 -1
  17. package/dist/src/agent-runtime/client.d.ts +0 -146
  18. package/dist/src/agent-runtime/client.d.ts.map +0 -1
  19. package/dist/src/agent-runtime/endpoint.d.ts +0 -132
  20. package/dist/src/agent-runtime/endpoint.d.ts.map +0 -1
  21. package/dist/src/agent-runtime/index.d.ts +0 -12
  22. package/dist/src/agent-runtime/index.d.ts.map +0 -1
  23. package/dist/src/agent-runtime/model.d.ts +0 -327
  24. package/dist/src/agent-runtime/model.d.ts.map +0 -1
  25. package/dist/src/agent-runtime/runtime.d.ts +0 -203
  26. package/dist/src/agent-runtime/runtime.d.ts.map +0 -1
  27. package/dist/src/credential/api/control.d.ts +0 -90
  28. package/dist/src/credential/api/control.d.ts.map +0 -1
  29. package/dist/src/credential/api/index.d.ts +0 -5
  30. package/dist/src/credential/api/index.d.ts.map +0 -1
  31. package/dist/src/credential/client.d.ts +0 -57
  32. package/dist/src/credential/client.d.ts.map +0 -1
  33. package/dist/src/credential/credential.d.ts +0 -68
  34. package/dist/src/credential/credential.d.ts.map +0 -1
  35. package/dist/src/credential/index.d.ts +0 -9
  36. package/dist/src/credential/index.d.ts.map +0 -1
  37. package/dist/src/credential/model.d.ts +0 -116
  38. package/dist/src/credential/model.d.ts.map +0 -1
  39. package/dist/src/index.d.ts +0 -32
  40. package/dist/src/index.d.ts.map +0 -1
  41. package/dist/src/integration/adapter.d.ts +0 -128
  42. package/dist/src/integration/adapter.d.ts.map +0 -1
  43. package/dist/src/integration/index.d.ts +0 -14
  44. package/dist/src/integration/index.d.ts.map +0 -1
  45. package/dist/src/integration/mastra/adapter.d.ts +0 -112
  46. package/dist/src/integration/mastra/adapter.d.ts.map +0 -1
  47. package/dist/src/integration/mastra/index.d.ts +0 -15
  48. package/dist/src/integration/mastra/index.d.ts.map +0 -1
  49. package/dist/src/integration/mastra/types.d.ts +0 -62
  50. package/dist/src/integration/mastra/types.d.ts.map +0 -1
  51. package/dist/src/model/api/control.d.ts +0 -162
  52. package/dist/src/model/api/control.d.ts.map +0 -1
  53. package/dist/src/model/client.d.ts +0 -87
  54. package/dist/src/model/client.d.ts.map +0 -1
  55. package/dist/src/model/index.d.ts +0 -10
  56. package/dist/src/model/index.d.ts.map +0 -1
  57. package/dist/src/model/model-proxy.d.ts +0 -173
  58. package/dist/src/model/model-proxy.d.ts.map +0 -1
  59. package/dist/src/model/model-service.d.ts +0 -172
  60. package/dist/src/model/model-service.d.ts.map +0 -1
  61. package/dist/src/model/model.d.ts +0 -227
  62. package/dist/src/model/model.d.ts.map +0 -1
  63. package/dist/src/sandbox/aio-sandbox.d.ts +0 -235
  64. package/dist/src/sandbox/aio-sandbox.d.ts.map +0 -1
  65. package/dist/src/sandbox/api/aio-data.d.ts +0 -50
  66. package/dist/src/sandbox/api/aio-data.d.ts.map +0 -1
  67. package/dist/src/sandbox/api/browser-data.d.ts +0 -82
  68. package/dist/src/sandbox/api/browser-data.d.ts.map +0 -1
  69. package/dist/src/sandbox/api/code-interpreter-data.d.ts +0 -189
  70. package/dist/src/sandbox/api/code-interpreter-data.d.ts.map +0 -1
  71. package/dist/src/sandbox/api/control.d.ts +0 -146
  72. package/dist/src/sandbox/api/control.d.ts.map +0 -1
  73. package/dist/src/sandbox/api/sandbox-data.d.ts +0 -168
  74. package/dist/src/sandbox/api/sandbox-data.d.ts.map +0 -1
  75. package/dist/src/sandbox/browser-sandbox.d.ts +0 -91
  76. package/dist/src/sandbox/browser-sandbox.d.ts.map +0 -1
  77. package/dist/src/sandbox/client.d.ts +0 -122
  78. package/dist/src/sandbox/client.d.ts.map +0 -1
  79. package/dist/src/sandbox/code-interpreter-sandbox.d.ts +0 -218
  80. package/dist/src/sandbox/code-interpreter-sandbox.d.ts.map +0 -1
  81. package/dist/src/sandbox/index.d.ts +0 -16
  82. package/dist/src/sandbox/index.d.ts.map +0 -1
  83. package/dist/src/sandbox/model.d.ts +0 -231
  84. package/dist/src/sandbox/model.d.ts.map +0 -1
  85. package/dist/src/sandbox/sandbox.d.ts +0 -90
  86. package/dist/src/sandbox/sandbox.d.ts.map +0 -1
  87. package/dist/src/sandbox/template.d.ts +0 -115
  88. package/dist/src/sandbox/template.d.ts.map +0 -1
  89. package/dist/src/server/agui-protocol.d.ts +0 -127
  90. package/dist/src/server/agui-protocol.d.ts.map +0 -1
  91. package/dist/src/server/index.d.ts +0 -8
  92. package/dist/src/server/index.d.ts.map +0 -1
  93. package/dist/src/server/model.d.ts +0 -150
  94. package/dist/src/server/model.d.ts.map +0 -1
  95. package/dist/src/server/server.d.ts +0 -66
  96. package/dist/src/server/server.d.ts.map +0 -1
  97. package/dist/src/toolset/api/control.d.ts +0 -74
  98. package/dist/src/toolset/api/control.d.ts.map +0 -1
  99. package/dist/src/toolset/api/index.d.ts +0 -10
  100. package/dist/src/toolset/api/index.d.ts.map +0 -1
  101. package/dist/src/toolset/api/mcp.d.ts +0 -79
  102. package/dist/src/toolset/api/mcp.d.ts.map +0 -1
  103. package/dist/src/toolset/client.d.ts +0 -65
  104. package/dist/src/toolset/client.d.ts.map +0 -1
  105. package/dist/src/toolset/index.d.ts +0 -15
  106. package/dist/src/toolset/index.d.ts.map +0 -1
  107. package/dist/src/toolset/model.d.ts +0 -246
  108. package/dist/src/toolset/model.d.ts.map +0 -1
  109. package/dist/src/toolset/openapi.d.ts +0 -174
  110. package/dist/src/toolset/openapi.d.ts.map +0 -1
  111. package/dist/src/toolset/toolset.d.ts +0 -154
  112. package/dist/src/toolset/toolset.d.ts.map +0 -1
  113. package/dist/src/utils/config.d.ts +0 -124
  114. package/dist/src/utils/config.d.ts.map +0 -1
  115. package/dist/src/utils/control-api.d.ts +0 -24
  116. package/dist/src/utils/control-api.d.ts.map +0 -1
  117. package/dist/src/utils/data-api.d.ts +0 -163
  118. package/dist/src/utils/data-api.d.ts.map +0 -1
  119. package/dist/src/utils/exception.d.ts +0 -67
  120. package/dist/src/utils/exception.d.ts.map +0 -1
  121. package/dist/src/utils/helper.d.ts +0 -2
  122. package/dist/src/utils/helper.d.ts.map +0 -1
  123. package/dist/src/utils/index.d.ts +0 -9
  124. package/dist/src/utils/index.d.ts.map +0 -1
  125. package/dist/src/utils/log.d.ts +0 -25
  126. package/dist/src/utils/log.d.ts.map +0 -1
  127. package/dist/src/utils/model.d.ts +0 -77
  128. package/dist/src/utils/model.d.ts.map +0 -1
  129. package/dist/src/utils/resource.d.ts +0 -72
  130. package/dist/src/utils/resource.d.ts.map +0 -1
  131. package/dist/tests/e2e/a.test.d.ts +0 -2
  132. package/dist/tests/e2e/a.test.d.ts.map +0 -1
  133. package/dist/tests/e2e/agent-runtime/agent-runtime.test.d.ts +0 -14
  134. package/dist/tests/e2e/agent-runtime/agent-runtime.test.d.ts.map +0 -1
  135. package/dist/tests/e2e/credential/credential.test.d.ts +0 -2
  136. package/dist/tests/e2e/credential/credential.test.d.ts.map +0 -1
  137. package/dist/tests/e2e/model/model.test.d.ts +0 -20
  138. package/dist/tests/e2e/model/model.test.d.ts.map +0 -1
  139. package/dist/tests/e2e/model/model_service.test.d.ts +0 -12
  140. package/dist/tests/e2e/model/model_service.test.d.ts.map +0 -1
  141. package/dist/tests/e2e/sandbox/aio-sandbox.test.d.ts +0 -18
  142. package/dist/tests/e2e/sandbox/aio-sandbox.test.d.ts.map +0 -1
  143. package/dist/tests/e2e/sandbox/browser-sandbox.test.d.ts +0 -15
  144. package/dist/tests/e2e/sandbox/browser-sandbox.test.d.ts.map +0 -1
  145. package/dist/tests/e2e/sandbox/code-interpreter-sandbox.test.d.ts +0 -16
  146. package/dist/tests/e2e/sandbox/code-interpreter-sandbox.test.d.ts.map +0 -1
  147. package/dist/tests/e2e/sandbox/sandbox.test.d.ts +0 -13
  148. package/dist/tests/e2e/sandbox/sandbox.test.d.ts.map +0 -1
  149. package/dist/tests/e2e/sandbox/template.test.d.ts +0 -12
  150. package/dist/tests/e2e/sandbox/template.test.d.ts.map +0 -1
  151. package/dist/tests/e2e/toolset/toolset.test.d.ts +0 -2
  152. package/dist/tests/e2e/toolset/toolset.test.d.ts.map +0 -1
  153. package/dist/tests/integration/adapter.test.d.ts +0 -8
  154. package/dist/tests/integration/adapter.test.d.ts.map +0 -1
  155. package/dist/tests/setup.d.ts +0 -8
  156. package/dist/tests/setup.d.ts.map +0 -1
  157. package/dist/tests/unittests/integration/mastra.test.d.ts +0 -8
  158. package/dist/tests/unittests/integration/mastra.test.d.ts.map +0 -1
  159. package/dist/tests/unittests/server/agui-protocol.test.d.ts +0 -7
  160. package/dist/tests/unittests/server/agui-protocol.test.d.ts.map +0 -1
  161. package/dist/tests/unittests/server/server.test.d.ts +0 -7
  162. package/dist/tests/unittests/server/server.test.d.ts.map +0 -1
  163. package/dist/tests/unittests/toolset/openapi.test.d.ts +0 -10
  164. package/dist/tests/unittests/toolset/openapi.test.d.ts.map +0 -1
  165. package/dist/tests/unittests/toolset/toolset.test.d.ts +0 -8
  166. package/dist/tests/unittests/toolset/toolset.test.d.ts.map +0 -1
  167. package/dist/tests/unittests/utils/config.test.d.ts +0 -7
  168. package/dist/tests/unittests/utils/config.test.d.ts.map +0 -1
  169. package/dist/tests/unittests/utils/data-api.test.d.ts +0 -8
  170. package/dist/tests/unittests/utils/data-api.test.d.ts.map +0 -1
  171. package/dist/tests/unittests/utils/exception.test.d.ts +0 -5
  172. package/dist/tests/unittests/utils/exception.test.d.ts.map +0 -1
@@ -0,0 +1,4296 @@
1
+ import * as openai_core_streaming from 'openai/core/streaming';
2
+ import * as openai_resources from 'openai/resources';
3
+ import { ChatCompletionMessageParam } from 'openai/resources';
4
+ import * as $AgentRun from '@alicloud/agentrun20250910';
5
+ import * as ai from 'ai';
6
+ import * as $Devs from '@alicloud/devs20230714';
7
+
8
+ /**
9
+ * Configuration Management Module
10
+ *
11
+ * 此模块提供 AgentRun SDK 的全局配置管理功能。
12
+ * This module provides global configuration management for AgentRun SDK.
13
+ */
14
+ /**
15
+ * Configuration options for AgentRun SDK
16
+ */
17
+ interface ConfigOptions {
18
+ /**
19
+ * Access Key ID for authentication.
20
+ * Read from AGENTRUN_ACCESS_KEY_ID or ALIBABA_CLOUD_ACCESS_KEY_ID if not provided.
21
+ */
22
+ accessKeyId?: string;
23
+ /**
24
+ * Access Key Secret for authentication.
25
+ * Read from AGENTRUN_ACCESS_KEY_SECRET or ALIBABA_CLOUD_ACCESS_KEY_SECRET if not provided.
26
+ */
27
+ accessKeySecret?: string;
28
+ /**
29
+ * Security token for STS authentication.
30
+ * Read from AGENTRUN_SECURITY_TOKEN or ALIBABA_CLOUD_SECURITY_TOKEN if not provided.
31
+ */
32
+ securityToken?: string;
33
+ /**
34
+ * Account ID.
35
+ * Read from AGENTRUN_ACCOUNT_ID or FC_ACCOUNT_ID if not provided.
36
+ */
37
+ accountId?: string;
38
+ /**
39
+ * Custom token for data API calls.
40
+ */
41
+ token?: string;
42
+ /**
43
+ * Region ID. Defaults to cn-hangzhou.
44
+ * Read from AGENTRUN_REGION or FC_REGION if not provided.
45
+ */
46
+ regionId?: string;
47
+ /**
48
+ * Request timeout in milliseconds. Defaults to 600000 (10 minutes).
49
+ */
50
+ timeout?: number;
51
+ /**
52
+ * Read timeout in milliseconds. Defaults to 100000000.
53
+ */
54
+ readTimeout?: number;
55
+ /**
56
+ * Custom control API endpoint.
57
+ * Read from AGENTRUN_CONTROL_ENDPOINT if not provided.
58
+ */
59
+ controlEndpoint?: string;
60
+ /**
61
+ * Custom data API endpoint.
62
+ * Read from AGENTRUN_DATA_ENDPOINT if not provided.
63
+ */
64
+ dataEndpoint?: string;
65
+ /**
66
+ * Custom DevS API endpoint.
67
+ * Read from DEVS_ENDPOINT if not provided.
68
+ */
69
+ devsEndpoint?: string;
70
+ /**
71
+ * Custom request headers.
72
+ */
73
+ headers?: Record<string, string>;
74
+ }
75
+ /**
76
+ * AgentRun SDK Global Configuration Class
77
+ *
78
+ * 用于管理账号凭证和客户端配置。
79
+ * Used for managing account credentials and client configuration.
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * // Create config from parameters
84
+ * const config = new Config({
85
+ * accountId: 'your-account-id',
86
+ * accessKeyId: 'your-key-id',
87
+ * accessKeySecret: 'your-secret',
88
+ * });
89
+ *
90
+ * // Or read from environment variables
91
+ * const config = new Config();
92
+ * ```
93
+ */
94
+ declare class Config {
95
+ private _accessKeyId;
96
+ private _accessKeySecret;
97
+ private _securityToken;
98
+ private _accountId;
99
+ private _token?;
100
+ private _regionId;
101
+ private _timeout;
102
+ private _readTimeout;
103
+ private _controlEndpoint;
104
+ private _dataEndpoint;
105
+ private _devsEndpoint;
106
+ private _headers;
107
+ constructor(options?: ConfigOptions);
108
+ /**
109
+ * Create a new Config by merging multiple configs.
110
+ * Later configs take precedence.
111
+ */
112
+ static withConfigs(...configs: (Config | undefined)[]): Config;
113
+ /**
114
+ * Update this config with values from other configs.
115
+ * Non-undefined values from later configs take precedence.
116
+ */
117
+ update(...configs: (Config | undefined)[]): Config;
118
+ get accessKeyId(): string;
119
+ get accessKeySecret(): string;
120
+ get securityToken(): string;
121
+ get accountId(): string;
122
+ get token(): string | undefined;
123
+ get regionId(): string;
124
+ get timeout(): number;
125
+ get readTimeout(): number;
126
+ get controlEndpoint(): string;
127
+ get dataEndpoint(): string;
128
+ get devsEndpoint(): string;
129
+ get headers(): Record<string, string>;
130
+ }
131
+
132
+ /**
133
+ * Exception classes for AgentRun SDK
134
+ *
135
+ * 此模块定义 AgentRun SDK 的异常类。
136
+ * This module defines exception classes for AgentRun SDK.
137
+ */
138
+ /**
139
+ * Base error class for AgentRun SDK
140
+ */
141
+ declare class AgentRunError extends Error {
142
+ constructor(message: string);
143
+ }
144
+ /**
145
+ * HTTP error with status code and request ID
146
+ */
147
+ declare class HTTPError extends AgentRunError {
148
+ readonly statusCode: number;
149
+ readonly requestId?: string;
150
+ readonly errorCode?: string;
151
+ constructor(statusCode: number, message: string, options?: {
152
+ requestId?: string;
153
+ errorCode?: string;
154
+ });
155
+ /**
156
+ * Convert HTTP error to resource-specific error based on status code
157
+ */
158
+ toResourceError(resourceType: string, resourceId?: string): HTTPError;
159
+ }
160
+ /**
161
+ * Client-side error (4xx status codes)
162
+ */
163
+ declare class ClientError extends HTTPError {
164
+ constructor(statusCode: number, message: string, options?: {
165
+ requestId?: string;
166
+ errorCode?: string;
167
+ });
168
+ }
169
+ /**
170
+ * Server-side error (5xx status codes)
171
+ */
172
+ declare class ServerError extends HTTPError {
173
+ constructor(statusCode: number, message: string, options?: {
174
+ requestId?: string;
175
+ errorCode?: string;
176
+ });
177
+ }
178
+ /**
179
+ * Resource not found error
180
+ */
181
+ declare class ResourceNotExistError extends ClientError {
182
+ readonly resourceType: string;
183
+ readonly resourceId?: string;
184
+ constructor(resourceType: string, resourceId?: string, options?: {
185
+ requestId?: string;
186
+ });
187
+ }
188
+ /**
189
+ * Resource already exists error
190
+ */
191
+ declare class ResourceAlreadyExistError extends ClientError {
192
+ readonly resourceType: string;
193
+ readonly resourceId?: string;
194
+ constructor(resourceType: string, resourceId?: string, options?: {
195
+ requestId?: string;
196
+ });
197
+ }
198
+
199
+ /**
200
+ * Common data models for AgentRun SDK
201
+ *
202
+ * 此模块定义通用的数据模型。
203
+ * This module defines common data models.
204
+ */
205
+ /**
206
+ * Resource status enum
207
+ */
208
+ type Status = 'CREATING' | 'CREATE_FAILED' | 'READY' | 'UPDATING' | 'UPDATE_FAILED' | 'DELETING' | 'DELETE_FAILED';
209
+ declare const Status: {
210
+ CREATING: Status;
211
+ CREATE_FAILED: Status;
212
+ READY: Status;
213
+ UPDATING: Status;
214
+ UPDATE_FAILED: Status;
215
+ DELETING: Status;
216
+ DELETE_FAILED: Status;
217
+ };
218
+ /**
219
+ * Network mode enum
220
+ */
221
+ type NetworkMode = 'PUBLIC' | 'PRIVATE' | 'PUBLIC_AND_PRIVATE';
222
+ declare const NetworkMode: {
223
+ PUBLIC: NetworkMode;
224
+ PRIVATE: NetworkMode;
225
+ PUBLIC_AND_PRIVATE: NetworkMode;
226
+ };
227
+ /**
228
+ * Pageable input for list operations
229
+ */
230
+ interface PageableInput {
231
+ pageNumber?: number;
232
+ pageSize?: number;
233
+ }
234
+ /**
235
+ * Network configuration
236
+ */
237
+ interface NetworkConfig {
238
+ networkMode?: NetworkMode;
239
+ vpcId?: string;
240
+ vSwitchIds?: string[];
241
+ securityGroupId?: string;
242
+ }
243
+
244
+ /**
245
+ * Invoke arguments for OpenAI-compatible API
246
+ */
247
+ interface InvokeArgs {
248
+ /** Chat messages */
249
+ messages: ChatCompletionMessageParam[];
250
+ /** Whether to stream the response */
251
+ stream?: boolean;
252
+ /** Optional config override */
253
+ config?: Config;
254
+ }
255
+
256
+ /**
257
+ * Agent Runtime Data Models
258
+ *
259
+ * 此模块定义 Agent Runtime 相关的所有数据模型、枚举和输入输出对象。
260
+ * This module defines all data models, enums, and input/output objects related to Agent Runtime.
261
+ */
262
+
263
+ /**
264
+ * Agent Runtime artifact type
265
+ */
266
+ type AgentRuntimeArtifact = "Code" | "Container";
267
+ declare const AgentRuntimeArtifact: {
268
+ CODE: AgentRuntimeArtifact;
269
+ CONTAINER: AgentRuntimeArtifact;
270
+ };
271
+ /**
272
+ * Agent Runtime language
273
+ */
274
+ type AgentRuntimeLanguage = "python3.10" | "python3.12" | "nodejs18" | "nodejs20" | "java8" | "java11";
275
+ declare const AgentRuntimeLanguage: {
276
+ PYTHON310: AgentRuntimeLanguage;
277
+ PYTHON312: AgentRuntimeLanguage;
278
+ NODEJS18: AgentRuntimeLanguage;
279
+ NODEJS20: AgentRuntimeLanguage;
280
+ JAVA8: AgentRuntimeLanguage;
281
+ JAVA11: AgentRuntimeLanguage;
282
+ };
283
+ /**
284
+ * Agent Runtime protocol type
285
+ */
286
+ type AgentRuntimeProtocolType = "HTTP" | "MCP";
287
+ declare const AgentRuntimeProtocolType: {
288
+ HTTP: AgentRuntimeProtocolType;
289
+ MCP: AgentRuntimeProtocolType;
290
+ };
291
+ /**
292
+ * Agent Runtime code configuration
293
+ */
294
+ interface AgentRuntimeCode {
295
+ /** CRC-64 checksum of the code package */
296
+ checksum?: string;
297
+ /** Command to run in the runtime (e.g., ["python"]) */
298
+ command?: string[];
299
+ /** Programming language runtime */
300
+ language?: AgentRuntimeLanguage;
301
+ /** OSS bucket name */
302
+ ossBucketName?: string;
303
+ /** OSS object name */
304
+ ossObjectName?: string;
305
+ /** Base64 encoded ZIP file */
306
+ zipFile?: string;
307
+ }
308
+ /**
309
+ * Agent Runtime container configuration
310
+ */
311
+ interface AgentRuntimeContainer {
312
+ /** Command to run in the runtime */
313
+ command?: string[];
314
+ /** Container image address */
315
+ image?: string;
316
+ }
317
+ /**
318
+ * Agent Runtime health check configuration
319
+ */
320
+ interface AgentRuntimeHealthCheckConfig {
321
+ /** Failure threshold before marking unhealthy */
322
+ failureThreshold?: number;
323
+ /** HTTP GET URL for health check */
324
+ httpGetUrl?: string;
325
+ /** Initial delay before first health check (seconds) */
326
+ initialDelaySeconds?: number;
327
+ /** Health check interval (seconds) */
328
+ periodSeconds?: number;
329
+ /** Success threshold before marking healthy */
330
+ successThreshold?: number;
331
+ /** Health check timeout (seconds) */
332
+ timeoutSeconds?: number;
333
+ }
334
+ /**
335
+ * Agent Runtime log configuration
336
+ */
337
+ interface AgentRuntimeLogConfig {
338
+ /** SLS project name */
339
+ project: string;
340
+ /** SLS logstore name */
341
+ logstore: string;
342
+ }
343
+ /**
344
+ * Agent Runtime protocol configuration
345
+ */
346
+ interface AgentRuntimeProtocolConfig {
347
+ /** Protocol type */
348
+ type?: AgentRuntimeProtocolType;
349
+ }
350
+ /**
351
+ * Endpoint routing weight configuration
352
+ */
353
+ interface AgentRuntimeEndpointRoutingWeight {
354
+ /** Version identifier */
355
+ version?: string;
356
+ /** Weight value */
357
+ weight?: number;
358
+ }
359
+ /**
360
+ * Endpoint routing configuration
361
+ */
362
+ interface AgentRuntimeEndpointRoutingConfig {
363
+ /** Version weights list */
364
+ versionWeights?: AgentRuntimeEndpointRoutingWeight[];
365
+ }
366
+ /**
367
+ * Agent Runtime create input
368
+ */
369
+ interface AgentRuntimeCreateInput {
370
+ /** Agent Runtime name */
371
+ agentRuntimeName?: string;
372
+ /** Artifact type (Code or Container) */
373
+ artifactType?: AgentRuntimeArtifact;
374
+ /** Code configuration */
375
+ codeConfiguration?: AgentRuntimeCode;
376
+ /** Container configuration */
377
+ containerConfiguration?: AgentRuntimeContainer;
378
+ /** CPU cores */
379
+ cpu?: number;
380
+ /** Credential name */
381
+ credentialName?: string;
382
+ /** Description */
383
+ description?: string;
384
+ /** Environment variables */
385
+ environmentVariables?: Record<string, string>;
386
+ /** Execution role ARN */
387
+ executionRoleArn?: string;
388
+ /** Health check configuration */
389
+ healthCheckConfiguration?: AgentRuntimeHealthCheckConfig;
390
+ /** Log configuration */
391
+ logConfiguration?: AgentRuntimeLogConfig;
392
+ /** Memory in MB */
393
+ memory?: number;
394
+ /** Network configuration */
395
+ networkConfiguration?: NetworkConfig;
396
+ /** Port number */
397
+ port?: number;
398
+ /** Protocol configuration */
399
+ protocolConfiguration?: AgentRuntimeProtocolConfig;
400
+ /** Session concurrency limit per instance */
401
+ sessionConcurrencyLimitPerInstance?: number;
402
+ /** Session idle timeout in seconds */
403
+ sessionIdleTimeoutSeconds?: number;
404
+ /** Tags */
405
+ tags?: string[];
406
+ }
407
+ /**
408
+ * Agent Runtime update input
409
+ */
410
+ interface AgentRuntimeUpdateInput {
411
+ /** Agent Runtime name */
412
+ agentRuntimeName?: string;
413
+ /** Artifact type (Code or Container) */
414
+ artifactType?: AgentRuntimeArtifact;
415
+ /** Code configuration */
416
+ codeConfiguration?: AgentRuntimeCode;
417
+ /** Container configuration */
418
+ containerConfiguration?: AgentRuntimeContainer;
419
+ /** CPU cores */
420
+ cpu?: number;
421
+ /** Credential name */
422
+ credentialName?: string;
423
+ /** Description */
424
+ description?: string;
425
+ /** Environment variables */
426
+ environmentVariables?: Record<string, string>;
427
+ /** Execution role ARN */
428
+ executionRoleArn?: string;
429
+ /** Health check configuration */
430
+ healthCheckConfiguration?: AgentRuntimeHealthCheckConfig;
431
+ /** Log configuration */
432
+ logConfiguration?: AgentRuntimeLogConfig;
433
+ /** Memory in MB */
434
+ memory?: number;
435
+ /** Network configuration */
436
+ networkConfiguration?: NetworkConfig;
437
+ /** Port number */
438
+ port?: number;
439
+ /** Protocol configuration */
440
+ protocolConfiguration?: AgentRuntimeProtocolConfig;
441
+ /** Session concurrency limit per instance */
442
+ sessionConcurrencyLimitPerInstance?: number;
443
+ /** Session idle timeout in seconds */
444
+ sessionIdleTimeoutSeconds?: number;
445
+ /** Tags */
446
+ tags?: string[];
447
+ }
448
+ /**
449
+ * Agent Runtime list input
450
+ */
451
+ interface AgentRuntimeListInput extends PageableInput {
452
+ /** Filter by name */
453
+ agentRuntimeName?: string;
454
+ /** Filter by tags (comma separated) */
455
+ tags?: string;
456
+ /** Search mode */
457
+ searchMode?: string;
458
+ }
459
+ /**
460
+ * Agent Runtime endpoint create input
461
+ */
462
+ interface AgentRuntimeEndpointCreateInput {
463
+ /** Endpoint name */
464
+ agentRuntimeEndpointName?: string;
465
+ /** Description */
466
+ description?: string;
467
+ /** Routing configuration */
468
+ routingConfiguration?: AgentRuntimeEndpointRoutingConfig;
469
+ /** Tags */
470
+ tags?: string[];
471
+ /** Target version */
472
+ targetVersion?: string;
473
+ }
474
+ /**
475
+ * Agent Runtime endpoint update input
476
+ */
477
+ interface AgentRuntimeEndpointUpdateInput {
478
+ /** Endpoint name */
479
+ agentRuntimeEndpointName?: string;
480
+ /** Description */
481
+ description?: string;
482
+ /** Routing configuration */
483
+ routingConfiguration?: AgentRuntimeEndpointRoutingConfig;
484
+ /** Tags */
485
+ tags?: string[];
486
+ /** Target version */
487
+ targetVersion?: string;
488
+ }
489
+ /**
490
+ * Agent Runtime endpoint list input
491
+ */
492
+ interface AgentRuntimeEndpointListInput extends PageableInput {
493
+ /** Filter by endpoint name */
494
+ endpointName?: string;
495
+ /** Search mode */
496
+ searchMode?: string;
497
+ }
498
+ /**
499
+ * Agent Runtime version
500
+ */
501
+ interface AgentRuntimeVersion {
502
+ /** Agent Runtime ARN */
503
+ agentRuntimeArn?: string;
504
+ /** Agent Runtime ID */
505
+ agentRuntimeId?: string;
506
+ /** Agent Runtime name */
507
+ agentRuntimeName?: string;
508
+ /** Version number */
509
+ agentRuntimeVersion?: string;
510
+ /** Version description */
511
+ description?: string;
512
+ /** Last update timestamp */
513
+ lastUpdatedAt?: string;
514
+ }
515
+ /**
516
+ * Agent Runtime version list input
517
+ */
518
+ interface AgentRuntimeVersionListInput extends PageableInput {
519
+ }
520
+ /**
521
+ * Agent Runtime data (internal representation from API)
522
+ */
523
+ interface AgentRuntimeData {
524
+ agentRuntimeArn?: string;
525
+ agentRuntimeId?: string;
526
+ agentRuntimeName?: string;
527
+ agentRuntimeVersion?: string;
528
+ artifactType?: string;
529
+ codeConfiguration?: AgentRuntimeCode;
530
+ containerConfiguration?: AgentRuntimeContainer;
531
+ cpu?: number;
532
+ createdAt?: string;
533
+ credentialName?: string;
534
+ description?: string;
535
+ environmentVariables?: Record<string, string>;
536
+ executionRoleArn?: string;
537
+ healthCheckConfiguration?: AgentRuntimeHealthCheckConfig;
538
+ lastUpdatedAt?: string;
539
+ logConfiguration?: AgentRuntimeLogConfig;
540
+ memory?: number;
541
+ networkConfiguration?: NetworkConfig;
542
+ port?: number;
543
+ protocolConfiguration?: AgentRuntimeProtocolConfig;
544
+ resourceName?: string;
545
+ sessionConcurrencyLimitPerInstance?: number;
546
+ sessionIdleTimeoutSeconds?: number;
547
+ status?: Status;
548
+ statusReason?: string;
549
+ tags?: string[];
550
+ }
551
+ /**
552
+ * Agent Runtime endpoint data (internal representation from API)
553
+ */
554
+ interface AgentRuntimeEndpointData {
555
+ agentRuntimeEndpointArn?: string;
556
+ agentRuntimeEndpointId?: string;
557
+ agentRuntimeEndpointName?: string;
558
+ agentRuntimeId?: string;
559
+ description?: string;
560
+ endpointPublicUrl?: string;
561
+ resourceName?: string;
562
+ routingConfiguration?: AgentRuntimeEndpointRoutingConfig;
563
+ status?: Status;
564
+ statusReason?: string;
565
+ tags?: string[];
566
+ targetVersion?: string;
567
+ }
568
+
569
+ /**
570
+ * Agent Runtime Endpoint resource class
571
+ */
572
+ declare class AgentRuntimeEndpoint implements AgentRuntimeEndpointData {
573
+ agentRuntimeEndpointArn?: string;
574
+ agentRuntimeEndpointId?: string;
575
+ agentRuntimeEndpointName?: string;
576
+ agentRuntimeId?: string;
577
+ description?: string;
578
+ endpointPublicUrl?: string;
579
+ resourceName?: string;
580
+ routingConfiguration?: AgentRuntimeEndpointRoutingConfig;
581
+ status?: Status;
582
+ statusReason?: string;
583
+ tags?: string[];
584
+ targetVersion?: string;
585
+ private _config?;
586
+ private _dataApi?;
587
+ private _agentRuntimeName?;
588
+ constructor(data?: Partial<AgentRuntimeEndpointData>, config?: Config);
589
+ /**
590
+ * Create endpoint from SDK response object
591
+ */
592
+ static fromInnerObject(obj: $AgentRun.AgentRuntimeEndpoint, config?: Config): AgentRuntimeEndpoint;
593
+ private static getClient;
594
+ /**
595
+ * Create an endpoint by Agent Runtime ID
596
+ */
597
+ static create(params: {
598
+ agentRuntimeId: string;
599
+ input: AgentRuntimeEndpointCreateInput;
600
+ config?: Config;
601
+ }): Promise<AgentRuntimeEndpoint>;
602
+ /**
603
+ * Delete an endpoint by ID
604
+ */
605
+ static delete(params: {
606
+ agentRuntimeId: string;
607
+ endpointId: string;
608
+ config?: Config;
609
+ }): Promise<AgentRuntimeEndpoint>;
610
+ /**
611
+ * Update an endpoint by ID
612
+ */
613
+ static update(params: {
614
+ agentRuntimeId: string;
615
+ endpointId: string;
616
+ input: AgentRuntimeEndpointUpdateInput;
617
+ config?: Config;
618
+ }): Promise<AgentRuntimeEndpoint>;
619
+ /**
620
+ * Get an endpoint by ID
621
+ */
622
+ static get(params: {
623
+ agentRuntimeId: string;
624
+ endpointId: string;
625
+ config?: Config;
626
+ }): Promise<AgentRuntimeEndpoint>;
627
+ /**
628
+ * List endpoints by Agent Runtime ID
629
+ */
630
+ static listById(params: {
631
+ agentRuntimeId: string;
632
+ input?: AgentRuntimeEndpointListInput;
633
+ config?: Config;
634
+ }): Promise<AgentRuntimeEndpoint[]>;
635
+ /**
636
+ * Delete this endpoint
637
+ */
638
+ delete: (params?: {
639
+ config?: Config;
640
+ }) => Promise<AgentRuntimeEndpoint>;
641
+ /**
642
+ * Update this endpoint
643
+ */
644
+ update: (params: {
645
+ input: AgentRuntimeEndpointUpdateInput;
646
+ config?: Config;
647
+ }) => Promise<AgentRuntimeEndpoint>;
648
+ /**
649
+ * Refresh this endpoint's data
650
+ */
651
+ refresh: (params?: {
652
+ config?: Config;
653
+ }) => Promise<AgentRuntimeEndpoint>;
654
+ /**
655
+ * Wait until the endpoint is ready
656
+ */
657
+ waitUntilReady: (options?: {
658
+ timeoutSeconds?: number;
659
+ intervalSeconds?: number;
660
+ beforeCheck?: (endpoint: AgentRuntimeEndpoint) => void;
661
+ }, config?: Config) => Promise<AgentRuntimeEndpoint>;
662
+ /**
663
+ * Invoke agent runtime using OpenAI-compatible API through this endpoint
664
+ *
665
+ * This method provides an OpenAI-compatible interface to invoke the agent runtime
666
+ * through this specific endpoint.
667
+ *
668
+ * @param args - Invocation arguments
669
+ * @returns OpenAI chat completion response
670
+ *
671
+ * @example
672
+ * ```typescript
673
+ * const endpoint = await AgentRuntimeEndpoint.get({
674
+ * agentRuntimeId: "runtime-id",
675
+ * endpointId: "endpoint-id"
676
+ * });
677
+ * const response = await endpoint.invokeOpenai({
678
+ * messages: [{ role: "user", content: "Hello" }],
679
+ * stream: false
680
+ * });
681
+ * ```
682
+ */
683
+ invokeOpenai: (args: InvokeArgs) => Promise<(openai_core_streaming.Stream<openai_resources.ChatCompletionChunk> & {
684
+ _request_id?: string | null;
685
+ }) | (openai_resources.ChatCompletion & {
686
+ _request_id?: string | null;
687
+ })>;
688
+ }
689
+
690
+ /**
691
+ * Agent Runtime resource class
692
+ */
693
+ declare class AgentRuntime implements AgentRuntimeData {
694
+ agentRuntimeArn?: string;
695
+ agentRuntimeId?: string;
696
+ agentRuntimeName?: string;
697
+ agentRuntimeVersion?: string;
698
+ artifactType?: string;
699
+ codeConfiguration?: AgentRuntimeCode;
700
+ containerConfiguration?: AgentRuntimeContainer;
701
+ cpu?: number;
702
+ createdAt?: string;
703
+ credentialName?: string;
704
+ description?: string;
705
+ environmentVariables?: Record<string, string>;
706
+ executionRoleArn?: string;
707
+ healthCheckConfiguration?: AgentRuntimeHealthCheckConfig;
708
+ lastUpdatedAt?: string;
709
+ logConfiguration?: AgentRuntimeLogConfig;
710
+ memory?: number;
711
+ networkConfiguration?: NetworkConfig;
712
+ port?: number;
713
+ protocolConfiguration?: AgentRuntimeProtocolConfig;
714
+ resourceName?: string;
715
+ sessionConcurrencyLimitPerInstance?: number;
716
+ sessionIdleTimeoutSeconds?: number;
717
+ status?: Status;
718
+ statusReason?: string;
719
+ tags?: string[];
720
+ private _config?;
721
+ private _dataApiCache;
722
+ constructor(data?: Partial<AgentRuntimeData>, config?: Config);
723
+ /**
724
+ * Create runtime from SDK response object
725
+ */
726
+ static fromInnerObject(obj: $AgentRun.AgentRuntime, config?: Config): AgentRuntime;
727
+ private static getClient;
728
+ /**
729
+ * Create a new Agent Runtime
730
+ */
731
+ static create(params: {
732
+ input: AgentRuntimeCreateInput;
733
+ config?: Config;
734
+ }): Promise<AgentRuntime>;
735
+ /**
736
+ * Delete an Agent Runtime by ID
737
+ */
738
+ static delete(params: {
739
+ id: string;
740
+ config?: Config;
741
+ }): Promise<AgentRuntime>;
742
+ /**
743
+ * Update an Agent Runtime by ID
744
+ */
745
+ static update(params: {
746
+ id: string;
747
+ input: AgentRuntimeUpdateInput;
748
+ config?: Config;
749
+ }): Promise<AgentRuntime>;
750
+ /**
751
+ * Get an Agent Runtime by ID
752
+ */
753
+ static get(params: {
754
+ id: string;
755
+ config?: Config;
756
+ }): Promise<AgentRuntime>;
757
+ /**
758
+ * List Agent Runtimes
759
+ */
760
+ static list(input?: AgentRuntimeListInput, config?: Config): Promise<AgentRuntime[]>;
761
+ /**
762
+ * List all Agent Runtimes (with pagination)
763
+ */
764
+ static listAll(options?: {
765
+ agentRuntimeName?: string;
766
+ tags?: string;
767
+ searchMode?: string;
768
+ }, config?: Config): Promise<AgentRuntime[]>;
769
+ /**
770
+ * List Agent Runtime versions by ID
771
+ */
772
+ static listVersionsById(params: {
773
+ agentRuntimeId: string;
774
+ input?: AgentRuntimeVersionListInput;
775
+ config?: Config;
776
+ }): Promise<AgentRuntimeVersion[]>;
777
+ /**
778
+ * Delete this runtime
779
+ */
780
+ delete: (params?: {
781
+ config?: Config;
782
+ }) => Promise<AgentRuntime>;
783
+ /**
784
+ * Update this runtime
785
+ */
786
+ update: (params: {
787
+ input: AgentRuntimeUpdateInput;
788
+ config?: Config;
789
+ }) => Promise<AgentRuntime>;
790
+ /**
791
+ * Refresh this runtime's data
792
+ */
793
+ refresh: (params?: {
794
+ config?: Config;
795
+ }) => Promise<AgentRuntime>;
796
+ /**
797
+ * Create an endpoint for this runtime
798
+ */
799
+ createEndpoint: (params: {
800
+ input: AgentRuntimeEndpointCreateInput;
801
+ config?: Config;
802
+ }) => Promise<AgentRuntimeEndpoint>;
803
+ /**
804
+ * Delete an endpoint from this runtime
805
+ */
806
+ deleteEndpoint: (params: {
807
+ endpointId: string;
808
+ config?: Config;
809
+ }) => Promise<AgentRuntimeEndpoint>;
810
+ /**
811
+ * Update an endpoint of this runtime
812
+ */
813
+ updateEndpoint: (params: {
814
+ endpointId: string;
815
+ input: AgentRuntimeEndpointUpdateInput;
816
+ config?: Config;
817
+ }) => Promise<AgentRuntimeEndpoint>;
818
+ /**
819
+ * Get an endpoint of this runtime
820
+ */
821
+ getEndpoint: (params: {
822
+ endpointId: string;
823
+ config?: Config;
824
+ }) => Promise<AgentRuntimeEndpoint>;
825
+ /**
826
+ * List endpoints of this runtime
827
+ */
828
+ listEndpoints: (params?: {
829
+ config?: Config;
830
+ }) => Promise<AgentRuntimeEndpoint[]>;
831
+ /**
832
+ * List versions of this runtime
833
+ */
834
+ listVersions: (params?: {
835
+ config?: Config;
836
+ }) => Promise<AgentRuntimeVersion[]>;
837
+ /**
838
+ * Wait until the runtime is ready
839
+ */
840
+ waitUntilReady: (options?: {
841
+ timeoutSeconds?: number;
842
+ intervalSeconds?: number;
843
+ beforeCheck?: (runtime: AgentRuntime) => void;
844
+ }, config?: Config) => Promise<AgentRuntime>;
845
+ /**
846
+ * Wait until agent runtime reaches READY or any FAILED state
847
+ * Similar to waitUntilReady but does not throw on FAILED states
848
+ * Compatible with Python SDK's wait_until_ready_or_failed method
849
+ */
850
+ waitUntilReadyOrFailed: (options?: {
851
+ timeoutSeconds?: number;
852
+ intervalSeconds?: number;
853
+ beforeCheck?: (runtime: AgentRuntime) => void;
854
+ }, config?: Config) => Promise<AgentRuntime>;
855
+ /**
856
+ * Invoke agent runtime using OpenAI-compatible API
857
+ *
858
+ * This method provides an OpenAI-compatible interface to invoke the agent runtime.
859
+ * It creates a Data API client and forwards the invocation request.
860
+ *
861
+ * @param args - Invocation arguments
862
+ * @returns OpenAI chat completion response
863
+ *
864
+ * @example
865
+ * ```typescript
866
+ * const runtime = await AgentRuntime.get({ id: "runtime-id" });
867
+ * const response = await runtime.invokeOpenai({
868
+ * agentRuntimeEndpointName: "Default",
869
+ * messages: [{ role: "user", content: "Hello" }],
870
+ * stream: false
871
+ * });
872
+ * ```
873
+ */
874
+ invokeOpenai: (args: InvokeArgs & {
875
+ agentRuntimeEndpointName?: string;
876
+ }) => Promise<(openai_core_streaming.Stream<openai_resources.ChatCompletionChunk> & {
877
+ _request_id?: string | null;
878
+ }) | (openai_resources.ChatCompletion & {
879
+ _request_id?: string | null;
880
+ })>;
881
+ }
882
+
883
+ /**
884
+ * Agent Runtime Client
885
+ *
886
+ * 提供 Agent Runtime 的创建、删除、更新、查询和端点管理功能。
887
+ * Provides create, delete, update, query and endpoint management functions for Agent Runtime.
888
+ */
889
+ declare class AgentRuntimeClient {
890
+ private config?;
891
+ private controlApi;
892
+ constructor(config?: Config);
893
+ /**
894
+ * Create an Agent Runtime
895
+ */
896
+ create: (params: {
897
+ input: AgentRuntimeCreateInput;
898
+ config?: Config;
899
+ }) => Promise<AgentRuntime>;
900
+ /**
901
+ * Delete an Agent Runtime
902
+ */
903
+ delete: (params: {
904
+ id: string;
905
+ config?: Config;
906
+ }) => Promise<AgentRuntime>;
907
+ /**
908
+ * Update an Agent Runtime
909
+ */
910
+ update: (params: {
911
+ id: string;
912
+ input: AgentRuntimeUpdateInput;
913
+ config?: Config;
914
+ }) => Promise<AgentRuntime>;
915
+ /**
916
+ * Get an Agent Runtime
917
+ */
918
+ get: (params: {
919
+ id: string;
920
+ config?: Config;
921
+ }) => Promise<AgentRuntime>;
922
+ /**
923
+ * List Agent Runtimes
924
+ */
925
+ list: (params?: {
926
+ input?: AgentRuntimeListInput;
927
+ config?: Config;
928
+ }) => Promise<AgentRuntime[]>;
929
+ /**
930
+ * List all Agent Runtimes (with pagination)
931
+ */
932
+ listAll: (params?: {
933
+ options?: {
934
+ agentRuntimeName?: string;
935
+ tags?: string;
936
+ searchMode?: string;
937
+ };
938
+ config?: Config;
939
+ }) => Promise<AgentRuntime[]>;
940
+ /**
941
+ * Create an endpoint for an Agent Runtime
942
+ */
943
+ createEndpoint: (params: {
944
+ agentRuntimeId: string;
945
+ input: AgentRuntimeEndpointCreateInput;
946
+ config?: Config;
947
+ }) => Promise<AgentRuntimeEndpoint>;
948
+ /**
949
+ * Delete an endpoint
950
+ */
951
+ deleteEndpoint: (params: {
952
+ agentRuntimeId: string;
953
+ endpointId: string;
954
+ config?: Config;
955
+ }) => Promise<AgentRuntimeEndpoint>;
956
+ /**
957
+ * Update an endpoint
958
+ */
959
+ updateEndpoint: (params: {
960
+ agentRuntimeId: string;
961
+ endpointId: string;
962
+ input: AgentRuntimeEndpointUpdateInput;
963
+ config?: Config;
964
+ }) => Promise<AgentRuntimeEndpoint>;
965
+ /**
966
+ * Get an endpoint
967
+ */
968
+ getEndpoint: (params: {
969
+ agentRuntimeId: string;
970
+ endpointId: string;
971
+ config?: Config;
972
+ }) => Promise<AgentRuntimeEndpoint>;
973
+ /**
974
+ * List endpoints for an Agent Runtime
975
+ */
976
+ listEndpoints: (params: {
977
+ agentRuntimeId: string;
978
+ input?: AgentRuntimeEndpointListInput;
979
+ config?: Config;
980
+ }) => Promise<AgentRuntimeEndpoint[]>;
981
+ /**
982
+ * List versions for an Agent Runtime
983
+ */
984
+ listVersions: (params: {
985
+ agentRuntimeId: string;
986
+ input?: AgentRuntimeVersionListInput;
987
+ config?: Config;
988
+ }) => Promise<AgentRuntimeVersion[]>;
989
+ /**
990
+ * Invoke agent runtime using OpenAI-compatible API
991
+ *
992
+ * This method provides an OpenAI-compatible interface to invoke the agent runtime.
993
+ *
994
+ * @param params - Parameters including agent runtime name, endpoint name, and invocation args
995
+ * @returns OpenAI chat completion response
996
+ *
997
+ * @example
998
+ * ```typescript
999
+ * const client = new AgentRuntimeClient();
1000
+ * const response = await client.invokeOpenai({
1001
+ * agentRuntimeName: "my-runtime",
1002
+ * agentRuntimeEndpointName: "Default",
1003
+ * messages: [{ role: "user", content: "Hello" }],
1004
+ * stream: false
1005
+ * });
1006
+ * ```
1007
+ */
1008
+ invokeOpenai: (params: {
1009
+ agentRuntimeName: string;
1010
+ agentRuntimeEndpointName?: string;
1011
+ } & InvokeArgs) => Promise<(openai_core_streaming.Stream<openai_resources.ChatCompletionChunk> & {
1012
+ _request_id?: string | null;
1013
+ }) | (openai_resources.ChatCompletion & {
1014
+ _request_id?: string | null;
1015
+ })>;
1016
+ }
1017
+
1018
+ /**
1019
+ * Control API Base Module
1020
+ *
1021
+ * 此模块定义控制链路 API 的基类。
1022
+ * This module defines the base class for control API.
1023
+ */
1024
+
1025
+ declare const $AgentRunClient: any;
1026
+ type Client = InstanceType<typeof $AgentRunClient>;
1027
+ /**
1028
+ * Base class for Control API clients
1029
+ *
1030
+ * 提供控制链路和 DevS API 客户端的获取功能。
1031
+ * Provides functionality to get control API and DevS API clients.
1032
+ */
1033
+ declare class ControlAPI {
1034
+ protected config?: Config;
1035
+ constructor(config?: Config);
1036
+ /**
1037
+ * Get the underlying AgentRun client instance
1038
+ */
1039
+ getClient(config?: Config): Client;
1040
+ }
1041
+
1042
+ /**
1043
+ * This file is auto generated by the code generation script.
1044
+ * Do not modify this file manually.
1045
+ * Use the `bun run codegen` command to regenerate.
1046
+ *
1047
+ * 当前文件为自动生成的控制 API 客户端代码。请勿手动修改此文件。
1048
+ * 使用 `bun run codegen` 命令重新生成。
1049
+ */
1050
+
1051
+ /**
1052
+ * Agent Runtime Control API
1053
+ */
1054
+ declare class AgentRuntimeControlAPI extends ControlAPI {
1055
+ constructor(config?: Config);
1056
+ /**
1057
+ * Create Agent Runtime
1058
+ *
1059
+ * @param params - Method parameters
1060
+ * @param params.input - Agent Runtime configuration
1061
+ * @param params.headers - Custom request headers
1062
+ * @param params.config - Optional config override
1063
+ * @returns Created Runtime object
1064
+ */
1065
+ createAgentRuntime: (params: {
1066
+ input: $AgentRun.CreateAgentRuntimeInput;
1067
+ headers?: Record<string, string>;
1068
+ config?: Config;
1069
+ }) => Promise<$AgentRun.AgentRuntime>;
1070
+ /**
1071
+ * Delete Agent Runtime
1072
+ *
1073
+ * @param params - Method parameters
1074
+ * @param params.agentId - Agent Runtime ID
1075
+ * @param params.headers - Custom request headers
1076
+ * @param params.config - Optional config override
1077
+ * @returns Deleted Runtime object
1078
+ */
1079
+ deleteAgentRuntime: (params: {
1080
+ agentId: string;
1081
+ headers?: Record<string, string>;
1082
+ config?: Config;
1083
+ }) => Promise<$AgentRun.AgentRuntime>;
1084
+ /**
1085
+ * Update Agent Runtime
1086
+ *
1087
+ * @param params - Method parameters
1088
+ * @param params.agentId - Agent Runtime ID
1089
+ * @param params.input - Agent Runtime configuration
1090
+ * @param params.headers - Custom request headers
1091
+ * @param params.config - Optional config override
1092
+ * @returns Updated Runtime object
1093
+ */
1094
+ updateAgentRuntime: (params: {
1095
+ agentId: string;
1096
+ input: $AgentRun.UpdateAgentRuntimeInput;
1097
+ headers?: Record<string, string>;
1098
+ config?: Config;
1099
+ }) => Promise<$AgentRun.AgentRuntime>;
1100
+ /**
1101
+ * Get Agent Runtime
1102
+ *
1103
+ * @param params - Method parameters
1104
+ * @param params.agentId - Agent Runtime ID
1105
+ * @param params.request - Get request options
1106
+ * @param params.headers - Custom request headers
1107
+ * @param params.config - Optional config override
1108
+ * @returns Runtime object
1109
+ */
1110
+ getAgentRuntime: (params: {
1111
+ agentId: string;
1112
+ request?: $AgentRun.GetAgentRuntimeRequest;
1113
+ headers?: Record<string, string>;
1114
+ config?: Config;
1115
+ }) => Promise<$AgentRun.AgentRuntime>;
1116
+ /**
1117
+ * List Agent Runtimes
1118
+ *
1119
+ * @param params - Method parameters
1120
+ * @param params.input - List options
1121
+ * @param params.headers - Custom request headers
1122
+ * @param params.config - Optional config override
1123
+ * @returns List of Runtime objects
1124
+ */
1125
+ listAgentRuntimes: (params: {
1126
+ input: $AgentRun.ListAgentRuntimesRequest;
1127
+ headers?: Record<string, string>;
1128
+ config?: Config;
1129
+ }) => Promise<$AgentRun.ListAgentRuntimesOutput>;
1130
+ /**
1131
+ * Create Agent Runtime Endpoint
1132
+ *
1133
+ * @param params - Method parameters
1134
+ * @param params.agentId - Agent Runtime ID
1135
+ * @param params.input - Endpoint configuration
1136
+ * @param params.headers - Custom request headers
1137
+ * @param params.config - Optional config override
1138
+ * @returns Created Endpoint object
1139
+ */
1140
+ createAgentRuntimeEndpoint: (params: {
1141
+ agentId: string;
1142
+ input: $AgentRun.CreateAgentRuntimeEndpointInput;
1143
+ headers?: Record<string, string>;
1144
+ config?: Config;
1145
+ }) => Promise<$AgentRun.AgentRuntimeEndpoint>;
1146
+ /**
1147
+ * Delete Agent Runtime Endpoint
1148
+ *
1149
+ * @param params - Method parameters
1150
+ * @param params.agentId - Agent Runtime ID
1151
+ * @param params.endpointId - Endpoint ID
1152
+ * @param params.headers - Custom request headers
1153
+ * @param params.config - Optional config override
1154
+ * @returns Deleted Endpoint object
1155
+ */
1156
+ deleteAgentRuntimeEndpoint: (params: {
1157
+ agentId: string;
1158
+ endpointId: string;
1159
+ headers?: Record<string, string>;
1160
+ config?: Config;
1161
+ }) => Promise<$AgentRun.AgentRuntimeEndpoint>;
1162
+ /**
1163
+ * Update Agent Runtime Endpoint
1164
+ *
1165
+ * @param params - Method parameters
1166
+ * @param params.agentId - Agent Runtime ID
1167
+ * @param params.endpointId - Endpoint ID
1168
+ * @param params.input - Endpoint configuration
1169
+ * @param params.headers - Custom request headers
1170
+ * @param params.config - Optional config override
1171
+ * @returns Updated Endpoint object
1172
+ */
1173
+ updateAgentRuntimeEndpoint: (params: {
1174
+ agentId: string;
1175
+ endpointId: string;
1176
+ input: $AgentRun.UpdateAgentRuntimeEndpointInput;
1177
+ headers?: Record<string, string>;
1178
+ config?: Config;
1179
+ }) => Promise<$AgentRun.AgentRuntimeEndpoint>;
1180
+ /**
1181
+ * Get Agent Runtime Endpoint
1182
+ *
1183
+ * @param params - Method parameters
1184
+ * @param params.agentId - Agent Runtime ID
1185
+ * @param params.endpointId - Endpoint ID
1186
+ * @param params.headers - Custom request headers
1187
+ * @param params.config - Optional config override
1188
+ * @returns Endpoint object
1189
+ */
1190
+ getAgentRuntimeEndpoint: (params: {
1191
+ agentId: string;
1192
+ endpointId: string;
1193
+ headers?: Record<string, string>;
1194
+ config?: Config;
1195
+ }) => Promise<$AgentRun.AgentRuntimeEndpoint>;
1196
+ /**
1197
+ * List Agent Runtime Endpoints
1198
+ *
1199
+ * @param params - Method parameters
1200
+ * @param params.agentId - Agent Runtime ID
1201
+ * @param params.input - List options
1202
+ * @param params.headers - Custom request headers
1203
+ * @param params.config - Optional config override
1204
+ * @returns List of Endpoint objects
1205
+ */
1206
+ listAgentRuntimeEndpoints: (params: {
1207
+ agentId: string;
1208
+ input: $AgentRun.ListAgentRuntimeEndpointsRequest;
1209
+ headers?: Record<string, string>;
1210
+ config?: Config;
1211
+ }) => Promise<$AgentRun.ListAgentRuntimeEndpointsOutput>;
1212
+ /**
1213
+ * List Agent Runtime Versions
1214
+ *
1215
+ * @param params - Method parameters
1216
+ * @param params.agentId - Agent Runtime ID
1217
+ * @param params.input - List options
1218
+ * @param params.headers - Custom request headers
1219
+ * @param params.config - Optional config override
1220
+ * @returns List of Version objects
1221
+ */
1222
+ listAgentRuntimeVersions: (params: {
1223
+ agentId: string;
1224
+ input: $AgentRun.ListAgentRuntimeVersionsRequest;
1225
+ headers?: Record<string, string>;
1226
+ config?: Config;
1227
+ }) => Promise<$AgentRun.ListAgentRuntimeVersionsOutput>;
1228
+ }
1229
+
1230
+ /**
1231
+ 资源基类模板 / Resource Base Template
1232
+
1233
+ 此模板用于生成资源对象的基类代码。
1234
+ This template is used to generate base class code for resource objects.
1235
+ */
1236
+
1237
+ declare abstract class ResourceBase {
1238
+ status?: Status;
1239
+ protected _config?: Config;
1240
+ abstract get(params?: {
1241
+ config?: Config;
1242
+ }): Promise<any>;
1243
+ abstract delete(params?: {
1244
+ config?: Config;
1245
+ }): Promise<any>;
1246
+ static list(_params: {
1247
+ input?: PageableInput;
1248
+ config?: Config;
1249
+ }): Promise<ThisType<ResourceBase>[]>;
1250
+ static listAll(params: {
1251
+ uniqIdCallback: (item: any) => string;
1252
+ input?: Record<string, any>;
1253
+ config?: Config;
1254
+ }): Promise<any[]>;
1255
+ waitUntil: (params: {
1256
+ checkFinishedCallback: (resource: ResourceBase) => Promise<boolean>;
1257
+ intervalSeconds?: number;
1258
+ timeoutSeconds?: number;
1259
+ }) => Promise<ResourceBase>;
1260
+ waitUntilReadyOrFailed: (params: {
1261
+ callback: (resource: ResourceBase) => Promise<void>;
1262
+ intervalSeconds?: number;
1263
+ timeoutSeconds?: number;
1264
+ }) => Promise<ResourceBase>;
1265
+ delete_and_wait_until_finished: (params: {
1266
+ callback: (resource: ResourceBase) => Promise<void>;
1267
+ intervalSeconds?: number;
1268
+ timeoutSeconds?: number;
1269
+ }) => Promise<ResourceBase | undefined>;
1270
+ refresh: (params?: {
1271
+ config?: Config;
1272
+ }) => Promise<any>;
1273
+ /**
1274
+ * 更新实例自身的属性 / Update instance properties
1275
+ *
1276
+ * @param source - 源对象 / Source object
1277
+ */
1278
+ updateSelf(source: any): void;
1279
+ /**
1280
+ * 列出所有资源(带去重)/ List all resources (with deduplication)
1281
+ *
1282
+ * @param uniqIdCallback - 唯一ID回调函数 / Unique ID callback function
1283
+ * @param config - 配置 / Configuration
1284
+ * @param kwargs - 其他查询参数 / Other query parameters
1285
+ * @returns 资源列表 / Resource list
1286
+ */
1287
+ protected static listAllResources(uniqIdCallback: (item: any) => string, config?: Config, kwargs?: Record<string, any>): Promise<any[]>;
1288
+ setConfig: (config: Config) => this;
1289
+ }
1290
+
1291
+ /** 凭证认证类型 / Credential Authentication Types */
1292
+ type CredentialAuthType = 'jwt' | 'api_key' | 'basic' | 'aksk' | 'custom_header';
1293
+ /** 凭证来源类型 / Credential Source Types */
1294
+ type CredentialSourceType = 'external_llm' | 'external_tool' | 'internal';
1295
+ /**
1296
+ * Credential basic authentication configuration
1297
+ */
1298
+ interface CredentialBasicAuth {
1299
+ /** Username */
1300
+ username?: string;
1301
+ /** Password */
1302
+ password?: string;
1303
+ }
1304
+ /**
1305
+ * Related resource for credential
1306
+ */
1307
+ interface RelatedResource {
1308
+ /** 资源 IDj*/
1309
+ resourceId?: string;
1310
+ /** 资源名称j*/
1311
+ resourceName?: string;
1312
+ /** 资源类型j*/
1313
+ resourceType?: string;
1314
+ }
1315
+ interface CredentialConfigInterface {
1316
+ /** 凭证认证类型 */
1317
+ credentialAuthType?: CredentialAuthType;
1318
+ /** 凭证来源类型 */
1319
+ credentialSourceType?: CredentialSourceType;
1320
+ /** 凭证公共配置 */
1321
+ credentialPublicConfig?: Record<string, any>;
1322
+ /** 凭证密钥 */
1323
+ credentialSecret?: string;
1324
+ }
1325
+ /**
1326
+ * 凭证配置 / Credential configuration
1327
+ */
1328
+ declare class CredentialConfig implements CredentialConfigInterface {
1329
+ constructor(data?: CredentialConfigInterface);
1330
+ /** 配置访问 AgentRun 的 api key 凭证 */
1331
+ static inboundApiKey(params: {
1332
+ apiKey: string;
1333
+ headerKey?: string;
1334
+ }): CredentialConfig;
1335
+ /** 配置访问 AgentRun 的静态 JWKS 凭证 */
1336
+ static inboundStaticJwt(params: {
1337
+ jwks: string;
1338
+ }): CredentialConfig;
1339
+ /** 配置访问 AgentRun 的远程 JWT 凭证 */
1340
+ static inboundRemoteJwt(uri: string, timeout?: number, ttl?: number, publicConfig?: Record<string, any>): CredentialConfig;
1341
+ /** 配置访问 AgentRun 的 Basic 凭证 */
1342
+ static inboundBasic(params: {
1343
+ users: CredentialBasicAuth[];
1344
+ }): CredentialConfig;
1345
+ /** 配置访问第三方工具的 api key 凭证 */
1346
+ static outboundLLMApiKey(params: {
1347
+ apiKey: string;
1348
+ provider: string;
1349
+ }): CredentialConfig;
1350
+ /** 配置访问第三方工具的 ak/sk 凭证 */
1351
+ static outboundLLMAKSK(provider: string, accessKeyId: string, accessKeySecret: string, accountId: string): CredentialConfig;
1352
+ /** 配置访问第三方工具的自定义凭证 */
1353
+ static outboundToolAKSKCustom(params: {
1354
+ authConfig: Record<string, string>;
1355
+ }): CredentialConfig;
1356
+ /** 配置访问第三方工具的自定义 Header 凭证 */
1357
+ static outboundToolCustomHeader(params: {
1358
+ headers: Record<string, string>;
1359
+ }): CredentialConfig;
1360
+ }
1361
+ /** 凭证公共配置 */
1362
+ interface CredentialMutableProps {
1363
+ /** 描述 */
1364
+ description?: string;
1365
+ /** 是否启用 */
1366
+ enabled?: boolean;
1367
+ }
1368
+ interface CredentialImmutableProps {
1369
+ credentialName?: string;
1370
+ }
1371
+ interface CredentialSystemProps {
1372
+ credentialId?: string;
1373
+ createdAt?: string;
1374
+ updatedAt?: string;
1375
+ relatedResources?: RelatedResource[];
1376
+ }
1377
+ interface CredentialCreateInput extends CredentialMutableProps, CredentialImmutableProps {
1378
+ credentialConfig?: CredentialConfig;
1379
+ }
1380
+ /**
1381
+ * Credential update input
1382
+ */
1383
+ interface CredentialUpdateInput extends CredentialMutableProps {
1384
+ credentialConfig?: CredentialConfig;
1385
+ }
1386
+ /**
1387
+ * Credential list input
1388
+ */
1389
+ interface CredentialListInput extends PageableInput {
1390
+ credentialAuthType?: CredentialAuthType;
1391
+ credentialName?: string;
1392
+ credentialSourceType?: CredentialSourceType;
1393
+ provider?: string;
1394
+ }
1395
+ declare class CredentialListOutput {
1396
+ createdAt?: string;
1397
+ credentialAuthType?: CredentialAuthType;
1398
+ credentialId?: string;
1399
+ credentialName?: string;
1400
+ credentialSourceType?: CredentialSourceType;
1401
+ enabled?: boolean;
1402
+ relatedResourceCount?: number;
1403
+ updatedAt?: string;
1404
+ constructor(data?: any);
1405
+ toCredential: (params?: {
1406
+ config?: Config;
1407
+ }) => Promise<Credential>;
1408
+ }
1409
+ /**
1410
+ * Credential resource class
1411
+ */
1412
+ interface CredentialInterface extends CredentialMutableProps, CredentialImmutableProps, CredentialSystemProps, CredentialConfigInterface {
1413
+ }
1414
+
1415
+ /**
1416
+ * Credential Resource
1417
+ *
1418
+ * 此模块定义 Credential 资源类。
1419
+ * This module defines the Credential resource class.
1420
+ */
1421
+
1422
+ declare class Credential extends ResourceBase implements CredentialInterface {
1423
+ credentialName?: string;
1424
+ /** 描述 */
1425
+ description?: string;
1426
+ /** 是否启用 */
1427
+ enabled?: boolean;
1428
+ credentialId?: string;
1429
+ createdAt?: string;
1430
+ updatedAt?: string;
1431
+ relatedResources?: RelatedResource[];
1432
+ /** 凭证认证类型 */
1433
+ credentialAuthType?: CredentialAuthType;
1434
+ /** 凭证来源类型 */
1435
+ credentialSourceType?: CredentialSourceType;
1436
+ /** 凭证公共配置 */
1437
+ credentialPublicConfig?: Record<string, any>;
1438
+ /** 凭证密钥 */
1439
+ credentialSecret?: string;
1440
+ protected _config?: Config;
1441
+ constructor(data?: CredentialInterface, config?: Config);
1442
+ private static getClient;
1443
+ /**
1444
+ * Create a new Credential
1445
+ */
1446
+ static create: (paramsOrInput: any) => Promise<Credential>;
1447
+ /**
1448
+ * Delete a Credential by name
1449
+ */
1450
+ static delete: (paramsOrName: any) => Promise<Credential>;
1451
+ /**
1452
+ * Update a Credential by name
1453
+ */
1454
+ static update: (paramsOrName: any) => Promise<Credential>;
1455
+ /**
1456
+ * Get a Credential by name
1457
+ */
1458
+ static get: (paramsOrName: any) => Promise<Credential>;
1459
+ /**
1460
+ * List all Credentials (with pagination)
1461
+ */
1462
+ static list: (paramsOrUndefined?: any) => Promise<CredentialListOutput[]>;
1463
+ static listAll: (params?: {
1464
+ input?: CredentialListInput;
1465
+ config?: Config;
1466
+ }) => Promise<CredentialListOutput[]>;
1467
+ /**
1468
+ * Delete this credential
1469
+ */
1470
+ delete: (params?: any) => Promise<this>;
1471
+ /**
1472
+ * Update this credential
1473
+ */
1474
+ update: (params: any) => Promise<this>;
1475
+ /**
1476
+ * Refresh this credential's data
1477
+ */
1478
+ get: (params?: any) => Promise<Credential>;
1479
+ }
1480
+
1481
+ /**
1482
+ * Credential Client
1483
+ *
1484
+ * 此模块提供 Credential 的客户端 API。
1485
+ * This module provides the client API for Credential.
1486
+ */
1487
+
1488
+ /**
1489
+ * Credential Client
1490
+ *
1491
+ * 提供 Credential 的创建、删除、更新、查询功能。
1492
+ * Provides create, delete, update, query functions for Credential.
1493
+ */
1494
+ declare class CredentialClient {
1495
+ private config?;
1496
+ private controlApi;
1497
+ constructor(config?: Config);
1498
+ /**
1499
+ * Create a Credential
1500
+ */
1501
+ create: (params: {
1502
+ input: CredentialCreateInput;
1503
+ config?: Config;
1504
+ }) => Promise<Credential>;
1505
+ /**
1506
+ * Delete a Credential
1507
+ */
1508
+ delete: (params: {
1509
+ name: string;
1510
+ config?: Config;
1511
+ }) => Promise<Credential>;
1512
+ /**
1513
+ * Update a Credential
1514
+ */
1515
+ update: (params: {
1516
+ name: string;
1517
+ input: CredentialUpdateInput;
1518
+ config?: Config;
1519
+ }) => Promise<Credential>;
1520
+ /**
1521
+ * Get a Credential
1522
+ */
1523
+ get: (params: {
1524
+ name: string;
1525
+ config?: Config;
1526
+ }) => Promise<Credential>;
1527
+ /**
1528
+ * List Credentials
1529
+ */
1530
+ list: (params: {
1531
+ input?: CredentialListInput;
1532
+ config?: Config;
1533
+ }) => Promise<CredentialListOutput[]>;
1534
+ }
1535
+
1536
+ /**
1537
+ * This file is auto generated by the code generation script.
1538
+ * Do not modify this file manually.
1539
+ * Use the `bun run codegen` command to regenerate.
1540
+ *
1541
+ * 当前文件为自动生成的控制 API 客户端代码。请勿手动修改此文件。
1542
+ * 使用 `bun run codegen` 命令重新生成。
1543
+ */
1544
+
1545
+ /**
1546
+ * Credential Control API
1547
+ */
1548
+ declare class CredentialControlAPI extends ControlAPI {
1549
+ constructor(config?: Config);
1550
+ /**
1551
+ * Create credential
1552
+ *
1553
+ * @param params - Method parameters
1554
+ * @param params.input - Credential configuration
1555
+ * @param params.headers - Custom request headers
1556
+ * @param params.config - Optional config override
1557
+ * @returns Created credential object
1558
+ */
1559
+ createCredential: (params: {
1560
+ input: $AgentRun.CreateCredentialInput;
1561
+ headers?: Record<string, string>;
1562
+ config?: Config;
1563
+ }) => Promise<$AgentRun.Credential>;
1564
+ /**
1565
+ * Delete credential
1566
+ *
1567
+ * @param params - Method parameters
1568
+ * @param params.credentialName - Credential name
1569
+ * @param params.headers - Custom request headers
1570
+ * @param params.config - Optional config override
1571
+ * @returns Deleted credential object
1572
+ */
1573
+ deleteCredential: (params: {
1574
+ credentialName: string;
1575
+ headers?: Record<string, string>;
1576
+ config?: Config;
1577
+ }) => Promise<$AgentRun.Credential>;
1578
+ /**
1579
+ * Update credential
1580
+ *
1581
+ * @param params - Method parameters
1582
+ * @param params.credentialName - Credential name
1583
+ * @param params.input - Credential configuration
1584
+ * @param params.headers - Custom request headers
1585
+ * @param params.config - Optional config override
1586
+ * @returns Updated credential object
1587
+ */
1588
+ updateCredential: (params: {
1589
+ credentialName: string;
1590
+ input: $AgentRun.UpdateCredentialInput;
1591
+ headers?: Record<string, string>;
1592
+ config?: Config;
1593
+ }) => Promise<$AgentRun.Credential>;
1594
+ /**
1595
+ * Get credential
1596
+ *
1597
+ * @param params - Method parameters
1598
+ * @param params.credentialName - Credential name
1599
+ * @param params.headers - Custom request headers
1600
+ * @param params.config - Optional config override
1601
+ * @returns Credential object
1602
+ */
1603
+ getCredential: (params: {
1604
+ credentialName: string;
1605
+ headers?: Record<string, string>;
1606
+ config?: Config;
1607
+ }) => Promise<$AgentRun.Credential>;
1608
+ /**
1609
+ * List credentials
1610
+ *
1611
+ * @param params - Method parameters
1612
+ * @param params.input - List options
1613
+ * @param params.headers - Custom request headers
1614
+ * @param params.config - Optional config override
1615
+ * @returns List of credential objects
1616
+ */
1617
+ listCredentials: (params: {
1618
+ input: $AgentRun.ListCredentialsRequest;
1619
+ headers?: Record<string, string>;
1620
+ config?: Config;
1621
+ }) => Promise<$AgentRun.ListCredentialsOutput>;
1622
+ }
1623
+
1624
+ /**
1625
+ * Sandbox Data API Base Class
1626
+ *
1627
+ * This module provides an HTTP client for interacting with the AgentRun Sandbox Data API.
1628
+ * 此模块提供用于与 AgentRun Sandbox Data API 交互的 HTTP 客户端。
1629
+ */
1630
+
1631
+ /**
1632
+ * Resource type enum
1633
+ */
1634
+ declare enum ResourceType {
1635
+ Runtime = "runtime",
1636
+ LiteLLM = "litellm",
1637
+ Tool = "tool",
1638
+ Template = "template",
1639
+ Sandbox = "sandbox"
1640
+ }
1641
+ /**
1642
+ * Sandbox Data API Client
1643
+ *
1644
+ * Provides methods for making HTTP requests to sandbox data API endpoints.
1645
+ */
1646
+ declare class SandboxDataAPI {
1647
+ protected resourceName: string;
1648
+ protected resourceType: ResourceType;
1649
+ protected namespace: string;
1650
+ protected config: Config;
1651
+ protected accessToken?: string;
1652
+ protected accessTokenMap: Map<string, string>;
1653
+ constructor(params: {
1654
+ sandboxId?: string;
1655
+ templateName?: string;
1656
+ config?: Config;
1657
+ namespace?: string;
1658
+ });
1659
+ /**
1660
+ * Refresh access token for the resource
1661
+ */
1662
+ protected refreshAccessToken(params: {
1663
+ sandboxId?: string;
1664
+ templateName?: string;
1665
+ config?: Config;
1666
+ }): Promise<void>;
1667
+ /**
1668
+ * Get base URL for data API
1669
+ */
1670
+ protected getBaseUrl(): string;
1671
+ /**
1672
+ * Construct full URL with path and query parameters
1673
+ */
1674
+ protected withPath(path: string, query?: Record<string, any>): string;
1675
+ /**
1676
+ * Authentication hook - gets access token for the resource
1677
+ */
1678
+ protected auth(params: {
1679
+ config?: Config;
1680
+ }): Promise<void>;
1681
+ /**
1682
+ * Mask token for logging
1683
+ */
1684
+ protected maskToken(token: string): string;
1685
+ /**
1686
+ * Prepare request headers
1687
+ */
1688
+ protected prepareHeaders(params: {
1689
+ headers?: Record<string, string>;
1690
+ config?: Config;
1691
+ }): Record<string, string>;
1692
+ /**
1693
+ * Make an HTTP request
1694
+ */
1695
+ protected makeRequest<T = any>(params: {
1696
+ method: string;
1697
+ url: string;
1698
+ data?: any;
1699
+ headers?: Record<string, string>;
1700
+ query?: Record<string, any>;
1701
+ config?: Config;
1702
+ }): Promise<T>;
1703
+ /**
1704
+ * GET request
1705
+ */
1706
+ get<T = any>(params: {
1707
+ path: string;
1708
+ query?: Record<string, any>;
1709
+ headers?: Record<string, string>;
1710
+ config?: Config;
1711
+ }): Promise<T>;
1712
+ /**
1713
+ * POST request
1714
+ */
1715
+ post<T = any>(params: {
1716
+ path: string;
1717
+ data?: any;
1718
+ query?: Record<string, any>;
1719
+ headers?: Record<string, string>;
1720
+ config?: Config;
1721
+ }): Promise<T>;
1722
+ /**
1723
+ * PUT request
1724
+ */
1725
+ put<T = any>(params: {
1726
+ path: string;
1727
+ data?: any;
1728
+ query?: Record<string, any>;
1729
+ headers?: Record<string, string>;
1730
+ config?: Config;
1731
+ }): Promise<T>;
1732
+ /**
1733
+ * PATCH request
1734
+ */
1735
+ patch<T = any>(params: {
1736
+ path: string;
1737
+ data?: any;
1738
+ query?: Record<string, any>;
1739
+ headers?: Record<string, string>;
1740
+ config?: Config;
1741
+ }): Promise<T>;
1742
+ /**
1743
+ * DELETE request
1744
+ */
1745
+ delete<T = any>(params: {
1746
+ path: string;
1747
+ query?: Record<string, any>;
1748
+ headers?: Record<string, string>;
1749
+ config?: Config;
1750
+ }): Promise<T>;
1751
+ /**
1752
+ * Check sandbox health
1753
+ */
1754
+ checkHealth: (params: {
1755
+ sandboxId: string;
1756
+ config?: Config;
1757
+ }) => Promise<{
1758
+ status: string;
1759
+ [key: string]: any;
1760
+ }>;
1761
+ /**
1762
+ * Create sandbox from template
1763
+ */
1764
+ createSandbox: (params: {
1765
+ templateName: string;
1766
+ sandboxIdleTimeoutSeconds?: number;
1767
+ config?: Config;
1768
+ }) => Promise<any>;
1769
+ /**
1770
+ * Delete sandbox
1771
+ */
1772
+ deleteSandbox: (params: {
1773
+ sandboxId: string;
1774
+ config?: Config;
1775
+ }) => Promise<any>;
1776
+ /**
1777
+ * Stop sandbox
1778
+ */
1779
+ stopSandbox: (params: {
1780
+ sandboxId: string;
1781
+ config?: Config;
1782
+ }) => Promise<any>;
1783
+ /**
1784
+ * Get sandbox info
1785
+ */
1786
+ getSandbox: (params: {
1787
+ sandboxId: string;
1788
+ config?: Config;
1789
+ }) => Promise<any>;
1790
+ }
1791
+
1792
+ /**
1793
+ * Browser Sandbox Data API
1794
+ *
1795
+ * This module provides data API methods for Browser sandboxes.
1796
+ * 此模块提供浏览器沙箱的数据 API 方法。
1797
+ */
1798
+
1799
+ /**
1800
+ * Browser Data API
1801
+ *
1802
+ * Provides methods for interacting with Browser sandbox data endpoints.
1803
+ */
1804
+ declare class BrowserDataAPI extends SandboxDataAPI {
1805
+ protected sandboxId: string;
1806
+ constructor(params: {
1807
+ sandboxId: string;
1808
+ config?: Config;
1809
+ });
1810
+ /**
1811
+ * Generate the WebSocket URL for Chrome DevTools Protocol (CDP) connection
1812
+ */
1813
+ getCdpUrl(record?: boolean): string;
1814
+ /**
1815
+ * Generate the WebSocket URL for VNC (Virtual Network Computing) live view connection
1816
+ */
1817
+ getVncUrl(record?: boolean): string;
1818
+ /**
1819
+ * List all recordings
1820
+ */
1821
+ listRecordings: (params?: {
1822
+ config?: Config;
1823
+ }) => Promise<any>;
1824
+ /**
1825
+ * Delete a recording
1826
+ */
1827
+ deleteRecording: (params: {
1828
+ filename: string;
1829
+ config?: Config;
1830
+ }) => Promise<any>;
1831
+ /**
1832
+ * Download a recording video file
1833
+ */
1834
+ downloadRecording: (params: {
1835
+ filename: string;
1836
+ savePath: string;
1837
+ }) => Promise<{
1838
+ savedPath: string;
1839
+ size: number;
1840
+ }>;
1841
+ /**
1842
+ * Helper method to download video file
1843
+ */
1844
+ protected getVideo(params: {
1845
+ path: string;
1846
+ savePath: string;
1847
+ query?: Record<string, any>;
1848
+ headers?: Record<string, string>;
1849
+ config?: Config;
1850
+ }): Promise<{
1851
+ savedPath: string;
1852
+ size: number;
1853
+ }>;
1854
+ }
1855
+
1856
+ /**
1857
+ * Sandbox Data Models
1858
+ *
1859
+ * 此模块定义 Sandbox 相关的所有数据模型。
1860
+ * This module defines all data models related to Sandbox.
1861
+ */
1862
+
1863
+ /**
1864
+ * Template type enum
1865
+ */
1866
+ declare enum TemplateType {
1867
+ CODE_INTERPRETER = "CodeInterpreter",
1868
+ BROWSER = "Browser",
1869
+ AIO = "AllInOne"
1870
+ }
1871
+ /**
1872
+ * Sandbox state enum
1873
+ */
1874
+ declare enum SandboxState {
1875
+ CREATING = "Creating",
1876
+ RUNNING = "Running",
1877
+ READY = "READY",// API返回的就绪状态,等同于Running
1878
+ STOPPED = "Stopped",
1879
+ FAILED = "Failed",
1880
+ DELETING = "Deleting"
1881
+ }
1882
+ /**
1883
+ * Template network mode enum
1884
+ */
1885
+ declare enum TemplateNetworkMode {
1886
+ PUBLIC = "PUBLIC",
1887
+ PRIVATE = "PRIVATE",
1888
+ PUBLIC_AND_PRIVATE = "PUBLIC_AND_PRIVATE"
1889
+ }
1890
+ /**
1891
+ * OSS permission enum
1892
+ */
1893
+ declare enum TemplateOSSPermission {
1894
+ READ_WRITE = "READ_WRITE",
1895
+ READ_ONLY = "READ_ONLY"
1896
+ }
1897
+ /**
1898
+ * Code language enum
1899
+ */
1900
+ declare enum CodeLanguage {
1901
+ PYTHON = "python"
1902
+ }
1903
+ /**
1904
+ * Template network configuration
1905
+ */
1906
+ interface TemplateNetworkConfiguration {
1907
+ networkMode?: TemplateNetworkMode;
1908
+ securityGroupId?: string;
1909
+ vpcId?: string;
1910
+ vswitchIds?: string[];
1911
+ }
1912
+ /**
1913
+ * Template OSS configuration
1914
+ */
1915
+ interface TemplateOssConfiguration {
1916
+ bucketName: string;
1917
+ mountPoint: string;
1918
+ permission?: TemplateOSSPermission;
1919
+ prefix: string;
1920
+ region: string;
1921
+ }
1922
+ /**
1923
+ * Template log configuration
1924
+ */
1925
+ interface TemplateLogConfiguration {
1926
+ project?: string;
1927
+ logstore?: string;
1928
+ }
1929
+ /**
1930
+ * Template credential configuration
1931
+ */
1932
+ interface TemplateCredentialConfiguration {
1933
+ credentialName?: string;
1934
+ }
1935
+ /**
1936
+ * Template ARMS configuration
1937
+ */
1938
+ interface TemplateArmsConfiguration {
1939
+ armsLicenseKey?: string;
1940
+ enableArms: boolean;
1941
+ }
1942
+ /**
1943
+ * Template container configuration
1944
+ */
1945
+ interface TemplateContainerConfiguration {
1946
+ image?: string;
1947
+ command?: string[];
1948
+ }
1949
+ /**
1950
+ * Template MCP options
1951
+ */
1952
+ interface TemplateMcpOptions {
1953
+ enabledTools?: string[];
1954
+ transport?: string;
1955
+ }
1956
+ /**
1957
+ * Template MCP state
1958
+ */
1959
+ interface TemplateMcpState {
1960
+ accessEndpoint?: string;
1961
+ status?: string;
1962
+ statusReason?: string;
1963
+ }
1964
+ /**
1965
+ * Template create input
1966
+ */
1967
+ interface TemplateCreateInput {
1968
+ templateName?: string;
1969
+ templateType: TemplateType;
1970
+ cpu?: number;
1971
+ memory?: number;
1972
+ executionRoleArn?: string;
1973
+ sandboxIdleTimeoutInSeconds?: number;
1974
+ sandboxTtlInSeconds?: number;
1975
+ shareConcurrencyLimitPerSandbox?: number;
1976
+ templateConfiguration?: Record<string, unknown>;
1977
+ description?: string;
1978
+ environmentVariables?: Record<string, string>;
1979
+ networkConfiguration?: TemplateNetworkConfiguration;
1980
+ ossConfiguration?: TemplateOssConfiguration[];
1981
+ logConfiguration?: TemplateLogConfiguration;
1982
+ credentialConfiguration?: TemplateCredentialConfiguration;
1983
+ armsConfiguration?: TemplateArmsConfiguration;
1984
+ containerConfiguration?: TemplateContainerConfiguration;
1985
+ diskSize?: number;
1986
+ }
1987
+ /**
1988
+ * Template update input
1989
+ */
1990
+ interface TemplateUpdateInput {
1991
+ cpu?: number;
1992
+ memory?: number;
1993
+ executionRoleArn?: string;
1994
+ sandboxIdleTimeoutInSeconds?: number;
1995
+ sandboxTtlInSeconds?: number;
1996
+ shareConcurrencyLimitPerSandbox?: number;
1997
+ description?: string;
1998
+ environmentVariables?: Record<string, string>;
1999
+ networkConfiguration?: TemplateNetworkConfiguration;
2000
+ ossConfiguration?: TemplateOssConfiguration[];
2001
+ logConfiguration?: TemplateLogConfiguration;
2002
+ credentialConfiguration?: TemplateCredentialConfiguration;
2003
+ armsConfiguration?: TemplateArmsConfiguration;
2004
+ containerConfiguration?: TemplateContainerConfiguration;
2005
+ diskSize?: number;
2006
+ }
2007
+ /**
2008
+ * Template list input
2009
+ */
2010
+ interface TemplateListInput extends PageableInput {
2011
+ templateType?: TemplateType;
2012
+ }
2013
+ /**
2014
+ * Sandbox create input
2015
+ */
2016
+ interface SandboxCreateInput {
2017
+ templateName: string;
2018
+ sandboxIdleTimeoutSeconds?: number;
2019
+ }
2020
+ /**
2021
+ * Sandbox list input
2022
+ */
2023
+ interface SandboxListInput {
2024
+ maxResults?: number;
2025
+ nextToken?: string;
2026
+ status?: string;
2027
+ templateName?: string;
2028
+ templateType?: TemplateType;
2029
+ }
2030
+ /**
2031
+ * Template data
2032
+ */
2033
+ interface TemplateData {
2034
+ templateArn?: string;
2035
+ templateId?: string;
2036
+ templateName?: string;
2037
+ templateType?: TemplateType;
2038
+ cpu?: number;
2039
+ memory?: number;
2040
+ createdAt?: string;
2041
+ description?: string;
2042
+ executionRoleArn?: string;
2043
+ lastUpdatedAt?: string;
2044
+ resourceName?: string;
2045
+ sandboxIdleTimeoutInSeconds?: number;
2046
+ sandboxTtlInSeconds?: number;
2047
+ shareConcurrencyLimitPerSandbox?: number;
2048
+ status?: Status;
2049
+ statusReason?: string;
2050
+ diskSize?: number;
2051
+ }
2052
+ /**
2053
+ * Sandbox data
2054
+ */
2055
+ interface SandboxData {
2056
+ sandboxId?: string;
2057
+ sandboxName?: string;
2058
+ templateId?: string;
2059
+ templateName?: string;
2060
+ state?: SandboxState;
2061
+ stateReason?: string;
2062
+ createdAt?: string;
2063
+ lastUpdatedAt?: string;
2064
+ sandboxIdleTimeoutSeconds?: number;
2065
+ }
2066
+ /**
2067
+ * Code execution result
2068
+ */
2069
+ interface ExecuteCodeResult {
2070
+ stdout?: string;
2071
+ stderr?: string;
2072
+ exitCode?: number;
2073
+ error?: string;
2074
+ }
2075
+ /**
2076
+ * File info
2077
+ */
2078
+ interface FileInfo {
2079
+ name: string;
2080
+ path: string;
2081
+ size?: number;
2082
+ isDirectory?: boolean;
2083
+ modifiedAt?: string;
2084
+ }
2085
+
2086
+ /**
2087
+ * Base Sandbox Resource
2088
+ *
2089
+ * 此模块定义基础 Sandbox 资源类。
2090
+ * This module defines the base Sandbox resource class.
2091
+ */
2092
+
2093
+ /**
2094
+ * Base Sandbox resource class
2095
+ */
2096
+ declare class Sandbox implements SandboxData {
2097
+ sandboxId?: string;
2098
+ sandboxName?: string;
2099
+ templateId?: string;
2100
+ templateName?: string;
2101
+ state?: SandboxState;
2102
+ stateReason?: string;
2103
+ createdAt?: string;
2104
+ lastUpdatedAt?: string;
2105
+ sandboxIdleTimeoutSeconds?: number;
2106
+ protected _config?: Config;
2107
+ constructor(data?: Partial<SandboxData>, config?: Config);
2108
+ /**
2109
+ * Create sandbox from SDK response object
2110
+ */
2111
+ static fromInnerObject(obj: any, config?: Config): Sandbox;
2112
+ protected static getClient(config?: Config): $AgentRun.default;
2113
+ /**
2114
+ * Create a new Sandbox
2115
+ */
2116
+ static create(input: SandboxCreateInput, config?: Config): Promise<Sandbox>;
2117
+ /**
2118
+ * Delete a Sandbox by ID
2119
+ */
2120
+ static delete(params: {
2121
+ id: string;
2122
+ config?: Config;
2123
+ }): Promise<Sandbox>;
2124
+ /**
2125
+ * Stop a Sandbox by ID
2126
+ */
2127
+ static stop(params: {
2128
+ id: string;
2129
+ config?: Config;
2130
+ }): Promise<Sandbox>;
2131
+ /**
2132
+ * Get a Sandbox by ID
2133
+ */
2134
+ static get(params: {
2135
+ id: string;
2136
+ templateType?: TemplateType;
2137
+ config?: Config;
2138
+ }): Promise<Sandbox>;
2139
+ /**
2140
+ * List Sandboxes
2141
+ */
2142
+ static list(input?: SandboxListInput, config?: Config): Promise<Sandbox[]>;
2143
+ /**
2144
+ * Handle API errors
2145
+ */
2146
+ protected static handleError(error: unknown): never;
2147
+ /**
2148
+ * Delete this sandbox
2149
+ */
2150
+ delete: (params?: {
2151
+ config?: Config;
2152
+ }) => Promise<Sandbox>;
2153
+ /**
2154
+ * Stop this sandbox
2155
+ */
2156
+ stop: (params?: {
2157
+ config?: Config;
2158
+ }) => Promise<Sandbox>;
2159
+ /**
2160
+ * Refresh this sandbox's data
2161
+ */
2162
+ refresh: (params?: {
2163
+ config?: Config;
2164
+ }) => Promise<Sandbox>;
2165
+ /**
2166
+ * Wait until the sandbox is running
2167
+ */
2168
+ waitUntilRunning: (options?: {
2169
+ timeoutSeconds?: number;
2170
+ intervalSeconds?: number;
2171
+ beforeCheck?: (sandbox: Sandbox) => void;
2172
+ }, config?: Config) => Promise<Sandbox>;
2173
+ }
2174
+
2175
+ /**
2176
+ * Browser Sandbox
2177
+ *
2178
+ * High-level API for browser sandboxes with CDP/VNC connectivity
2179
+ * and recording management.
2180
+ */
2181
+
2182
+ /**
2183
+ * Browser Sandbox
2184
+ *
2185
+ * High-level API for interacting with browser sandboxes.
2186
+ */
2187
+ declare class BrowserSandbox extends Sandbox {
2188
+ static templateType: TemplateType;
2189
+ /**
2190
+ * Create a Browser Sandbox from template
2191
+ */
2192
+ static createFromTemplate(templateName: string, options?: {
2193
+ sandboxIdleTimeoutSeconds?: number;
2194
+ }, config?: Config): Promise<BrowserSandbox>;
2195
+ constructor(sandbox: Sandbox, config?: Config);
2196
+ private _dataApi?;
2197
+ /**
2198
+ * Get data API client
2199
+ */
2200
+ get dataApi(): BrowserDataAPI;
2201
+ /**
2202
+ * Check sandbox health
2203
+ */
2204
+ checkHealth: (params?: {
2205
+ config?: Config;
2206
+ }) => Promise<{
2207
+ status: string;
2208
+ [key: string]: any;
2209
+ }>;
2210
+ /**
2211
+ * Wait for browser sandbox to be ready (polls health check)
2212
+ */
2213
+ waitUntilReady: (params?: {
2214
+ maxRetries?: number;
2215
+ retryIntervalMs?: number;
2216
+ }) => Promise<void>;
2217
+ /**
2218
+ * Get CDP WebSocket URL for browser automation
2219
+ */
2220
+ getCdpUrl(record?: boolean): string;
2221
+ /**
2222
+ * Get VNC WebSocket URL for live view
2223
+ */
2224
+ getVncUrl(record?: boolean): string;
2225
+ /**
2226
+ * List all recordings
2227
+ */
2228
+ listRecordings: (params?: {
2229
+ config?: Config;
2230
+ }) => Promise<any>;
2231
+ /**
2232
+ * Download a recording video file
2233
+ */
2234
+ downloadRecording: (params: {
2235
+ filename: string;
2236
+ savePath: string;
2237
+ }) => Promise<{
2238
+ savedPath: string;
2239
+ size: number;
2240
+ }>;
2241
+ /**
2242
+ * Delete a recording
2243
+ */
2244
+ deleteRecording: (params: {
2245
+ filename: string;
2246
+ config?: Config;
2247
+ }) => Promise<any>;
2248
+ }
2249
+
2250
+ /**
2251
+ * Code Interpreter Sandbox Data API
2252
+ *
2253
+ * This module provides data API methods for Code Interpreter sandboxes.
2254
+ * 此模块提供代码解释器沙箱的数据 API 方法。
2255
+ */
2256
+
2257
+ /**
2258
+ * Code Interpreter Data API
2259
+ *
2260
+ * Provides methods for interacting with Code Interpreter sandbox data endpoints.
2261
+ */
2262
+ declare class CodeInterpreterDataAPI extends SandboxDataAPI {
2263
+ constructor(params: {
2264
+ sandboxId: string;
2265
+ config?: Config;
2266
+ });
2267
+ /**
2268
+ * List directory contents
2269
+ */
2270
+ listDirectory(params?: {
2271
+ path?: string;
2272
+ depth?: number;
2273
+ config?: Config;
2274
+ }): Promise<any>;
2275
+ /**
2276
+ * Get file/directory stats
2277
+ */
2278
+ stat(params: {
2279
+ path: string;
2280
+ config?: Config;
2281
+ }): Promise<any>;
2282
+ /**
2283
+ * Create directory
2284
+ */
2285
+ mkdir(params: {
2286
+ path: string;
2287
+ parents?: boolean;
2288
+ mode?: string;
2289
+ config?: Config;
2290
+ }): Promise<any>;
2291
+ /**
2292
+ * Move file or directory
2293
+ */
2294
+ moveFile(params: {
2295
+ source: string;
2296
+ destination: string;
2297
+ config?: Config;
2298
+ }): Promise<any>;
2299
+ /**
2300
+ * Remove file or directory
2301
+ */
2302
+ removeFile(params: {
2303
+ path: string;
2304
+ config?: Config;
2305
+ }): Promise<any>;
2306
+ /**
2307
+ * List code execution contexts
2308
+ */
2309
+ listContexts(params?: {
2310
+ config?: Config;
2311
+ }): Promise<any>;
2312
+ /**
2313
+ * Create a new code execution context
2314
+ */
2315
+ createContext(params?: {
2316
+ language?: CodeLanguage;
2317
+ cwd?: string;
2318
+ config?: Config;
2319
+ }): Promise<any>;
2320
+ /**
2321
+ * Get context details
2322
+ */
2323
+ getContext(params: {
2324
+ contextId: string;
2325
+ config?: Config;
2326
+ }): Promise<any>;
2327
+ /**
2328
+ * Execute code in a context
2329
+ */
2330
+ executeCode(params: {
2331
+ code: string;
2332
+ contextId?: string;
2333
+ language?: CodeLanguage;
2334
+ timeout?: number;
2335
+ config?: Config;
2336
+ }): Promise<any>;
2337
+ /**
2338
+ * Delete a context
2339
+ */
2340
+ deleteContext(params: {
2341
+ contextId: string;
2342
+ config?: Config;
2343
+ }): Promise<any>;
2344
+ /**
2345
+ * Read file contents
2346
+ */
2347
+ readFile(params: {
2348
+ path: string;
2349
+ config?: Config;
2350
+ }): Promise<any>;
2351
+ /**
2352
+ * Write file contents
2353
+ */
2354
+ writeFile(params: {
2355
+ path: string;
2356
+ content: string;
2357
+ mode?: string;
2358
+ encoding?: string;
2359
+ createDir?: boolean;
2360
+ config?: Config;
2361
+ }): Promise<any>;
2362
+ /**
2363
+ * Upload file to sandbox
2364
+ */
2365
+ uploadFile(params: {
2366
+ localFilePath: string;
2367
+ targetFilePath: string;
2368
+ config?: Config;
2369
+ }): Promise<any>;
2370
+ /**
2371
+ * Download file from sandbox
2372
+ */
2373
+ downloadFile(params: {
2374
+ path: string;
2375
+ savePath: string;
2376
+ config?: Config;
2377
+ }): Promise<{
2378
+ savedPath: string;
2379
+ size: number;
2380
+ }>;
2381
+ /**
2382
+ * Execute shell command
2383
+ */
2384
+ cmd(params: {
2385
+ command: string;
2386
+ cwd: string;
2387
+ timeout?: number;
2388
+ config?: Config;
2389
+ }): Promise<any>;
2390
+ /**
2391
+ * List running processes
2392
+ */
2393
+ listProcesses(params?: {
2394
+ config?: Config;
2395
+ }): Promise<any>;
2396
+ /**
2397
+ * Get process details
2398
+ */
2399
+ getProcess(params: {
2400
+ pid: string;
2401
+ config?: Config;
2402
+ }): Promise<any>;
2403
+ /**
2404
+ * Kill a process
2405
+ */
2406
+ killProcess(params: {
2407
+ pid: string;
2408
+ config?: Config;
2409
+ }): Promise<any>;
2410
+ /**
2411
+ * Helper method to upload file using multipart/form-data
2412
+ */
2413
+ protected postFile(params: {
2414
+ path: string;
2415
+ localFilePath: string;
2416
+ targetFilePath: string;
2417
+ formData?: Record<string, any>;
2418
+ query?: Record<string, any>;
2419
+ headers?: Record<string, string>;
2420
+ config?: Config;
2421
+ }): Promise<any>;
2422
+ /**
2423
+ * Helper method to download file
2424
+ */
2425
+ protected getFile(params: {
2426
+ path: string;
2427
+ savePath: string;
2428
+ query?: Record<string, any>;
2429
+ headers?: Record<string, string>;
2430
+ config?: Config;
2431
+ }): Promise<{
2432
+ savedPath: string;
2433
+ size: number;
2434
+ }>;
2435
+ }
2436
+
2437
+ /**
2438
+ * Code Interpreter Sandbox
2439
+ *
2440
+ * High-level API for code interpreter sandboxes with file, filesystem,
2441
+ * context, and process management operations.
2442
+ */
2443
+
2444
+ /**
2445
+ * File upload/download operations
2446
+ */
2447
+ declare class FileOperations {
2448
+ private sandbox;
2449
+ constructor(sandbox: CodeInterpreterSandbox);
2450
+ /**
2451
+ * Read a file from the code interpreter
2452
+ */
2453
+ read: (params: {
2454
+ path: string;
2455
+ }) => Promise<any>;
2456
+ /**
2457
+ * Write a file to the code interpreter
2458
+ */
2459
+ write: (params: {
2460
+ path: string;
2461
+ content: string;
2462
+ mode?: string;
2463
+ encoding?: string;
2464
+ createDir?: boolean;
2465
+ }) => Promise<any>;
2466
+ }
2467
+ /**
2468
+ * File system operations (list, move, remove, stat, mkdir)
2469
+ */
2470
+ declare class FileSystemOperations {
2471
+ private sandbox;
2472
+ constructor(sandbox: CodeInterpreterSandbox);
2473
+ /**
2474
+ * List directory contents
2475
+ */
2476
+ list: (params?: {
2477
+ path?: string;
2478
+ depth?: number;
2479
+ }) => Promise<any>;
2480
+ /**
2481
+ * Move a file or directory
2482
+ */
2483
+ move: (params: {
2484
+ source: string;
2485
+ destination: string;
2486
+ }) => Promise<any>;
2487
+ /**
2488
+ * Remove a file or directory
2489
+ */
2490
+ remove: (params: {
2491
+ path: string;
2492
+ }) => Promise<any>;
2493
+ /**
2494
+ * Get file or directory statistics
2495
+ */
2496
+ stat: (params: {
2497
+ path: string;
2498
+ }) => Promise<any>;
2499
+ /**
2500
+ * Create a directory
2501
+ */
2502
+ mkdir: (params: {
2503
+ path: string;
2504
+ parents?: boolean;
2505
+ mode?: string;
2506
+ }) => Promise<any>;
2507
+ /**
2508
+ * Upload a file to the code interpreter
2509
+ */
2510
+ upload: (params: {
2511
+ localFilePath: string;
2512
+ targetFilePath: string;
2513
+ }) => Promise<any>;
2514
+ /**
2515
+ * Download a file from the code interpreter
2516
+ */
2517
+ download: (params: {
2518
+ path: string;
2519
+ savePath: string;
2520
+ }) => Promise<{
2521
+ savedPath: string;
2522
+ size: number;
2523
+ }>;
2524
+ }
2525
+ /**
2526
+ * Process management operations
2527
+ */
2528
+ declare class ProcessOperations {
2529
+ private sandbox;
2530
+ constructor(sandbox: CodeInterpreterSandbox);
2531
+ /**
2532
+ * Execute a command in the code interpreter
2533
+ */
2534
+ cmd: (params: {
2535
+ command: string;
2536
+ cwd: string;
2537
+ timeout?: number;
2538
+ }) => Promise<any>;
2539
+ /**
2540
+ * List all processes
2541
+ */
2542
+ list: (params?: {
2543
+ config?: Config;
2544
+ }) => Promise<any>;
2545
+ /**
2546
+ * Get a specific process by PID
2547
+ */
2548
+ get: (params: {
2549
+ pid: string;
2550
+ }) => Promise<any>;
2551
+ /**
2552
+ * Kill a specific process by PID
2553
+ */
2554
+ kill: (params: {
2555
+ pid: string;
2556
+ }) => Promise<any>;
2557
+ }
2558
+ /**
2559
+ * Context management operations
2560
+ */
2561
+ declare class ContextOperations {
2562
+ private sandbox;
2563
+ private _contextId?;
2564
+ private _language?;
2565
+ private _cwd?;
2566
+ constructor(sandbox: CodeInterpreterSandbox);
2567
+ /**
2568
+ * Get the current context ID
2569
+ */
2570
+ get contextId(): string | undefined;
2571
+ /**
2572
+ * List all contexts
2573
+ */
2574
+ list: (params?: {
2575
+ config?: Config;
2576
+ }) => Promise<any>;
2577
+ /**
2578
+ * Create a new context and save its ID
2579
+ */
2580
+ create: (params?: {
2581
+ language?: CodeLanguage;
2582
+ cwd?: string;
2583
+ }) => Promise<ContextOperations>;
2584
+ /**
2585
+ * Get a specific context by ID
2586
+ */
2587
+ get: (params?: {
2588
+ contextId?: string;
2589
+ }) => Promise<ContextOperations>;
2590
+ /**
2591
+ * Execute code in a context
2592
+ */
2593
+ execute: (params: {
2594
+ code: string;
2595
+ language?: CodeLanguage;
2596
+ contextId?: string;
2597
+ timeout?: number;
2598
+ }) => Promise<any>;
2599
+ /**
2600
+ * Delete a context
2601
+ */
2602
+ delete: (params?: {
2603
+ contextId?: string;
2604
+ }) => Promise<any>;
2605
+ }
2606
+ /**
2607
+ * Code Interpreter Sandbox
2608
+ *
2609
+ * High-level API for interacting with code interpreter sandboxes.
2610
+ */
2611
+ declare class CodeInterpreterSandbox extends Sandbox {
2612
+ static templateType: TemplateType;
2613
+ /**
2614
+ * Create a Code Interpreter Sandbox from template
2615
+ */
2616
+ static createFromTemplate(templateName: string, options?: {
2617
+ sandboxIdleTimeoutSeconds?: number;
2618
+ }, config?: Config): Promise<CodeInterpreterSandbox>;
2619
+ constructor(sandbox: Sandbox, config?: Config);
2620
+ private _dataApi?;
2621
+ private _file?;
2622
+ private _fileSystem?;
2623
+ private _context?;
2624
+ private _process?;
2625
+ /**
2626
+ * Get data API client
2627
+ */
2628
+ get dataApi(): CodeInterpreterDataAPI;
2629
+ /**
2630
+ * Access file upload/download operations
2631
+ */
2632
+ get file(): FileOperations;
2633
+ /**
2634
+ * Access file system operations
2635
+ */
2636
+ get fileSystem(): FileSystemOperations;
2637
+ /**
2638
+ * Access context management operations
2639
+ */
2640
+ get context(): ContextOperations;
2641
+ /**
2642
+ * Access process management operations
2643
+ */
2644
+ get process(): ProcessOperations;
2645
+ /**
2646
+ * Check sandbox health
2647
+ */
2648
+ checkHealth: (params?: {
2649
+ config?: Config;
2650
+ }) => Promise<{
2651
+ status: string;
2652
+ [key: string]: any;
2653
+ }>;
2654
+ /**
2655
+ * Wait for sandbox to be ready (polls health check)
2656
+ */
2657
+ waitUntilReady: (params?: {
2658
+ maxRetries?: number;
2659
+ retryIntervalMs?: number;
2660
+ }) => Promise<void>;
2661
+ /**
2662
+ * Execute code (convenience method delegating to context.execute)
2663
+ */
2664
+ execute: (params: {
2665
+ code: string;
2666
+ language?: CodeLanguage;
2667
+ contextId?: string;
2668
+ timeout?: number;
2669
+ }) => Promise<any>;
2670
+ }
2671
+
2672
+ /**
2673
+ * Template Resource
2674
+ *
2675
+ * 此模块定义 Template 资源类。
2676
+ * This module defines the Template resource class.
2677
+ */
2678
+
2679
+ /**
2680
+ * Template resource class
2681
+ */
2682
+ declare class Template implements TemplateData {
2683
+ templateArn?: string;
2684
+ templateId?: string;
2685
+ templateName?: string;
2686
+ templateType?: TemplateType;
2687
+ cpu?: number;
2688
+ memory?: number;
2689
+ createdAt?: string;
2690
+ description?: string;
2691
+ executionRoleArn?: string;
2692
+ lastUpdatedAt?: string;
2693
+ resourceName?: string;
2694
+ sandboxIdleTimeoutInSeconds?: number;
2695
+ sandboxTtlInSeconds?: number;
2696
+ shareConcurrencyLimitPerSandbox?: number;
2697
+ status?: Status;
2698
+ statusReason?: string;
2699
+ diskSize?: number;
2700
+ private _config?;
2701
+ constructor(data?: Partial<TemplateData>, config?: Config);
2702
+ /**
2703
+ * Create template from SDK response object
2704
+ */
2705
+ static fromInnerObject(obj: $AgentRun.Template, config?: Config): Template;
2706
+ private static getClient;
2707
+ /**
2708
+ * Create a new Template
2709
+ */
2710
+ static create(params: {
2711
+ input: TemplateCreateInput;
2712
+ config?: Config;
2713
+ }): Promise<Template>;
2714
+ /**
2715
+ * Get defaults based on template type
2716
+ */
2717
+ private static getDefaults;
2718
+ /**
2719
+ * Validate template configuration
2720
+ */
2721
+ private static validate;
2722
+ /**
2723
+ * Delete a Template by name
2724
+ */
2725
+ static delete(params: {
2726
+ name: string;
2727
+ config?: Config;
2728
+ }): Promise<Template>;
2729
+ /**
2730
+ * Update a Template by name
2731
+ */
2732
+ static update(params: {
2733
+ name: string;
2734
+ input: TemplateUpdateInput;
2735
+ config?: Config;
2736
+ }): Promise<Template>;
2737
+ /**
2738
+ * Get a Template by name
2739
+ */
2740
+ static get(params: {
2741
+ name: string;
2742
+ config?: Config;
2743
+ }): Promise<Template>;
2744
+ /**
2745
+ * List Templates
2746
+ */
2747
+ static list(input?: TemplateListInput, config?: Config): Promise<Template[]>;
2748
+ /**
2749
+ * List all Templates (with pagination)
2750
+ */
2751
+ static listAll(options?: {
2752
+ templateType?: TemplateType;
2753
+ }, config?: Config): Promise<Template[]>;
2754
+ /**
2755
+ * Handle API errors
2756
+ */
2757
+ private static handleError;
2758
+ /**
2759
+ * Delete this template
2760
+ */
2761
+ delete: (params?: {
2762
+ config?: Config;
2763
+ }) => Promise<Template>;
2764
+ /**
2765
+ * Update this template
2766
+ */
2767
+ update: (params: {
2768
+ input: TemplateUpdateInput;
2769
+ config?: Config;
2770
+ }) => Promise<Template>;
2771
+ /**
2772
+ * Refresh this template's data
2773
+ */
2774
+ refresh: (params?: {
2775
+ config?: Config;
2776
+ }) => Promise<Template>;
2777
+ /**
2778
+ * Wait until the template is ready
2779
+ */
2780
+ waitUntilReady: (options?: {
2781
+ timeoutSeconds?: number;
2782
+ intervalSeconds?: number;
2783
+ beforeCheck?: (template: Template) => void;
2784
+ }, config?: Config) => Promise<Template>;
2785
+ }
2786
+
2787
+ /**
2788
+ * Sandbox Client
2789
+ *
2790
+ * 此模块提供 Sandbox 的客户端 API。
2791
+ * This module provides the client API for Sandbox.
2792
+ */
2793
+
2794
+ /**
2795
+ * Sandbox Client
2796
+ *
2797
+ * 提供 Sandbox 和 Template 的管理功能。
2798
+ */
2799
+ declare class SandboxClient {
2800
+ private config?;
2801
+ constructor(config?: Config);
2802
+ /**
2803
+ * Create a Template
2804
+ */
2805
+ createTemplate: (params: {
2806
+ input: TemplateCreateInput;
2807
+ config?: Config;
2808
+ }) => Promise<Template>;
2809
+ /**
2810
+ * Delete a Template
2811
+ */
2812
+ deleteTemplate: (params: {
2813
+ name: string;
2814
+ config?: Config;
2815
+ }) => Promise<Template>;
2816
+ /**
2817
+ * Update a Template
2818
+ */
2819
+ updateTemplate: (params: {
2820
+ name: string;
2821
+ input: TemplateUpdateInput;
2822
+ config?: Config;
2823
+ }) => Promise<Template>;
2824
+ /**
2825
+ * Get a Template
2826
+ */
2827
+ getTemplate: (params: {
2828
+ name: string;
2829
+ config?: Config;
2830
+ }) => Promise<Template>;
2831
+ /**
2832
+ * List Templates
2833
+ */
2834
+ listTemplates: (params?: {
2835
+ input?: TemplateListInput;
2836
+ config?: Config;
2837
+ }) => Promise<Template[]>;
2838
+ /**
2839
+ * List all Templates
2840
+ */
2841
+ listAllTemplates: (params?: {
2842
+ options?: {
2843
+ templateType?: TemplateType;
2844
+ };
2845
+ config?: Config;
2846
+ }) => Promise<Template[]>;
2847
+ /**
2848
+ * Create a Sandbox
2849
+ */
2850
+ createSandbox: (params: {
2851
+ input: SandboxCreateInput;
2852
+ config?: Config;
2853
+ }) => Promise<Sandbox>;
2854
+ /**
2855
+ * Create a Code Interpreter Sandbox
2856
+ */
2857
+ createCodeInterpreterSandbox: (params: {
2858
+ templateName: string;
2859
+ options?: {
2860
+ sandboxIdleTimeoutSeconds?: number;
2861
+ };
2862
+ config?: Config;
2863
+ }) => Promise<CodeInterpreterSandbox>;
2864
+ /**
2865
+ * Create a Browser Sandbox
2866
+ */
2867
+ createBrowserSandbox: (params: {
2868
+ templateName: string;
2869
+ options?: {
2870
+ sandboxIdleTimeoutSeconds?: number;
2871
+ };
2872
+ config?: Config;
2873
+ }) => Promise<BrowserSandbox>;
2874
+ /**
2875
+ * Delete a Sandbox
2876
+ */
2877
+ deleteSandbox: (params: {
2878
+ id: string;
2879
+ config?: Config;
2880
+ }) => Promise<Sandbox>;
2881
+ /**
2882
+ * Stop a Sandbox
2883
+ */
2884
+ stopSandbox: (params: {
2885
+ id: string;
2886
+ config?: Config;
2887
+ }) => Promise<Sandbox>;
2888
+ /**
2889
+ * Get a Sandbox
2890
+ *
2891
+ * @param params.id - Sandbox ID
2892
+ * @param params.templateType - Template type to cast the result to the appropriate subclass
2893
+ * @param params.config - Configuration
2894
+ */
2895
+ getSandbox: (params: {
2896
+ id: string;
2897
+ templateType?: TemplateType;
2898
+ config?: Config;
2899
+ }) => Promise<Sandbox>;
2900
+ /**
2901
+ * List Sandboxes
2902
+ */
2903
+ listSandboxes: (params?: {
2904
+ input?: SandboxListInput;
2905
+ config?: Config;
2906
+ }) => Promise<Sandbox[]>;
2907
+ }
2908
+
2909
+ /**
2910
+ * AIO (All-In-One) Sandbox Data API
2911
+ *
2912
+ * This module provides a combined data API that includes both Code Interpreter
2913
+ * and Browser sandbox functionalities.
2914
+ * 此模块提供包含代码解释器和浏览器沙箱功能的组合数据 API。
2915
+ */
2916
+
2917
+ /**
2918
+ * AIO Data API
2919
+ *
2920
+ * Combines both Code Interpreter and Browser data API methods.
2921
+ */
2922
+ declare class AioDataAPI extends CodeInterpreterDataAPI {
2923
+ private browserAPI;
2924
+ constructor(params: {
2925
+ sandboxId: string;
2926
+ config?: Config;
2927
+ });
2928
+ /**
2929
+ * Get CDP WebSocket URL for browser automation
2930
+ */
2931
+ getCdpUrl(record?: boolean): string;
2932
+ /**
2933
+ * Get VNC WebSocket URL for live view
2934
+ */
2935
+ getVncUrl(record?: boolean): string;
2936
+ /**
2937
+ * List browser recordings
2938
+ */
2939
+ listRecordings: (params?: {
2940
+ config?: Config;
2941
+ }) => Promise<any>;
2942
+ /**
2943
+ * Delete a recording
2944
+ */
2945
+ deleteRecording: (params: {
2946
+ filename: string;
2947
+ config?: Config;
2948
+ }) => Promise<any>;
2949
+ /**
2950
+ * Download a recording
2951
+ */
2952
+ downloadRecording: (params: {
2953
+ filename: string;
2954
+ savePath: string;
2955
+ }) => Promise<{
2956
+ savedPath: string;
2957
+ size: number;
2958
+ }>;
2959
+ }
2960
+
2961
+ /**
2962
+ * AIO (All-In-One) Sandbox
2963
+ *
2964
+ * Combines both Code Interpreter and Browser sandbox functionalities
2965
+ * into a single unified interface.
2966
+ */
2967
+
2968
+ /**
2969
+ * File upload/download operations
2970
+ */
2971
+ declare class AioFileOperations {
2972
+ private sandbox;
2973
+ constructor(sandbox: AioSandbox);
2974
+ /**
2975
+ * Read a file from the sandbox
2976
+ */
2977
+ read: (path: string) => Promise<any>;
2978
+ /**
2979
+ * Write a file to the sandbox
2980
+ */
2981
+ write: (params: {
2982
+ path: string;
2983
+ content: string;
2984
+ mode?: string;
2985
+ encoding?: string;
2986
+ createDir?: boolean;
2987
+ }) => Promise<any>;
2988
+ }
2989
+ /**
2990
+ * File system operations (list, move, remove, stat, mkdir)
2991
+ */
2992
+ declare class AioFileSystemOperations {
2993
+ private sandbox;
2994
+ constructor(sandbox: AioSandbox);
2995
+ /**
2996
+ * List directory contents
2997
+ */
2998
+ list: (params?: {
2999
+ path?: string;
3000
+ depth?: number;
3001
+ }) => Promise<any>;
3002
+ /**
3003
+ * Move a file or directory
3004
+ */
3005
+ move: (params: {
3006
+ source: string;
3007
+ destination: string;
3008
+ }) => Promise<any>;
3009
+ /**
3010
+ * Remove a file or directory
3011
+ */
3012
+ remove: (params: {
3013
+ path: string;
3014
+ }) => Promise<any>;
3015
+ /**
3016
+ * Get file or directory statistics
3017
+ */
3018
+ stat: (params: {
3019
+ path: string;
3020
+ }) => Promise<any>;
3021
+ /**
3022
+ * Create a directory
3023
+ */
3024
+ mkdir: (params: {
3025
+ path: string;
3026
+ parents?: boolean;
3027
+ mode?: string;
3028
+ }) => Promise<any>;
3029
+ /**
3030
+ * Upload a file to the sandbox
3031
+ */
3032
+ upload: (params: {
3033
+ localFilePath: string;
3034
+ targetFilePath: string;
3035
+ }) => Promise<any>;
3036
+ /**
3037
+ * Download a file from the sandbox
3038
+ */
3039
+ download: (params: {
3040
+ path: string;
3041
+ savePath: string;
3042
+ }) => Promise<{
3043
+ savedPath: string;
3044
+ size: number;
3045
+ }>;
3046
+ }
3047
+ /**
3048
+ * Process management operations
3049
+ */
3050
+ declare class AioProcessOperations {
3051
+ private sandbox;
3052
+ constructor(sandbox: AioSandbox);
3053
+ /**
3054
+ * Execute a command in the sandbox
3055
+ */
3056
+ cmd: (params: {
3057
+ command: string;
3058
+ cwd: string;
3059
+ timeout?: number;
3060
+ }) => Promise<any>;
3061
+ /**
3062
+ * List all processes
3063
+ */
3064
+ list: (params?: {
3065
+ config?: Config;
3066
+ }) => Promise<any>;
3067
+ /**
3068
+ * Get a specific process by PID
3069
+ */
3070
+ get: (params: {
3071
+ pid: string;
3072
+ }) => Promise<any>;
3073
+ /**
3074
+ * Kill a specific process by PID
3075
+ */
3076
+ kill: (params: {
3077
+ pid: string;
3078
+ }) => Promise<any>;
3079
+ }
3080
+ /**
3081
+ * Context management operations
3082
+ */
3083
+ declare class AioContextOperations {
3084
+ private sandbox;
3085
+ private _contextId?;
3086
+ private _language?;
3087
+ private _cwd?;
3088
+ constructor(sandbox: AioSandbox);
3089
+ /**
3090
+ * Get the current context ID
3091
+ */
3092
+ get contextId(): string | undefined;
3093
+ /**
3094
+ * List all contexts
3095
+ */
3096
+ list: (params?: {
3097
+ config?: Config;
3098
+ }) => Promise<any>;
3099
+ /**
3100
+ * Create a new context and save its ID
3101
+ */
3102
+ create: (params?: {
3103
+ language?: CodeLanguage;
3104
+ cwd?: string;
3105
+ }) => Promise<AioContextOperations>;
3106
+ /**
3107
+ * Get a specific context by ID
3108
+ */
3109
+ get: (params?: {
3110
+ contextId?: string;
3111
+ }) => Promise<AioContextOperations>;
3112
+ /**
3113
+ * Execute code in a context
3114
+ */
3115
+ execute: (params: {
3116
+ code: string;
3117
+ language?: CodeLanguage;
3118
+ contextId?: string;
3119
+ timeout?: number;
3120
+ }) => Promise<any>;
3121
+ /**
3122
+ * Delete a context
3123
+ */
3124
+ delete: (params?: {
3125
+ contextId?: string;
3126
+ }) => Promise<any>;
3127
+ }
3128
+ /**
3129
+ * AIO (All-In-One) Sandbox
3130
+ *
3131
+ * Combines both Code Interpreter and Browser sandbox functionalities.
3132
+ */
3133
+ declare class AioSandbox extends Sandbox {
3134
+ static templateType: TemplateType;
3135
+ /**
3136
+ * Create an AIO Sandbox from template
3137
+ */
3138
+ static createFromTemplate(templateName: string, options?: {
3139
+ sandboxIdleTimeoutSeconds?: number;
3140
+ }, config?: Config): Promise<AioSandbox>;
3141
+ constructor(sandbox: Sandbox, config?: Config);
3142
+ private _dataApi?;
3143
+ private _file?;
3144
+ private _fileSystem?;
3145
+ private _context?;
3146
+ private _process?;
3147
+ /**
3148
+ * Get data API client
3149
+ */
3150
+ get dataApi(): AioDataAPI;
3151
+ /**
3152
+ * Access file upload/download operations
3153
+ */
3154
+ get file(): AioFileOperations;
3155
+ /**
3156
+ * Access file system operations
3157
+ */
3158
+ get fileSystem(): AioFileSystemOperations;
3159
+ /**
3160
+ * Access context management operations
3161
+ */
3162
+ get context(): AioContextOperations;
3163
+ /**
3164
+ * Access process management operations
3165
+ */
3166
+ get process(): AioProcessOperations;
3167
+ /**
3168
+ * Check sandbox health
3169
+ */
3170
+ checkHealth: (params?: {
3171
+ config?: Config;
3172
+ }) => Promise<{
3173
+ status: string;
3174
+ [key: string]: any;
3175
+ }>;
3176
+ /**
3177
+ * Wait for sandbox to be ready (polls health check)
3178
+ */
3179
+ waitUntilReady: (params?: {
3180
+ maxRetries?: number;
3181
+ retryIntervalMs?: number;
3182
+ }) => Promise<void>;
3183
+ /**
3184
+ * Get CDP WebSocket URL for browser automation
3185
+ */
3186
+ getCdpUrl(record?: boolean): string;
3187
+ /**
3188
+ * Get VNC WebSocket URL for live view
3189
+ */
3190
+ getVncUrl(record?: boolean): string;
3191
+ /**
3192
+ * List all browser recordings
3193
+ */
3194
+ listRecordings: (params?: {
3195
+ config?: Config;
3196
+ }) => Promise<any>;
3197
+ /**
3198
+ * Download a recording video file
3199
+ */
3200
+ downloadRecording: (params: {
3201
+ filename: string;
3202
+ savePath: string;
3203
+ }) => Promise<{
3204
+ savedPath: string;
3205
+ size: number;
3206
+ }>;
3207
+ /**
3208
+ * Delete a recording
3209
+ */
3210
+ deleteRecording: (params: {
3211
+ filename: string;
3212
+ config?: Config;
3213
+ }) => Promise<any>;
3214
+ /**
3215
+ * Execute code (convenience method delegating to context.execute)
3216
+ */
3217
+ execute: (params: {
3218
+ code: string;
3219
+ language?: CodeLanguage;
3220
+ contextId?: string;
3221
+ timeout?: number;
3222
+ }) => Promise<any>;
3223
+ }
3224
+
3225
+ /**
3226
+ * Model Service Data Models
3227
+ *
3228
+ * 此模块定义 Model Service 相关的所有数据模型。
3229
+ * This module defines all data models related to Model Service.
3230
+ */
3231
+
3232
+ /**
3233
+ * Backend type enum
3234
+ */
3235
+ type BackendType = 'proxy' | 'service';
3236
+ declare const BackendType: {
3237
+ PROXY: BackendType;
3238
+ SERVICE: BackendType;
3239
+ };
3240
+ /**
3241
+ * Model type enum
3242
+ */
3243
+ type ModelType = 'llm' | 'text-embedding' | 'speech2text' | 'tts' | 'rerank' | 'moderation';
3244
+ declare const ModelType: {
3245
+ LLM: ModelType;
3246
+ TEXT_EMBEDDING: ModelType;
3247
+ SPEECH2TEXT: ModelType;
3248
+ TTS: ModelType;
3249
+ RERANK: ModelType;
3250
+ MODERATION: ModelType;
3251
+ };
3252
+ /**
3253
+ * Provider enum
3254
+ */
3255
+ type Provider = 'openai' | 'anthropic' | 'baichuan' | 'deepseek' | 'gemini' | 'hunyuan' | 'minimax' | 'moonshot' | 'spark' | 'stepfun' | 'tongyi' | 'vertex_ai' | 'wenxin' | 'yi' | 'zhipuai' | 'custom';
3256
+ declare const Provider: {
3257
+ OPENAI: Provider;
3258
+ ANTHROPIC: Provider;
3259
+ BAICHUAN: Provider;
3260
+ DEEPSEEK: Provider;
3261
+ GEMINI: Provider;
3262
+ HUNYUAN: Provider;
3263
+ MINIMAX: Provider;
3264
+ MOONSHOT: Provider;
3265
+ SPARK: Provider;
3266
+ STEPFUN: Provider;
3267
+ TONGYI: Provider;
3268
+ VERTEX_AI: Provider;
3269
+ WENXIN: Provider;
3270
+ YI: Provider;
3271
+ ZHIPUAI: Provider;
3272
+ CUSTOM: Provider;
3273
+ };
3274
+ type ProxyMode = 'single' | 'multi';
3275
+ declare const ProxyMode: {
3276
+ SINGLE: ProxyMode;
3277
+ MULTI: ProxyMode;
3278
+ };
3279
+ /**
3280
+ * Provider settings
3281
+ */
3282
+ interface ProviderSettings {
3283
+ apiKey?: string;
3284
+ baseUrl?: string;
3285
+ modelNames?: string[];
3286
+ }
3287
+ /**
3288
+ * Model features
3289
+ */
3290
+ interface ModelFeatures {
3291
+ agentThought?: boolean;
3292
+ multiToolCall?: boolean;
3293
+ streamToolCall?: boolean;
3294
+ toolCall?: boolean;
3295
+ vision?: boolean;
3296
+ }
3297
+ /**
3298
+ * Model properties
3299
+ */
3300
+ interface ModelProperties {
3301
+ contextSize?: number;
3302
+ }
3303
+ /**
3304
+ * Model parameter rule
3305
+ */
3306
+ interface ModelParameterRule {
3307
+ default?: unknown;
3308
+ max?: number;
3309
+ min?: number;
3310
+ name?: string;
3311
+ required?: boolean;
3312
+ type?: string;
3313
+ }
3314
+ /**
3315
+ * Model info config
3316
+ */
3317
+ interface ModelInfoConfig {
3318
+ modelName?: string;
3319
+ modelFeatures?: ModelFeatures;
3320
+ modelProperties?: ModelProperties;
3321
+ modelParameterRules?: ModelParameterRule[];
3322
+ }
3323
+ /**
3324
+ * Proxy config endpoint
3325
+ */
3326
+ interface ProxyConfigEndpoint {
3327
+ baseUrl?: string;
3328
+ modelNames?: string[];
3329
+ modelServiceName?: string;
3330
+ weight?: number;
3331
+ }
3332
+ /**
3333
+ * Proxy config fallback
3334
+ */
3335
+ interface ProxyConfigFallback {
3336
+ modelName?: string;
3337
+ modelServiceName?: string;
3338
+ }
3339
+ interface ProxyConfigTokenRateLimiter {
3340
+ tps?: number;
3341
+ tpm?: number;
3342
+ tph?: number;
3343
+ tpd?: number;
3344
+ }
3345
+ interface ProxyConfigAIGuardrailConfig {
3346
+ checkRequest?: boolean;
3347
+ checkResponse?: boolean;
3348
+ }
3349
+ /**
3350
+ * Proxy config policies
3351
+ */
3352
+ interface ProxyConfigPolicies {
3353
+ cache?: boolean;
3354
+ concurrencyLimit?: number;
3355
+ fallbacks?: ProxyConfigFallback[];
3356
+ numRetries?: number;
3357
+ requestTimeout?: number;
3358
+ aiGuardrailConfig?: ProxyConfigAIGuardrailConfig;
3359
+ tokenRateLimiter?: ProxyConfigTokenRateLimiter;
3360
+ }
3361
+ /**
3362
+ * Proxy config
3363
+ */
3364
+ interface ProxyConfig {
3365
+ endpoints?: ProxyConfigEndpoint[];
3366
+ policies?: ProxyConfigPolicies;
3367
+ }
3368
+ interface CommonModelMutableProps {
3369
+ credentialName?: string;
3370
+ description?: string;
3371
+ networkConfiguration?: NetworkConfig;
3372
+ tags?: string[];
3373
+ }
3374
+ interface CommonModelImmutableProps {
3375
+ modelType?: ModelType;
3376
+ }
3377
+ interface CommonModelSystemProps {
3378
+ createdAt?: string;
3379
+ lastUpdatedAt?: string;
3380
+ status?: Status;
3381
+ }
3382
+ interface ModelServiceMutableProps extends CommonModelMutableProps {
3383
+ providerSettings?: ProviderSettings;
3384
+ }
3385
+ interface ModelServiceImmutableProps extends CommonModelImmutableProps {
3386
+ modelInfoConfigs?: ModelInfoConfig[];
3387
+ modelServiceName?: string;
3388
+ provider?: string;
3389
+ }
3390
+ interface ModelServiceSystemProps extends CommonModelSystemProps {
3391
+ modelServiceId?: string;
3392
+ }
3393
+ interface ModelProxyMutableProps extends CommonModelMutableProps {
3394
+ cpu?: number;
3395
+ litellmVersion?: string;
3396
+ memory?: number;
3397
+ modelProxyName?: string;
3398
+ proxyModel?: ProxyMode;
3399
+ serviceRegionId?: string;
3400
+ proxyConfig?: ProxyConfig;
3401
+ executionRoleArn?: string;
3402
+ }
3403
+ interface ModelProxyImmutableProps extends CommonModelImmutableProps {
3404
+ }
3405
+ interface ModelProxySystemProps extends CommonModelSystemProps {
3406
+ endpoint?: string;
3407
+ functionName?: string;
3408
+ modelProxyId?: string;
3409
+ }
3410
+ interface ModelServiceCreateInput extends ModelServiceImmutableProps, ModelServiceMutableProps {
3411
+ }
3412
+ interface ModelServiceUpdateInput extends ModelServiceMutableProps {
3413
+ }
3414
+ interface ModelServiceListInput extends PageableInput {
3415
+ modelServiceName?: string;
3416
+ modelType?: ModelType;
3417
+ provider?: string;
3418
+ }
3419
+ /**
3420
+ * Model proxy create input
3421
+ */
3422
+ interface ModelProxyCreateInput extends ModelServiceImmutableProps, ModelProxyMutableProps {
3423
+ }
3424
+ /**
3425
+ * Model proxy update input
3426
+ */
3427
+ interface ModelProxyUpdateInput extends ModelServiceMutableProps {
3428
+ proxyModel?: string;
3429
+ executionRoleArn?: string;
3430
+ }
3431
+ /**
3432
+ * Model proxy list input
3433
+ */
3434
+ interface ModelProxyListInput extends PageableInput {
3435
+ modelProxyName?: string;
3436
+ proxyMode?: string;
3437
+ status?: Status;
3438
+ }
3439
+
3440
+ /**
3441
+ * 模型代理 / Model Proxy
3442
+ */
3443
+ declare class ModelProxy extends ResourceBase implements ModelProxyImmutableProps, ModelProxyMutableProps, ModelProxySystemProps {
3444
+ modelType?: ModelProxyImmutableProps['modelType'];
3445
+ credentialName?: string;
3446
+ description?: string;
3447
+ networkConfiguration?: ModelProxyMutableProps['networkConfiguration'];
3448
+ tags?: string[];
3449
+ cpu?: number;
3450
+ litellmVersion?: string;
3451
+ memory?: number;
3452
+ modelProxyName?: string;
3453
+ proxyModel?: ProxyMode;
3454
+ serviceRegionId?: string;
3455
+ proxyConfig?: ModelProxyMutableProps['proxyConfig'];
3456
+ executionRoleArn?: string;
3457
+ endpoint?: string;
3458
+ functionName?: string;
3459
+ modelProxyId?: string;
3460
+ createdAt?: string;
3461
+ lastUpdatedAt?: string;
3462
+ status?: ModelProxySystemProps['status'];
3463
+ /**
3464
+ * 获取客户端 / Get client
3465
+ *
3466
+ * @returns ModelClient 实例
3467
+ */
3468
+ private static getClient;
3469
+ /**
3470
+ * 创建模型代理 / Create model proxy
3471
+ *
3472
+ * @param params - 参数 / Parameters
3473
+ * @returns 创建的模型代理对象 / Created model proxy object
3474
+ */
3475
+ static create(params: {
3476
+ input: ModelProxyCreateInput;
3477
+ config?: Config;
3478
+ }): Promise<ModelProxy>;
3479
+ /**
3480
+ * 根据名称删除模型代理 / Delete model proxy by name
3481
+ *
3482
+ * @param params - 参数 / Parameters
3483
+ * @returns 删除的模型代理对象 / Deleted model proxy object
3484
+ */
3485
+ static delete(params: {
3486
+ name: string;
3487
+ config?: Config;
3488
+ }): Promise<ModelProxy>;
3489
+ /**
3490
+ * 根据名称更新模型代理 / Update model proxy by name
3491
+ *
3492
+ * @param params - 参数 / Parameters
3493
+ * @returns 更新后的模型代理对象 / Updated model proxy object
3494
+ */
3495
+ static update(params: {
3496
+ name: string;
3497
+ input: ModelProxyUpdateInput;
3498
+ config?: Config;
3499
+ }): Promise<ModelProxy>;
3500
+ /**
3501
+ * 根据名称获取模型代理 / Get model proxy by name
3502
+ *
3503
+ * @param params - 参数 / Parameters
3504
+ * @returns 模型代理对象 / Model proxy object
3505
+ */
3506
+ static get(params: {
3507
+ name: string;
3508
+ config?: Config;
3509
+ }): Promise<ModelProxy>;
3510
+ /**
3511
+ * 列出模型代理(分页)/ List model proxies (paginated)
3512
+ *
3513
+ * @param pageInput - 分页参数 / Pagination parameters
3514
+ * @param config - 配置 / Configuration
3515
+ * @param kwargs - 其他查询参数 / Other query parameters
3516
+ * @returns 模型代理列表 / Model proxy list
3517
+ */
3518
+ protected static listPage(pageInput: PageableInput, config?: Config, kwargs?: Partial<ModelProxyListInput>): Promise<ModelProxy[]>;
3519
+ /**
3520
+ * 列出所有模型代理 / List all model proxies
3521
+ *
3522
+ * @param options - 查询选项 / Query options
3523
+ * @param config - 配置 / Configuration
3524
+ * @returns 模型代理列表 / Model proxy list
3525
+ */
3526
+ static listAll(options?: {
3527
+ proxyMode?: string;
3528
+ status?: Status;
3529
+ config?: Config;
3530
+ }): Promise<ModelProxy[]>;
3531
+ /**
3532
+ * 更新模型代理 / Update model proxy
3533
+ *
3534
+ * @param input - 模型代理更新输入参数 / Model proxy update input parameters
3535
+ * @param config - 配置 / Configuration
3536
+ * @returns 更新后的模型代理对象 / Updated model proxy object
3537
+ */
3538
+ update: (params: {
3539
+ input: ModelProxyUpdateInput;
3540
+ config?: Config;
3541
+ }) => Promise<ModelProxy>;
3542
+ /**
3543
+ * 删除模型代理 / Delete model proxy
3544
+ *
3545
+ * @param params - 参数 / Parameters
3546
+ * @returns 删除的模型代理对象 / Deleted model proxy object
3547
+ */
3548
+ delete: (params?: {
3549
+ config?: Config;
3550
+ }) => Promise<ModelProxy>;
3551
+ /**
3552
+ * 刷新模型代理信息 / Refresh model proxy information
3553
+ *
3554
+ * @param params - 参数 / Parameters
3555
+ * @returns 刷新后的模型代理对象 / Refreshed model proxy object
3556
+ */
3557
+ get: (params?: {
3558
+ config?: Config;
3559
+ }) => Promise<ModelProxy>;
3560
+ /**
3561
+ * 获取模型信息 / Get model information
3562
+ *
3563
+ * @param params - 参数 / Parameters
3564
+ * @param params.config - 配置 / Configuration
3565
+ * @returns 模型基本信息 / Model base information
3566
+ */
3567
+ modelInfo: (params?: {
3568
+ config?: Config;
3569
+ }) => Promise<{
3570
+ apiKey: string;
3571
+ baseUrl: string;
3572
+ model?: string;
3573
+ headers?: Record<string, string>;
3574
+ }>;
3575
+ /**
3576
+ * 调用模型完成 / Call model completion
3577
+ *
3578
+ * @param params - 参数 / Parameters
3579
+ * @returns 完成结果 / Completion result
3580
+ */
3581
+ completions: (params: {
3582
+ messages: any[];
3583
+ model?: string;
3584
+ stream?: boolean;
3585
+ config?: Config;
3586
+ [key: string]: any;
3587
+ }) => Promise<ai.StreamTextResult<ai.ToolSet, any> | ai.GenerateTextResult<ai.ToolSet, any>>;
3588
+ /**
3589
+ * 获取响应 / Get responses
3590
+ *
3591
+ * @param params - 参数 / Parameters
3592
+ * @returns 响应结果 / Response result
3593
+ */
3594
+ responses: (params: {
3595
+ messages: any[];
3596
+ model?: string;
3597
+ stream?: boolean;
3598
+ config?: Config;
3599
+ [key: string]: any;
3600
+ }) => Promise<any>;
3601
+ /**
3602
+ * 等待模型代理就绪 / Wait until model proxy is ready
3603
+ *
3604
+ * @param options - 选项 / Options
3605
+ * @param config - 配置 / Configuration
3606
+ * @returns 模型代理对象 / Model proxy object
3607
+ */
3608
+ waitUntilReady: (options?: {
3609
+ timeoutSeconds?: number;
3610
+ intervalSeconds?: number;
3611
+ beforeCheck?: (proxy: ModelProxy) => void;
3612
+ }, config?: Config) => Promise<ModelProxy>;
3613
+ }
3614
+
3615
+ /**
3616
+ * 模型服务 / Model Service
3617
+ */
3618
+ declare class ModelService extends ResourceBase implements ModelServiceImmutableProps, ModelServiceMutableProps, ModelServiceSystemProps {
3619
+ modelInfoConfigs?: ModelServiceImmutableProps['modelInfoConfigs'];
3620
+ modelServiceName?: string;
3621
+ provider?: string;
3622
+ credentialName?: string;
3623
+ description?: string;
3624
+ networkConfiguration?: ModelServiceMutableProps['networkConfiguration'];
3625
+ tags?: string[];
3626
+ providerSettings?: ModelServiceMutableProps['providerSettings'];
3627
+ modelServiceId?: string;
3628
+ createdAt?: string;
3629
+ lastUpdatedAt?: string;
3630
+ status?: ModelServiceSystemProps['status'];
3631
+ modelType?: ModelServiceImmutableProps['modelType'];
3632
+ /**
3633
+ * 获取客户端 / Get client
3634
+ *
3635
+ * @returns ModelClient 实例
3636
+ */
3637
+ private static getClient;
3638
+ /**
3639
+ * 创建模型服务 / Create model service
3640
+ *
3641
+ * @param params - 参数 / Parameters
3642
+ * @returns 创建的模型服务对象 / Created model service object
3643
+ */
3644
+ static create(params: {
3645
+ input: ModelServiceCreateInput;
3646
+ config?: Config;
3647
+ }): Promise<ModelService>;
3648
+ /**
3649
+ * 根据名称删除模型服务 / Delete model service by name
3650
+ *
3651
+ * @param params - 参数 / Parameters
3652
+ * @returns 删除的模型服务对象 / Deleted model service object
3653
+ */
3654
+ static delete(params: {
3655
+ name: string;
3656
+ config?: Config;
3657
+ }): Promise<ModelService>;
3658
+ /**
3659
+ * 根据名称更新模型服务 / Update model service by name
3660
+ *
3661
+ * @param params - 参数 / Parameters
3662
+ * @returns 更新后的模型服务对象 / Updated model service object
3663
+ */
3664
+ static update(params: {
3665
+ name: string;
3666
+ input: ModelServiceUpdateInput;
3667
+ config?: Config;
3668
+ }): Promise<ModelService>;
3669
+ /**
3670
+ * 根据名称获取模型服务 / Get model service by name
3671
+ *
3672
+ * @param params - 参数 / Parameters
3673
+ * @returns 模型服务对象 / Model service object
3674
+ */
3675
+ static get(params: {
3676
+ name: string;
3677
+ config?: Config;
3678
+ }): Promise<ModelService>;
3679
+ /**
3680
+ * 列出模型服务(分页)/ List model services (paginated)
3681
+ *
3682
+ * @param pageInput - 分页参数 / Pagination parameters
3683
+ * @param config - 配置 / Configuration
3684
+ * @param kwargs - 其他查询参数 / Other query parameters
3685
+ * @returns 模型服务列表 / Model service list
3686
+ */
3687
+ protected static listPage(pageInput: PageableInput, config?: Config, kwargs?: Partial<ModelServiceListInput>): Promise<ModelService[]>;
3688
+ /**
3689
+ * 列出所有模型服务 / List all model services
3690
+ *
3691
+ * @param options - 查询选项 / Query options
3692
+ * @param config - 配置 / Configuration
3693
+ * @returns 模型服务列表 / Model service list
3694
+ */
3695
+ static listAll(options?: {
3696
+ modelType?: ModelType;
3697
+ provider?: string;
3698
+ config?: Config;
3699
+ }): Promise<ModelService[]>;
3700
+ /**
3701
+ * 更新模型服务 / Update model service
3702
+ *
3703
+ * @param params - 参数 / Parameters
3704
+ * @returns 更新后的模型服务对象 / Updated model service object
3705
+ */
3706
+ update: (params: {
3707
+ input: ModelServiceUpdateInput;
3708
+ config?: Config;
3709
+ }) => Promise<ModelService>;
3710
+ /**
3711
+ * 删除模型服务 / Delete model service
3712
+ *
3713
+ * @param config - 配置 / Configuration
3714
+ * @returns 删除的模型服务对象 / Deleted model service object
3715
+ */
3716
+ delete: (params?: {
3717
+ config?: Config;
3718
+ }) => Promise<ModelService>;
3719
+ /**
3720
+ * 刷新模型服务信息 / Refresh model service information
3721
+ *
3722
+ * @param config - 配置 / Configuration
3723
+ * @returns 刷新后的模型服务对象 / Refreshed model service object
3724
+ */
3725
+ get: (params?: {
3726
+ config?: Config;
3727
+ }) => Promise<ModelService>;
3728
+ /**
3729
+ * 获取模型信息 / Get model information
3730
+ *
3731
+ * @param params - 参数 / Parameters
3732
+ * @param params.config - 配置 / Configuration
3733
+ * @returns 模型基本信息 / Model base information
3734
+ */
3735
+ modelInfo: (params?: {
3736
+ config?: Config;
3737
+ }) => Promise<{
3738
+ apiKey: string;
3739
+ baseUrl: string;
3740
+ model?: string;
3741
+ headers?: Record<string, string>;
3742
+ provider?: string;
3743
+ }>;
3744
+ /**
3745
+ * 调用模型完成 / Call model completion
3746
+ *
3747
+ * @param messages - 消息列表 / Message list
3748
+ * @param model - 模型名称(可选)/ Model name (optional)
3749
+ * @param stream - 是否流式输出 / Whether to stream output
3750
+ * @param kwargs - 其他参数 / Other parameters
3751
+ * @returns 完成结果 / Completion result
3752
+ */
3753
+ completions: (params: {
3754
+ messages: any[];
3755
+ model?: string;
3756
+ stream?: boolean;
3757
+ config?: Config;
3758
+ [key: string]: any;
3759
+ }) => Promise<ai.StreamTextResult<ai.ToolSet, any> | ai.GenerateTextResult<ai.ToolSet, any>>;
3760
+ /**
3761
+ * 获取响应 / Get responses
3762
+ *
3763
+ * @param input - 输入 / Input
3764
+ * @param model - 模型名称(可选)/ Model name (optional)
3765
+ * @param stream - 是否流式输出 / Whether to stream output
3766
+ * @param kwargs - 其他参数 / Other parameters
3767
+ * @returns 响应结果 / Response result
3768
+ */
3769
+ responses: (params: {
3770
+ input: string | any;
3771
+ model?: string;
3772
+ stream?: boolean;
3773
+ config?: Config;
3774
+ [key: string]: any;
3775
+ }) => Promise<any>;
3776
+ /**
3777
+ * 等待模型服务就绪 / Wait until model service is ready
3778
+ *
3779
+ * @param options - 选项 / Options
3780
+ * @param config - 配置 / Configuration
3781
+ * @returns 模型服务对象 / Model service object
3782
+ */
3783
+ waitUntilReady: (options?: {
3784
+ timeoutSeconds?: number;
3785
+ intervalSeconds?: number;
3786
+ beforeCheck?: (service: ModelService) => void;
3787
+ }, config?: Config) => Promise<ModelService>;
3788
+ }
3789
+
3790
+ /**
3791
+ * Model Service 客户端 / Model Service Client
3792
+ *
3793
+ * 此模块提供模型服务和模型代理的客户端API。
3794
+ * This module provides the client API for model services and model proxies.
3795
+ */
3796
+
3797
+ /**
3798
+ * Model Service 客户端 / Model Service Client
3799
+ *
3800
+ * 提供模型服务和模型代理的创建、删除、更新和查询功能。
3801
+ * Provides create, delete, update and query functions for model services and model proxies.
3802
+ */
3803
+ declare class ModelClient {
3804
+ private controlApi;
3805
+ private config?;
3806
+ /**
3807
+ * 初始化客户端 / Initialize client
3808
+ *
3809
+ * @param config - 配置对象,可选 / Configuration object, optional
3810
+ */
3811
+ constructor(config?: Config);
3812
+ /**
3813
+ * 创建模型服务
3814
+ * Create model service
3815
+ *
3816
+ * @param params - 参数 / Parameters
3817
+ * @returns 创建的对象 / Created object
3818
+ */
3819
+ create: (params: {
3820
+ input: ModelServiceCreateInput | ModelProxyCreateInput;
3821
+ config?: Config;
3822
+ }) => Promise<ModelService | ModelProxy>;
3823
+ /**
3824
+ * 删除模型服务
3825
+ * Delete model service
3826
+ *
3827
+ * @param params - 参数 / Parameters
3828
+ * @returns 删除的对象 / Deleted object
3829
+ *
3830
+ * @throws ResourceNotExistError - 模型服务不存在 / Model service does not exist
3831
+ */
3832
+ delete: (params: {
3833
+ name: string;
3834
+ backendType?: BackendType;
3835
+ config?: Config;
3836
+ }) => Promise<ModelService | ModelProxy>;
3837
+ /**
3838
+ * 更新模型服务
3839
+ * Update model service
3840
+ *
3841
+ * @param params - 参数 / Parameters
3842
+ * @returns 更新后的模型服务对象 / Updated model service object
3843
+ *
3844
+ * @throws ResourceNotExistError - 模型服务不存在 / Model service does not exist
3845
+ */
3846
+ update: (params: {
3847
+ name: string;
3848
+ input: ModelServiceUpdateInput | ModelProxyUpdateInput;
3849
+ config?: Config;
3850
+ }) => Promise<ModelService | ModelProxy>;
3851
+ /**
3852
+ * 获取模型服务
3853
+ * Get model service
3854
+ *
3855
+ * @param params - 参数 / Parameters
3856
+ * @returns 模型服务对象 / Model service object
3857
+ *
3858
+ * @throws ResourceNotExistError - 模型服务不存在 / Model service does not exist
3859
+ */
3860
+ get: (params: {
3861
+ name: string;
3862
+ backendType?: BackendType;
3863
+ config?: Config;
3864
+ }) => Promise<ModelService | ModelProxy>;
3865
+ /**
3866
+ * 列出模型服务
3867
+ * List model services
3868
+ *
3869
+ * @param params - 参数 / Parameters
3870
+ * @returns 模型服务列表 / Model service list
3871
+ */
3872
+ list: (params: {
3873
+ input: ModelServiceListInput | ModelProxyListInput;
3874
+ config?: Config;
3875
+ }) => Promise<ModelService[] | ModelProxy[]>;
3876
+ }
3877
+
3878
+ /**
3879
+ * ToolSet Models
3880
+ *
3881
+ * ToolSet 相关的数据模型。
3882
+ * Data models for ToolSet.
3883
+ */
3884
+
3885
+ /**
3886
+ * ToolSet schema type
3887
+ */
3888
+ declare enum ToolSetSchemaType {
3889
+ OPENAPI = "OpenAPI",
3890
+ MCP = "MCP"
3891
+ }
3892
+ /**
3893
+ * ToolSet schema
3894
+ */
3895
+ interface ToolSetSchema {
3896
+ /**
3897
+ * Schema type (OpenAPI, MCP)
3898
+ */
3899
+ type?: ToolSetSchemaType;
3900
+ /**
3901
+ * Schema detail (URL or inline definition)
3902
+ */
3903
+ detail?: string;
3904
+ }
3905
+ /**
3906
+ * ToolSet authorization configuration
3907
+ */
3908
+ interface ToolSetAuthorization {
3909
+ /**
3910
+ * Authorization type
3911
+ */
3912
+ type?: string;
3913
+ /**
3914
+ * API Key header name
3915
+ */
3916
+ apiKeyHeaderName?: string;
3917
+ /**
3918
+ * API Key value
3919
+ */
3920
+ apiKeyValue?: string;
3921
+ }
3922
+ /**
3923
+ * ToolSet specification
3924
+ */
3925
+ interface ToolSetSpec {
3926
+ /**
3927
+ * Schema configuration
3928
+ */
3929
+ schema?: ToolSetSchema;
3930
+ /**
3931
+ * Authorization configuration
3932
+ */
3933
+ authConfig?: ToolSetAuthorization;
3934
+ }
3935
+ /**
3936
+ * MCP Tool meta
3937
+ */
3938
+ interface MCPToolMeta {
3939
+ /**
3940
+ * Tool name
3941
+ */
3942
+ name?: string;
3943
+ /**
3944
+ * Tool description
3945
+ */
3946
+ description?: string;
3947
+ }
3948
+ /**
3949
+ * ToolSet status outputs
3950
+ */
3951
+ interface ToolSetStatusOutputs {
3952
+ /**
3953
+ * MCP server configuration
3954
+ */
3955
+ mcpServerConfig?: {
3956
+ url?: string;
3957
+ transport?: string;
3958
+ };
3959
+ /**
3960
+ * Tools list
3961
+ */
3962
+ tools?: MCPToolMeta[];
3963
+ /**
3964
+ * URLs
3965
+ */
3966
+ urls?: {
3967
+ cdpUrl?: string;
3968
+ liveViewUrl?: string;
3969
+ streamUrl?: string;
3970
+ };
3971
+ }
3972
+ /**
3973
+ * ToolSet status
3974
+ */
3975
+ interface ToolSetStatus {
3976
+ /**
3977
+ * Current status
3978
+ */
3979
+ status?: Status;
3980
+ /**
3981
+ * Status reason
3982
+ */
3983
+ statusReason?: string;
3984
+ /**
3985
+ * Outputs
3986
+ */
3987
+ outputs?: ToolSetStatusOutputs;
3988
+ }
3989
+ /**
3990
+ * ToolSet data interface
3991
+ */
3992
+ interface ToolSetData {
3993
+ name?: string;
3994
+ uid?: string;
3995
+ kind?: string;
3996
+ description?: string;
3997
+ createdTime?: string;
3998
+ generation?: number;
3999
+ labels?: Record<string, string>;
4000
+ spec?: ToolSetSpec;
4001
+ status?: ToolSetStatus;
4002
+ }
4003
+ /**
4004
+ * ToolSet create input
4005
+ */
4006
+ interface ToolSetCreateInput {
4007
+ /**
4008
+ * ToolSet name (required)
4009
+ */
4010
+ name: string;
4011
+ /**
4012
+ * Description
4013
+ */
4014
+ description?: string;
4015
+ /**
4016
+ * Labels
4017
+ */
4018
+ labels?: Record<string, string>;
4019
+ /**
4020
+ * Spec configuration
4021
+ */
4022
+ spec?: ToolSetSpec;
4023
+ }
4024
+ /**
4025
+ * ToolSet update input
4026
+ */
4027
+ interface ToolSetUpdateInput {
4028
+ /**
4029
+ * Description
4030
+ */
4031
+ description?: string;
4032
+ /**
4033
+ * Labels
4034
+ */
4035
+ labels?: Record<string, string>;
4036
+ /**
4037
+ * Spec configuration
4038
+ */
4039
+ spec?: ToolSetSpec;
4040
+ }
4041
+ /**
4042
+ * ToolSet list input
4043
+ */
4044
+ interface ToolSetListInput {
4045
+ /**
4046
+ * Prefix filter
4047
+ */
4048
+ prefix?: string;
4049
+ /**
4050
+ * Page size
4051
+ */
4052
+ pageSize?: number;
4053
+ /**
4054
+ * Next token for pagination
4055
+ */
4056
+ nextToken?: string;
4057
+ /**
4058
+ * Labels filter
4059
+ */
4060
+ labels?: Record<string, string>;
4061
+ }
4062
+
4063
+ /**
4064
+ * ToolSet Resource Class
4065
+ *
4066
+ * ToolSet 资源类,用于管理 ToolSet 资源。
4067
+ * Resource class for managing ToolSet resources.
4068
+ */
4069
+
4070
+ /**
4071
+ * ToolSet resource class
4072
+ */
4073
+ declare class ToolSet implements ToolSetData {
4074
+ name?: string;
4075
+ uid?: string;
4076
+ kind?: string;
4077
+ description?: string;
4078
+ createdTime?: string;
4079
+ generation?: number;
4080
+ labels?: Record<string, string>;
4081
+ spec?: ToolSetSpec;
4082
+ status?: ToolSetStatus;
4083
+ private _config?;
4084
+ constructor(data?: Partial<ToolSetData>, config?: Config);
4085
+ /**
4086
+ * Get ToolSet name (alias for name)
4087
+ */
4088
+ get toolSetName(): string | undefined;
4089
+ /**
4090
+ * Get ToolSet ID (alias for uid)
4091
+ */
4092
+ get toolSetId(): string | undefined;
4093
+ /**
4094
+ * Check if the toolset is ready
4095
+ */
4096
+ get isReady(): boolean;
4097
+ /**
4098
+ * Create toolset from SDK response object
4099
+ */
4100
+ static fromInnerObject(obj: $Devs.Toolset, config?: Config): ToolSet;
4101
+ /**
4102
+ * Get DevS client
4103
+ */
4104
+ private static getClient;
4105
+ /**
4106
+ * Create a new ToolSet
4107
+ */
4108
+ static create(params: {
4109
+ input: ToolSetCreateInput;
4110
+ config?: Config;
4111
+ }): Promise<ToolSet>;
4112
+ /**
4113
+ * Delete a ToolSet by Name
4114
+ */
4115
+ static delete(params: {
4116
+ name: string;
4117
+ config?: Config;
4118
+ }): Promise<ToolSet>;
4119
+ /**
4120
+ * Get a ToolSet by Name
4121
+ */
4122
+ static get(params: {
4123
+ name: string;
4124
+ config?: Config;
4125
+ }): Promise<ToolSet>;
4126
+ /**
4127
+ * List ToolSets
4128
+ */
4129
+ static list(input?: ToolSetListInput, config?: Config): Promise<ToolSet[]>;
4130
+ /**
4131
+ * List all ToolSets with pagination
4132
+ */
4133
+ static listAll(options?: {
4134
+ prefix?: string;
4135
+ labels?: Record<string, string>;
4136
+ }, config?: Config): Promise<ToolSet[]>;
4137
+ /**
4138
+ * Update a ToolSet by Name
4139
+ */
4140
+ static update(params: {
4141
+ name: string;
4142
+ input: ToolSetUpdateInput;
4143
+ config?: Config;
4144
+ }): Promise<ToolSet>;
4145
+ /**
4146
+ * Handle API errors
4147
+ */
4148
+ private static handleError;
4149
+ /**
4150
+ * Delete this toolset
4151
+ */
4152
+ delete: (params?: {
4153
+ config?: Config;
4154
+ }) => Promise<ToolSet>;
4155
+ /**
4156
+ * Update this toolset
4157
+ */
4158
+ update: (params: {
4159
+ input: ToolSetUpdateInput;
4160
+ config?: Config;
4161
+ }) => Promise<ToolSet>;
4162
+ /**
4163
+ * Refresh this toolset's data
4164
+ */
4165
+ refresh: (params?: {
4166
+ config?: Config;
4167
+ }) => Promise<ToolSet>;
4168
+ /**
4169
+ * Wait until the toolset is ready
4170
+ */
4171
+ waitUntilReady: (options?: {
4172
+ timeoutSeconds?: number;
4173
+ intervalSeconds?: number;
4174
+ beforeCheck?: (toolset: ToolSet) => void;
4175
+ }, config?: Config) => Promise<ToolSet>;
4176
+ /**
4177
+ * Get toolset type
4178
+ * 获取工具集类型
4179
+ */
4180
+ type(): string | undefined;
4181
+ /**
4182
+ * List tools (async)
4183
+ * 异步获取工具列表,返回统一的 ToolInfo 列表
4184
+ */
4185
+ listToolsAsync: (params?: {
4186
+ config?: Config;
4187
+ }) => Promise<any[]>;
4188
+ /**
4189
+ * List tools (sync wrapper)
4190
+ * 同步获取工具列表,返回统一的 ToolInfo 列表
4191
+ */
4192
+ listTools: (config?: Config) => Promise<any[]>;
4193
+ /**
4194
+ * Call tool (async)
4195
+ * 异步调用工具,统一使用 ApiSet 实现
4196
+ */
4197
+ callToolAsync: (name: string, args?: Record<string, unknown>, config?: Config) => Promise<any>;
4198
+ /**
4199
+ * Call tool (sync wrapper)
4200
+ * 同步调用工具,统一使用 ApiSet 实现
4201
+ */
4202
+ callTool: (name: string, args?: Record<string, unknown>, config?: Config) => Promise<any>;
4203
+ /**
4204
+ * Convert ToolSet to unified ApiSet object
4205
+ * 将 ToolSet 转换为统一的 ApiSet 对象
4206
+ */
4207
+ toApiSet: (params?: {
4208
+ config?: Config;
4209
+ }) => Promise<any>;
4210
+ /**
4211
+ * Get OpenAPI authentication defaults
4212
+ * 获取 OpenAPI 认证默认值
4213
+ */
4214
+ private _getOpenAPIAuthDefaults;
4215
+ /**
4216
+ * Get OpenAPI base URL
4217
+ * 获取 OpenAPI 基础 URL
4218
+ */
4219
+ private _getOpenAPIBaseUrl;
4220
+ }
4221
+
4222
+ /**
4223
+ * ToolSet Client
4224
+ *
4225
+ * ToolSet 客户端,提供 ToolSet 的管理功能。
4226
+ * Client for managing ToolSet resources.
4227
+ */
4228
+
4229
+ /**
4230
+ * ToolSet Client
4231
+ *
4232
+ * 提供 ToolSet 的管理功能。
4233
+ */
4234
+ declare class ToolSetClient {
4235
+ private config?;
4236
+ constructor(config?: Config);
4237
+ /**
4238
+ * Create a ToolSet
4239
+ */
4240
+ createToolSet: (params: {
4241
+ input: ToolSetCreateInput;
4242
+ config?: Config;
4243
+ }) => Promise<ToolSet>;
4244
+ /**
4245
+ * Delete a ToolSet by name
4246
+ */
4247
+ deleteToolSet: (params: {
4248
+ name: string;
4249
+ config?: Config;
4250
+ }) => Promise<ToolSet>;
4251
+ /**
4252
+ * Get a ToolSet by name
4253
+ */
4254
+ getToolSet: (params: {
4255
+ name: string;
4256
+ config?: Config;
4257
+ }) => Promise<ToolSet>;
4258
+ /**
4259
+ * Update a ToolSet by name
4260
+ */
4261
+ updateToolSet: (params: {
4262
+ name: string;
4263
+ input: ToolSetUpdateInput;
4264
+ config?: Config;
4265
+ }) => Promise<ToolSet>;
4266
+ /**
4267
+ * List ToolSets
4268
+ */
4269
+ listToolSets: (params?: {
4270
+ input?: ToolSetListInput;
4271
+ config?: Config;
4272
+ }) => Promise<ToolSet[]>;
4273
+ /**
4274
+ * List all ToolSets with pagination
4275
+ */
4276
+ listAllToolSets: (params?: {
4277
+ options?: {
4278
+ prefix?: string;
4279
+ labels?: Record<string, string>;
4280
+ };
4281
+ config?: Config;
4282
+ }) => Promise<ToolSet[]>;
4283
+ }
4284
+
4285
+ /**
4286
+ * AgentRun SDK for Node.js
4287
+ *
4288
+ * AgentRun SDK 是阿里云 AgentRun 服务的 Node.js 客户端库。
4289
+ * Provides simple and easy-to-use APIs for managing AI Agent runtime environments,
4290
+ * model services, sandbox environments, etc.
4291
+ *
4292
+ * @packageDocumentation
4293
+ */
4294
+ declare const VERSION = "0.0.1";
4295
+
4296
+ export { AgentRunError, AgentRuntime, AgentRuntimeArtifact, AgentRuntimeClient, type AgentRuntimeCode, type AgentRuntimeContainer, AgentRuntimeControlAPI, type AgentRuntimeCreateInput, AgentRuntimeEndpoint, type AgentRuntimeEndpointCreateInput, type AgentRuntimeEndpointListInput, type AgentRuntimeEndpointRoutingConfig, type AgentRuntimeEndpointRoutingWeight, type AgentRuntimeEndpointUpdateInput, type AgentRuntimeHealthCheckConfig, AgentRuntimeLanguage, type AgentRuntimeListInput, type AgentRuntimeLogConfig, type AgentRuntimeProtocolConfig, AgentRuntimeProtocolType, type AgentRuntimeUpdateInput, type AgentRuntimeVersion, AioDataAPI, AioSandbox, BackendType, BrowserDataAPI, BrowserSandbox, ClientError, CodeInterpreterDataAPI, CodeInterpreterSandbox, CodeLanguage, Config, type ConfigOptions, Credential, type CredentialBasicAuth, CredentialClient, CredentialConfig, CredentialControlAPI, type CredentialCreateInput, type CredentialListInput, type CredentialUpdateInput, type ExecuteCodeResult, type FileInfo, HTTPError, type MCPToolMeta, ModelClient, ControlAPI as ModelControlAPI, type ModelFeatures, type ModelInfoConfig, type ModelParameterRule, type ModelProperties, ModelProxy, type ModelProxyCreateInput, type ModelProxyListInput, type ModelProxyUpdateInput, ModelService, type ModelServiceCreateInput, type ModelServiceListInput, type ModelServiceUpdateInput, ModelType, Provider, type ProviderSettings, type ProxyConfig, type ProxyConfigEndpoint, type ProxyConfigFallback, type ProxyConfigPolicies, type RelatedResource, ResourceAlreadyExistError, ResourceNotExistError, Sandbox, SandboxClient, type SandboxCreateInput, type SandboxData, SandboxDataAPI, type SandboxListInput, SandboxState, ServerError, Status, Template, type TemplateArmsConfiguration, type TemplateContainerConfiguration, type TemplateCreateInput, type TemplateCredentialConfiguration, type TemplateData, type TemplateListInput, type TemplateLogConfiguration, type TemplateMcpOptions, type TemplateMcpState, type TemplateNetworkConfiguration, TemplateNetworkMode, TemplateOSSPermission, type TemplateOssConfiguration, TemplateType, type TemplateUpdateInput, ToolSet, type ToolSetAuthorization, ToolSetClient, type ToolSetCreateInput, type ToolSetData, type ToolSetListInput, type ToolSetSchema, ToolSetSchemaType, type ToolSetSpec, type ToolSetStatus, type ToolSetStatusOutputs, type ToolSetUpdateInput, VERSION };