@agentrun/sdk 0.0.3 → 0.0.4

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