@d34dman/flowdrop 0.0.1 → 0.0.2

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 (119) hide show
  1. package/README.md +307 -215
  2. package/dist/adapters/WorkflowAdapter.d.ts +1 -1
  3. package/dist/adapters/WorkflowAdapter.js +30 -30
  4. package/dist/api/client.d.ts +24 -1
  5. package/dist/api/client.js +55 -38
  6. package/dist/api/enhanced-client.d.ts +46 -0
  7. package/dist/api/enhanced-client.js +211 -0
  8. package/dist/clients/ApiClient.d.ts +19 -23
  9. package/dist/clients/ApiClient.js +36 -34
  10. package/dist/components/App.svelte +1299 -230
  11. package/dist/components/App.svelte.d.ts +21 -1
  12. package/dist/components/CanvasBanner.svelte +50 -44
  13. package/dist/components/CanvasBanner.svelte.d.ts +5 -19
  14. package/dist/components/ConfigForm.svelte +555 -0
  15. package/dist/components/ConfigForm.svelte.d.ts +32 -0
  16. package/dist/components/ConfigModal.svelte +261 -0
  17. package/dist/components/ConfigModal.svelte.d.ts +31 -0
  18. package/dist/components/ConfigSidebar.svelte +934 -0
  19. package/dist/components/ConfigSidebar.svelte.d.ts +51 -0
  20. package/dist/components/ConnectionLine.svelte +32 -0
  21. package/dist/components/ConnectionLine.svelte.d.ts +3 -0
  22. package/dist/components/GatewayNode.svelte +471 -0
  23. package/dist/components/GatewayNode.svelte.d.ts +15 -0
  24. package/dist/components/LoadingSpinner.svelte +23 -23
  25. package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
  26. package/dist/components/Logo.svelte +82 -0
  27. package/dist/components/Logo.svelte.d.ts +26 -0
  28. package/dist/components/LogsSidebar.svelte +565 -0
  29. package/dist/components/LogsSidebar.svelte.d.ts +34 -0
  30. package/dist/components/MarkdownDisplay.svelte +28 -0
  31. package/dist/components/MarkdownDisplay.svelte.d.ts +7 -0
  32. package/dist/components/Navbar.svelte +663 -0
  33. package/dist/components/Navbar.svelte.d.ts +21 -0
  34. package/dist/components/NodeSidebar.svelte +629 -488
  35. package/dist/components/NodeSidebar.svelte.d.ts +1 -2
  36. package/dist/components/NodeStatusOverlay.svelte +327 -0
  37. package/dist/components/NodeStatusOverlay.svelte.d.ts +11 -0
  38. package/dist/components/NotesNode.svelte +566 -0
  39. package/dist/components/NotesNode.svelte.d.ts +43 -0
  40. package/dist/components/PipelineStatus.svelte +331 -0
  41. package/dist/components/PipelineStatus.svelte.d.ts +18 -0
  42. package/dist/components/SimpleNode.svelte +447 -0
  43. package/dist/components/SimpleNode.svelte.d.ts +24 -0
  44. package/dist/components/SquareNode.svelte +346 -0
  45. package/dist/components/SquareNode.svelte.d.ts +24 -0
  46. package/dist/components/StatusIcon.svelte +112 -0
  47. package/dist/components/StatusIcon.svelte.d.ts +10 -0
  48. package/dist/components/StatusLabel.svelte +33 -0
  49. package/dist/components/StatusLabel.svelte.d.ts +7 -0
  50. package/dist/components/ToolNode.svelte +385 -0
  51. package/dist/components/ToolNode.svelte.d.ts +36 -0
  52. package/dist/components/UniversalNode.svelte +126 -0
  53. package/dist/components/UniversalNode.svelte.d.ts +15 -0
  54. package/dist/components/WorkflowEditor.svelte +871 -528
  55. package/dist/components/WorkflowEditor.svelte.d.ts +15 -5
  56. package/dist/components/WorkflowNode.svelte +428 -542
  57. package/dist/components/WorkflowNode.svelte.d.ts +7 -3
  58. package/dist/config/apiConfig.d.ts +33 -0
  59. package/dist/config/apiConfig.js +39 -0
  60. package/dist/config/defaultPortConfig.d.ts +6 -0
  61. package/dist/config/defaultPortConfig.js +192 -0
  62. package/dist/config/demo.d.ts +58 -0
  63. package/dist/config/demo.js +142 -0
  64. package/dist/config/endpoints.d.ts +106 -0
  65. package/dist/config/endpoints.js +128 -0
  66. package/dist/data/samples.d.ts +38 -4
  67. package/dist/data/samples.js +2789 -737
  68. package/dist/examples/adapter-usage.d.ts +4 -4
  69. package/dist/examples/adapter-usage.js +21 -26
  70. package/dist/examples/api-client-usage.d.ts +6 -6
  71. package/dist/examples/api-client-usage.js +55 -54
  72. package/dist/index.d.ts +23 -15
  73. package/dist/index.js +23 -15
  74. package/dist/mocks/app-environment.d.ts +8 -0
  75. package/dist/mocks/app-environment.js +16 -0
  76. package/dist/mocks/app-forms.d.ts +2 -0
  77. package/dist/mocks/app-forms.js +21 -0
  78. package/dist/mocks/app-navigation.d.ts +5 -0
  79. package/dist/mocks/app-navigation.js +34 -0
  80. package/dist/mocks/app-stores.d.ts +14 -0
  81. package/dist/mocks/app-stores.js +26 -0
  82. package/dist/services/api.d.ts +13 -3
  83. package/dist/services/api.js +91 -36
  84. package/dist/services/globalSave.d.ts +20 -0
  85. package/dist/services/globalSave.js +165 -0
  86. package/dist/services/nodeExecutionService.d.ts +63 -0
  87. package/dist/services/nodeExecutionService.js +261 -0
  88. package/dist/services/portConfigApi.d.ts +14 -0
  89. package/dist/services/portConfigApi.js +69 -0
  90. package/dist/services/toastService.d.ts +147 -0
  91. package/dist/services/toastService.js +235 -0
  92. package/dist/services/workflowStorage.d.ts +2 -2
  93. package/dist/services/workflowStorage.js +10 -10
  94. package/dist/stores/workflowStore.d.ts +53 -0
  95. package/dist/stores/workflowStore.js +264 -0
  96. package/dist/styles/base.css +896 -363
  97. package/dist/svelte-app.d.ts +52 -5
  98. package/dist/svelte-app.js +128 -6
  99. package/dist/types/config.d.ts +291 -0
  100. package/dist/types/config.js +4 -0
  101. package/dist/types/index.d.ts +231 -19
  102. package/dist/types/index.js +1 -1
  103. package/dist/utils/colors.d.ts +67 -33
  104. package/dist/utils/colors.js +183 -118
  105. package/dist/utils/config.d.ts +41 -0
  106. package/dist/utils/config.js +248 -0
  107. package/dist/utils/connections.d.ts +40 -3
  108. package/dist/utils/connections.js +115 -44
  109. package/dist/utils/icons.d.ts +1 -1
  110. package/dist/utils/icons.js +71 -70
  111. package/dist/utils/nodeStatus.d.ts +53 -0
  112. package/dist/utils/nodeStatus.js +183 -0
  113. package/dist/utils/nodeTypes.d.ts +57 -0
  114. package/dist/utils/nodeTypes.js +109 -0
  115. package/dist/utils/nodeWrapper.d.ts +39 -0
  116. package/dist/utils/nodeWrapper.js +62 -0
  117. package/package.json +129 -97
  118. package/dist/components/Node.svelte +0 -38
  119. package/dist/components/Node.svelte.d.ts +0 -4
