@d34dman/flowdrop 0.0.3 → 0.0.4

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 CHANGED
@@ -1,385 +1,327 @@
1
- # FlowDrop - Drupal Workflow Editor
1
+ # FlowDrop
2
2
 
3
- A powerful visual workflow editor for Drupal that enables drag-and-drop creation of complex workflows with AI integration, data processing, and automation capabilities.
3
+ A visual workflow editor component library built with Svelte 5 and @xyflow/svelte. Create complex workflows with drag-and-drop functionality, node-based editing, and configurable API integration.
4
4
 
5
5
  ## 🚀 Features
6
6
 
7
- - **Visual Workflow Editor**: Drag-and-drop interface for building complex workflows
8
- - **AI Integration**: OpenAI, Anthropic, and other AI model integrations
9
- - **Data Processing**: Advanced data manipulation and transformation nodes
10
- - **HTTP Integration**: Webhook and API request capabilities
11
- - **File Operations**: Upload, download, and file processing
12
- - **Conditional Logic**: Advanced branching and decision-making nodes
13
- - **Real-time Execution**: Live workflow execution with status monitoring
14
- - **Drupal Native**: Built specifically for Drupal 10/11
7
+ - **Visual Workflow Editor**: Drag-and-drop interface for building node-based workflows
8
+ - **Svelte 5 Components**: Modern, reactive components with runes
9
+ - **Configurable API Client**: Flexible endpoint configuration for backend integration
10
+ - **Node System**: Extensible node types with customizable configuration
11
+ - **Real-time Updates**: Live workflow state management with stores
12
+ - **Framework Agnostic**: Can be integrated into any web application
13
+ - **TypeScript Support**: Full type definitions included
15
14
 
16
- ## 📁 Project Structure
15
+ ## 📦 Installation
17
16
 
17
+ ```bash
18
+ npm install @d34dman/flowdrop
18
19
  ```
