asteroid-odyssey 1.0.23 → 1.0.25

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.
@@ -3,4 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.client = void 0;
5
5
  const client_fetch_1 = require("@hey-api/client-fetch");
6
- exports.client = (0, client_fetch_1.createClient)((0, client_fetch_1.createConfig)());
6
+ exports.client = (0, client_fetch_1.createClient)((0, client_fetch_1.createConfig)({
7
+ baseUrl: 'https://odyssey.asteroid.ai/api/v1'
8
+ }));
@@ -1,5 +1,5 @@
1
1
  import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
2
- import type { GetOpenApiData, HealthCheckData, GetAgentsData, QueueOptimisationJobData, CreateWorkflowData, DeleteWorkflowData, GetWorkflowData, ExecuteWorkflowData, GetExecutionsForWorkflowData, DeleteWorkflowCredentialsData, GetWorkflowCredentialsData, AddWorkflowCredentialData, GetCredentialsPublicKeyData, DeleteExecutionData, GetExecutionData, UpdateExecutionStatusData, GetBrowserSessionData, SetSlackChannelData, GetAgentWorkflowExecutionsData, GetExecutionProgressData, GetExecutionFilesData, GetWorkflowVersionsData, GetExecutionUserMessagesData, CreateExecutionUserMessageData } from './types.gen';
2
+ import type { GetOpenApiData, HealthCheckData, ExecuteAgentData, GetExecutionStatusData, GetExecutionResultData } from './types.gen';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -26,98 +26,15 @@ export declare const healthCheck: <ThrowOnError extends boolean = false>(options
26
26
  error?: string;
27
27
  }, ThrowOnError>;
28
28
  /**
29
- * Get all agents
29
+ * Execute an agent
30
+ * Executes an agent with the provided parameters
30
31
  */