@@ -3,73 +3,117 @@
3
3
  * Ensures consistent category colors across sidebar and canvas
4
4
  * Uses BEM syntax for CSS classes
5
5
  */
6
+ import { getPortCompatibilityChecker } from './connections.js';
6
7
  /**
7
8
  * Category color mapping to reference tokens (CSS variables)
8
9
  */
9
10
  export const CATEGORY_COLOR_TOKENS = {
10
- "inputs": "var(--color-ref-emerald-500)",
11
- "outputs": "var(--color-ref-blue-600)",
12
- "prompts": "var(--color-ref-amber-500)",
13
- "models": "var(--color-ref-indigo-500)",
14
- "processing": "var(--color-ref-teal-500)",
15
- "logic": "var(--color-ref-purple-600)",
16
- "data": "var(--color-ref-orange-500)",
17
- "helpers": "var(--color-ref-slate-500)",
18
- "tools": "var(--color-ref-amber-500)",
19
- "vector stores": "var(--color-ref-emerald-500)",
20
- "embeddings": "var(--color-ref-indigo-500)",
21
- "memories": "var(--color-ref-blue-600)",
22
- "agents": "var(--color-ref-teal-500)",
23
- "bundles": "var(--color-ref-slate-500)"
11
+ inputs: 'var(--color-ref-emerald-500)',
12
+ outputs: 'var(--color-ref-blue-600)',
13
+ prompts: 'var(--color-ref-amber-500)',
14
+ models: 'var(--color-ref-indigo-500)',
15
+ processing: 'var(--color-ref-teal-500)',
16
+ logic: 'var(--color-ref-purple-600)',
17
+ data: 'var(--color-ref-orange-500)',
18
+ helpers: 'var(--color-ref-slate-500)',
19
+ tools: 'var(--color-ref-amber-500)',
20
+ 'vector stores': 'var(--color-ref-emerald-500)',
21
+ embeddings: 'var(--color-ref-indigo-500)',
22
+ memories: 'var(--color-ref-blue-600)',
23
+ agents: 'var(--color-ref-teal-500)',
24
+ ai: 'var(--color-ref-purple-500)',
25
+ bundles: 'var(--color-ref-slate-500)'
24
26
  };