19
- flowdrop/
20
- ├── src/ # Core PHP classes
21
- │ ├── Service/NodeRuntime/ # Node execution engine
22
- │ ├── Plugin/FlowDropNodeProcessor/ # 25+ node processors
23
- │ ├── Attribute/ # Plugin discovery attributes
24
- │ └── Exception/ # Custom exception classes
25
- ├── modules/ # Drupal sub-modules
26
- │ ├── flowdrop_workflow/ # Workflow entity management
27
- │ ├── flowdrop_ui/ # Svelte frontend application
28
- │ ├── flowdrop_node_type/ # Node type definitions
29
- │ ├── flowdrop_node_category/ # Node categorization
30
- │ ├── flowdrop_pipeline/ # Pipeline management
31
- │ ├── flowdrop_job/ # Job execution system
32
- │ ├── flowdrop_runner/ # Workflow execution engine
33
- │ └── flowdrop_ai/ # AI integration features
34
- ├── js/ # Drupal JavaScript integration
35
- └── config/ # Drupal configuration
36
- ```
37
-
38
- ## 🏗️ Architecture
39
-
40
- ### Core Components
41
-
42
- 1. **Plugin System**: Attribute-based discovery of node processors
43
- 2. **Node Runtime**: Execution engine for workflow nodes
44
- 3. **Workflow Engine**: Drupal entity-based workflow management
45
- 4. **Frontend**: Svelte-based visual editor
46
- 5. **API Layer**: RESTful API for workflow operations
47
-
48
- ### Node Categories
49
-
50
- - **AI Models**: OpenAI Chat, Embeddings, HuggingFace
51
- - **Data Processing**: Calculator, Dataframe Operations, Data Operations
52
- - **Input/Output**: Text Input, Chat Output, File Upload
53
- - **HTTP Operations**: URL Fetch, HTTP Request, Webhook
54
- - **Conditional Logic**: Conditional nodes, Loop operations
55
- - **Utility**: DateTime, Regex Extractor, Split Text
56
- - **Storage**: Save to File, Chroma Vector Store
57
-
58
- ## 🛠️ Installation
59
-
60
- ### Prerequisites
61
20
 
62
- - Drupal 10 or 11
63
- - PHP 8.1+
64
- - Node.js 18+ (for frontend development)
65
-
66
- ### Installation Steps
67
-
68
- 1. **Install the module**:
69
-
70
- ```bash
71
- # Copy to your Drupal modules directory
72
- cp -r flowdrop /path/to/drupal/web/modules/custom/
73
- ```
74
-
75
- 2. **Enable the module**:
76
-
77
- ```bash
78
- ddev drush en flowdrop flowdrop_workflow flowdrop_ui
79
- ```
80
-
81
- 3. **Build the frontend**:
82
-
83
- ```bash
84
- cd modules/flowdrop_ui/app/flowdrop
85
- npm install
86
- npm run build:iife
87
- ```
21
+ ## 📁 Project Structure
88
22
 
89
- 4. **Clear Drupal cache**:
90
- ```bash
91
- ddev drush cr
92
- ```
23
+ ```
24
+ @d34dman/flowdrop/
25
+ ├── dist/ # Built library files
26
+ ├── components/ # Svelte components
27
+ │ ├── types/ # TypeScript definitions
28
+ │ ├── services/ # API and state management
29
+ │ ├── utils/ # Utility functions
30
+ │ └── styles/ # CSS styles
31
+ ├── src/ # Source code
32
+ │ └── lib/ # Library source
33
+ │ ├── components/ # Svelte components
34
+ │ ├── services/ # Services and APIs
35
+ │ ├── stores/ # State management
36
+ │ └── types/ # Type definitions
37
+ └── api/ # API documentation
38
+ ```
93
39
 
94
40
  ## 🎯 Usage
95
41
 
96
- ### Accessing the Workflow Editor
97
-
98
- 1. Navigate to `/admin/structure/flowdrop-workflow`
99
- 2. Create a new workflow or edit an existing one
100
- 3. Use the visual editor to build your workflow
101
-
102
- ### Creating Workflows
103
-
104
- 1. **Add Nodes**: Drag nodes from the palette to the canvas
105
- 2. **Configure Nodes**: Set parameters and configuration for each node
106
- 3. **Connect Nodes**: Create connections between node inputs and outputs
107
- 4. **Test Execution**: Use the execution panel to test your workflow
108
- 5. **Save & Deploy**: Save your workflow for production use
109
-
110
- ### Available Node Types
111
-
112
- #### AI Models
113
-
114
- - **OpenAI Chat**: GPT model integration
115
- - **OpenAI Embeddings**: Text embedding generation
116
- - **HuggingFace Embeddings**: Alternative embedding models
117
- - **Simple Agent**: Basic AI agent implementation
118
-
119
- #### Data Processing
120
-
121
- - **Calculator**: Mathematical operations
122
- - **Dataframe Operations**: Advanced data manipulation
123
- - **Data Operations**: General data processing
124
- - **Data to Dataframe**: Data format conversion
125
-
126
- #### Input/Output
127
-
128
- - **Text Input**: User input collection
129
- - **Text Output**: Display text results
130
- - **Chat Output**: Chat interface output
131
- - **File Upload**: File upload handling
132
-
133
- #### HTTP & Integration
134
-
135
- - **URL Fetch**: HTTP GET requests
136
- - **HTTP Request**: Full HTTP client
137
- - **Webhook**: Webhook endpoint handling
138
-
139
- #### Logic & Control
140
-
141
- - **Conditional**: If/else logic branching
142
- - **Loop**: Iterative operations
143
- - **Split Text**: Text segmentation
144
-
145
- #### Utility
146
-
147
- - **DateTime**: Date/time operations
148
- - **Regex Extractor**: Pattern matching
149
- - **Conversation Buffer**: Chat history management
150
- - **Structured Output**: Formatted output generation
151
-
152
- ## 🔧 Development
153
-
154
- ### Adding New Node Types
155
-
156
- 1. **Create Node Class**:
42
+ ### Basic Import
157
43
 
158
- ```php
159
- <?php
160
-
161
- namespace Drupal\flowdrop\Plugin\FlowDropNodeProcessor;
44
+ ```javascript
45
+ import { WorkflowEditor } from "@d34dman/flowdrop";
46
+ import "@d34dman/flowdrop/styles/base.css";
47
+ ```
162
48
 
163
- use Drupal\flowdrop\Attribute\FlowDropNodeProcessor;
49
+ ### Using the WorkflowEditor Component
50
+
51
+ ```svelte
52
+ <script lang="ts">
53
+ import { WorkflowEditor } from "@d34dman/flowdrop";
54
+ import type { NodeMetadata, Workflow } from "@d34dman/flowdrop";
55
+
56
+ let nodes: NodeMetadata[] = [
57
+ {
58
+ id: "text_input",
59
+ name: "Text Input",
60
+ category: "input_output",
61
+ description: "User input field",
62
+ inputs: [],
63
+ outputs: [{ id: "value", name: "Value", type: "output", dataType: "string" }]
64
+ }
65
+ ];
66
+
67
+ let workflow: Workflow = {
68
+ id: "workflow_1",
69
+ name: "My Workflow",
70
+ nodes: [],
71
+ edges: []
72
+ };
73
+ </script>
74
+
75
+ <WorkflowEditor {nodes} />
76
+ ```
164
77
 
