@foresthubai/workflow-builder 0.3.0 → 0.4.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 (120) hide show
  1. package/LICENSE +661 -661
  2. package/NOTICE +16 -16
  3. package/README.md +110 -93
  4. package/dist/components/ui/command.d.ts +2 -2
  5. package/dist/components/ui/input.d.ts +1 -1
  6. package/dist/components/ui/resizable.d.ts +1 -1
  7. package/dist/components/ui/textarea.d.ts +1 -1
  8. package/dist/graph/BaseNode.js +10 -10
  9. package/dist/graph/reactFlowRegistry.d.ts.map +1 -1
  10. package/dist/lib/utils.d.ts +3 -0
  11. package/dist/lib/utils.d.ts.map +1 -0
  12. package/dist/lib/utils.js +6 -0
  13. package/dist/lib/utils.js.map +1 -0
  14. package/dist/toolbars/CanvasTabsToolbar.d.ts +11 -0
  15. package/dist/toolbars/CanvasTabsToolbar.d.ts.map +1 -0
  16. package/dist/toolbars/CanvasTabsToolbar.js +101 -0
  17. package/dist/toolbars/CanvasTabsToolbar.js.map +1 -0
  18. package/package.json +2 -2
  19. package/src/BuilderLayout.tsx +345 -345
  20. package/src/Canvas.tsx +261 -261
  21. package/src/CanvasEditor.tsx +142 -142
  22. package/src/CanvasTabsToolbar.tsx +176 -176
  23. package/src/RightConfigPanel.tsx +266 -266
  24. package/src/WorkflowBuilder.tsx +412 -412
  25. package/src/cn.ts +6 -6
  26. package/src/components/ui/add-button.tsx +39 -39
  27. package/src/components/ui/alert-dialog.tsx +141 -141
  28. package/src/components/ui/alert.tsx +59 -59
  29. package/src/components/ui/badge.tsx +36 -36
  30. package/src/components/ui/button.tsx +85 -85
  31. package/src/components/ui/card.tsx +79 -79
  32. package/src/components/ui/checkbox.tsx +28 -28
  33. package/src/components/ui/collapsible.tsx +9 -9
  34. package/src/components/ui/command.tsx +153 -153
  35. package/src/components/ui/delete-button.tsx +23 -23
  36. package/src/components/ui/dialog.tsx +125 -125
  37. package/src/components/ui/dropdown-menu.tsx +198 -198
  38. package/src/components/ui/input.tsx +55 -55
  39. package/src/components/ui/label.tsx +24 -24
  40. package/src/components/ui/readonly-banner.tsx +15 -15
  41. package/src/components/ui/resizable.tsx +43 -43
  42. package/src/components/ui/scroll-area.tsx +102 -102
  43. package/src/components/ui/select.tsx +160 -160
  44. package/src/components/ui/separator.tsx +29 -29
  45. package/src/components/ui/switch.tsx +27 -27
  46. package/src/components/ui/textarea.tsx +51 -51
  47. package/src/components/ui/toast.tsx +127 -127
  48. package/src/components/ui/toaster.tsx +33 -33
  49. package/src/components/ui/toggle-group.tsx +59 -59
  50. package/src/components/ui/toggle.tsx +43 -43
  51. package/src/components/ui/tooltip.tsx +32 -32
  52. package/src/dialogs/NodePickerDialog.tsx +84 -84
  53. package/src/dialogs/ValidationDialog.tsx +184 -184
  54. package/src/graph/BaseNode.tsx +557 -557
  55. package/src/graph/CustomEdge.tsx +185 -185
  56. package/src/graph/CustomNode.tsx +16 -16
  57. package/src/graph/FunctionCallNode.tsx +30 -30
  58. package/src/graph/PortHandle.tsx +189 -189
  59. package/src/graph/reactFlowRegistry.ts +26 -26
  60. package/src/hooks/use-toast.ts +125 -125
  61. package/src/hooks/useAvailableVariables.ts +20 -20
  62. package/src/hooks/useCanvasHistory.ts +22 -22
  63. package/src/hooks/useCanvasTabs.ts +168 -168
  64. package/src/hooks/useFunctionDiagnosticsSync.ts +40 -40
  65. package/src/hooks/useFunctionRegistry.ts +26 -26
  66. package/src/hooks/useFunctions.ts +44 -44
  67. package/src/hooks/useGraph.ts +161 -161
  68. package/src/hooks/useNodeDefinitions.ts +82 -82
  69. package/src/hooks/useParamErrors.ts +26 -26
  70. package/src/hooks/useResolvedTheme.ts +30 -30
  71. package/src/hooks/useResourceDiagnosticsSync.ts +58 -58
  72. package/src/hooks/useSuppressThemeTransition.ts +79 -79
  73. package/src/hooks/useWorkflowSerialization.ts +127 -127
  74. package/src/i18n/index.ts +53 -53
  75. package/src/i18n/locales/de.json +501 -501
  76. package/src/i18n/locales/en.json +557 -557
  77. package/src/index.ts +27 -27
  78. package/src/inputs/ExpressionInput.tsx +297 -297
  79. package/src/inputs/ParameterEditor.tsx +515 -515
  80. package/src/inputs/PortSection.tsx +144 -144
  81. package/src/panels/BuilderSidebar.tsx +301 -301
  82. package/src/panels/ChannelConfigPanel.tsx +49 -49
  83. package/src/panels/ChannelsPanel.tsx +28 -28
  84. package/src/panels/DebugConsolePanel.tsx +73 -73
  85. package/src/panels/DebugContextPanel.tsx +77 -77
  86. package/src/panels/DebugExternalIOPanel.tsx +180 -180
  87. package/src/panels/DiagnosticsPanel.tsx +170 -170
  88. package/src/panels/EdgeConfigPanel.tsx +104 -104
  89. package/src/panels/FunctionConfigPanel.tsx +179 -179
  90. package/src/panels/FunctionListPanel.tsx +45 -45
  91. package/src/panels/MemoryConfigPanel.tsx +55 -55
  92. package/src/panels/MemoryPanel.tsx +40 -40
  93. package/src/panels/ModelConfigPanel.tsx +41 -41
  94. package/src/panels/ModelsPanel.tsx +36 -36
  95. package/src/panels/NodeConfigPanel.tsx +630 -630
  96. package/src/panels/NodeLibrary.tsx +288 -288
  97. package/src/panels/ResourceConfigPanel.tsx +132 -132
  98. package/src/panels/ResourceListPanel.tsx +113 -113
  99. package/src/panels/VariableConfigPanel.tsx +161 -161
  100. package/src/panels/VariablesPanel.tsx +145 -145
  101. package/src/stores/canvasStore.test.ts +44 -44
  102. package/src/stores/canvasStore.ts +245 -245
  103. package/src/stores/debugStore.ts +74 -74
  104. package/src/stores/diagnosticsStore.ts +130 -130
  105. package/src/stores/editorStore.ts +202 -202
  106. package/src/styles/index.css +526 -526
  107. package/src/utils/categoryConstants.ts +26 -26
  108. package/src/utils/channelOperations.ts +86 -86
  109. package/src/utils/connectionRules.ts +137 -137
  110. package/src/utils/functionOperations.ts +179 -179
  111. package/src/utils/graphOperations.ts +550 -550
  112. package/src/utils/history.ts +207 -207
  113. package/src/utils/memoryOperations.ts +57 -57
  114. package/src/utils/migrateFunctionNodes.ts +107 -107
  115. package/src/utils/modelOperations.ts +55 -55
  116. package/src/utils/paramDisplay.ts +71 -71
  117. package/src/utils/resourceHelpers.ts +32 -32
  118. package/src/utils/translation.ts +28 -28
  119. package/src/utils/variableOperations.ts +75 -75
  120. package/tailwind-preset.ts +166 -166
