@d34dman/flowdrop 0.0.23 → 0.0.25

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.
@@ -87,6 +87,37 @@ export interface DynamicPort {
87
87
  /** Whether this port is required for execution */
88
88
  required?: boolean;
89
89
  }
90
+ /**
91
+ * Branch configuration for gateway nodes
92
+ *
93
+ * Branches define conditional output paths in gateway/switch nodes.
94
+ * Each branch creates an output handle that can be connected to downstream nodes.
95
+ * Branches are stored in `config.branches` array and support dynamic addition/removal
96
+ * through the node configuration panel.
97
+ *
98
+ * @example
99
+ * ```typescript
100
+ * const branches: Branch[] = [
101
+ * { name: "high", label: "High Priority", condition: "priority > 8" },
102
+ * { name: "medium", label: "Medium Priority", condition: "priority >= 4" },
103
+ * { name: "default", label: "Default", isDefault: true }
104
+ * ];
105
+ * ```
106
+ */
107
+ export interface Branch {
108
+ /** Unique identifier for the branch (used as handle ID and for connections) */
109
+ name: string;
110
+ /** Display label shown in the UI (optional, defaults to name) */
111
+ label?: string;
112
+ /** Description of when this branch is activated */
113
+ description?: string;
114
+ /** Optional value associated with the branch (e.g., for Switch matching) */
115
+ value?: string;
116
+ /** Optional condition expression for this branch */
117
+ condition?: string;
118
+ /** Whether this is the default/fallback branch */
119
+ isDefault?: boolean;
120
+ }
90
121
  /**
91
122
  * Convert a DynamicPort to a NodePort
92
123
  * @param port - The dynamic port configuration
@@ -180,6 +211,8 @@ export interface NodeMetadata {
180
211
  inputs: NodePort[];
181
212
  outputs: NodePort[];
182
213
  configSchema?: ConfigSchema;
214
+ /** Default configuration values for this node type */
215
+ config?: Record<string, unknown>;
183
216
  tags?: string[];
184
217
  /**
185
218
  * Custom extension properties for 3rd party integrations
@@ -314,13 +347,59 @@ export type SchemaProperty<T extends SchemaType> = T extends 'config' ? ConfigPr
314
347
  export type SchemaTypeMap<T extends SchemaType> = T extends 'config' ? ConfigSchema : T extends 'input' ? InputSchema : T extends 'output' ? OutputSchema : never;
315
348
  /**
316
349
  * Node configuration values
317
- * Key-value pairs of user-entered configuration values
350
+ *
351
+ * Key-value pairs of user-entered configuration values based on the node's configSchema.
352
+ * This is where all node-specific settings are stored, including:
353
+ *
354
+ * **Standard Properties:**
355
+ * - Any property defined in the node's `configSchema` (e.g., model, temperature, apiKey)
356
+ *
357
+ * **Special Properties (Dynamic Ports):**
358
+ * - `dynamicInputs`: Array of DynamicPort for user-defined input handles
359
+ * - `dynamicOutputs`: Array of DynamicPort for user-defined output handles
360
+ * - `branches`: Array of Branch for gateway node conditional output paths
361
+ *
362
+ * The backend uses this object to:
363
+ * - Store and retrieve node configuration
364
+ * - Pass configuration values to node processors during execution
365
+ * - Persist node state across sessions
366
+ *
367
+ * @example
368
+ * ```typescript
369
+ * const config: ConfigValues = {
370
+ * // Standard configuration from configSchema
371
+ * model: "gpt-4o-mini",
372
+ * temperature: 0.7,
373
+ * maxTokens: 1000,
374
+ *
375
+ * // Dynamic input ports
376
+ * dynamicInputs: [
377
+ * { name: "extra_data", label: "Extra Data", dataType: "json" }
378
+ * ],
379
+ *
380
+ * // Gateway branches
381
+ * branches: [
382
+ * { name: "success", label: "Success", condition: "status === 200" },
383
+ * { name: "error", label: "Error", isDefault: true }
384
+ * ]
385
+ * };
386
+ * ```
318
387
  */
