@fractal-solutions/qflow 1.0.30 → 1.0.31

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.
Files changed (2) hide show
  1. package/README.md +30 -40
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,17 +2,15 @@
2
2
 
3
3
  `qflow` is a lightweight and flexible JavaScript library designed for creating and managing complex workflows and autonomous agents. It provides a minimalist yet expressive API to define sequences of operations, manage data flow, and orchestrate execution, supporting both synchronous and asynchronous patterns.
4
4
 
5
- With zero external dependencies for its core functionality, `qflow` is built for performance and seamless integration into any JavaScript environment, from Node.js backends to browser-based applications.
6
-
7
5
  ## Features
8
6
 
9
7
  * **Modular & Extensible:** Easily define custom nodes and compose them into complex, reusable flows.
10
8
  * **Synchronous & Asynchronous Flows:** Supports both blocking and non-blocking execution models.
11
9
  * **Shared State Management:** Pass and manipulate data across nodes using a central, mutable `shared` object.
12
10
  * **Batch Processing:** Efficiently process collections of data through dedicated batch nodes and flows, including parallel execution.
13
- * **Retry Mechanisms:** Built-in support for retrying failed operations with configurable delays.
14
- * **Conditional Transitions:** Define dynamic flow paths based on execution outcomes.
15
- * **Built-in Integrations:** Comes with pre-built nodes for common tasks like LLM interactions, web scraping, and popular API integrations (GitHub, HackerNews, Stripe).
11
+ * **Agents:** Built upon the `qflow` core functionality are plug and play agents with extensive tool integrations available.
12
+ * **Built-in Integrations:** Comes with pre-built nodes for multiple tasks like LLM interactions, browser use, pdf tools, webhooks, spreadsheet manipulation, code interpretation, media manipulation, web scraping, and popular API integrations (GitHub, Git, Open Router, HackerNews, Stripe, Maps).
13
+ * **Custom Agent Tools:** Build your own Agent tools using the flow registry pattern.
16
14
 
17
15
  ## Installation
18
16
 
@@ -57,7 +55,6 @@ The fundamental building block of any `qflow` workflow. A `Node` represents a si
57
55
  * `post(shared, prepRes, execRes)`: Processes the result of `exec`. Receives the `shared` object.
58
56
  * `setParams(params)`: Configures the node with specific parameters. Parameters are accessible via `this.params`.
59
57
  * `next(node, action = "default")`: Chains this node to another, defining the next step in the flow.
60
- * `transition(action)`: Initiates a conditional transition to another node, allowing for dynamic branching.
61
58
 
62
59
  **Asynchronous Nodes (`AsyncNode`, `AsyncBatchNode`, `AsyncParallelBatchNode`)**
63
60
  For operations that involve I/O or are inherently asynchronous, `qflow` provides `AsyncNode` and its variants. These nodes leverage `async`/`await` for non-blocking execution. When working within `AsyncFlow`s, it's crucial to implement the `async` versions of the lifecycle methods:
@@ -78,18 +75,11 @@ A `Flow` orchestrates the execution of a sequence of `Node`s. It defines the ove
78
75
  **Batch Flows (`BatchFlow`, `AsyncBatchFlow`, `AsyncParallelBatchFlow`)**
79
76
  These specialized flows are designed to process collections of items. They run a sub-flow for each item in the batch. `AsyncParallelBatchFlow` is particularly useful for concurrently processing batch items, significantly speeding up operations.
80
77
 
81
- ### ConditionalTransition
82
-
83
- A helper class used in conjunction with `Node.transition()` to define conditional branching within your workflows.
84
-
85
- * `to(targetNode)`: Specifies the target node for the transition based on the action returned by the preceding node.
86
-
87
-
88
- ## What Can We Do Now That We Have Agents?
78
+ ## Agents
89
79
 
80
+ The introduction of the `AgentNode` is a game-changer for qflow. It shifts the paradigm from pre-defined, static workflows to dynamic, intelligent, and autonomous task execution.
90
81
 
91
- The introduction of the `AgentNode` is a game-changer for qflow. It shifts the paradigm from
92
- pre-defined, static workflows to dynamic, intelligent, and autonomous task execution.
82
+ ### What Can We Do Now That We Have Agents?
93
83
 
94
84
  Here are some key capabilities and applications unlocked by having agents:
95
85
 
@@ -114,13 +104,13 @@ A helper class used in conjunction with `Node.transition()` to define conditiona
114
104
  interactive. They can ask clarifying questions, seek approval for critical actions, or
115
105
  provide progress updates, making them more collaborative.
116
106
  7. **Data Analysis and Reporting:** Agents can gather data from various sources (web, files,
117
- APIs), process it (potentially with a future code interpreter), and then synthesize
107
+ APIs), process it, and then synthesize
118
108
  findings into structured reports or summaries.