@@ -1,41 +1,41 @@
1
- import { useTranslation } from "react-i18next";
2
- import { ModelRegistry, type Model } from "@foresthubai/workflow-core/model";
3
- import { useDiagnosticsStore } from "../stores/diagnosticsStore";
4
- import { deleteModel, updateModel } from "../utils/modelOperations";
5
- import { ResourceConfigPanel } from "./ResourceConfigPanel";
6
-
7
- interface ModelConfigPanelProps {
8
- model: Model;
9
- onClose: () => void;
10
- }
11
-
12
- export const ModelConfigPanel = ({ model, onClose }: ModelConfigPanelProps) => {
13
- const { t } = useTranslation();
14
- const def = ModelRegistry.getByType(model.type);
15
- const modelDiags = useDiagnosticsStore((s) => s.byModelId[model.id]);
16
- const isEmptyLabel = model.label.trim() === "";
17
-
18
- return (
19
- <ResourceConfigPanel
20
- resetKey={model.id}
21
- label={model.label}
22
- labelTitle={t("modelLabel", "Model label")}
23
- onLabelChange={(label) => updateModel(model.id, { label })}
24
- description={def?.description ?? t("modelCustomDescription", "Custom model mapped to a provider at deploy")}
25
- belowLabel={
26
- isEmptyLabel ? (
27
- <p className="text-xs text-destructive mt-1">{t("modelLabelRequired", "Label is required")}</p>
28
- ) : undefined
29
- }
30
- parameters={def?.parameters ?? []}
31
- getValue={(p) => model.arguments[p.id]}
32
- allArguments={{ ...model.arguments }}
33
- onParamChange={(paramId, value) => updateModel(model.id, { arguments: { [paramId]: value } })}
34
- diagnostics={modelDiags}
35
- translationPrefix="models"
36
- deleteLabel={t("deleteModel", "Delete model")}
37
- onDelete={() => deleteModel(model.id)}
38
- onClose={onClose}
39
- />
40
- );
41
- };
1
+ import { useTranslation } from "react-i18next";
2
+ import { ModelRegistry, type Model } from "@foresthubai/workflow-core/model";
3
+ import { useDiagnosticsStore } from "../stores/diagnosticsStore";
4
+ import { deleteModel, updateModel } from "../utils/modelOperations";
5
+ import { ResourceConfigPanel } from "./ResourceConfigPanel";
6
+
7
+ interface ModelConfigPanelProps {
8
+ model: Model;
9
+ onClose: () => void;
10
+ }
11
+
12
+ export const ModelConfigPanel = ({ model, onClose }: ModelConfigPanelProps) => {
13
+ const { t } = useTranslation();
14
+ const def = ModelRegistry.getByType(model.type);
15
+ const modelDiags = useDiagnosticsStore((s) => s.byModelId[model.id]);
16
+ const isEmptyLabel = model.label.trim() === "";
17
+
18
+ return (
19
+ <ResourceConfigPanel
20
+ resetKey={model.id}
21
+ label={model.label}
22
+ labelTitle={t("modelLabel", "Model label")}
23
+ onLabelChange={(label) => updateModel(model.id, { label })}
24
+ description={def?.description ?? t("modelCustomDescription", "Custom model mapped to a provider at deploy")}
25
+ belowLabel={
26
+ isEmptyLabel ? (
27
+ <p className="text-xs text-destructive mt-1">{t("modelLabelRequired", "Label is required")}</p>
28
+ ) : undefined
29
+ }
30
+ parameters={def?.parameters ?? []}
31
+ getValue={(p) => model.arguments[p.id]}
32
+ allArguments={{ ...model.arguments }}
33
+ onParamChange={(paramId, value) => updateModel(model.id, { arguments: { [paramId]: value } })}
34
+ diagnostics={modelDiags}
35
+ translationPrefix="models"
36
+ deleteLabel={t("deleteModel", "Delete model")}
37
+ onDelete={() => deleteModel(model.id)}
38
+ onClose={onClose}
39
+ />
40
+ );
41
+ };
@@ -1,36 +1,36 @@
1
- import { useTranslation } from "react-i18next";
2
- import { BrainCircuit, Plus } from "lucide-react";
3
- import { useDiagnosticsStore } from "../stores/diagnosticsStore";
4
- import { useEditorStore } from "../stores/editorStore";
5
- import { addModel } from "../utils/modelOperations";
6
- import { ResourceListPanel } from "./ResourceListPanel";
7
-
8
- /**
9
- * Lists DECLARED custom/self-hosted models. The static catalog (built-in models
10
- * the llmproxy supports) is not shown here — those are always available as
11
- * picker options on agent nodes and need no declaration. This tab only manages
12
- * the custom models that get mapped to llmproxy providers at deploy.
13
- */
14
- export const ModelsPanel = () => {
15
- const { t } = useTranslation();
16
- const models = useEditorStore((s) => s.models);
17
- const selection = useEditorStore((s) => s.selection);
18
- const selectModel = useEditorStore((s) => s.selectModel);
19
- const byModelId = useDiagnosticsStore((s) => s.byModelId);
20
-
21
- return (
22
- <ResourceListPanel
23
- items={Object.values(models)}
24
- selectedId={selection.kind === "model" ? selection.id : null}
25
- onSelect={selectModel}
26
- diagnosticsSlot={byModelId}
27
- badge={() => t("modelLLMBadge", "LLM")}
28
- emptyIcon={BrainCircuit}
29
- emptyText={t("noModels", "No custom models yet")}
30
- emptyHint={t("noModelsHint", "Built-in models are always available. Declare custom or self-hosted models here.")}
31
- addActions={[
32
- { label: t("addCustomModel", "Add Custom Model"), icon: Plus, onAdd: () => selectModel(addModel("LLMModel").id) },
33
- ]}
34
- />
35
- );
36
- };
1
+ import { useTranslation } from "react-i18next";
2
+ import { BrainCircuit, Plus } from "lucide-react";
3
+ import { useDiagnosticsStore } from "../stores/diagnosticsStore";
4
+ import { useEditorStore } from "../stores/editorStore";
5
+ import { addModel } from "../utils/modelOperations";
6
+ import { ResourceListPanel } from "./ResourceListPanel";
7
+
8
+ /**
9
+ * Lists DECLARED custom/self-hosted models. The static catalog (built-in models
10
+ * the llmproxy supports) is not shown here — those are always available as
11
+ * picker options on agent nodes and need no declaration. This tab only manages
12
+ * the custom models that get mapped to llmproxy providers at deploy.
13
+ */
14
+ export const ModelsPanel = () => {
15
+ const { t } = useTranslation();
16
+ const models = useEditorStore((s) => s.models);
17
+ const selection = useEditorStore((s) => s.selection);
18
+ const selectModel = useEditorStore((s) => s.selectModel);
19
+ const byModelId = useDiagnosticsStore((s) => s.byModelId);
20
+
21
+ return (
22
+ <ResourceListPanel
23
+ items={Object.values(models)}
24
+ selectedId={selection.kind === "model" ? selection.id : null}
25
+ onSelect={selectModel}
26
+ diagnosticsSlot={byModelId}
27
+ badge={() => t("modelLLMBadge", "LLM")}
28
+ emptyIcon={BrainCircuit}
29
+ emptyText={t("noModels", "No custom models yet")}
30
+ emptyHint={t("noModelsHint", "Built-in models are always available. Declare custom or self-hosted models here.")}
31
+ addActions={[
32
+ { label: t("addCustomModel", "Add Custom Model"), icon: Plus, onAdd: () => selectModel(addModel("LLMModel").id) },
33
+ ]}
34
+ />
35
+ );
36
+ };