asteroid-odyssey 1.2.4 → 1.3.0

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.
@@ -1,664 +0,0 @@
1
- /**
2
- * Request to execute an agent with specific parameters
3
- */
4
- export type AgentExecutionRequest = {
5
- [key: string]: unknown;
6
- };
7
- export type ExecutionResponse = {
8
- /**
9
- * The ID of the execution
10
- */
11
- execution_id: string;
12
- };
13
- export type ExecutionStatusResponse = {
14
- /**
15
- * The ID of the execution
16
- */
17
- execution_id: string;
18
- status: Status;
19
- /**
20
- * Reason for the current status (if applicable)
21
- */
22
- reason?: string;
23
- /**
24
- * Time when the status was last updated
25
- */
26
- updated_at?: string;
27
- };
28
- export type ExecutionResultResponse = {
29
- /**
30
- * The ID of the execution
31
- */
32
- execution_id: string;
33
- status: Status;
34
- /**
35
- * (Deprecated, use execution_result instead) The structured result data from the execution. Contains the outcome, reasoning, final answer, and result.
36
- * @deprecated
37
- */
38
- result?: {
39
- [key: string]: unknown;
40
- };
41
- /**
42
- * Error message (if execution failed)
43
- */
44
- error?: string;
45
- execution_result?: ExecutionResult;
46
- };
47
- /**
48
- * The result of an execution. Contains the outcome, reasoning, and result.
49
- */
50
- export type ExecutionResult = {
51
- /**
52
- * The outcome of the execution (success or failure)
53
- */
54
- outcome?: 'success' | 'failure';
55
- /**
56
- * The reasoning behind the execution outcome
57
- */
58
- reasoning?: string;
59
- /**
60
- * The structured result data from the execution. This will follow the format defined in the result_schema of the agent.
61
- */
62
- result?: {
63
- [key: string]: unknown;
64
- };
65
- };
66
- /**
67
- * Status of the execution
68
- */
69
- export type Status = 'starting' | 'running' | 'paused' | 'completed' | 'cancelled' | 'failed' | 'awaiting_confirmation' | 'paused_by_agent';
70
- export type ErrorResponse = {
71
- /**
72
- * Error message
73
- */
74
- error: string;
75
- };
76
- export type BrowserSessionRecordingResponse = {
77
- /**
78
- * The URL of the browser session recording
79
- */
80
- recording_url: string;
81
- };
82
- /**
83
- * Request to execute an agent with structured parameters including optional agent profile configuration
84
- */
85
- export type StructuredAgentExecutionRequest = {
86
- /**
87
- * The ID of the browser profile to use
88
- */
89
- agent_profile_id?: string;
90
- /**
91
- * Dynamic data to be merged into the saved agent configuration.
92
- */
93
- dynamic_data?: {
94
- [key: string]: unknown;
95
- };
96
- };
97
- export type AgentProfile = {
98
- /**
99
- * Unique identifier for the agent profile
100
- */
101
- id: string;
102
- /**
103
- * Name of the agent profile (unique within organization)
104
- */
105
- name: string;
106
- /**
107
- * Description of the agent profile
108
- */
109
- description: string;
110
- /**
111
- * The ID of the organization that the agent profile belongs to
112
- */
113
- organization_id: string;
114
- proxy_cc: CountryCode;
115
- proxy_type: ProxyType;
116
- /**
117
- * Whether the captcha solver is active for this profile
118
- */
119
- captcha_solver_active: boolean;
120
- /**
121
- * Whether the same IP address should be used for all executions of this profile
122
- */
123
- sticky_ip: boolean;
124
- /**
125
- * List of credentials associated with this agent profile
126
- */
127
- credentials: Array<Credential>;
128
- /**
129
- * The date and time the agent profile was created
130
- */
131
- created_at: string;
132
- /**
133
- * The last update time of the agent profile
134
- */
135
- updated_at: string;
136
- };
137
- export type CreateAgentProfileRequest = {
138
- /**
139
- * Name of the agent profile (must be unique within organization)
140
- */
141
- name: string;
142
- /**
143
- * Description of the agent profile
144
- */
145
- description: string;
146
- /**
147
- * The ID of the organization that the agent profile belongs to
148
- */
149
- organization_id: string;
150
- proxy_cc: CountryCode;
151
- proxy_type: ProxyType;
152
- /**
153
- * Whether the captcha solver should be active for this profile
154
- */
155
- captcha_solver_active: boolean;
156
- /**
157
- * Whether the same IP address should be used for all executions of this profile
158
- */
159
- sticky_ip: boolean;
160
- /**
161
- * Optional list of credentials to create with the profile
162
- */
163
- credentials: Array<Credential>;
164
- };
165
- export type UpdateAgentProfileRequest = {
166
- /**
167
- * The name of the agent profile
168
- */
169
- name?: string;
170
- /**
171
- * The description of the agent profile
172
- */
173
- description?: string;
174
- proxy_cc?: CountryCode;
175
- proxy_type?: ProxyType;
176
- /**
177
- * Whether the captcha solver should be active for this profile
178
- */
179
- captcha_solver_active?: boolean;
180
- /**
181
- * Whether the same IP address should be used for all executions of this profile
182
- */
183
- sticky_ip?: boolean;
184
- /**
185
- * List of credentials to add to the profile
186
- */
187
- credentials_to_add?: Array<Credential>;
188
- /**
189
- * List of credential IDs to delete from the profile
190
- */
191
- credentials_to_delete?: Array<string>;
192
- };
193
- /**
194
- * Two-letter country code for proxy location
195
- */
196
- export type CountryCode = 'us' | 'uk' | 'fr' | 'it' | 'jp' | 'au' | 'de' | 'fi' | 'ca';
197
- /**
198
- * Type of proxy to use
199
- */
200
- export type ProxyType = 'residential' | 'mobile';
201
- export type Credential = {
202
- /**
203
- * The unique identifier for this credential
204
- */
205
- id?: string;
206
- /**
207
- * The credential name
208
- */
209
- name: string;
210
- /**
211
- * The encrypted credential
212
- */
213
- data: string;
214
- /**
215
- * When the credential was created
216
- */
217
- created_at?: string;
218
- };
219
- export type GetOpenApiData = {
220
- body?: never;
221
- path?: never;
222
- query?: never;
223
- url: '/openapi.yaml';
224
- };
225
- export type GetOpenApiResponses = {
226
- /**
227
- * OpenAPI schema
228
- */
229
- 200: unknown;
230
- };
231
- export type UploadExecutionFilesData = {
232
- body: {
233
- /**
234
- * Files to upload to the execution
235
- */
236
- files?: Array<Blob | File>;
237
- };
238
- path: {
239
- /**
240
- * The ID of the execution
241
- */
242
- id: string;
243
- };
244
- query?: never;
245
- url: '/execution/{id}/files';
246
- };
247
- export type UploadExecutionFilesErrors = {
248
- /**
249
- * Bad request
250
- */
251
- 400: ErrorResponse;
252
- /**
253
- * Unauthorized
254
- */
255
- 401: ErrorResponse;
256
- /**
257
- * Execution not found
258
- */
259
- 404: ErrorResponse;
260
- };
261
- export type UploadExecutionFilesError = UploadExecutionFilesErrors[keyof UploadExecutionFilesErrors];
262
- export type UploadExecutionFilesResponses = {
263
- /**
264
- * Files uploaded successfully
265
- */
266
- 200: {
267
- /**
268
- * Success message
269
- */
270
- message?: string;
271
- /**
272
- * IDs of the uploaded files
273
- */
274
- file_ids?: Array<string>;
275
- };
276
- };
277
- export type UploadExecutionFilesResponse = UploadExecutionFilesResponses[keyof UploadExecutionFilesResponses];
278
- export type HealthCheckData = {
279
- body?: never;
280
- path?: never;
281
- query?: never;
282
- url: '/health';
283
- };
284
- export type HealthCheckErrors = {
285
- /**
286
- * API is unhealthy
287
- */
288
- 500: {
289
- /**
290
- * The error message
291
- */
292
- error?: string;
293
- };
294
- };
295
- export type HealthCheckError = HealthCheckErrors[keyof HealthCheckErrors];
296
- export type HealthCheckResponses = {
297
- /**
298
- * API is healthy
299
- */
300
- 200: {
301
- /**
302
- * The health status of the API
303
- */
304
- status?: string;
305
- };
306
- };
307
- export type HealthCheckResponse = HealthCheckResponses[keyof HealthCheckResponses];
308
- export type ExecuteAgentData = {
309
- body: AgentExecutionRequest;
310
- path: {
311
- /**
312
- * The ID of the agent
313
- */
314
- id: string;
315
- };
316
- query?: never;
317
- url: '/agent/{id}';
318
- };
319
- export type ExecuteAgentErrors = {
320
- /**
321
- * Invalid request
322
- */
323
- 400: ErrorResponse;
324
- /**
325
- * Agent not found
326
- */
327
- 404: ErrorResponse;
328
- /**
329
- * Internal server error
330
- */
331
- 500: ErrorResponse;
332
- };
333
- export type ExecuteAgentError = ExecuteAgentErrors[keyof ExecuteAgentErrors];
334
- export type ExecuteAgentResponses = {
335
- /**
336
- * Agent execution started successfully
337
- */
338
- 202: ExecutionResponse;
339
- };
340
- export type ExecuteAgentResponse = ExecuteAgentResponses[keyof ExecuteAgentResponses];
341
- export type ExecuteAgentStructuredData = {
342
- body: StructuredAgentExecutionRequest;
343
- path: {
344
- /**
345
- * The ID of the agent
346
- */
347
- id: string;
348
- };
349
- query?: never;
350
- url: '/agent/{id}/execute';
351
- };
352
- export type ExecuteAgentStructuredErrors = {
353
- /**
354
- * Invalid request
355
- */
356
- 400: ErrorResponse;
357
- /**
358
- * Agent not found
359
- */
360
- 404: ErrorResponse;
361
- /**
362
- * Internal server error
363
- */
364
- 500: ErrorResponse;
365
- };
366
- export type ExecuteAgentStructuredError = ExecuteAgentStructuredErrors[keyof ExecuteAgentStructuredErrors];
367
- export type ExecuteAgentStructuredResponses = {
368
- /**
369
- * Agent execution started successfully
370
- */
371
- 202: ExecutionResponse;
372
- };
373
- export type ExecuteAgentStructuredResponse = ExecuteAgentStructuredResponses[keyof ExecuteAgentStructuredResponses];
374
- export type GetExecutionStatusData = {
375
- body?: never;
376
- path: {
377
- /**
378
- * The ID of the execution
379
- */
380
- id: string;
381
- };
382
- query?: never;
383
- url: '/execution/{id}/status';
384
- };
385
- export type GetExecutionStatusErrors = {
386
- /**
387
- * Execution not found
388
- */
389
- 404: ErrorResponse;
390
- /**
391
- * Internal server error
392
- */
393
- 500: ErrorResponse;
394
- };
395
- export type GetExecutionStatusError = GetExecutionStatusErrors[keyof GetExecutionStatusErrors];
396
- export type GetExecutionStatusResponses = {
397
- /**
398
- * Execution status retrieved successfully
399
- */
400
- 200: ExecutionStatusResponse;
401
- };
402
- export type GetExecutionStatusResponse = GetExecutionStatusResponses[keyof GetExecutionStatusResponses];
403
- export type GetExecutionResultData = {
404
- body?: never;
405
- path: {
406
- /**
407
- * The ID of the execution
408
- */
409
- id: string;
410
- };
411
- query?: never;
412
- url: '/execution/{id}/result';
413
- };
414
- export type GetExecutionResultErrors = {
415
- /**
416
- * Execution not found
417
- */
418
- 404: ErrorResponse;
419
- /**
420
- * Internal server error
421
- */
422
- 500: ErrorResponse;
423
- };
424
- export type GetExecutionResultError = GetExecutionResultErrors[keyof GetExecutionResultErrors];
425
- export type GetExecutionResultResponses = {
426
- /**
427
- * Execution result retrieved successfully
428
- */
429
- 200: ExecutionResultResponse;
430
- };
431
- export type GetExecutionResultResponse = GetExecutionResultResponses[keyof GetExecutionResultResponses];
432
- export type GetBrowserSessionRecordingData = {
433
- body?: never;
434
- path: {
435
- /**
436
- * The ID of the execution
437
- */
438
- id: string;
439
- };
440
- query?: never;
441
- url: '/execution/{id}/browser_session/recording';
442
- };
443
- export type GetBrowserSessionRecordingErrors = {
444
- /**
445
- * Browser session not found
446
- */
447
- 404: ErrorResponse;
448
- /**
449
- * Internal server error
450
- */
451
- 500: ErrorResponse;
452
- };
453
- export type GetBrowserSessionRecordingError = GetBrowserSessionRecordingErrors[keyof GetBrowserSessionRecordingErrors];
454
- export type GetBrowserSessionRecordingResponses = {
455
- /**
456
- * Browser session recording retrieved successfully
457
- */
458
- 200: BrowserSessionRecordingResponse;
459
- };
460
- export type GetBrowserSessionRecordingResponse = GetBrowserSessionRecordingResponses[keyof GetBrowserSessionRecordingResponses];
461
- export type GetAgentProfilesData = {
462
- body?: never;
463
- path?: never;
464
- query?: {
465
- /**
466
- * The ID of the organization to filter by
467
- */
468
- organization_id?: string;
469
- };
470
- url: '/agent-profiles';
471
- };
472
- export type GetAgentProfilesErrors = {
473
- /**
474
- * Unauthorized - Authentication required
475
- */
476
- 401: ErrorResponse;
477
- /**
478
- * Forbidden - Insufficient permissions
479
- */
480
- 403: ErrorResponse;
481
- /**
482
- * Internal server error
483
- */
484
- 500: ErrorResponse;
485
- };
486
- export type GetAgentProfilesError = GetAgentProfilesErrors[keyof GetAgentProfilesErrors];
487
- export type GetAgentProfilesResponses = {
488
- /**
489
- * List of agent profiles
490
- */
491
- 200: Array<AgentProfile>;
492
- };
493
- export type GetAgentProfilesResponse = GetAgentProfilesResponses[keyof GetAgentProfilesResponses];
494
- export type CreateAgentProfileData = {
495
- body: CreateAgentProfileRequest;
496
- path?: never;
497
- query?: never;
498
- url: '/agent-profiles';
499
- };
500
- export type CreateAgentProfileErrors = {
501
- /**
502
- * Bad request - Invalid input or profile name already exists
503
- */
504
- 400: ErrorResponse;
505
- /**
506
- * Unauthorized - Authentication required
507
- */
508
- 401: ErrorResponse;
509
- /**
510
- * Forbidden - Insufficient permissions
511
- */
512
- 403: ErrorResponse;
513
- /**
514
- * Internal server error
515
- */
516
- 500: ErrorResponse;
517
- };
518
- export type CreateAgentProfileError = CreateAgentProfileErrors[keyof CreateAgentProfileErrors];
519
- export type CreateAgentProfileResponses = {
520
- /**
521
- * Agent profile created successfully
522
- */
523
- 201: AgentProfile;
524
- };
525
- export type CreateAgentProfileResponse = CreateAgentProfileResponses[keyof CreateAgentProfileResponses];
526
- export type DeleteAgentProfileData = {
527
- body?: never;
528
- path: {
529
- /**
530
- * The ID of the agent profile
531
- */
532
- profile_id: string;
533
- };
534
- query?: never;
535
- url: '/agent-profiles/{profile_id}';
536
- };
537
- export type DeleteAgentProfileErrors = {
538
- /**
539
- * Unauthorized - Authentication required
540
- */
541
- 401: ErrorResponse;
542
- /**
543
- * Forbidden - Insufficient permissions
544
- */
545
- 403: ErrorResponse;
546
- /**
547
- * Agent profile not found
548
- */
549
- 404: ErrorResponse;
550
- /**
551
- * Internal server error
552
- */
553
- 500: ErrorResponse;
554
- };
555
- export type DeleteAgentProfileError = DeleteAgentProfileErrors[keyof DeleteAgentProfileErrors];
556
- export type DeleteAgentProfileResponses = {
557
- /**
558
- * Agent profile deleted successfully
559
- */
560
- 200: {
561
- message?: string;
562
- };
563
- };
564
- export type DeleteAgentProfileResponse = DeleteAgentProfileResponses[keyof DeleteAgentProfileResponses];
565
- export type GetAgentProfileData = {
566
- body?: never;
567
- path: {
568
- /**
569
- * The ID of the agent profile
570
- */
571
- profile_id: string;
572
- };
573
- query?: never;
574
- url: '/agent-profiles/{profile_id}';
575
- };
576
- export type GetAgentProfileErrors = {
577
- /**
578
- * Unauthorized - Authentication required
579
- */
580
- 401: ErrorResponse;
581
- /**
582
- * Forbidden - Insufficient permissions
583
- */
584
- 403: ErrorResponse;
585
- /**
586
- * Agent profile not found
587
- */
588
- 404: ErrorResponse;
589
- /**
590
- * Internal server error
591
- */
592
- 500: ErrorResponse;
593
- };
594
- export type GetAgentProfileError = GetAgentProfileErrors[keyof GetAgentProfileErrors];
595
- export type GetAgentProfileResponses = {
596
- /**
597
- * Agent profile found
598
- */
599
- 200: AgentProfile;
600
- };
601
- export type GetAgentProfileResponse = GetAgentProfileResponses[keyof GetAgentProfileResponses];
602
- export type UpdateAgentProfileData = {
603
- body: UpdateAgentProfileRequest;
604
- path: {
605
- /**
606
- * The ID of the agent profile
607
- */
608
- profile_id: string;
609
- };
610
- query?: never;
611
- url: '/agent-profiles/{profile_id}';
612
- };
613
- export type UpdateAgentProfileErrors = {
614
- /**
615
- * Bad request - Invalid input
616
- */
617
- 400: ErrorResponse;
618
- /**
619
- * Unauthorized - Authentication required
620
- */
621
- 401: ErrorResponse;
622
- /**
623
- * Forbidden - Insufficient permissions
624
- */
625
- 403: ErrorResponse;
626
- /**
627
- * Agent profile not found
628
- */
629
- 404: ErrorResponse;
630
- /**
631
- * Internal server error
632
- */
633
- 500: ErrorResponse;
634
- };
635
- export type UpdateAgentProfileError = UpdateAgentProfileErrors[keyof UpdateAgentProfileErrors];
636
- export type UpdateAgentProfileResponses = {
637
- /**
638
- * Agent profile updated successfully
639
- */
640
- 200: AgentProfile;
641
- };
642
- export type UpdateAgentProfileResponse = UpdateAgentProfileResponses[keyof UpdateAgentProfileResponses];
643
- export type GetCredentialsPublicKeyData = {
644
- body?: never;
645
- path?: never;
646
- query?: never;
647
- url: '/credentials/public_key';
648
- };
649
- export type GetCredentialsPublicKeyErrors = {
650
- /**
651
- * Public key not found
652
- */
653
- 404: unknown;
654
- };
655
- export type GetCredentialsPublicKeyResponses = {
656
- /**
657
- * The public key for credentials
658
- */
659
- 200: string;
660
- };
661
- export type GetCredentialsPublicKeyResponse = GetCredentialsPublicKeyResponses[keyof GetCredentialsPublicKeyResponses];
662
- export type ClientOptions = {
663
- baseUrl: 'https://odyssey.asteroid.ai/api/v1' | `${string}://${string}/api/v1` | (string & {});
664
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file is auto-generated by @hey-api/openapi-ts
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export declare function encryptWithPublicKey(plaintext: string, pemPublicKey: string): string;
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.encryptWithPublicKey = encryptWithPublicKey;
37
- const forge = __importStar(require("node-forge"));
38
- // Utility function to encrypt a plaintext value using a PEM public key
39
- function encryptWithPublicKey(plaintext, pemPublicKey) {
40
- try {
41
- // The public key is already in PEM format from the API
42
- // Parse the public key using node-forge
43
- const publicKey = forge.pki.publicKeyFromPem(pemPublicKey);
44
- // Encrypt the plaintext using RSA
45
- const encrypted = publicKey.encrypt(plaintext, "RSAES-PKCS1-V1_5");
46
- // Convert to base64 for transmission
47
- return forge.util.encode64(encrypted);
48
- }
49
- catch (error) {
50
- console.error("Encryption failed:", error);
51
- throw new Error("Failed to encrypt: " +
52
- (error instanceof Error ? error.message : "unknown error"));
53
- }
54
- }