@flowdrop/flowdrop 1.4.0 → 1.5.0

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 (100) hide show
  1. package/README.md +68 -24
  2. package/dist/adapters/WorkflowAdapter.js +2 -22
  3. package/dist/adapters/agentspec/autoLayout.d.ts +51 -5
  4. package/dist/adapters/agentspec/autoLayout.js +120 -23
  5. package/dist/chat/commandClassifier.d.ts +19 -0
  6. package/dist/chat/commandClassifier.js +30 -0
  7. package/dist/chat/index.d.ts +27 -0
  8. package/dist/chat/index.js +32 -0
  9. package/dist/chat/responseParser.d.ts +21 -0
  10. package/dist/chat/responseParser.js +87 -0
  11. package/dist/commands/batch.d.ts +18 -0
  12. package/dist/commands/batch.js +56 -0
  13. package/dist/commands/executor.d.ts +37 -0
  14. package/dist/commands/executor.js +1044 -0
  15. package/dist/commands/index.d.ts +14 -0
  16. package/dist/commands/index.js +17 -0
  17. package/dist/commands/parser.d.ts +16 -0
  18. package/dist/commands/parser.js +278 -0
  19. package/dist/commands/positioner.d.ts +19 -0
  20. package/dist/commands/positioner.js +33 -0
  21. package/dist/commands/storeIntegration.svelte.d.ts +16 -0
  22. package/dist/commands/storeIntegration.svelte.js +67 -0
  23. package/dist/commands/types.d.ts +343 -0
  24. package/dist/commands/types.js +45 -0
  25. package/dist/components/App.svelte +351 -12
  26. package/dist/components/App.svelte.d.ts +3 -0
  27. package/dist/components/CanvasController.svelte +38 -0
  28. package/dist/components/CanvasController.svelte.d.ts +32 -0
  29. package/dist/components/ConfigMappingRow.svelte +130 -0
  30. package/dist/components/ConfigMappingRow.svelte.d.ts +8 -0
  31. package/dist/components/ConfigPanel.svelte +56 -7
  32. package/dist/components/ConfigPanel.svelte.d.ts +2 -0
  33. package/dist/components/FlowDropEdge.svelte +2 -10
  34. package/dist/components/LogsSidebar.svelte +5 -5
  35. package/dist/components/NodeSidebar.svelte +15 -49
  36. package/dist/components/NodeSwapPicker.svelte +537 -0
  37. package/dist/components/NodeSwapPicker.svelte.d.ts +16 -0
  38. package/dist/components/PortMappingRow.svelte +209 -0
  39. package/dist/components/PortMappingRow.svelte.d.ts +12 -0
  40. package/dist/components/SwapMappingEditor.svelte +550 -0
  41. package/dist/components/SwapMappingEditor.svelte.d.ts +12 -0
  42. package/dist/components/WorkflowEditor.svelte +99 -4
  43. package/dist/components/WorkflowEditor.svelte.d.ts +8 -0
  44. package/dist/components/chat/AIChatPanel.svelte +658 -0
  45. package/dist/components/chat/AIChatPanel.svelte.d.ts +13 -0
  46. package/dist/components/chat/CommandPreview.svelte +184 -0
  47. package/dist/components/chat/CommandPreview.svelte.d.ts +9 -0
  48. package/dist/components/console/CommandConsole.stories.svelte +93 -0
  49. package/dist/components/console/CommandConsole.stories.svelte.d.ts +27 -0
  50. package/dist/components/console/CommandConsole.svelte +259 -0
  51. package/dist/components/console/CommandConsole.svelte.d.ts +11 -0
  52. package/dist/components/console/ConsoleAutocomplete.svelte +139 -0
  53. package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +21 -0
  54. package/dist/components/console/ConsoleInput.svelte +712 -0
  55. package/dist/components/console/ConsoleInput.svelte.d.ts +16 -0
  56. package/dist/components/console/ConsoleOutput.svelte +121 -0
  57. package/dist/components/console/ConsoleOutput.svelte.d.ts +11 -0
  58. package/dist/components/console/formatters.d.ts +26 -0
  59. package/dist/components/console/formatters.js +118 -0
  60. package/dist/components/interrupt/index.d.ts +1 -0
  61. package/dist/components/interrupt/index.js +1 -0
  62. package/dist/config/endpoints.d.ts +8 -0
  63. package/dist/config/endpoints.js +5 -0
  64. package/dist/core/index.d.ts +5 -0
  65. package/dist/core/index.js +9 -0
  66. package/dist/editor/index.d.ts +3 -1
  67. package/dist/editor/index.js +4 -2
  68. package/dist/helpers/proximityConnect.js +8 -1
  69. package/dist/helpers/workflowEditorHelper.d.ts +3 -53
  70. package/dist/helpers/workflowEditorHelper.js +13 -228
  71. package/dist/playground/index.d.ts +1 -1
  72. package/dist/playground/index.js +1 -1
  73. package/dist/schemas/v1/workflow.schema.json +107 -22
  74. package/dist/services/chatService.d.ts +65 -0
  75. package/dist/services/chatService.js +131 -0
  76. package/dist/services/historyService.d.ts +6 -4
  77. package/dist/services/historyService.js +21 -6
  78. package/dist/stores/interruptStore.svelte.js +6 -1
  79. package/dist/stores/playgroundStore.svelte.d.ts +1 -1
  80. package/dist/stores/playgroundStore.svelte.js +11 -2
  81. package/dist/stores/portCoordinateStore.svelte.d.ts +4 -0
  82. package/dist/stores/portCoordinateStore.svelte.js +20 -26
  83. package/dist/stores/workflowStore.svelte.d.ts +31 -2
  84. package/dist/stores/workflowStore.svelte.js +84 -64
  85. package/dist/types/chat.d.ts +63 -0
  86. package/dist/types/chat.js +9 -0
  87. package/dist/types/events.d.ts +28 -2
  88. package/dist/types/events.js +1 -0
  89. package/dist/types/index.d.ts +8 -0
  90. package/dist/types/settings.d.ts +6 -0
  91. package/dist/types/settings.js +3 -0
  92. package/dist/utils/edgeStyling.d.ts +42 -0
  93. package/dist/utils/edgeStyling.js +176 -0
  94. package/dist/utils/nodeIds.d.ts +31 -0
  95. package/dist/utils/nodeIds.js +42 -0
  96. package/dist/utils/nodeSwap.d.ts +221 -0
  97. package/dist/utils/nodeSwap.js +686 -0
  98. package/package.json +6 -1
  99. package/dist/helpers/nodeLayoutHelper.d.ts +0 -14
  100. package/dist/helpers/nodeLayoutHelper.js +0 -19
