@flowdrop/flowdrop 2.0.0-beta.1 → 2.0.0-beta.11

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 (270) hide show
  1. package/CHANGELOG.md +210 -0
  2. package/MIGRATION-2.0.md +173 -3
  3. package/README.md +5 -5
  4. package/dist/adapters/WorkflowAdapter.js +4 -5
  5. package/dist/adapters/agentspec/AgentSpecAdapter.js +3 -3
  6. package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
  7. package/dist/api/enhanced-client.js +6 -11
  8. package/dist/chat/batchFeedback.js +1 -1
  9. package/dist/chat/commandClassifier.d.ts +11 -0
  10. package/dist/chat/commandClassifier.js +20 -0
  11. package/dist/chat/historyBuilder.d.ts +39 -0
  12. package/dist/chat/historyBuilder.js +82 -0
  13. package/dist/chat/index.d.ts +2 -1
  14. package/dist/chat/index.js +2 -1
  15. package/dist/chat/responseParser.js +16 -12
  16. package/dist/commands/executor.js +51 -26
  17. package/dist/commands/parser.d.ts +12 -0
  18. package/dist/commands/parser.js +33 -6
  19. package/dist/commands/storeIntegration.svelte.js +11 -1
  20. package/dist/commands/types.js +5 -5
  21. package/dist/components/App.svelte +547 -386
  22. package/dist/components/App.svelte.d.ts +16 -8
  23. package/dist/components/Button.stories.svelte +65 -0
  24. package/dist/components/Button.stories.svelte.d.ts +19 -0
  25. package/dist/components/Button.svelte +62 -0
  26. package/dist/components/Button.svelte.d.ts +24 -0
  27. package/dist/components/CanvasIconButton.svelte +76 -0
  28. package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
  29. package/dist/components/ConfigForm.svelte +194 -565
  30. package/dist/components/ConfigForm.svelte.d.ts +24 -7
  31. package/dist/components/ConfigModal.svelte +9 -1
  32. package/dist/components/ConfigPanel.svelte +234 -15
  33. package/dist/components/ConfigPanel.svelte.d.ts +6 -0
  34. package/dist/components/EditorStatusBar.stories.svelte +44 -0
  35. package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
  36. package/dist/components/EditorStatusBar.svelte +99 -0
  37. package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
  38. package/dist/components/IconButton.svelte +80 -0
  39. package/dist/components/IconButton.svelte.d.ts +30 -0
  40. package/dist/components/Input.svelte +74 -0
  41. package/dist/components/Input.svelte.d.ts +17 -0
  42. package/dist/components/LogoWordmark.svelte +113 -0
  43. package/dist/components/LogoWordmark.svelte.d.ts +26 -0
  44. package/dist/components/Navbar.svelte +17 -63
  45. package/dist/components/Navbar.svelte.d.ts +3 -0
  46. package/dist/components/NodeSidebar.svelte +21 -126
  47. package/dist/components/NodeSwapPicker.svelte +12 -30
  48. package/dist/components/PipelineStatus.svelte +6 -1
  49. package/dist/components/PipelineStatus.svelte.d.ts +3 -0
  50. package/dist/components/PortMappingRow.svelte +0 -2
  51. package/dist/components/SchemaForm.svelte +4 -14
  52. package/dist/components/Select.svelte +53 -0
  53. package/dist/components/Select.svelte.d.ts +15 -0
  54. package/dist/components/SettingsModal.svelte +0 -5
  55. package/dist/components/SettingsPanel.svelte +33 -6
  56. package/dist/components/Textarea.svelte +39 -0
  57. package/dist/components/Textarea.svelte.d.ts +12 -0
  58. package/dist/components/ThemeToggle.svelte +15 -94
  59. package/dist/components/UniversalNode.svelte +36 -4
  60. package/dist/components/UniversalNode.svelte.d.ts +1 -1
  61. package/dist/components/WorkflowEditor.svelte +71 -54
  62. package/dist/components/WorkflowEditor.svelte.d.ts +21 -0
  63. package/dist/components/chat/AIChatPanel.svelte +49 -8
  64. package/dist/components/chat/CommandPreview.svelte +10 -1
  65. package/dist/components/console/ConsoleAutocomplete.svelte +1 -1
  66. package/dist/components/console/ConsoleInput.svelte +3 -3
  67. package/dist/components/console/ConsoleOutput.svelte +2 -2
  68. package/dist/components/form/FormArray.svelte +37 -173
  69. package/dist/components/form/FormAutocomplete.svelte +18 -15
  70. package/dist/components/form/FormCheckboxGroup.svelte +1 -5
  71. package/dist/components/form/FormCodeEditor.svelte +9 -7
  72. package/dist/components/form/FormField.svelte +18 -42
  73. package/dist/components/form/FormFieldLight.svelte +52 -48
  74. package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
  75. package/dist/components/form/FormFieldset.svelte +45 -11
  76. package/dist/components/form/FormMarkdownEditor.svelte +8 -5
  77. package/dist/components/form/FormNumberField.svelte +4 -36
  78. package/dist/components/form/FormPorts.svelte +280 -0
  79. package/dist/components/form/FormPorts.svelte.d.ts +13 -0
  80. package/dist/components/form/FormRangeField.svelte +63 -30
  81. package/dist/components/form/FormSelect.svelte +13 -75
  82. package/dist/components/form/FormTemplateEditor.svelte +6 -4
  83. package/dist/components/form/FormTextField.svelte +3 -35
  84. package/dist/components/form/FormTextarea.svelte +4 -39
  85. package/dist/components/form/FormToggle.svelte +27 -6
  86. package/dist/components/form/FormToggle.svelte.d.ts +5 -0
  87. package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
  88. package/dist/components/form/resolveFieldType.d.ts +24 -0
  89. package/dist/components/form/resolveFieldType.js +55 -0
  90. package/dist/components/icons/CloseIcon.svelte +6 -0
  91. package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
  92. package/dist/components/icons/CommandLineIcon.svelte +15 -0
  93. package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
  94. package/dist/components/icons/MenuIcon.svelte +4 -0
  95. package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
  96. package/dist/components/icons/MenuOpenIcon.svelte +6 -0
  97. package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
  98. package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
  99. package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
  100. package/dist/components/interrupt/InterruptBubble.svelte +11 -12
  101. package/dist/components/interrupt/ReviewPrompt.svelte +0 -20
  102. package/dist/components/interrupt/TextInputPrompt.svelte +0 -6
  103. package/dist/components/layouts/MainLayout.svelte +4 -5
  104. package/dist/components/nodes/AtomNode.svelte +62 -76
  105. package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
  106. package/dist/components/nodes/GatewayNode.svelte +117 -164
  107. package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
  108. package/dist/components/nodes/IdeaNode.svelte +72 -98
  109. package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
  110. package/dist/components/nodes/NodeConfigButton.svelte +86 -0
  111. package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
  112. package/dist/components/nodes/NotesNode.svelte +76 -85
  113. package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
  114. package/dist/components/nodes/SimpleNode.svelte +59 -133
  115. package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
  116. package/dist/components/nodes/SquareNode.svelte +110 -164
  117. package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
  118. package/dist/components/nodes/TerminalNode.svelte +62 -124
  119. package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
  120. package/dist/components/nodes/ToolNode.svelte +92 -103
  121. package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
  122. package/dist/components/nodes/WorkflowNode.svelte +132 -191
  123. package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
  124. package/dist/components/playground/ChatInput.svelte +316 -27
  125. package/dist/components/playground/ChatInput.svelte.d.ts +31 -1
  126. package/dist/components/playground/ControlPanel.svelte +22 -0
  127. package/dist/components/playground/ControlPanel.svelte.d.ts +13 -0
  128. package/dist/components/playground/InputCollector.svelte +11 -48
  129. package/dist/components/playground/PipelineKanbanView.svelte +6 -4
  130. package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
  131. package/dist/components/playground/PipelinePanel.svelte +20 -3
  132. package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
  133. package/dist/components/playground/PipelineTableView.svelte +6 -4
  134. package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
  135. package/dist/components/playground/Playground.svelte +292 -28
  136. package/dist/components/playground/Playground.svelte.d.ts +3 -0
  137. package/dist/components/playground/PlaygroundApp.svelte +6 -1
  138. package/dist/components/playground/PlaygroundApp.svelte.d.ts +3 -0
  139. package/dist/components/playground/PlaygroundModal.svelte +5 -0
  140. package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -0
  141. package/dist/components/playground/PlaygroundStudio.svelte +7 -6
  142. package/dist/components/playground/PlaygroundStudio.svelte.d.ts +3 -0
  143. package/dist/components/playground/pipelineViewUtils.svelte.d.ts +2 -1
  144. package/dist/components/playground/pipelineViewUtils.svelte.js +2 -2
  145. package/dist/components/surfaces/SurfaceOverlay.svelte +153 -0
  146. package/dist/components/surfaces/SurfaceOverlay.svelte.d.ts +14 -0
  147. package/dist/components/surfaces/TabbedSurface.svelte +133 -0
  148. package/dist/components/surfaces/TabbedSurface.svelte.d.ts +27 -0
  149. package/dist/config/endpoints.d.ts +71 -1
  150. package/dist/config/endpoints.js +46 -5
  151. package/dist/core/index.d.ts +2 -3
  152. package/dist/core/index.js +2 -6
  153. package/dist/display/index.d.ts +6 -1
  154. package/dist/display/index.js +9 -1
  155. package/dist/editor/index.d.ts +1 -1
  156. package/dist/editor/index.js +1 -1
  157. package/dist/form/full.d.ts +2 -1
  158. package/dist/form/full.js +4 -1
  159. package/dist/form/index.d.ts +0 -1
  160. package/dist/form/index.js +3 -2
  161. package/dist/helpers/workflowEditorHelper.d.ts +4 -2
  162. package/dist/helpers/workflowEditorHelper.js +8 -8
  163. package/dist/messages/defaults.d.ts +98 -0
  164. package/dist/messages/defaults.js +58 -1
  165. package/dist/messages/index.d.ts +1 -1
  166. package/dist/messages/index.js +1 -1
  167. package/dist/openapi/v1/openapi.yaml +35 -23
  168. package/dist/playground/commands/args.d.ts +32 -0
  169. package/dist/playground/commands/args.js +50 -0
  170. package/dist/playground/commands/dispatch.d.ts +143 -0
  171. package/dist/playground/commands/dispatch.js +162 -0
  172. package/dist/playground/commands/index.d.ts +14 -0
  173. package/dist/playground/commands/index.js +10 -0
  174. package/dist/playground/commands/parser.d.ts +38 -0
  175. package/dist/playground/commands/parser.js +163 -0
  176. package/dist/playground/commands/registry.d.ts +42 -0
  177. package/dist/playground/commands/registry.js +122 -0
  178. package/dist/playground/commands/suggest.d.ts +37 -0
  179. package/dist/playground/commands/suggest.js +46 -0
  180. package/dist/playground/commands/types.d.ts +111 -0
  181. package/dist/playground/commands/types.js +15 -0
  182. package/dist/playground/index.d.ts +21 -2
  183. package/dist/playground/index.js +27 -2
  184. package/dist/playground/mount.d.ts +19 -5
  185. package/dist/playground/mount.js +16 -8
  186. package/dist/playground/runAction.d.ts +48 -0
  187. package/dist/playground/runAction.js +31 -0
  188. package/dist/registry/builtinNodeTypes.d.ts +53 -0
  189. package/dist/registry/builtinNodeTypes.js +67 -0
  190. package/dist/registry/builtinNodes.d.ts +2 -39
  191. package/dist/registry/builtinNodes.js +6 -53
  192. package/dist/registry/nodeComponentRegistry.d.ts +2 -1
  193. package/dist/schemas/v1/workflow.schema.json +16 -14
  194. package/dist/services/agentSpecExecutionService.d.ts +0 -2
  195. package/dist/services/agentSpecExecutionService.js +0 -2
  196. package/dist/services/apiVariableService.js +12 -26
  197. package/dist/services/categoriesApi.js +3 -6
  198. package/dist/services/chatService.d.ts +4 -3
  199. package/dist/services/chatService.js +13 -18
  200. package/dist/services/dynamicSchemaService.d.ts +31 -4
  201. package/dist/services/dynamicSchemaService.js +62 -33
  202. package/dist/services/historyService.d.ts +30 -8
  203. package/dist/services/historyService.js +51 -15
  204. package/dist/services/interruptService.d.ts +7 -6
  205. package/dist/services/interruptService.js +19 -21
  206. package/dist/services/pipelineSignalService.d.ts +97 -0
  207. package/dist/services/pipelineSignalService.js +94 -0
  208. package/dist/services/playgroundService.d.ts +21 -8
  209. package/dist/services/playgroundService.js +45 -25
  210. package/dist/services/portConfigApi.js +3 -6
  211. package/dist/services/settingsService.d.ts +9 -4
  212. package/dist/services/settingsService.js +23 -12
  213. package/dist/services/workflowLaunchService.d.ts +74 -0
  214. package/dist/services/workflowLaunchService.js +74 -0
  215. package/dist/skins/drafter.d.ts +30 -0
  216. package/dist/skins/drafter.js +198 -0
  217. package/dist/skins/index.d.ts +2 -1
  218. package/dist/skins/index.js +4 -2
  219. package/dist/stores/apiContext.d.ts +11 -0
  220. package/dist/stores/apiContext.js +15 -0
  221. package/dist/stores/categoriesStore.svelte.js +0 -1
  222. package/dist/stores/historyStore.svelte.d.ts +17 -3
  223. package/dist/stores/historyStore.svelte.js +30 -3
  224. package/dist/stores/instanceContainer.svelte.js +5 -0
  225. package/dist/stores/playgroundStore.svelte.js +1 -3
  226. package/dist/stores/settingsStore.svelte.d.ts +13 -0
  227. package/dist/stores/settingsStore.svelte.js +32 -0
  228. package/dist/stores/workflowStore.svelte.d.ts +42 -5
  229. package/dist/stores/workflowStore.svelte.js +109 -32
  230. package/dist/styles/base.css +285 -14
  231. package/dist/styles/tokens.css +60 -2
  232. package/dist/svelte-app.d.ts +18 -1
  233. package/dist/svelte-app.js +75 -110
  234. package/dist/themes/drafter.d.ts +2 -0
  235. package/dist/themes/drafter.js +15 -0
  236. package/dist/themes/index.d.ts +2 -1
  237. package/dist/themes/index.js +8 -2
  238. package/dist/types/auth.d.ts +9 -51
  239. package/dist/types/auth.js +4 -54
  240. package/dist/types/chat.d.ts +5 -1
  241. package/dist/types/events.d.ts +18 -0
  242. package/dist/types/events.js +2 -1
  243. package/dist/types/index.d.ts +84 -29
  244. package/dist/types/index.js +0 -1
  245. package/dist/types/settings.d.ts +28 -1
  246. package/dist/types/settings.js +6 -3
  247. package/dist/types/skin.d.ts +1 -1
  248. package/dist/types/theme.d.ts +16 -2
  249. package/dist/types/uischema.d.ts +5 -0
  250. package/dist/utils/canvasSelection.d.ts +25 -0
  251. package/dist/utils/canvasSelection.js +37 -0
  252. package/dist/utils/colors.d.ts +27 -0
  253. package/dist/utils/colors.js +23 -0
  254. package/dist/utils/connections.js +20 -56
  255. package/dist/utils/edgeStyling.js +9 -5
  256. package/dist/utils/fetchWithAuth.d.ts +36 -15
  257. package/dist/utils/fetchWithAuth.js +53 -23
  258. package/dist/utils/nodeFormSchema.d.ts +51 -0
  259. package/dist/utils/nodeFormSchema.js +87 -0
  260. package/dist/utils/nodeIds.d.ts +1 -1
  261. package/dist/utils/nodeIds.js +1 -1
  262. package/dist/utils/nodeSwap.js +3 -6
  263. package/dist/utils/nodeTypes.js +1 -1
  264. package/dist/utils/portUtils.d.ts +47 -11
  265. package/dist/utils/portUtils.js +67 -14
  266. package/dist/utils/portal.d.ts +18 -0
  267. package/dist/utils/portal.js +34 -0
  268. package/dist/utils/schemaMerge.d.ts +25 -0
  269. package/dist/utils/schemaMerge.js +61 -0
  270. package/package.json +2 -1