165
- #[FlowDropNodeProcessor(
166
- id: "my_custom_node",
167
- label: new \Drupal\Core\StringTranslation\TranslatableMarkup("My Custom Node")
168
- )]
169
- class MyCustomNode extends AbstractFlowDropNodeProcessor {
78
+ ### Integration Methods
170
79
 
171
- public function execute(array $inputs, array $config): array {
172
- // Your node logic here
173
- return ['result' => 'processed data'];
174
- }
80
+ #### 1. As a Svelte Component (Recommended)
175
81
 
176
- public function getConfigSchema(): array {
177
- return [
178
- 'type' => 'object',
179
- 'properties' => [
180
- 'mySetting' => ['type' => 'string'],
181
- ],
182
- ];
183
- }
184
- }
185
- ```
82
+ ```svelte
83
+ <script>
84
+ import { WorkflowEditor, NodeSidebar } from "@d34dman/flowdrop";
85
+ </script>
186
86
 
187
- 2. **Implement Required Methods**:
188
- - `execute()`: Main node logic
189
- - `getConfigSchema()`: Configuration schema
190
- - `getInputSchema()`: Input validation schema
191
- - `getOutputSchema()`: Output schema
192
- - `validateInputs()`: Input validation
87
+ <div class="editor-container">
88
+ <NodeSidebar {nodes} />
89
+ <WorkflowEditor {nodes} />
90
+ </div>
91
+ ```
193
92
 
194
- ### Frontend Development
93
+ #### 2. Using Mount Functions (Vanilla JS/Other Frameworks)
195
94
 
196
- The frontend is a Svelte application located in `modules/flowdrop_ui/app/flowdrop/`.
95
+ ```javascript
96
+ import { mountWorkflowEditor } from "@d34dman/flowdrop";
97
+
98
+ const container = document.getElementById("workflow-container");
99
+ const editor = mountWorkflowEditor(container, {
100
+ nodes: availableNodes,
101
+ endpointConfig: {
102
+ baseUrl: "/api/flowdrop",
103
+ endpoints: {
104
+ workflows: {
105
+ list: "/workflows",
106
+ get: "/workflows/{id}",
107
+ create: "/workflows",
108
+ update: "/workflows/{id}"
109
+ }
110
+ }
111
+ }
112
+ });
197
113
 
198
- ```bash
199
- cd modules/flowdrop_ui/app/flowdrop
200
- npm run dev # Development server
201
- npm run build:iife # Build for Drupal integration
202
- npm run test # Run tests
114
+ // Cleanup
115
+ editor.destroy();
203
116
  ```
204
117
 
205
- ## 📚 API Documentation
206
-
207
- ### IIFE Integration API
208
-
209
- The FlowDrop library can be integrated into Drupal using the IIFE (Immediately Invoked Function Expression) build. The library provides two main mounting functions:
118
+ #### 3. Integration with Backend Frameworks
210
119
 
211
- #### Mounting Functions
120
+ ##### Drupal Example
212
121
 
213
122
  ```javascript
214
- // Mount the full FlowDrop App
215
- window.FlowDrop.mountFlowDropApp(container, options);
123
+ Drupal.behaviors.flowdropEditor = {
124
+ attach: function (context, settings) {
125
+ const container = context.querySelector(".flowdrop-container");
126
+ if (container && window.FlowDrop) {
127
+ window.FlowDrop.mountWorkflowEditor(container, {
128
+ endpointConfig: settings.flowdrop.endpointConfig,
129
+ nodes: settings.flowdrop.nodes
130
+ });
131
+ }
132
+ }
133
+ };
134
+ ```
216
135
 
217
- // Mount just the WorkflowEditor component
218
- window.FlowDrop.mountWorkflowEditor(container, options);
136
+ ## 📚 Core Components
137
+
138
+ ### WorkflowEditor
139
+
140
+ Main editor component for creating and editing workflows.
141
+
142
+ **Props:**
143
+ - `nodes`: Array of available node types
144
+ - `endpointConfig`: API endpoint configuration
145
+ - `height`: Editor height (default: "100vh")
146
+ - `width`: Editor width (default: "100%")
147
+ - `lockWorkflow`: Disable editing
148
+ - `readOnly`: Read-only mode
149
+
150
+ ### NodeSidebar
151
+
152
+ Sidebar displaying available node types.
153
+
154
+ **Props:**
155
+ - `nodes`: Array of node types to display
156
+
157
+ ### ConfigSidebar
158
+
159
+ Configuration panel for selected nodes.
160
+
161
+ **Props:**
162
+ - `isOpen`: Sidebar visibility
163
+ - `configSchema`: JSON schema for configuration
164
+ - `configValues`: Current configuration values
165
+ - `onSave`: Save handler
166
+ - `onClose`: Close handler
167
+
168
+ ## 🔧 API Configuration
169
+
170
+ Configure the API client to connect to your backend:
171
+
172
+ ```typescript
173
+ import { createEndpointConfig } from "@d34dman/flowdrop";
174
+
175
+ const config = createEndpointConfig({
176
+ baseUrl: "https://api.example.com",
177
+ endpoints: {
178
+ nodes: {
179
+ list: "/nodes",
180
+ get: "/nodes/{id}"
181
+ },
182
+ workflows: {
183
+ list: "/workflows",
184
+ get: "/workflows/{id}",
185
+ create: "/workflows",
186
+ update: "/workflows/{id}",
187
+ delete: "/workflows/{id}",
188
+ execute: "/workflows/{id}/execute"
189
+ }
190
+ },
191
+ timeout: 30000,
192
+ auth: {
193
+ type: "bearer",
194
+ token: "your-token"
195
+ }
196
+ });
219
197
  ```
