simplex-ts 1.1.12 → 2.0.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 +163 -56
- package/dist/SimplexClient.d.ts +13 -0
- package/dist/SimplexClient.d.ts.map +1 -0
- package/dist/SimplexClient.js +31 -0
- package/dist/SimplexClient.js.map +1 -0
- package/dist/client/HttpClient.d.ts +33 -0
- package/dist/client/HttpClient.d.ts.map +1 -0
- package/dist/client/HttpClient.js +149 -0
- package/dist/client/HttpClient.js.map +1 -0
- package/dist/errors/index.d.ts +22 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +55 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +4 -43
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -399
- package/dist/index.js.map +1 -1
- package/dist/resources/Agent.d.ts +13 -0
- package/dist/resources/Agent.d.ts.map +1 -0
- package/dist/resources/Agent.js +53 -0
- package/dist/resources/Agent.js.map +1 -0
- package/dist/resources/Workflow.d.ts +38 -0
- package/dist/resources/Workflow.d.ts.map +1 -0
- package/dist/resources/Workflow.js +124 -0
- package/dist/resources/Workflow.js.map +1 -0
- package/dist/types/index.d.ts +80 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +22 -26
- package/dist/index.d.mts +0 -43
- package/dist/index.mjs +0 -366
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Workflow = void 0;
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
class Workflow {
|
|
6
|
+
constructor(httpClient) {
|
|
7
|
+
this.httpClient = httpClient;
|
|
8
|
+
}
|
|
9
|
+
async run(workflowId, options) {
|
|
10
|
+
const request = {
|
|
11
|
+
workflow_id: workflowId,
|
|
12
|
+
variables: options?.variables,
|
|
13
|
+
metadata: options?.metadata,
|
|
14
|
+
webhook_url: options?.webhookUrl,
|
|
15
|
+
};
|
|
16
|
+
try {
|
|
17
|
+
const response = await this.httpClient.post('/run_workflow', request);
|
|
18
|
+
if (!response.succeeded) {
|
|
19
|
+
throw new errors_1.WorkflowError(response.message || 'Workflow execution failed', workflowId, response.session_id);
|
|
20
|
+
}
|
|
21
|
+
return response;
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
if (error instanceof errors_1.WorkflowError) {
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
throw new errors_1.WorkflowError(`Failed to run workflow: ${error instanceof Error ? error.message : 'Unknown error'}`, workflowId);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async runWithVariables(workflowId, variables) {
|
|
31
|
+
return this.run(workflowId, { variables });
|
|
32
|
+
}
|
|
33
|
+
async getStatus(sessionId) {
|
|
34
|
+
try {
|
|
35
|
+
const response = await this.httpClient.get(`/run_workflow_status?session_id=${sessionId}`);
|
|
36
|
+
return response;
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
throw new errors_1.WorkflowError(`Failed to get workflow status: ${error instanceof Error ? error.message : 'Unknown error'}`, undefined, sessionId);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async createWorkflowSession(workflowName, url, options) {
|
|
43
|
+
// Ensure URL has protocol
|
|
44
|
+
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
|
45
|
+
url = 'https://' + url;
|
|
46
|
+
}
|
|
47
|
+
const request = {
|
|
48
|
+
workflow_name: workflowName,
|
|
49
|
+
url: url,
|
|
50
|
+
proxies: options?.proxies,
|
|
51
|
+
session_data: options?.sessionData ? JSON.stringify(options.sessionData) : undefined,
|
|
52
|
+
};
|
|
53
|
+
try {
|
|
54
|
+
const response = await this.httpClient.post('/create_workflow_session', request);
|
|
55
|
+
return response;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
throw new errors_1.WorkflowError(`Failed to create workflow session: ${error instanceof Error ? error.message : 'Unknown error'}`, undefined);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async startSegment(workflowId, segmentName) {
|
|
62
|
+
const request = {
|
|
63
|
+
workflow_id: workflowId,
|
|
64
|
+
segment_name: segmentName,
|
|
65
|
+
};
|
|
66
|
+
try {
|
|
67
|
+
const response = await this.httpClient.post('/start_segment', request);
|
|
68
|
+
return response;
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
throw new errors_1.WorkflowError(`Failed to start segment: ${error instanceof Error ? error.message : 'Unknown error'}`, workflowId);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async finishSegment(workflowId) {
|
|
75
|
+
const request = {
|
|
76
|
+
workflow_id: workflowId,
|
|
77
|
+
};
|
|
78
|
+
try {
|
|
79
|
+
const response = await this.httpClient.post('/finish_segment', request);
|
|
80
|
+
return response;
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
throw new errors_1.WorkflowError(`Failed to finish segment: ${error instanceof Error ? error.message : 'Unknown error'}`, workflowId);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
async startCapture(sessionId) {
|
|
87
|
+
const request = {
|
|
88
|
+
session_id: sessionId,
|
|
89
|
+
};
|
|
90
|
+
try {
|
|
91
|
+
const response = await this.httpClient.post('/start_capture_mode', request);
|
|
92
|
+
return response;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
throw new errors_1.WorkflowError(`Failed to start capture mode: ${error instanceof Error ? error.message : 'Unknown error'}`, undefined, sessionId);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
async stopCapture(sessionId) {
|
|
99
|
+
const request = {
|
|
100
|
+
session_id: sessionId,
|
|
101
|
+
};
|
|
102
|
+
try {
|
|
103
|
+
const response = await this.httpClient.post('/stop_capture_mode', request);
|
|
104
|
+
return response;
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
throw new errors_1.WorkflowError(`Failed to stop capture mode: ${error instanceof Error ? error.message : 'Unknown error'}`, undefined, sessionId);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async closeWorkflowSession(sessionId) {
|
|
111
|
+
const request = {
|
|
112
|
+
session_id: sessionId,
|
|
113
|
+
};
|
|
114
|
+
try {
|
|
115
|
+
const response = await this.httpClient.post('/close_workflow_session', request);
|
|
116
|
+
return response;
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
throw new errors_1.WorkflowError(`Failed to close workflow session: ${error instanceof Error ? error.message : 'Unknown error'}`, undefined, sessionId);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
exports.Workflow = Workflow;
|
|
124
|
+
//# sourceMappingURL=Workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Workflow.js","sourceRoot":"","sources":["../../src/resources/Workflow.ts"],"names":[],"mappings":";;;AASA,sCAA0C;AAE1C,MAAa,QAAQ;IACnB,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAE9C,KAAK,CAAC,GAAG,CACP,UAAkB,EAClB,OAIC;QAED,MAAM,OAAO,GAAuB;YAClC,WAAW,EAAE,UAAU;YACvB,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,QAAQ,EAAE,OAAO,EAAE,QAAQ;YAC3B,WAAW,EAAE,OAAO,EAAE,UAAU;SACjC,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACzC,eAAe,EACf,OAAO,CACR,CAAC;YAEF,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;gBACxB,MAAM,IAAI,sBAAa,CACrB,QAAQ,CAAC,OAAO,IAAI,2BAA2B,EAC/C,UAAU,EACV,QAAQ,CAAC,UAAU,CACpB,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MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CACzC,yBAAyB,EACzB,OAAO,CACR,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,sBAAa,CACrB,qCAAqC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,EAC/F,SAAS,EACT,SAAS,CACV,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAxND,4BAwNC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export interface SimplexConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseURL?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
maxRetries?: number;
|
|
6
|
+
retryDelay?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkflowVariables {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export interface RunWorkflowRequest {
|
|
12
|
+
workflow_id: string;
|
|
13
|
+
metadata?: string;
|
|
14
|
+
webhook_url?: string;
|
|
15
|
+
variables?: WorkflowVariables;
|
|
16
|
+
}
|
|
17
|
+
export interface RunWorkflowResponse {
|
|
18
|
+
succeeded: boolean;
|
|
19
|
+
message: string;
|
|
20
|
+
session_id: string;
|
|
21
|
+
vnc_url: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SimplexClientOptions {
|
|
24
|
+
apiKey: string;
|
|
25
|
+
baseURL?: string;
|
|
26
|
+
timeout?: number;
|
|
27
|
+
maxRetries?: number;
|
|
28
|
+
retryDelay?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface AgenticRequest {
|
|
31
|
+
task: string;
|
|
32
|
+
session_id: string;
|
|
33
|
+
max_steps?: number;
|
|
34
|
+
actions_to_exclude?: string[];
|
|
35
|
+
variables?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface AgenticResponse {
|
|
38
|
+
succeeded: boolean;
|
|
39
|
+
result: any;
|
|
40
|
+
error?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface RunAgentRequest {
|
|
43
|
+
agent_name: string;
|
|
44
|
+
session_id: string;
|
|
45
|
+
variables?: Record<string, any>;
|
|
46
|
+
}
|
|
47
|
+
export interface RunAgentResponse {
|
|
48
|
+
succeeded: boolean;
|
|
49
|
+
session_id: string;
|
|
50
|
+
agent_name: string;
|
|
51
|
+
result: any;
|
|
52
|
+
}
|
|
53
|
+
export interface WorkflowAction {
|
|
54
|
+
action: string;
|
|
55
|
+
params: any;
|
|
56
|
+
result: any;
|
|
57
|
+
timestamp: string;
|
|
58
|
+
}
|
|
59
|
+
export interface WorkflowStatusResponse {
|
|
60
|
+
succeeded: boolean;
|
|
61
|
+
completed: boolean;
|
|
62
|
+
results: WorkflowAction[];
|
|
63
|
+
total_actions: number;
|
|
64
|
+
session_id: string;
|
|
65
|
+
completed_at?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface CreateWorkflowSessionRequest {
|
|
68
|
+
workflow_name: string;
|
|
69
|
+
url: string;
|
|
70
|
+
proxies?: boolean;
|
|
71
|
+
session_data?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface CreateWorkflowSessionResponse {
|
|
74
|
+
session_id: string;
|
|
75
|
+
workflow_id: string;
|
|
76
|
+
livestream_url: string;
|
|
77
|
+
connect_url: string;
|
|
78
|
+
vnc_url: string;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACr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AAE,GAAG,CAAC;CACb;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,GAAG,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,40 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simplex-ts",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"module": "./dist/index.mjs",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist",
|
|
10
|
-
"dist/**/*.d.ts",
|
|
11
|
-
"dist/**/*.d.mts"
|
|
12
|
-
],
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
13
6
|
"scripts": {
|
|
14
|
-
"build": "
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"clean": "rm -rf dist",
|
|
9
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
10
|
+
"dev": "tsc --watch",
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
19
12
|
},
|
|
20
13
|
"keywords": [
|
|
14
|
+
"simplex",
|
|
15
|
+
"api",
|
|
16
|
+
"sdk",
|
|
21
17
|
"typescript",
|
|
22
|
-
"
|
|
18
|
+
"workflow"
|
|
23
19
|
],
|
|
24
20
|
"author": "",
|
|
25
21
|
"license": "MIT",
|
|
22
|
+
"description": "Official TypeScript SDK for the Simplex API",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist/**/*"
|
|
25
|
+
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"rimraf": "^5.0.5",
|
|
32
|
-
"ts-jest": "^29.1.2",
|
|
33
|
-
"tsup": "^8.0.2",
|
|
34
|
-
"typescript": "^5.3.3"
|
|
27
|
+
"@types/node": "^24.5.2",
|
|
28
|
+
"nodemon": "^3.1.10",
|
|
29
|
+
"tsx": "^4.20.6",
|
|
30
|
+
"typescript": "^5.9.2"
|
|
35
31
|
},
|
|
36
32
|
"dependencies": {
|
|
37
|
-
"axios": "^1.
|
|
38
|
-
"dotenv": "^
|
|
33
|
+
"axios": "^1.12.2",
|
|
34
|
+
"dotenv": "^17.2.2"
|
|
39
35
|
}
|
|
40
36
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Example function to demonstrate package usage
|
|
3
|
-
* @param name - The name to greet
|
|
4
|
-
* @returns A greeting message
|
|
5
|
-
*/
|
|
6
|
-
declare function greet(name: string): string;
|
|
7
|
-
interface SessionData {
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
}
|
|
10
|
-
declare class Simplex {
|
|
11
|
-
private apiKey;
|
|
12
|
-
private sessionId;
|
|
13
|
-
private connectUrl;
|
|
14
|
-
constructor(apiKey: string);
|
|
15
|
-
private makeRequest;
|
|
16
|
-
createSession(showInConsole?: boolean, proxies?: boolean, workflowName?: string, sessionData?: SessionData | string): Promise<[string, string]>;
|
|
17
|
-
goto(url: string, cdpUrl?: string): Promise<void>;
|
|
18
|
-
click(elementDescription: string, dropdownOptions?: boolean, cdpUrl?: string): Promise<string>;
|
|
19
|
-
hover(elementDescription: string, cdpUrl?: string): Promise<void>;
|
|
20
|
-
scrollToElement(elementDescription: string, cdpUrl?: string): Promise<void>;
|
|
21
|
-
getNetworkResponse(url: string, cdpUrl?: string): Promise<string>;
|
|
22
|
-
type(text: string, cdpUrl?: string): Promise<void>;
|
|
23
|
-
pressEnter(cdpUrl?: string): Promise<void>;
|
|
24
|
-
pressTab(cdpUrl?: string): Promise<void>;
|
|
25
|
-
deleteText(cdpUrl?: string): Promise<void>;
|
|
26
|
-
extractBbox(elementDescription: string, cdpUrl?: string): Promise<any>;
|
|
27
|
-
extractText(elementDescription: string, cdpUrl?: string): Promise<string>;
|
|
28
|
-
scroll(pixels: number, cdpUrl?: string): Promise<void>;
|
|
29
|
-
wait(milliseconds: number, cdpUrl?: string): Promise<void>;
|
|
30
|
-
clickAndUpload(elementDescription: string, filePathOrCallable: string | (() => Blob)): Promise<void>;
|
|
31
|
-
clickAndDownload(elementDescription: string): Promise<[string, string]>;
|
|
32
|
-
exists(elementDescription: string, cdpUrl?: string, maxSteps?: number): Promise<[boolean, string]>;
|
|
33
|
-
getPageURL(cdpUrl?: string): Promise<string>;
|
|
34
|
-
captureLoginSession(cdpUrl?: string): Promise<string>;
|
|
35
|
-
closeSession(): Promise<void>;
|
|
36
|
-
captchaExists(): Promise<boolean>;
|
|
37
|
-
waitForCaptcha(): Promise<boolean>;
|
|
38
|
-
setDialogSettings(accept: boolean): Promise<void>;
|
|
39
|
-
getDialogMessage(): Promise<string | undefined>;
|
|
40
|
-
enqueueActions(actions: any[]): Promise<void>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { Simplex, greet };
|