@@ -24,7 +24,9 @@ export const defaultEndpointConfig = {
24
24
  delete: '/workflows/{id}',
25
25
  validate: '/workflows/validate',
26
26
  export: '/workflows/{id}/export',
27
- import: '/workflows/import'
27
+ import: '/workflows/import',
28
+ // Singular `workflow` here is the reference backend's spelling, not a typo.
29
+ run: '/workflow/{workflowId}/run'
28
30
  },
29
31
  executions: {
30
32
  execute: '/workflows/{id}/execute',
@@ -51,7 +53,15 @@ export const defaultEndpointConfig = {
51
53
  deleteSession: '/playground/sessions/{sessionId}',
52
54
  getMessages: '/playground/sessions/{sessionId}/messages',
53
55
  sendMessage: '/playground/sessions/{sessionId}/messages',
54
- stopExecution: '/playground/sessions/{sessionId}/stop'
56
+ stopExecution: '/playground/sessions/{sessionId}/stop',
57
+ resetSession: '/playground/sessions/{sessionId}/reset'
58
+ },
59
+ signals: {
60
+ // The reference backend transposes its prefix for these routes.
61
+ baseUrl: '/flowdrop/api',
62
+ pause: '/pipelines/{pipelineId}/pause',
63
+ resume: '/pipelines/{pipelineId}/resume',
64
+ cancel: '/pipelines/{pipelineId}/cancel'
55
65
  },
56
66
  interrupts: {
57
67
  get: '/interrupts/{interruptId}',
@@ -105,7 +115,7 @@ export function createEndpointConfig(baseUrl, overrides) {
105
115
  /**
106
116
  * Build full URL for an endpoint
107
117
  */
108
- export function buildEndpointUrl(config, endpointPath, params) {
118
+ export function buildEndpointUrl(config, endpointPath, params, baseUrlOverride) {
109
119
  let url = endpointPath;
110
120
  // Replace path parameters
111
121
  if (params) {
@@ -113,9 +123,12 @@ export function buildEndpointUrl(config, endpointPath, params) {
113
123
  url = url.replace(`{${key}}`, encodeURIComponent(value));
114
124
  });
115
125
  }
116
- // Ensure URL starts with base URL
126
+ // Ensure URL starts with base URL. `baseUrlOverride` lets a group of
127
+ // endpoints hang off a different root than the global one — backends do not
128
+ // always serve every API from a single prefix.
129
+ const base = baseUrlOverride ?? config.baseUrl;
117
130
  if (!url.startsWith('http') && !url.startsWith('//')) {
118
- url = `${config.baseUrl}${url.startsWith('/') ? url : `/${url}`}`;
131
+ url = `${base}${url.startsWith('/') ? url : `/${url}`}`;
119
132
  }
120
133
  return url;
121
134
  }
@@ -141,3 +154,31 @@ export function getEndpointHeaders(config, endpointKey) {
141
154
  }
142
155
  return baseHeaders;
143
156
  }
157
+ /**
158
+ * Build request headers for an endpoint, layering the auth provider's headers
159
+ * over the static endpoint headers.
160
+ *
161
+ * This is the single header-building path shared by the per-instance services
162
+ * (playground, chat, interrupt, settings, port config, categories). Routing all
163
+ * of them through this helper guarantees a configured {@link AuthProvider}
164
+ * authenticates every request consistently — matching the behaviour of
165
+ * {@link EnhancedFlowDropApiClient}, which owns the equivalent merge for the
166
+ * typed workflow/node API.
167
+ *
168
+ * `getAuthHeaders()` is awaited per call so providers can return freshly
169
+ * refreshed tokens. When no provider is supplied the result is identical to
170
+ * {@link getEndpointHeaders} (no auth) — keeping unauthenticated callers
171
+ * working unchanged.
172
+ *
173
+ * @param config - The endpoint configuration
174
+ * @param endpointKey - Key identifying the endpoint (for static header lookup)
175
+ * @param authProvider - Optional auth provider supplying `Authorization` etc.
176
+ * @returns Merged headers: static endpoint headers < auth headers
177
+ */
178
+ export async function getRequestHeaders(config, endpointKey, authProvider) {
179
+ const headers = getEndpointHeaders(config, endpointKey);
180
+ if (authProvider) {
181
+ Object.assign(headers, await authProvider.getAuthHeaders());
182
+ }
183
+ return headers;
184
+ }
@@ -16,7 +16,7 @@
16
16
  */
17
17
  export type { WorkflowFormat, BuiltinWorkflowFormat } from '../types/index.js';
18
18
  export { DEFAULT_WORKFLOW_FORMAT } from '../types/index.js';
19
- export type { NodeCategory, BuiltinNodeCategory, CategoryDefinition, NodeDataType, NodePort, DynamicPort, Branch, NodeMetadata, NodeExtensions, NodeUIExtensions, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType, PortConfig, PortCompatibilityRule, ConfigSchema, ConfigProperty, HttpMethod, DynamicSchemaEndpoint, ExternalEditLink, ConfigEditOptions, EdgeCategory, UISchemaElementType, UISchemaElementBase, UISchemaControl, UISchemaVerticalLayout, UISchemaGroup, UISchemaElement } from '../types/index.js';
19
+ export type { NodeCategory, BuiltinNodeCategory, CategoryDefinition, NodeDataType, NodePort, DynamicPort, Branch, NodeMetadata, NodeExtensions, NodeUIExtensions, PortsConfig, PortConfigEntry, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType, PortConfig, PortCompatibilityRule, ConfigSchema, ConfigProperty, HttpMethod, DynamicSchemaEndpoint, ExternalEditLink, ConfigEditOptions, EdgeCategory, UISchemaElementType, UISchemaElementBase, UISchemaControl, UISchemaVerticalLayout, UISchemaGroup, UISchemaElement } from '../types/index.js';
20
20
  export { isUISchemaControl, isUISchemaVerticalLayout, isUISchemaGroup } from '../types/index.js';
21
21
  export type { WorkflowEditorConfig, EditorFeatures, UIConfig, APIConfig, ExecutionConfig, StorageConfig } from '../types/config.js';
22
22
  export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from '../types/auth.js';
@@ -68,7 +68,7 @@ export { computeAutoLayout } from '../adapters/agentspec/autoLayout.js';
68
68
  export type { AutoLayoutConfig } from '../adapters/agentspec/autoLayout.js';
69
69
  export type { AgentSpecEndpointConfig } from '../config/agentSpecEndpoints.js';
70
70
  export { defaultAgentSpecEndpoints, createAgentSpecEndpointConfig, buildAgentSpecUrl, getAgentSpecAuthHeaders } from '../config/agentSpecEndpoints.js';
71
- export { AgentSpecExecutionService, agentSpecExecutionService } from '../services/agentSpecExecutionService.js';
71
+ export { AgentSpecExecutionService } from '../services/agentSpecExecutionService.js';
72
72
  export type { AgentSpecExecutionHandle } from '../services/agentSpecExecutionService.js';
73
73
  export { workflowSchema, WORKFLOW_SCHEMA_VERSION } from '../schemas/index.js';
74
74
  export type { FlowDropTheme, FlowDropThemeName, FlowDropThemeConfig } from '../types/theme.js';
@@ -77,7 +77,6 @@ export type { FlowDropSkin, FlowDropSkinName, FlowDropSkinTokens } from '../type
77
77
  export { slateSkin, defaultSkin } from '../skins/index.js';
78
78
  export type { ThemePreference, ResolvedTheme } from '../stores/settingsStore.svelte.js';
79
79
  export { getTheme as theme, getResolvedTheme as resolvedTheme, setTheme, toggleTheme, cycleTheme, initializeTheme, isThemeInitialized } from '../stores/settingsStore.svelte.js';
80
- export { sanitizeHtml } from '../utils/sanitize.js';
81
80
  export { logger, setLogLevel, getLogLevel } from '../utils/logger.js';
82
81
  export type { LogLevel } from '../utils/logger.js';
83
82
  export { computeSwapPreview, computeSwapPreviewWithOptions, executeSwap, mapConfig, getVersionUpgrade, compareSemver, performSwap, validateSwapResult, SwapValidationError } from '../utils/nodeSwap.js';
@@ -80,8 +80,8 @@ export { validateForAgentSpecExport, validateAgentSpecFlow } from '../adapters/a
80
80
  // Agent Spec auto-layout
81
81
  export { computeAutoLayout } from '../adapters/agentspec/autoLayout.js';
82
82
  export { defaultAgentSpecEndpoints, createAgentSpecEndpointConfig, buildAgentSpecUrl, getAgentSpecAuthHeaders } from '../config/agentSpecEndpoints.js';
83
- // Agent Spec execution service
84
- export { AgentSpecExecutionService, agentSpecExecutionService } from '../services/agentSpecExecutionService.js';
83
+ // Agent Spec execution service (instantiate per instance — no global singleton)
84
+ export { AgentSpecExecutionService } from '../services/agentSpecExecutionService.js';
85
85
  // ============================================================================
86
86
  // Workflow JSON Schema
87
87
  // ============================================================================
@@ -90,10 +90,6 @@ export { defaultTheme, minimalTheme, resolveTheme } from '../themes/index.js';
90
90
  export { slateSkin, defaultSkin } from '../skins/index.js';
91
91
  export { getTheme as theme, getResolvedTheme as resolvedTheme, setTheme, toggleTheme, cycleTheme, initializeTheme, isThemeInitialized } from '../stores/settingsStore.svelte.js';
92
92
  // ============================================================================
93
- // HTML Sanitization
94
- // ============================================================================
95
- export { sanitizeHtml } from '../utils/sanitize.js';
96
- // ============================================================================
97
93
  // Logger
98
94
  // ============================================================================
99
95
  export { logger, setLogLevel, getLogLevel } from '../utils/logger.js';
@@ -5,9 +5,13 @@
5
5
  *
6
6
  * @module display
7
7
  *
8
+ * This entry renders user/API-provided HTML, so it pulls in the HTML sanitizer
9
+ * (DOMPurify). `sanitizeHtml` is exposed here — rather than from
10
+ * `@flowdrop/flowdrop/core` — to keep `core` free of that heavier dependency.
11
+ *
8
12
  * @example
9
13
  * ```typescript
10
- * import { MarkdownDisplay } from "@flowdrop/flowdrop/display";
14
+ * import { MarkdownDisplay, sanitizeHtml } from "@flowdrop/flowdrop/display";
11
15
  * ```
12
16
  *
13
17
  * @example In Svelte:
@@ -25,3 +29,4 @@
25
29
  * ```
26
30
  */
27
31
  export { default as MarkdownDisplay } from '../components/MarkdownDisplay.svelte';
32
+ export { sanitizeHtml } from '../utils/sanitize.js';
@@ -5,9 +5,13 @@
5
5
  *
6
6
  * @module display
7
7
  *
8
+ * This entry renders user/API-provided HTML, so it pulls in the HTML sanitizer
9
+ * (DOMPurify). `sanitizeHtml` is exposed here — rather than from
10
+ * `@flowdrop/flowdrop/core` — to keep `core` free of that heavier dependency.
11
+ *
8
12
  * @example
9
13
  * ```typescript
10
- * import { MarkdownDisplay } from "@flowdrop/flowdrop/display";
14
+ * import { MarkdownDisplay, sanitizeHtml } from "@flowdrop/flowdrop/display";
11
15
  * ```
12
16
  *
13
17
  * @example In Svelte:
@@ -28,3 +32,7 @@
28
32
  // Display Components
29
33
  // ============================================================================
30
34
  export { default as MarkdownDisplay } from '../components/MarkdownDisplay.svelte';
35
+ // ============================================================================
36
+ // HTML Sanitization (DOMPurify-backed — lives here, not in core)
37
+ // ============================================================================
38
+ export { sanitizeHtml } from '../utils/sanitize.js';
@@ -74,7 +74,7 @@ export { PortCoordinateStore } from '../stores/portCoordinateStore.svelte.js';
74
74
  export { HistoryService } from '../services/historyService.js';
75
75
  export type { HistoryEntry, HistoryState, PushOptions } from '../stores/historyStore.svelte.js';
76
76
  export { showSuccess, showError, showWarning, showInfo, showLoading, dismissToast, dismissAllToasts, showPromise, showConfirmation, apiToasts, workflowToasts, pipelineToasts } from '../services/toastService.js';
77
- export { NodeExecutionService, nodeExecutionService } from '../services/nodeExecutionService.js';
77
+ export { NodeExecutionService } from '../services/nodeExecutionService.js';
78
78
  export { saveWorkflow, updateWorkflow, getWorkflow, getWorkflows, deleteWorkflow, getWorkflowCount, initializeSampleWorkflows } from '../services/workflowStorage.js';
79
79
  export { globalSaveWorkflow, globalExportWorkflow } from '../services/globalSave.js';
80
80
  export { fetchPortConfig, validatePortConfig } from '../services/portConfigApi.js';
@@ -109,7 +109,7 @@ export { HistoryService } from '../services/historyService.js';
109
109
  // Services
110
110
  // ============================================================================
111
111
  export { showSuccess, showError, showWarning, showInfo, showLoading, dismissToast, dismissAllToasts, showPromise, showConfirmation, apiToasts, workflowToasts, pipelineToasts } from '../services/toastService.js';
112
- export { NodeExecutionService, nodeExecutionService } from '../services/nodeExecutionService.js';
112
+ export { NodeExecutionService } from '../services/nodeExecutionService.js';
113
113
  export { saveWorkflow, updateWorkflow, getWorkflow, getWorkflows, deleteWorkflow, getWorkflowCount, initializeSampleWorkflows } from '../services/workflowStorage.js';
114
114
  export { globalSaveWorkflow, globalExportWorkflow } from '../services/globalSave.js';
115
115
  export { fetchPortConfig, validatePortConfig } from '../services/portConfigApi.js';
@@ -20,7 +20,8 @@
20
20
  * // Now all field types are available
21
21
  * ```
22
22
  */
23
- export { SchemaForm, FormField, FormFieldFull, FormFieldWrapper, FormTextField, FormTextarea, FormNumberField, FormRangeField, FormToggle, FormSelect, FormCheckboxGroup, FormArray, FormFieldset, FormUISchemaRenderer } from './index.js';
23
+ export { default as FormFieldFull } from '../components/form/FormField.svelte';
24
+ export { SchemaForm, FormField, FormFieldWrapper, FormTextField, FormTextarea, FormNumberField, FormRangeField, FormToggle, FormSelect, FormCheckboxGroup, FormArray, FormFieldset, FormUISchemaRenderer } from './index.js';
24
25
  export type { FieldSchema, FieldType, FieldFormat, FieldOption, OneOfItem, SchemaFormProps, BaseFieldProps, TextFieldProps, TextareaFieldProps, NumberFieldProps, ToggleFieldProps, RangeFieldProps, SelectFieldProps, CheckboxGroupFieldProps, ArrayFieldProps, FormFieldFactoryProps, FormFieldWrapperProps, FieldComponentProps, FieldMatcher, FieldMatcherRegistration, FieldComponent, FieldComponentRegistration } from './index.js';
25
26
  export { isFieldOptionArray, isOneOfArray, normalizeOptions, oneOfToOptions, getSchemaOptions } from './index.js';
26
27
  export { FieldComponentRegistry, hiddenFieldMatcher, checkboxGroupMatcher, enumSelectMatcher, textareaMatcher, rangeMatcher, textFieldMatcher, numberFieldMatcher, toggleMatcher, selectOptionsMatcher, arrayMatcher } from './index.js';
package/dist/form/full.js CHANGED
@@ -21,8 +21,11 @@
21
21
  * ```
22
22
  */
23
23
  // Re-export everything from the light form module
24
+ // The "everything statically bundled" FormField variant lives here (this is the
25
+ // heavy entry), not in the light `@flowdrop/flowdrop/form`.
26
+ export { default as FormFieldFull } from '../components/form/FormField.svelte';
24
27
  // Components
25
- export { SchemaForm, FormField, FormFieldFull, FormFieldWrapper, FormTextField, FormTextarea, FormNumberField, FormRangeField, FormToggle, FormSelect, FormCheckboxGroup, FormArray, FormFieldset, FormUISchemaRenderer } from './index.js';
28
+ export { SchemaForm, FormField, FormFieldWrapper, FormTextField, FormTextarea, FormNumberField, FormRangeField, FormToggle, FormSelect, FormCheckboxGroup, FormArray, FormFieldset, FormUISchemaRenderer } from './index.js';
26
29
  // Utility functions
27
30
  export { isFieldOptionArray, isOneOfArray, normalizeOptions, oneOfToOptions, getSchemaOptions } from './index.js';
28
31
  // Field Registry
@@ -59,7 +59,6 @@
59
59
  */
60
60
  export { default as SchemaForm } from '../components/SchemaForm.svelte';
61
61
  export { default as FormField } from '../components/form/FormFieldLight.svelte';
62
- export { default as FormFieldFull } from '../components/form/FormField.svelte';
63
62
  export { default as FormFieldWrapper } from '../components/form/FormFieldWrapper.svelte';
64
63
  export { default as FormTextField } from '../components/form/FormTextField.svelte';
65
64
  export { default as FormTextarea } from '../components/form/FormTextarea.svelte';
@@ -66,8 +66,9 @@ export { default as SchemaForm } from '../components/SchemaForm.svelte';
66
66
  // ============================================================================
67
67
  // Use the light version of FormField that uses the registry for heavy editors
68
68
  export { default as FormField } from '../components/form/FormFieldLight.svelte';
69
- // Also export the original (full) version for users who want everything
70
- export { default as FormFieldFull } from '../components/form/FormField.svelte';
69
+ // NOTE: `FormFieldFull` — the variant that *statically* bundles every editor
70
+ // (including CodeMirror) — is intentionally NOT exported here; it would pull
71
+ // CodeMirror into this light entry. Import it from `@flowdrop/flowdrop/form/full`.
71
72
  export { default as FormFieldWrapper } from '../components/form/FormFieldWrapper.svelte';
72
73
  export { default as FormTextField } from '../components/form/FormTextField.svelte';
73
74
  export { default as FormTextarea } from '../components/form/FormTextarea.svelte';
@@ -5,6 +5,7 @@
5
5
  import type { WorkflowNode as WorkflowNodeType, NodeMetadata, Workflow, WorkflowEdge, NodeExecutionInfo } from '../types/index.js';
6
6
  import { type FlowDropInstance } from '../stores/instanceContainer.svelte.js';
7
7
  import type { ApiContext } from '../stores/apiContext.js';
8
+ import type { AuthProvider } from '../types/auth.js';
8
9
  import type { EndpointConfig } from '../config/endpoints.js';
9
10
  export { generateNodeId, extractConfigDefaults } from '../utils/nodeIds.js';
10
11
  /**
@@ -134,7 +135,8 @@ export declare class WorkflowOperationsHelper {
134
135
  */
135
136
  export declare class ConfigurationHelper {
136
137
  /**
137
- * Configure API endpoints on the given instance's API context.
138
+ * Configure API endpoints (and optionally the auth provider) on the given
139
+ * instance's API context.
138
140
  */
139
- static configureEndpoints(api: ApiContext, config: EndpointConfig): void;
141
+ static configureEndpoints(api: ApiContext, config: EndpointConfig, authProvider?: AuthProvider): void;
140
142
  }
@@ -63,7 +63,7 @@ export class NodeOperationsHelper {
63
63
  // Use fallback sample nodes
64
64
  return [
65
65
  {
66
- id: 'text-input',
66
+ node_type_id: 'text-input',
67
67
  name: 'Text Input',
68
68
  category: 'inputs',
69
69
  description: 'Simple text input field',
@@ -73,7 +73,7 @@ export class NodeOperationsHelper {
73
73
  outputs: [{ id: 'text', name: 'text', type: 'output', dataType: 'string' }]
74
74
  },
75
75
  {
76
- id: 'text-output',
76
+ node_type_id: 'text-output',
77
77
  name: 'Text Output',
78
78
  category: 'outputs',
79
79
  description: 'Display text output',
@@ -128,7 +128,7 @@ export class NodeOperationsHelper {
128
128
  };
129
129
  }
130
130
  // Generate node ID based on node type and existing nodes
131
- const newNodeId = generateNodeId(nodeType.id, existingNodes);
131
+ const newNodeId = generateNodeId(nodeType.node_type_id, existingNodes);
132
132
  // All nodes use "universalNode" type
133
133
  // UniversalNode component handles internal switching based on metadata and config
134
134
  const newNode = {
@@ -137,8 +137,7 @@ export class NodeOperationsHelper {
137
137
  position, // Use the position calculated from the drop event
138
138
  deletable: true,
139
139
  data: {
140
- ...nodeData,
141
- nodeId: newNodeId // Use the same ID
140
+ ...nodeData
142
141
  }
143
142
  };
144
143
  return newNode;
@@ -382,9 +381,10 @@ export class WorkflowOperationsHelper {
382
381
  */
383
382
  export class ConfigurationHelper {
384
383
  /**
385
- * Configure API endpoints on the given instance's API context.
384
+ * Configure API endpoints (and optionally the auth provider) on the given
385
+ * instance's API context.
386
386
  */
387
- static configureEndpoints(api, config) {
388
- api.configure(config);
387
+ static configureEndpoints(api, config, authProvider) {
388
+ api.configure(config, authProvider);
389
389
  }
390
390
  }
@@ -271,6 +271,7 @@ export declare const defaultMessages: {
271
271
  readonly dismissed: "Dismissed";
272
272
  readonly applyAll: "Apply All";
273
273
  readonly cancel: "Cancel";
274
+ readonly layoutSkipped: "Skipped — AI layout changes are disabled in Settings";
274
275
  };
275
276
  };
276
277
  readonly playground: {
@@ -284,6 +285,103 @@ export declare const defaultMessages: {
284
285
  readonly processing: "Processing...";
285
286
  readonly viewOnlyHelp: "View-only mode. Workflow execution is controlled externally.";
286
287
  };
288
+ readonly commands: {
289
+ readonly unknown: ({ name }: {
290
+ name: string;
291
+ }) => string;
292
+ readonly unknownWithSuggestions: ({ name, suggestions }: {
293
+ name: string;
294
+ suggestions: string;
295
+ }) => string;
296
+ readonly unavailable: ({ name }: {
297
+ name: string;
298
+ }) => string;
299
+ readonly needsSession: ({ name }: {
300
+ name: string;
301
+ }) => string;
302
+ readonly helpHeading: "Available commands";
303
+ readonly helpEscapeHint: "To send a message starting with a slash, type it twice: //like this";
304
+ readonly catalog: {
305
+ readonly help: {
306
+ readonly usage: "/help";
307
+ readonly summary: "List the commands available here";
308
+ };
309
+ readonly run: {
310
+ readonly usage: "/run [--input=value ...]";
311
+ readonly summary: "Start a run, optionally with named inputs";
312
+ };
313
+ readonly new: {
314
+ readonly usage: "/new";
315
+ readonly summary: "Start a new session";
316
+ };
317
+ readonly stop: {
318
+ readonly usage: "/stop";
319
+ readonly summary: "Stop what this session is running";
320
+ };
321
+ readonly reset: {
322
+ readonly usage: "/reset";
323
+ readonly summary: "Reset a stuck session to idle";
324
+ };
325
+ readonly delete: {
326
+ readonly usage: "/delete";
327
+ readonly summary: "Delete the current session";
328
+ };
329
+ readonly pause: {
330
+ readonly usage: "/pause [reason]";
331
+ readonly summary: "Ask the active run to pause";
332
+ };
333
+ readonly resume: {
334
+ readonly usage: "/resume [reason]";
335
+ readonly summary: "Resume the paused run";
336
+ };
337
+ readonly cancel: {
338
+ readonly usage: "/cancel [reason]";
339
+ readonly summary: "Cancel the active run — cannot be undone";
340
+ };
341
+ };
342
+ readonly dismiss: "Dismiss";
343
+ readonly stopped: "Execution stopped";
344
+ readonly reset: "Session reset";
345
+ readonly created: "New session created";
346
+ readonly deleted: "Session deleted";
347
+ readonly failed: ({ name, error }: {
348
+ name: string;
349
+ error: string;
350
+ }) => string;
351
+ readonly needsRun: ({ name }: {
352
+ name: string;
353
+ }) => string;
354
+ readonly signalPending: ({ signal }: {
355
+ signal: string;
356
+ }) => string;
357
+ readonly pauseRequested: "Pause requested — finishing the current step";
358
+ readonly resumeRequested: "Resume requested";
359
+ readonly cancelRequested: "Cancel requested — finishing the current step";
360
+ readonly refusedTerminal: ({ name }: {
361
+ name: string;
362
+ }) => string;
363
+ readonly refusedDuplicate: "A signal is already pending for this run";
364
+ readonly refusedNotPaused: "Nothing to resume — this run is not paused";
365
+ readonly refusedNotFound: "That run no longer exists";
366
+ readonly refusedForbidden: ({ name }: {
367
+ name: string;
368
+ }) => string;
369
+ readonly refusedOther: ({ name, error }: {
370
+ name: string;
371
+ error: string;
372
+ }) => string;
373
+ readonly runStarted: "Run started";
374
+ readonly runInvalidInput: ({ error }: {
375
+ error: string;
376
+ }) => string;
377
+ readonly runInvalidWorkflow: ({ error }: {
378
+ error: string;
379
+ }) => string;
380
+ readonly runInvalidWorkflowDetail: ({ locator, message }: {
381
+ locator: string;
382
+ message: string;
383
+ }) => string;
384
+ };
287
385
  readonly actions: {
288
386
  readonly stopTitle: "Stop execution";
289
387
  readonly stop: "Stop";
@@ -249,7 +249,8 @@ export const defaultMessages = {
249
249
  applied: 'Applied',
250
250
  dismissed: 'Dismissed',
251
251
  applyAll: 'Apply All',
252
- cancel: 'Cancel'
252
+ cancel: 'Cancel',
253
+ layoutSkipped: 'Skipped — AI layout changes are disabled in Settings'
253
254
  }
254
255
  },
255
256
  playground: {
@@ -263,6 +264,62 @@ export const defaultMessages = {
263
264
  processing: 'Processing...',
264
265
  viewOnlyHelp: 'View-only mode. Workflow execution is controlled externally.'
265
266
  },
267
+ // Slash commands — the composer's out-of-band control lane. Feedback is
268
+ // transient UI, never a session message: control traffic must not enter
269
+ // conversation history, or it feeds back into the next turn's input.
270
+ commands: {
271
+ unknown: ({ name }) => `Unknown command: /${name}`,
272
+ unknownWithSuggestions: ({ name, suggestions }) => `Unknown command: /${name}. Did you mean ${suggestions}?`,
273
+ unavailable: ({ name }) => `/${name} is not supported by this backend`,
274
+ needsSession: ({ name }) => `/${name} needs an active session`,
275
+ helpHeading: 'Available commands',
276
+ helpEscapeHint: 'To send a message starting with a slash, type it twice: //like this',
277
+ // Display text for each command, shown by `/help` and by the palette.
278
+ // Lives here rather than in the command registry so translators reach it
279
+ // through the same channel as everything else; the registry keeps only
280
+ // the structural facts (does it take arguments, is it available).
281
+ catalog: {
282
+ help: { usage: '/help', summary: 'List the commands available here' },
283
+ run: {
284
+ usage: '/run [--input=value ...]',
285
+ summary: 'Start a run, optionally with named inputs'
286
+ },
287
+ new: { usage: '/new', summary: 'Start a new session' },
288
+ stop: { usage: '/stop', summary: 'Stop what this session is running' },
289
+ reset: { usage: '/reset', summary: 'Reset a stuck session to idle' },
290
+ delete: { usage: '/delete', summary: 'Delete the current session' },
291
+ pause: { usage: '/pause [reason]', summary: 'Ask the active run to pause' },
292
+ resume: { usage: '/resume [reason]', summary: 'Resume the paused run' },
293
+ cancel: { usage: '/cancel [reason]', summary: 'Cancel the active run — cannot be undone' }
294
+ },
295
+ dismiss: 'Dismiss',
296
+ stopped: 'Execution stopped',
297
+ reset: 'Session reset',
298
+ created: 'New session created',
299
+ deleted: 'Session deleted',
300
+ failed: ({ name, error }) => `/${name} failed: ${error}`,
301
+ // Pipeline signals. Wording matters: a backend acknowledges a signal
302
+ // before acting on it, so these say "requested" and let the status poll
303
+ // report the real state. Claiming "Paused" on acknowledgement would be
304
+ // wrong exactly when the current step is slow.
305
+ needsRun: ({ name }) => `/${name} needs an active run`,
306
+ signalPending: ({ signal }) => `A ${signal} is already pending for this run`,
307
+ pauseRequested: 'Pause requested — finishing the current step',
308
+ resumeRequested: 'Resume requested',
309
+ cancelRequested: 'Cancel requested — finishing the current step',
310
+ refusedTerminal: ({ name }) => `Cannot ${name}: the run already finished`,
311
+ refusedDuplicate: 'A signal is already pending for this run',
312
+ refusedNotPaused: 'Nothing to resume — this run is not paused',
313
+ refusedNotFound: 'That run no longer exists',
314
+ refusedForbidden: ({ name }) => `You do not have permission to ${name} this run`,
315
+ refusedOther: ({ name, error }) => `/${name} refused: ${error}`,
316
+ // Launch. Bad inputs and an invalid workflow are separated on purpose —
317
+ // one is the caller's to fix, the other is an authoring problem.
318
+ runStarted: 'Run started',
319
+ runInvalidInput: ({ error }) => `Cannot start: ${error}`,
320
+ runInvalidWorkflow: ({ error }) => `Cannot start — this workflow has errors: ${error}`,
321
+ runInvalidWorkflowDetail: ({ locator, message }) => locator ? ` • ${locator}: ${message}` : ` • ${message}`
322
+ },
266
323
  actions: {
267
324
  stopTitle: 'Stop execution',
268
325
  stop: 'Stop',
@@ -2,7 +2,7 @@
2
2
  * Messages module — typed, overridable, translation-ready user-facing strings.
3
3
  *
4
4
  * See `./defaults.ts` for the canonical shape, `./context.ts` for the runtime
5
- * plumbing, and the i18n guide in `apps/docs` for consumer recipes.
5
+ * plumbing, and the i18n guide in the docs site (`.docs/`) for consumer recipes.
6
6
  */
7
7
  export { defaultMessages } from './defaults.js';
8
8
  export { mergeMessages } from './merge.js';
@@ -2,7 +2,7 @@
2
2
  * Messages module — typed, overridable, translation-ready user-facing strings.
3
3
  *
4
4
  * See `./defaults.ts` for the canonical shape, `./context.ts` for the runtime
5
- * plumbing, and the i18n guide in `apps/docs` for consumer recipes.
5
+ * plumbing, and the i18n guide in the docs site (`.docs/`) for consumer recipes.
6
6
  */
7
7
  export { defaultMessages } from './defaults.js';
8
8
  export { mergeMessages } from './merge.js';