cloudcruise 0.0.2-alpha.0 → 0.0.2-alpha.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.
- package/README.md +2 -2
- package/dist/CloudCruise.js +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/runs/RunsClient.d.ts +2 -2
- package/dist/runs/types.d.ts +34 -10
- package/dist/vault/VaultClient.d.ts +18 -4
- package/dist/vault/VaultClient.js +25 -10
- package/dist/vault/types.d.ts +11 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# cloudcruise-js
|
|
2
2
|
|
|
3
3
|
[](https://opensource.org/licenses/MIT)
|
|
4
|
-
|
|
4
|
+

|
|
5
5
|
[](https://github.com/CloudCruise/cloudcruise-js)
|
|
6
|
-
[](https://discord.com/invite/MHjbUqedZF)
|
|
7
7
|
[](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.
|
package/dist/CloudCruise.js
CHANGED
|
@@ -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
|
-
|
|
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,
|
|
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,
|
|
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<
|
|
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
|
package/dist/runs/types.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
52
|
-
|
|
53
|
-
|
|
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:
|
|
69
|
-
screenshot_urls:
|
|
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<
|
|
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(
|
|
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
|
|
25
|
-
* @param
|
|
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(
|
|
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(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
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
|
|
71
|
-
* @param
|
|
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(
|
|
74
|
-
await this.makeRequest('DELETE', '/vault',
|
|
88
|
+
async delete(params) {
|
|
89
|
+
await this.makeRequest('DELETE', '/vault', params);
|
|
75
90
|
}
|
|
76
91
|
}
|
package/dist/vault/types.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface ProxyConfig {
|
|
|
10
10
|
target_ip?: string;
|
|
11
11
|
}
|
|
12
12
|
export interface VaultEntry {
|
|
13
|
-
id
|
|
13
|
+
id: string;
|
|
14
14
|
domain: string;
|
|
15
15
|
permissioned_user_id: string;
|
|
16
16
|
workspace_id?: string;
|
|
@@ -24,17 +24,24 @@ export interface VaultEntry {
|
|
|
24
24
|
ip_address?: string;
|
|
25
25
|
session_id?: string;
|
|
26
26
|
allow_multiple_sessions?: boolean;
|
|
27
|
+
prevent_concurrency_during_login?: boolean | null;
|
|
28
|
+
max_concurrency?: number | null;
|
|
29
|
+
expiry_time_from_last_use?: string | null;
|
|
30
|
+
expiry_time_from_session_data_set?: string | null;
|
|
31
|
+
tfa_method?: 'AUTHENTICATOR' | 'EMAIL' | 'SMS' | null;
|
|
27
32
|
cookies?: any;
|
|
28
33
|
local_storage?: any;
|
|
29
34
|
session_storage?: any;
|
|
30
|
-
persist_cookies?: boolean;
|
|
31
|
-
persist_local_storage?: boolean;
|
|
32
|
-
persist_session_storage?: boolean;
|
|
35
|
+
persist_cookies?: boolean | null;
|
|
36
|
+
persist_local_storage?: boolean | null;
|
|
37
|
+
persist_session_storage?: boolean | null;
|
|
33
38
|
cookie_domain_to_store?: string | null;
|
|
34
39
|
proxy?: ProxyConfig;
|
|
35
40
|
proxy_string?: string | null;
|
|
36
41
|
headers?: VaultPostPutHeadersInBody[];
|
|
37
42
|
created_at?: string | null;
|
|
43
|
+
session_data_set_at?: string | null;
|
|
44
|
+
effective_expires_at?: string | null;
|
|
38
45
|
}
|
|
39
46
|
export interface GetVaultEntriesFilters {
|
|
40
47
|
permissioned_user_id?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcruise",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.2",
|
|
4
4
|
"description": "The official CloudCruise JS/TS client.",
|
|
5
5
|
"homepage": "https://github.com/CloudCruise/cloudcruise-js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "tsc",
|
|
23
23
|
"dev": "tsc --watch",
|
|
24
|
-
"test": "
|
|
24
|
+
"test": "pnpm build && node --test test/*.test.js"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^20.0.0",
|