@agentrun/sdk 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -15
- package/dist/agent-runtime/api/index.cjs +907 -0
- package/dist/agent-runtime/api/index.cjs.map +1 -0
- package/dist/agent-runtime/api/index.d.cts +193 -0
- package/dist/agent-runtime/api/index.d.ts +193 -0
- package/dist/agent-runtime/api/index.js +882 -0
- package/dist/agent-runtime/api/index.js.map +1 -0
- package/dist/agent-runtime/index.cjs +2528 -0
- package/dist/agent-runtime/index.cjs.map +1 -0
- package/dist/agent-runtime/index.d.cts +778 -0
- package/dist/agent-runtime/index.d.ts +778 -0
- package/dist/agent-runtime/index.js +2496 -0
- package/dist/agent-runtime/index.js.map +1 -0
- package/dist/base-K1GMfJbH.d.ts +59 -0
- package/dist/base-xcWt5bua.d.cts +59 -0
- package/dist/client-DHXxjuo3.d.ts +58 -0
- package/dist/client-DPUTs69s.d.cts +58 -0
- package/dist/config-07gMelJP.d.cts +125 -0
- package/dist/config-07gMelJP.d.ts +125 -0
- package/dist/control-api-BWD4eua5.d.cts +27 -0
- package/dist/control-api-d-82Sgpr.d.ts +27 -0
- package/dist/credential/api/index.cjs +655 -0
- package/dist/credential/api/index.cjs.map +1 -0
- package/dist/credential/api/index.d.cts +93 -0
- package/dist/credential/api/index.d.ts +93 -0
- package/dist/credential/api/index.js +630 -0
- package/dist/credential/api/index.js.map +1 -0
- package/dist/credential/index.cjs +1286 -0
- package/dist/credential/index.cjs.map +1 -0
- package/dist/credential/index.d.cts +246 -0
- package/dist/credential/index.d.ts +246 -0
- package/dist/credential/index.js +1263 -0
- package/dist/credential/index.js.map +1 -0
- package/dist/data-api-B-4h9_Vf.d.ts +166 -0
- package/dist/data-api-DsG-8JRQ.d.cts +166 -0
- package/dist/exception-DM9H2Rpo.d.cts +68 -0
- package/dist/exception-DM9H2Rpo.d.ts +68 -0
- package/dist/index.cjs +29281 -1427
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -4485
- package/dist/index.d.ts +38 -4485
- package/dist/index.js +29259 -1426
- package/dist/index.js.map +1 -1
- package/dist/integration/builtin/index.cjs +9399 -0
- package/dist/integration/builtin/index.cjs.map +1 -0
- package/dist/integration/builtin/index.d.cts +692 -0
- package/dist/integration/builtin/index.d.ts +692 -0
- package/dist/integration/builtin/index.js +9363 -0
- package/dist/integration/builtin/index.js.map +1 -0
- package/dist/integration/index.cjs +9524 -0
- package/dist/integration/index.cjs.map +1 -0
- package/dist/integration/index.d.cts +98 -0
- package/dist/integration/index.d.ts +98 -0
- package/dist/integration/index.js +9481 -0
- package/dist/integration/index.js.map +1 -0
- package/dist/integration/mastra/index.cjs +9383 -0
- package/dist/integration/mastra/index.cjs.map +1 -0
- package/dist/integration/mastra/index.d.cts +186 -0
- package/dist/integration/mastra/index.d.ts +186 -0
- package/dist/integration/mastra/index.js +9348 -0
- package/dist/integration/mastra/index.js.map +1 -0
- package/dist/model/index.cjs +2392 -0
- package/dist/model/index.cjs.map +1 -0
- package/dist/model/index.d.cts +97 -0
- package/dist/model/index.d.ts +97 -0
- package/dist/model/index.js +2368 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model--I90nCqy.d.cts +66 -0
- package/dist/model--I90nCqy.d.ts +66 -0
- package/dist/model-BV7A6Trb.d.cts +512 -0
- package/dist/model-DGBy-o_L.d.cts +176 -0
- package/dist/model-DGBy-o_L.d.ts +176 -0
- package/dist/model-RiiiZnou.d.ts +512 -0
- package/dist/model-service-D-P2FZNi.d.ts +540 -0
- package/dist/model-service-VpzBb7rV.d.cts +540 -0
- package/dist/resource-CQovFUeh.d.cts +44 -0
- package/dist/resource-DnE_DEka.d.ts +44 -0
- package/dist/sandbox/index.cjs +3557 -0
- package/dist/sandbox/index.cjs.map +1 -0
- package/dist/sandbox/index.d.cts +1598 -0
- package/dist/sandbox/index.d.ts +1598 -0
- package/dist/sandbox/index.js +3532 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/server/adapter/index.cjs +24886 -0
- package/dist/server/adapter/index.cjs.map +1 -0
- package/dist/server/adapter/index.d.cts +68 -0
- package/dist/server/adapter/index.d.ts +68 -0
- package/dist/server/adapter/index.js +24883 -0
- package/dist/server/adapter/index.js.map +1 -0
- package/dist/server/core/index.cjs +313 -0
- package/dist/server/core/index.cjs.map +1 -0
- package/dist/server/core/index.d.cts +58 -0
- package/dist/server/core/index.d.ts +58 -0
- package/dist/server/core/index.js +309 -0
- package/dist/server/core/index.js.map +1 -0
- package/dist/server/index.cjs +25098 -0
- package/dist/server/index.cjs.map +1 -0
- package/dist/server/index.d.cts +73 -0
- package/dist/server/index.d.ts +73 -0
- package/dist/server/index.js +25067 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/protocol/index.cjs +1057 -0
- package/dist/server/protocol/index.cjs.map +1 -0
- package/dist/server/protocol/index.d.cts +135 -0
- package/dist/server/protocol/index.d.ts +135 -0
- package/dist/server/protocol/index.js +1053 -0
- package/dist/server/protocol/index.js.map +1 -0
- package/dist/tool-CG0LY-ov.d.cts +155 -0
- package/dist/tool-JJHam0ms.d.ts +155 -0
- package/dist/toolset/api/index.cjs +754 -0
- package/dist/toolset/api/index.cjs.map +1 -0
- package/dist/toolset/api/index.d.cts +207 -0
- package/dist/toolset/api/index.d.ts +207 -0
- package/dist/toolset/api/index.js +727 -0
- package/dist/toolset/api/index.js.map +1 -0
- package/dist/toolset/index.cjs +1945 -0
- package/dist/toolset/index.cjs.map +1 -0
- package/dist/toolset/index.d.cts +182 -0
- package/dist/toolset/index.d.ts +182 -0
- package/dist/toolset/index.js +1920 -0
- package/dist/toolset/index.js.map +1 -0
- package/dist/toolset-BYDvhwRp.d.cts +394 -0
- package/dist/toolset-CSRsJxCb.d.ts +394 -0
- package/dist/utils/index.cjs +994 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +30 -0
- package/dist/utils/index.d.ts +30 -0
- package/dist/utils/index.js +951 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +65 -13
|
@@ -0,0 +1,778 @@
|
|
|
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 { C as Config } from '../config-07gMelJP.js';
|
|
5
|
+
import { D as DataAPI } from '../data-api-B-4h9_Vf.js';
|
|
6
|
+
import { R as ResourceBase } from '../resource-DnE_DEka.js';
|
|
7
|
+
import { N as NetworkConfig, S as Status, P as PageableInput } from '../model--I90nCqy.js';
|
|
8
|
+
import { KeyOf } from 'zod/v4/core/util.cjs';
|
|
9
|
+
export { AgentRuntimeControlAPI } from './api/index.js';
|
|
10
|
+
import '@alicloud/agentrun20250910';
|
|
11
|
+
import '../control-api-d-82Sgpr.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Invoke arguments for OpenAI-compatible API
|
|
15
|
+
*/
|
|
16
|
+
interface InvokeArgs {
|
|
17
|
+
/** Chat messages */
|
|
18
|
+
messages: ChatCompletionMessageParam[];
|
|
19
|
+
/** Whether to stream the response */
|
|
20
|
+
stream?: boolean;
|
|
21
|
+
/** Optional config override */
|
|
22
|
+
config?: Config;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Agent Runtime Data API for invoking agent runtime through OpenAI-compatible API
|
|
26
|
+
*/
|
|
27
|
+
declare class AgentRuntimeDataAPI extends DataAPI {
|
|
28
|
+
constructor(agentRuntimeName: string, agentRuntimeEndpointName?: string, config?: Config);
|
|
29
|
+
/**
|
|
30
|
+
* Invoke agent runtime using OpenAI-compatible API
|
|
31
|
+
*/
|
|
32
|
+
invokeOpenai(args: InvokeArgs): Promise<(openai_core_streaming.Stream<openai_resources.ChatCompletionChunk> & {
|
|
33
|
+
_request_id?: string | null;
|
|
34
|
+
}) | (openai_resources.ChatCompletion & {
|
|
35
|
+
_request_id?: string | null;
|
|
36
|
+
})>;
|
|
37
|
+
private getConfig;
|
|
38
|
+
private getResourceName;
|
|
39
|
+
private getAuthHeaders;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Agent Runtime Data Models
|
|
44
|
+
*
|
|
45
|
+
* 此模块定义 Agent Runtime 相关的所有数据模型、枚举和输入输出对象。
|
|
46
|
+
* This module defines all data models, enums, and input/output objects related to Agent Runtime.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Agent Runtime artifact type
|
|
51
|
+
*/
|
|
52
|
+
type AgentRuntimeArtifact = 'Code' | 'Container';
|
|
53
|
+
declare const AgentRuntimeArtifact: {
|
|
54
|
+
CODE: AgentRuntimeArtifact;
|
|
55
|
+
CONTAINER: AgentRuntimeArtifact;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Agent Runtime language
|
|
59
|
+
*/
|
|
60
|
+
type AgentRuntimeLanguage = 'python3.10' | 'python3.12' | 'nodejs18' | 'nodejs20' | 'java8' | 'java11';
|
|
61
|
+
declare const AgentRuntimeLanguage: {
|
|
62
|
+
PYTHON310: AgentRuntimeLanguage;
|
|
63
|
+
PYTHON312: AgentRuntimeLanguage;
|
|
64
|
+
NODEJS18: AgentRuntimeLanguage;
|
|
65
|
+
NODEJS20: AgentRuntimeLanguage;
|
|
66
|
+
JAVA8: AgentRuntimeLanguage;
|
|
67
|
+
JAVA11: AgentRuntimeLanguage;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Agent Runtime protocol type
|
|
71
|
+
*/
|
|
72
|
+
type AgentRuntimeProtocolType = 'HTTP' | 'MCP';
|
|
73
|
+
declare const AgentRuntimeProtocolType: {
|
|
74
|
+
HTTP: AgentRuntimeProtocolType;
|
|
75
|
+
MCP: AgentRuntimeProtocolType;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Agent Runtime code configuration
|
|
79
|
+
*/
|
|
80
|
+
interface AgentRuntimeCode {
|
|
81
|
+
/** CRC-64 checksum of the code package */
|
|
82
|
+
checksum?: string;
|
|
83
|
+
/** Command to run in the runtime (e.g., ["python"]) */
|
|
84
|
+
command?: string[];
|
|
85
|
+
/** Programming language runtime */
|
|
86
|
+
language?: AgentRuntimeLanguage;
|
|
87
|
+
/** OSS bucket name */
|
|
88
|
+
ossBucketName?: string;
|
|
89
|
+
/** OSS object name */
|
|
90
|
+
ossObjectName?: string;
|
|
91
|
+
/** Base64 encoded ZIP file */
|
|
92
|
+
zipFile?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Create AgentRuntimeCode from a ZIP file
|
|
96
|
+
*/
|
|
97
|
+
declare function codeFromZipFile(language: AgentRuntimeLanguage, command: string[], zipFilePath: string): Promise<AgentRuntimeCode>;
|
|
98
|
+
/**
|
|
99
|
+
* Create AgentRuntimeCode from OSS
|
|
100
|
+
*/
|
|
101
|
+
declare function codeFromOss(language: AgentRuntimeLanguage, command: string[], bucket: string, object: string): AgentRuntimeCode;
|
|
102
|
+
/**
|
|
103
|
+
* Create AgentRuntimeCode from a file or directory
|
|
104
|
+
*/
|
|
105
|
+
declare function codeFromFile(language: AgentRuntimeLanguage, command: string[], filePath: string): Promise<AgentRuntimeCode>;
|
|
106
|
+
/**
|
|
107
|
+
* Agent Runtime container configuration
|
|
108
|
+
*/
|
|
109
|
+
interface AgentRuntimeContainer {
|
|
110
|
+
/** Command to run in the runtime */
|
|
111
|
+
command?: string[];
|
|
112
|
+
/** Container image address */
|
|
113
|
+
image?: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Agent Runtime health check configuration
|
|
117
|
+
*/
|
|
118
|
+
interface AgentRuntimeHealthCheckConfig {
|
|
119
|
+
/** Failure threshold before marking unhealthy */
|
|
120
|
+
failureThreshold?: number;
|
|
121
|
+
/** HTTP GET URL for health check */
|
|
122
|
+
httpGetUrl?: string;
|
|
123
|
+
/** Initial delay before first health check (seconds) */
|
|
124
|
+
initialDelaySeconds?: number;
|
|
125
|
+
/** Health check interval (seconds) */
|
|
126
|
+
periodSeconds?: number;
|
|
127
|
+
/** Success threshold before marking healthy */
|
|
128
|
+
successThreshold?: number;
|
|
129
|
+
/** Health check timeout (seconds) */
|
|
130
|
+
timeoutSeconds?: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Agent Runtime log configuration
|
|
134
|
+
*/
|
|
135
|
+
interface AgentRuntimeLogConfig {
|
|
136
|
+
/** SLS project name */
|
|
137
|
+
project: string;
|
|
138
|
+
/** SLS logstore name */
|
|
139
|
+
logstore: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Agent Runtime protocol configuration
|
|
143
|
+
*/
|
|
144
|
+
interface AgentRuntimeProtocolConfig {
|
|
145
|
+
/** Protocol type */
|
|
146
|
+
type?: AgentRuntimeProtocolType;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Endpoint routing weight configuration
|
|
150
|
+
*/
|
|
151
|
+
interface AgentRuntimeEndpointRoutingWeight {
|
|
152
|
+
/** Version identifier */
|
|
153
|
+
version?: string;
|
|
154
|
+
/** Weight value */
|
|
155
|
+
weight?: number;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Endpoint routing configuration
|
|
159
|
+
*/
|
|
160
|
+
interface AgentRuntimeEndpointRoutingConfig {
|
|
161
|
+
/** Version weights list */
|
|
162
|
+
versionWeights?: AgentRuntimeEndpointRoutingWeight[];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Agent Runtime create input
|
|
166
|
+
*/
|
|
167
|
+
interface AgentRuntimeCreateInput {
|
|
168
|
+
/** Agent Runtime name */
|
|
169
|
+
agentRuntimeName?: string;
|
|
170
|
+
/** Artifact type (Code or Container) */
|
|
171
|
+
artifactType?: AgentRuntimeArtifact;
|
|
172
|
+
/** Code configuration */
|
|
173
|
+
codeConfiguration?: AgentRuntimeCode;
|
|
174
|
+
/** Container configuration */
|
|
175
|
+
containerConfiguration?: AgentRuntimeContainer;
|
|
176
|
+
/** CPU cores */
|
|
177
|
+
cpu?: number;
|
|
178
|
+
/** Credential name */
|
|
179
|
+
credentialName?: string;
|
|
180
|
+
/** Description */
|
|
181
|
+
description?: string;
|
|
182
|
+
/** Environment variables */
|
|
183
|
+
environmentVariables?: Record<string, string>;
|
|
184
|
+
/** Execution role ARN */
|
|
185
|
+
executionRoleArn?: string;
|
|
186
|
+
/** Health check configuration */
|
|
187
|
+
healthCheckConfiguration?: AgentRuntimeHealthCheckConfig;
|
|
188
|
+
/** Log configuration */
|
|
189
|
+
logConfiguration?: AgentRuntimeLogConfig;
|
|
190
|
+
/** Memory in MB */
|
|
191
|
+
memory?: number;
|
|
192
|
+
/** Network configuration */
|
|
193
|
+
networkConfiguration?: NetworkConfig;
|
|
194
|
+
/** Port number */
|
|
195
|
+
port?: number;
|
|
196
|
+
/** Protocol configuration */
|
|
197
|
+
protocolConfiguration?: AgentRuntimeProtocolConfig;
|
|
198
|
+
/** Session concurrency limit per instance */
|
|
199
|
+
sessionConcurrencyLimitPerInstance?: number;
|
|
200
|
+
/** Session idle timeout in seconds */
|
|
201
|
+
sessionIdleTimeoutSeconds?: number;
|
|
202
|
+
/** Tags */
|
|
203
|
+
tags?: string[];
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Agent Runtime update input
|
|
207
|
+
*/
|
|
208
|
+
interface AgentRuntimeUpdateInput {
|
|
209
|
+
/** Agent Runtime name */
|
|
210
|
+
agentRuntimeName?: string;
|
|
211
|
+
/** Artifact type (Code or Container) */
|
|
212
|
+
artifactType?: AgentRuntimeArtifact;
|
|
213
|
+
/** Code configuration */
|
|
214
|
+
codeConfiguration?: AgentRuntimeCode;
|
|
215
|
+
/** Container configuration */
|
|
216
|
+
containerConfiguration?: AgentRuntimeContainer;
|
|
217
|
+
/** CPU cores */
|
|
218
|
+
cpu?: number;
|
|
219
|
+
/** Credential name */
|
|
220
|
+
credentialName?: string;
|
|
221
|
+
/** Description */
|
|
222
|
+
description?: string;
|
|
223
|
+
/** Environment variables */
|
|
224
|
+
environmentVariables?: Record<string, string>;
|
|
225
|
+
/** Execution role ARN */
|
|
226
|
+
executionRoleArn?: string;
|
|
227
|
+
/** Health check configuration */
|
|
228
|
+
healthCheckConfiguration?: AgentRuntimeHealthCheckConfig;
|
|
229
|
+
/** Log configuration */
|
|
230
|
+
logConfiguration?: AgentRuntimeLogConfig;
|
|
231
|
+
/** Memory in MB */
|
|
232
|
+
memory?: number;
|
|
233
|
+
/** Network configuration */
|
|
234
|
+
networkConfiguration?: NetworkConfig;
|
|
235
|
+
/** Port number */
|
|
236
|
+
port?: number;
|
|
237
|
+
/** Protocol configuration */
|
|
238
|
+
protocolConfiguration?: AgentRuntimeProtocolConfig;
|
|
239
|
+
/** Session concurrency limit per instance */
|
|
240
|
+
sessionConcurrencyLimitPerInstance?: number;
|
|
241
|
+
/** Session idle timeout in seconds */
|
|
242
|
+
sessionIdleTimeoutSeconds?: number;
|
|
243
|
+
/** Tags */
|
|
244
|
+
tags?: string[];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Agent Runtime list input
|
|
248
|
+
*/
|
|
249
|
+
interface AgentRuntimeListInput extends PageableInput {
|
|
250
|
+
/** Filter by name */
|
|
251
|
+
agentRuntimeName?: string;
|
|
252
|
+
/** Filter by tags (comma separated) */
|
|
253
|
+
tags?: string;
|
|
254
|
+
/** Search mode */
|
|
255
|
+
searchMode?: string;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Agent Runtime endpoint create input
|
|
259
|
+
*/
|
|
260
|
+
interface AgentRuntimeEndpointCreateInput {
|
|
261
|
+
/** Endpoint name */
|
|
262
|
+
agentRuntimeEndpointName?: string;
|
|
263
|
+
/** Description */
|
|
264
|
+
description?: string;
|
|
265
|
+
/** Routing configuration */
|
|
266
|
+
routingConfiguration?: AgentRuntimeEndpointRoutingConfig;
|
|
267
|
+
/** Tags */
|
|
268
|
+
tags?: string[];
|
|
269
|
+
/** Target version */
|
|
270
|
+
targetVersion?: string;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Agent Runtime endpoint update input
|
|
274
|
+
*/
|
|
275
|
+
interface AgentRuntimeEndpointUpdateInput {
|
|
276
|
+
/** Endpoint name */
|
|
277
|
+
agentRuntimeEndpointName?: string;
|
|
278
|
+
/** Description */
|
|
279
|
+
description?: string;
|
|
280
|
+
/** Routing configuration */
|
|
281
|
+
routingConfiguration?: AgentRuntimeEndpointRoutingConfig;
|
|
282
|
+
/** Tags */
|
|
283
|
+
tags?: string[];
|
|
284
|
+
/** Target version */
|
|
285
|
+
targetVersion?: string;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Agent Runtime endpoint list input
|
|
289
|
+
*/
|
|
290
|
+
interface AgentRuntimeEndpointListInput extends PageableInput {
|
|
291
|
+
/** Filter by endpoint name */
|
|
292
|
+
endpointName?: string;
|
|
293
|
+
/** Search mode */
|
|
294
|
+
searchMode?: string;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Agent Runtime version
|
|
298
|
+
*/
|
|
299
|
+
interface AgentRuntimeVersion {
|
|
300
|
+
/** Agent Runtime ARN */
|
|
301
|
+
agentRuntimeArn?: string;
|
|
302
|
+
/** Agent Runtime ID */
|
|
303
|
+
agentRuntimeId?: string;
|
|
304
|
+
/** Agent Runtime name */
|
|
305
|
+
agentRuntimeName?: string;
|
|
306
|
+
/** Version number */
|
|
307
|
+
agentRuntimeVersion?: string;
|
|
308
|
+
/** Version description */
|
|
309
|
+
description?: string;
|
|
310
|
+
/** Last update timestamp */
|
|
311
|
+
lastUpdatedAt?: string;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Agent Runtime version list input
|
|
315
|
+
*/
|
|
316
|
+
interface AgentRuntimeVersionListInput extends PageableInput {
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Agent Runtime data (internal representation from API)
|
|
320
|
+
*/
|
|
321
|
+
interface AgentRuntimeData {
|
|
322
|
+
agentRuntimeArn?: string;
|
|
323
|
+
agentRuntimeId?: string;
|
|
324
|
+
agentRuntimeName?: string;
|
|
325
|
+
agentRuntimeVersion?: string;
|
|
326
|
+
artifactType?: string;
|
|
327
|
+
codeConfiguration?: AgentRuntimeCode;
|
|
328
|
+
containerConfiguration?: AgentRuntimeContainer;
|
|
329
|
+
cpu?: number;
|
|
330
|
+
createdAt?: string;
|
|
331
|
+
credentialName?: string;
|
|
332
|
+
description?: string;
|
|
333
|
+
environmentVariables?: Record<string, string>;
|
|
334
|
+
executionRoleArn?: string;
|
|
335
|
+
healthCheckConfiguration?: AgentRuntimeHealthCheckConfig;
|
|
336
|
+
lastUpdatedAt?: string;
|
|
337
|
+
logConfiguration?: AgentRuntimeLogConfig;
|
|
338
|
+
memory?: number;
|
|
339
|
+
networkConfiguration?: NetworkConfig;
|
|
340
|
+
port?: number;
|
|
341
|
+
protocolConfiguration?: AgentRuntimeProtocolConfig;
|
|
342
|
+
resourceName?: string;
|
|
343
|
+
sessionConcurrencyLimitPerInstance?: number;
|
|
344
|
+
sessionIdleTimeoutSeconds?: number;
|
|
345
|
+
status?: Status;
|
|
346
|
+
statusReason?: string;
|
|
347
|
+
tags?: string[];
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Agent Runtime endpoint data (internal representation from API)
|
|
351
|
+
*/
|
|
352
|
+
interface AgentRuntimeEndpointData {
|
|
353
|
+
agentRuntimeEndpointArn?: string;
|
|
354
|
+
agentRuntimeEndpointId?: string;
|
|
355
|
+
agentRuntimeEndpointName?: string;
|
|
356
|
+
agentRuntimeId?: string;
|
|
357
|
+
description?: string;
|
|
358
|
+
endpointPublicUrl?: string;
|
|
359
|
+
resourceName?: string;
|
|
360
|
+
routingConfiguration?: AgentRuntimeEndpointRoutingConfig;
|
|
361
|
+
status?: Status;
|
|
362
|
+
statusReason?: string;
|
|
363
|
+
tags?: string[];
|
|
364
|
+
targetVersion?: string;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Agent Runtime Endpoint resource class
|
|
369
|
+
*/
|
|
370
|
+
declare class AgentRuntimeEndpoint extends ResourceBase implements AgentRuntimeEndpointData {
|
|
371
|
+
agentRuntimeEndpointArn?: string;
|
|
372
|
+
agentRuntimeEndpointId?: string;
|
|
373
|
+
agentRuntimeEndpointName?: string;
|
|
374
|
+
agentRuntimeId?: string;
|
|
375
|
+
description?: string;
|
|
376
|
+
endpointPublicUrl?: string;
|
|
377
|
+
resourceName?: string;
|
|
378
|
+
routingConfiguration?: AgentRuntimeEndpointRoutingConfig;
|
|
379
|
+
status?: Status;
|
|
380
|
+
statusReason?: string;
|
|
381
|
+
tags?: string[];
|
|
382
|
+
targetVersion?: string;
|
|
383
|
+
protected _config?: Config;
|
|
384
|
+
private _dataApi?;
|
|
385
|
+
private _agentRuntimeName?;
|
|
386
|
+
constructor(data?: any, config?: Config);
|
|
387
|
+
uniqIdCallback: () => string | undefined;
|
|
388
|
+
private static getClient;
|
|
389
|
+
/**
|
|
390
|
+
* Create an endpoint by Agent Runtime ID
|
|
391
|
+
*/
|
|
392
|
+
static create(params: {
|
|
393
|
+
agentRuntimeId: string;
|
|
394
|
+
input: AgentRuntimeEndpointCreateInput;
|
|
395
|
+
config?: Config;
|
|
396
|
+
}): Promise<AgentRuntimeEndpoint>;
|
|
397
|
+
/**
|
|
398
|
+
* Delete an endpoint by ID
|
|
399
|
+
*/
|
|
400
|
+
static delete(params: {
|
|
401
|
+
agentRuntimeId: string;
|
|
402
|
+
endpointId: string;
|
|
403
|
+
config?: Config;
|
|
404
|
+
}): Promise<AgentRuntimeEndpoint>;
|
|
405
|
+
/**
|
|
406
|
+
* Update an endpoint by ID
|
|
407
|
+
*/
|
|
408
|
+
static update(params: {
|
|
409
|
+
agentRuntimeId: string;
|
|
410
|
+
endpointId: string;
|
|
411
|
+
input: AgentRuntimeEndpointUpdateInput;
|
|
412
|
+
config?: Config;
|
|
413
|
+
}): Promise<AgentRuntimeEndpoint>;
|
|
414
|
+
/**
|
|
415
|
+
* Get an endpoint by ID
|
|
416
|
+
*/
|
|
417
|
+
static get(params: {
|
|
418
|
+
agentRuntimeId: string;
|
|
419
|
+
endpointId: string;
|
|
420
|
+
config?: Config;
|
|
421
|
+
}): Promise<AgentRuntimeEndpoint>;
|
|
422
|
+
/**
|
|
423
|
+
* List endpoints by Agent Runtime ID
|
|
424
|
+
*/
|
|
425
|
+
static list(params: {
|
|
426
|
+
agentRuntimeId: string;
|
|
427
|
+
input?: AgentRuntimeEndpointListInput;
|
|
428
|
+
config?: Config;
|
|
429
|
+
}): Promise<AgentRuntimeEndpoint[]>;
|
|
430
|
+
static listAll: (params: {
|
|
431
|
+
agentRuntimeId: string;
|
|
432
|
+
config?: Config;
|
|
433
|
+
} & Omit<AgentRuntimeEndpointListInput, KeyOf<PageableInput>>) => Promise<any[]>;
|
|
434
|
+
get: (params?: {
|
|
435
|
+
config?: Config;
|
|
436
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
437
|
+
/**
|
|
438
|
+
* Delete this endpoint
|
|
439
|
+
*/
|
|
440
|
+
delete: (params?: {
|
|
441
|
+
config?: Config;
|
|
442
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
443
|
+
/**
|
|
444
|
+
* Update this endpoint
|
|
445
|
+
*/
|
|
446
|
+
update: (params: {
|
|
447
|
+
input: AgentRuntimeEndpointUpdateInput;
|
|
448
|
+
config?: Config;
|
|
449
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
450
|
+
/**
|
|
451
|
+
* Refresh this endpoint's data
|
|
452
|
+
*/
|
|
453
|
+
refresh: (params?: {
|
|
454
|
+
config?: Config;
|
|
455
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
456
|
+
/**
|
|
457
|
+
* Invoke agent runtime using OpenAI-compatible API through this endpoint
|
|
458
|
+
*
|
|
459
|
+
* This method provides an OpenAI-compatible interface to invoke the agent runtime
|
|
460
|
+
* through this specific endpoint.
|
|
461
|
+
*
|
|
462
|
+
* @param args - Invocation arguments
|
|
463
|
+
* @returns OpenAI chat completion response
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
* ```typescript
|
|
467
|
+
* const endpoint = await AgentRuntimeEndpoint.get({
|
|
468
|
+
* agentRuntimeId: "runtime-id",
|
|
469
|
+
* endpointId: "endpoint-id"
|
|
470
|
+
* });
|
|
471
|
+
* const response = await endpoint.invokeOpenai({
|
|
472
|
+
* messages: [{ role: "user", content: "Hello" }],
|
|
473
|
+
* stream: false
|
|
474
|
+
* });
|
|
475
|
+
* ```
|
|
476
|
+
*/
|
|
477
|
+
invokeOpenai: (args: InvokeArgs) => Promise<(openai_core_streaming.Stream<openai_resources.ChatCompletionChunk> & {
|
|
478
|
+
_request_id?: string | null;
|
|
479
|
+
}) | (openai_resources.ChatCompletion & {
|
|
480
|
+
_request_id?: string | null;
|
|
481
|
+
})>;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Agent Runtime resource class
|
|
486
|
+
*/
|
|
487
|
+
declare class AgentRuntime extends ResourceBase implements AgentRuntimeData {
|
|
488
|
+
agentRuntimeArn?: string;
|
|
489
|
+
agentRuntimeId?: string;
|
|
490
|
+
agentRuntimeName?: string;
|
|
491
|
+
agentRuntimeVersion?: string;
|
|
492
|
+
artifactType?: string;
|
|
493
|
+
codeConfiguration?: AgentRuntimeCode;
|
|
494
|
+
containerConfiguration?: AgentRuntimeContainer;
|
|
495
|
+
cpu?: number;
|
|
496
|
+
createdAt?: string;
|
|
497
|
+
credentialName?: string;
|
|
498
|
+
description?: string;
|
|
499
|
+
environmentVariables?: Record<string, string>;
|
|
500
|
+
executionRoleArn?: string;
|
|
501
|
+
healthCheckConfiguration?: AgentRuntimeHealthCheckConfig;
|
|
502
|
+
lastUpdatedAt?: string;
|
|
503
|
+
logConfiguration?: AgentRuntimeLogConfig;
|
|
504
|
+
memory?: number;
|
|
505
|
+
networkConfiguration?: NetworkConfig;
|
|
506
|
+
port?: number;
|
|
507
|
+
protocolConfiguration?: AgentRuntimeProtocolConfig;
|
|
508
|
+
resourceName?: string;
|
|
509
|
+
sessionConcurrencyLimitPerInstance?: number;
|
|
510
|
+
sessionIdleTimeoutSeconds?: number;
|
|
511
|
+
status?: Status;
|
|
512
|
+
statusReason?: string;
|
|
513
|
+
tags?: string[];
|
|
514
|
+
protected _config?: Config;
|
|
515
|
+
private _dataApiCache;
|
|
516
|
+
constructor(data?: any, config?: Config);
|
|
517
|
+
uniqIdCallback: () => string | undefined;
|
|
518
|
+
private static getClient;
|
|
519
|
+
/**
|
|
520
|
+
* Create a new Agent Runtime
|
|
521
|
+
*/
|
|
522
|
+
static create(params: {
|
|
523
|
+
input: AgentRuntimeCreateInput;
|
|
524
|
+
config?: Config;
|
|
525
|
+
}): Promise<AgentRuntime>;
|
|
526
|
+
/**
|
|
527
|
+
* Delete an Agent Runtime by ID
|
|
528
|
+
*/
|
|
529
|
+
static delete(params: {
|
|
530
|
+
id: string;
|
|
531
|
+
config?: Config;
|
|
532
|
+
}): Promise<AgentRuntime>;
|
|
533
|
+
/**
|
|
534
|
+
* Update an Agent Runtime by ID
|
|
535
|
+
*/
|
|
536
|
+
static update(params: {
|
|
537
|
+
id: string;
|
|
538
|
+
input: AgentRuntimeUpdateInput;
|
|
539
|
+
config?: Config;
|
|
540
|
+
}): Promise<AgentRuntime>;
|
|
541
|
+
/**
|
|
542
|
+
* Get an Agent Runtime by ID
|
|
543
|
+
*/
|
|
544
|
+
static get(params: {
|
|
545
|
+
id: string;
|
|
546
|
+
config?: Config;
|
|
547
|
+
}): Promise<AgentRuntime>;
|
|
548
|
+
/**
|
|
549
|
+
* List Agent Runtimes
|
|
550
|
+
*/
|
|
551
|
+
static list(params?: {
|
|
552
|
+
input?: AgentRuntimeListInput;
|
|
553
|
+
config?: Config;
|
|
554
|
+
}): Promise<AgentRuntime[]>;
|
|
555
|
+
static listAll: (params?: (Omit<AgentRuntimeListInput, "pageNumber" | "pageSize"> & {
|
|
556
|
+
config?: Config;
|
|
557
|
+
}) | undefined) => Promise<any[]>;
|
|
558
|
+
/**
|
|
559
|
+
* List Agent Runtime versions by ID
|
|
560
|
+
*/
|
|
561
|
+
static listVersionsById(params: {
|
|
562
|
+
agentRuntimeId: string;
|
|
563
|
+
input?: AgentRuntimeVersionListInput;
|
|
564
|
+
config?: Config;
|
|
565
|
+
}): Promise<AgentRuntimeVersion[]>;
|
|
566
|
+
/**
|
|
567
|
+
* Delete this runtime
|
|
568
|
+
*/
|
|
569
|
+
delete: (params?: {
|
|
570
|
+
config?: Config;
|
|
571
|
+
}) => Promise<AgentRuntime>;
|
|
572
|
+
/**
|
|
573
|
+
* Update this runtime
|
|
574
|
+
*/
|
|
575
|
+
update: (params: {
|
|
576
|
+
input: AgentRuntimeUpdateInput;
|
|
577
|
+
config?: Config;
|
|
578
|
+
}) => Promise<AgentRuntime>;
|
|
579
|
+
/**
|
|
580
|
+
* Refresh this runtime's data
|
|
581
|
+
*/
|
|
582
|
+
get: (params?: {
|
|
583
|
+
config?: Config;
|
|
584
|
+
}) => Promise<AgentRuntime>;
|
|
585
|
+
/**
|
|
586
|
+
* Create an endpoint for this runtime
|
|
587
|
+
*/
|
|
588
|
+
createEndpoint: (params: {
|
|
589
|
+
input: AgentRuntimeEndpointCreateInput;
|
|
590
|
+
config?: Config;
|
|
591
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
592
|
+
/**
|
|
593
|
+
* Delete an endpoint from this runtime
|
|
594
|
+
*/
|
|
595
|
+
deleteEndpoint: (params: {
|
|
596
|
+
endpointId: string;
|
|
597
|
+
config?: Config;
|
|
598
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
599
|
+
/**
|
|
600
|
+
* Update an endpoint of this runtime
|
|
601
|
+
*/
|
|
602
|
+
updateEndpoint: (params: {
|
|
603
|
+
endpointId: string;
|
|
604
|
+
input: AgentRuntimeEndpointUpdateInput;
|
|
605
|
+
config?: Config;
|
|
606
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
607
|
+
/**
|
|
608
|
+
* Get an endpoint of this runtime
|
|
609
|
+
*/
|
|
610
|
+
getEndpoint: (params: {
|
|
611
|
+
endpointId: string;
|
|
612
|
+
config?: Config;
|
|
613
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
614
|
+
/**
|
|
615
|
+
* List endpoints of this runtime
|
|
616
|
+
*/
|
|
617
|
+
listEndpoints: (params?: {
|
|
618
|
+
config?: Config;
|
|
619
|
+
}) => Promise<AgentRuntimeEndpoint[]>;
|
|
620
|
+
/**
|
|
621
|
+
* List versions of this runtime
|
|
622
|
+
*/
|
|
623
|
+
listVersions: (params?: {
|
|
624
|
+
config?: Config;
|
|
625
|
+
}) => Promise<AgentRuntimeVersion[]>;
|
|
626
|
+
/**
|
|
627
|
+
* Invoke agent runtime using OpenAI-compatible API
|
|
628
|
+
*
|
|
629
|
+
* This method provides an OpenAI-compatible interface to invoke the agent runtime.
|
|
630
|
+
* It creates a Data API client and forwards the invocation request.
|
|
631
|
+
*
|
|
632
|
+
* @param args - Invocation arguments
|
|
633
|
+
* @returns OpenAI chat completion response
|
|
634
|
+
*
|
|
635
|
+
* @example
|
|
636
|
+
* ```typescript
|
|
637
|
+
* const runtime = await AgentRuntime.get({ id: "runtime-id" });
|
|
638
|
+
* const response = await runtime.invokeOpenai({
|
|
639
|
+
* agentRuntimeEndpointName: "Default",
|
|
640
|
+
* messages: [{ role: "user", content: "Hello" }],
|
|
641
|
+
* stream: false
|
|
642
|
+
* });
|
|
643
|
+
* ```
|
|
644
|
+
*/
|
|
645
|
+
invokeOpenai: (args: InvokeArgs & {
|
|
646
|
+
agentRuntimeEndpointName?: string;
|
|
647
|
+
}) => Promise<(openai_core_streaming.Stream<openai_resources.ChatCompletionChunk> & {
|
|
648
|
+
_request_id?: string | null;
|
|
649
|
+
}) | (openai_resources.ChatCompletion & {
|
|
650
|
+
_request_id?: string | null;
|
|
651
|
+
})>;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Agent Runtime Client
|
|
656
|
+
*
|
|
657
|
+
* 提供 Agent Runtime 的创建、删除、更新、查询和端点管理功能。
|
|
658
|
+
* Provides create, delete, update, query and endpoint management functions for Agent Runtime.
|
|
659
|
+
*/
|
|
660
|
+
declare class AgentRuntimeClient {
|
|
661
|
+
private config?;
|
|
662
|
+
private controlApi;
|
|
663
|
+
constructor(config?: Config);
|
|
664
|
+
/**
|
|
665
|
+
* Create an Agent Runtime
|
|
666
|
+
*/
|
|
667
|
+
create: (params: {
|
|
668
|
+
input: AgentRuntimeCreateInput;
|
|
669
|
+
config?: Config;
|
|
670
|
+
}) => Promise<AgentRuntime>;
|
|
671
|
+
/**
|
|
672
|
+
* Delete an Agent Runtime
|
|
673
|
+
*/
|
|
674
|
+
delete: (params: {
|
|
675
|
+
id: string;
|
|
676
|
+
config?: Config;
|
|
677
|
+
}) => Promise<AgentRuntime>;
|
|
678
|
+
/**
|
|
679
|
+
* Update an Agent Runtime
|
|
680
|
+
*/
|
|
681
|
+
update: (params: {
|
|
682
|
+
id: string;
|
|
683
|
+
input: AgentRuntimeUpdateInput;
|
|
684
|
+
config?: Config;
|
|
685
|
+
}) => Promise<AgentRuntime>;
|
|
686
|
+
/**
|
|
687
|
+
* Get an Agent Runtime
|
|
688
|
+
*/
|
|
689
|
+
get: (params: {
|
|
690
|
+
id: string;
|
|
691
|
+
config?: Config;
|
|
692
|
+
}) => Promise<AgentRuntime>;
|
|
693
|
+
/**
|
|
694
|
+
* List Agent Runtimes
|
|
695
|
+
*/
|
|
696
|
+
list: (params?: {
|
|
697
|
+
input?: AgentRuntimeListInput;
|
|
698
|
+
config?: Config;
|
|
699
|
+
}) => Promise<AgentRuntime[]>;
|
|
700
|
+
/**
|
|
701
|
+
* Create an endpoint for an Agent Runtime
|
|
702
|
+
*/
|
|
703
|
+
createEndpoint: (params: {
|
|
704
|
+
agentRuntimeId: string;
|
|
705
|
+
input: AgentRuntimeEndpointCreateInput;
|
|
706
|
+
config?: Config;
|
|
707
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
708
|
+
/**
|
|
709
|
+
* Delete an endpoint
|
|
710
|
+
*/
|
|
711
|
+
deleteEndpoint: (params: {
|
|
712
|
+
agentRuntimeId: string;
|
|
713
|
+
endpointId: string;
|
|
714
|
+
config?: Config;
|
|
715
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
716
|
+
/**
|
|
717
|
+
* Update an endpoint
|
|
718
|
+
*/
|
|
719
|
+
updateEndpoint: (params: {
|
|
720
|
+
agentRuntimeId: string;
|
|
721
|
+
endpointId: string;
|
|
722
|
+
input: AgentRuntimeEndpointUpdateInput;
|
|
723
|
+
config?: Config;
|
|
724
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
725
|
+
/**
|
|
726
|
+
* Get an endpoint
|
|
727
|
+
*/
|
|
728
|
+
getEndpoint: (params: {
|
|
729
|
+
agentRuntimeId: string;
|
|
730
|
+
endpointId: string;
|
|
731
|
+
config?: Config;
|
|
732
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
733
|
+
/**
|
|
734
|
+
* List endpoints for an Agent Runtime
|
|
735
|
+
*/
|
|
736
|
+
listEndpoints: (params: {
|
|
737
|
+
agentRuntimeId: string;
|
|
738
|
+
input?: AgentRuntimeEndpointListInput;
|
|
739
|
+
config?: Config;
|
|
740
|
+
}) => Promise<AgentRuntimeEndpoint[]>;
|
|
741
|
+
/**
|
|
742
|
+
* List versions for an Agent Runtime
|
|
743
|
+
*/
|
|
744
|
+
listVersions: (params: {
|
|
745
|
+
agentRuntimeId: string;
|
|
746
|
+
input?: AgentRuntimeVersionListInput;
|
|
747
|
+
config?: Config;
|
|
748
|
+
}) => Promise<AgentRuntimeVersion[]>;
|
|
749
|
+
/**
|
|
750
|
+
* Invoke agent runtime using OpenAI-compatible API
|
|
751
|
+
*
|
|
752
|
+
* This method provides an OpenAI-compatible interface to invoke the agent runtime.
|
|
753
|
+
*
|
|
754
|
+
* @param params - Parameters including agent runtime name, endpoint name, and invocation args
|
|
755
|
+
* @returns OpenAI chat completion response
|
|
756
|
+
*
|
|
757
|
+
* @example
|
|
758
|
+
* ```typescript
|
|
759
|
+
* const client = new AgentRuntimeClient();
|
|
760
|
+
* const response = await client.invokeOpenai({
|
|
761
|
+
* agentRuntimeName: "my-runtime",
|
|
762
|
+
* agentRuntimeEndpointName: "Default",
|
|
763
|
+
* messages: [{ role: "user", content: "Hello" }],
|
|
764
|
+
* stream: false
|
|
765
|
+
* });
|
|
766
|
+
* ```
|
|
767
|
+
*/
|
|
768
|
+
invokeOpenai: (params: {
|
|
769
|
+
agentRuntimeName: string;
|
|
770
|
+
agentRuntimeEndpointName?: string;
|
|
771
|
+
} & InvokeArgs) => Promise<(openai_core_streaming.Stream<openai_resources.ChatCompletionChunk> & {
|
|
772
|
+
_request_id?: string | null;
|
|
773
|
+
}) | (openai_resources.ChatCompletion & {
|
|
774
|
+
_request_id?: string | null;
|
|
775
|
+
})>;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
export { AgentRuntime, AgentRuntimeArtifact, AgentRuntimeClient, type AgentRuntimeCode, type AgentRuntimeContainer, type AgentRuntimeCreateInput, type AgentRuntimeData, AgentRuntimeDataAPI, AgentRuntimeEndpoint, type AgentRuntimeEndpointCreateInput, type AgentRuntimeEndpointData, type AgentRuntimeEndpointListInput, type AgentRuntimeEndpointRoutingConfig, type AgentRuntimeEndpointRoutingWeight, type AgentRuntimeEndpointUpdateInput, type AgentRuntimeHealthCheckConfig, AgentRuntimeLanguage, type AgentRuntimeListInput, type AgentRuntimeLogConfig, type AgentRuntimeProtocolConfig, AgentRuntimeProtocolType, type AgentRuntimeUpdateInput, type AgentRuntimeVersion, type AgentRuntimeVersionListInput, type InvokeArgs, codeFromFile, codeFromOss, codeFromZipFile };
|