cloudcruise 0.0.2-alpha.0 → 0.0.2-alpha.1

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/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # cloudcruise-js
2
2
 
3
3
  [![MIT License](https://img.shields.io/badge/License-MIT-red.svg?style=flat-square)](https://opensource.org/licenses/MIT)
4
- [![NPM version](https://img.shields.io/npm/v/cloudcruise.svg?style=flat-square)](https://www.npmjs.com/package/cloudcruise)
4
+ ![NPM Downloads](https://img.shields.io/npm/dw/cloudcruise)
5
5
  [![GitHub Repo stars](https://img.shields.io/github/stars/CloudCruise/cloudcruise-js?style=flat-square&logo=GitHub&label=cloudcruise-js)](https://github.com/CloudCruise/cloudcruise-js)
6
- [![Discord](https://img.shields.io/discord/1111061815649124414?style=flat-square&logo=Discord&logoColor=white&label=Discord&color=%23434EE4)](https://discord.com/invite/MHjbUqedZF)
6
+ [![Discord](https://img.shields.io/discord/1227480834945318933?style=flat-square&logo=Discord&logoColor=white&label=Discord&color=%23434EE4)](https://discord.com/invite/MHjbUqedZF)
7
7
  [![YC W24](https://img.shields.io/badge/Y%20Combinator-W24-orange?style=flat-square)](https://www.ycombinator.com/companies/cloudcruise)
8
8
 
9
9
  The official CloudCruise JavaScript/TypeScript client library for automated browser workflows, credential management, and real-time monitoring.
@@ -63,8 +63,7 @@ export class CloudCruise {
63
63
  }
64
64
  const contentType = response.headers.get('content-type');
65
65
  if (contentType && contentType.includes('application/json')) {
66
- const jsonResponse = await response.json();
67
- return jsonResponse.data || jsonResponse;
66
+ return await response.json();
68
67
  }
69
68
  else {
70
69
  return await response.text();
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export { RunsClient } from './runs/RunsClient.js';
10
10
  export { WebhookClient } from './webhook/WebhookClient.js';
11
11
  export type { VaultEntry, GetVaultEntriesFilters, ProxyConfig, VaultPostPutHeadersInBody } from './vault/types.js';
12
12
  export type { Workflow, WorkflowInputSchema, WorkflowMetadata } from './workflows/types.js';
13
- export type { EventType, DryRun, Metadata, RunSpecificWebhook, PayloadWebhook, StartRunRequest, StartRunResponse, UserInteractionData, VideoUrl, FileUrl, ScreenshotUrl, RunError, RunResult, WebhookEvent, WebhookReplayResponse, RunHandle, RunStreamOptions, SseEventName, SseMessage, RunEventEnvelope } from './runs/types.js';
13
+ export type { EventType, DryRun, Metadata, RunSpecificWebhook, PayloadWebhook, StartRunRequest, StartRunResponse, UserInteractionData, VideoUrl, SignedFileUrl, SignedScreenshotUrl, RunError, WorkflowError, RunResult, GetRunResult, WebhookEvent, WebhookReplayResponse, RunHandle, RunStreamOptions, SseEventName, SseMessage, RunEventEnvelope } from './runs/types.js';
14
14
  export type { WebhookPayload, WebhookVerificationOptions } from './webhook/types.js';
15
15
  export { VerificationError } from './webhook/types.js';
16
16
  export { InputValidationError } from './workflows/types.js';
@@ -1,4 +1,4 @@
1
- import type { StartRunRequest, UserInteractionData, RunResult, WebhookReplayResponse, RunHandle, RunStreamOptions } from './types.js';
1
+ import type { StartRunRequest, UserInteractionData, GetRunResult, WebhookReplayResponse, RunHandle, RunStreamOptions } from './types.js';
2
2
  import { ConnectionManager } from '../utils/connectionManager.js';
3
3
  export declare class RunsClient {
4
4
  private readonly makeRequest;
@@ -27,7 +27,7 @@ export declare class RunsClient {
27
27
  * @param sessionId - The unique identifier for the workflow execution session
28
28
  * @returns Promise resolving to complete run results
29
29
  */
30
- getResults(sessionId: string): Promise<RunResult>;
30
+ getResults(sessionId: string): Promise<GetRunResult>;
31
31
  /**
32
32
  * Interrupts a running browser agent run
33
33
  * @param sessionId - The unique identifier for the workflow execution session
@@ -34,26 +34,37 @@ export interface VideoUrl {
34
34
  signed_screen_recording_url: string;
35
35
  signed_screen_recording_url_expires: string;
36
36
  }
37
- export interface FileUrl {
37
+ export interface RunError {
38
+ prompt?: string | null;
39
+ message?: string | null;
40
+ error_id?: string | null;
41
+ full_url?: string | null;
42
+ llm_model?: string | null;
43
+ created_at?: string | null;
44
+ error_code?: string | null;
45
+ action_type?: string | null;
46
+ action_display_name?: string | null;
47
+ }
48
+ export interface SignedFileUrl {
38
49
  signed_file_url: string;
39
50
  file_name: string;
40
51
  timestamp: string;
41
52
  signed_file_url_expires: string;
42
53
  metadata: Record<string, any>;
43
54
  }
44
- export interface ScreenshotUrl {
55
+ export interface SignedScreenshotUrl {
45
56
  signed_screenshot_url: string;
46
57
  node_display_name: string;
47
58
  timestamp: string;
48
59
  signed_screenshot_url_expires: string;
49
60
  error_screenshot: boolean;
61
+ full_length_screenshot?: boolean;
62
+ retry_index?: number;
50
63
  }
51
- export interface RunError {
52
- prompt?: string | null;
53
- message?: string | null;
54
- error_id?: string | null;
64
+ export interface WorkflowError {
65
+ message: string;
66
+ error_id: string;
55
67
  full_url?: string | null;
56
- llm_model?: string | null;
57
68
  created_at?: string | null;
58
69
  error_code?: string | null;
59
70
  action_type?: string | null;
@@ -65,10 +76,23 @@ export interface RunResult {
65
76
  input_variables: Record<string, any>;
66
77
  data: Record<string, any>;
67
78
  video_urls: VideoUrl[];
68
- file_urls: FileUrl[];
69
- screenshot_urls: ScreenshotUrl[];
79
+ file_urls: SignedFileUrl[];
80
+ screenshot_urls: SignedScreenshotUrl[];
70
81
  errors: RunError[] | null;
71
82
  }
83
+ export interface GetRunResult {
84
+ data: Record<string, any> | null;
85
+ session_id: string;
86
+ errors: WorkflowError[];
87
+ status: EventType;
88
+ input_variables: Record<string, any>;
89
+ workflow_id: string | null;
90
+ session_retries: number | null;
91
+ encrypted_variables: string[] | null;
92
+ video_urls: VideoUrl[] | null;
93
+ screenshot_urls?: SignedScreenshotUrl[] | null;
94
+ file_urls: SignedFileUrl[] | null;
95
+ }
72
96
  export interface WebhookEvent {
73
97
  success: boolean;
74
98
  response: string;
@@ -119,7 +143,7 @@ export interface RunStreamOptions {
119
143
  export interface RunHandle {
120
144
  sessionId: string;
121
145
  on(event: 'open' | 'reconnect' | 'error' | 'end' | SseEventName | 'message', handler: (e: unknown) => void): () => void;
122
- wait(): Promise<RunResult>;
146
+ wait(): Promise<GetRunResult>;
123
147
  close(): void;
124
148
  [Symbol.asyncIterator](): AsyncIterator<SseMessage>;
125
149
  }
@@ -17,12 +17,26 @@ export declare class VaultClient {
17
17
  get(filters?: GetVaultEntriesFilters): Promise<VaultEntry[]>;
18
18
  /**
19
19
  * Updates an existing vault entry
20
+ * @param updates - Vault entry updates including required fields
21
+ * @param updates.permissioned_user_id - Required: User identifier for the vault entry
22
+ * @param updates.user_name - Required: Username or email
23
+ * @param updates.password - Required: User password
24
+ * @param updates.domain - Required: Target domain for the credentials
20
25
  */
21
- update(id: string, updates: Partial<VaultEntry>): Promise<VaultEntry>;
26
+ update(updates: Partial<VaultEntry> & {
27
+ permissioned_user_id: string;
28
+ user_name: string;
29
+ password: string;
30
+ domain: string;
31
+ }): Promise<VaultEntry>;
22
32
  /**
23
33
  * Deletes a vault entry by domain and permissioned user ID
24
- * @param domain - The domain of the vault entry to delete
25
- * @param permissioned_user_id - The permissioned user ID of the vault entry to delete
34
+ * @param params - Object containing domain and permissioned_user_id
35
+ * @param params.domain - The domain of the vault entry to delete
36
+ * @param params.permissioned_user_id - The permissioned user ID of the vault entry to delete
26
37
  */
27
- delete(domain: string, permissioned_user_id: string): Promise<void>;
38
+ delete(params: {
39
+ domain: string;
40
+ permissioned_user_id: string;
41
+ }): Promise<void>;
28
42
  }
@@ -52,13 +52,27 @@ export class VaultClient {
52
52
  }
53
53
  /**
54
54
  * Updates an existing vault entry
55
+ * @param updates - Vault entry updates including required fields
56
+ * @param updates.permissioned_user_id - Required: User identifier for the vault entry
57
+ * @param updates.user_name - Required: Username or email
58
+ * @param updates.password - Required: User password
59
+ * @param updates.domain - Required: Target domain for the credentials
55
60
  */
56
- async update(id, updates) {
57
- const entry = {
58
- id,
59
- ...updates
60
- };
61
- let processedEntry = { ...entry };
61
+ async update(updates) {
62
+ // Validate required fields
63
+ if (!updates.permissioned_user_id) {
64
+ throw new Error('permissioned_user_id is required for vault updates');
65
+ }
66
+ if (!updates.user_name) {
67
+ throw new Error('user_name is required for vault updates');
68
+ }
69
+ if (!updates.password) {
70
+ throw new Error('password is required for vault updates');
71
+ }
72
+ if (!updates.domain) {
73
+ throw new Error('domain is required for vault updates');
74
+ }
75
+ let processedEntry = { ...updates };
62
76
  // Encrypt sensitive fields
63
77
  processedEntry = await encryptSensitiveFields(processedEntry, this.encryptionKey);
64
78
  const response = await this.makeRequest('PUT', '/vault', processedEntry);
@@ -67,10 +81,11 @@ export class VaultClient {
67
81
  }
68
82
  /**
69
83
  * Deletes a vault entry by domain and permissioned user ID
70
- * @param domain - The domain of the vault entry to delete
71
- * @param permissioned_user_id - The permissioned user ID of the vault entry to delete
84
+ * @param params - Object containing domain and permissioned_user_id
85
+ * @param params.domain - The domain of the vault entry to delete
86
+ * @param params.permissioned_user_id - The permissioned user ID of the vault entry to delete
72
87
  */
73
- async delete(domain, permissioned_user_id) {
74
- await this.makeRequest('DELETE', '/vault', { domain, permissioned_user_id });
88
+ async delete(params) {
89
+ await this.makeRequest('DELETE', '/vault', params);
75
90
  }
76
91
  }
@@ -10,7 +10,7 @@ export interface ProxyConfig {
10
10
  target_ip?: string;
11
11
  }
12
12
  export interface VaultEntry {
13
- id?: string;
13
+ id: string;
14
14
  domain: string;
15
15
  permissioned_user_id: string;
16
16
  workspace_id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcruise",
3
- "version": "0.0.2-alpha.0",
3
+ "version": "0.0.2-alpha.1",
4
4
  "description": "The official CloudCruise JS/TS client.",
5
5
  "homepage": "https://github.com/CloudCruise/cloudcruise-js#readme",
6
6
  "bugs": {