319
388
  export interface ConfigValues {
389
+ /** Dynamic input ports for user-defined input handles */
390
+ dynamicInputs?: DynamicPort[];
391
+ /** Dynamic output ports for user-defined output handles */
392
+ dynamicOutputs?: DynamicPort[];
393
+ /** Branches for gateway node conditional output paths */
394
+ branches?: Branch[];
395
+ /** Any other configuration properties defined in configSchema */
320
396
  [key: string]: unknown;
321
397
  }
322
398
  /**
323
399
  * Extended node type for workflows
400
+ *
401
+ * Represents a node instance in a workflow, containing position, display data,
402
+ * configuration values, and metadata from the node type definition.
324
403
  */
325
404
  export interface WorkflowNode extends Node {
326
405
  id: string;
@@ -328,11 +407,30 @@ export interface WorkflowNode extends Node {
328
407
  position: XYPosition;
329
408
  deletable?: boolean;
330
409
  data: {
410
+ /** Display label for the node instance */
331
411
  label: string;
412
+ /**
413
+ * Node configuration values
414
+ *
415
+ * Contains all user-configured settings for this node instance based on the
416
+ * node type's configSchema. This includes standard properties defined in the
417
+ * schema as well as special dynamic port configurations.
418
+ *
419
+ * The backend uses this object to:
420
+ * - Store and retrieve node configuration
421
+ * - Pass configuration values to node processors during execution
422
+ * - Persist node state across sessions
423
+ *
424
+ * @see ConfigValues for detailed documentation of available properties
425
+ */
332
426
  config: ConfigValues;
427
+ /** Node type metadata (inputs, outputs, configSchema, etc.) */
333
428
  metadata: NodeMetadata;
429
+ /** Whether the node is currently processing/executing */
334
430
  isProcessing?: boolean;
431
+ /** Error message if the node execution failed */
335
432
  error?: string;
433
+ /** Alternative node identifier */
336
434
  nodeId?: string;
337
435
  /** Node execution tracking information */
338
436
  executionInfo?: NodeExecutionInfo;
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.23",
5
+ "version": "0.0.25",
6
6
  "scripts": {
7
7
  "dev": "vite dev",
8
8
  "build": "vite build && npm run prepack",
@@ -104,6 +104,7 @@
104
104
  "@sveltejs/vite-plugin-svelte": "^5.0.0",
105
105
  "@types/marked": "^6.0.0",
106
106
  "@types/node": "^20",
107
+ "@types/uuid": "^10.0.0",
107
108
  "@vitest/browser": "^3.2.3",
108
109
  "eslint": "^9.18.0",
109
110
  "eslint-config-prettier": "^10.0.1",
@@ -125,8 +126,7 @@
125
126
  "vite": "^6.2.6",
126
127
  "vite-plugin-devtools-json": "^0.2.1",
127
128
  "vitest": "^3.2.3",
128
- "vitest-browser-svelte": "^0.1.0",
129
- "@types/uuid": "^10.0.0"
129
+ "vitest-browser-svelte": "^0.1.0"
130
130
  },
131
131
  "overrides": {
132
132
  "@sveltejs/kit": {
@@ -137,7 +137,13 @@
137
137
  "svelte"
138
138
  ],
139
139
  "dependencies": {
140
+ "@codemirror/autocomplete": "^6.20.0",
141
+ "@codemirror/lang-json": "^6.0.2",
142
+ "@codemirror/lint": "^6.9.2",
143
+ "@codemirror/theme-one-dark": "^6.1.3",
140
144
  "@xyflow/svelte": "~1.2",
145
+ "codemirror": "^6.0.2",
146
+ "easymde": "^2.20.0",
141
147
  "marked": "^16.1.1",
142
148
  "svelte-5-french-toast": "^2.0.6",
143
149
  "uuid": "^11.1.0"