@agentrun/sdk 0.0.1 → 0.0.2-test.20910143561

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 +7910 -6549
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +4685 -0
  5. package/dist/index.d.ts +4685 -0
  6. package/dist/index.js +7811 -6490
  7. package/dist/index.js.map +1 -0
  8. package/package.json +24 -22
  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,4685 @@
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
+ * 从模板创建沙箱 / Create Sandbox from Template
1764
+ */
1765
+ createSandbox: (params: {
1766
+ templateName: string;
1767
+ sandboxIdleTimeoutSeconds?: number;
1768
+ nasConfig?: Record<string, any>;
1769
+ ossMountConfig?: Record<string, any>;
1770
+ polarFsConfig?: Record<string, any>;
1771
+ config?: Config;
1772
+ }) => Promise<any>;
1773
+ /**
1774
+ * Delete sandbox
1775
+ */
1776
+ deleteSandbox: (params: {
1777
+ sandboxId: string;
1778
+ config?: Config;
1779
+ }) => Promise<any>;
1780
+ /**
1781
+ * Stop sandbox
1782
+ */
1783
+ stopSandbox: (params: {
1784
+ sandboxId: string;
1785
+ config?: Config;
1786
+ }) => Promise<any>;
1787
+ /**
1788
+ * Get sandbox info
1789
+ */
1790
+ getSandbox: (params: {
1791
+ sandboxId: string;
1792
+ config?: Config;
1793
+ }) => Promise<any>;
1794
+ }
1795
+
1796
+ /**
1797
+ * Browser Sandbox Data API
1798
+ *
1799
+ * This module provides data API methods for Browser sandboxes.
1800
+ * 此模块提供浏览器沙箱的数据 API 方法。
1801
+ */
1802
+
1803
+ /**
1804
+ * Browser Data API
1805
+ *
1806
+ * Provides methods for interacting with Browser sandbox data endpoints.
1807
+ */
1808
+ declare class BrowserDataAPI extends SandboxDataAPI {
1809
+ protected sandboxId: string;
1810
+ constructor(params: {
1811
+ sandboxId: string;
1812
+ config?: Config;
1813
+ });
1814
+ /**
1815
+ * Generate the WebSocket URL for Chrome DevTools Protocol (CDP) connection
1816
+ */
1817
+ getCdpUrl(record?: boolean): string;
1818
+ /**
1819
+ * Generate the WebSocket URL for VNC (Virtual Network Computing) live view connection
1820
+ */
1821
+ getVncUrl(record?: boolean): string;
1822
+ /**
1823
+ * List all recordings
1824
+ */
1825
+ listRecordings: (params?: {
1826
+ config?: Config;
1827
+ }) => Promise<any>;
1828
+ /**
1829
+ * Delete a recording
1830
+ */
1831
+ deleteRecording: (params: {
1832
+ filename: string;
1833
+ config?: Config;
1834
+ }) => Promise<any>;
1835
+ /**
1836
+ * Download a recording video file
1837
+ */
1838
+ downloadRecording: (params: {
1839
+ filename: string;
1840
+ savePath: string;
1841
+ }) => Promise<{
1842
+ savedPath: string;
1843
+ size: number;
1844
+ }>;
1845
+ /**
1846
+ * Helper method to download video file
1847
+ */
1848
+ protected getVideo(params: {
1849
+ path: string;
1850
+ savePath: string;
1851
+ query?: Record<string, any>;
1852
+ headers?: Record<string, string>;
1853
+ config?: Config;
1854
+ }): Promise<{
1855
+ savedPath: string;
1856
+ size: number;
1857
+ }>;
1858
+ }
1859
+
1860
+ /**
1861
+ * Sandbox Data Models
1862
+ *
1863
+ * 此模块定义 Sandbox 相关的所有数据模型。
1864
+ * This module defines all data models related to Sandbox.
1865
+ */
1866
+
1867
+ /**
1868
+ * Template type enum
1869
+ */
1870
+ declare enum TemplateType {
1871
+ CODE_INTERPRETER = "CodeInterpreter",
1872
+ BROWSER = "Browser",
1873
+ AIO = "AllInOne"
1874
+ }
1875
+ /**
1876
+ * Sandbox state enum
1877
+ */
1878
+ declare enum SandboxState {
1879
+ CREATING = "Creating",
1880
+ RUNNING = "Running",
1881
+ READY = "READY",// API返回的就绪状态,等同于Running
1882
+ STOPPED = "Stopped",
1883
+ FAILED = "Failed",
1884
+ DELETING = "Deleting"
1885
+ }
1886
+ /**
1887
+ * Template network mode enum
1888
+ */
1889
+ declare enum TemplateNetworkMode {
1890
+ PUBLIC = "PUBLIC",
1891
+ PRIVATE = "PRIVATE",
1892
+ PUBLIC_AND_PRIVATE = "PUBLIC_AND_PRIVATE"
1893
+ }
1894
+ /**
1895
+ * OSS permission enum
1896
+ */
1897
+ declare enum TemplateOSSPermission {
1898
+ READ_WRITE = "READ_WRITE",
1899
+ READ_ONLY = "READ_ONLY"
1900
+ }
1901
+ /**
1902
+ * Code language enum
1903
+ */
1904
+ declare enum CodeLanguage {
1905
+ PYTHON = "python"
1906
+ }
1907
+ /**
1908
+ * NAS mount configuration
1909
+ * NAS 挂载配置 / NAS Mount Configuration
1910
+ *
1911
+ * 定义 NAS 文件系统的挂载配置。
1912
+ * Defines the mount configuration for NAS file system.
1913
+ */
1914
+ interface NASMountConfig {
1915
+ /**
1916
+ * 是否启用 TLS 加密 / Whether to enable TLS encryption
1917
+ */
1918
+ enableTLS?: boolean;
1919
+ /**
1920
+ * 挂载目录 / Mount Directory
1921
+ * @example "/home/test"
1922
+ */
1923
+ mountDir?: string;
1924
+ /**
1925
+ * NAS 服务器地址 / NAS Server Address
1926
+ * @example "***-uni85.cn-hangzhou.nas.com:/"
1927
+ */
1928
+ serverAddr?: string;
1929
+ }
1930
+ /**
1931
+ * NAS configuration
1932
+ * NAS 配置 / NAS Configuration
1933
+ *
1934
+ * 定义 NAS 文件系统的配置。
1935
+ * Defines the configuration for NAS file system.
1936
+ */
1937
+ interface NASConfig {
1938
+ /**
1939
+ * 组 ID / Group ID
1940
+ * @example 100
1941
+ */
1942
+ groupId?: number;
1943
+ /**
1944
+ * 挂载点列表 / Mount Points List
1945
+ */
1946
+ mountPoints?: NASMountConfig[];
1947
+ /**
1948
+ * 用户 ID / User ID
1949
+ * @example 100
1950
+ */
1951
+ userId?: number;
1952
+ }
1953
+ /**
1954
+ * OSS mount point
1955
+ * OSS 挂载点 / OSS Mount Point
1956
+ *
1957
+ * 定义 OSS 存储的挂载点配置。
1958
+ * Defines the mount point configuration for OSS storage.
1959
+ */
1960
+ interface OSSMountPoint {
1961
+ /**
1962
+ * OSS 存储桶名称 / OSS Bucket Name
1963
+ * @example "my-bucket"
1964
+ */
1965
+ bucketName?: string;
1966
+ /**
1967
+ * OSS 存储桶路径 / OSS Bucket Path
1968
+ * @example "/my-dir"
1969
+ */
1970
+ bucketPath?: string;
1971
+ /**
1972
+ * OSS 端点 / OSS Endpoint
1973
+ * @example "http://oss-cn-shanghai.aliyuncs.com"
1974
+ */
1975
+ endpoint?: string;
1976
+ /**
1977
+ * 挂载目录 / Mount Directory
1978
+ * @example "/mnt/dir"
1979
+ */
1980
+ mountDir?: string;
1981
+ /**
1982
+ * 是否只读 / Read Only
1983
+ */
1984
+ readOnly?: boolean;
1985
+ }
1986
+ /**
1987
+ * OSS mount configuration
1988
+ * OSS 挂载配置 / OSS Mount Configuration
1989
+ *
1990
+ * 定义 OSS 存储的挂载配置。
1991
+ * Defines the mount configuration for OSS storage.
1992
+ */
1993
+ interface OSSMountConfig {
1994
+ /**
1995
+ * 挂载点列表 / Mount Points List
1996
+ */
1997
+ mountPoints?: OSSMountPoint[];
1998
+ }
1999
+ /**
2000
+ * PolarFS mount configuration
2001
+ * PolarFS 挂载配置 / PolarFS Mount Configuration
2002
+ *
2003
+ * 定义 PolarFS 文件系统的挂载配置。
2004
+ * Defines the mount configuration for PolarFS file system.
2005
+ */
2006
+ interface PolarFsMountConfig {
2007
+ /**
2008
+ * 实例 ID / Instance ID
2009
+ */
2010
+ instanceId?: string;
2011
+ /**
2012
+ * 挂载目录 / Mount Directory
2013
+ */
2014
+ mountDir?: string;
2015
+ /**
2016
+ * 远程目录 / Remote Directory
2017
+ */
2018
+ remoteDir?: string;
2019
+ }
2020
+ /**
2021
+ * PolarFS configuration
2022
+ * PolarFS 配置 / PolarFS Configuration
2023
+ *
2024
+ * 定义 PolarFS 文件系统的配置。
2025
+ * Defines the configuration for PolarFS file system.
2026
+ */
2027
+ interface PolarFsConfig {
2028
+ /**
2029
+ * 组 ID / Group ID
2030
+ */
2031
+ groupId?: number;
2032
+ /**
2033
+ * 挂载点列表 / Mount Points List
2034
+ */
2035
+ mountPoints?: PolarFsMountConfig[];
2036
+ /**
2037
+ * 用户 ID / User ID
2038
+ */
2039
+ userId?: number;
2040
+ }
2041
+ /**
2042
+ * Template network configuration
2043
+ */
2044
+ interface TemplateNetworkConfiguration {
2045
+ networkMode?: TemplateNetworkMode;
2046
+ securityGroupId?: string;
2047
+ vpcId?: string;
2048
+ vswitchIds?: string[];
2049
+ }
2050
+ /**
2051
+ * Template OSS configuration
2052
+ */
2053
+ interface TemplateOssConfiguration {
2054
+ bucketName: string;
2055
+ mountPoint: string;
2056
+ permission?: TemplateOSSPermission;
2057
+ prefix: string;
2058
+ region: string;
2059
+ }
2060
+ /**
2061
+ * Template log configuration
2062
+ */
2063
+ interface TemplateLogConfiguration {
2064
+ project?: string;
2065
+ logstore?: string;
2066
+ }
2067
+ /**
2068
+ * Template credential configuration
2069
+ */
2070
+ interface TemplateCredentialConfiguration {
2071
+ credentialName?: string;
2072
+ }
2073
+ /**
2074
+ * Template ARMS configuration
2075
+ */
2076
+ interface TemplateArmsConfiguration {
2077
+ armsLicenseKey?: string;
2078
+ enableArms: boolean;
2079
+ }
2080
+ /**
2081
+ * Template container configuration
2082
+ */
2083
+ interface TemplateContainerConfiguration {
2084
+ image?: string;
2085
+ command?: string[];
2086
+ }
2087
+ /**
2088
+ * Template MCP options
2089
+ */
2090
+ interface TemplateMcpOptions {
2091
+ enabledTools?: string[];
2092
+ transport?: string;
2093
+ }
2094
+ /**
2095
+ * Template MCP state
2096
+ */
2097
+ interface TemplateMcpState {
2098
+ accessEndpoint?: string;
2099
+ status?: string;
2100
+ statusReason?: string;
2101
+ }
2102
+ /**
2103
+ * Template create input
2104
+ * 模板创建输入 / Template Create Input
2105
+ */
2106
+ interface TemplateCreateInput {
2107
+ templateName?: string;
2108
+ templateType: TemplateType;
2109
+ cpu?: number;
2110
+ memory?: number;
2111
+ executionRoleArn?: string;
2112
+ sandboxIdleTimeoutInSeconds?: number;
2113
+ sandboxTtlInSeconds?: number;
2114
+ shareConcurrencyLimitPerSandbox?: number;
2115
+ templateConfiguration?: Record<string, unknown>;
2116
+ description?: string;
2117
+ environmentVariables?: Record<string, string>;
2118
+ networkConfiguration?: TemplateNetworkConfiguration;
2119
+ ossConfiguration?: TemplateOssConfiguration[];
2120
+ logConfiguration?: TemplateLogConfiguration;
2121
+ credentialConfiguration?: TemplateCredentialConfiguration;
2122
+ armsConfiguration?: TemplateArmsConfiguration;
2123
+ containerConfiguration?: TemplateContainerConfiguration;
2124
+ diskSize?: number;
2125
+ /**
2126
+ * 是否允许匿名管理 / Whether to allow anonymous management
2127
+ */
2128
+ allowAnonymousManage?: boolean;
2129
+ }
2130
+ /**
2131
+ * Template update input
2132
+ */
2133
+ interface TemplateUpdateInput {
2134
+ cpu?: number;
2135
+ memory?: number;
2136
+ executionRoleArn?: string;
2137
+ sandboxIdleTimeoutInSeconds?: number;
2138
+ sandboxTtlInSeconds?: number;
2139
+ shareConcurrencyLimitPerSandbox?: number;
2140
+ description?: string;
2141
+ environmentVariables?: Record<string, string>;
2142
+ networkConfiguration?: TemplateNetworkConfiguration;
2143
+ ossConfiguration?: TemplateOssConfiguration[];
2144
+ logConfiguration?: TemplateLogConfiguration;
2145
+ credentialConfiguration?: TemplateCredentialConfiguration;
2146
+ armsConfiguration?: TemplateArmsConfiguration;
2147
+ containerConfiguration?: TemplateContainerConfiguration;
2148
+ diskSize?: number;
2149
+ }
2150
+ /**
2151
+ * Template list input
2152
+ */
2153
+ interface TemplateListInput extends PageableInput {
2154
+ templateType?: TemplateType;
2155
+ }
2156
+ /**
2157
+ * Sandbox create input
2158
+ * 沙箱创建输入 / Sandbox Create Input
2159
+ */
2160
+ interface SandboxCreateInput {
2161
+ /**
2162
+ * 模板名称 / Template Name
2163
+ */
2164
+ templateName: string;
2165
+ /**
2166
+ * 沙箱空闲超时时间(秒) / Sandbox Idle Timeout (seconds)
2167
+ */
2168
+ sandboxIdleTimeoutSeconds?: number;
2169
+ /**
2170
+ * 沙箱 ID(可选,用户可指定) / Sandbox ID (optional, user can specify)
2171
+ */
2172
+ sandboxId?: string;
2173
+ /**
2174
+ * NAS 配置 / NAS Configuration
2175
+ */
2176
+ nasConfig?: NASConfig;
2177
+ /**
2178
+ * OSS 挂载配置 / OSS Mount Configuration
2179
+ */
2180
+ ossMountConfig?: OSSMountConfig;
2181
+ /**
2182
+ * PolarFS 配置 / PolarFS Configuration
2183
+ */
2184
+ polarFsConfig?: PolarFsConfig;
2185
+ }
2186
+ /**
2187
+ * Sandbox list input
2188
+ */
2189
+ interface SandboxListInput {
2190
+ maxResults?: number;
2191
+ nextToken?: string;
2192
+ status?: string;
2193
+ templateName?: string;
2194
+ templateType?: TemplateType;
2195
+ }
2196
+ /**
2197
+ * Template data
2198
+ * 模板数据 / Template Data
2199
+ */
2200
+ interface TemplateData {
2201
+ /**
2202
+ * 模板 ARN / Template ARN
2203
+ */
2204
+ templateArn?: string;
2205
+ /**
2206
+ * 模板 ID / Template ID
2207
+ */
2208
+ templateId?: string;
2209
+ /**
2210
+ * 模板名称 / Template Name
2211
+ */
2212
+ templateName?: string;
2213
+ /**
2214
+ * 模板类型 / Template Type
2215
+ */
2216
+ templateType?: TemplateType;
2217
+ /**
2218
+ * CPU 核数 / CPU Cores
2219
+ */
2220
+ cpu?: number;
2221
+ /**
2222
+ * 内存大小(MB) / Memory Size (MB)
2223
+ */
2224
+ memory?: number;
2225
+ /**
2226
+ * 创建时间 / Creation Time
2227
+ */
2228
+ createdAt?: string;
2229
+ /**
2230
+ * 描述 / Description
2231
+ */
2232
+ description?: string;
2233
+ /**
2234
+ * 执行角色 ARN / Execution Role ARN
2235
+ */
2236
+ executionRoleArn?: string;
2237
+ /**
2238
+ * 最后更新时间 / Last Updated Time
2239
+ */
2240
+ lastUpdatedAt?: string;
2241
+ /**
2242
+ * 资源名称 / Resource Name
2243
+ */
2244
+ resourceName?: string;
2245
+ /**
2246
+ * 沙箱空闲超时时间(秒) / Sandbox Idle Timeout (seconds)
2247
+ */
2248
+ sandboxIdleTimeoutInSeconds?: number;
2249
+ /**
2250
+ * 沙箱存活时间(秒) / Sandbox TTL (seconds)
2251
+ */
2252
+ sandboxTtlInSeconds?: number;
2253
+ /**
2254
+ * 每个沙箱的最大并发会话数 / Max Concurrency Limit Per Sandbox
2255
+ */
2256
+ shareConcurrencyLimitPerSandbox?: number;
2257
+ /**
2258
+ * 状态 / Status
2259
+ */
2260
+ status?: Status;
2261
+ /**
2262
+ * 状态原因 / Status Reason
2263
+ */
2264
+ statusReason?: string;
2265
+ /**
2266
+ * 磁盘大小(GB) / Disk Size (GB)
2267
+ */
2268
+ diskSize?: number;
2269
+ /**
2270
+ * 是否允许匿名管理 / Whether to allow anonymous management
2271
+ */
2272
+ allowAnonymousManage?: boolean;
2273
+ }
2274
+ /**
2275
+ * Sandbox data
2276
+ * 沙箱数据 / Sandbox Data
2277
+ */
2278
+ interface SandboxData {
2279
+ /**
2280
+ * 沙箱 ID / Sandbox ID
2281
+ */
2282
+ sandboxId?: string;
2283
+ /**
2284
+ * 沙箱名称 / Sandbox Name
2285
+ */
2286
+ sandboxName?: string;
2287
+ /**
2288
+ * 模板 ID / Template ID
2289
+ */
2290
+ templateId?: string;
2291
+ /**
2292
+ * 模板名称 / Template Name
2293
+ */
2294
+ templateName?: string;
2295
+ /**
2296
+ * 沙箱状态 / Sandbox State
2297
+ */
2298
+ state?: SandboxState;
2299
+ /**
2300
+ * 状态原因 / State Reason
2301
+ */
2302
+ stateReason?: string;
2303
+ /**
2304
+ * 沙箱创建时间 / Sandbox Creation Time
2305
+ */
2306
+ createdAt?: string;
2307
+ /**
2308
+ * 最后更新时间 / Last Updated Time
2309
+ */
2310
+ lastUpdatedAt?: string;
2311
+ /**
2312
+ * 沙箱空闲超时时间(秒) / Sandbox Idle Timeout (seconds)
2313
+ */
2314
+ sandboxIdleTimeoutSeconds?: number;
2315
+ /**
2316
+ * 沙箱结束时间 / Sandbox End Time
2317
+ */
2318
+ endedAt?: string;
2319
+ /**
2320
+ * 元数据 / Metadata
2321
+ */
2322
+ metadata?: Record<string, any>;
2323
+ /**
2324
+ * 沙箱全局唯一资源名称 / Sandbox ARN
2325
+ */
2326
+ sandboxArn?: string;
2327
+ /**
2328
+ * 沙箱空闲 TTL(秒) / Sandbox Idle TTL (seconds)
2329
+ */
2330
+ sandboxIdleTTLInSeconds?: number;
2331
+ }
2332
+ /**
2333
+ * Code execution result
2334
+ */
2335
+ interface ExecuteCodeResult {
2336
+ stdout?: string;
2337
+ stderr?: string;
2338
+ exitCode?: number;
2339
+ error?: string;
2340
+ }
2341
+ /**
2342
+ * File info
2343
+ */
2344
+ interface FileInfo {
2345
+ name: string;
2346
+ path: string;
2347
+ size?: number;
2348
+ isDirectory?: boolean;
2349
+ modifiedAt?: string;
2350
+ }
2351
+
2352
+ /**
2353
+ * Base Sandbox Resource
2354
+ *
2355
+ * 此模块定义基础 Sandbox 资源类。
2356
+ * This module defines the base Sandbox resource class.
2357
+ */
2358
+
2359
+ /**
2360
+ * Base Sandbox resource class
2361
+ * 基础沙箱资源类 / Base Sandbox Resource Class
2362
+ */
2363
+ declare class Sandbox implements SandboxData {
2364
+ /**
2365
+ * 沙箱 ID / Sandbox ID
2366
+ */
2367
+ sandboxId?: string;
2368
+ /**
2369
+ * 沙箱名称 / Sandbox Name
2370
+ */
2371
+ sandboxName?: string;
2372
+ /**
2373
+ * 模板 ID / Template ID
2374
+ */
2375
+ templateId?: string;
2376
+ /**
2377
+ * 模板名称 / Template Name
2378
+ */
2379
+ templateName?: string;
2380
+ /**
2381
+ * 沙箱状态 / Sandbox State
2382
+ */
2383
+ state?: SandboxState;
2384
+ /**
2385
+ * 状态原因 / State Reason
2386
+ */
2387
+ stateReason?: string;
2388
+ /**
2389
+ * 沙箱创建时间 / Sandbox Creation Time
2390
+ */
2391
+ createdAt?: string;
2392
+ /**
2393
+ * 最后更新时间 / Last Updated Time
2394
+ */
2395
+ lastUpdatedAt?: string;
2396
+ /**
2397
+ * 沙箱空闲超时时间(秒) / Sandbox Idle Timeout (seconds)
2398
+ */
2399
+ sandboxIdleTimeoutSeconds?: number;
2400
+ /**
2401
+ * 沙箱结束时间 / Sandbox End Time
2402
+ */
2403
+ endedAt?: string;
2404
+ /**
2405
+ * 元数据 / Metadata
2406
+ */
2407
+ metadata?: Record<string, any>;
2408
+ /**
2409
+ * 沙箱全局唯一资源名称 / Sandbox ARN
2410
+ */
2411
+ sandboxArn?: string;
2412
+ /**
2413
+ * 沙箱空闲 TTL(秒) / Sandbox Idle TTL (seconds)
2414
+ */
2415
+ sandboxIdleTTLInSeconds?: number;
2416
+ protected _config?: Config;
2417
+ constructor(data?: Partial<SandboxData>, config?: Config);
2418
+ /**
2419
+ * Create sandbox from SDK response object
2420
+ * 从 SDK 响应对象创建沙箱 / Create Sandbox from SDK Response Object
2421
+ */
2422
+ static fromInnerObject(obj: any, config?: Config): Sandbox;
2423
+ protected static getClient(config?: Config): $AgentRun.default;
2424
+ /**
2425
+ * Create a new Sandbox
2426
+ * 创建新沙箱 / Create a New Sandbox
2427
+ */
2428
+ static create(input: SandboxCreateInput, config?: Config): Promise<Sandbox>;
2429
+ /**
2430
+ * Delete a Sandbox by ID
2431
+ */
2432
+ static delete(params: {
2433
+ id: string;
2434
+ config?: Config;
2435
+ }): Promise<Sandbox>;
2436
+ /**
2437
+ * Stop a Sandbox by ID
2438
+ */
2439
+ static stop(params: {
2440
+ id: string;
2441
+ config?: Config;
2442
+ }): Promise<Sandbox>;
2443
+ /**
2444
+ * Get a Sandbox by ID
2445
+ */
2446
+ static get(params: {
2447
+ id: string;
2448
+ templateType?: TemplateType;
2449
+ config?: Config;
2450
+ }): Promise<Sandbox>;
2451
+ /**
2452
+ * List Sandboxes
2453
+ */
2454
+ static list(input?: SandboxListInput, config?: Config): Promise<Sandbox[]>;
2455
+ /**
2456
+ * Handle API errors
2457
+ */
2458
+ protected static handleError(error: unknown): never;
2459
+ /**
2460
+ * Delete this sandbox
2461
+ */
2462
+ delete: (params?: {
2463
+ config?: Config;
2464
+ }) => Promise<Sandbox>;
2465
+ /**
2466
+ * Stop this sandbox
2467
+ */
2468
+ stop: (params?: {
2469
+ config?: Config;
2470
+ }) => Promise<Sandbox>;
2471
+ /**
2472
+ * Refresh this sandbox's data
2473
+ */
2474
+ refresh: (params?: {
2475
+ config?: Config;
2476
+ }) => Promise<Sandbox>;
2477
+ /**
2478
+ * Wait until the sandbox is running
2479
+ */
2480
+ waitUntilRunning: (options?: {
2481
+ timeoutSeconds?: number;
2482
+ intervalSeconds?: number;
2483
+ beforeCheck?: (sandbox: Sandbox) => void;
2484
+ }, config?: Config) => Promise<Sandbox>;
2485
+ }
2486
+
2487
+ /**
2488
+ * Browser Sandbox
2489
+ *
2490
+ * High-level API for browser sandboxes with CDP/VNC connectivity
2491
+ * and recording management.
2492
+ */
2493
+
2494
+ /**
2495
+ * Browser Sandbox
2496
+ *
2497
+ * High-level API for interacting with browser sandboxes.
2498
+ */
2499
+ declare class BrowserSandbox extends Sandbox {
2500
+ static templateType: TemplateType;
2501
+ /**
2502
+ * Create a Browser Sandbox from template
2503
+ * 从模板创建浏览器沙箱 / Create Browser Sandbox from Template
2504
+ */
2505
+ static createFromTemplate(templateName: string, options?: {
2506
+ sandboxIdleTimeoutSeconds?: number;
2507
+ nasConfig?: NASConfig;
2508
+ ossMountConfig?: OSSMountConfig;
2509
+ polarFsConfig?: PolarFsConfig;
2510
+ }, config?: Config): Promise<BrowserSandbox>;
2511
+ constructor(sandbox: Sandbox, config?: Config);
2512
+ private _dataApi?;
2513
+ /**
2514
+ * Get data API client
2515
+ */
2516
+ get dataApi(): BrowserDataAPI;
2517
+ /**
2518
+ * Check sandbox health
2519
+ */
2520
+ checkHealth: (params?: {
2521
+ config?: Config;
2522
+ }) => Promise<{
2523
+ status: string;
2524
+ [key: string]: any;
2525
+ }>;
2526
+ /**
2527
+ * Wait for browser sandbox to be ready (polls health check)
2528
+ */
2529
+ waitUntilReady: (params?: {
2530
+ maxRetries?: number;
2531
+ retryIntervalMs?: number;
2532
+ }) => Promise<void>;
2533
+ /**
2534
+ * Get CDP WebSocket URL for browser automation
2535
+ */
2536
+ getCdpUrl(record?: boolean): string;
2537
+ /**
2538
+ * Get VNC WebSocket URL for live view
2539
+ */
2540
+ getVncUrl(record?: boolean): string;
2541
+ /**
2542
+ * List all recordings
2543
+ */
2544
+ listRecordings: (params?: {
2545
+ config?: Config;
2546
+ }) => Promise<any>;
2547
+ /**
2548
+ * Download a recording video file
2549
+ */
2550
+ downloadRecording: (params: {
2551
+ filename: string;
2552
+ savePath: string;
2553
+ }) => Promise<{
2554
+ savedPath: string;
2555
+ size: number;
2556
+ }>;
2557
+ /**
2558
+ * Delete a recording
2559
+ */
2560
+ deleteRecording: (params: {
2561
+ filename: string;
2562
+ config?: Config;
2563
+ }) => Promise<any>;
2564
+ }
2565
+
2566
+ /**
2567
+ * Code Interpreter Sandbox Data API
2568
+ *
2569
+ * This module provides data API methods for Code Interpreter sandboxes.
2570
+ * 此模块提供代码解释器沙箱的数据 API 方法。
2571
+ */
2572
+
2573
+ /**
2574
+ * Code Interpreter Data API
2575
+ *
2576
+ * Provides methods for interacting with Code Interpreter sandbox data endpoints.
2577
+ */
2578
+ declare class CodeInterpreterDataAPI extends SandboxDataAPI {
2579
+ constructor(params: {
2580
+ sandboxId: string;
2581
+ config?: Config;
2582
+ });
2583
+ /**
2584
+ * List directory contents
2585
+ */
2586
+ listDirectory(params?: {
2587
+ path?: string;
2588
+ depth?: number;
2589
+ config?: Config;
2590
+ }): Promise<any>;
2591
+ /**
2592
+ * Get file/directory stats
2593
+ */
2594
+ stat(params: {
2595
+ path: string;
2596
+ config?: Config;
2597
+ }): Promise<any>;
2598
+ /**
2599
+ * Create directory
2600
+ */
2601
+ mkdir(params: {
2602
+ path: string;
2603
+ parents?: boolean;
2604
+ mode?: string;
2605
+ config?: Config;
2606
+ }): Promise<any>;
2607
+ /**
2608
+ * Move file or directory
2609
+ */
2610
+ moveFile(params: {
2611
+ source: string;
2612
+ destination: string;
2613
+ config?: Config;
2614
+ }): Promise<any>;
2615
+ /**
2616
+ * Remove file or directory
2617
+ */
2618
+ removeFile(params: {
2619
+ path: string;
2620
+ config?: Config;
2621
+ }): Promise<any>;
2622
+ /**
2623
+ * List code execution contexts
2624
+ */
2625
+ listContexts(params?: {
2626
+ config?: Config;
2627
+ }): Promise<any>;
2628
+ /**
2629
+ * Create a new code execution context
2630
+ */
2631
+ createContext(params?: {
2632
+ language?: CodeLanguage;
2633
+ cwd?: string;
2634
+ config?: Config;
2635
+ }): Promise<any>;
2636
+ /**
2637
+ * Get context details
2638
+ */
2639
+ getContext(params: {
2640
+ contextId: string;
2641
+ config?: Config;
2642
+ }): Promise<any>;
2643
+ /**
2644
+ * Execute code in a context
2645
+ */
2646
+ executeCode(params: {
2647
+ code: string;
2648
+ contextId?: string;
2649
+ language?: CodeLanguage;
2650
+ timeout?: number;
2651
+ config?: Config;
2652
+ }): Promise<any>;
2653
+ /**
2654
+ * Delete a context
2655
+ */
2656
+ deleteContext(params: {
2657
+ contextId: string;
2658
+ config?: Config;
2659
+ }): Promise<any>;
2660
+ /**
2661
+ * Read file contents
2662
+ */
2663
+ readFile(params: {
2664
+ path: string;
2665
+ config?: Config;
2666
+ }): Promise<any>;
2667
+ /**
2668
+ * Write file contents
2669
+ */
2670
+ writeFile(params: {
2671
+ path: string;
2672
+ content: string;
2673
+ mode?: string;
2674
+ encoding?: string;
2675
+ createDir?: boolean;
2676
+ config?: Config;
2677
+ }): Promise<any>;
2678
+ /**
2679
+ * Upload file to sandbox
2680
+ */
2681
+ uploadFile(params: {
2682
+ localFilePath: string;
2683
+ targetFilePath: string;
2684
+ config?: Config;
2685
+ }): Promise<any>;
2686
+ /**
2687
+ * Download file from sandbox
2688
+ */
2689
+ downloadFile(params: {
2690
+ path: string;
2691
+ savePath: string;
2692
+ config?: Config;
2693
+ }): Promise<{
2694
+ savedPath: string;
2695
+ size: number;
2696
+ }>;
2697
+ /**
2698
+ * Execute shell command
2699
+ */
2700
+ cmd(params: {
2701
+ command: string;
2702
+ cwd: string;
2703
+ timeout?: number;
2704
+ config?: Config;
2705
+ }): Promise<any>;
2706
+ /**
2707
+ * List running processes
2708
+ */
2709
+ listProcesses(params?: {
2710
+ config?: Config;
2711
+ }): Promise<any>;
2712
+ /**
2713
+ * Get process details
2714
+ */
2715
+ getProcess(params: {
2716
+ pid: string;
2717
+ config?: Config;
2718
+ }): Promise<any>;
2719
+ /**
2720
+ * Kill a process
2721
+ */
2722
+ killProcess(params: {
2723
+ pid: string;
2724
+ config?: Config;
2725
+ }): Promise<any>;
2726
+ /**
2727
+ * Helper method to upload file using multipart/form-data
2728
+ */
2729
+ protected postFile(params: {
2730
+ path: string;
2731
+ localFilePath: string;
2732
+ targetFilePath: string;
2733
+ formData?: Record<string, any>;
2734
+ query?: Record<string, any>;
2735
+ headers?: Record<string, string>;
2736
+ config?: Config;
2737
+ }): Promise<any>;
2738
+ /**
2739
+ * Helper method to download file
2740
+ */
2741
+ protected getFile(params: {
2742
+ path: string;
2743
+ savePath: string;
2744
+ query?: Record<string, any>;
2745
+ headers?: Record<string, string>;
2746
+ config?: Config;
2747
+ }): Promise<{
2748
+ savedPath: string;
2749
+ size: number;
2750
+ }>;
2751
+ }
2752
+
2753
+ /**
2754
+ * Code Interpreter Sandbox
2755
+ *
2756
+ * High-level API for code interpreter sandboxes with file, filesystem,
2757
+ * context, and process management operations.
2758
+ */
2759
+
2760
+ /**
2761
+ * File upload/download operations
2762
+ */
2763
+ declare class FileOperations {
2764
+ private sandbox;
2765
+ constructor(sandbox: CodeInterpreterSandbox);
2766
+ /**
2767
+ * Read a file from the code interpreter
2768
+ */
2769
+ read: (params: {
2770
+ path: string;
2771
+ }) => Promise<any>;
2772
+ /**
2773
+ * Write a file to the code interpreter
2774
+ */
2775
+ write: (params: {
2776
+ path: string;
2777
+ content: string;
2778
+ mode?: string;
2779
+ encoding?: string;
2780
+ createDir?: boolean;
2781
+ }) => Promise<any>;
2782
+ }
2783
+ /**
2784
+ * File system operations (list, move, remove, stat, mkdir)
2785
+ */
2786
+ declare class FileSystemOperations {
2787
+ private sandbox;
2788
+ constructor(sandbox: CodeInterpreterSandbox);
2789
+ /**
2790
+ * List directory contents
2791
+ */
2792
+ list: (params?: {
2793
+ path?: string;
2794
+ depth?: number;
2795
+ }) => Promise<any>;
2796
+ /**
2797
+ * Move a file or directory
2798
+ */
2799
+ move: (params: {
2800
+ source: string;
2801
+ destination: string;
2802
+ }) => Promise<any>;
2803
+ /**
2804
+ * Remove a file or directory
2805
+ */
2806
+ remove: (params: {
2807
+ path: string;
2808
+ }) => Promise<any>;
2809
+ /**
2810
+ * Get file or directory statistics
2811
+ */
2812
+ stat: (params: {
2813
+ path: string;
2814
+ }) => Promise<any>;
2815
+ /**
2816
+ * Create a directory
2817
+ */
2818
+ mkdir: (params: {
2819
+ path: string;
2820
+ parents?: boolean;
2821
+ mode?: string;
2822
+ }) => Promise<any>;
2823
+ /**
2824
+ * Upload a file to the code interpreter
2825
+ */
2826
+ upload: (params: {
2827
+ localFilePath: string;
2828
+ targetFilePath: string;
2829
+ }) => Promise<any>;
2830
+ /**
2831
+ * Download a file from the code interpreter
2832
+ */
2833
+ download: (params: {
2834
+ path: string;
2835
+ savePath: string;
2836
+ }) => Promise<{
2837
+ savedPath: string;
2838
+ size: number;
2839
+ }>;
2840
+ }
2841
+ /**
2842
+ * Process management operations
2843
+ */
2844
+ declare class ProcessOperations {
2845
+ private sandbox;
2846
+ constructor(sandbox: CodeInterpreterSandbox);
2847
+ /**
2848
+ * Execute a command in the code interpreter
2849
+ */
2850
+ cmd: (params: {
2851
+ command: string;
2852
+ cwd: string;
2853
+ timeout?: number;
2854
+ }) => Promise<any>;
2855
+ /**
2856
+ * List all processes
2857
+ */
2858
+ list: (params?: {
2859
+ config?: Config;
2860
+ }) => Promise<any>;
2861
+ /**
2862
+ * Get a specific process by PID
2863
+ */
2864
+ get: (params: {
2865
+ pid: string;
2866
+ }) => Promise<any>;
2867
+ /**
2868
+ * Kill a specific process by PID
2869
+ */
2870
+ kill: (params: {
2871
+ pid: string;
2872
+ }) => Promise<any>;
2873
+ }
2874
+ /**
2875
+ * Context management operations
2876
+ */
2877
+ declare class ContextOperations {
2878
+ private sandbox;
2879
+ private _contextId?;
2880
+ private _language?;
2881
+ private _cwd?;
2882
+ constructor(sandbox: CodeInterpreterSandbox);
2883
+ /**
2884
+ * Get the current context ID
2885
+ */
2886
+ get contextId(): string | undefined;
2887
+ /**
2888
+ * List all contexts
2889
+ */
2890
+ list: (params?: {
2891
+ config?: Config;
2892
+ }) => Promise<any>;
2893
+ /**
2894
+ * Create a new context and save its ID
2895
+ */
2896
+ create: (params?: {
2897
+ language?: CodeLanguage;
2898
+ cwd?: string;
2899
+ }) => Promise<ContextOperations>;
2900
+ /**
2901
+ * Get a specific context by ID
2902
+ */
2903
+ get: (params?: {
2904
+ contextId?: string;
2905
+ }) => Promise<ContextOperations>;
2906
+ /**
2907
+ * Execute code in a context
2908
+ */
2909
+ execute: (params: {
2910
+ code: string;
2911
+ language?: CodeLanguage;
2912
+ contextId?: string;
2913
+ timeout?: number;
2914
+ }) => Promise<any>;
2915
+ /**
2916
+ * Delete a context
2917
+ */
2918
+ delete: (params?: {
2919
+ contextId?: string;
2920
+ }) => Promise<any>;
2921
+ }
2922
+ /**
2923
+ * Code Interpreter Sandbox
2924
+ *
2925
+ * High-level API for interacting with code interpreter sandboxes.
2926
+ */
2927
+ declare class CodeInterpreterSandbox extends Sandbox {
2928
+ static templateType: TemplateType;
2929
+ /**
2930
+ * Create a Code Interpreter Sandbox from template
2931
+ * 从模板创建代码解释器沙箱 / Create Code Interpreter Sandbox from Template
2932
+ */
2933
+ static createFromTemplate(templateName: string, options?: {
2934
+ sandboxIdleTimeoutSeconds?: number;
2935
+ nasConfig?: NASConfig;
2936
+ ossMountConfig?: OSSMountConfig;
2937
+ polarFsConfig?: PolarFsConfig;
2938
+ }, config?: Config): Promise<CodeInterpreterSandbox>;
2939
+ constructor(sandbox: Sandbox, config?: Config);
2940
+ private _dataApi?;
2941
+ private _file?;
2942
+ private _fileSystem?;
2943
+ private _context?;
2944
+ private _process?;
2945
+ /**
2946
+ * Get data API client
2947
+ */
2948
+ get dataApi(): CodeInterpreterDataAPI;
2949
+ /**
2950
+ * Access file upload/download operations
2951
+ */
2952
+ get file(): FileOperations;
2953
+ /**
2954
+ * Access file system operations
2955
+ */
2956
+ get fileSystem(): FileSystemOperations;
2957
+ /**
2958
+ * Access context management operations
2959
+ */
2960
+ get context(): ContextOperations;
2961
+ /**
2962
+ * Access process management operations
2963
+ */
2964
+ get process(): ProcessOperations;
2965
+ /**
2966
+ * Check sandbox health
2967
+ */
2968
+ checkHealth: (params?: {
2969
+ config?: Config;
2970
+ }) => Promise<{
2971
+ status: string;
2972
+ [key: string]: any;
2973
+ }>;
2974
+ /**
2975
+ * Wait for sandbox to be ready (polls health check)
2976
+ */
2977
+ waitUntilReady: (params?: {
2978
+ maxRetries?: number;
2979
+ retryIntervalMs?: number;
2980
+ }) => Promise<void>;
2981
+ /**
2982
+ * Execute code (convenience method delegating to context.execute)
2983
+ */
2984
+ execute: (params: {
2985
+ code: string;
2986
+ language?: CodeLanguage;
2987
+ contextId?: string;
2988
+ timeout?: number;
2989
+ }) => Promise<any>;
2990
+ }
2991
+
2992
+ /**
2993
+ * Template Resource
2994
+ *
2995
+ * 此模块定义 Template 资源类。
2996
+ * This module defines the Template resource class.
2997
+ */
2998
+
2999
+ /**
3000
+ * Template resource class
3001
+ * 模板资源类 / Template Resource Class
3002
+ */
3003
+ declare class Template implements TemplateData {
3004
+ /**
3005
+ * 模板 ARN / Template ARN
3006
+ */
3007
+ templateArn?: string;
3008
+ /**
3009
+ * 模板 ID / Template ID
3010
+ */
3011
+ templateId?: string;
3012
+ /**
3013
+ * 模板名称 / Template Name
3014
+ */
3015
+ templateName?: string;
3016
+ /**
3017
+ * 模板类型 / Template Type
3018
+ */
3019
+ templateType?: TemplateType;
3020
+ /**
3021
+ * CPU 核数 / CPU Cores
3022
+ */
3023
+ cpu?: number;
3024
+ /**
3025
+ * 内存大小(MB) / Memory Size (MB)
3026
+ */
3027
+ memory?: number;
3028
+ /**
3029
+ * 创建时间 / Creation Time
3030
+ */
3031
+ createdAt?: string;
3032
+ /**
3033
+ * 描述 / Description
3034
+ */
3035
+ description?: string;
3036
+ /**
3037
+ * 执行角色 ARN / Execution Role ARN
3038
+ */
3039
+ executionRoleArn?: string;
3040
+ /**
3041
+ * 最后更新时间 / Last Updated Time
3042
+ */
3043
+ lastUpdatedAt?: string;
3044
+ /**
3045
+ * 资源名称 / Resource Name
3046
+ */
3047
+ resourceName?: string;
3048
+ /**
3049
+ * 沙箱空闲超时时间(秒) / Sandbox Idle Timeout (seconds)
3050
+ */
3051
+ sandboxIdleTimeoutInSeconds?: number;
3052
+ /**
3053
+ * 沙箱存活时间(秒) / Sandbox TTL (seconds)
3054
+ */
3055
+ sandboxTtlInSeconds?: number;
3056
+ /**
3057
+ * 每个沙箱的最大并发会话数 / Max Concurrency Limit Per Sandbox
3058
+ */
3059
+ shareConcurrencyLimitPerSandbox?: number;
3060
+ /**
3061
+ * 状态 / Status
3062
+ */
3063
+ status?: Status;
3064
+ /**
3065
+ * 状态原因 / Status Reason
3066
+ */
3067
+ statusReason?: string;
3068
+ /**
3069
+ * 磁盘大小(GB) / Disk Size (GB)
3070
+ */
3071
+ diskSize?: number;
3072
+ /**
3073
+ * 是否允许匿名管理 / Whether to allow anonymous management
3074
+ */
3075
+ allowAnonymousManage?: boolean;
3076
+ private _config?;
3077
+ constructor(data?: Partial<TemplateData>, config?: Config);
3078
+ /**
3079
+ * Create template from SDK response object
3080
+ * 从 SDK 响应对象创建模板 / Create Template from SDK Response Object
3081
+ */
3082
+ static fromInnerObject(obj: $AgentRun.Template, config?: Config): Template;
3083
+ private static getClient;
3084
+ /**
3085
+ * Create a new Template
3086
+ */
3087
+ static create(params: {
3088
+ input: TemplateCreateInput;
3089
+ config?: Config;
3090
+ }): Promise<Template>;
3091
+ /**
3092
+ * Get defaults based on template type
3093
+ */
3094
+ private static getDefaults;
3095
+ /**
3096
+ * Validate template configuration
3097
+ */
3098
+ private static validate;
3099
+ /**
3100
+ * Delete a Template by name
3101
+ */
3102
+ static delete(params: {
3103
+ name: string;
3104
+ config?: Config;
3105
+ }): Promise<Template>;
3106
+ /**
3107
+ * Update a Template by name
3108
+ */
3109
+ static update(params: {
3110
+ name: string;
3111
+ input: TemplateUpdateInput;
3112
+ config?: Config;
3113
+ }): Promise<Template>;
3114
+ /**
3115
+ * Get a Template by name
3116
+ */
3117
+ static get(params: {
3118
+ name: string;
3119
+ config?: Config;
3120
+ }): Promise<Template>;
3121
+ /**
3122
+ * List Templates
3123
+ */
3124
+ static list(input?: TemplateListInput, config?: Config): Promise<Template[]>;
3125
+ /**
3126
+ * List all Templates (with pagination)
3127
+ */
3128
+ static listAll(options?: {
3129
+ templateType?: TemplateType;
3130
+ }, config?: Config): Promise<Template[]>;
3131
+ /**
3132
+ * Handle API errors
3133
+ */
3134
+ private static handleError;
3135
+ /**
3136
+ * Delete this template
3137
+ */
3138
+ delete: (params?: {
3139
+ config?: Config;
3140
+ }) => Promise<Template>;
3141
+ /**
3142
+ * Update this template
3143
+ */
3144
+ update: (params: {
3145
+ input: TemplateUpdateInput;
3146
+ config?: Config;
3147
+ }) => Promise<Template>;
3148
+ /**
3149
+ * Refresh this template's data
3150
+ */
3151
+ refresh: (params?: {
3152
+ config?: Config;
3153
+ }) => Promise<Template>;
3154
+ /**
3155
+ * Wait until the template is ready
3156
+ */
3157
+ waitUntilReady: (options?: {
3158
+ timeoutSeconds?: number;
3159
+ intervalSeconds?: number;
3160
+ beforeCheck?: (template: Template) => void;
3161
+ }, config?: Config) => Promise<Template>;
3162
+ }
3163
+
3164
+ /**
3165
+ * Sandbox Client
3166
+ *
3167
+ * 此模块提供 Sandbox 的客户端 API。
3168
+ * This module provides the client API for Sandbox.
3169
+ */
3170
+
3171
+ /**
3172
+ * Sandbox Client
3173
+ *
3174
+ * 提供 Sandbox 和 Template 的管理功能。
3175
+ */
3176
+ declare class SandboxClient {
3177
+ private config?;
3178
+ constructor(config?: Config);
3179
+ /**
3180
+ * Create a Template
3181
+ */
3182
+ createTemplate: (params: {
3183
+ input: TemplateCreateInput;
3184
+ config?: Config;
3185
+ }) => Promise<Template>;
3186
+ /**
3187
+ * Delete a Template
3188
+ */
3189
+ deleteTemplate: (params: {
3190
+ name: string;
3191
+ config?: Config;
3192
+ }) => Promise<Template>;
3193
+ /**
3194
+ * Update a Template
3195
+ */
3196
+ updateTemplate: (params: {
3197
+ name: string;
3198
+ input: TemplateUpdateInput;
3199
+ config?: Config;
3200
+ }) => Promise<Template>;
3201
+ /**
3202
+ * Get a Template
3203
+ */
3204
+ getTemplate: (params: {
3205
+ name: string;
3206
+ config?: Config;
3207
+ }) => Promise<Template>;
3208
+ /**
3209
+ * List Templates
3210
+ */
3211
+ listTemplates: (params?: {
3212
+ input?: TemplateListInput;
3213
+ config?: Config;
3214
+ }) => Promise<Template[]>;
3215
+ /**
3216
+ * List all Templates
3217
+ */
3218
+ listAllTemplates: (params?: {
3219
+ options?: {
3220
+ templateType?: TemplateType;
3221
+ };
3222
+ config?: Config;
3223
+ }) => Promise<Template[]>;
3224
+ /**
3225
+ * Create a Sandbox
3226
+ */
3227
+ createSandbox: (params: {
3228
+ input: SandboxCreateInput;
3229
+ config?: Config;
3230
+ }) => Promise<Sandbox>;
3231
+ /**
3232
+ * Create a Code Interpreter Sandbox
3233
+ * 创建代码解释器沙箱 / Create Code Interpreter Sandbox
3234
+ */
3235
+ createCodeInterpreterSandbox: (params: {
3236
+ templateName: string;
3237
+ options?: {
3238
+ sandboxIdleTimeoutSeconds?: number;
3239
+ nasConfig?: NASConfig;
3240
+ ossMountConfig?: OSSMountConfig;
3241
+ polarFsConfig?: PolarFsConfig;
3242
+ };
3243
+ config?: Config;
3244
+ }) => Promise<CodeInterpreterSandbox>;
3245
+ /**
3246
+ * Create a Browser Sandbox
3247
+ * 创建浏览器沙箱 / Create Browser Sandbox
3248
+ */
3249
+ createBrowserSandbox: (params: {
3250
+ templateName: string;
3251
+ options?: {
3252
+ sandboxIdleTimeoutSeconds?: number;
3253
+ nasConfig?: NASConfig;
3254
+ ossMountConfig?: OSSMountConfig;
3255
+ polarFsConfig?: PolarFsConfig;
3256
+ };
3257
+ config?: Config;
3258
+ }) => Promise<BrowserSandbox>;
3259
+ /**
3260
+ * Delete a Sandbox
3261
+ */
3262
+ deleteSandbox: (params: {
3263
+ id: string;
3264
+ config?: Config;
3265
+ }) => Promise<Sandbox>;
3266
+ /**
3267
+ * Stop a Sandbox
3268
+ */
3269
+ stopSandbox: (params: {
3270
+ id: string;
3271
+ config?: Config;
3272
+ }) => Promise<Sandbox>;
3273
+ /**
3274
+ * Get a Sandbox
3275
+ *
3276
+ * @param params.id - Sandbox ID
3277
+ * @param params.templateType - Template type to cast the result to the appropriate subclass
3278
+ * @param params.config - Configuration
3279
+ */
3280
+ getSandbox: (params: {
3281
+ id: string;
3282
+ templateType?: TemplateType;
3283
+ config?: Config;
3284
+ }) => Promise<Sandbox>;
3285
+ /**
3286
+ * List Sandboxes
3287
+ */
3288
+ listSandboxes: (params?: {
3289
+ input?: SandboxListInput;
3290
+ config?: Config;
3291
+ }) => Promise<Sandbox[]>;
3292
+ }
3293
+
3294
+ /**
3295
+ * AIO (All-In-One) Sandbox Data API
3296
+ *
3297
+ * This module provides a combined data API that includes both Code Interpreter
3298
+ * and Browser sandbox functionalities.
3299
+ * 此模块提供包含代码解释器和浏览器沙箱功能的组合数据 API。
3300
+ */
3301
+
3302
+ /**
3303
+ * AIO Data API
3304
+ *
3305
+ * Combines both Code Interpreter and Browser data API methods.
3306
+ */
3307
+ declare class AioDataAPI extends CodeInterpreterDataAPI {
3308
+ private browserAPI;
3309
+ constructor(params: {
3310
+ sandboxId: string;
3311
+ config?: Config;
3312
+ });
3313
+ /**
3314
+ * Get CDP WebSocket URL for browser automation
3315
+ */
3316
+ getCdpUrl(record?: boolean): string;
3317
+ /**
3318
+ * Get VNC WebSocket URL for live view
3319
+ */
3320
+ getVncUrl(record?: boolean): string;
3321
+ /**
3322
+ * List browser recordings
3323
+ */
3324
+ listRecordings: (params?: {
3325
+ config?: Config;
3326
+ }) => Promise<any>;
3327
+ /**
3328
+ * Delete a recording
3329
+ */
3330
+ deleteRecording: (params: {
3331
+ filename: string;
3332
+ config?: Config;
3333
+ }) => Promise<any>;
3334
+ /**
3335
+ * Download a recording
3336
+ */
3337
+ downloadRecording: (params: {
3338
+ filename: string;
3339
+ savePath: string;
3340
+ }) => Promise<{
3341
+ savedPath: string;
3342
+ size: number;
3343
+ }>;
3344
+ }
3345
+
3346
+ /**
3347
+ * AIO (All-In-One) Sandbox
3348
+ *
3349
+ * Combines both Code Interpreter and Browser sandbox functionalities
3350
+ * into a single unified interface.
3351
+ */
3352
+
3353
+ /**
3354
+ * File upload/download operations
3355
+ */
3356
+ declare class AioFileOperations {
3357
+ private sandbox;
3358
+ constructor(sandbox: AioSandbox);
3359
+ /**
3360
+ * Read a file from the sandbox
3361
+ */
3362
+ read: (path: string) => Promise<any>;
3363
+ /**
3364
+ * Write a file to the sandbox
3365
+ */
3366
+ write: (params: {
3367
+ path: string;
3368
+ content: string;
3369
+ mode?: string;
3370
+ encoding?: string;
3371
+ createDir?: boolean;
3372
+ }) => Promise<any>;
3373
+ }
3374
+ /**
3375
+ * File system operations (list, move, remove, stat, mkdir)
3376
+ */
3377
+ declare class AioFileSystemOperations {
3378
+ private sandbox;
3379
+ constructor(sandbox: AioSandbox);
3380
+ /**
3381
+ * List directory contents
3382
+ */
3383
+ list: (params?: {
3384
+ path?: string;
3385
+ depth?: number;
3386
+ }) => Promise<any>;
3387
+ /**
3388
+ * Move a file or directory
3389
+ */
3390
+ move: (params: {
3391
+ source: string;
3392
+ destination: string;
3393
+ }) => Promise<any>;
3394
+ /**
3395
+ * Remove a file or directory
3396
+ */
3397
+ remove: (params: {
3398
+ path: string;
3399
+ }) => Promise<any>;
3400
+ /**
3401
+ * Get file or directory statistics
3402
+ */
3403
+ stat: (params: {
3404
+ path: string;
3405
+ }) => Promise<any>;
3406
+ /**
3407
+ * Create a directory
3408
+ */
3409
+ mkdir: (params: {
3410
+ path: string;
3411
+ parents?: boolean;
3412
+ mode?: string;
3413
+ }) => Promise<any>;
3414
+ /**
3415
+ * Upload a file to the sandbox
3416
+ */
3417
+ upload: (params: {
3418
+ localFilePath: string;
3419
+ targetFilePath: string;
3420
+ }) => Promise<any>;
3421
+ /**
3422
+ * Download a file from the sandbox
3423
+ */
3424
+ download: (params: {
3425
+ path: string;
3426
+ savePath: string;
3427
+ }) => Promise<{
3428
+ savedPath: string;
3429
+ size: number;
3430
+ }>;
3431
+ }
3432
+ /**
3433
+ * Process management operations
3434
+ */
3435
+ declare class AioProcessOperations {
3436
+ private sandbox;
3437
+ constructor(sandbox: AioSandbox);
3438
+ /**
3439
+ * Execute a command in the sandbox
3440
+ */
3441
+ cmd: (params: {
3442
+ command: string;
3443
+ cwd: string;
3444
+ timeout?: number;
3445
+ }) => Promise<any>;
3446
+ /**
3447
+ * List all processes
3448
+ */
3449
+ list: (params?: {
3450
+ config?: Config;
3451
+ }) => Promise<any>;
3452
+ /**
3453
+ * Get a specific process by PID
3454
+ */
3455
+ get: (params: {
3456
+ pid: string;
3457
+ }) => Promise<any>;
3458
+ /**
3459
+ * Kill a specific process by PID
3460
+ */
3461
+ kill: (params: {
3462
+ pid: string;
3463
+ }) => Promise<any>;
3464
+ }
3465
+ /**
3466
+ * Context management operations
3467
+ */
3468
+ declare class AioContextOperations {
3469
+ private sandbox;
3470
+ private _contextId?;
3471
+ private _language?;
3472
+ private _cwd?;
3473
+ constructor(sandbox: AioSandbox);
3474
+ /**
3475
+ * Get the current context ID
3476
+ */
3477
+ get contextId(): string | undefined;
3478
+ /**
3479
+ * List all contexts
3480
+ */
3481
+ list: (params?: {
3482
+ config?: Config;
3483
+ }) => Promise<any>;
3484
+ /**
3485
+ * Create a new context and save its ID
3486
+ */
3487
+ create: (params?: {
3488
+ language?: CodeLanguage;
3489
+ cwd?: string;
3490
+ }) => Promise<AioContextOperations>;
3491
+ /**
3492
+ * Get a specific context by ID
3493
+ */
3494
+ get: (params?: {
3495
+ contextId?: string;
3496
+ }) => Promise<AioContextOperations>;
3497
+ /**
3498
+ * Execute code in a context
3499
+ */
3500
+ execute: (params: {
3501
+ code: string;
3502
+ language?: CodeLanguage;
3503
+ contextId?: string;
3504
+ timeout?: number;
3505
+ }) => Promise<any>;
3506
+ /**
3507
+ * Delete a context
3508
+ */
3509
+ delete: (params?: {
3510
+ contextId?: string;
3511
+ }) => Promise<any>;
3512
+ }
3513
+ /**
3514
+ * AIO (All-In-One) Sandbox
3515
+ *
3516
+ * Combines both Code Interpreter and Browser sandbox functionalities.
3517
+ */
3518
+ declare class AioSandbox extends Sandbox {
3519
+ static templateType: TemplateType;
3520
+ /**
3521
+ * Create an AIO Sandbox from template
3522
+ * 从模板创建 AIO 沙箱 / Create AIO Sandbox from Template
3523
+ */
3524
+ static createFromTemplate(templateName: string, options?: {
3525
+ sandboxIdleTimeoutSeconds?: number;
3526
+ nasConfig?: NASConfig;
3527
+ ossMountConfig?: OSSMountConfig;
3528
+ polarFsConfig?: PolarFsConfig;
3529
+ }, config?: Config): Promise<AioSandbox>;
3530
+ constructor(sandbox: Sandbox, config?: Config);
3531
+ private _dataApi?;
3532
+ private _file?;
3533
+ private _fileSystem?;
3534
+ private _context?;
3535
+ private _process?;
3536
+ /**
3537
+ * Get data API client
3538
+ */
3539
+ get dataApi(): AioDataAPI;
3540
+ /**
3541
+ * Access file upload/download operations
3542
+ */
3543
+ get file(): AioFileOperations;
3544
+ /**
3545
+ * Access file system operations
3546
+ */
3547
+ get fileSystem(): AioFileSystemOperations;
3548
+ /**
3549
+ * Access context management operations
3550
+ */
3551
+ get context(): AioContextOperations;
3552
+ /**
3553
+ * Access process management operations
3554
+ */
3555
+ get process(): AioProcessOperations;
3556
+ /**
3557
+ * Check sandbox health
3558
+ */
3559
+ checkHealth: (params?: {
3560
+ config?: Config;
3561
+ }) => Promise<{
3562
+ status: string;
3563
+ [key: string]: any;
3564
+ }>;
3565
+ /**
3566
+ * Wait for sandbox to be ready (polls health check)
3567
+ */
3568
+ waitUntilReady: (params?: {
3569
+ maxRetries?: number;
3570
+ retryIntervalMs?: number;
3571
+ }) => Promise<void>;
3572
+ /**
3573
+ * Get CDP WebSocket URL for browser automation
3574
+ */
3575
+ getCdpUrl(record?: boolean): string;
3576
+ /**
3577
+ * Get VNC WebSocket URL for live view
3578
+ */
3579
+ getVncUrl(record?: boolean): string;
3580
+ /**
3581
+ * List all browser recordings
3582
+ */
3583
+ listRecordings: (params?: {
3584
+ config?: Config;
3585
+ }) => Promise<any>;
3586
+ /**
3587
+ * Download a recording video file
3588
+ */
3589
+ downloadRecording: (params: {
3590
+ filename: string;
3591
+ savePath: string;
3592
+ }) => Promise<{
3593
+ savedPath: string;
3594
+ size: number;
3595
+ }>;
3596
+ /**
3597
+ * Delete a recording
3598
+ */
3599
+ deleteRecording: (params: {
3600
+ filename: string;
3601
+ config?: Config;
3602
+ }) => Promise<any>;
3603
+ /**
3604
+ * Execute code (convenience method delegating to context.execute)
3605
+ */
3606
+ execute: (params: {
3607
+ code: string;
3608
+ language?: CodeLanguage;
3609
+ contextId?: string;
3610
+ timeout?: number;
3611
+ }) => Promise<any>;
3612
+ }
3613
+
3614
+ /**
3615
+ * Model Service Data Models
3616
+ *
3617
+ * 此模块定义 Model Service 相关的所有数据模型。
3618
+ * This module defines all data models related to Model Service.
3619
+ */
3620
+
3621
+ /**
3622
+ * Backend type enum
3623
+ */
3624
+ type BackendType = 'proxy' | 'service';
3625
+ declare const BackendType: {
3626
+ PROXY: BackendType;
3627
+ SERVICE: BackendType;
3628
+ };
3629
+ /**
3630
+ * Model type enum
3631
+ */
3632
+ type ModelType = 'llm' | 'text-embedding' | 'speech2text' | 'tts' | 'rerank' | 'moderation';
3633
+ declare const ModelType: {
3634
+ LLM: ModelType;
3635
+ TEXT_EMBEDDING: ModelType;
3636
+ SPEECH2TEXT: ModelType;
3637
+ TTS: ModelType;
3638
+ RERANK: ModelType;
3639
+ MODERATION: ModelType;
3640
+ };
3641
+ /**
3642
+ * Provider enum
3643
+ */
3644
+ type Provider = 'openai' | 'anthropic' | 'baichuan' | 'deepseek' | 'gemini' | 'hunyuan' | 'minimax' | 'moonshot' | 'spark' | 'stepfun' | 'tongyi' | 'vertex_ai' | 'wenxin' | 'yi' | 'zhipuai' | 'custom';
3645
+ declare const Provider: {
3646
+ OPENAI: Provider;
3647
+ ANTHROPIC: Provider;
3648
+ BAICHUAN: Provider;
3649
+ DEEPSEEK: Provider;
3650
+ GEMINI: Provider;
3651
+ HUNYUAN: Provider;
3652
+ MINIMAX: Provider;
3653
+ MOONSHOT: Provider;
3654
+ SPARK: Provider;
3655
+ STEPFUN: Provider;
3656
+ TONGYI: Provider;
3657
+ VERTEX_AI: Provider;
3658
+ WENXIN: Provider;
3659
+ YI: Provider;
3660
+ ZHIPUAI: Provider;
3661
+ CUSTOM: Provider;
3662
+ };
3663
+ type ProxyMode = 'single' | 'multi';
3664
+ declare const ProxyMode: {
3665
+ SINGLE: ProxyMode;
3666
+ MULTI: ProxyMode;
3667
+ };
3668
+ /**
3669
+ * Provider settings
3670
+ */
3671
+ interface ProviderSettings {
3672
+ apiKey?: string;
3673
+ baseUrl?: string;
3674
+ modelNames?: string[];
3675
+ }
3676
+ /**
3677
+ * Model features
3678
+ */
3679
+ interface ModelFeatures {
3680
+ agentThought?: boolean;
3681
+ multiToolCall?: boolean;
3682
+ streamToolCall?: boolean;
3683
+ toolCall?: boolean;
3684
+ vision?: boolean;
3685
+ }
3686
+ /**
3687
+ * Model properties
3688
+ */
3689
+ interface ModelProperties {
3690
+ contextSize?: number;
3691
+ }
3692
+ /**
3693
+ * Model parameter rule
3694
+ */
3695
+ interface ModelParameterRule {
3696
+ default?: unknown;
3697
+ max?: number;
3698
+ min?: number;
3699
+ name?: string;
3700
+ required?: boolean;
3701
+ type?: string;
3702
+ }
3703
+ /**
3704
+ * Model info config
3705
+ */
3706
+ interface ModelInfoConfig {
3707
+ modelName?: string;
3708
+ modelFeatures?: ModelFeatures;
3709
+ modelProperties?: ModelProperties;
3710
+ modelParameterRules?: ModelParameterRule[];
3711
+ }
3712
+ /**
3713
+ * Proxy config endpoint
3714
+ */
3715
+ interface ProxyConfigEndpoint {
3716
+ baseUrl?: string;
3717
+ modelNames?: string[];
3718
+ modelServiceName?: string;
3719
+ weight?: number;
3720
+ }
3721
+ /**
3722
+ * Proxy config fallback
3723
+ */
3724
+ interface ProxyConfigFallback {
3725
+ modelName?: string;
3726
+ modelServiceName?: string;
3727
+ }
3728
+ interface ProxyConfigTokenRateLimiter {
3729
+ tps?: number;
3730
+ tpm?: number;
3731
+ tph?: number;
3732
+ tpd?: number;
3733
+ }
3734
+ interface ProxyConfigAIGuardrailConfig {
3735
+ checkRequest?: boolean;
3736
+ checkResponse?: boolean;
3737
+ }
3738
+ /**
3739
+ * Proxy config policies
3740
+ */
3741
+ interface ProxyConfigPolicies {
3742
+ cache?: boolean;
3743
+ concurrencyLimit?: number;
3744
+ fallbacks?: ProxyConfigFallback[];
3745
+ numRetries?: number;
3746
+ requestTimeout?: number;
3747
+ aiGuardrailConfig?: ProxyConfigAIGuardrailConfig;
3748
+ tokenRateLimiter?: ProxyConfigTokenRateLimiter;
3749
+ }
3750
+ /**
3751
+ * Proxy config
3752
+ */
3753
+ interface ProxyConfig {
3754
+ endpoints?: ProxyConfigEndpoint[];
3755
+ policies?: ProxyConfigPolicies;
3756
+ }
3757
+ interface CommonModelMutableProps {
3758
+ credentialName?: string;
3759
+ description?: string;
3760
+ networkConfiguration?: NetworkConfig;
3761
+ tags?: string[];
3762
+ }
3763
+ interface CommonModelImmutableProps {
3764
+ modelType?: ModelType;
3765
+ }
3766
+ interface CommonModelSystemProps {
3767
+ createdAt?: string;
3768
+ lastUpdatedAt?: string;
3769
+ status?: Status;
3770
+ }
3771
+ interface ModelServiceMutableProps extends CommonModelMutableProps {
3772
+ providerSettings?: ProviderSettings;
3773
+ }
3774
+ interface ModelServiceImmutableProps extends CommonModelImmutableProps {
3775
+ modelInfoConfigs?: ModelInfoConfig[];
3776
+ modelServiceName?: string;
3777
+ provider?: string;
3778
+ }
3779
+ interface ModelServiceSystemProps extends CommonModelSystemProps {
3780
+ modelServiceId?: string;
3781
+ }
3782
+ interface ModelProxyMutableProps extends CommonModelMutableProps {
3783
+ cpu?: number;
3784
+ litellmVersion?: string;
3785
+ memory?: number;
3786
+ modelProxyName?: string;
3787
+ proxyModel?: ProxyMode;
3788
+ serviceRegionId?: string;
3789
+ proxyConfig?: ProxyConfig;
3790
+ executionRoleArn?: string;
3791
+ }
3792
+ interface ModelProxyImmutableProps extends CommonModelImmutableProps {
3793
+ }
3794
+ interface ModelProxySystemProps extends CommonModelSystemProps {
3795
+ endpoint?: string;
3796
+ functionName?: string;
3797
+ modelProxyId?: string;
3798
+ }
3799
+ interface ModelServiceCreateInput extends ModelServiceImmutableProps, ModelServiceMutableProps {
3800
+ }
3801
+ interface ModelServiceUpdateInput extends ModelServiceMutableProps {
3802
+ }
3803
+ interface ModelServiceListInput extends PageableInput {
3804
+ modelServiceName?: string;
3805
+ modelType?: ModelType;
3806
+ provider?: string;
3807
+ }
3808
+ /**
3809
+ * Model proxy create input
3810
+ */
3811
+ interface ModelProxyCreateInput extends ModelServiceImmutableProps, ModelProxyMutableProps {
3812
+ }
3813
+ /**
3814
+ * Model proxy update input
3815
+ */
3816
+ interface ModelProxyUpdateInput extends ModelServiceMutableProps {
3817
+ proxyModel?: string;
3818
+ executionRoleArn?: string;
3819
+ }
3820
+ /**
3821
+ * Model proxy list input
3822
+ */
3823
+ interface ModelProxyListInput extends PageableInput {
3824
+ modelProxyName?: string;
3825
+ proxyMode?: string;
3826
+ status?: Status;
3827
+ }
3828
+
3829
+ /**
3830
+ * 模型代理 / Model Proxy
3831
+ */
3832
+ declare class ModelProxy extends ResourceBase implements ModelProxyImmutableProps, ModelProxyMutableProps, ModelProxySystemProps {
3833
+ modelType?: ModelProxyImmutableProps['modelType'];
3834
+ credentialName?: string;
3835
+ description?: string;
3836
+ networkConfiguration?: ModelProxyMutableProps['networkConfiguration'];
3837
+ tags?: string[];
3838
+ cpu?: number;
3839
+ litellmVersion?: string;
3840
+ memory?: number;
3841
+ modelProxyName?: string;
3842
+ proxyModel?: ProxyMode;
3843
+ serviceRegionId?: string;
3844
+ proxyConfig?: ModelProxyMutableProps['proxyConfig'];
3845
+ executionRoleArn?: string;
3846
+ endpoint?: string;
3847
+ functionName?: string;
3848
+ modelProxyId?: string;
3849
+ createdAt?: string;
3850
+ lastUpdatedAt?: string;
3851
+ status?: ModelProxySystemProps['status'];
3852
+ /**
3853
+ * 获取客户端 / Get client
3854
+ *
3855
+ * @returns ModelClient 实例
3856
+ */
3857
+ private static getClient;
3858
+ /**
3859
+ * 创建模型代理 / Create model proxy
3860
+ *
3861
+ * @param params - 参数 / Parameters
3862
+ * @returns 创建的模型代理对象 / Created model proxy object
3863
+ */
3864
+ static create(params: {
3865
+ input: ModelProxyCreateInput;
3866
+ config?: Config;
3867
+ }): Promise<ModelProxy>;
3868
+ /**
3869
+ * 根据名称删除模型代理 / Delete model proxy by name
3870
+ *
3871
+ * @param params - 参数 / Parameters
3872
+ * @returns 删除的模型代理对象 / Deleted model proxy object
3873
+ */
3874
+ static delete(params: {
3875
+ name: string;
3876
+ config?: Config;
3877
+ }): Promise<ModelProxy>;
3878
+ /**
3879
+ * 根据名称更新模型代理 / Update model proxy by name
3880
+ *
3881
+ * @param params - 参数 / Parameters
3882
+ * @returns 更新后的模型代理对象 / Updated model proxy object
3883
+ */
3884
+ static update(params: {
3885
+ name: string;
3886
+ input: ModelProxyUpdateInput;
3887
+ config?: Config;
3888
+ }): Promise<ModelProxy>;
3889
+ /**
3890
+ * 根据名称获取模型代理 / Get model proxy by name
3891
+ *
3892
+ * @param params - 参数 / Parameters
3893
+ * @returns 模型代理对象 / Model proxy object
3894
+ */
3895
+ static get(params: {
3896
+ name: string;
3897
+ config?: Config;
3898
+ }): Promise<ModelProxy>;
3899
+ /**
3900
+ * 列出模型代理(分页)/ List model proxies (paginated)
3901
+ *
3902
+ * @param pageInput - 分页参数 / Pagination parameters
3903
+ * @param config - 配置 / Configuration
3904
+ * @param kwargs - 其他查询参数 / Other query parameters
3905
+ * @returns 模型代理列表 / Model proxy list
3906
+ */
3907
+ protected static listPage(pageInput: PageableInput, config?: Config, kwargs?: Partial<ModelProxyListInput>): Promise<ModelProxy[]>;
3908
+ /**
3909
+ * 列出所有模型代理 / List all model proxies
3910
+ *
3911
+ * @param options - 查询选项 / Query options
3912
+ * @param config - 配置 / Configuration
3913
+ * @returns 模型代理列表 / Model proxy list
3914
+ */
3915
+ static listAll(options?: {
3916
+ proxyMode?: string;
3917
+ status?: Status;
3918
+ config?: Config;
3919
+ }): Promise<ModelProxy[]>;
3920
+ /**
3921
+ * 更新模型代理 / Update model proxy
3922
+ *
3923
+ * @param input - 模型代理更新输入参数 / Model proxy update input parameters
3924
+ * @param config - 配置 / Configuration
3925
+ * @returns 更新后的模型代理对象 / Updated model proxy object
3926
+ */
3927
+ update: (params: {
3928
+ input: ModelProxyUpdateInput;
3929
+ config?: Config;
3930
+ }) => Promise<ModelProxy>;
3931
+ /**
3932
+ * 删除模型代理 / Delete model proxy
3933
+ *
3934
+ * @param params - 参数 / Parameters
3935
+ * @returns 删除的模型代理对象 / Deleted model proxy object
3936
+ */
3937
+ delete: (params?: {
3938
+ config?: Config;
3939
+ }) => Promise<ModelProxy>;
3940
+ /**
3941
+ * 刷新模型代理信息 / Refresh model proxy information
3942
+ *
3943
+ * @param params - 参数 / Parameters
3944
+ * @returns 刷新后的模型代理对象 / Refreshed model proxy object
3945
+ */
3946
+ get: (params?: {
3947
+ config?: Config;
3948
+ }) => Promise<ModelProxy>;
3949
+ /**
3950
+ * 获取模型信息 / Get model information
3951
+ *
3952
+ * @param params - 参数 / Parameters
3953
+ * @param params.config - 配置 / Configuration
3954
+ * @returns 模型基本信息 / Model base information
3955
+ */
3956
+ modelInfo: (params?: {
3957
+ config?: Config;
3958
+ }) => Promise<{
3959
+ apiKey: string;
3960
+ baseUrl: string;
3961
+ model?: string;
3962
+ headers?: Record<string, string>;
3963
+ }>;
3964
+ /**
3965
+ * 调用模型完成 / Call model completion
3966
+ *
3967
+ * @param params - 参数 / Parameters
3968
+ * @returns 完成结果 / Completion result
3969
+ */
3970
+ completions: (params: {
3971
+ messages: any[];
3972
+ model?: string;
3973
+ stream?: boolean;
3974
+ config?: Config;
3975
+ [key: string]: any;
3976
+ }) => Promise<ai.StreamTextResult<ai.ToolSet, any> | ai.GenerateTextResult<ai.ToolSet, any>>;
3977
+ /**
3978
+ * 获取响应 / Get responses
3979
+ *
3980
+ * @param params - 参数 / Parameters
3981
+ * @returns 响应结果 / Response result
3982
+ */
3983
+ responses: (params: {
3984
+ messages: any[];
3985
+ model?: string;
3986
+ stream?: boolean;
3987
+ config?: Config;
3988
+ [key: string]: any;
3989
+ }) => Promise<any>;
3990
+ /**
3991
+ * 等待模型代理就绪 / Wait until model proxy is ready
3992
+ *
3993
+ * @param options - 选项 / Options
3994
+ * @param config - 配置 / Configuration
3995
+ * @returns 模型代理对象 / Model proxy object
3996
+ */
3997
+ waitUntilReady: (options?: {
3998
+ timeoutSeconds?: number;
3999
+ intervalSeconds?: number;
4000
+ beforeCheck?: (proxy: ModelProxy) => void;
4001
+ }, config?: Config) => Promise<ModelProxy>;
4002
+ }
4003
+
4004
+ /**
4005
+ * 模型服务 / Model Service
4006
+ */
4007
+ declare class ModelService extends ResourceBase implements ModelServiceImmutableProps, ModelServiceMutableProps, ModelServiceSystemProps {
4008
+ modelInfoConfigs?: ModelServiceImmutableProps['modelInfoConfigs'];
4009
+ modelServiceName?: string;
4010
+ provider?: string;
4011
+ credentialName?: string;
4012
+ description?: string;
4013
+ networkConfiguration?: ModelServiceMutableProps['networkConfiguration'];
4014
+ tags?: string[];
4015
+ providerSettings?: ModelServiceMutableProps['providerSettings'];
4016
+ modelServiceId?: string;
4017
+ createdAt?: string;
4018
+ lastUpdatedAt?: string;
4019
+ status?: ModelServiceSystemProps['status'];
4020
+ modelType?: ModelServiceImmutableProps['modelType'];
4021
+ /**
4022
+ * 获取客户端 / Get client
4023
+ *
4024
+ * @returns ModelClient 实例
4025
+ */
4026
+ private static getClient;
4027
+ /**
4028
+ * 创建模型服务 / Create model service
4029
+ *
4030
+ * @param params - 参数 / Parameters
4031
+ * @returns 创建的模型服务对象 / Created model service object
4032
+ */
4033
+ static create(params: {
4034
+ input: ModelServiceCreateInput;
4035
+ config?: Config;
4036
+ }): Promise<ModelService>;
4037
+ /**
4038
+ * 根据名称删除模型服务 / Delete model service by name
4039
+ *
4040
+ * @param params - 参数 / Parameters
4041
+ * @returns 删除的模型服务对象 / Deleted model service object
4042
+ */
4043
+ static delete(params: {
4044
+ name: string;
4045
+ config?: Config;
4046
+ }): Promise<ModelService>;
4047
+ /**
4048
+ * 根据名称更新模型服务 / Update model service by name
4049
+ *
4050
+ * @param params - 参数 / Parameters
4051
+ * @returns 更新后的模型服务对象 / Updated model service object
4052
+ */
4053
+ static update(params: {
4054
+ name: string;
4055
+ input: ModelServiceUpdateInput;
4056
+ config?: Config;
4057
+ }): Promise<ModelService>;
4058
+ /**
4059
+ * 根据名称获取模型服务 / Get model service by name
4060
+ *
4061
+ * @param params - 参数 / Parameters
4062
+ * @returns 模型服务对象 / Model service object
4063
+ */
4064
+ static get(params: {
4065
+ name: string;
4066
+ config?: Config;
4067
+ }): Promise<ModelService>;
4068
+ /**
4069
+ * 列出模型服务(分页)/ List model services (paginated)
4070
+ *
4071
+ * @param pageInput - 分页参数 / Pagination parameters
4072
+ * @param config - 配置 / Configuration
4073
+ * @param kwargs - 其他查询参数 / Other query parameters
4074
+ * @returns 模型服务列表 / Model service list
4075
+ */
4076
+ protected static listPage(pageInput: PageableInput, config?: Config, kwargs?: Partial<ModelServiceListInput>): Promise<ModelService[]>;
4077
+ /**
4078
+ * 列出所有模型服务 / List all model services
4079
+ *
4080
+ * @param options - 查询选项 / Query options
4081
+ * @param config - 配置 / Configuration
4082
+ * @returns 模型服务列表 / Model service list
4083
+ */
4084
+ static listAll(options?: {
4085
+ modelType?: ModelType;
4086
+ provider?: string;
4087
+ config?: Config;
4088
+ }): Promise<ModelService[]>;
4089
+ /**
4090
+ * 更新模型服务 / Update model service
4091
+ *
4092
+ * @param params - 参数 / Parameters
4093
+ * @returns 更新后的模型服务对象 / Updated model service object
4094
+ */
4095
+ update: (params: {
4096
+ input: ModelServiceUpdateInput;
4097
+ config?: Config;
4098
+ }) => Promise<ModelService>;
4099
+ /**
4100
+ * 删除模型服务 / Delete model service
4101
+ *
4102
+ * @param config - 配置 / Configuration
4103
+ * @returns 删除的模型服务对象 / Deleted model service object
4104
+ */
4105
+ delete: (params?: {
4106
+ config?: Config;
4107
+ }) => Promise<ModelService>;
4108
+ /**
4109
+ * 刷新模型服务信息 / Refresh model service information
4110
+ *
4111
+ * @param config - 配置 / Configuration
4112
+ * @returns 刷新后的模型服务对象 / Refreshed model service object
4113
+ */
4114
+ get: (params?: {
4115
+ config?: Config;
4116
+ }) => Promise<ModelService>;
4117
+ /**
4118
+ * 获取模型信息 / Get model information
4119
+ *
4120
+ * @param params - 参数 / Parameters
4121
+ * @param params.config - 配置 / Configuration
4122
+ * @returns 模型基本信息 / Model base information
4123
+ */
4124
+ modelInfo: (params?: {
4125
+ config?: Config;
4126
+ }) => Promise<{
4127
+ apiKey: string;
4128
+ baseUrl: string;
4129
+ model?: string;
4130
+ headers?: Record<string, string>;
4131
+ provider?: string;
4132
+ }>;
4133
+ /**
4134
+ * 调用模型完成 / Call model completion
4135
+ *
4136
+ * @param messages - 消息列表 / Message list
4137
+ * @param model - 模型名称(可选)/ Model name (optional)
4138
+ * @param stream - 是否流式输出 / Whether to stream output
4139
+ * @param kwargs - 其他参数 / Other parameters
4140
+ * @returns 完成结果 / Completion result
4141
+ */
4142
+ completions: (params: {
4143
+ messages: any[];
4144
+ model?: string;
4145
+ stream?: boolean;
4146
+ config?: Config;
4147
+ [key: string]: any;
4148
+ }) => Promise<ai.StreamTextResult<ai.ToolSet, any> | ai.GenerateTextResult<ai.ToolSet, any>>;
4149
+ /**
4150
+ * 获取响应 / Get responses
4151
+ *
4152
+ * @param input - 输入 / Input
4153
+ * @param model - 模型名称(可选)/ Model name (optional)
4154
+ * @param stream - 是否流式输出 / Whether to stream output
4155
+ * @param kwargs - 其他参数 / Other parameters
4156
+ * @returns 响应结果 / Response result
4157
+ */
4158
+ responses: (params: {
4159
+ input: string | any;
4160
+ model?: string;
4161
+ stream?: boolean;
4162
+ config?: Config;
4163
+ [key: string]: any;
4164
+ }) => Promise<any>;
4165
+ /**
4166
+ * 等待模型服务就绪 / Wait until model service is ready
4167
+ *
4168
+ * @param options - 选项 / Options
4169
+ * @param config - 配置 / Configuration
4170
+ * @returns 模型服务对象 / Model service object
4171
+ */
4172
+ waitUntilReady: (options?: {
4173
+ timeoutSeconds?: number;
4174
+ intervalSeconds?: number;
4175
+ beforeCheck?: (service: ModelService) => void;
4176
+ }, config?: Config) => Promise<ModelService>;
4177
+ }
4178
+
4179
+ /**
4180
+ * Model Service 客户端 / Model Service Client
4181
+ *
4182
+ * 此模块提供模型服务和模型代理的客户端API。
4183
+ * This module provides the client API for model services and model proxies.
4184
+ */
4185
+
4186
+ /**
4187
+ * Model Service 客户端 / Model Service Client
4188
+ *
4189
+ * 提供模型服务和模型代理的创建、删除、更新和查询功能。
4190
+ * Provides create, delete, update and query functions for model services and model proxies.
4191
+ */
4192
+ declare class ModelClient {
4193
+ private controlApi;
4194
+ private config?;
4195
+ /**
4196
+ * 初始化客户端 / Initialize client
4197
+ *
4198
+ * @param config - 配置对象,可选 / Configuration object, optional
4199
+ */
4200
+ constructor(config?: Config);
4201
+ /**
4202
+ * 创建模型服务
4203
+ * Create model service
4204
+ *
4205
+ * @param params - 参数 / Parameters
4206
+ * @returns 创建的对象 / Created object
4207
+ */
4208
+ create: (params: {
4209
+ input: ModelServiceCreateInput | ModelProxyCreateInput;
4210
+ config?: Config;
4211
+ }) => Promise<ModelService | ModelProxy>;
4212
+ /**
4213
+ * 删除模型服务
4214
+ * Delete model service
4215
+ *
4216
+ * @param params - 参数 / Parameters
4217
+ * @returns 删除的对象 / Deleted object
4218
+ *
4219
+ * @throws ResourceNotExistError - 模型服务不存在 / Model service does not exist
4220
+ */
4221
+ delete: (params: {
4222
+ name: string;
4223
+ backendType?: BackendType;
4224
+ config?: Config;
4225
+ }) => Promise<ModelService | ModelProxy>;
4226
+ /**
4227
+ * 更新模型服务
4228
+ * Update model service
4229
+ *
4230
+ * @param params - 参数 / Parameters
4231
+ * @returns 更新后的模型服务对象 / Updated model service object
4232
+ *
4233
+ * @throws ResourceNotExistError - 模型服务不存在 / Model service does not exist
4234
+ */
4235
+ update: (params: {
4236
+ name: string;
4237
+ input: ModelServiceUpdateInput | ModelProxyUpdateInput;
4238
+ config?: Config;
4239
+ }) => Promise<ModelService | ModelProxy>;
4240
+ /**
4241
+ * 获取模型服务
4242
+ * Get model service
4243
+ *
4244
+ * @param params - 参数 / Parameters
4245
+ * @returns 模型服务对象 / Model service object
4246
+ *
4247
+ * @throws ResourceNotExistError - 模型服务不存在 / Model service does not exist
4248
+ */
4249
+ get: (params: {
4250
+ name: string;
4251
+ backendType?: BackendType;
4252
+ config?: Config;
4253
+ }) => Promise<ModelService | ModelProxy>;
4254
+ /**
4255
+ * 列出模型服务
4256
+ * List model services
4257
+ *
4258
+ * @param params - 参数 / Parameters
4259
+ * @returns 模型服务列表 / Model service list
4260
+ */
4261
+ list: (params: {
4262
+ input: ModelServiceListInput | ModelProxyListInput;
4263
+ config?: Config;
4264
+ }) => Promise<ModelService[] | ModelProxy[]>;
4265
+ }
4266
+
4267
+ /**
4268
+ * ToolSet Models
4269
+ *
4270
+ * ToolSet 相关的数据模型。
4271
+ * Data models for ToolSet.
4272
+ */
4273
+
4274
+ /**
4275
+ * ToolSet schema type
4276
+ */
4277
+ declare enum ToolSetSchemaType {
4278
+ OPENAPI = "OpenAPI",
4279
+ MCP = "MCP"
4280
+ }
4281
+ /**
4282
+ * ToolSet schema
4283
+ */
4284
+ interface ToolSetSchema {
4285
+ /**
4286
+ * Schema type (OpenAPI, MCP)
4287
+ */
4288
+ type?: ToolSetSchemaType;
4289
+ /**
4290
+ * Schema detail (URL or inline definition)
4291
+ */
4292
+ detail?: string;
4293
+ }
4294
+ /**
4295
+ * ToolSet authorization configuration
4296
+ */
4297
+ interface ToolSetAuthorization {
4298
+ /**
4299
+ * Authorization type
4300
+ */
4301
+ type?: string;
4302
+ /**
4303
+ * API Key header name
4304
+ */
4305
+ apiKeyHeaderName?: string;
4306
+ /**
4307
+ * API Key value
4308
+ */
4309
+ apiKeyValue?: string;
4310
+ }
4311
+ /**
4312
+ * ToolSet specification
4313
+ */
4314
+ interface ToolSetSpec {
4315
+ /**
4316
+ * Schema configuration
4317
+ */
4318
+ schema?: ToolSetSchema;
4319
+ /**
4320
+ * Authorization configuration
4321
+ */
4322
+ authConfig?: ToolSetAuthorization;
4323
+ }
4324
+ /**
4325
+ * MCP Tool meta
4326
+ */
4327
+ interface MCPToolMeta {
4328
+ /**
4329
+ * Tool name
4330
+ */
4331
+ name?: string;
4332
+ /**
4333
+ * Tool description
4334
+ */
4335
+ description?: string;
4336
+ }
4337
+ /**
4338
+ * ToolSet status outputs
4339
+ */
4340
+ interface ToolSetStatusOutputs {
4341
+ /**
4342
+ * MCP server configuration
4343
+ */
4344
+ mcpServerConfig?: {
4345
+ url?: string;
4346
+ transport?: string;
4347
+ };
4348
+ /**
4349
+ * Tools list
4350
+ */
4351
+ tools?: MCPToolMeta[];
4352
+ /**
4353
+ * URLs
4354
+ */
4355
+ urls?: {
4356
+ cdpUrl?: string;
4357
+ liveViewUrl?: string;
4358
+ streamUrl?: string;
4359
+ };
4360
+ }
4361
+ /**
4362
+ * ToolSet status
4363
+ */
4364
+ interface ToolSetStatus {
4365
+ /**
4366
+ * Current status
4367
+ */
4368
+ status?: Status;
4369
+ /**
4370
+ * Status reason
4371
+ */
4372
+ statusReason?: string;
4373
+ /**
4374
+ * Outputs
4375
+ */
4376
+ outputs?: ToolSetStatusOutputs;
4377
+ }
4378
+ /**
4379
+ * ToolSet data interface
4380
+ */
4381
+ interface ToolSetData {
4382
+ name?: string;
4383
+ uid?: string;
4384
+ kind?: string;
4385
+ description?: string;
4386
+ createdTime?: string;
4387
+ generation?: number;
4388
+ labels?: Record<string, string>;
4389
+ spec?: ToolSetSpec;
4390
+ status?: ToolSetStatus;
4391
+ }
4392
+ /**
4393
+ * ToolSet create input
4394
+ */
4395
+ interface ToolSetCreateInput {
4396
+ /**
4397
+ * ToolSet name (required)
4398
+ */
4399
+ name: string;
4400
+ /**
4401
+ * Description
4402
+ */
4403
+ description?: string;
4404
+ /**
4405
+ * Labels
4406
+ */
4407
+ labels?: Record<string, string>;
4408
+ /**
4409
+ * Spec configuration
4410
+ */
4411
+ spec?: ToolSetSpec;
4412
+ }
4413
+ /**
4414
+ * ToolSet update input
4415
+ */
4416
+ interface ToolSetUpdateInput {
4417
+ /**
4418
+ * Description
4419
+ */
4420
+ description?: string;
4421
+ /**
4422
+ * Labels
4423
+ */
4424
+ labels?: Record<string, string>;
4425
+ /**
4426
+ * Spec configuration
4427
+ */
4428
+ spec?: ToolSetSpec;
4429
+ }
4430
+ /**
4431
+ * ToolSet list input
4432
+ */
4433
+ interface ToolSetListInput {
4434
+ /**
4435
+ * Prefix filter
4436
+ */
4437
+ prefix?: string;
4438
+ /**
4439
+ * Page size
4440
+ */
4441
+ pageSize?: number;
4442
+ /**
4443
+ * Next token for pagination
4444
+ */
4445
+ nextToken?: string;
4446
+ /**
4447
+ * Labels filter
4448
+ */
4449
+ labels?: Record<string, string>;
4450
+ }
4451
+
4452
+ /**
4453
+ * ToolSet Resource Class
4454
+ *
4455
+ * ToolSet 资源类,用于管理 ToolSet 资源。
4456
+ * Resource class for managing ToolSet resources.
4457
+ */
4458
+
4459
+ /**
4460
+ * ToolSet resource class
4461
+ */
4462
+ declare class ToolSet implements ToolSetData {
4463
+ name?: string;
4464
+ uid?: string;
4465
+ kind?: string;
4466
+ description?: string;
4467
+ createdTime?: string;
4468
+ generation?: number;
4469
+ labels?: Record<string, string>;
4470
+ spec?: ToolSetSpec;
4471
+ status?: ToolSetStatus;
4472
+ private _config?;
4473
+ constructor(data?: Partial<ToolSetData>, config?: Config);
4474
+ /**
4475
+ * Get ToolSet name (alias for name)
4476
+ */
4477
+ get toolSetName(): string | undefined;
4478
+ /**
4479
+ * Get ToolSet ID (alias for uid)
4480
+ */
4481
+ get toolSetId(): string | undefined;
4482
+ /**
4483
+ * Check if the toolset is ready
4484
+ */
4485
+ get isReady(): boolean;
4486
+ /**
4487
+ * Create toolset from SDK response object
4488
+ */
4489
+ static fromInnerObject(obj: $Devs.Toolset, config?: Config): ToolSet;
4490
+ /**
4491
+ * Get DevS client
4492
+ */
4493
+ private static getClient;
4494
+ /**
4495
+ * Create a new ToolSet
4496
+ */
4497
+ static create(params: {
4498
+ input: ToolSetCreateInput;
4499
+ config?: Config;
4500
+ }): Promise<ToolSet>;
4501
+ /**
4502
+ * Delete a ToolSet by Name
4503
+ */
4504
+ static delete(params: {
4505
+ name: string;
4506
+ config?: Config;
4507
+ }): Promise<ToolSet>;
4508
+ /**
4509
+ * Get a ToolSet by Name
4510
+ */
4511
+ static get(params: {
4512
+ name: string;
4513
+ config?: Config;
4514
+ }): Promise<ToolSet>;
4515
+ /**
4516
+ * List ToolSets
4517
+ */
4518
+ static list(input?: ToolSetListInput, config?: Config): Promise<ToolSet[]>;
4519
+ /**
4520
+ * List all ToolSets with pagination
4521
+ */
4522
+ static listAll(options?: {
4523
+ prefix?: string;
4524
+ labels?: Record<string, string>;
4525
+ }, config?: Config): Promise<ToolSet[]>;
4526
+ /**
4527
+ * Update a ToolSet by Name
4528
+ */
4529
+ static update(params: {
4530
+ name: string;
4531
+ input: ToolSetUpdateInput;
4532
+ config?: Config;
4533
+ }): Promise<ToolSet>;
4534
+ /**
4535
+ * Handle API errors
4536
+ */
4537
+ private static handleError;
4538
+ /**
4539
+ * Delete this toolset
4540
+ */
4541
+ delete: (params?: {
4542
+ config?: Config;
4543
+ }) => Promise<ToolSet>;
4544
+ /**
4545
+ * Update this toolset
4546
+ */
4547
+ update: (params: {
4548
+ input: ToolSetUpdateInput;
4549
+ config?: Config;
4550
+ }) => Promise<ToolSet>;
4551
+ /**
4552
+ * Refresh this toolset's data
4553
+ */
4554
+ refresh: (params?: {
4555
+ config?: Config;
4556
+ }) => Promise<ToolSet>;
4557
+ /**
4558
+ * Wait until the toolset is ready
4559
+ */
4560
+ waitUntilReady: (options?: {
4561
+ timeoutSeconds?: number;
4562
+ intervalSeconds?: number;
4563
+ beforeCheck?: (toolset: ToolSet) => void;
4564
+ }, config?: Config) => Promise<ToolSet>;
4565
+ /**
4566
+ * Get toolset type
4567
+ * 获取工具集类型
4568
+ */
4569
+ type(): string | undefined;
4570
+ /**
4571
+ * List tools (async)
4572
+ * 异步获取工具列表,返回统一的 ToolInfo 列表
4573
+ */
4574
+ listToolsAsync: (params?: {
4575
+ config?: Config;
4576
+ }) => Promise<any[]>;
4577
+ /**
4578
+ * List tools (sync wrapper)
4579
+ * 同步获取工具列表,返回统一的 ToolInfo 列表
4580
+ */
4581
+ listTools: (config?: Config) => Promise<any[]>;
4582
+ /**
4583
+ * Call tool (async)
4584
+ * 异步调用工具,统一使用 ApiSet 实现
4585
+ */
4586
+ callToolAsync: (name: string, args?: Record<string, unknown>, config?: Config) => Promise<any>;
4587
+ /**
4588
+ * Call tool (sync wrapper)
4589
+ * 同步调用工具,统一使用 ApiSet 实现
4590
+ */
4591
+ callTool: (name: string, args?: Record<string, unknown>, config?: Config) => Promise<any>;
4592
+ /**
4593
+ * Convert ToolSet to unified ApiSet object
4594
+ * 将 ToolSet 转换为统一的 ApiSet 对象
4595
+ */
4596
+ toApiSet: (params?: {
4597
+ config?: Config;
4598
+ }) => Promise<any>;
4599
+ /**
4600
+ * Get OpenAPI authentication defaults
4601
+ * 获取 OpenAPI 认证默认值
4602
+ */
4603
+ private _getOpenAPIAuthDefaults;
4604
+ /**
4605
+ * Get OpenAPI base URL
4606
+ * 获取 OpenAPI 基础 URL
4607
+ */
4608
+ private _getOpenAPIBaseUrl;
4609
+ }
4610
+
4611
+ /**
4612
+ * ToolSet Client
4613
+ *
4614
+ * ToolSet 客户端,提供 ToolSet 的管理功能。
4615
+ * Client for managing ToolSet resources.
4616
+ */
4617
+
4618
+ /**
4619
+ * ToolSet Client
4620
+ *
4621
+ * 提供 ToolSet 的管理功能。
4622
+ */
4623
+ declare class ToolSetClient {
4624
+ private config?;
4625
+ constructor(config?: Config);
4626
+ /**
4627
+ * Create a ToolSet
4628
+ */
4629
+ createToolSet: (params: {
4630
+ input: ToolSetCreateInput;
4631
+ config?: Config;
4632
+ }) => Promise<ToolSet>;
4633
+ /**
4634
+ * Delete a ToolSet by name
4635
+ */
4636
+ deleteToolSet: (params: {
4637
+ name: string;
4638
+ config?: Config;
4639
+ }) => Promise<ToolSet>;
4640
+ /**
4641
+ * Get a ToolSet by name
4642
+ */
4643
+ getToolSet: (params: {
4644
+ name: string;
4645
+ config?: Config;
4646
+ }) => Promise<ToolSet>;
4647
+ /**
4648
+ * Update a ToolSet by name
4649
+ */
4650
+ updateToolSet: (params: {
4651
+ name: string;
4652
+ input: ToolSetUpdateInput;
4653
+ config?: Config;
4654
+ }) => Promise<ToolSet>;
4655
+ /**
4656
+ * List ToolSets
4657
+ */
4658
+ listToolSets: (params?: {
4659
+ input?: ToolSetListInput;
4660
+ config?: Config;
4661
+ }) => Promise<ToolSet[]>;
4662
+ /**
4663
+ * List all ToolSets with pagination
4664
+ */
4665
+ listAllToolSets: (params?: {
4666
+ options?: {
4667
+ prefix?: string;
4668
+ labels?: Record<string, string>;
4669
+ };
4670
+ config?: Config;
4671
+ }) => Promise<ToolSet[]>;
4672
+ }
4673
+
4674
+ /**
4675
+ * AgentRun SDK for Node.js
4676
+ *
4677
+ * AgentRun SDK 是阿里云 AgentRun 服务的 Node.js 客户端库。
4678
+ * Provides simple and easy-to-use APIs for managing AI Agent runtime environments,
4679
+ * model services, sandbox environments, etc.
4680
+ *
4681
+ * @packageDocumentation
4682
+ */
4683
+ declare const VERSION = "0.0.1";
4684
+
4685
+ 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 };