220
198
 
221
- #### Configuration Options
199
+ ## 🎨 Customization
222
200
 
223
- ```javascript
224
- // Basic usage with default configuration
225
- window.FlowDrop.mountWorkflowEditor(container, {
226
- workflow: myWorkflow,
227
- nodes: availableNodes
228
- });
201
+ ### Styling
229
202
 
230
- // Advanced usage with custom endpoint configuration
231
- window.FlowDrop.mountWorkflowEditor(container, {
232
- workflow: myWorkflow,
233
- nodes: availableNodes,
234
- endpointConfig: {
235
- baseUrl: '/api/flowdrop',
236
- endpoints: {
237
- nodes: {
238
- list: '/nodes',
239
- get: '/nodes/{id}',
240
- byCategory: '/nodes?category={category}',
241
- metadata: '/nodes/{id}/metadata'
242
- },
243
- workflows: {
244
- list: '/workflows',
245
- get: '/workflows/{id}',
246
- create: '/workflows',
247
- update: '/workflows/{id}',
248
- delete: '/workflows/{id}',
249
- validate: '/workflows/validate',
250
- export: '/workflows/{id}/export',
251
- import: '/workflows/import'
252
- },
253
- executions: {
254
- execute: '/workflows/{id}/execute',
255
- status: '/executions/{id}',
256
- cancel: '/executions/{id}/cancel',
257
- logs: '/executions/{id}/logs',
258
- history: '/executions'
259
- }
260
- },
261
- timeout: 30000,
262
- retry: {
263
- enabled: true,
264
- maxAttempts: 3,
265
- delay: 1000,
266
- backoff: 'exponential'
267
- },
268
- auth: {
269
- type: 'bearer',
270
- token: 'your-auth-token'
271
- }
272
- }
273
- });
274
- ```
203
+ Override CSS custom properties:
275
204
 
276
- #### Drupal Integration Example
205
+ ```css
206
+ :root {
207
+ --flowdrop-background-color: #f9fafb;
208
+ --flowdrop-primary-color: #3b82f6;
209
+ --flowdrop-border-color: #e5e7eb;
210
+ --flowdrop-text-color: #1f2937;
211
+ }
212
+ ```
277
213
 
278
- ```javascript
279
- // Drupal behavior for FlowDrop integration
280
- Drupal.behaviors.flowdropWorkflowEditor = {
281
- attach: function (context, settings) {
282
- const container = context.querySelector('.flowdrop-workflow-editor');
283
- if (container && window.FlowDrop) {
284
- window.FlowDrop.mountWorkflowEditor(container, {
285
- endpointConfig: settings.flowdrop.endpointConfig,
286
- workflow: settings.flowdrop.workflow,
287
- nodes: settings.flowdrop.nodes
288
- });
289
- }
290
- }
214
+ ### Node Types
215
+
216
+ Define custom node types:
217
+
218
+ ```typescript
219
+ const customNode: NodeMetadata = {
220
+ id: "custom_processor",
221
+ name: "Custom Processor",
222
+ category: "data_processing",
223
+ description: "Process data with custom logic",
224
+ icon: "mdi:cog",
225
+ color: "#3b82f6",
226
+ inputs: [
227
+ {
228
+ id: "input",
229
+ name: "Input",
230
+ type: "input",
231
+ dataType: "mixed"
232
+ }
233
+ ],
234
+ outputs: [
235
+ {
236
+ id: "output",
237
+ name: "Output",
238
+ type: "output",
239
+ dataType: "mixed"
240
+ }
241
+ ],
242
+ configSchema: {
243
+ type: "object",
244
+ properties: {
245
+ operation: {
246
+ type: "string",
247
+ title: "Operation"
248
+ }
249
+ }
250
+ }
291
251
  };