119
109
  8. **Research and Information Synthesis:** Agents can research topics, scrape relevant pages,
120
110
  and synthesize information into comprehensive answers or documents, acting as automated
121
111
  research assistants.
122
112
 
123
- ## How to use the Docs and Examples
113
+ ## Integrated Nodes and their Examples
124
114
 
125
115
  The examples in [Basic Usage & Examples](#basic-usage--examples) below will cover the core functionalities of `qflow`. For more advanced and specific use cases involving the built-in integrations, please explore the [`examples/` folder](https://github.com/fractal-solutions/qflow/tree/main/examples) in the project's GitHub repository. There you will find detailed scripts demonstrating how to use nodes for:
126
116
 
@@ -138,49 +128,49 @@ The examples in [Basic Usage & Examples](#basic-usage--examples) below will cove
138
128
  * [**Shell:**](#8-shell-command-example) For system-level interaction and execution.
139
129
  * [**HTTP:**](#10-generic-http-request-example) For universal API access.
140
130
  * [**FileSystem:**](#9-file-system-example) For reading and writing local data.
141
- * **User Input:** For human-in-the-loop control.
142
131
  * [**Web Search:**](#11-web-search-example) Discovering information on the web using either:
143
132
  * `DuckDuckGoSearchNode`: API-key-free, using DuckDuckGo's HTML interface.
144
133
  * `GoogleSearchNode`: Requires a Google API Key and Custom Search Engine ID for more robust results.
145
- * **WebScraper:** For targeted web scraping.
146
- * **BrowserControl:** For controlling a web browser with Playwright.
147
- * **Git:** For performing Git operations.
148
- * **WebSockets:** For real-time, two-way communication with web services.
134
+ * [**WebScraper:**](https://github.com/fractal-solutions/qflow/blob/main/examples/webscraper_test.js) For targeted web scraping.
135
+ * [**BrowserControl:**](https://github.com/fractal-solutions/qflow/blob/main/examples/browser_control_test.js) For controlling a web browser with Playwright.
136
+ * [**Git:**](https://github.com/fractal-solutions/qflow/blob/main/examples/git_example.js) For performing Git operations.
137
+ * [**WebSockets:**](https://github.com/fractal-solutions/qflow/blob/main/examples/websockets_test.js) For real-time, two-way communication with web services.
149
138
  * [**DataExtractor:**](#13-data-extraction-example) For targeted data extraction.
150
- * **PDF Processor:** For extracting text and images from PDF documents.
139
+ * [**PDF Processor:**](https://github.com/fractal-solutions/qflow/blob/main/examples/pdf_processor_example.js) For extracting text and images from PDF documents.
151
140
  * **Prerequisite:** Requires `poppler-utils` to be installed on your system.
152
141
  * **Linux (Debian/Ubuntu):** `sudo apt-get install poppler-utils`
153
142
  * **Linux (Arch/Manjaro):** `sudo pacman -S poppler`
154
143
  * **macOS:** `brew install poppler`
155
144
  * **Windows:** Install Poppler for Windows and add its executables to your system's PATH.
156
- * **GIS:** For Geographic Information System operations like geocoding and reverse geocoding. Supports multiple providers (OpenStreetMap, Google Maps).
145
+ * [**GIS:**](https://github.com/fractal-solutions/qflow/blob/main/examples/gis_example.js) For Geographic Information System operations like geocoding and reverse geocoding. Supports multiple providers (OpenStreetMap, Google Maps).
157
146
  * **OpenStreetMap:** Free and open-source. No API key required.
158
147
  * **Google Maps:** Requires a `GOOGLE_MAPS_API_KEY` environment variable.
159
- * **Display Image:** For opening image files using the system's default image viewer. Useful for agents to show generated plots or other visual output.
160
- * **Hardware Interaction:** For communicating with local hardware via serial port (UART).
161
- * **Prerequisite:** Requires the `serialport` library (`npm install serialport` or `bun add serialport`). This library has native components and may require build tools (Python, C/C++ compiler).
148
+ * [**Display Image:**](https://github.com/fractal-solutions/qflow/blob/main/examples/display_image_test.js) For opening image files using the system's default image viewer. Useful for agents to show generated plots or other visual output.
149
+ * [**Image Gallery:**](https://github.com/fractal-solutions/qflow/blob/main/examples/image_gallery_example.js) Generates an HTML gallery from multiple image files and opens it in a web browser. Useful for displaying multiple plots or images in a single view.
150
+ * [**Hardware Interaction:**](https://github.com/fractal-solutions/qflow/blob/main/examples/hardware_interaction_example.js) For communicating with local hardware via serial port (UART).
151
+ * **Prerequisite:** Uses the `serialport` library. This library has native components and may require build tools (Python, C/C++ compiler).
162
152
  * **Permissions:** On Linux, your user might need to be added to the `dialout` group (`sudo usermod -a -G dialout $USER`, then log out and back in).
163
- * **Image Gallery:** Generates an HTML gallery from multiple image files and opens it in a web browser. Useful for displaying multiple plots or images in a single view.
164
- * **Speech Synthesis:** Converts text to spoken audio using OS capabilities or cloud APIs.
153
+ * [**Speech Synthesis:**](https://github.com/fractal-solutions/qflow/blob/main/examples/speech_synthesis_example.js) Converts text to spoken audio using OS capabilities or cloud APIs.
165
154
  * **Prerequisites:**
166
155
  * **macOS:** Built-in (`say` command).
167
156
  * **Linux:** `espeak` (`sudo apt install espeak` or `sudo pacman -S alsa-utils`).
168
157
  * **Google Cloud TTS:** Requires `GOOGLE_TTS_API_KEY` environment variable.
169
- * **Multimedia Processing:** Performs various operations on audio and video files using `ffmpeg` (e.g., convert formats, trim, extract audio/frames).
158
+ * [**Multimedia Processing:**](https://github.com/fractal-solutions/qflow/blob/main/examples/multimedia_processing_example.js) Performs various operations on audio and video files using `ffmpeg` (e.g., convert formats, trim, extract audio/frames).
170
159
  * **Prerequisite:** Requires `ffmpeg` to be installed on your system.
171
160
  * **Linux (Debian/Ubuntu):** `sudo apt install ffmpeg`
172
161
  * **Linux (Arch/Manjaro):** `sudo pacman -S ffmpeg`
173
162
  * **macOS:** `brew install ffmpeg`
174
163
  * **Windows:** Download and install `ffmpeg` and add it to your system's PATH.
175
- * **Remote Execution:** Executes commands on remote machines via SSH.
176
- * **Prerequisite:** Requires the `ssh2` library (`npm install ssh2` or `bun add ssh2`). This library has native components and may require build tools (Python, C/C++ compiler).
177
- * **Data Validation:** Validates structured data against JSON Schemas.
178
- * **Prerequisite:** Requires the `ajv` library (`npm install ajv` or `bun add ajv`).
179
- * **WebHook:** Exposes an HTTP endpoint to receive webhooks, enabling event-driven flows.
180
- * **Scheduler:** Schedules `qflow` flows for future or recurring execution.
181
- * **Prerequisite:** Requires the `node-cron` library (`npm install node-cron` or `bun add node-cron`).
182
- * **System Notification:** For displaying system-level notifications across different operating systems.
183
- * **Interactive Input:** For getting user input via a GUI popup (cross-platform).
164
+ * [**Remote Execution:**](https://github.com/fractal-solutions/qflow/blob/main/examples/remote_execution_example.js) Executes commands on remote machines via SSH.
165
+ * **Prerequisite:** Uses the `ssh2` library. This library has native components and may require build tools (Python, C/C++ compiler).
166
+ * [**Data Validation:**](https://github.com/fractal-solutions/qflow/blob/main/examples/data_validation_example.js) Validates structured data against JSON Schemas.
167
+ * **Prerequisite:** Uses the `ajv` library.
168
+ * [**WebHook:**](https://github.com/fractal-solutions/qflow/blob/main/examples/webhook_example.js) Exposes an HTTP endpoint to receive webhooks, enabling event-driven flows.
169
+ * [**Scheduler:**](https://github.com/fractal-solutions/qflow/blob/main/examples/scheduler_example.js) Schedules `qflow` flows for future or recurring execution.
170
+ * **Prerequisite:** Uses the `node-cron` library.
171
+ * [**System Notification:**](https://github.com/fractal-solutions/qflow/blob/main/examples/system_notification_test.js) For displaying system-level notifications across different operating systems.
172
+ * [**Interactive Input:**](https://github.com/fractal-solutions/qflow/blob/main/examples/interactive_input_test.js) For getting user input via a GUI popup (cross-platform).
173
+ * [**User Input:**](https://github.com/fractal-solutions/qflow/blob/main/examples/user_input_test.js) For human-in-the-loop control.
184
174
  * **GitHub:** Creating and managing issues.
185
175
  * **HackerNews:** Fetching top stories and item details.
186
176
  * **Stripe:** Creating charges and retrieving account balances.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fractal-solutions/qflow",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "A lightweight and flexible JavaScript library for creating and managing workflows and agents.",
5
5
  "main": "dist/qflow.js",
6
6
  "types": "dist/qflow.d.ts",