@agentrun/sdk 0.0.1-test.21dd786
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/LICENSE +201 -0
- package/README.md +225 -0
- package/dist/add.d.ts +2 -0
- package/dist/add.d.ts.map +1 -0
- package/dist/agent-runtime/api/control.d.ts +190 -0
- package/dist/agent-runtime/api/control.d.ts.map +1 -0
- package/dist/agent-runtime/api/data.d.ts +38 -0
- package/dist/agent-runtime/api/data.d.ts.map +1 -0
- package/dist/agent-runtime/api/index.d.ts +5 -0
- package/dist/agent-runtime/api/index.d.ts.map +1 -0
- package/dist/agent-runtime/client.d.ts +146 -0
- package/dist/agent-runtime/client.d.ts.map +1 -0
- package/dist/agent-runtime/endpoint.d.ts +132 -0
- package/dist/agent-runtime/endpoint.d.ts.map +1 -0
- package/dist/agent-runtime/index.d.ts +12 -0
- package/dist/agent-runtime/index.d.ts.map +1 -0
- package/dist/agent-runtime/model.d.ts +327 -0
- package/dist/agent-runtime/model.d.ts.map +1 -0
- package/dist/agent-runtime/runtime.d.ts +206 -0
- package/dist/agent-runtime/runtime.d.ts.map +1 -0
- package/dist/credential/api/control.d.ts +90 -0
- package/dist/credential/api/control.d.ts.map +1 -0
- package/dist/credential/api/index.d.ts +5 -0
- package/dist/credential/api/index.d.ts.map +1 -0
- package/dist/credential/client.d.ts +57 -0
- package/dist/credential/client.d.ts.map +1 -0
- package/dist/credential/credential.d.ts +68 -0
- package/dist/credential/credential.d.ts.map +1 -0
- package/dist/credential/index.d.ts +9 -0
- package/dist/credential/index.d.ts.map +1 -0
- package/dist/credential/model.d.ts +132 -0
- package/dist/credential/model.d.ts.map +1 -0
- package/dist/index.cjs +7498 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7493 -0
- package/dist/integration/adapter.d.ts +128 -0
- package/dist/integration/adapter.d.ts.map +1 -0
- package/dist/integration/index.d.ts +14 -0
- package/dist/integration/index.d.ts.map +1 -0
- package/dist/integration/mastra/adapter.d.ts +112 -0
- package/dist/integration/mastra/adapter.d.ts.map +1 -0
- package/dist/integration/mastra/index.d.ts +15 -0
- package/dist/integration/mastra/index.d.ts.map +1 -0
- package/dist/integration/mastra/types.d.ts +62 -0
- package/dist/integration/mastra/types.d.ts.map +1 -0
- package/dist/model/api/control.d.ts +162 -0
- package/dist/model/api/control.d.ts.map +1 -0
- package/dist/model/client.d.ts +91 -0
- package/dist/model/client.d.ts.map +1 -0
- package/dist/model/index.d.ts +10 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/model-proxy.d.ts +186 -0
- package/dist/model/model-proxy.d.ts.map +1 -0
- package/dist/model/model-service.d.ts +185 -0
- package/dist/model/model-service.d.ts.map +1 -0
- package/dist/model/model.d.ts +227 -0
- package/dist/model/model.d.ts.map +1 -0
- package/dist/sandbox/aio-sandbox.d.ts +258 -0
- package/dist/sandbox/aio-sandbox.d.ts.map +1 -0
- package/dist/sandbox/api/aio-data.d.ts +53 -0
- package/dist/sandbox/api/aio-data.d.ts.map +1 -0
- package/dist/sandbox/api/browser-data.d.ts +85 -0
- package/dist/sandbox/api/browser-data.d.ts.map +1 -0
- package/dist/sandbox/api/code-interpreter-data.d.ts +189 -0
- package/dist/sandbox/api/code-interpreter-data.d.ts.map +1 -0
- package/dist/sandbox/api/control.d.ts +146 -0
- package/dist/sandbox/api/control.d.ts.map +1 -0
- package/dist/sandbox/api/sandbox-data.d.ts +168 -0
- package/dist/sandbox/api/sandbox-data.d.ts.map +1 -0
- package/dist/sandbox/browser-sandbox.d.ts +98 -0
- package/dist/sandbox/browser-sandbox.d.ts.map +1 -0
- package/dist/sandbox/client.d.ts +122 -0
- package/dist/sandbox/client.d.ts.map +1 -0
- package/dist/sandbox/code-interpreter-sandbox.d.ts +238 -0
- package/dist/sandbox/code-interpreter-sandbox.d.ts.map +1 -0
- package/dist/sandbox/index.d.ts +16 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/model.d.ts +231 -0
- package/dist/sandbox/model.d.ts.map +1 -0
- package/dist/sandbox/sandbox.d.ts +90 -0
- package/dist/sandbox/sandbox.d.ts.map +1 -0
- package/dist/sandbox/template.d.ts +118 -0
- package/dist/sandbox/template.d.ts.map +1 -0
- package/dist/server/agui-protocol.d.ts +127 -0
- package/dist/server/agui-protocol.d.ts.map +1 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/model.d.ts +150 -0
- package/dist/server/model.d.ts.map +1 -0
- package/dist/server/server.d.ts +66 -0
- package/dist/server/server.d.ts.map +1 -0
- package/dist/toolset/api/control.d.ts +74 -0
- package/dist/toolset/api/control.d.ts.map +1 -0
- package/dist/toolset/api/index.d.ts +10 -0
- package/dist/toolset/api/index.d.ts.map +1 -0
- package/dist/toolset/api/mcp.d.ts +85 -0
- package/dist/toolset/api/mcp.d.ts.map +1 -0
- package/dist/toolset/client.d.ts +65 -0
- package/dist/toolset/client.d.ts.map +1 -0
- package/dist/toolset/index.d.ts +15 -0
- package/dist/toolset/index.d.ts.map +1 -0
- package/dist/toolset/model.d.ts +246 -0
- package/dist/toolset/model.d.ts.map +1 -0
- package/dist/toolset/openapi.d.ts +174 -0
- package/dist/toolset/openapi.d.ts.map +1 -0
- package/dist/toolset/toolset.d.ts +161 -0
- package/dist/toolset/toolset.d.ts.map +1 -0
- package/dist/utils/config.d.ts +124 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/control-api.d.ts +24 -0
- package/dist/utils/control-api.d.ts.map +1 -0
- package/dist/utils/data-api.d.ts +163 -0
- package/dist/utils/data-api.d.ts.map +1 -0
- package/dist/utils/exception.d.ts +67 -0
- package/dist/utils/exception.d.ts.map +1 -0
- package/dist/utils/helper.d.ts +2 -0
- package/dist/utils/helper.d.ts.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/log.d.ts +25 -0
- package/dist/utils/log.d.ts.map +1 -0
- package/dist/utils/model.d.ts +77 -0
- package/dist/utils/model.d.ts.map +1 -0
- package/dist/utils/resource.d.ts +72 -0
- package/dist/utils/resource.d.ts.map +1 -0
- package/package.json +98 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Runtime Resource
|
|
3
|
+
*
|
|
4
|
+
* 此模块定义 Agent Runtime 资源类。
|
|
5
|
+
* This module defines the Agent Runtime resource class.
|
|
6
|
+
*/
|
|
7
|
+
import * as $AgentRun from "@alicloud/agentrun20250910";
|
|
8
|
+
import { Config } from "../utils/config";
|
|
9
|
+
import { Status } from "../utils/model";
|
|
10
|
+
import type { NetworkConfig } from "../utils/model";
|
|
11
|
+
import { InvokeArgs } from "./api/data";
|
|
12
|
+
import { AgentRuntimeEndpoint } from "./endpoint";
|
|
13
|
+
import { AgentRuntimeCode, AgentRuntimeContainer, AgentRuntimeCreateInput, AgentRuntimeData, AgentRuntimeEndpointCreateInput, AgentRuntimeEndpointUpdateInput, AgentRuntimeHealthCheckConfig, AgentRuntimeListInput, AgentRuntimeLogConfig, AgentRuntimeProtocolConfig, AgentRuntimeUpdateInput, AgentRuntimeVersion, AgentRuntimeVersionListInput } from "./model";
|
|
14
|
+
/**
|
|
15
|
+
* Agent Runtime resource class
|
|
16
|
+
*/
|
|
17
|
+
export declare class AgentRuntime implements AgentRuntimeData {
|
|
18
|
+
agentRuntimeArn?: string;
|
|
19
|
+
agentRuntimeId?: string;
|
|
20
|
+
agentRuntimeName?: string;
|
|
21
|
+
agentRuntimeVersion?: string;
|
|
22
|
+
artifactType?: string;
|
|
23
|
+
codeConfiguration?: AgentRuntimeCode;
|
|
24
|
+
containerConfiguration?: AgentRuntimeContainer;
|
|
25
|
+
cpu?: number;
|
|
26
|
+
createdAt?: string;
|
|
27
|
+
credentialName?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
environmentVariables?: Record<string, string>;
|
|
30
|
+
executionRoleArn?: string;
|
|
31
|
+
healthCheckConfiguration?: AgentRuntimeHealthCheckConfig;
|
|
32
|
+
lastUpdatedAt?: string;
|
|
33
|
+
logConfiguration?: AgentRuntimeLogConfig;
|
|
34
|
+
memory?: number;
|
|
35
|
+
networkConfiguration?: NetworkConfig;
|
|
36
|
+
port?: number;
|
|
37
|
+
protocolConfiguration?: AgentRuntimeProtocolConfig;
|
|
38
|
+
resourceName?: string;
|
|
39
|
+
sessionConcurrencyLimitPerInstance?: number;
|
|
40
|
+
sessionIdleTimeoutSeconds?: number;
|
|
41
|
+
status?: Status;
|
|
42
|
+
statusReason?: string;
|
|
43
|
+
tags?: string[];
|
|
44
|
+
private _config?;
|
|
45
|
+
private _dataApiCache;
|
|
46
|
+
constructor(data?: Partial<AgentRuntimeData>, config?: Config);
|
|
47
|
+
/**
|
|
48
|
+
* Create runtime from SDK response object
|
|
49
|
+
*/
|
|
50
|
+
static fromInnerObject(obj: $AgentRun.AgentRuntime, config?: Config): AgentRuntime;
|
|
51
|
+
private static getClient;
|
|
52
|
+
/**
|
|
53
|
+
* Create a new Agent Runtime
|
|
54
|
+
*/
|
|
55
|
+
static create(params: {
|
|
56
|
+
input: AgentRuntimeCreateInput;
|
|
57
|
+
config?: Config;
|
|
58
|
+
}): Promise<AgentRuntime>;
|
|
59
|
+
/**
|
|
60
|
+
* Delete an Agent Runtime by ID
|
|
61
|
+
*/
|
|
62
|
+
static delete(params: {
|
|
63
|
+
id: string;
|
|
64
|
+
config?: Config;
|
|
65
|
+
}): Promise<AgentRuntime>;
|
|
66
|
+
/**
|
|
67
|
+
* Update an Agent Runtime by ID
|
|
68
|
+
*/
|
|
69
|
+
static update(params: {
|
|
70
|
+
id: string;
|
|
71
|
+
input: AgentRuntimeUpdateInput;
|
|
72
|
+
config?: Config;
|
|
73
|
+
}): Promise<AgentRuntime>;
|
|
74
|
+
/**
|
|
75
|
+
* Get an Agent Runtime by ID
|
|
76
|
+
*/
|
|
77
|
+
static get(params: {
|
|
78
|
+
id: string;
|
|
79
|
+
config?: Config;
|
|
80
|
+
}): Promise<AgentRuntime>;
|
|
81
|
+
/**
|
|
82
|
+
* List Agent Runtimes
|
|
83
|
+
*/
|
|
84
|
+
static list(input?: AgentRuntimeListInput, config?: Config): Promise<AgentRuntime[]>;
|
|
85
|
+
/**
|
|
86
|
+
* List all Agent Runtimes (with pagination)
|
|
87
|
+
*/
|
|
88
|
+
static listAll(options?: {
|
|
89
|
+
agentRuntimeName?: string;
|
|
90
|
+
tags?: string;
|
|
91
|
+
searchMode?: string;
|
|
92
|
+
}, config?: Config): Promise<AgentRuntime[]>;
|
|
93
|
+
/**
|
|
94
|
+
* List Agent Runtime versions by ID
|
|
95
|
+
*/
|
|
96
|
+
static listVersionsById(params: {
|
|
97
|
+
agentRuntimeId: string;
|
|
98
|
+
input?: AgentRuntimeVersionListInput;
|
|
99
|
+
config?: Config;
|
|
100
|
+
}): Promise<AgentRuntimeVersion[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Delete this runtime
|
|
103
|
+
*/
|
|
104
|
+
delete: (params?: {
|
|
105
|
+
config?: Config;
|
|
106
|
+
}) => Promise<AgentRuntime>;
|
|
107
|
+
/**
|
|
108
|
+
* Update this runtime
|
|
109
|
+
*/
|
|
110
|
+
update: (params: {
|
|
111
|
+
input: AgentRuntimeUpdateInput;
|
|
112
|
+
config?: Config;
|
|
113
|
+
}) => Promise<AgentRuntime>;
|
|
114
|
+
/**
|
|
115
|
+
* Refresh this runtime's data
|
|
116
|
+
*/
|
|
117
|
+
refresh: (params?: {
|
|
118
|
+
config?: Config;
|
|
119
|
+
}) => Promise<AgentRuntime>;
|
|
120
|
+
/**
|
|
121
|
+
* Create an endpoint for this runtime
|
|
122
|
+
*/
|
|
123
|
+
createEndpoint: (params: {
|
|
124
|
+
input: AgentRuntimeEndpointCreateInput;
|
|
125
|
+
config?: Config;
|
|
126
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
127
|
+
/**
|
|
128
|
+
* Delete an endpoint from this runtime
|
|
129
|
+
*/
|
|
130
|
+
deleteEndpoint: (params: {
|
|
131
|
+
endpointId: string;
|
|
132
|
+
config?: Config;
|
|
133
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
134
|
+
/**
|
|
135
|
+
* Update an endpoint of this runtime
|
|
136
|
+
*/
|
|
137
|
+
updateEndpoint: (params: {
|
|
138
|
+
endpointId: string;
|
|
139
|
+
input: AgentRuntimeEndpointUpdateInput;
|
|
140
|
+
config?: Config;
|
|
141
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
142
|
+
/**
|
|
143
|
+
* Get an endpoint of this runtime
|
|
144
|
+
*/
|
|
145
|
+
getEndpoint: (params: {
|
|
146
|
+
endpointId: string;
|
|
147
|
+
config?: Config;
|
|
148
|
+
}) => Promise<AgentRuntimeEndpoint>;
|
|
149
|
+
/**
|
|
150
|
+
* List endpoints of this runtime
|
|
151
|
+
*/
|
|
152
|
+
listEndpoints: (params?: {
|
|
153
|
+
config?: Config;
|
|
154
|
+
}) => Promise<AgentRuntimeEndpoint[]>;
|
|
155
|
+
/**
|
|
156
|
+
* List versions of this runtime
|
|
157
|
+
*/
|
|
158
|
+
listVersions: (params?: {
|
|
159
|
+
config?: Config;
|
|
160
|
+
}) => Promise<AgentRuntimeVersion[]>;
|
|
161
|
+
/**
|
|
162
|
+
* Wait until the runtime is ready
|
|
163
|
+
*/
|
|
164
|
+
waitUntilReady: (options?: {
|
|
165
|
+
timeoutSeconds?: number;
|
|
166
|
+
intervalSeconds?: number;
|
|
167
|
+
beforeCheck?: (runtime: AgentRuntime) => void;
|
|
168
|
+
}, config?: Config) => Promise<AgentRuntime>;
|
|
169
|
+
/**
|
|
170
|
+
* Wait until agent runtime reaches READY or any FAILED state
|
|
171
|
+
* Similar to waitUntilReady but does not throw on FAILED states
|
|
172
|
+
* Compatible with Python SDK's wait_until_ready_or_failed method
|
|
173
|
+
*/
|
|
174
|
+
waitUntilReadyOrFailed: (options?: {
|
|
175
|
+
timeoutSeconds?: number;
|
|
176
|
+
intervalSeconds?: number;
|
|
177
|
+
beforeCheck?: (runtime: AgentRuntime) => void;
|
|
178
|
+
}, config?: Config) => Promise<AgentRuntime>;
|
|
179
|
+
/**
|
|
180
|
+
* Invoke agent runtime using OpenAI-compatible API
|
|
181
|
+
*
|
|
182
|
+
* This method provides an OpenAI-compatible interface to invoke the agent runtime.
|
|
183
|
+
* It creates a Data API client and forwards the invocation request.
|
|
184
|
+
*
|
|
185
|
+
* @param args - Invocation arguments
|
|
186
|
+
* @returns OpenAI chat completion response
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```typescript
|
|
190
|
+
* const runtime = await AgentRuntime.get({ id: "runtime-id" });
|
|
191
|
+
* const response = await runtime.invokeOpenai({
|
|
192
|
+
* agentRuntimeEndpointName: "Default",
|
|
193
|
+
* messages: [{ role: "user", content: "Hello" }],
|
|
194
|
+
* stream: false
|
|
195
|
+
* });
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
invokeOpenai: (args: InvokeArgs & {
|
|
199
|
+
agentRuntimeEndpointName?: string;
|
|
200
|
+
}) => Promise<(import("openai/core/streaming").Stream<import("openai/resources").ChatCompletionChunk> & {
|
|
201
|
+
_request_id?: string | null;
|
|
202
|
+
}) | (import("openai/resources").ChatCompletion & {
|
|
203
|
+
_request_id?: string | null;
|
|
204
|
+
})>;
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAe,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,E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AAO,CAAC,oBAAoB,CAAC,CAY/B;IAEF;;OAEG;IACH,WAAW,GAAU,QAAQ;QAC3B,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,KAAG,OAAO,CAAC,oBAAoB,CAAC,CAW/B;IAEF;;OAEG;IACH,aAAa,GAAU,SAAS;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAUnF;IAEF;;OAEG;IACH,YAAY,GAAU,SAAS;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAUjF;IAEF;;OAEG;IACH,cAAc,GACZ,UAAU;QACR,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;KAC/C,EACD,SAAS,MAAM,KACd,OAAO,CAAC,YAAY,CAAC,CA8BtB;IAEF;;;;OAIG;IACH,sBAAsB,GACpB,UAAU;QACR,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;KAC/C,EACD,SAAS,MAAM,KACd,OAAO,CAAC,YAAY,CAAC,CA4BtB;IAEF;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,GACV,MAAM,UAAU,GAAG;QAAE,wBAAwB,CAAC,EAAE,MAAM,CAAA;KAAE;;;;QA8BxD;CACH"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated by the code generation script.
|
|
3
|
+
* Do not modify this file manually.
|
|
4
|
+
* Use the `bun run codegen` command to regenerate.
|
|
5
|
+
*
|
|
6
|
+
* 当前文件为自动生成的控制 API 客户端代码。请勿手动修改此文件。
|
|
7
|
+
* 使用 `bun run codegen` 命令重新生成。
|
|
8
|
+
*/
|
|
9
|
+
import * as $AgentRun from "@alicloud/agentrun20250910";
|
|
10
|
+
import { Config } from "../../utils/config";
|
|
11
|
+
import { ControlAPI } from "../../utils/control-api";
|
|
12
|
+
/**
|
|
13
|
+
* Credential Control API
|
|
14
|
+
*/
|
|
15
|
+
export declare class CredentialControlAPI extends ControlAPI {
|
|
16
|
+
constructor(config?: Config);
|
|
17
|
+
/**
|
|
18
|
+
* Create credential
|
|
19
|
+
*
|
|
20
|
+
* @param params - Method parameters
|
|
21
|
+
* @param params.input - Credential configuration
|
|
22
|
+
* @param params.headers - Custom request headers
|
|
23
|
+
* @param params.config - Optional config override
|
|
24
|
+
* @returns Created credential object
|
|
25
|
+
*/
|
|
26
|
+
createCredential: (params: {
|
|
27
|
+
input: $AgentRun.CreateCredentialInput;
|
|
28
|
+
headers?: Record<string, string>;
|
|
29
|
+
config?: Config;
|
|
30
|
+
}) => Promise<$AgentRun.Credential>;
|
|
31
|
+
/**
|
|
32
|
+
* Delete credential
|
|
33
|
+
*
|
|
34
|
+
* @param params - Method parameters
|
|
35
|
+
* @param params.credentialName - Credential name
|
|
36
|
+
* @param params.headers - Custom request headers
|
|
37
|
+
* @param params.config - Optional config override
|
|
38
|
+
* @returns Deleted credential object
|
|
39
|
+
*/
|
|
40
|
+
deleteCredential: (params: {
|
|
41
|
+
credentialName: string;
|
|
42
|
+
headers?: Record<string, string>;
|
|
43
|
+
config?: Config;
|
|
44
|
+
}) => Promise<$AgentRun.Credential>;
|
|
45
|
+
/**
|
|
46
|
+
* Update credential
|
|
47
|
+
*
|
|
48
|
+
* @param params - Method parameters
|
|
49
|
+
* @param params.credentialName - Credential name
|
|
50
|
+
* @param params.input - Credential configuration
|
|
51
|
+
* @param params.headers - Custom request headers
|
|
52
|
+
* @param params.config - Optional config override
|
|
53
|
+
* @returns Updated credential object
|
|
54
|
+
*/
|
|
55
|
+
updateCredential: (params: {
|
|
56
|
+
credentialName: string;
|
|
57
|
+
input: $AgentRun.UpdateCredentialInput;
|
|
58
|
+
headers?: Record<string, string>;
|
|
59
|
+
config?: Config;
|
|
60
|
+
}) => Promise<$AgentRun.Credential>;
|
|
61
|
+
/**
|
|
62
|
+
* Get credential
|
|
63
|
+
*
|
|
64
|
+
* @param params - Method parameters
|
|
65
|
+
* @param params.credentialName - Credential name
|
|
66
|
+
* @param params.headers - Custom request headers
|
|
67
|
+
* @param params.config - Optional config override
|
|
68
|
+
* @returns Credential object
|
|
69
|
+
*/
|
|
70
|
+
getCredential: (params: {
|
|
71
|
+
credentialName: string;
|
|
72
|
+
headers?: Record<string, string>;
|
|
73
|
+
config?: Config;
|
|
74
|
+
}) => Promise<$AgentRun.Credential>;
|
|
75
|
+
/**
|
|
76
|
+
* List credentials
|
|
77
|
+
*
|
|
78
|
+
* @param params - Method parameters
|
|
79
|
+
* @param params.input - List options
|
|
80
|
+
* @param params.headers - Custom request headers
|
|
81
|
+
* @param params.config - Optional config override
|
|
82
|
+
* @returns List of credential objects
|
|
83
|
+
*/
|
|
84
|
+
listCredentials: (params: {
|
|
85
|
+
input: $AgentRun.ListCredentialsRequest;
|
|
86
|
+
headers?: Record<string, string>;
|
|
87
|
+
config?: Config;
|
|
88
|
+
}) => Promise<$AgentRun.ListCredentialsOutput>;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../../src/credential/api/control.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AAGxD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;gBACtC,MAAM,CAAC,EAAE,MAAM;IAI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,CAAC,CAiCxK;CAEH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/credential/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential Client
|
|
3
|
+
*
|
|
4
|
+
* 此模块提供 Credential 的客户端 API。
|
|
5
|
+
* This module provides the client API for Credential.
|
|
6
|
+
*/
|
|
7
|
+
import { Config } from '../utils/config';
|
|
8
|
+
import { Credential } from './credential';
|
|
9
|
+
import { CredentialCreateInput, CredentialListInput, CredentialListOutput, CredentialUpdateInput } from './model';
|
|
10
|
+
/**
|
|
11
|
+
* Credential Client
|
|
12
|
+
*
|
|
13
|
+
* 提供 Credential 的创建、删除、更新、查询功能。
|
|
14
|
+
* Provides create, delete, update, query functions for Credential.
|
|
15
|
+
*/
|
|
16
|
+
export declare class CredentialClient {
|
|
17
|
+
private config?;
|
|
18
|
+
private controlApi;
|
|
19
|
+
constructor(config?: Config);
|
|
20
|
+
/**
|
|
21
|
+
* Create a Credential
|
|
22
|
+
*/
|
|
23
|
+
create: (params: {
|
|
24
|
+
input: CredentialCreateInput;
|
|
25
|
+
config?: Config;
|
|
26
|
+
}) => Promise<Credential>;
|
|
27
|
+
/**
|
|
28
|
+
* Delete a Credential
|
|
29
|
+
*/
|
|
30
|
+
delete: (params: {
|
|
31
|
+
name: string;
|
|
32
|
+
config?: Config;
|
|
33
|
+
}) => Promise<Credential>;
|
|
34
|
+
/**
|
|
35
|
+
* Update a Credential
|
|
36
|
+
*/
|
|
37
|
+
update: (params: {
|
|
38
|
+
name: string;
|
|
39
|
+
input: CredentialUpdateInput;
|
|
40
|
+
config?: Config;
|
|
41
|
+
}) => Promise<Credential>;
|
|
42
|
+
/**
|
|
43
|
+
* Get a Credential
|
|
44
|
+
*/
|
|
45
|
+
get: (params: {
|
|
46
|
+
name: string;
|
|
47
|
+
config?: Config;
|
|
48
|
+
}) => Promise<Credential>;
|
|
49
|
+
/**
|
|
50
|
+
* List Credentials
|
|
51
|
+
*/
|
|
52
|
+
list: (params: {
|
|
53
|
+
input?: CredentialListInput;
|
|
54
|
+
config?: Config;
|
|
55
|
+
}) => Promise<CredentialListOutput[]>;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/credential/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKzC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,UAAU,CAAuB;gBAE7B,MAAM,CAAC,EAAE,MAAM;IAK3B;;OAEG;IACH,MAAM,GAAU,QAAQ;QACtB,KAAK,EAAE,qBAAqB,CAAC;QAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,KAAG,OAAO,CAAC,UAAU,CAAC,CA0DrB;IAEF;;OAEG;IACH,MAAM,GAAU,QAAQ;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,UAAU,CAAC,CAiB7E;IAEF;;OAEG;IACH,MAAM,GAAU,QAAQ;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,qBAAqB,CAAC;QAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,KAAG,OAAO,CAAC,UAAU,CAAC,CAoDrB;IAEF;;OAEG;IACH,GAAG,GAAU,QAAQ;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,UAAU,CAAC,CAgB1E;IAEF;;OAEG;IACH,IAAI,GAAU,QAAQ;QACpB,KAAK,CAAC,EAAE,mBAAmB,CAAC;QAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,KAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAgBjC;CACH"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential Resource
|
|
3
|
+
*
|
|
4
|
+
* 此模块定义 Credential 资源类。
|
|
5
|
+
* This module defines the Credential resource class.
|
|
6
|
+
*/
|
|
7
|
+
import { Config } from '../utils/config';
|
|
8
|
+
import { ResourceBase } from '../utils/resource';
|
|
9
|
+
import { CredentialAuthType, CredentialInterface, CredentialListInput, CredentialListOutput, CredentialSourceType, RelatedResource } from './model';
|
|
10
|
+
export declare class Credential extends ResourceBase implements CredentialInterface {
|
|
11
|
+
credentialName?: string;
|
|
12
|
+
/** 描述 */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** 是否启用 */
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
credentialId?: string;
|
|
17
|
+
createdAt?: string;
|
|
18
|
+
updatedAt?: string;
|
|
19
|
+
relatedResources?: RelatedResource[];
|
|
20
|
+
/** 凭证认证类型 */
|
|
21
|
+
credentialAuthType?: CredentialAuthType;
|
|
22
|
+
/** 凭证来源类型 */
|
|
23
|
+
credentialSourceType?: CredentialSourceType;
|
|
24
|
+
/** 凭证公共配置 */
|
|
25
|
+
credentialPublicConfig?: Record<string, any>;
|
|
26
|
+
/** 凭证密钥 */
|
|
27
|
+
credentialSecret?: string;
|
|
28
|
+
protected _config?: Config;
|
|
29
|
+
constructor(data?: CredentialInterface, config?: Config);
|
|
30
|
+
private static getClient;
|
|
31
|
+
/**
|
|
32
|
+
* Create a new Credential
|
|
33
|
+
*/
|
|
34
|
+
static create: (paramsOrInput: any) => Promise<Credential>;
|
|
35
|
+
/**
|
|
36
|
+
* Delete a Credential by name
|
|
37
|
+
*/
|
|
38
|
+
static delete: (paramsOrName: any) => Promise<Credential>;
|
|
39
|
+
/**
|
|
40
|
+
* Update a Credential by name
|
|
41
|
+
*/
|
|
42
|
+
static update: (paramsOrName: any) => Promise<Credential>;
|
|
43
|
+
/**
|
|
44
|
+
* Get a Credential by name
|
|
45
|
+
*/
|
|
46
|
+
static get: (paramsOrName: any) => Promise<Credential>;
|
|
47
|
+
/**
|
|
48
|
+
* List all Credentials (with pagination)
|
|
49
|
+
*/
|
|
50
|
+
static list: (paramsOrUndefined?: any) => Promise<CredentialListOutput[]>;
|
|
51
|
+
static listAll: (params?: {
|
|
52
|
+
input?: CredentialListInput;
|
|
53
|
+
config?: Config;
|
|
54
|
+
}) => Promise<CredentialListOutput[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Delete this credential
|
|
57
|
+
*/
|
|
58
|
+
delete: (params?: any) => Promise<this>;
|
|
59
|
+
/**
|
|
60
|
+
* Update this credential
|
|
61
|
+
*/
|
|
62
|
+
update: (params: any) => Promise<this>;
|
|
63
|
+
/**
|
|
64
|
+
* Refresh this credential's data
|
|
65
|
+
*/
|
|
66
|
+
get: (params?: any) => Promise<Credential>;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=credential.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential.d.ts","sourceRoot":"","sources":["../../src/credential/credential.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EACL,kBAAkB,EAElB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EAEpB,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,qBAAa,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QAAQ,GAAG,mBAkBzB;IAEF;;OAEG;IACH,GAAG,GAAU,SAAS,GAAG,KAAG,OAAO,CAAC,UAAU,CAAC,CAY7C;CACH"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential module exports
|
|
3
|
+
*/
|
|
4
|
+
export { CredentialClient } from './client';
|
|
5
|
+
export { Credential } from './credential';
|
|
6
|
+
export { CredentialControlAPI } from './api/control';
|
|
7
|
+
export { CredentialConfig } from './model';
|
|
8
|
+
export type { CredentialBasicAuth, RelatedResource, CredentialCreateInput, CredentialUpdateInput, CredentialListInput, CredentialListOutput, } from './model';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credential/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential Data Models
|
|
3
|
+
*
|
|
4
|
+
* 此模块定义 Credential 相关的所有数据模型。
|
|
5
|
+
* This module defines all data models related to Credential.
|
|
6
|
+
*/
|
|
7
|
+
import { PageableInput } from '../utils/model';
|
|
8
|
+
import { Config } from '../utils/config';
|
|
9
|
+
/** 凭证认证类型 / Credential Authentication Types */
|
|
10
|
+
export type CredentialAuthType = 'jwt' | 'api_key' | 'basic' | 'aksk' | 'custom_header';
|
|
11
|
+
/** 凭证来源类型 / Credential Source Types */
|
|
12
|
+
export type CredentialSourceType = 'external_llm' | 'external_tool' | 'internal';
|
|
13
|
+
/**
|
|
14
|
+
* Credential basic authentication configuration
|
|
15
|
+
*/
|
|
16
|
+
export interface CredentialBasicAuth {
|
|
17
|
+
/** Username */
|
|
18
|
+
username?: string;
|
|
19
|
+
/** Password */
|
|
20
|
+
password?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Related resource for credential
|
|
24
|
+
*/
|
|
25
|
+
export interface RelatedResource {
|
|
26
|
+
/** 资源 IDj*/
|
|
27
|
+
resourceId?: string;
|
|
28
|
+
/** 资源名称j*/
|
|
29
|
+
resourceName?: string;
|
|
30
|
+
/** 资源类型j*/
|
|
31
|
+
resourceType?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CredentialConfigInterface {
|
|
34
|
+
/** 凭证认证类型 */
|
|
35
|
+
credentialAuthType?: CredentialAuthType;
|
|
36
|
+
/** 凭证来源类型 */
|
|
37
|
+
credentialSourceType?: CredentialSourceType;
|
|
38
|
+
/** 凭证公共配置 */
|
|
39
|
+
credentialPublicConfig?: Record<string, any>;
|
|
40
|
+
/** 凭证密钥 */
|
|
41
|
+
credentialSecret?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 凭证配置 / Credential configuration
|
|
45
|
+
*/
|
|
46
|
+
export declare class CredentialConfig implements CredentialConfigInterface {
|
|
47
|
+
constructor(data?: CredentialConfigInterface);
|
|
48
|
+
/** 配置访问 AgentRun 的 api key 凭证 */
|
|
49
|
+
static inboundApiKey(params: {
|
|
50
|
+
apiKey: string;
|
|
51
|
+
headerKey?: string;
|
|
52
|
+
}): CredentialConfig;
|
|
53
|
+
/** 配置访问 AgentRun 的静态 JWKS 凭证 */
|
|
54
|
+
static inboundStaticJwt(params: {
|
|
55
|
+
jwks: string;
|
|
56
|
+
}): CredentialConfig;
|
|
57
|
+
/** 配置访问 AgentRun 的远程 JWT 凭证 */
|
|
58
|
+
static inboundRemoteJwt(uri: string, timeout?: number, ttl?: number, publicConfig?: Record<string, any>): CredentialConfig;
|
|
59
|
+
/** 配置访问 AgentRun 的 Basic 凭证 */
|
|
60
|
+
static inboundBasic(params: {
|
|
61
|
+
users: CredentialBasicAuth[];
|
|
62
|
+
}): CredentialConfig;
|
|
63
|
+
/** 配置访问第三方工具的 api key 凭证 */
|
|
64
|
+
static outboundLLMApiKey(params: {
|
|
65
|
+
apiKey: string;
|
|
66
|
+
provider: string;
|
|
67
|
+
}): CredentialConfig;
|
|
68
|
+
/** 配置访问第三方工具的 ak/sk 凭证 */
|
|
69
|
+
static outboundLLMAKSK(provider: string, accessKeyId: string, accessKeySecret: string, accountId: string): CredentialConfig;
|
|
70
|
+
/** 配置访问第三方工具的自定义凭证 */
|
|
71
|
+
static outboundToolAKSKCustom(params: {
|
|
72
|
+
authConfig: Record<string, string>;
|
|
73
|
+
}): CredentialConfig;
|
|
74
|
+
/** 配置访问第三方工具的自定义 Header 凭证 */
|
|
75
|
+
static outboundToolCustomHeader(params: {
|
|
76
|
+
headers: Record<string, string>;
|
|
77
|
+
}): CredentialConfig;
|
|
78
|
+
}
|
|
79
|
+
/** 凭证公共配置 */
|
|
80
|
+
export interface CredentialMutableProps {
|
|
81
|
+
/** 描述 */
|
|
82
|
+
description?: string;
|
|
83
|
+
/** 是否启用 */
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
}
|
|
86
|
+
export interface CredentialImmutableProps {
|
|
87
|
+
credentialName?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface CredentialSystemProps {
|
|
90
|
+
credentialId?: string;
|
|
91
|
+
createdAt?: string;
|
|
92
|
+
updatedAt?: string;
|
|
93
|
+
relatedResources?: RelatedResource[];
|
|
94
|
+
}
|
|
95
|
+
export interface CredentialCreateInput extends CredentialMutableProps, CredentialImmutableProps {
|
|
96
|
+
credentialConfig?: CredentialConfig;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Credential update input
|
|
100
|
+
*/
|
|
101
|
+
export interface CredentialUpdateInput extends CredentialMutableProps {
|
|
102
|
+
credentialConfig?: CredentialConfig;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Credential list input
|
|
106
|
+
*/
|
|
107
|
+
export interface CredentialListInput extends PageableInput {
|
|
108
|
+
credentialAuthType?: CredentialAuthType;
|
|
109
|
+
credentialName?: string;
|
|
110
|
+
credentialSourceType?: CredentialSourceType;
|
|
111
|
+
provider?: string;
|
|
112
|
+
}
|
|
113
|
+
export declare class CredentialListOutput {
|
|
114
|
+
createdAt?: string;
|
|
115
|
+
credentialAuthType?: CredentialAuthType;
|
|
116
|
+
credentialId?: string;
|
|
117
|
+
credentialName?: string;
|
|
118
|
+
credentialSourceType?: CredentialSourceType;
|
|
119
|
+
enabled?: boolean;
|
|
120
|
+
relatedResourceCount?: number;
|
|
121
|
+
updatedAt?: string;
|
|
122
|
+
constructor(data?: any);
|
|
123
|
+
toCredential: (params?: {
|
|
124
|
+
config?: Config;
|
|
125
|
+
}) => Promise<import("./credential").Credential>;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Credential resource class
|
|
129
|
+
*/
|
|
130
|
+
export interface CredentialInterface extends CredentialMutableProps, CredentialImmutableProps, CredentialSystemProps, CredentialConfigInterface {
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/credential/model.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,+CAA+C;AAC/C,MAAM,MAAM,kBAAkB,GAC1B,KAAK,GACL,SAAS,GACT,OAAO,GACP,MAAM,GACN,eAAe,CAAC;AAEpB,uCAAuC;AACvC,MAAM,MAAM,oBAAoB,GAAG,cAAc,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