292
252
  ```
293
253
 
294
- ### REST API Endpoints
295
-
296
- #### Workflows
254
+ ## 🔌 Backend Integration
297
255
 
298
- - `GET /api/flowdrop/workflows` - List workflows
299
- - `POST /api/flowdrop/workflows` - Create workflow
300
- - `GET /api/flowdrop/workflows/{id}` - Get workflow
301
- - `PUT /api/flowdrop/workflows/{id}` - Update workflow
302
- - `DELETE /api/flowdrop/workflows/{id}` - Delete workflow
303
- - `POST /api/flowdrop/workflows/{id}/execute` - Execute workflow
256
+ FlowDrop is backend-agnostic. Implement the API endpoints expected by the client:
304
257
 
305
- #### Nodes
258
+ ### Required Endpoints
306
259
 
307
- - `GET /api/flowdrop/nodes` - List available nodes
308
- - `GET /api/flowdrop/nodes/{id}` - Get node metadata
309
- - `GET /api/flowdrop/nodes?category={category}` - Filter by category
260
+ - `GET /api/nodes` - List available node types
261
+ - `GET /api/workflows` - List workflows
262
+ - `GET /api/workflows/{id}` - Get workflow
263
+ - `POST /api/workflows` - Create workflow
264
+ - `PUT /api/workflows/{id}` - Update workflow
265
+ - `DELETE /api/workflows/{id}` - Delete workflow
266
+ - `POST /api/workflows/{id}/execute` - Execute workflow
310
267
 
311
- #### Executions
268
+ See `API.md` for detailed endpoint specifications.
312
269
 
313
- - `GET /api/flowdrop/executions/active` - Active executions
314
- - `GET /api/flowdrop/executions/{id}/state` - Execution status
270
+ ## 🧪 Testing
315
271
 
316
- ### Node Configuration Schema
272
+ ```bash
273
+ # Unit tests
274
+ npm run test:unit
317
275
 
318
- Each node type defines its configuration schema:
276
+ # E2E tests
277
+ npm run test:e2e
319
278
 
320
- ```json
321
- {
322
- "type": "object",
323
- "properties": {
324
- "setting1": {
325
- "type": "string",
326
- "title": "Setting 1",
327
- "description": "Description of setting"
328
- },
329
- "setting2": {
330
- "type": "number",
331
- "default": 0
332
- }
333
- }
334
- }
279
+ # All tests
280
+ npm test
335
281
  ```
336
282
 
337
- ## 🔒 Security
283
+ ## 🛠️ Development
338
284
 