31
- export declare const getAgents: <ThrowOnError extends boolean = false>(options?: Options<GetAgentsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Agent[], unknown, ThrowOnError>;
32
+ export declare const executeAgent: <ThrowOnError extends boolean = false>(options: Options<ExecuteAgentData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ExecutionResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
32
33
  /**
33
- * Queue an optimisation job
34
+ * Get execution status
34
35
  */
35
- export declare const queueOptimisationJob: <ThrowOnError extends boolean = false>(options?: Options<QueueOptimisationJobData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
36
+ export declare const getExecutionStatus: <ThrowOnError extends boolean = false>(options: Options<GetExecutionStatusData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ExecutionStatusResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
36
37
  /**
37
- * Create a new workflow for an agent
38
+ * Get execution result
38
39
  */
39
- export declare const createWorkflow: <ThrowOnError extends boolean = false>(options: Options<CreateWorkflowData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<string, unknown, ThrowOnError>;
40
- /**
41
- * Delete a workflow
42
- */
43
- export declare const deleteWorkflow: <ThrowOnError extends boolean = false>(options: Options<DeleteWorkflowData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
44
- result?: string;
45
- }, {
46
- error?: string;
47
- }, ThrowOnError>;
48
- /**
49
- * Get a workflow
50
- */
51
- export declare const getWorkflow: <ThrowOnError extends boolean = false>(options: Options<GetWorkflowData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Workflow, unknown, ThrowOnError>;
52
- /**
53
- * Execute a saved workflow for an agent
54
- */
55
- export declare const executeWorkflow: <ThrowOnError extends boolean = false>(options: Options<ExecuteWorkflowData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<string, unknown, ThrowOnError>;
56
- /**
57
- * Get all executions for a workflow
58
- */
59
- export declare const getExecutionsForWorkflow: <ThrowOnError extends boolean = false>(options: Options<GetExecutionsForWorkflowData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Execution[], unknown, ThrowOnError>;
60
- /**
61
- * Delete credentials for a workflow
62
- */
63
- export declare const deleteWorkflowCredentials: <ThrowOnError extends boolean = false>(options: Options<DeleteWorkflowCredentialsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
64
- /**
65
- * Get credentials for a workflow (and all prior versions of the workflow)
66
- */
67
- export declare const getWorkflowCredentials: <ThrowOnError extends boolean = false>(options: Options<GetWorkflowCredentialsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").CredentialsResponse, unknown, ThrowOnError>;
68
- /**
69
- * Add a credential for a workflow
70
- */
71
- export declare const addWorkflowCredential: <ThrowOnError extends boolean = false>(options: Options<AddWorkflowCredentialData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
72
- /**
73
- * Get the public key for credentials
74
- */
75
- export declare const getCredentialsPublicKey: <ThrowOnError extends boolean = false>(options?: Options<GetCredentialsPublicKeyData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<string, unknown, ThrowOnError>;
76
- /**
77
- * Delete an execution
78
- */
79
- export declare const deleteExecution: <ThrowOnError extends boolean = false>(options: Options<DeleteExecutionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
80
- result?: string;
81
- }, {
82
- error?: string;
83
- }, ThrowOnError>;
84
- /**
85
- * Get an execution
86
- */
87
- export declare const getExecution: <ThrowOnError extends boolean = false>(options: Options<GetExecutionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Execution, unknown, ThrowOnError>;
88
- /**
89
- * Update the status of an execution
90
- */
91
- export declare const updateExecutionStatus: <ThrowOnError extends boolean = false>(options: Options<UpdateExecutionStatusData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
92
- /**
93
- * Get the browser session for an execution
94
- */
95
- export declare const getBrowserSession: <ThrowOnError extends boolean = false>(options: Options<GetBrowserSessionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").BrowserSession, unknown, ThrowOnError>;
96
- /**
97
- * Set your slack notification channel
98
- */
99
- export declare const setSlackChannel: <ThrowOnError extends boolean = false>(options: Options<SetSlackChannelData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
100
- /**
101
- * Get all workflows and their executions
102
- */
103
- export declare const getAgentWorkflowExecutions: <ThrowOnError extends boolean = false>(options: Options<GetAgentWorkflowExecutionsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").WorkflowExecution[], unknown, ThrowOnError>;
104
- /**
105
- * Get the progress of an execution
106
- */
107
- export declare const getExecutionProgress: <ThrowOnError extends boolean = false>(options: Options<GetExecutionProgressData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ProgressUpdate[], unknown, ThrowOnError>;
108
- /**
109
- * Get files for an execution
110
- */
111
- export declare const getExecutionFiles: <ThrowOnError extends boolean = false>(options: Options<GetExecutionFilesData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").File[], unknown, ThrowOnError>;
112
- /**
113
- * Get all versions of a workflow
114
- */
115
- export declare const getWorkflowVersions: <ThrowOnError extends boolean = false>(options: Options<GetWorkflowVersionsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Workflow[], unknown, ThrowOnError>;
116
- /**
117
- * Get all user messages for an execution
118
- */
119
- export declare const getExecutionUserMessages: <ThrowOnError extends boolean = false>(options: Options<GetExecutionUserMessagesData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").UserMessage[], unknown, ThrowOnError>;
120
- /**
121
- * Create a user message for an execution
122
- */
123
- export declare const createExecutionUserMessage: <ThrowOnError extends boolean = false>(options: Options<CreateExecutionUserMessageData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
40
+ export declare const getExecutionResult: <ThrowOnError extends boolean = false>(options: Options<GetExecutionResultData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ExecutionResultResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // This file is auto-generated by @hey-api/openapi-ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.createExecutionUserMessage = exports.getExecutionUserMessages = exports.getWorkflowVersions = exports.getExecutionFiles = exports.getExecutionProgress = exports.getAgentWorkflowExecutions = exports.setSlackChannel = exports.getBrowserSession = exports.updateExecutionStatus = exports.getExecution = exports.deleteExecution = exports.getCredentialsPublicKey = exports.addWorkflowCredential = exports.getWorkflowCredentials = exports.deleteWorkflowCredentials = exports.getExecutionsForWorkflow = exports.executeWorkflow = exports.getWorkflow = exports.deleteWorkflow = exports.createWorkflow = exports.queueOptimisationJob = exports.getAgents = exports.healthCheck = exports.getOpenApi = void 0;
4
+ exports.getExecutionResult = exports.getExecutionStatus = exports.executeAgent = exports.healthCheck = exports.getOpenApi = void 0;
5
5
  const client_gen_1 = require("./client.gen");
6
6
  /**
7
7
  * Get the OpenAPI schema
@@ -24,35 +24,18 @@ const healthCheck = (options) => {
24
24
  };
25
25
  exports.healthCheck = healthCheck;
26
26
  /**
27
- * Get all agents
27
+ * Execute an agent
28
+ * Executes an agent with the provided parameters
28
29
  */
29
- const getAgents = (options) => {
30
- return (options?.client ?? client_gen_1.client).get({
31
- url: '/agents',
32
- ...options
33
- });
34
- };
35
- exports.getAgents = getAgents;
36
- /**
37
- * Queue an optimisation job
38
- */
39
- const queueOptimisationJob = (options) => {
40
- return (options?.client ?? client_gen_1.client).post({
41
- url: '/optimiser',
42
- ...options,
43
- headers: {
44
- 'Content-Type': 'application/json',
45
- ...options?.headers
46
- }
47
- });
48
- };
49
- exports.queueOptimisationJob = queueOptimisationJob;
50
- /**
51
- * Create a new workflow for an agent
52
- */
53
- const createWorkflow = (options) => {
30
+ const executeAgent = (options) => {
54
31
  return (options.client ?? client_gen_1.client).post({
55
- url: '/workflow/{agent_name}/create',
32
+ security: [
33
+ {
34
+ name: 'X-Asteroid-Agents-Api-Key',
35
+ type: 'apiKey'
36
+ }
37
+ ],
38
+ url: '/agent/{id}',
56
39
  ...options,
57
40
  headers: {
58
41
  'Content-Type': 'application/json',
@@ -60,214 +43,36 @@ const createWorkflow = (options) => {
60
43
  }
61
44
  });
62
45
  };
63
- exports.createWorkflow = createWorkflow;
64
- /**
65
- * Delete a workflow
66
- */
67
- const deleteWorkflow = (options) => {
68
- return (options.client ?? client_gen_1.client).delete({
69
- url: '/workflow/{workflow_id}',
70
- ...options
71
- });
72
- };
73
- exports.deleteWorkflow = deleteWorkflow;
46
+ exports.executeAgent = executeAgent;
74
47
  /**
75
- * Get a workflow
48
+ * Get execution status
76
49
  */
77
- const getWorkflow = (options) => {
50
+ const getExecutionStatus = (options) => {
78
51
  return (options.client ?? client_gen_1.client).get({
79
- url: '/workflow/{workflow_id}',
80
- ...options
81
- });
82
- };
83
- exports.getWorkflow = getWorkflow;
84
- /**
85
- * Execute a saved workflow for an agent
86
- */
87
- const executeWorkflow = (options) => {
88
- return (options.client ?? client_gen_1.client).post({
89
- url: '/workflow/{workflow_id}',
90
- ...options,
91
- headers: {
92
- 'Content-Type': 'application/json',
93
- ...options?.headers
94
- }
95
- });
96
- };
97
- exports.executeWorkflow = executeWorkflow;
98
- /**
99
- * Get all executions for a workflow
100
- */
101
- const getExecutionsForWorkflow = (options) => {
102
- return (options.client ?? client_gen_1.client).get({
103
- url: '/workflow/{workflow_id}/executions',
104
- ...options
105
- });
106
- };
107
- exports.getExecutionsForWorkflow = getExecutionsForWorkflow;
108
- /**
109
- * Delete credentials for a workflow
110
- */
111
- const deleteWorkflowCredentials = (options) => {
112
- return (options.client ?? client_gen_1.client).delete({
113
- url: '/workflow/{workflow_id}/credentials',
114
- ...options
115
- });
116
- };
117
- exports.deleteWorkflowCredentials = deleteWorkflowCredentials;
118
- /**
119
- * Get credentials for a workflow (and all prior versions of the workflow)
120
- */
121
- const getWorkflowCredentials = (options) => {
122
- return (options.client ?? client_gen_1.client).get({
123
- url: '/workflow/{workflow_id}/credentials',
124
- ...options
125
- });
126
- };
127
- exports.getWorkflowCredentials = getWorkflowCredentials;
128
- /**
129
- * Add a credential for a workflow
130
- */
131
- const addWorkflowCredential = (options) => {
132
- return (options.client ?? client_gen_1.client).patch({
133
- url: '/workflow/{workflow_id}/credentials',
134
- ...options,
135
- headers: {
136
- 'Content-Type': 'application/json',
137
- ...options?.headers
138
- }
139
- });
140
- };
141
- exports.addWorkflowCredential = addWorkflowCredential;
142
- /**
143
- * Get the public key for credentials
144
- */
145
- const getCredentialsPublicKey = (options) => {
146
- return (options?.client ?? client_gen_1.client).get({
147
- url: '/credentials/public_key',
148
- ...options
149
- });
150
- };
151
- exports.getCredentialsPublicKey = getCredentialsPublicKey;
152
- /**
153
- * Delete an execution
154
- */
155
- const deleteExecution = (options) => {
156
- return (options.client ?? client_gen_1.client).delete({
157
- url: '/execution/{id}',
158
- ...options
159
- });
160
- };
161
- exports.deleteExecution = deleteExecution;
162
- /**
163
- * Get an execution
164
- */
165
- const getExecution = (options) => {
166
- return (options.client ?? client_gen_1.client).get({
167
- url: '/execution/{id}',
168
- ...options
169
- });
170
- };
171
- exports.getExecution = getExecution;
172
- /**
173
- * Update the status of an execution
174
- */
175
- const updateExecutionStatus = (options) => {
176
- return (options.client ?? client_gen_1.client).post({
52
+ security: [
53
+ {
54
+ name: 'X-Asteroid-Agents-Api-Key',
55
+ type: 'apiKey'
56
+ }
57
+ ],
177
58
  url: '/execution/{id}/status',
178
- ...options,
179
- headers: {
180
- 'Content-Type': 'application/json',
181
- ...options?.headers
182
- }
183
- });
184
- };
185
- exports.updateExecutionStatus = updateExecutionStatus;
186
- /**
187
- * Get the browser session for an execution
188
- */
189
- const getBrowserSession = (options) => {
190
- return (options.client ?? client_gen_1.client).get({
191
- url: '/execution/{id}/browser_session',
192
- ...options
193
- });
194
- };
195
- exports.getBrowserSession = getBrowserSession;
196
- /**
197
- * Set your slack notification channel
198
- */
199
- const setSlackChannel = (options) => {
200
- return (options.client ?? client_gen_1.client).post({
201
- url: '/slack_channel',
202
- ...options,
203
- headers: {
204
- 'Content-Type': 'application/json',
205
- ...options?.headers
206
- }
207
- });
208
- };
209
- exports.setSlackChannel = setSlackChannel;
210
- /**
211
- * Get all workflows and their executions
212
- */
213
- const getAgentWorkflowExecutions = (options) => {
214
- return (options.client ?? client_gen_1.client).get({
215
- url: '/agent/{agent_name}/workflows',
216
- ...options
217
- });
218
- };
219
- exports.getAgentWorkflowExecutions = getAgentWorkflowExecutions;
220
- /**
221
- * Get the progress of an execution
222
- */
223
- const getExecutionProgress = (options) => {
224
- return (options.client ?? client_gen_1.client).get({
225
- url: '/execution/{id}/progress',
226
- ...options
227
- });
228
- };
229
- exports.getExecutionProgress = getExecutionProgress;
230
- /**
231
- * Get files for an execution
232
- */
233
- const getExecutionFiles = (options) => {
234
- return (options.client ?? client_gen_1.client).get({
235
- url: '/execution/{id}/files',
236
59
  ...options
237
60
  });
238
61
  };
239
- exports.getExecutionFiles = getExecutionFiles;
62
+ exports.getExecutionStatus = getExecutionStatus;
240
63
  /**
241
- * Get all versions of a workflow
64
+ * Get execution result
242
65
  */
243
- const getWorkflowVersions = (options) => {
66
+ const getExecutionResult = (options) => {
244
67
  return (options.client ?? client_gen_1.client).get({
245
- url: '/workflow/{workflow_id}/versions',
68
+ security: [
69
+ {
70
+ name: 'X-Asteroid-Agents-Api-Key',
71
+ type: 'apiKey'
72
+ }
73
+ ],
74
+ url: '/execution/{id}/result',
246
75
  ...options
247
76
  });
248
77
  };
249
- exports.getWorkflowVersions = getWorkflowVersions;
250
- /**
251
- * Get all user messages for an execution
252
- */
253
- const getExecutionUserMessages = (options) => {
254
- return (options.client ?? client_gen_1.client).get({
255
- url: '/execution/{id}/user_messages',
256
- ...options
257
- });
258
- };
259
- exports.getExecutionUserMessages = getExecutionUserMessages;
260
- /**
261
- * Create a user message for an execution
262
- */
263
- const createExecutionUserMessage = (options) => {
264
- return (options.client ?? client_gen_1.client).post({
265
- url: '/execution/{id}/user_messages',
266
- ...options,
267
- headers: {
268
- 'Content-Type': 'application/json',
269
- ...options?.headers
270
- }
271
- });
272
- };
273
- exports.createExecutionUserMessage = createExecutionUserMessage;
78
+ exports.getExecutionResult = getExecutionResult;