25
27
  /**
26
28
  * Data type color mapping to reference tokens (CSS variables)
29
+ * @deprecated Use getDataTypeColorToken() with port configuration instead
27
30
  */
28
31
  export const DATA_TYPE_COLOR_TOKENS = {
29
- string: "var(--color-ref-emerald-500)",
30
- text: "var(--color-ref-emerald-500)",
31
- number: "var(--color-ref-blue-600)",
32
- integer: "var(--color-ref-blue-600)",
33
- float: "var(--color-ref-blue-600)",
34
- boolean: "var(--color-ref-purple-600)",
35
- array: "var(--color-ref-amber-500)",
36
- list: "var(--color-ref-amber-500)",
37
- object: "var(--color-ref-orange-500)",
38
- json: "var(--color-ref-orange-500)",
39
- file: "var(--color-ref-red-500)",
40
- document: "var(--color-ref-red-500)",
41
- image: "var(--color-ref-pink-500)",
42
- picture: "var(--color-ref-pink-500)",
43
- audio: "var(--color-ref-indigo-500)",
44
- sound: "var(--color-ref-indigo-500)",
45
- video: "var(--color-ref-teal-500)",
46
- movie: "var(--color-ref-teal-500)",
47
- url: "var(--color-ref-cyan-500)",
48
- email: "var(--color-ref-cyan-500)",
49
- date: "var(--color-ref-lime-500)",
50
- datetime: "var(--color-ref-lime-500)",
51
- time: "var(--color-ref-lime-500)"
32
+ string: 'var(--color-ref-emerald-500)',
33
+ text: 'var(--color-ref-emerald-500)',
34
+ number: 'var(--color-ref-blue-600)',
35
+ integer: 'var(--color-ref-blue-600)',
36
+ float: 'var(--color-ref-blue-600)',
37
+ boolean: 'var(--color-ref-purple-600)',
38
+ array: 'var(--color-ref-amber-500)',
39
+ list: 'var(--color-ref-amber-500)',
40
+ object: 'var(--color-ref-orange-500)',
41
+ json: 'var(--color-ref-orange-500)',
42
+ mixed: 'var(--color-ref-orange-500)',
43
+ file: 'var(--color-ref-red-500)',
44
+ document: 'var(--color-ref-red-500)',
45
+ image: 'var(--color-ref-pink-500)',
46
+ picture: 'var(--color-ref-pink-500)',
47
+ audio: 'var(--color-ref-indigo-500)',
48
+ sound: 'var(--color-ref-indigo-500)',
49
+ video: 'var(--color-ref-teal-500)',
50
+ movie: 'var(--color-ref-teal-500)',
51
+ url: 'var(--color-ref-cyan-500)',
52
+ email: 'var(--color-ref-cyan-500)',
53
+ date: 'var(--color-ref-lime-500)',
54
+ datetime: 'var(--color-ref-lime-500)',
55
+ time: 'var(--color-ref-lime-500)',
56
+ tool: 'var(--color-ref-amber-500)',
57
+ trigger: 'var(--color-ref-gray-950)',
58
+ branch: 'var(--color-ref-purple-500)'
52
59
  };
