@eigenpal/sdk 0.0.0-placeholder → 0.4.11
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/CHANGELOG.md +58 -1
- package/README.md +58 -46
- package/package.json +15 -2
- package/src/client.ts +48 -17
- package/src/errors.ts +7 -2
- package/src/generated/index.ts +82 -21
- package/src/generated/sdk.gen.ts +203 -31
- package/src/generated/types.gen.ts +649 -88
- package/src/index.ts +21 -8
- package/src/lib/files.ts +27 -0
- package/src/resources/agents.ts +168 -0
- package/src/resources/executions.ts +35 -23
- package/src/resources/workflows.ts +9 -3
- package/src/runtime-config.ts +2 -2
- package/src/telemetry.ts +54 -0
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -3,15 +3,39 @@
|
|
|
3
3
|
import type { Client, Options as Options2, TDataShape } from './client';
|
|
4
4
|
import { client } from './client.gen';
|
|
5
5
|
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
AgentsCreateData,
|
|
7
|
+
AgentsCreateErrors,
|
|
8
|
+
AgentsCreateResponses,
|
|
9
|
+
AgentsExecutionsCancelData,
|
|
10
|
+
AgentsExecutionsCancelErrors,
|
|
11
|
+
AgentsExecutionsCancelResponses,
|
|
12
|
+
AgentsExecutionsGetData,
|
|
13
|
+
AgentsExecutionsGetErrors,
|
|
14
|
+
AgentsExecutionsGetResponses,
|
|
15
|
+
AgentsExecutionsListData,
|
|
16
|
+
AgentsExecutionsListErrors,
|
|
17
|
+
AgentsExecutionsListResponses,
|
|
18
|
+
AgentsGetData,
|
|
19
|
+
AgentsGetErrors,
|
|
20
|
+
AgentsGetResponses,
|
|
21
|
+
AgentsListData,
|
|
22
|
+
AgentsListErrors,
|
|
23
|
+
AgentsListResponses,
|
|
24
|
+
AgentsRunData,
|
|
25
|
+
AgentsRunErrors,
|
|
26
|
+
AgentsRunResponses,
|
|
27
|
+
AgentsUpdateData,
|
|
28
|
+
AgentsUpdateErrors,
|
|
29
|
+
AgentsUpdateResponses,
|
|
30
|
+
WorkflowsExecutionsCancelData,
|
|
31
|
+
WorkflowsExecutionsCancelErrors,
|
|
32
|
+
WorkflowsExecutionsCancelResponses,
|
|
33
|
+
WorkflowsExecutionsGetData,
|
|
34
|
+
WorkflowsExecutionsGetErrors,
|
|
35
|
+
WorkflowsExecutionsGetResponses,
|
|
36
|
+
WorkflowsExecutionsListData,
|
|
37
|
+
WorkflowsExecutionsListErrors,
|
|
38
|
+
WorkflowsExecutionsListResponses,
|
|
15
39
|
WorkflowsGetData,
|
|
16
40
|
WorkflowsGetErrors,
|
|
17
41
|
WorkflowsGetResponses,
|
|
@@ -45,44 +69,156 @@ export type Options<
|
|
|
45
69
|
};
|
|
46
70
|
|
|
47
71
|
/**
|
|
48
|
-
*
|
|
72
|
+
* List agent executions
|
|
49
73
|
*
|
|
50
|
-
*
|
|
74
|
+
* Returns executions for an agent, optionally filtered by status or experiment batch.
|
|
51
75
|
*/
|
|
52
|
-
export const
|
|
53
|
-
options: Options<
|
|
76
|
+
export const agentsExecutionsList = <ThrowOnError extends boolean = false>(
|
|
77
|
+
options: Options<AgentsExecutionsListData, ThrowOnError>
|
|
54
78
|
) =>
|
|
55
|
-
(options.client ?? client).
|
|
79
|
+
(options.client ?? client).get<
|
|
80
|
+
AgentsExecutionsListResponses,
|
|
81
|
+
AgentsExecutionsListErrors,
|
|
82
|
+
ThrowOnError
|
|
83
|
+
>({
|
|
84
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
85
|
+
url: '/api/v1/agents/{agentId}/executions',
|
|
86
|
+
...options,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get an agent
|
|
91
|
+
*
|
|
92
|
+
* Returns one agent by id or slug.
|
|
93
|
+
*/
|
|
94
|
+
export const agentsGet = <ThrowOnError extends boolean = false>(
|
|
95
|
+
options: Options<AgentsGetData, ThrowOnError>
|
|
96
|
+
) =>
|
|
97
|
+
(options.client ?? client).get<AgentsGetResponses, AgentsGetErrors, ThrowOnError>({
|
|
98
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
99
|
+
url: '/api/v1/agents/{agentId}',
|
|
100
|
+
...options,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Update an agent
|
|
105
|
+
*
|
|
106
|
+
* Updates mutable agent metadata and configuration.
|
|
107
|
+
*/
|
|
108
|
+
export const agentsUpdate = <ThrowOnError extends boolean = false>(
|
|
109
|
+
options: Options<AgentsUpdateData, ThrowOnError>
|
|
110
|
+
) =>
|
|
111
|
+
(options.client ?? client).patch<AgentsUpdateResponses, AgentsUpdateErrors, ThrowOnError>({
|
|
112
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
113
|
+
url: '/api/v1/agents/{agentId}',
|
|
114
|
+
...options,
|
|
115
|
+
headers: {
|
|
116
|
+
'Content-Type': 'application/json',
|
|
117
|
+
...options.headers,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Execute an agent
|
|
123
|
+
*
|
|
124
|
+
* Enqueues an agent execution. Returns 202 with `{ executionId }` by default. Pass `wait_for_completion=<seconds>` to hold the connection until the execution reaches a terminal state. File inputs are uploaded as multipart/form-data.
|
|
125
|
+
*/
|
|
126
|
+
export const agentsRun = <ThrowOnError extends boolean = false>(
|
|
127
|
+
options: Options<AgentsRunData, ThrowOnError>
|
|
128
|
+
) =>
|
|
129
|
+
(options.client ?? client).post<AgentsRunResponses, AgentsRunErrors, ThrowOnError>({
|
|
130
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
131
|
+
url: '/api/v1/agents/{agentId}/run',
|
|
132
|
+
...options,
|
|
133
|
+
headers: {
|
|
134
|
+
'Content-Type': 'application/json',
|
|
135
|
+
...options.headers,
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Cancel agent execution
|
|
141
|
+
*
|
|
142
|
+
* Requests cancellation for one agent execution by id.
|
|
143
|
+
*/
|
|
144
|
+
export const agentsExecutionsCancel = <ThrowOnError extends boolean = false>(
|
|
145
|
+
options: Options<AgentsExecutionsCancelData, ThrowOnError>
|
|
146
|
+
) =>
|
|
147
|
+
(options.client ?? client).post<
|
|
148
|
+
AgentsExecutionsCancelResponses,
|
|
149
|
+
AgentsExecutionsCancelErrors,
|
|
150
|
+
ThrowOnError
|
|
151
|
+
>({
|
|
152
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
153
|
+
url: '/api/v1/agents/executions/{executionId}/cancel',
|
|
154
|
+
...options,
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Get agent execution
|
|
159
|
+
*
|
|
160
|
+
* Returns one agent execution by id.
|
|
161
|
+
*/
|
|
162
|
+
export const agentsExecutionsGet = <ThrowOnError extends boolean = false>(
|
|
163
|
+
options: Options<AgentsExecutionsGetData, ThrowOnError>
|
|
164
|
+
) =>
|
|
165
|
+
(options.client ?? client).get<
|
|
166
|
+
AgentsExecutionsGetResponses,
|
|
167
|
+
AgentsExecutionsGetErrors,
|
|
168
|
+
ThrowOnError
|
|
169
|
+
>({
|
|
56
170
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
57
|
-
url: '/v1/executions/{executionId}
|
|
171
|
+
url: '/api/v1/agents/executions/{executionId}',
|
|
58
172
|
...options,
|
|
59
173
|
});
|
|
60
174
|
|
|
61
175
|
/**
|
|
62
|
-
*
|
|
176
|
+
* List agents
|
|
63
177
|
*
|
|
64
|
-
* Returns the
|
|
178
|
+
* Returns agents the API key has access to, with pagination and basic execution stats.
|
|
65
179
|
*/
|
|
66
|
-
export const
|
|
67
|
-
options
|
|
180
|
+
export const agentsList = <ThrowOnError extends boolean = false>(
|
|
181
|
+
options?: Options<AgentsListData, ThrowOnError>
|
|
68
182
|
) =>
|
|
69
|
-
(options
|
|
183
|
+
(options?.client ?? client).get<AgentsListResponses, AgentsListErrors, ThrowOnError>({
|
|
70
184
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
71
|
-
url: '/v1/
|
|
185
|
+
url: '/api/v1/agents',
|
|
72
186
|
...options,
|
|
73
187
|
});
|
|
74
188
|
|
|
75
189
|
/**
|
|
76
|
-
*
|
|
190
|
+
* Create an agent
|
|
77
191
|
*
|
|
78
|
-
*
|
|
192
|
+
* Creates a new agent and initializes its workspace files.
|
|
79
193
|
*/
|
|
80
|
-
export const
|
|
81
|
-
options
|
|
194
|
+
export const agentsCreate = <ThrowOnError extends boolean = false>(
|
|
195
|
+
options: Options<AgentsCreateData, ThrowOnError>
|
|
82
196
|
) =>
|
|
83
|
-
(options
|
|
197
|
+
(options.client ?? client).post<AgentsCreateResponses, AgentsCreateErrors, ThrowOnError>({
|
|
198
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
199
|
+
url: '/api/v1/agents',
|
|
200
|
+
...options,
|
|
201
|
+
headers: {
|
|
202
|
+
'Content-Type': 'application/json',
|
|
203
|
+
...options.headers,
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* List workflow executions
|
|
209
|
+
*
|
|
210
|
+
* Returns executions for a workflow, optionally filtered by status, date range, or eval example. Paginated.
|
|
211
|
+
*/
|
|
212
|
+
export const workflowsExecutionsList = <ThrowOnError extends boolean = false>(
|
|
213
|
+
options: Options<WorkflowsExecutionsListData, ThrowOnError>
|
|
214
|
+
) =>
|
|
215
|
+
(options.client ?? client).get<
|
|
216
|
+
WorkflowsExecutionsListResponses,
|
|
217
|
+
WorkflowsExecutionsListErrors,
|
|
218
|
+
ThrowOnError
|
|
219
|
+
>({
|
|
84
220
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
85
|
-
url: '/v1/executions',
|
|
221
|
+
url: '/api/v1/workflows/{id}/executions',
|
|
86
222
|
...options,
|
|
87
223
|
});
|
|
88
224
|
|
|
@@ -96,7 +232,7 @@ export const workflowsGet = <ThrowOnError extends boolean = false>(
|
|
|
96
232
|
) =>
|
|
97
233
|
(options.client ?? client).get<WorkflowsGetResponses, WorkflowsGetErrors, ThrowOnError>({
|
|
98
234
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
99
|
-
url: '/v1/workflows/{id}',
|
|
235
|
+
url: '/api/v1/workflows/{id}',
|
|
100
236
|
...options,
|
|
101
237
|
});
|
|
102
238
|
|
|
@@ -110,7 +246,7 @@ export const workflowsRun = <ThrowOnError extends boolean = false>(
|
|
|
110
246
|
) =>
|
|
111
247
|
(options.client ?? client).post<WorkflowsRunResponses, WorkflowsRunErrors, ThrowOnError>({
|
|
112
248
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
113
|
-
url: '/v1/workflows/{id}/run',
|
|
249
|
+
url: '/api/v1/workflows/{id}/run',
|
|
114
250
|
...options,
|
|
115
251
|
headers: {
|
|
116
252
|
'Content-Type': 'application/json',
|
|
@@ -132,7 +268,43 @@ export const workflowsVersionsList = <ThrowOnError extends boolean = false>(
|
|
|
132
268
|
ThrowOnError
|
|
133
269
|
>({
|
|
134
270
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
135
|
-
url: '/v1/workflows/{id}/versions',
|
|
271
|
+
url: '/api/v1/workflows/{id}/versions',
|
|
272
|
+
...options,
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Cancel a workflow execution
|
|
277
|
+
*
|
|
278
|
+
* Idempotent. Created/pending executions transition immediately to `cancelled`; running/waiting executions receive a cancellation request for the worker to observe.
|
|
279
|
+
*/
|
|
280
|
+
export const workflowsExecutionsCancel = <ThrowOnError extends boolean = false>(
|
|
281
|
+
options: Options<WorkflowsExecutionsCancelData, ThrowOnError>
|
|
282
|
+
) =>
|
|
283
|
+
(options.client ?? client).post<
|
|
284
|
+
WorkflowsExecutionsCancelResponses,
|
|
285
|
+
WorkflowsExecutionsCancelErrors,
|
|
286
|
+
ThrowOnError
|
|
287
|
+
>({
|
|
288
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
289
|
+
url: '/api/v1/workflows/executions/{executionId}/cancel',
|
|
290
|
+
...options,
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Get workflow execution status
|
|
295
|
+
*
|
|
296
|
+
* Returns the current status, completion timestamps, and result or error for a workflow execution. Pass `includeSteps=true` for the per-step artifact payload.
|
|
297
|
+
*/
|
|
298
|
+
export const workflowsExecutionsGet = <ThrowOnError extends boolean = false>(
|
|
299
|
+
options: Options<WorkflowsExecutionsGetData, ThrowOnError>
|
|
300
|
+
) =>
|
|
301
|
+
(options.client ?? client).get<
|
|
302
|
+
WorkflowsExecutionsGetResponses,
|
|
303
|
+
WorkflowsExecutionsGetErrors,
|
|
304
|
+
ThrowOnError
|
|
305
|
+
>({
|
|
306
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
307
|
+
url: '/api/v1/workflows/executions/{executionId}',
|
|
136
308
|
...options,
|
|
137
309
|
});
|
|
138
310
|
|
|
@@ -146,6 +318,6 @@ export const workflowsList = <ThrowOnError extends boolean = false>(
|
|
|
146
318
|
) =>
|
|
147
319
|
(options?.client ?? client).get<WorkflowsListResponses, WorkflowsListErrors, ThrowOnError>({
|
|
148
320
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
149
|
-
url: '/v1/workflows',
|
|
321
|
+
url: '/api/v1/workflows',
|
|
150
322
|
...options,
|
|
151
323
|
});
|