339
- - All API endpoints require appropriate Drupal permissions
340
- - Input validation on all node processors
341
- - Exception handling for failed executions
342
- - Logging of all workflow operations
285
+ ```bash
286
+ # Install dependencies
287
+ npm install
343
288
 
344
- ## 🧪 Testing
289
+ # Development server
290
+ npm run dev
345
291
 
346
- ### Backend Testing
292
+ # Build library
293
+ npm run build
347
294
 
348
- ```bash
349
- ddev drush test:run flowdrop
350
- ```
295
+ # Build for production
296
+ npm run build:production
351
297
 
352
- ### Frontend Testing
298
+ # Linting
299
+ npm run lint
353
300
 
354
- ```bash
355
- cd modules/flowdrop_ui/app/flowdrop
356
- npm run test:unit
357
- npm run test:e2e
301
+ # Format code
302
+ npm run format
358
303
  ```
359
304
 
360
- ## 📝 Logging
305
+ ## 📖 Documentation
361
306
 
362
- Workflow execution is logged through Drupal's logging system:
363
-
364
- ```php
365
- $this->loggerFactory->get('flowdrop')->info('Workflow executed', [
366
- 'workflow_id' => $workflowId,
367
- 'execution_time' => $executionTime,
368
- ]);
369
- ```
307
+ - **API.md** - REST API specification
308
+ - **CHANGELOG.md** - Version history
309
+ - **Storybook** - Component documentation (run `npm run storybook`)
370
310
 
371
311
  ## 🤝 Contributing
372
312
 
373
- Not accepting Contribution until the module stabilizes. Stay tuned.
313
+ Not accepting contributions until the library stabilizes. Stay tuned.
374
314
 
375
- ## 🆘 Support
315
+ ## 📄 License
376
316
 
377
- For issues and questions:
317
+ MIT
318
+
319
+ ## 🆘 Support
378
320
 
379
- - Check the API documentation in `modules/flowdrop_ui/app/flowdrop/API.md`
380
- - Review the security guidelines in `modules/flowdrop_ui/app/flowdrop/SECURITY.md`
321
+ - Check the API documentation in `API.md`
381
322
  - Create an issue in the project repository
323
+ - Review the examples in `src/lib/examples/`
382
324
 
383
325
  ---
384
326
 
385
- **FlowDrop** - Empowering Drupal with visual workflow automation.
327
+ **FlowDrop** - Visual workflow editing for modern web applications
@@ -1,6 +1,6 @@
1
1
  <!--
2
- FlowDrop Demo Page
3
- Demonstrates the FlowDrop library with sample data
2
+ FlowDrop App Component
3
+ Main application wrapper with navbar, sidebars, and workflow editor
4
4
  Styled with BEM syntax
5
5
  -->
6
6
 
@@ -310,7 +310,7 @@
310
310
  const savedWorkflow = await workflowApi.saveWorkflow(finalWorkflow);
311
311
 
312
312
  // Update the workflow ID if it changed (new workflow)
313
- // Keep our current workflow state, only update ID and metadata from Drupal
313
+ // Keep our current workflow state, only update ID and metadata from backend
314
314
  if (savedWorkflow.id && savedWorkflow.id !== finalWorkflow.id) {
315
315
  workflowActions.batchUpdate({
316
316
  nodes: finalWorkflow.nodes,
@@ -508,7 +508,7 @@
508
508
  class="flowdrop-btn flowdrop-btn--sm flowdrop-btn--outline"
509
509
  onclick={() => {
510
510
  const defaultUrl = '/api/flowdrop';
511
- const newUrl = prompt('Enter Drupal API URL:', defaultUrl);
511
+ const newUrl = prompt('Enter Backend API URL:', defaultUrl);
512
512
  if (newUrl) {
513
513
  const endpointConfig = createEndpointConfig(newUrl);
514
514
  setEndpointConfig(endpointConfig);
@@ -511,7 +511,7 @@
511
511
  }
512
512
  };
513
513
 
514
- console.log('💾 WorkflowEditor: Saving workflow to Drupal:');
514
+ console.log('💾 WorkflowEditor: Saving workflow to backend:');
515
515
  console.log(' - ID:', workflow.id);
516
516
  console.log(' - Name:', workflow.name);
517
517
  console.log(' - Nodes count:', workflow.nodes.length);
@@ -520,14 +520,14 @@
520
520
 
521
521
  const savedWorkflow = await workflowApi.saveWorkflow(workflow);
522
522
 
523
- console.log('✅ WorkflowEditor: Received workflow from Drupal:');
523
+ console.log('✅ WorkflowEditor: Received workflow from backend:');
524
524
  console.log(' - ID:', savedWorkflow.id);
525
525
  console.log(' - Name:', savedWorkflow.name);
526
526
  console.log(' - Nodes count:', savedWorkflow.nodes?.length || 0);
527
527
  console.log(' - Edges count:', savedWorkflow.edges?.length || 0);
528
528
 
529
529
  // Update the workflow ID if it changed (new workflow)
530
- // Keep our current workflow state, only update ID and metadata from Drupal
530
+ // Keep our current workflow state, only update ID and metadata from backend
531
531
  if (savedWorkflow.id && savedWorkflow.id !== workflow.id) {
532
532
  console.log('🔄 Updating workflow ID from', workflow.id, 'to', savedWorkflow.id);
533
533
  workflowActions.batchUpdate({
@@ -77,14 +77,14 @@ export const demoWorkflowConfig = {
77
77
  * Demo instructions for non-technical users
78
78
  */
79
79
  export const demoInstructions = {
80
- title: 'Multi-Agent Content Management Demo',
81
- description: 'This demo shows how FlowDrop uses multiple AI agents working together to manage and improve your Drupal content.',
80
+ title: 'Multi-Agent Workflow Demo',
81
+ description: 'This demo shows how FlowDrop uses multiple AI agents working together to process and manage data workflows.',
82
82
  steps: [
83
83
  {
84
84
  step: 1,
85
85
  title: 'User Input',
86
- description: 'Start by telling the main agent what content management task you need.',
87
- example: "Find all blog posts about 'XB' and check if it's being used correctly as an acronym"
86
+ description: 'Start by providing input data or instructions to the main agent.',
87
+ example: 'Analyze and process the provided dataset'
88
88
  },
89
89
  {
90
90
  step: 2,
@@ -94,20 +94,20 @@ export const demoInstructions = {
94
94
  },
95
95
  {
96
96
  step: 3,
97
- title: 'Content Analysis Agent',
98
- description: 'Specialized agent analyzes content using RAG search tools to find and examine relevant content.',
99
- note: 'Uses Drupal Search API RAG tool for intelligent content discovery'
97
+ title: 'Data Analysis Agent',
98
+ description: 'Specialized agent analyzes data using search and processing tools to find and examine relevant information.',
99
+ note: 'Uses connected data sources and search tools for intelligent data discovery'
100
100
  },
101
101
  {
102
102
  step: 4,
103
- title: 'Content Editor Agent',
104
- description: 'Specialized agent makes improvements using available tools like date formatters and draft creators.',
105
- note: 'Has access to multiple tools and makes conservative, tracked changes'
103
+ title: 'Data Processing Agent',
104
+ description: 'Specialized agent processes and transforms data using available tools and formatters.',
105
+ note: 'Has access to multiple tools and makes tracked transformations'
106
106
  },
107
107
  {
108
108
  step: 5,
109
109
  title: 'Tool Integration',
110
- description: 'Sub-agents use specialized tools: RAG search, draft creation, date formatting, etc.',
110
+ description: 'Sub-agents use specialized tools for data processing, formatting, and transformation.',
111
111
  note: "Tools are connected via special 'tool' interface ports"
112
112
  },
113
113
  {
@@ -120,23 +120,23 @@ export const demoInstructions = {
120
120
  step: 7,
121
121
  title: 'Orchestrated Response',
122
122
  description: 'Main agent compiles results from all sub-agents and provides a comprehensive response.',
123
- note: 'Includes summaries, draft links, and next steps for human review'
123
+ note: 'Includes summaries, results, and next steps for review'
124
124
  }
125
125
  ],
126
126
  benefits: [
127
127
  'Multi-agent collaboration for complex tasks',
128
- 'Specialized agents for specific content management functions',
128
+ 'Specialized agents for specific data processing functions',
129
129
  'Intelligent task orchestration and coordination',
130
130
  'Tool-based architecture for extensibility',
131
- 'Human oversight through draft approval process',
131
+ 'Human oversight through review process',
132
132
  'Scalable agent-to-agent communication patterns'
133
133
  ],
134
134
  useCases: [
135
- 'Multi-agent content analysis and improvement',
136
- 'Coordinated acronym standardization workflows',
137
- 'Agent-orchestrated style guide enforcement',
138
- 'Collaborative content quality assessment',
139
- 'Tool-assisted bulk content transformations',
140
- 'Intelligent editorial workflow automation'
135
+ 'Multi-agent data analysis and processing',
136
+ 'Coordinated data transformation workflows',
137
+ 'Agent-orchestrated data quality checks',
138
+ 'Collaborative data processing pipelines',
139
+ 'Tool-assisted bulk data operations',
140
+ 'Intelligent workflow automation'
141
141
  ]
142
142
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Sample data for FlowDrop development and testing
3
- * Full set matching Langflow's default categories and node types
3
+ * Includes sample nodes and workflows for demonstration and testing purposes
4
4
  */
5
5
  import type { NodeMetadata, Workflow } from '../types/index.js';
6
6
  import { CATEGORY_ICONS } from '../utils/icons.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Sample data for FlowDrop development and testing
3
- * Full set matching Langflow's default categories and node types
3
+ * Includes sample nodes and workflows for demonstration and testing purposes
4
4
  */
5
5
  import { CATEGORY_ICONS } from '../utils/icons.js';
6
6
  /**
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Example: Using FlowDrop API Client
3
- * This demonstrates how to integrate with FlowDrop API from backend applications
3
+ * Demonstrates how to integrate with FlowDrop API from applications
4
+ * This client can be used with any backend that implements the FlowDrop API specification
4
5
  */
5
6
  import type { Workflow } from '../types/index.js';
6
7
  declare function checkApiHealth(): Promise<{
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Example: Using FlowDrop API Client
3
- * This demonstrates how to integrate with FlowDrop API from backend applications
3
+ * Demonstrates how to integrate with FlowDrop API from applications
4
+ * This client can be used with any backend that implements the FlowDrop API specification
4
5
  */
5
6
  import { ApiClient } from '../clients/ApiClient.js';
6
7
  // Initialize the API client
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * FlowDrop - Workflow Library
3
- * A Svelte Flow-based library for building workflows
2
+ * FlowDrop - Visual Workflow Editor Library
3
+ * A Svelte 5 component library built on @xyflow/svelte for creating node-based workflow editors
4
4
  */
5
5
  import "./styles/base.css";
6
6
  export type { NodeCategory, NodeDataType, NodePort, NodeMetadata, NodeConfig, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents } from './types/index.js';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * FlowDrop - Workflow Library
3
- * A Svelte Flow-based library for building workflows
2
+ * FlowDrop - Visual Workflow Editor Library
3
+ * A Svelte 5 component library built on @xyflow/svelte for creating node-based workflow editors
4
4
  */
5
5
  // Import CSS to ensure styles are included in the library build
6
6
  import "./styles/base.css";
@@ -31,5 +31,5 @@ export * from './config/endpoints.js';
31
31
  export * from './adapters/WorkflowAdapter.js';
32
32
  // Export API client
33
33
  export * from './clients/ApiClient.js';
34
- // Export Svelte app wrapper for Drupal integration
34
+ // Export Svelte app wrapper for framework integration
35
35
  export { mountWorkflowEditor, unmountWorkflowEditor, mountFlowDropApp, unmountFlowDropApp } from './svelte-app.js';
@@ -1,6 +1,7 @@
1
1
  /**
2
- * Svelte App Wrapper for Drupal Integration
3
- * This provides a way to mount Svelte components in Drupal
2
+ * Svelte App Wrapper for Framework Integration
3
+ * Provides mount/unmount functions for integrating FlowDrop into any web application
4
+ * Particularly useful for integration with vanilla JS, Drupal, WordPress, or other frameworks
4
5
  */
5
6
  import type { Workflow, NodeMetadata, PortConfig } from './types/index.js';
6
7
  import type { EndpointConfig } from './config/endpoints.js';
@@ -19,8 +20,10 @@ interface MountedSvelteApp {
19
20
  export?: () => void;
20
21
  }
21
22
  /**
22
- * Mount the full FlowDrop App with configurable navbar height and other settings
23
- * This is the recommended way to mount the app for IIFE usage
23
+ * Mount the full FlowDrop App with navbar, sidebars, and workflow editor
24
+ * Use this for a complete workflow editing experience with all UI components
25
+ * @param container - DOM element to mount the app into
26
+ * @param options - Configuration options for the app
24
27
  */
25
28
  export declare function mountFlowDropApp(container: HTMLElement, options?: {
26
29
  workflow?: Workflow;
@@ -45,7 +48,8 @@ export declare function mountFlowDropApp(container: HTMLElement, options?: {
45
48
  }>;
46
49
  }): Promise<MountedSvelteApp>;
47
50
  /**
48
- * Mount the WorkflowEditor component in a Drupal container
51
+ * Mount the WorkflowEditor component in a container
52
+ * Simpler alternative to mountFlowDropApp - only mounts the editor without navbar
49
53
  */
50
54
  export declare function mountWorkflowEditor(container: HTMLElement, options?: {
51
55
  workflow?: Workflow;
@@ -1,6 +1,7 @@
1
1
  /**
2
- * Svelte App Wrapper for Drupal Integration
3
- * This provides a way to mount Svelte components in Drupal
2
+ * Svelte App Wrapper for Framework Integration
3
+ * Provides mount/unmount functions for integrating FlowDrop into any web application
4
+ * Particularly useful for integration with vanilla JS, Drupal, WordPress, or other frameworks
4
5
  */
5
6
  import { mount } from 'svelte';
6
7
  import WorkflowEditor from './components/WorkflowEditor.svelte';
@@ -10,8 +11,10 @@ import { initializePortCompatibility } from './utils/connections.js';
10
11
  import { DEFAULT_PORT_CONFIG } from './config/defaultPortConfig.js';
11
12
  import { fetchPortConfig } from './services/portConfigApi.js';
12
13
  /**
13
- * Mount the full FlowDrop App with configurable navbar height and other settings
14
- * This is the recommended way to mount the app for IIFE usage
14
+ * Mount the full FlowDrop App with navbar, sidebars, and workflow editor
15
+ * Use this for a complete workflow editing experience with all UI components
16
+ * @param container - DOM element to mount the app into
17
+ * @param options - Configuration options for the app
15
18
  */
16
19
  export async function mountFlowDropApp(container, options = {}) {
17
20
  const { workflow, nodes = [], endpointConfig, portConfig, height = '100vh', width = '100%', showNavbar = false, disableSidebar, lockWorkflow, readOnly, nodeStatuses, pipelineId, navbarTitle, navbarActions } = options;
@@ -87,7 +90,8 @@ export async function mountFlowDropApp(container, options = {}) {
87
90
  return app;
88
91
  }
89
92
  /**
90
- * Mount the WorkflowEditor component in a Drupal container
93
+ * Mount the WorkflowEditor component in a container
94
+ * Simpler alternative to mountFlowDropApp - only mounts the editor without navbar
91
95
  */
92
96
  export async function mountWorkflowEditor(container, options = {}) {
93
97
  const { workflow, nodes = [], endpointConfig, portConfig } = options;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@d34dman/flowdrop",
3
3
  "license": "MIT",
4
4
  "private": false,
5
- "version": "0.0.3",
5
+ "version": "0.0.4",
6
6
  "scripts": {
7
7
  "dev": "vite dev",
8
8
  "build": "vite build && npm run prepack",