53
60
  /**
54
61
  * Get the reference color token for a category
55
62
  */
56
63
  export function getCategoryColorToken(category) {
57
- return CATEGORY_COLOR_TOKENS[category] || "var(--color-ref-slate-500)";
64
+ return CATEGORY_COLOR_TOKENS[category] || 'var(--color-ref-slate-500)';
58
65
  }
59
66
  /**
60
- * Get the reference color token for a data type
67
+ * Get the reference color token for a data type (configurable version)
61
68
  */
62
69
  export function getDataTypeColorToken(dataType) {
63
- return DATA_TYPE_COLOR_TOKENS[dataType.toLowerCase()] || "var(--color-ref-slate-500)";
70
+ try {
71
+ const checker = getPortCompatibilityChecker();
72
+ const config = checker.getDataTypeConfig(dataType);
73
+ if (config?.color) {
74
+ return config.color;
75
+ }
76
+ }
77
+ catch {
78
+ // Fallback to static color mapping if port checker not initialized
79
+ // console.warn("Port compatibility checker not initialized, using fallback colors");
80
+ }
81
+ return DATA_TYPE_COLOR_TOKENS[dataType.toLowerCase()] || 'var(--color-ref-slate-500)';
82
+ }
83
+ /**
84
+ * Get data type configuration from port config
85
+ */
86
+ export function getDataTypeConfig(dataType) {
87
+ try {
88
+ const checker = getPortCompatibilityChecker();
89
+ return checker.getDataTypeConfig(dataType);
90
+ }
91
+ catch (error) {
92
+ console.warn('Port compatibility checker not initialized:', error);
93
+ return undefined;
94
+ }
95
+ }
96
+ /**
97
+ * Get all available data types from port configuration
98
+ */
99
+ export function getAvailableDataTypes() {
100
+ try {
101
+ const checker = getPortCompatibilityChecker();
102
+ return checker.getEnabledDataTypes();
103
+ }
104
+ catch (error) {
105
+ console.warn('Port compatibility checker not initialized:', error);
106
+ return [];
107
+ }
64
108
  }
65
109
  /**
66
110
  * Default colors for fallback cases
67
111
  */
68
112
  export const DEFAULT_COLORS = {
69
- background: "flowdrop-color--base-light",
70
- accent: "flowdrop-color--neutral",
71
- text: "flowdrop-color--base-text",
72
- border: "flowdrop-color--base-border"
113
+ background: 'flowdrop-color--base-light',
114
+ accent: 'flowdrop-color--neutral',
115
+ text: 'flowdrop-color--base-text',
116
+ border: 'flowdrop-color--base-border'
73
117
  };
74
118
  /**
75
119
  * Get category colors
@@ -77,18 +121,7 @@ export const DEFAULT_COLORS = {
77
121
  * @returns The color configuration for the category
78
122
  */