@@ -0,0 +1,16 @@
1
+ import type { NodeMetadata } from "../../types/index.js";
2
+ interface Props {
3
+ /** Whether the console is currently visible/open */
4
+ open: boolean;
5
+ /** Available node types for autocomplete suggestions */
6
+ nodeTypes?: NodeMetadata[];
7
+ /** Called when user submits a command (Enter key) */
8
+ onSubmit: (value: string) => void;
9
+ /** Called when user pastes multiple lines */
10
+ onBatchSubmit?: (lines: string[]) => void;
11
+ /** Called when user presses Escape to close the console */
12
+ onClose: () => void;
13
+ }
14
+ declare const ConsoleInput: import("svelte").Component<Props, {}, "">;
15
+ type ConsoleInput = ReturnType<typeof ConsoleInput>;
16
+ export default ConsoleInput;
@@ -0,0 +1,121 @@
1
+ <!--
2
+ ConsoleOutput Component
3
+ Scrollable output area for displaying command results in the console
4
+ Styled with BEM syntax matching CommandConsole pattern
5
+ -->
6
+
7
+ <script lang="ts">
8
+ import { tick } from "svelte";
9
+
10
+ export interface ConsoleEntry {
11
+ type: "input" | "success" | "error" | "formatted";
12
+ text: string;
13
+ }
14
+
15
+ interface Props {
16
+ /** Output entries to display */
17
+ entries: ConsoleEntry[];
18
+ }
19
+
20
+ let { entries }: Props = $props();
21
+
22
+ let outputElement: HTMLDivElement | undefined = $state();
23
+
24
+ $effect(() => {
25
+ // Track entries length to auto-scroll on new entries
26
+ const _count = entries.length;
27
+ tick().then(() => {
28
+ if (outputElement) {
29
+ outputElement.scrollTop = outputElement.scrollHeight;
30
+ }
31
+ });
32
+ });
33
+ </script>
34
+
35
+ <div
36
+ class="console-output"
37
+ bind:this={outputElement}
38
+ role="log"
39
+ aria-live="polite"
40
+ >
41
+ {#each entries as entry}
42
+ <div class="console-output__entry console-output__entry--{entry.type}">
43
+ {#if entry.type === "input"}
44
+ <span class="console-output__prefix">&gt;</span>
45
+ <span class="console-output__text">{entry.text}</span>
46
+ {:else if entry.type === "formatted"}
47
+ <pre class="console-output__pre">{entry.text}</pre>
48
+ {:else}
49
+ <span class="console-output__text">{entry.text}</span>
50
+ {/if}
51
+ </div>
52
+ {/each}
53
+ </div>
54
+
55
+ <style>
56
+ .console-output {
57
+ flex: 1;
58
+ overflow-y: auto;
59
+ padding: 0.5rem 1rem;
60
+ font-family: monospace;
61
+ font-size: 0.875rem;
62
+ line-height: 1.6;
63
+
64
+ /* Custom scrollbar styling matching MainLayout pattern */
65
+ scrollbar-width: thin;
66
+ scrollbar-color: var(--fd-scrollbar-thumb) var(--fd-scrollbar-track);
67
+ }
68
+
69
+ .console-output::-webkit-scrollbar {
70
+ width: 8px;
71
+ }
72
+
73
+ .console-output::-webkit-scrollbar-track {
74
+ background: var(--fd-scrollbar-track);
75
+ border-radius: 4px;
76
+ }
77
+
78
+ .console-output::-webkit-scrollbar-thumb {
79
+ background: var(--fd-scrollbar-thumb);
80
+ border-radius: 4px;
81
+ }
82
+
83
+ .console-output::-webkit-scrollbar-thumb:hover {
84
+ background: var(--fd-scrollbar-thumb-hover);
85
+ }
86
+
87
+ .console-output__entry {
88
+ white-space: pre-wrap;
89
+ word-break: break-word;
90
+ }
91
+
92
+ .console-output__entry--input {
93
+ color: var(--fd-muted-foreground);
94
+ }
95
+
96
+ .console-output__entry--success {
97
+ color: var(--fd-success);
98
+ }
99
+
100
+ .console-output__entry--error {
101
+ color: var(--fd-error);
102
+ }
103
+
104
+ .console-output__entry--formatted {
105
+ color: var(--fd-foreground);
106
+ }
107
+
108
+ .console-output__pre {
109
+ margin: 0;
110
+ font-family: inherit;
111
+ font-size: inherit;
112
+ line-height: inherit;
113
+ white-space: pre;
114
+ overflow-x: auto;
115
+ }
116
+
117
+ .console-output__prefix {
118
+ margin-right: 0.5rem;
119
+ user-select: none;
120
+ }
121
+ </style>
@@ -0,0 +1,11 @@
1
+ export interface ConsoleEntry {
2
+ type: "input" | "success" | "error" | "formatted";
3
+ text: string;
4
+ }
5
+ interface Props {
6
+ /** Output entries to display */
7
+ entries: ConsoleEntry[];
8
+ }
9
+ declare const ConsoleOutput: import("svelte").Component<Props, {}, "">;
10
+ type ConsoleOutput = ReturnType<typeof ConsoleOutput>;
11
+ export default ConsoleOutput;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Pure formatting functions for rich command result display.
3
+ * Converts CommandResult data into aligned table strings for console output.
4
+ */
5
+ import type { ListNodesResultData, ListEdgesResultData, ListTypesResultData, InfoResultData, HelpResultData } from "../../commands/types.js";
6
+ /**
7
+ * Formats list nodes result as an aligned table: ID, Label, Type.
8
+ */
9
+ export declare function formatListNodes(data: ListNodesResultData): string;
10
+ /**
11
+ * Formats list edges result as a table: Source, Port, ->, Target, Port.
12
+ */
13
+ export declare function formatListEdges(data: ListEdgesResultData): string;
14
+ /**
15
+ * Formats list types result as a table: Type ID, Name, Category.
16
+ */
17
+ export declare function formatListTypes(data: ListTypesResultData): string;
18
+ /**
19
+ * Formats info result as structured output with header fields,
20
+ * config section, ports section, and edges section.
21
+ */
22
+ export declare function formatInfo(data: InfoResultData): string;
23
+ /**
24
+ * Formats help result as a table: Name, Syntax, Description.
25
+ */
26
+ export declare function formatHelp(data: HelpResultData): string;
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Pads a string to a given width (right-padded with spaces).
3
+ */
4
+ function pad(str, width) {
5
+ return str.length >= width ? str : str + " ".repeat(width - str.length);
6
+ }
7
+ /**
8
+ * Formats a simple table from rows with headers.
9
+ * Each column is auto-sized to fit the widest value.
10
+ */
11
+ function formatTable(headers, rows) {
12
+ const colWidths = headers.map((h, i) => Math.max(h.length, ...rows.map((r) => (r[i] ?? "").length)));
13
+ const headerLine = headers.map((h, i) => pad(h, colWidths[i])).join(" ");
14
+ const separator = colWidths.map((w) => "-".repeat(w)).join(" ");
15
+ const dataLines = rows.map((row) => row.map((cell, i) => pad(cell, colWidths[i])).join(" "));
16
+ return [headerLine, separator, ...dataLines].join("\n");
17
+ }
18
+ /**
19
+ * Formats list nodes result as an aligned table: ID, Label, Type.
20
+ */
21
+ export function formatListNodes(data) {
22
+ if (data.nodes.length === 0) {
23
+ return "No nodes in workflow";
24
+ }
25
+ const rows = data.nodes.map((n) => [n.nodeId, n.label, n.type]);
26
+ return formatTable(["ID", "Label", "Type"], rows);
27
+ }
28
+ /**
29
+ * Formats list edges result as a table: Source, Port, ->, Target, Port.
30
+ */
31
+ export function formatListEdges(data) {
32
+ if (data.edges.length === 0) {
33
+ return "No edges in workflow";
34
+ }
35
+ const rows = data.edges.map((e) => [
36
+ e.sourceNodeId,
37
+ e.sourcePort,
38
+ "->",
39
+ e.targetNodeId,
40
+ e.targetPort,
41
+ ]);
42
+ return formatTable(["Source", "Port", "", "Target", "Port"], rows);
43
+ }
44
+ /**
45
+ * Formats list types result as a table: Type ID, Name, Category.
46
+ */
47
+ export function formatListTypes(data) {
48
+ if (data.types.length === 0) {
49
+ return "No node types available";
50
+ }
51
+ const rows = data.types.map((t) => [t.typeId, t.name, t.category]);
52
+ return formatTable(["Type ID", "Name", "Category"], rows);
53
+ }
54
+ /**
55
+ * Formats info result as structured output with header fields,
56
+ * config section, ports section, and edges section.
57
+ */
58
+ export function formatInfo(data) {
59
+ const lines = [];
60
+ // Header fields
61
+ lines.push(`Node: ${data.nodeId}`);
62
+ lines.push(`Label: ${data.label}`);
63
+ lines.push(`Type: ${data.type}`);
64
+ lines.push(`Position: (${Math.round(data.position.x)}, ${Math.round(data.position.y)})`);
65
+ // Config section
66
+ const configEntries = Object.entries(data.config);
67
+ if (configEntries.length > 0) {
68
+ lines.push("");
69
+ lines.push("Config:");
70
+ for (const [key, value] of configEntries) {
71
+ const display = typeof value === "string"
72
+ ? `"${value}"`
73
+ : JSON.stringify(value) ?? "null";
74
+ lines.push(` ${key}: ${display}`);
75
+ }
76
+ }
77
+ // Ports section
78
+ if (data.inputs.length > 0 || data.outputs.length > 0) {
79
+ lines.push("");
80
+ lines.push("Ports:");
81
+ if (data.inputs.length > 0) {
82
+ lines.push(" Inputs:");
83
+ for (const port of data.inputs) {
84
+ lines.push(` ${port.portId} (${port.dataType})`);
85
+ }
86
+ }
87
+ if (data.outputs.length > 0) {
88
+ lines.push(" Outputs:");
89
+ for (const port of data.outputs) {
90
+ lines.push(` ${port.portId} (${port.dataType})`);
91
+ }
92
+ }
93
+ }
94
+ // Connected edges section
95
+ if (data.connectedEdges.length > 0) {
96
+ lines.push("");
97
+ lines.push("Edges:");
98
+ for (const edge of data.connectedEdges) {
99
+ if (edge.direction === "incoming") {
100
+ lines.push(` ${edge.remoteNodeId}:${edge.remotePort} -> ${edge.localPort}`);
101
+ }
102
+ else {
103
+ lines.push(` ${edge.localPort} -> ${edge.remoteNodeId}:${edge.remotePort}`);
104
+ }
105
+ }
106
+ }
107
+ return lines.join("\n");
108
+ }
109
+ /**
110
+ * Formats help result as a table: Name, Syntax, Description.
111
+ */
112
+ export function formatHelp(data) {
113
+ if (data.commands.length === 0) {
114
+ return "No commands available";
115
+ }
116
+ const rows = data.commands.map((c) => [c.name, c.syntax, c.description]);
117
+ return formatTable(["Name", "Syntax", "Description"], rows);
118
+ }
@@ -11,3 +11,4 @@ export { default as ConfirmationPrompt } from "./ConfirmationPrompt.svelte";
11
11
  export { default as ChoicePrompt } from "./ChoicePrompt.svelte";
12
12
  export { default as TextInputPrompt } from "./TextInputPrompt.svelte";
13
13
  export { default as FormPrompt } from "./FormPrompt.svelte";
14
+ export { default as ReviewPrompt } from "./ReviewPrompt.svelte";
@@ -13,3 +13,4 @@ export { default as ConfirmationPrompt } from "./ConfirmationPrompt.svelte";
13
13
  export { default as ChoicePrompt } from "./ChoicePrompt.svelte";
14
14
  export { default as TextInputPrompt } from "./TextInputPrompt.svelte";
15
15
  export { default as FormPrompt } from "./FormPrompt.svelte";
16
+ export { default as ReviewPrompt } from "./ReviewPrompt.svelte";
@@ -72,6 +72,14 @@ export interface EndpointConfig {
72
72
  /** List interrupts for a pipeline */
73
73
  listByPipeline: string;
74
74
  };
75
+ chat: {
76
+ /** Send a message to the chat */
77
+ sendMessage: string;
78
+ /** Get conversation history */
79
+ getHistory: string;
80
+ /** Clear conversation history */
81
+ clearHistory: string;
82
+ };
75
83
  templates: {
76
84
  list: string;
77
85
  get: string;
@@ -60,6 +60,11 @@ export const defaultEndpointConfig = {
60
60
  listBySession: "/playground/sessions/{sessionId}/interrupts",
61
61
  listByPipeline: "/pipelines/{pipelineId}/interrupts",
62
62
  },
63
+ chat: {
64
+ sendMessage: "/workflows/{id}/chat/messages",
65
+ getHistory: "/workflows/{id}/chat/messages",
66
+ clearHistory: "/workflows/{id}/chat/messages",
67
+ },
63
68
  templates: {
64
69
  list: "/templates",
65
70
  get: "/templates/{id}",
@@ -49,6 +49,9 @@ export { isFieldOptionArray, normalizeOptions, } from "../components/form/types.
49
49
  export { resolveScopeToKey, keyToScope, generateDefaultUISchema, collectReferencedKeys, } from "../utils/uischema.js";
50
50
  export { DEFAULT_PORT_CONFIG } from "../config/defaultPortConfig.js";
51
51
  export { defaultEndpointConfig, createEndpointConfig, } from "../config/endpoints.js";
52
+ export { generateNodeId, extractConfigDefaults } from "../utils/nodeIds.js";
53
+ export type { AddNodeCommand, DeleteNodeCommand, RenameNodeCommand, SetConfigCommand, GetConfigCommand, ConnectCommand, DisconnectPortsCommand, DisconnectNodeCommand, ListNodesCommand, ListEdgesCommand, ListTypesCommand, InfoCommand, UndoCommand, RedoCommand, ConfigOpenCommand, SelectNodeCommand, HelpCommand, ClearCommand, SwapNodeCommand, MoveNodeCommand, AutoLayoutCommand, Command, ParseResult, CommandErrorCode, AddNodeResultData, ListNodesResultData, ListEdgesResultData, ListTypesResultData, InfoResultData, GetConfigResultData, SetConfigResultData, HelpResultData, CommandResultData, CommandResultOk, CommandResultError, CommandResult, BatchResult, UIAction, CommandDispatch, CommandContext, } from "../commands/index.js";
54
+ export { buildTypeMap, parseCommand, executeCommand, toShortId, toShortTypeId, resolveNode, executeBatch, computeAutoPosition, } from "../commands/index.js";
52
55
  export { WorkflowAdapter } from "../adapters/WorkflowAdapter.js";
53
56
  export type { StandardNode, StandardEdge, StandardWorkflow, WorkflowExecutionResult, WorkflowValidationResult, } from "../adapters/WorkflowAdapter.js";
54
57
  export type { AgentSpecNodeComponentType, AgentSpecToolComponentType, AgentSpecComponentType, AgentSpecProperty, AgentSpecNodeBase, AgentSpecStartNode, AgentSpecEndNode, AgentSpecLLMNode, AgentSpecAPINode, AgentSpecAgentNode, AgentSpecFlowNode, AgentSpecMapNode, AgentSpecBranchingNode, AgentSpecToolNode, AgentSpecNode, AgentSpecBranch, AgentSpecControlFlowEdge, AgentSpecDataFlowEdge, AgentSpecFlow, AgentSpecToolBase, AgentSpecServerTool, AgentSpecClientTool, AgentSpecRemoteTool, AgentSpecTool, AgentSpecLLMConfig, AgentSpecAgent, AgentSpecDocument, } from "../types/agentspec.js";
@@ -77,3 +80,5 @@ export { getTheme as theme, getResolvedTheme as resolvedTheme, setTheme, toggleT
77
80
  export { sanitizeHtml } from "../utils/sanitize.js";
78
81
  export { logger, setLogLevel, getLogLevel } from "../utils/logger.js";
79
82
  export type { LogLevel } from "../utils/logger.js";
83
+ export { computeSwapPreview, computeSwapPreviewWithOptions, executeSwap, mapConfig, getVersionUpgrade, compareSemver, performSwap, validateSwapResult, SwapValidationError, } from "../utils/nodeSwap.js";
84
+ export type { SwapPreview, SwapResult, PortMapping, DroppedEdge, MatchQuality, PortMappingOverride, ConfigMappingOverride, SwapOptions, SwapStrategy, SwapStrategyContext, SwapEventContext, } from "../utils/nodeSwap.js";
@@ -58,6 +58,11 @@ export { resolveScopeToKey, keyToScope, generateDefaultUISchema, collectReferenc
58
58
  export { DEFAULT_PORT_CONFIG } from "../config/defaultPortConfig.js";
59
59
  export { defaultEndpointConfig, createEndpointConfig, } from "../config/endpoints.js";
60
60
  // ============================================================================
61
+ // Shared Utilities
62
+ // ============================================================================
63
+ export { generateNodeId, extractConfigDefaults } from "../utils/nodeIds.js";
64
+ export { buildTypeMap, parseCommand, executeCommand, toShortId, toShortTypeId, resolveNode, executeBatch, computeAutoPosition, } from "../commands/index.js";
65
+ // ============================================================================
61
66
  // Adapters
62
67
  // ============================================================================
63
68
  export { WorkflowAdapter } from "../adapters/WorkflowAdapter.js";
@@ -92,3 +97,7 @@ export { sanitizeHtml } from "../utils/sanitize.js";
92
97
  // Logger
93
98
  // ============================================================================
94
99
  export { logger, setLogLevel, getLogLevel } from "../utils/logger.js";
100
+ // ============================================================================
101
+ // Node Swap
102
+ // ============================================================================
103
+ export { computeSwapPreview, computeSwapPreviewWithOptions, executeSwap, mapConfig, getVersionUpgrade, compareSemver, performSwap, validateSwapResult, SwapValidationError, } from "../utils/nodeSwap.js";
@@ -57,6 +57,7 @@ export { default as LogsSidebar } from "../components/LogsSidebar.svelte";
57
57
  export { default as PipelineStatus } from "../components/PipelineStatus.svelte";
58
58
  export { default as Navbar } from "../components/Navbar.svelte";
59
59
  export { default as Logo } from "../components/Logo.svelte";
60
+ export { default as CommandConsole } from "../components/console/CommandConsole.svelte";
60
61
  export { default as Playground } from "../components/playground/Playground.svelte";
61
62
  export { default as PlaygroundModal } from "../components/playground/PlaygroundModal.svelte";
62
63
  export { default as ChatPanel } from "../components/playground/ChatPanel.svelte";
@@ -67,7 +68,7 @@ export { default as MessageBubble } from "../components/playground/MessageBubble
67
68
  export { mountWorkflowEditor, mountFlowDropApp, unmountFlowDropApp, } from "../svelte-app.js";
68
69
  export { nodeComponentRegistry, createNamespacedType, parseNamespacedType, BUILTIN_NODE_COMPONENTS, BUILTIN_NODE_TYPES, FLOWDROP_SOURCE, registerBuiltinNodes, areBuiltinsRegistered, isBuiltinType, getBuiltinTypes, resolveBuiltinAlias, registerFlowDropPlugin, unregisterFlowDropPlugin, registerCustomNode, createPlugin, isValidNamespace, getRegisteredPlugins, getPluginNodeCount, } from "../registry/index.js";
69
70
  export { EdgeStylingHelper, NodeOperationsHelper, WorkflowOperationsHelper, ConfigurationHelper, } from "../helpers/workflowEditorHelper.js";
70
- export { getWorkflowStore, workflowActions, getWorkflowId, getWorkflowName, getWorkflowNodes, getWorkflowEdges, getWorkflowMetadata, getWorkflowFormat, getWorkflowChanged, getWorkflowValidation, getWorkflowMetadataChanged, getConnectedHandles, getIsDirty, isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange, setHistoryEnabled, isHistoryEnabled, setRestoringFromHistory, } from "../stores/workflowStore.svelte.js";
71
+ export { getWorkflowStore, workflowActions, getWorkflowId, getWorkflowName, getWorkflowNodes, getWorkflowEdges, getWorkflowMetadata, getWorkflowFormat, getWorkflowChanged, getWorkflowValidation, getWorkflowMetadataChanged, getConnectedHandles, getIsDirty, isDirty, markAsSaved, getEditVersion, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange, setHistoryEnabled, isHistoryEnabled, setRestoringFromHistory, } from "../stores/workflowStore.svelte.js";
71
72
  export { rebuildAllPortCoordinates, updateNodePortCoordinates, removeNodePortCoordinates, getPortCoordinate, getNodePortCoordinates, getPortCoordinateSnapshot, getPortCoordinates, } from "../stores/portCoordinateStore.svelte.js";
72
73
  export { getHistoryState, getCanUndo, getCanRedo, historyActions, setOnRestoreCallback, cleanupHistorySubscription, historyService, HistoryService, } from "../stores/historyStore.svelte.js";
73
74
  export type { HistoryEntry, HistoryState, PushOptions, } from "../stores/historyStore.svelte.js";
@@ -91,5 +92,6 @@ export type { WorkflowEditorConfig, EditorFeatures, UIConfig, APIConfig, } from
91
92
  export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig, } from "../types/auth.js";
92
93
  export type { FlowDropEventHandlers, FlowDropFeatures, WorkflowChangeType, } from "../types/events.js";
93
94
  export type { EndpointConfig } from "../config/endpoints.js";
95
+ export type { UIAction } from "../commands/types.js";
94
96
  export type { FlowDropMountOptions, MountedFlowDropApp, NavbarAction, } from "../svelte-app.js";
95
97
  export type { NodeComponentProps, NodeComponentRegistration, FlowDropPluginConfig, PluginNodeDefinition, } from "../registry/index.js";
@@ -71,6 +71,8 @@ export { default as LogsSidebar } from "../components/LogsSidebar.svelte";
71
71
  export { default as PipelineStatus } from "../components/PipelineStatus.svelte";
72
72
  export { default as Navbar } from "../components/Navbar.svelte";
73
73
  export { default as Logo } from "../components/Logo.svelte";
74
+ // Console Components
75
+ export { default as CommandConsole } from "../components/console/CommandConsole.svelte";
74
76
  // Playground Components
75
77
  export { default as Playground } from "../components/playground/Playground.svelte";
76
78
  export { default as PlaygroundModal } from "../components/playground/PlaygroundModal.svelte";
@@ -101,8 +103,8 @@ export { EdgeStylingHelper, NodeOperationsHelper, WorkflowOperationsHelper, Conf
101
103
  // Stores
102
104
  // ============================================================================
103
105
  export { getWorkflowStore, workflowActions, getWorkflowId, getWorkflowName, getWorkflowNodes, getWorkflowEdges, getWorkflowMetadata, getWorkflowFormat, getWorkflowChanged, getWorkflowValidation, getWorkflowMetadataChanged, getConnectedHandles,
104
- // Dirty state tracking
105
- getIsDirty, isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange,
106
+ // Dirty state tracking & version counter
107
+ getIsDirty, isDirty, markAsSaved, getEditVersion, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange,
106
108
  // History control
107
109
  setHistoryEnabled, isHistoryEnabled, setRestoringFromHistory, } from "../stores/workflowStore.svelte.js";
108
110
  // Port Coordinate Store (Svelte 5 runes-based)
@@ -239,9 +239,16 @@ export class ProximityConnectHelper {
239
239
  bestIsExact = isExact;
240
240
  }
241
241
  };
242
+ // Cache compatible types per dataType to avoid redundant lookups
243
+ const compatCache = new Map();
244
+ for (const srcPort of draggedOutputs) {
245
+ if (!compatCache.has(srcPort.dataType)) {
246
+ compatCache.set(srcPort.dataType, checker.getCompatibleTypes(srcPort.dataType));
247
+ }
248
+ }
242
249
  // Direction A: dragged outputs → other inputs (only compatible types)
243
250
  for (const srcPort of draggedOutputs) {
244
- const compatibleTypes = checker.getCompatibleTypes(srcPort.dataType);
251
+ const compatibleTypes = compatCache.get(srcPort.dataType);
245
252
  for (const targetType of compatibleTypes) {
246
253
  const targets = otherInputsByType.get(targetType);
247
254
  if (!targets)
@@ -4,12 +4,7 @@
4
4
  */
5
5
  import type { WorkflowNode as WorkflowNodeType, NodeMetadata, Workflow, WorkflowEdge, NodeExecutionInfo } from "../types/index.js";
6
6
  import type { EndpointConfig } from "../config/endpoints.js";
7
- /**
8
- * Generate a unique node ID based on node type and existing nodes
9
- * Format: <node_type>.<number>
10
- * Example: boolean_gateway.1, calculator.2
11
- */
12
- export declare function generateNodeId(nodeTypeId: string, existingNodes: WorkflowNodeType[]): string;
7
+ export { generateNodeId, extractConfigDefaults } from "../utils/nodeIds.js";
13
8
  /**
14
9
  * Edge category type for styling purposes
15
10
  * - trigger: For control flow connections (dataType: "trigger")
@@ -19,61 +14,16 @@ export declare function generateNodeId(nodeTypeId: string, existingNodes: Workfl
19
14
  */
20
15
  export type EdgeCategory = "trigger" | "tool" | "loopback" | "data";
21
16
  /**
22
- * Edge styling configuration based on source port data type
17
+ * Edge styling configuration based on source port data type.
18
+ * Delegates to standalone functions in utils/edgeStyling.ts.
23
19
  */
24
20
  export declare class EdgeStylingHelper {
25
- /**
26
- * Extract the port ID from a handle ID
27
- * @param handleId - The handle ID string (e.g., "sample-node.1-output-trigger" or "trigger")
28
- * @returns The port ID (e.g., "trigger") or the handleId itself for short format
29
- */
30
21
  static extractPortIdFromHandle(handleId: string | undefined): string | null;
31
- /**
32
- * Check if a port ID matches a dynamic branch in a Gateway node
33
- * Gateway nodes store branches in config.branches array
34
- * @param node - The workflow node to check
35
- * @param portId - The port ID to look up
36
- * @returns true if the portId matches a gateway branch
37
- */
38
22
  static isGatewayBranch(node: WorkflowNodeType, portId: string): boolean;
39
- /**
40
- * Get the data type of a port from a node's metadata
41
- * Also handles dynamic ports like Gateway branches
42
- * @param node - The workflow node containing the port
43
- * @param portId - The port ID to look up
44
- * @param portType - Whether to look in "inputs" or "outputs"
45
- * @returns The port's dataType or null if not found
46
- */
47
23
  static getPortDataType(node: WorkflowNodeType, portId: string, portType: "input" | "output"): string | null;
48
- /**
49
- * Determine the edge category based on source port data type
50
- * Note: This method does not check for loopback edges.
51
- * Use getEdgeCategoryWithLoopback() for full edge categorization.
52
- *
53
- * @param sourcePortDataType - The data type of the source output port
54
- * @returns The edge category for styling
55
- */
56
24
  static getEdgeCategory(sourcePortDataType: string | null): EdgeCategory;
57
- /**
58
- * Determine the full edge category including loopback detection
59
- * Loopback edges take precedence over source port data type
60
- *
61
- * @param edge - The edge to categorize
62
- * @param sourcePortDataType - The data type of the source output port
63
- * @returns The edge category for styling
64
- */
65
25
  static getEdgeCategoryWithLoopback(edge: WorkflowEdge, sourcePortDataType: string | null): EdgeCategory;
66
- /**
67
- * Apply custom styling to connection edges based on edge type:
68
- * - Loopback: Dashed gray line for loop iteration (targets loop_back port)
69
- * - Trigger ports: Solid black line with arrow
70
- * - Tool ports: Dashed amber line with arrow
71
- * - Data ports: Normal gray line with arrow
72
- */
73
26
  static applyConnectionStyling(edge: WorkflowEdge, sourceNode: WorkflowNodeType, targetNode: WorkflowNodeType): void;
74
- /**
75
- * Update existing edges with custom styling rules
76
- */
77
27
  static updateEdgeStyles(edges: WorkflowEdge[], nodes: WorkflowNodeType[]): WorkflowEdge[];
78
28
  }
79
29
  /**