@fractal-solutions/qflow 1.0.62 → 1.0.64
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/dist/agent/tools.d.ts +1 -5378
- package/dist/agent/tools.js +145 -1171
- package/dist/nodes/browser_control.d.ts +31 -0
- package/dist/nodes/browser_control.js +33 -0
- package/dist/nodes/code_interpreter.d.ts +29 -0
- package/dist/nodes/code_interpreter.js +29 -0
- package/dist/nodes/data_extractor.d.ts +35 -0
- package/dist/nodes/data_extractor.js +37 -0
- package/dist/nodes/data_validation.d.ts +27 -0
- package/dist/nodes/data_validation.js +29 -0
- package/dist/nodes/database.d.ts +44 -0
- package/dist/nodes/database.js +46 -0
- package/dist/nodes/display_image.d.ts +14 -0
- package/dist/nodes/display_image.js +16 -0
- package/dist/nodes/embedding.d.ts +22 -0
- package/dist/nodes/embedding.js +24 -0
- package/dist/nodes/filesystem.d.ts +64 -0
- package/dist/nodes/filesystem.js +72 -0
- package/dist/nodes/gis.d.ts +25 -0
- package/dist/nodes/gis.js +27 -0
- package/dist/nodes/git.d.ts +42 -0
- package/dist/nodes/git.js +44 -0
- package/dist/nodes/github.d.ts +56 -0
- package/dist/nodes/github.js +60 -0
- package/dist/nodes/hackernews.d.ts +28 -0
- package/dist/nodes/hackernews.js +32 -0
- package/dist/nodes/hardware_interaction.d.ts +31 -0
- package/dist/nodes/hardware_interaction.js +33 -0
- package/dist/nodes/http.d.ts +51 -0
- package/dist/nodes/http.js +53 -0
- package/dist/nodes/http_server.d.ts +37 -0
- package/dist/nodes/http_server.js +33 -0
- package/dist/nodes/image_gallery.d.ts +29 -0
- package/dist/nodes/image_gallery.js +29 -0
- package/dist/nodes/interactive_input.d.ts +22 -0
- package/dist/nodes/interactive_input.js +24 -0
- package/dist/nodes/interactive_webview.d.ts +59 -0
- package/dist/nodes/interactive_webview.js +59 -0
- package/dist/nodes/iterator.d.ts +18 -0
- package/dist/nodes/iterator.js +20 -0
- package/dist/nodes/llm.d.ts +142 -0
- package/dist/nodes/llm.js +152 -0
- package/dist/nodes/memory.d.ts +31 -0
- package/dist/nodes/memory.js +80 -38
- package/dist/nodes/multimedia_processing.d.ts +47 -0
- package/dist/nodes/multimedia_processing.js +49 -0
- package/dist/nodes/openrouter_llm.d.ts +30 -0
- package/dist/nodes/openrouter_llm.js +32 -0
- package/dist/nodes/pdf_processor.d.ts +39 -0
- package/dist/nodes/pdf_processor.js +37 -0
- package/dist/nodes/remote_execution.d.ts +47 -0
- package/dist/nodes/remote_execution.js +49 -0
- package/dist/nodes/s3.d.ts +67 -0
- package/dist/nodes/s3.js +69 -0
- package/dist/nodes/scheduler.d.ts +31 -0
- package/dist/nodes/scheduler.js +33 -0
- package/dist/nodes/search.d.ts +36 -0
- package/dist/nodes/search.js +40 -0
- package/dist/nodes/semantic_memory.d.ts +47 -0
- package/dist/nodes/semantic_memory.js +49 -0
- package/dist/nodes/shell.d.ts +14 -0
- package/dist/nodes/shell.js +16 -0
- package/dist/nodes/speech_synthesis.d.ts +27 -0
- package/dist/nodes/speech_synthesis.js +29 -0
- package/dist/nodes/spreadsheet.d.ts +51 -0
- package/dist/nodes/spreadsheet.js +53 -0
- package/dist/nodes/stripe.d.ts +44 -0
- package/dist/nodes/stripe.js +48 -0
- package/dist/nodes/subflow.d.ts +18 -0
- package/dist/nodes/subflow.js +20 -0
- package/dist/nodes/summarize.d.ts +14 -0
- package/dist/nodes/summarize.js +20 -0
- package/dist/nodes/system_notification.d.ts +22 -0
- package/dist/nodes/system_notification.js +24 -0
- package/dist/nodes/transform.d.ts +18 -0
- package/dist/nodes/transform.js +20 -0
- package/dist/nodes/user.d.ts +14 -0
- package/dist/nodes/user.js +16 -0
- package/dist/nodes/webhook.d.ts +34 -0
- package/dist/nodes/webhook.js +36 -0
- package/dist/nodes/webscraper.d.ts +14 -0
- package/dist/nodes/webscraper.js +16 -0
- package/dist/nodes/websockets.d.ts +23 -0
- package/dist/nodes/websockets.js +25 -0
- package/dist/nodes/webview.d.ts +26 -0
- package/dist/nodes/webview.js +28 -0
- package/package.json +3 -2
- package/dist/qflow.config.d.ts +0 -5
- package/dist/qflow.config.js +0 -16
- package/dist/src/agent/agent.d.ts +0 -23
- package/dist/src/agent/agent.js +0 -365
- package/dist/src/agent/base_agent.d.ts +0 -21
- package/dist/src/agent/base_agent.js +0 -206
- package/dist/src/agent/logger.d.ts +0 -9
- package/dist/src/agent/logger.js +0 -45
- package/dist/src/agent/lpavrl_agent.d.ts +0 -5
- package/dist/src/agent/lpavrl_agent.js +0 -178
- package/dist/src/agent/ooda_agent.d.ts +0 -5
- package/dist/src/agent/ooda_agent.js +0 -167
- package/dist/src/agent/pema_agent.d.ts +0 -5
- package/dist/src/agent/pema_agent.js +0 -171
- package/dist/src/agent/raor_agent.d.ts +0 -5
- package/dist/src/agent/raor_agent.js +0 -164
- package/dist/src/agent/tools.d.ts +0 -1
- package/dist/src/agent/tools.js +0 -148
- package/dist/src/logger.d.ts +0 -9
- package/dist/src/logger.js +0 -107
- package/dist/src/nodes/agent_llm.d.ts +0 -31
- package/dist/src/nodes/agent_llm.js +0 -302
- package/dist/src/nodes/browser_control.d.ts +0 -35
- package/dist/src/nodes/browser_control.js +0 -106
- package/dist/src/nodes/code_interpreter.d.ts +0 -38
- package/dist/src/nodes/code_interpreter.js +0 -150
- package/dist/src/nodes/data_extractor.d.ts +0 -40
- package/dist/src/nodes/data_extractor.js +0 -118
- package/dist/src/nodes/data_validation.d.ts +0 -36
- package/dist/src/nodes/data_validation.js +0 -77
- package/dist/src/nodes/database.d.ts +0 -50
- package/dist/src/nodes/database.js +0 -135
- package/dist/src/nodes/display_image.d.ts +0 -18
- package/dist/src/nodes/display_image.js +0 -63
- package/dist/src/nodes/embedding.d.ts +0 -29
- package/dist/src/nodes/embedding.js +0 -69
- package/dist/src/nodes/filesystem.d.ts +0 -105
- package/dist/src/nodes/filesystem.js +0 -160
- package/dist/src/nodes/gis.d.ts +0 -62
- package/dist/src/nodes/gis.js +0 -133
- package/dist/src/nodes/git.d.ts +0 -46
- package/dist/src/nodes/git.js +0 -99
- package/dist/src/nodes/github.d.ts +0 -83
- package/dist/src/nodes/github.js +0 -135
- package/dist/src/nodes/hackernews.d.ts +0 -47
- package/dist/src/nodes/hackernews.js +0 -79
- package/dist/src/nodes/hardware_interaction.d.ts +0 -39
- package/dist/src/nodes/hardware_interaction.js +0 -131
- package/dist/src/nodes/http.d.ts +0 -77
- package/dist/src/nodes/http.js +0 -120
- package/dist/src/nodes/http_server.d.ts +0 -54
- package/dist/src/nodes/http_server.js +0 -223
- package/dist/src/nodes/image_gallery.d.ts +0 -37
- package/dist/src/nodes/image_gallery.js +0 -129
- package/dist/src/nodes/index.d.ts +0 -48
- package/dist/src/nodes/index.js +0 -48
- package/dist/src/nodes/interactive_input.d.ts +0 -26
- package/dist/src/nodes/interactive_input.js +0 -95
- package/dist/src/nodes/interactive_webview.d.ts +0 -78
- package/dist/src/nodes/interactive_webview.js +0 -369
- package/dist/src/nodes/iterator.d.ts +0 -23
- package/dist/src/nodes/iterator.js +0 -43
- package/dist/src/nodes/llm.d.ts +0 -160
- package/dist/src/nodes/llm.js +0 -367
- package/dist/src/nodes/memory.d.ts +0 -43
- package/dist/src/nodes/memory.js +0 -90
- package/dist/src/nodes/multimedia_processing.d.ts +0 -57
- package/dist/src/nodes/multimedia_processing.js +0 -129
- package/dist/src/nodes/openrouter_llm.d.ts +0 -38
- package/dist/src/nodes/openrouter_llm.js +0 -156
- package/dist/src/nodes/pdf_processor.d.ts +0 -43
- package/dist/src/nodes/pdf_processor.js +0 -112
- package/dist/src/nodes/remote_execution.d.ts +0 -51
- package/dist/src/nodes/remote_execution.js +0 -132
- package/dist/src/nodes/s3.d.ts +0 -73
- package/dist/src/nodes/s3.js +0 -107
- package/dist/src/nodes/scheduler.d.ts +0 -51
- package/dist/src/nodes/scheduler.js +0 -131
- package/dist/src/nodes/search.d.ts +0 -61
- package/dist/src/nodes/search.js +0 -118
- package/dist/src/nodes/semantic_memory.d.ts +0 -64
- package/dist/src/nodes/semantic_memory.js +0 -160
- package/dist/src/nodes/shell.d.ts +0 -25
- package/dist/src/nodes/shell.js +0 -45
- package/dist/src/nodes/speech_synthesis.d.ts +0 -72
- package/dist/src/nodes/speech_synthesis.js +0 -171
- package/dist/src/nodes/spreadsheet.d.ts +0 -61
- package/dist/src/nodes/spreadsheet.js +0 -294
- package/dist/src/nodes/stripe.d.ts +0 -67
- package/dist/src/nodes/stripe.js +0 -117
- package/dist/src/nodes/subflow.d.ts +0 -23
- package/dist/src/nodes/subflow.js +0 -36
- package/dist/src/nodes/summarize.d.ts +0 -26
- package/dist/src/nodes/summarize.js +0 -51
- package/dist/src/nodes/system_notification.d.ts +0 -26
- package/dist/src/nodes/system_notification.js +0 -74
- package/dist/src/nodes/transform.d.ts +0 -23
- package/dist/src/nodes/transform.js +0 -52
- package/dist/src/nodes/user.d.ts +0 -25
- package/dist/src/nodes/user.js +0 -48
- package/dist/src/nodes/webhook.d.ts +0 -49
- package/dist/src/nodes/webhook.js +0 -161
- package/dist/src/nodes/webscraper.d.ts +0 -25
- package/dist/src/nodes/webscraper.js +0 -49
- package/dist/src/nodes/websockets.d.ts +0 -27
- package/dist/src/nodes/websockets.js +0 -98
- package/dist/src/nodes/webview.d.ts +0 -38
- package/dist/src/nodes/webview.js +0 -55
- package/dist/src/qflow.d.ts +0 -69
- package/dist/src/qflow.js +0 -320
- /package/dist/{src/types.d.ts → types.d.ts} +0 -0
- /package/dist/{src/types.js → types.js} +0 -0
|
@@ -3,6 +3,59 @@ import { promises as fs } from 'fs';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import * as XLSX from 'xlsx'; // npm install xlsx
|
|
5
5
|
export class SpreadsheetNode extends AsyncNode {
|
|
6
|
+
static getToolDefinition() {
|
|
7
|
+
return {
|
|
8
|
+
name: "spreadsheet",
|
|
9
|
+
description: "Reads from and writes to spreadsheet files (.xlsx, .xls, .csv) with advanced manipulation.",
|
|
10
|
+
parameters: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
action: {
|
|
14
|
+
type: "string",
|
|
15
|
+
enum: ["read", "write", "list_sheets", "read_range", "write_range", "append_rows", "delete_rows", "insert_rows", "add_sheet", "delete_sheet", "rename_sheet", "format_cells"],
|
|
16
|
+
description: "The action to perform."
|
|
17
|
+
},
|
|
18
|
+
filePath: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "The absolute path to the spreadsheet file."
|
|
21
|
+
},
|
|
22
|
+
sheetName: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Required for .xlsx/.xls files and sheet-specific actions. The name of the sheet."
|
|
25
|
+
},
|
|
26
|
+
data: {
|
|
27
|
+
type: "array",
|
|
28
|
+
description: "Required for 'write', 'write_range', 'append_rows'. The data to write (array of arrays or array of objects)."
|
|
29
|
+
},
|
|
30
|
+
headerRow: {
|
|
31
|
+
type: "boolean",
|
|
32
|
+
description: "Optional. True if the first row is a header. Defaults to true."
|
|
33
|
+
},
|
|
34
|
+
range: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Required for 'read_range', 'write_range', 'format_cells'. A1 notation (e.g., 'Sheet1!A1:C10')."
|
|
37
|
+
},
|
|
38
|
+
startRow: {
|
|
39
|
+
type: "number",
|
|
40
|
+
description: "Required for 'delete_rows', 'insert_rows'. The 1-indexed starting row."
|
|
41
|
+
},
|
|
42
|
+
numRows: {
|
|
43
|
+
type: "number",
|
|
44
|
+
description: "Required for 'delete_rows', 'insert_rows'. The number of rows to delete/insert."
|
|
45
|
+
},
|
|
46
|
+
newSheetName: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Required for 'add_sheet', 'rename_sheet'. The name of the new sheet."
|
|
49
|
+
},
|
|
50
|
+
formats: {
|
|
51
|
+
type: "object",
|
|
52
|
+
description: "Required for 'format_cells'. Formatting options (conceptual, basic XLSX.js has limited styling)."
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
required: ["action", "filePath"]
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
6
59
|
constructor(maxRetries = 1, wait = 0) {
|
|
7
60
|
super(maxRetries, wait);
|
|
8
61
|
}
|
package/dist/nodes/stripe.d.ts
CHANGED
|
@@ -9,6 +9,36 @@
|
|
|
9
9
|
* @returns {Promise<object>} A promise that resolves to the created charge object.
|
|
10
10
|
*/
|
|
11
11
|
export class CreateChargeNode extends AsyncNode {
|
|
12
|
+
static getToolDefinition(): {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
parameters: {
|
|
16
|
+
type: string;
|
|
17
|
+
properties: {
|
|
18
|
+
apiKey: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
amount: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
currency: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
source: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
description: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
required: string[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
12
42
|
execAsync(): Promise<unknown>;
|
|
13
43
|
}
|
|
14
44
|
/**
|
|
@@ -18,6 +48,20 @@ export class CreateChargeNode extends AsyncNode {
|
|
|
18
48
|
* @returns {Promise<object>} A promise that resolves to the balance object.
|
|
19
49
|
*/
|
|
20
50
|
export class GetBalanceNode extends AsyncNode {
|
|
51
|
+
static getToolDefinition(): {
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
parameters: {
|
|
55
|
+
type: string;
|
|
56
|
+
properties: {
|
|
57
|
+
apiKey: {
|
|
58
|
+
type: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
required: string[];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
21
65
|
execAsync(): Promise<unknown>;
|
|
22
66
|
}
|
|
23
67
|
import { AsyncNode } from '../qflow.js';
|
package/dist/nodes/stripe.js
CHANGED
|
@@ -12,6 +12,38 @@ const API_BASE = 'https://api.stripe.com/v1';
|
|
|
12
12
|
* @returns {Promise<object>} A promise that resolves to the created charge object.
|
|
13
13
|
*/
|
|
14
14
|
export class CreateChargeNode extends AsyncNode {
|
|
15
|
+
static getToolDefinition() {
|
|
16
|
+
return {
|
|
17
|
+
name: "stripe_create_charge",
|
|
18
|
+
description: "Creates a new charge in Stripe.",
|
|
19
|
+
parameters: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {
|
|
22
|
+
apiKey: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "The Stripe secret key."
|
|
25
|
+
},
|
|
26
|
+
amount: {
|
|
27
|
+
type: "number",
|
|
28
|
+
description: "The amount to charge, in cents."
|
|
29
|
+
},
|
|
30
|
+
currency: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "The currency of the charge (e.g., 'usd')."
|
|
33
|
+
},
|
|
34
|
+
source: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "The source of the charge (e.g., a token or card ID)."
|
|
37
|
+
},
|
|
38
|
+
description: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Optional. The description of the charge."
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
required: ["apiKey", "amount", "currency", "source"]
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
15
47
|
async execAsync() {
|
|
16
48
|
const { apiKey, amount, currency, source, description } = this.params;
|
|
17
49
|
if (!apiKey || !amount || !currency || !source) {
|
|
@@ -47,6 +79,22 @@ export class CreateChargeNode extends AsyncNode {
|
|
|
47
79
|
* @returns {Promise<object>} A promise that resolves to the balance object.
|
|
48
80
|
*/
|
|
49
81
|
export class GetBalanceNode extends AsyncNode {
|
|
82
|
+
static getToolDefinition() {
|
|
83
|
+
return {
|
|
84
|
+
name: "stripe_get_balance",
|
|
85
|
+
description: "Retrieves the current account balance from Stripe.",
|
|
86
|
+
parameters: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
apiKey: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "The Stripe secret key."
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
required: ["apiKey"]
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
50
98
|
async execAsync() {
|
|
51
99
|
const { apiKey } = this.params;
|
|
52
100
|
if (!apiKey) {
|
package/dist/nodes/subflow.d.ts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
export class SubFlowNode extends AsyncNode {
|
|
2
|
+
static getToolDefinition(): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: string;
|
|
7
|
+
properties: {
|
|
8
|
+
flow: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
shared: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
required: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
2
20
|
execAsync(): Promise<any>;
|
|
3
21
|
postAsync(shared: any, prepRes: any, execRes: any): Promise<string>;
|
|
4
22
|
}
|
package/dist/nodes/subflow.js
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import { AsyncNode, AsyncFlow } from '../qflow.js';
|
|
2
2
|
export class SubFlowNode extends AsyncNode {
|
|
3
|
+
static getToolDefinition() {
|
|
4
|
+
return {
|
|
5
|
+
name: "sub_flow",
|
|
6
|
+
description: "Executes a sub-flow.",
|
|
7
|
+
parameters: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
flow: {
|
|
11
|
+
type: "string",
|
|
12
|
+
description: "The name of the flow to execute, as registered in the flow registry."
|
|
13
|
+
},
|
|
14
|
+
shared: {
|
|
15
|
+
type: "object",
|
|
16
|
+
description: "The shared object to pass to the sub-flow."
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
required: ["flow"]
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
3
23
|
async execAsync() {
|
|
4
24
|
const { flow, shared } = this.params;
|
|
5
25
|
if (!flow || !(flow instanceof AsyncFlow)) {
|
|
@@ -6,6 +6,20 @@
|
|
|
6
6
|
* @returns {Promise<string>} A promise that resolves to the summarized text.
|
|
7
7
|
*/
|
|
8
8
|
export class SummarizeNode extends AsyncNode {
|
|
9
|
+
static getToolDefinition(): {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
parameters: {
|
|
13
|
+
type: string;
|
|
14
|
+
properties: {
|
|
15
|
+
text: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
required: string[];
|
|
21
|
+
};
|
|
22
|
+
};
|
|
9
23
|
execAsync(): Promise<any>;
|
|
10
24
|
postAsync(shared: any, prepRes: any, execRes: any): Promise<string>;
|
|
11
25
|
}
|
package/dist/nodes/summarize.js
CHANGED
|
@@ -9,6 +9,26 @@ import { log } from '../logger.js';
|
|
|
9
9
|
* @returns {Promise<string>} A promise that resolves to the summarized text.
|
|
10
10
|
*/
|
|
11
11
|
export class SummarizeNode extends AsyncNode {
|
|
12
|
+
static getToolDefinition() {
|
|
13
|
+
return {
|
|
14
|
+
name: "summarize_text",
|
|
15
|
+
description: "Summarizes a given text using an LLM.",
|
|
16
|
+
parameters: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
text: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "The text content to summarize."
|
|
22
|
+
},
|
|
23
|
+
// Note: llmNode itself cannot be directly passed as a tool parameter in JSON schema.
|
|
24
|
+
// The agent would need to be configured with a default summarization LLM,
|
|
25
|
+
// or the tool definition would need to specify parameters for an LLM to be instantiated.
|
|
26
|
+
// For now, we'll omit llmNode from the tool definition, assuming it's handled internally by the agent.
|
|
27
|
+
},
|
|
28
|
+
required: ["text"]
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
12
32
|
async execAsync() {
|
|
13
33
|
const { text, llmNode } = this.params;
|
|
14
34
|
if (!text) {
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
export class SystemNotificationNode extends AsyncNode {
|
|
2
|
+
static getToolDefinition(): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: string;
|
|
7
|
+
properties: {
|
|
8
|
+
message: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
title: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
icon: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
required: string[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
2
24
|
execAsync(): Promise<any>;
|
|
3
25
|
}
|
|
4
26
|
import { AsyncNode } from '../qflow.js';
|
|
@@ -3,6 +3,30 @@ import { exec } from 'child_process';
|
|
|
3
3
|
import os from 'os';
|
|
4
4
|
import { log } from '../logger.js';
|
|
5
5
|
export class SystemNotificationNode extends AsyncNode {
|
|
6
|
+
static getToolDefinition() {
|
|
7
|
+
return {
|
|
8
|
+
name: "system_notification",
|
|
9
|
+
description: "Displays a system-level notification across OSs.",
|
|
10
|
+
parameters: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
message: {
|
|
14
|
+
type: "string",
|
|
15
|
+
description: "The main message content of the notification."
|
|
16
|
+
},
|
|
17
|
+
title: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Optional. The title of the notification. Defaults to 'QFlow Notification'."
|
|
20
|
+
},
|
|
21
|
+
icon: {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Optional. Path to an icon file or a system icon name (Linux specific). Ignored on macOS/Windows."
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
required: ["message"]
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
6
30
|
constructor(maxRetries = 1, wait = 0) {
|
|
7
31
|
super(maxRetries, wait);
|
|
8
32
|
}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
export class TransformNode extends AsyncNode {
|
|
2
|
+
static getToolDefinition(): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: string;
|
|
7
|
+
properties: {
|
|
8
|
+
input: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
transformFunction: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
required: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
2
20
|
execAsync(): Promise<any>;
|
|
3
21
|
postAsync(shared: any, prepRes: any, execRes: any): Promise<string>;
|
|
4
22
|
}
|
package/dist/nodes/transform.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { AsyncNode } from '../qflow.js';
|
|
2
2
|
import { log } from '../logger.js';
|
|
3
3
|
export class TransformNode extends AsyncNode {
|
|
4
|
+
static getToolDefinition() {
|
|
5
|
+
return {
|
|
6
|
+
name: "transform_node",
|
|
7
|
+
description: "Transforms data using a JavaScript function.",
|
|
8
|
+
parameters: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
input: {
|
|
12
|
+
type: "object", // Can be any type of data
|
|
13
|
+
description: "The data to be transformed."
|
|
14
|
+
},
|
|
15
|
+
transformFunction: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "A JavaScript function string (e.g., '(data) => data.map(item => item.name)') that takes 'data' as an argument and returns the transformed result."
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
required: ["input", "transformFunction"]
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
4
24
|
async execAsync() {
|
|
5
25
|
const { input, transformFunction } = this.params;
|
|
6
26
|
if (transformFunction === undefined) {
|
package/dist/nodes/user.d.ts
CHANGED
|
@@ -5,6 +5,20 @@
|
|
|
5
5
|
* @returns {Promise<string>} A promise that resolves to the user's input.
|
|
6
6
|
*/
|
|
7
7
|
export class UserInputNode extends AsyncNode {
|
|
8
|
+
static getToolDefinition(): {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
parameters: {
|
|
12
|
+
type: string;
|
|
13
|
+
properties: {
|
|
14
|
+
prompt: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
required: string[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
8
22
|
execAsync(): Promise<any>;
|
|
9
23
|
postAsync(shared: any, prepRes: any, execRes: any): Promise<string>;
|
|
10
24
|
}
|
package/dist/nodes/user.js
CHANGED
|
@@ -7,6 +7,22 @@ import readline from 'readline';
|
|
|
7
7
|
* @returns {Promise<string>} A promise that resolves to the user's input.
|
|
8
8
|
*/
|
|
9
9
|
export class UserInputNode extends AsyncNode {
|
|
10
|
+
static getToolDefinition() {
|
|
11
|
+
return {
|
|
12
|
+
name: "user_input",
|
|
13
|
+
description: "Prompts user for input.",
|
|
14
|
+
parameters: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
prompt: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "The message to display to the user."
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
required: ["prompt"]
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
10
26
|
async execAsync() {
|
|
11
27
|
const { prompt } = this.params;
|
|
12
28
|
if (!prompt) {
|
package/dist/nodes/webhook.d.ts
CHANGED
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
export class WebHookNode extends AsyncNode {
|
|
2
|
+
static getToolDefinition(): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: string;
|
|
7
|
+
properties: {
|
|
8
|
+
port: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
path: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
flow: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
sharedSecret: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
responseStatus: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
responseBody: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
required: string[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
2
36
|
server: http.Server<typeof http.IncomingMessage, typeof http.ServerResponse> | null;
|
|
3
37
|
flowToTrigger: AsyncFlow | null;
|
|
4
38
|
webhookPath: any;
|
package/dist/nodes/webhook.js
CHANGED
|
@@ -4,6 +4,42 @@ import { URL } from 'url'; // Node.js built-in
|
|
|
4
4
|
import crypto from 'crypto'; // Node.js built-in
|
|
5
5
|
import { log } from '../logger.js';
|
|
6
6
|
export class WebHookNode extends AsyncNode {
|
|
7
|
+
static getToolDefinition() {
|
|
8
|
+
return {
|
|
9
|
+
name: "webhook",
|
|
10
|
+
description: "Exposes an HTTP endpoint to receive webhooks, triggering a specified qflow flow.",
|
|
11
|
+
parameters: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
port: {
|
|
15
|
+
type: "number",
|
|
16
|
+
description: "Optional. The port number to listen on. Defaults to 3000."
|
|
17
|
+
},
|
|
18
|
+
path: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Optional. The URL path for the webhook endpoint. Defaults to '/webhook'."
|
|
21
|
+
},
|
|
22
|
+
flow: {
|
|
23
|
+
type: "string", // This will be the name of a flow in the flowRegistry
|
|
24
|
+
description: "The name of the qflow AsyncFlow instance to trigger when a webhook is received."
|
|
25
|
+
},
|
|
26
|
+
sharedSecret: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Optional. A shared secret for HMAC verification of incoming webhooks."
|
|
29
|
+
},
|
|
30
|
+
responseStatus: {
|
|
31
|
+
type: "number",
|
|
32
|
+
description: "Optional. The HTTP status code to send back to the webhook sender. Defaults to 200."
|
|
33
|
+
},
|
|
34
|
+
responseBody: {
|
|
35
|
+
type: "object",
|
|
36
|
+
description: "Optional. The JSON body to send back to the webhook sender. Defaults to { status: 'received' }."
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
required: ["flow"]
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
7
43
|
constructor(maxRetries = 1, wait = 0) {
|
|
8
44
|
super(maxRetries, wait);
|
|
9
45
|
this.server = null;
|
|
@@ -5,6 +5,20 @@
|
|
|
5
5
|
* @returns {Promise<string>} A promise that resolves to the HTML content of the page.
|
|
6
6
|
*/
|
|
7
7
|
export class ScrapeURLNode extends AsyncNode {
|
|
8
|
+
static getToolDefinition(): {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
parameters: {
|
|
12
|
+
type: string;
|
|
13
|
+
properties: {
|
|
14
|
+
url: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
required: string[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
8
22
|
execAsync(): Promise<string>;
|
|
9
23
|
postAsync(shared: any, prepRes: any, execRes: any): Promise<any>;
|
|
10
24
|
}
|
package/dist/nodes/webscraper.js
CHANGED
|
@@ -7,6 +7,22 @@ import { log } from '../logger.js';
|
|
|
7
7
|
* @returns {Promise<string>} A promise that resolves to the HTML content of the page.
|
|
8
8
|
*/
|
|
9
9
|
export class ScrapeURLNode extends AsyncNode {
|
|
10
|
+
static getToolDefinition() {
|
|
11
|
+
return {
|
|
12
|
+
name: "web_scraper",
|
|
13
|
+
description: "Fetches HTML content from a URL. Use with 'data_extractor' for specifics.",
|
|
14
|
+
parameters: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
url: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "The URL to scrape."
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
required: ["url"]
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
10
26
|
async execAsync() {
|
|
11
27
|
const { url } = this.params;
|
|
12
28
|
if (!url) {
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
export class WebSocketsNode extends AsyncNode {
|
|
2
|
+
static getToolDefinition(): {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: string;
|
|
7
|
+
properties: {
|
|
8
|
+
action: {
|
|
9
|
+
type: string;
|
|
10
|
+
enum: string[];
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
url: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
message: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
required: string[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
2
25
|
execAsync(prepRes: any, shared: any): Promise<any>;
|
|
3
26
|
}
|
|
4
27
|
import { AsyncNode } from '../qflow.js';
|
package/dist/nodes/websockets.js
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { AsyncNode } from '../qflow.js';
|
|
2
2
|
import WebSocket from 'ws';
|
|
3
3
|
export class WebSocketsNode extends AsyncNode {
|
|
4
|
+
static getToolDefinition() {
|
|
5
|
+
return {
|
|
6
|
+
name: "websockets",
|
|
7
|
+
description: "Establishes and manages WebSocket connections.",
|
|
8
|
+
parameters: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
action: {
|
|
12
|
+
type: "string",
|
|
13
|
+
enum: ["connect", "send", "receive", "close"],
|
|
14
|
+
description: "The WebSocket action to perform."
|
|
15
|
+
},
|
|
16
|
+
url: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "The URL of the WebSocket server (for 'connect' action)."
|
|
19
|
+
},
|
|
20
|
+
message: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "The message to send to the server (for 'send' action)."
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
required: ["action"]
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
4
29
|
async execAsync(prepRes, shared) {
|
|
5
30
|
const { action, url, message, timeout = 5000, // 5-second timeout
|
|
6
31
|
} = this.params;
|
package/dist/nodes/webview.d.ts
CHANGED
|
@@ -7,6 +7,32 @@
|
|
|
7
7
|
* @param {number} [params.height=600] - The height of the webview window.
|
|
8
8
|
*/
|
|
9
9
|
export class WebviewNode extends AsyncNode {
|
|
10
|
+
static getToolDefinition(): {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
parameters: {
|
|
14
|
+
type: string;
|
|
15
|
+
properties: {
|
|
16
|
+
html: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
title: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
width: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
height: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
required: string[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
10
36
|
execAsync(): Promise<string>;
|
|
11
37
|
}
|
|
12
38
|
import { AsyncNode } from '../qflow.js';
|