79
123
  export function getCategoryColors(category) {
80
- const colorToken = CATEGORY_COLOR_TOKENS[category];
81
- if (colorToken) {
82
- // Convert color token to BEM color class
83
- const colorName = colorToken.replace("var(--color-ref-", "").replace(")", "");
84
- return {
85
- background: `flowdrop-color--${colorName.split("-")[0]}-light`,
86
- accent: `flowdrop-color--${colorName.split("-")[0]}`,
87
- text: `flowdrop-color--${colorName.split("-")[0]}-text`,
88
- border: `flowdrop-color--${colorName.split("-")[0]}-border`
89
- };
90
- }
91
- return DEFAULT_COLORS;
124
+ return CATEGORY_COLOR_TOKENS[category] || 'var(--color-ref-slate-500)';
92
125
  }
93
126
  /**
94
127
  * Get category background color
@@ -96,15 +129,15 @@ export function getCategoryColors(category) {
96
129
  * @returns The background color class
97
130
  */
98
131
  export function getCategoryBackground(category) {
99
- return getCategoryColors(category).background;
132
+ return getCategoryColors(category);
100
133
  }
101
134
  /**
102
- * Get category accent color (for icons, highlights)
135
+ * Get category accent color
103
136
  * @param category - The node category
104
137
  * @returns The accent color class
105
138
  */
106
139
  export function getCategoryAccent(category) {
107
- return getCategoryColors(category).accent;
140
+ return getCategoryColors(category);
108
141
  }
109
142
  /**
110
143
  * Get category text color
@@ -112,7 +145,7 @@ export function getCategoryAccent(category) {
112
145
  * @returns The text color class
113
146
  */
114
147
  export function getCategoryText(category) {
115
- return getCategoryColors(category).text;
148
+ return getCategoryColors(category);
116
149
  }
117
150
  /**
118
151
  * Get category border color
@@ -120,50 +153,56 @@ export function getCategoryText(category) {
120
153
  * @returns The border color class
121
154
  */
122
155
  export function getCategoryBorder(category) {
123
- return getCategoryColors(category).border;
156
+ return getCategoryColors(category);
124
157
  }
125
158
  /**
126
- * Get node colors based on category and status
159
+ * Get node colors based on category and state
127
160
  * @param category - The node category
128
- * @param isError - Whether the node has an error
161
+ * @param isError - Whether the node is in error state
129
162
  * @param isProcessing - Whether the node is processing
130
163
  * @param isSelected - Whether the node is selected
131
- * @returns The color configuration for the node
164
+ * @returns The color configuration object
132
165
  */
133
166
  export function getNodeColors(category, isError = false, isProcessing = false, isSelected = false) {
167
+ const baseColor = getCategoryColors(category);
134
168
  if (isError) {
135
169
  return {
136
- background: "flowdrop-color--error-light",
137
- accent: "flowdrop-color--error",
138
- text: "flowdrop-color--error-text",
139
- border: "flowdrop-color--error-border"
170
+ background: 'var(--color-ref-red-50)',
171
+ accent: 'var(--color-ref-red-500)',
172
+ text: 'var(--color-ref-red-900)',
173
+ border: 'var(--color-ref-red-200)'
140
174
  };
141
175
  }
142
176
  if (isProcessing) {
143
177
  return {
144
- background: "flowdrop-color--warning-light",
145
- accent: "flowdrop-color--warning",
146
- text: "flowdrop-color--warning-text",
147
- border: "flowdrop-color--warning-border"
178
+ background: 'var(--color-ref-blue-50)',
179
+ accent: 'var(--color-ref-blue-500)',
180
+ text: 'var(--color-ref-blue-900)',
181
+ border: 'var(--color-ref-blue-200)'
148
182
  };
149
183
  }
150
184
  if (isSelected) {
151
185
  return {
152
- background: "flowdrop-color--primary-light",
153
- accent: "flowdrop-color--primary",
154
- text: "flowdrop-color--primary-text",
155
- border: "flowdrop-color--primary-border"
186
+ background: 'var(--color-ref-indigo-50)',
187
+ accent: 'var(--color-ref-indigo-500)',
188
+ text: 'var(--color-ref-indigo-900)',
189
+ border: 'var(--color-ref-indigo-200)'
156
190
  };
157
191
  }
158
- return getCategoryColors(category);
192
+ return {
193
+ background: baseColor,
194
+ accent: baseColor,
195
+ text: 'var(--color-ref-slate-900)',
196
+ border: baseColor
197
+ };
159
198
  }
