@fractal-solutions/qflow 1.0.5 → 1.0.7

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 +65 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -423,8 +423,73 @@ class HereticNode extends DeepSeekLLMNode {
423
423
 
424
424
  ```
425
425
 
426
+ ### 8. Shell Command Example
427
+
428
+ Executing a shell command and printing the output.
429
+
430
+ ```javascript
431
+ import { AsyncFlow } from '@fractal-solutions/qflow';
432
+ import { ShellCommandNode } from '@fractal-solutions/qflow/nodes';
433
+
434
+ const listFiles = new ShellCommandNode();
435
+ listFiles.setParams({ command: 'ls -l' });
436
+
437
+ listFiles.postAsync = async (shared, prepRes, execRes) => {
438
+ console.log('--- File Listing ---');
439
+ console.log(execRes.stdout);
440
+ return 'default';
441
+ };
442
+
443
+ const flow = new AsyncFlow(listFiles);
444
+ await flow.runAsync({});
445
+ ```
446
+
447
+ ### 9. File System Example
448
+
449
+ Writing to a file and then reading it back.
450
+
451
+ ```javascript
452
+ import { AsyncFlow } from '@fractal-solutions/qflow';
453
+ import { WriteFileNode, ReadFileNode } from '@fractal-solutions/qflow/nodes';
454
+
455
+ const writeFile = new WriteFileNode();
456
+ writeFile.setParams({ filePath: './hello.txt', content: 'Hello, qflow!\n' });
457
+
458
+ const readFile = new ReadFileNode();
459
+ readFile.setParams({ filePath: './hello.txt' });
460
+
461
+ readFile.postAsync = async (shared, prepRes, execRes) => {
462
+ console.log('--- File Content ---');
463
+ console.log(execRes);
464
+ return 'default';
465
+ };
466
+
467
+ writeFile.next(readFile);
468
+
469
+ const flow = new AsyncFlow(writeFile);
470
+ await flow.runAsync({});
471
+ ```
472
+
473
+ ```
474
+
475
+ ## Exploring More Examples
476
+
477
+ The examples above 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:
478
+
479
+ * **GitHub:** Creating and managing issues.
480
+ * **HackerNews:** Fetching top stories and item details.
481
+ * **Stripe:** Creating charges and retrieving account balances.
482
+ * **WebScraper:** Fetching and processing web content.
483
+ * **LLMs (DeepSeek, OpenAI, Gemini):** Building powerful AI-driven workflows.
484
+ * **Shell:** Executing shell commands.
485
+ * **FileSystem:** Reading, writing, and appending files, and listing directories.
486
+ * **User Input:** Pausing a flow to request user feedback or approval.
487
+
488
+ These examples are a great resource for understanding how to leverage `qflow` to its full potential.
489
+
426
490
  ## Error Handling
427
491
 
492
+
428
493
  `qflow` provides mechanisms to handle errors gracefully within your workflows.
429
494
 
430
495
  * **Node-level Error Handling:**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fractal-solutions/qflow",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
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",
@@ -35,7 +35,7 @@
35
35
  "license": "MIT",
36
36
  "repository": {
37
37
  "type": "git",
38
- "url": "https://github.com/fractal-solutions/qflow.git"
38
+ "url": "git+https://github.com/fractal-solutions/qflow.git"
39
39
  },
40
40
  "bugs": {
41
41
  "url": "https://github.com/fractal-solutions/qflow/issues"