asteroid-odyssey 1.0.24 → 1.1.2

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
- 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';
1
+ import { type Options as ClientOptions, type TDataShape, type Client } from '@hey-api/client-fetch';
2
+ import type { GetOpenApiData, UploadExecutionFilesData, HealthCheckData, ExecuteAgentData, ExecuteAgentStructuredData, GetExecutionStatusData, GetExecutionResultData, GetBrowserSessionRecordingData } 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
@@ -17,6 +17,13 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
17
17
  * Get the OpenAPI schema
18
18
  */
19
19
  export declare const getOpenApi: <ThrowOnError extends boolean = false>(options?: Options<GetOpenApiData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
20
+ /**
21
+ * Upload files to an execution
22
+ */
23
+ export declare const uploadExecutionFiles: <ThrowOnError extends boolean = false>(options: Options<UploadExecutionFilesData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
24
+ message?: string;
25
+ file_ids?: Array<string>;
26
+ }, import("./types.gen").ErrorResponse, ThrowOnError>;
20
27
  /**
21
28
  * Check the health of the API
22
29
  */
@@ -26,98 +33,25 @@ export declare const healthCheck: <ThrowOnError extends boolean = false>(options
26
33
  error?: string;
27
34
  }, ThrowOnError>;
28
35
  /**
29
- * Get all agents
30
- */
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
- /**
33
- * Queue an optimisation job
34
- */
35
- export declare const queueOptimisationJob: <ThrowOnError extends boolean = false>(options?: Options<QueueOptimisationJobData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
36
- /**
37
- * Create a new workflow for an agent
38
- */
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
36
+ * Execute an agent
37
+ * Executes an agent with the provided parameters
106
38
  */
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>;
39
+ 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>;
108
40
  /**
109
- * Get files for an execution
41
+ * Execute an agent with structured parameters
42
+ * Executes an agent with structured parameters including optional agent profile configuration. This is the recommended method for new integrations.
110
43
  */
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>;
44
+ export declare const executeAgentStructured: <ThrowOnError extends boolean = false>(options: Options<ExecuteAgentStructuredData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ExecutionResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
112
45
  /**
113
- * Get all versions of a workflow
46
+ * Get execution status
114
47
  */
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>;
48
+ 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>;
116
49
  /**
117
- * Get all user messages for an execution
50
+ * Get execution result
118
51
  */
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>;
52
+ 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>;
120
53
  /**
121
- * Create a user message for an execution
54
+ * Get browser session recording
55
+ * Retrieves the browser session recording URL for a completed execution
122
56
  */
123
- export declare const createExecutionUserMessage: <ThrowOnError extends boolean = false>(options: Options<CreateExecutionUserMessageData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
57
+ export declare const getBrowserSessionRecording: <ThrowOnError extends boolean = false>(options: Options<GetBrowserSessionRecordingData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").BrowserSessionRecordingResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
@@ -1,7 +1,8 @@
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.getBrowserSessionRecording = exports.getExecutionResult = exports.getExecutionStatus = exports.executeAgentStructured = exports.executeAgent = exports.healthCheck = exports.uploadExecutionFiles = exports.getOpenApi = void 0;
5
+ const client_fetch_1 = require("@hey-api/client-fetch");
5
6
  const client_gen_1 = require("./client.gen");
6
7
  /**
7
8
  * Get the OpenAPI schema
@@ -14,167 +15,49 @@ const getOpenApi = (options) => {
14
15
  };
15
16
  exports.getOpenApi = getOpenApi;
16
17
  /**
17
- * Check the health of the API
18
- */
19
- const healthCheck = (options) => {
20
- return (options?.client ?? client_gen_1.client).get({
21
- url: '/health',
22
- ...options
23
- });
24
- };
25
- exports.healthCheck = healthCheck;
26
- /**
27
- * Get all agents
28
- */
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) => {
54
- return (options.client ?? client_gen_1.client).post({
55
- url: '/workflow/{agent_name}/create',
56
- ...options,
57
- headers: {
58
- 'Content-Type': 'application/json',
59
- ...options?.headers
60
- }
61
- });
62
- };
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;
74
- /**
75
- * Get a workflow
76
- */
77
- const getWorkflow = (options) => {
78
- 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
18
+ * Upload files to an execution
86
19
  */
87
- const executeWorkflow = (options) => {
20
+ const uploadExecutionFiles = (options) => {
88
21
  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',
22
+ ...client_fetch_1.formDataBodySerializer,
23
+ security: [
24
+ {
25
+ name: 'X-Asteroid-Agents-Api-Key',
26
+ type: 'apiKey'
27
+ }
28
+ ],
29
+ url: '/execution/{id}/files',
134
30
  ...options,
135
31
  headers: {
136
- 'Content-Type': 'application/json',
32
+ 'Content-Type': null,
137
33
  ...options?.headers
138
34
  }
139
35
  });
140
36
  };
141
- exports.addWorkflowCredential = addWorkflowCredential;
37
+ exports.uploadExecutionFiles = uploadExecutionFiles;
142
38
  /**
143
- * Get the public key for credentials
39
+ * Check the health of the API
144
40
  */
145
- const getCredentialsPublicKey = (options) => {
41
+ const healthCheck = (options) => {
146
42
  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}',
43
+ url: '/health',
168
44
  ...options
169
45
  });
170
46
  };
171
- exports.getExecution = getExecution;
47
+ exports.healthCheck = healthCheck;
172
48
  /**
173
- * Update the status of an execution
49
+ * Execute an agent
50
+ * Executes an agent with the provided parameters
174
51
  */
175
- const updateExecutionStatus = (options) => {
52
+ const executeAgent = (options) => {
176
53
  return (options.client ?? client_gen_1.client).post({
177
- url: '/execution/{id}/status',
54
+ security: [
55
+ {
56
+ name: 'X-Asteroid-Agents-Api-Key',
57
+ type: 'apiKey'
58
+ }
59
+ ],
60
+ url: '/agent/{id}',
178
61
  ...options,
179
62
  headers: {
180
63
  'Content-Type': 'application/json',
@@ -182,23 +65,20 @@ const updateExecutionStatus = (options) => {
182
65
  }
183
66
  });
184
67
  };
185
- exports.updateExecutionStatus = updateExecutionStatus;
68
+ exports.executeAgent = executeAgent;
186
69
  /**
187
- * Get the browser session for an execution
70
+ * Execute an agent with structured parameters
71
+ * Executes an agent with structured parameters including optional agent profile configuration. This is the recommended method for new integrations.
188
72
  */
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) => {
73
+ const executeAgentStructured = (options) => {
200
74
  return (options.client ?? client_gen_1.client).post({
201
- url: '/slack_channel',
75
+ security: [
76
+ {
77
+ name: 'X-Asteroid-Agents-Api-Key',
78
+ type: 'apiKey'
79
+ }
80
+ ],
81
+ url: '/agent/{id}/execute',
202
82
  ...options,
203
83
  headers: {
204
84
  'Content-Type': 'application/json',
@@ -206,68 +86,53 @@ const setSlackChannel = (options) => {
206
86
  }
207
87
  });
208
88
  };
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;
89
+ exports.executeAgentStructured = executeAgentStructured;
230
90
  /**
231
- * Get files for an execution
91
+ * Get execution status
232
92
  */
233
- const getExecutionFiles = (options) => {
93
+ const getExecutionStatus = (options) => {
234
94
  return (options.client ?? client_gen_1.client).get({
235
- url: '/execution/{id}/files',
95
+ security: [
96
+ {
97
+ name: 'X-Asteroid-Agents-Api-Key',
98
+ type: 'apiKey'
99
+ }
100
+ ],
101
+ url: '/execution/{id}/status',
236
102
  ...options
237
103
  });
238
104
  };
239
- exports.getExecutionFiles = getExecutionFiles;
105
+ exports.getExecutionStatus = getExecutionStatus;
240
106
  /**
241
- * Get all versions of a workflow
107
+ * Get execution result
242
108
  */
243
- const getWorkflowVersions = (options) => {
109
+ const getExecutionResult = (options) => {
244
110
  return (options.client ?? client_gen_1.client).get({
245
- url: '/workflow/{workflow_id}/versions',
111
+ security: [
112
+ {
113
+ name: 'X-Asteroid-Agents-Api-Key',
114
+ type: 'apiKey'
115
+ }
116
+ ],
117
+ url: '/execution/{id}/result',
246
118
  ...options
247
119
  });
248
120
  };
249
- exports.getWorkflowVersions = getWorkflowVersions;
121
+ exports.getExecutionResult = getExecutionResult;
250
122
  /**
251
- * Get all user messages for an execution
123
+ * Get browser session recording
124
+ * Retrieves the browser session recording URL for a completed execution
252
125
  */
253
- const getExecutionUserMessages = (options) => {
126
+ const getBrowserSessionRecording = (options) => {
254
127
  return (options.client ?? client_gen_1.client).get({
255
- url: '/execution/{id}/user_messages',
128
+ security: [
129
+ {
130
+ name: 'X-Asteroid-Agents-Api-Key',
131
+ type: 'apiKey'
132
+ }
133
+ ],
134
+ url: '/execution/{id}/browser_session/recording',
256
135
  ...options
257
136
  });
258
137
  };
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;
138
+ exports.getBrowserSessionRecording = getBrowserSessionRecording;