160
199
  /**
161
200
  * Get node background color
162
201
  * @param category - The node category
163
- * @param isError - Whether the node has an error
202
+ * @param isError - Whether the node is in error state
164
203
  * @param isProcessing - Whether the node is processing
165
204
  * @param isSelected - Whether the node is selected
166
- * @returns The background color class
205
+ * @returns The background color
167
206
  */
168
207
  export function getNodeBackground(category, isError = false, isProcessing = false, isSelected = false) {
169
208
  return getNodeColors(category, isError, isProcessing, isSelected).background;
@@ -171,10 +210,10 @@ export function getNodeBackground(category, isError = false, isProcessing = fals
171
210
  /**
172
211
  * Get node accent color
173
212
  * @param category - The node category
174
- * @param isError - Whether the node has an error
213
+ * @param isError - Whether the node is in error state
175
214
  * @param isProcessing - Whether the node is processing
176
215
  * @param isSelected - Whether the node is selected
177
- * @returns The accent color class
216
+ * @returns The accent color
178
217
  */
179
218
  export function getNodeAccent(category, isError = false, isProcessing = false, isSelected = false) {
180
219
  return getNodeColors(category, isError, isProcessing, isSelected).accent;
@@ -182,10 +221,10 @@ export function getNodeAccent(category, isError = false, isProcessing = false, i
182
221
  /**
183
222
  * Get node text color
184
223
  * @param category - The node category
185
- * @param isError - Whether the node has an error
224
+ * @param isError - Whether the node is in error state
186
225
  * @param isProcessing - Whether the node is processing
187
226
  * @param isSelected - Whether the node is selected
188
- * @returns The text color class
227
+ * @returns The text color
189
228
  */
190
229
  export function getNodeText(category, isError = false, isProcessing = false, isSelected = false) {
191
230
  return getNodeColors(category, isError, isProcessing, isSelected).text;
@@ -193,48 +232,74 @@ export function getNodeText(category, isError = false, isProcessing = false, isS
193
232
  /**
194
233
  * Get node border color
195
234
  * @param category - The node category
196
- * @param isError - Whether the node has an error
235
+ * @param isError - Whether the node is in error state
197
236
  * @param isProcessing - Whether the node is processing
198
237
  * @param isSelected - Whether the node is selected
199
- * @returns The border color class
238
+ * @returns The border color
200
239
  */
201
240
  export function getNodeBorder(category, isError = false, isProcessing = false, isSelected = false) {
202
241
  return getNodeColors(category, isError, isProcessing, isSelected).border;
203
242
  }
204
243
  /**
205
- * Data type color mapping for ports (used in WorkflowNode, etc.)
206
- * These use BEM color classes for consistency
207
- */
208
- export const dataTypeColors = {
209
- string: "flowdrop-color--emerald",
210
- text: "flowdrop-color--emerald",
211
- number: "flowdrop-color--blue",
212
- integer: "flowdrop-color--blue",
213
- float: "flowdrop-color--blue",
214
- boolean: "flowdrop-color--purple",
215
- array: "flowdrop-color--amber",
216
- list: "flowdrop-color--amber",
217
- object: "flowdrop-color--orange",
218
- json: "flowdrop-color--orange",
219
- file: "flowdrop-color--red",
220
- document: "flowdrop-color--red",
221
- image: "flowdrop-color--pink",
222
- picture: "flowdrop-color--pink",
223
- audio: "flowdrop-color--indigo",
224
- sound: "flowdrop-color--indigo",
225
- video: "flowdrop-color--teal",
226
- movie: "flowdrop-color--teal",
227
- url: "flowdrop-color--cyan",
228
- email: "flowdrop-color--cyan",
229
- date: "flowdrop-color--lime",
230
- datetime: "flowdrop-color--lime",
231
- time: "flowdrop-color--lime"
232
- };
233
- /**
234
- * Get data type color class
235
- * @param dataType - The data type string
236
- * @returns The color class for the data type
244
+ * Get data type color
245
+ * @param dataType - The data type
246
+ * @returns The color for the data type
237
247
  */
238
248
  export function getDataTypeColor(dataType) {
239
- return dataTypeColors[dataType.toLowerCase()] || "flowdrop-color--slate";
249
+ return getDataTypeColorToken(dataType);
250
+ }
251
+ /**
252
+ * Parse typed array notation and get display information
253
+ * @param dataType - The data type (e.g., "string[]", "number", "object[]")
254
+ * @returns Object with display information
255
+ */
256
+ export function parseDataTypeDisplay(dataType) {
257
+ // Check if it's a typed array (ends with [])
258
+ const isArray = dataType.endsWith('[]');
259
+ if (isArray) {
260
+ const elementType = dataType.slice(0, -2); // Remove []
261
+ const config = getDataTypeConfig(dataType);
262
+ return {
263
+ baseType: dataType,
264
+ isArray: true,
265
+ displayName: config?.name || `${elementType}[]`,
266
+ elementType: elementType
267
+ };
268
+ }
269
+ else {
270
+ const config = getDataTypeConfig(dataType);
271
+ return {
272
+ baseType: dataType,
273
+ isArray: false,
274
+ displayName: config?.name || dataType
275
+ };
276
+ }
277
+ }
278
+ /**
279
+ * Get formatted display text for a data type
280
+ * @param dataType - The data type
281
+ * @returns Formatted display text
282
+ */
283
+ export function getDataTypeDisplayText(dataType) {
284
+ const parsed = parseDataTypeDisplay(dataType);
285
+ return parsed.displayName;
286
+ }
287
+ /**
288
+ * Check if a data type represents an array
289
+ * @param dataType - The data type
290
+ * @returns True if it's an array type
291
+ */
292
+ export function isArrayDataType(dataType) {
293
+ return dataType.endsWith('[]') || dataType === 'array' || dataType === 'list';
294
+ }
295
+ /**
296
+ * Get the element type from an array data type
297
+ * @param arrayDataType - The array data type (e.g., "string[]")
298
+ * @returns The element type (e.g., "string") or null if not an array
299
+ */
300
+ export function getArrayElementType(arrayDataType) {
301
+ if (arrayDataType.endsWith('[]')) {
302
+ return arrayDataType.slice(0, -2);
303
+ }
304
+ return null;
240
305
  }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Configuration utilities for FlowDrop Editor
3
+ */
4
+ import type { WorkflowEditorConfig, EditorFeatures, UIConfig, APIConfig, ExecutionConfig, StorageConfig } from '../types/config.js';
5
+ import type { EndpointConfig } from '../config/endpoints.js';
6
+ /**
7
+ * Create default editor features configuration
8
+ */
9
+ export declare function createDefaultFeatures(): EditorFeatures;
10
+ /**
11
+ * Create default UI configuration
12
+ */
13
+ export declare function createDefaultUIConfig(): UIConfig;
14
+ /**
15
+ * Create default API configuration
16
+ */
17
+ export declare function createDefaultAPIConfig(): APIConfig;
18
+ /**
19
+ * Create default execution configuration
20
+ */
21
+ export declare function createDefaultExecutionConfig(): ExecutionConfig;
22
+ /**
23
+ * Create default storage configuration
24
+ */
25
+ export declare function createDefaultStorageConfig(): StorageConfig;
26
+ /**
27
+ * Create default workflow editor configuration
28
+ */
29
+ export declare function createDefaultConfig(endpointConfig?: EndpointConfig): WorkflowEditorConfig;
30
+ /**
31
+ * Merge configuration with defaults
32
+ */
33
+ export declare function mergeConfig(userConfig: Partial<WorkflowEditorConfig>, defaultConfig: WorkflowEditorConfig): WorkflowEditorConfig;
34
+ /**
35
+ * Validate configuration
36
+ */
37
+ export declare function validateConfig(config: WorkflowEditorConfig): string[];
38
+ /**
39
+ * Create configuration from environment variables
40
+ */
41
+ export declare function createConfigFromEnv(): WorkflowEditorConfig;