@agentrun/sdk 0.0.1-test.21dd786 → 0.0.1-test.5b55888

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