@kiberon-labs/behave-graph-flow 1.0.0 → 3.0.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.
- package/.fallowrc.json +16 -0
- package/.storybook/main.ts +32 -0
- package/.storybook/manager.ts +6 -0
- package/.storybook/preview.ts +64 -0
- package/.storybook/styles.css +16 -0
- package/.turbo/turbo-build.log +7 -0
- package/CHANGELOG.md +368 -0
- package/LICENSE +6 -0
- package/README.md +2 -2
- package/data/Polynomial.json +510 -0
- package/data/sequence.json +337 -0
- package/data/trigger-event.json +241 -0
- package/data/variable-change.json +210 -0
- package/dist/AnyControlImpl-Ds-CShIB.js +20 -0
- package/dist/AnyControlImpl-Ds-CShIB.js.map +1 -0
- package/dist/DocumentationBrowserPanelImpl-deZNzFX8.js +166 -0
- package/dist/DocumentationBrowserPanelImpl-deZNzFX8.js.map +1 -0
- package/dist/entry.css +4 -0
- package/dist/index.css +42 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +3597 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18009 -0
- package/dist/index.js.map +1 -0
- package/dist/noteImpl-KkrrWgJd.js +242 -0
- package/dist/noteImpl-KkrrWgJd.js.map +1 -0
- package/dist/styles.module-CvmpDkZj.css +3 -0
- package/dist/styles.module-CvmpDkZj.css.map +1 -0
- package/dist/styles.module-DZxg8aW9.js +271 -0
- package/dist/styles.module-DZxg8aW9.js.map +1 -0
- package/dist/useChangeNodeData-ChQGK7AI.js +23 -0
- package/dist/useChangeNodeData-ChQGK7AI.js.map +1 -0
- package/docs/notifications.md +246 -0
- package/docs/protocol.md +702 -0
- package/docs/specifics.md +191 -0
- package/package.json +82 -22
- package/postcss.config.ts +3 -4
- package/src/annotations/index.ts +32 -0
- package/src/components/FloatingToolbar/index.module.css +37 -0
- package/src/components/FloatingToolbar/index.tsx +256 -0
- package/src/components/Flow.tsx +287 -75
- package/src/components/contextMenus/DynamicContextMenu.tsx +85 -0
- package/src/components/contextMenus/NodePicker.module.css +274 -0
- package/src/components/contextMenus/NodePicker.tsx +481 -0
- package/src/components/contextMenus/edge.tsx +22 -0
- package/src/components/contextMenus/node.tsx +15 -0
- package/src/components/contextMenus/selection.tsx +11 -0
- package/src/components/controls/any/AnyControlImpl.tsx +14 -0
- package/src/components/controls/any/index.tsx +19 -0
- package/src/components/controls/boolean/index.tsx +13 -0
- package/src/components/controls/colorPicker/InputPopover.module.css +100 -0
- package/src/components/controls/colorPicker/InputPopover.tsx +31 -0
- package/src/components/controls/colorPicker/index.module.css +18 -0
- package/src/components/controls/colorPicker/index.tsx +61 -0
- package/src/components/controls/number/index.tsx +35 -0
- package/src/components/controls/string/index.tsx +16 -0
- package/src/components/edges/index.tsx +475 -0
- package/src/components/edges/offsetBezier.ts +134 -0
- package/src/components/hotKeys.tsx +20 -0
- package/src/components/layoutController/index.module.css +13 -0
- package/src/components/layoutController/index.tsx +140 -0
- package/src/components/layoutController/utils.ts +248 -0
- package/src/components/menubar/defaults.tsx +516 -0
- package/src/components/menubar/index.tsx +49 -0
- package/src/components/menubar/menuItem.module.css +31 -0
- package/src/components/menubar/menuItem.tsx +65 -0
- package/src/components/nodes/behave/Node.module.css +23 -0
- package/src/components/nodes/behave/Node.tsx +176 -0
- package/src/components/nodes/behave/NodeContainer.module.css +88 -0
- package/src/components/nodes/behave/NodeContainer.tsx +46 -0
- package/src/components/nodes/behave/index.tsx +14 -0
- package/src/components/nodes/group/index.tsx +109 -0
- package/src/components/nodes/wrapper/index.tsx +73 -0
- package/src/components/nodes/wrapper/styles.module.css +87 -0
- package/src/components/notifications/NotificationProvider.tsx +81 -0
- package/src/components/notifications/index.ts +2 -0
- package/src/components/notifications/utils.ts +71 -0
- package/src/components/panels/alignment/index.module.css +10 -0
- package/src/components/panels/alignment/index.tsx +244 -0
- package/src/components/panels/base/index.tsx +5 -0
- package/src/components/panels/base/styles.module.css +12 -0
- package/src/components/panels/common/PanelHeader.module.css +24 -0
- package/src/components/panels/common/PanelHeader.tsx +22 -0
- package/src/components/panels/common/SectionTitle.module.css +13 -0
- package/src/components/panels/common/SectionTitle.tsx +10 -0
- package/src/components/panels/events/EditEventPanel.tsx +324 -0
- package/src/components/panels/events/ManageEventsPanel.tsx +101 -0
- package/src/components/panels/events/index.tsx +23 -0
- package/src/components/panels/events/styles.module.css +178 -0
- package/src/components/panels/graphProperties/index.tsx +125 -0
- package/src/components/panels/history/index.tsx +92 -0
- package/src/components/panels/history/styles.module.css +97 -0
- package/src/components/panels/keymaps/index.module.css +68 -0
- package/src/components/panels/keymaps/index.tsx +166 -0
- package/src/components/panels/layers/index.tsx +245 -0
- package/src/components/panels/layers/styles.module.css +107 -0
- package/src/components/panels/legend/index.module.css +6 -0
- package/src/components/panels/legend/index.tsx +76 -0
- package/src/components/panels/logs/index.module.css +218 -0
- package/src/components/panels/logs/index.tsx +288 -0
- package/src/components/panels/nodeInputs/InputControl.tsx +63 -0
- package/src/components/panels/nodeInputs/InputsGroup.tsx +65 -0
- package/src/components/panels/nodeInputs/MultipleNodesView.tsx +37 -0
- package/src/components/panels/nodeInputs/NodeSettings.tsx +92 -0
- package/src/components/panels/nodeInputs/NodeTitleEditor.tsx +125 -0
- package/src/components/panels/nodeInputs/OutputsGroup.tsx +55 -0
- package/src/components/panels/nodeInputs/SocketGenerators.tsx +32 -0
- package/src/components/panels/nodeInputs/index.module.css +308 -0
- package/src/components/panels/nodeInputs/index.tsx +349 -0
- package/src/components/panels/nodeInputs/useNodeHandlers.ts +76 -0
- package/src/components/panels/nodeInputs/useNodeInputsData.ts +153 -0
- package/src/components/panels/nodePicker/index.tsx +115 -0
- package/src/components/panels/panel/index.module.css +66 -0
- package/src/components/panels/panel/index.tsx +88 -0
- package/src/components/panels/search/index.module.css +16 -0
- package/src/components/panels/search/index.tsx +215 -0
- package/src/components/panels/systemSettings/ConversionsSettings.tsx +203 -0
- package/src/components/panels/systemSettings/index.tsx +251 -0
- package/src/components/panels/systemSettings/styles.module.css +138 -0
- package/src/components/panels/traces/GridLines.tsx +38 -0
- package/src/components/panels/traces/TimeGrid.tsx +48 -0
- package/src/components/panels/traces/TraceLane.tsx +62 -0
- package/src/components/panels/traces/TraceTooltip.tsx +22 -0
- package/src/components/panels/traces/TracesHeader.tsx +56 -0
- package/src/components/panels/traces/index.module.css +159 -0
- package/src/components/panels/traces/index.tsx +298 -0
- package/src/components/panels/traces/types.ts +48 -0
- package/src/components/panels/traces/useDerivedSpans.ts +307 -0
- package/src/components/panels/traces/utils.ts +33 -0
- package/src/components/panels/variables/CreateVariableScreen.tsx +162 -0
- package/src/components/panels/variables/ManageVariablesScreen.tsx +147 -0
- package/src/components/panels/variables/index.tsx +125 -0
- package/src/components/panels/variables/styles.module.css +149 -0
- package/src/components/primitives/icon.module.css +45 -0
- package/src/components/primitives/icon.tsx +38 -0
- package/src/components/sockets/input/index.tsx +83 -0
- package/src/components/sockets/input/styles.module.css +26 -0
- package/src/components/sockets/output/index.tsx +68 -0
- package/src/components/sockets/output/styles.module.css +22 -0
- package/src/css/notes.css +135 -0
- package/src/css/prosemirror.css +57 -0
- package/src/css/rc-dock.css +212 -0
- package/src/css/rc-menu.css +101 -0
- package/src/css/themes/kiberon.css +127 -0
- package/src/css/vars.css +198 -0
- package/src/css/vscode-elements.css +124 -0
- package/src/entry.css +4 -0
- package/src/generators/CallSubgraphGenerator.tsx +136 -0
- package/src/generators/CustomEventOnTriggeredGenerator.tsx +85 -0
- package/src/generators/GraphBoundaryGenerator.module.css +32 -0
- package/src/generators/GraphBoundaryGenerator.tsx +193 -0
- package/src/generators/SequenceGenerator.tsx +104 -0
- package/src/generators/SwitchOnIntegerGenerator.tsx +256 -0
- package/src/generators/SwitchOnStringGenerator.tsx +263 -0
- package/src/generators/callSubgraphSync.ts +126 -0
- package/src/generators/registerDefaultGenerators.ts +55 -0
- package/src/generators/registerDefaults.ts +26 -0
- package/src/hooks/useBehaveGraphFlow.ts +17 -16
- package/src/hooks/useFlowHandlers.ts +154 -30
- package/src/hooks/useWasdPan.ts +210 -0
- package/src/index.css +134 -0
- package/src/index.ts +53 -18
- package/src/manifest/contributionRegistry.ts +93 -0
- package/src/manifest/index.ts +4 -0
- package/src/manifest/loadManifest.ts +82 -0
- package/src/manifest/manifestPlugin.ts +29 -0
- package/src/manifest/passthroughValueType.ts +40 -0
- package/src/plugin/alignment/index.ts +91 -0
- package/src/plugin/autosave/controller.ts +366 -0
- package/src/plugin/autosave/index.tsx +114 -0
- package/src/plugin/autosave/panel/BackupPanel.tsx +141 -0
- package/src/plugin/autosave/panel/index.tsx +1 -0
- package/src/plugin/autosave/panel/styles.module.css +56 -0
- package/src/plugin/autosave/settings.ts +65 -0
- package/src/plugin/autosave/storage.ts +147 -0
- package/src/plugin/docs/index.tsx +297 -0
- package/src/plugin/docs/panel/DocumentationBrowserPanelImpl.tsx +200 -0
- package/src/plugin/docs/panel/index.tsx +21 -0
- package/src/plugin/docs/panel/styles.module.css +174 -0
- package/src/plugin/graphrunner/actions.ts +326 -0
- package/src/plugin/graphrunner/buttons.tsx +95 -0
- package/src/plugin/graphrunner/client.ts +707 -0
- package/src/plugin/graphrunner/index.tsx +184 -0
- package/src/plugin/graphrunner/panel.tsx +386 -0
- package/src/plugin/graphrunner/runController.ts +283 -0
- package/src/plugin/graphrunner/runner.ts +187 -0
- package/src/plugin/graphrunner/session.ts +243 -0
- package/src/plugin/graphrunner/store.ts +196 -0
- package/src/plugin/graphrunner/styles.module.css +171 -0
- package/src/plugin/graphrunner/transport.ts +250 -0
- package/src/plugin/graphrunner/types.ts +693 -0
- package/src/plugin/graphrunner-local/execution-utils.ts +637 -0
- package/src/plugin/graphrunner-local/index.tsx +172 -0
- package/src/plugin/graphrunner-local/panel.tsx +187 -0
- package/src/plugin/graphrunner-local/store.ts +41 -0
- package/src/plugin/graphrunner-local/styles.module.css +82 -0
- package/src/plugin/graphrunner-local/transport.ts +1339 -0
- package/src/plugin/graphrunner-local/types.ts +10 -0
- package/src/plugin/graphrunner-webworker/graph-executor.worker.ts +635 -0
- package/src/plugin/graphrunner-webworker/index.tsx +140 -0
- package/src/plugin/graphrunner-webworker/panel.tsx +173 -0
- package/src/plugin/graphrunner-webworker/store.ts +98 -0
- package/src/plugin/graphrunner-webworker/worker-transport.ts +123 -0
- package/src/plugin/kitchen-sink/index.ts +38 -0
- package/src/plugin/layout/dagre.ts +131 -0
- package/src/plugin/layout/elk.ts +216 -0
- package/src/plugin/layout/index.ts +80 -0
- package/src/plugin/notes/FormatToolbar.tsx +200 -0
- package/src/plugin/notes/index.tsx +191 -0
- package/src/plugin/notes/nodeActions.ts +100 -0
- package/src/plugin/notes/note.tsx +20 -0
- package/src/plugin/notes/noteImpl.tsx +89 -0
- package/src/plugin/realtime/realtimeRunner.ts +624 -0
- package/src/specifics/CustomEventOnTriggeredSpecific.tsx +92 -0
- package/src/specifics/CustomEventTriggerSpecific.tsx +141 -0
- package/src/specifics/VariableGetSpecific.tsx +110 -0
- package/src/specifics/VariableSetSpecific.tsx +110 -0
- package/src/store/actions.tsx +698 -0
- package/src/store/commands.ts +278 -0
- package/src/store/contextMenu.ts +192 -0
- package/src/store/controls.tsx +62 -0
- package/src/store/conversions.ts +47 -0
- package/src/store/documentation.tsx +69 -0
- package/src/store/events.tsx +116 -0
- package/src/store/flow.tsx +230 -0
- package/src/store/graphMeta.ts +39 -0
- package/src/store/hotKeys.tsx +364 -0
- package/src/store/layers.ts +259 -0
- package/src/store/legend.tsx +76 -0
- package/src/store/logs.ts +28 -0
- package/src/store/menubar.ts +41 -0
- package/src/store/refs.ts +84 -0
- package/src/store/registry.ts +51 -0
- package/src/store/selection.ts +22 -0
- package/src/store/settings.ts +99 -0
- package/src/store/settingsSchema.ts +210 -0
- package/src/store/socketGenerator.tsx +54 -0
- package/src/store/specific.tsx +75 -0
- package/src/store/specs.tsx +35 -0
- package/src/store/tabs.ts +282 -0
- package/src/store/toolbar.tsx +45 -0
- package/src/store/traces.ts +240 -0
- package/src/store/variables.ts +37 -0
- package/src/system/graph.ts +131 -0
- package/src/system/graphSession.ts +172 -0
- package/src/system/index.ts +6 -0
- package/src/system/notifications.ts +111 -0
- package/src/system/persistence.ts +82 -0
- package/src/system/plugin.ts +55 -0
- package/src/system/provider.tsx +86 -0
- package/src/system/pubsub.ts +323 -0
- package/src/system/system.ts +653 -0
- package/src/system/tabLoader.tsx +303 -0
- package/src/system/undoRedo.ts +103 -0
- package/src/transformers/Uigraph.ts +61 -0
- package/src/transformers/behaveToFlow.ts +16 -4
- package/src/transformers/contract.ts +87 -0
- package/src/transformers/flowToBehave.ts +40 -12
- package/src/types/NodeMetadata.ts +27 -0
- package/src/types/graph.ts +49 -0
- package/src/types/nodes.ts +50 -0
- package/src/types.ts +18 -0
- package/src/util/autoConvert.ts +200 -0
- package/src/util/colors.ts +1 -29
- package/src/util/downloadJson.ts +18 -0
- package/src/util/extractNodeMetadata.ts +16 -0
- package/src/util/getPickerFilters.ts +1 -1
- package/src/util/isBehaveNode.ts +6 -0
- package/src/util/isValidConnection.ts +51 -17
- package/src/util/mergeSockets.ts +29 -0
- package/src/util/serializeVariables.ts +66 -0
- package/src/util/sockets.ts +43 -0
- package/stories/apex/layoutController/example-graph.worker.ts +39 -0
- package/stories/apex/layoutController/index.stories.tsx +48 -0
- package/stories/apex/layoutController/webworker.stories.tsx +103 -0
- package/stories/apex/menubar/menubar.stories.tsx +19 -0
- package/stories/components/colorpicker/index.stories.tsx +20 -0
- package/stories/components/contextMenus/edge.stories.tsx +32 -0
- package/stories/components/contextMenus/node.stories.tsx +26 -0
- package/stories/components/contextMenus/nodePicker.stories.tsx +115 -0
- package/stories/components/controls/any/index.stories.tsx +19 -0
- package/stories/components/controls/boolean/index.stories.tsx +19 -0
- package/stories/components/controls/colorPicker/index.stories.tsx +49 -0
- package/stories/components/controls/number/index.stories.tsx +19 -0
- package/stories/components/controls/string/index.stories.tsx +19 -0
- package/stories/components/nodes/behaveNode.stories.tsx +108 -0
- package/stories/components/panels/alignment.stories.tsx +24 -0
- package/stories/components/panels/events.stories.tsx +38 -0
- package/stories/components/panels/graphRunner.stories.tsx +317 -0
- package/stories/components/panels/history.stories.tsx +37 -0
- package/stories/components/panels/keymaps.stories.tsx +21 -0
- package/stories/components/panels/legend.stories.tsx +37 -0
- package/stories/components/panels/logs.stories.tsx +24 -0
- package/stories/components/panels/nodeInputs.stories.tsx +21 -0
- package/stories/components/panels/nodePicker.stories.tsx +37 -0
- package/stories/components/panels/panel.stories.tsx +39 -0
- package/stories/components/panels/search.stories.tsx +24 -0
- package/stories/components/panels/systemSettings.stories.tsx +26 -0
- package/stories/components/panels/traces.stories.tsx +225 -0
- package/stories/components/panels/variables.stories.tsx +24 -0
- package/stories/defaults/defaultStoryProvider.tsx +170 -0
- package/stories/defaults/systemGenerator.ts +43 -0
- package/stories/plugins/notes.stories.tsx +100 -0
- package/tests/autoConvert.test.ts +329 -0
- package/tests/autosavePlugin.test.ts +204 -0
- package/tests/callSubgraphSync.test.ts +148 -0
- package/tests/commandRegistry.test.ts +137 -0
- package/tests/components/edges/offsetBezier.test.ts +51 -0
- package/tests/components/layoutController/utils.test.ts +68 -0
- package/tests/components/panels/traces/utils.test.ts +52 -0
- package/tests/contract.test.ts +51 -0
- package/tests/contractSerialize.test.ts +62 -0
- package/tests/deriveSpans.test.ts +71 -0
- package/tests/flowToBehave.test.ts +27 -4
- package/tests/hotkeys.test.ts +79 -0
- package/tests/keepAliveLifecycle.test.ts +167 -0
- package/tests/loadManifest.test.ts +113 -0
- package/tests/noteMarkdown.test.ts +65 -0
- package/tests/notesPlugin.test.ts +162 -0
- package/tests/notifications.test.ts +87 -0
- package/tests/persistence.test.ts +51 -0
- package/tests/saveLoad.test.ts +373 -0
- package/tests/settings.test.ts +178 -0
- package/tests/traceStore.test.ts +46 -0
- package/tests/util/calculateNewEdge.test.ts +98 -0
- package/tests/util/getSocketsByNodeTypeAndHandleType.test.ts +31 -0
- package/tests/util/hasPositionMetaData.test.ts +33 -0
- package/tests/util/isBehaveNode.test.ts +22 -0
- package/tests/util/isHandleConnected.test.ts +37 -0
- package/tests/util/mergeSockets.test.ts +43 -0
- package/tests/visual/README.md +64 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-alignment-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-conversation-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-events-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-history-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-keymaps-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-layers-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-legend-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-localGraphRunner-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-logs-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-nodeInputs-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-nodePicker-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-panel-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-search-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-systemSettings-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-traces-chromium-win32.png +0 -0
- package/tests/visual/__screenshots__/panels.visual.test.tsx/panel-variables-chromium-win32.png +0 -0
- package/tests/visual/panels.visual.test.tsx +76 -0
- package/tests/wasdPan.test.ts +71 -0
- package/tsconfig.base.json +39 -0
- package/tsconfig.json +18 -59
- package/tsconfig.prod.json +23 -0
- package/tsdown.config.ts +15 -3
- package/typedoc.json +7 -7
- package/vite.config.js +7 -0
- package/vitest.config.ts +5 -2
- package/vitest.visual.config.ts +55 -0
- package/src/components/AutoSizeInput.tsx +0 -65
- package/src/components/Controls.tsx +0 -87
- package/src/components/InputSocket.tsx +0 -142
- package/src/components/Node.tsx +0 -68
- package/src/components/NodeContainer.tsx +0 -46
- package/src/components/NodePicker.tsx +0 -77
- package/src/components/OutputSocket.tsx +0 -58
- package/src/components/modals/ClearModal.tsx +0 -40
- package/src/components/modals/HelpModal.tsx +0 -36
- package/src/components/modals/LoadModal.tsx +0 -96
- package/src/components/modals/Modal.tsx +0 -64
- package/src/components/modals/SaveModal.tsx +0 -60
- package/src/hooks/useCustomNodeTypes.tsx +0 -31
- package/src/hooks/useGraphRunner.ts +0 -104
- package/src/hooks/useMergeMap.ts +0 -14
- package/src/hooks/useNodeSpecJson.ts +0 -20
- package/src/hooks/useQueriableDefinitions.ts +0 -22
- package/src/styles.css +0 -8
- package/tailwind.config.ts +0 -19
- package/tests/tsconfig.json +0 -10
- /package/src/{types.d.ts → types-declarations.d.ts} +0 -0
package/.fallowrc.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
|
|
3
|
+
"entry": [
|
|
4
|
+
"src/index.ts"
|
|
5
|
+
],
|
|
6
|
+
"ignorePatterns": [
|
|
7
|
+
"**/*.generated.ts",
|
|
8
|
+
"**/dist/**",
|
|
9
|
+
"**/tests/**"
|
|
10
|
+
],
|
|
11
|
+
"rules": {
|
|
12
|
+
"unused-files": "error",
|
|
13
|
+
"unused-exports": "warn",
|
|
14
|
+
"unused-types": "off"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { loadEnv } from 'vite';
|
|
2
|
+
import type { StorybookConfig } from '@storybook/react-vite';
|
|
3
|
+
|
|
4
|
+
const config: StorybookConfig = {
|
|
5
|
+
stories: [
|
|
6
|
+
'../stories/**/*.mdx',
|
|
7
|
+
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'
|
|
8
|
+
],
|
|
9
|
+
addons: [
|
|
10
|
+
'@storybook/addon-docs',
|
|
11
|
+
'@storybook/addon-a11y',
|
|
12
|
+
'@storybook/addon-vitest'
|
|
13
|
+
],
|
|
14
|
+
framework: {
|
|
15
|
+
name: '@storybook/react-vite',
|
|
16
|
+
options: {}
|
|
17
|
+
},
|
|
18
|
+
viteFinal(config) {
|
|
19
|
+
const env = loadEnv(config.mode ?? 'development', process.cwd(), 'VITE_');
|
|
20
|
+
config.define = {
|
|
21
|
+
...config.define,
|
|
22
|
+
...Object.fromEntries(
|
|
23
|
+
Object.entries(env).map(([k, v]) => [
|
|
24
|
+
`import.meta.env.${k}`,
|
|
25
|
+
JSON.stringify(v)
|
|
26
|
+
])
|
|
27
|
+
)
|
|
28
|
+
};
|
|
29
|
+
return config;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export default config;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Preview, Decorator } from '@storybook/react-vite';
|
|
2
|
+
import { themes } from 'storybook/theming';
|
|
3
|
+
import '../src/index.css';
|
|
4
|
+
import './styles.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Apply the selected editor theme by setting `data-flow-theme` on the preview
|
|
8
|
+
* <html>. The design system's `--ds-*` tokens cascade from there, so this
|
|
9
|
+
* re-skins every story. `default` removes the attribute (built-in look); any
|
|
10
|
+
* other value matches a scoped theme in src/css/themes/ (e.g. `kiberon`).
|
|
11
|
+
*/
|
|
12
|
+
const withFlowTheme: Decorator = (Story, context) => {
|
|
13
|
+
const theme = context.globals.flowTheme as string | undefined;
|
|
14
|
+
if (typeof document !== 'undefined') {
|
|
15
|
+
const root = document.documentElement;
|
|
16
|
+
if (theme && theme !== 'default') {
|
|
17
|
+
root.setAttribute('data-flow-theme', theme);
|
|
18
|
+
} else {
|
|
19
|
+
root.removeAttribute('data-flow-theme');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return Story();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const preview: Preview = {
|
|
26
|
+
decorators: [withFlowTheme],
|
|
27
|
+
globalTypes: {
|
|
28
|
+
flowTheme: {
|
|
29
|
+
description: 'Editor design-system theme',
|
|
30
|
+
toolbar: {
|
|
31
|
+
title: 'Theme',
|
|
32
|
+
icon: 'paintbrush',
|
|
33
|
+
items: [
|
|
34
|
+
{ value: 'default', title: 'Default (VS Code-style)' },
|
|
35
|
+
{ value: 'kiberon', title: 'Kiberon Labs' }
|
|
36
|
+
],
|
|
37
|
+
dynamicTitle: true
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
parameters: {
|
|
42
|
+
docs: {
|
|
43
|
+
theme: themes.dark
|
|
44
|
+
},
|
|
45
|
+
backgrounds: {
|
|
46
|
+
options: {
|
|
47
|
+
dark: { name: 'Dark', value: '#1f1f1f' },
|
|
48
|
+
light: { name: 'Light', value: '#ffffff' }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
controls: {
|
|
52
|
+
matchers: {
|
|
53
|
+
color: /(background|color)$/i,
|
|
54
|
+
date: /Date$/i
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
initialGlobals: {
|
|
59
|
+
backgrounds: { value: 'dark' },
|
|
60
|
+
flowTheme: 'default'
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default preview;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* Dark canvas by default, matching the editor theme used by the components.
|
|
2
|
+
Colors resolve through the design system's `--ds-*` bridge layer (defined in
|
|
3
|
+
src/css/vars.css, imported via src/index.css before this file). */
|
|
4
|
+
body.sb-show-main {
|
|
5
|
+
background-color: var(--ds-editor-bg) !important;
|
|
6
|
+
color: var(--ds-editor-fg);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
#storybook-root {
|
|
10
|
+
padding: 0 !important;
|
|
11
|
+
font-family: var(--ds-font-mono) !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.h-dvh {
|
|
15
|
+
height: 100dvh !important;
|
|
16
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
> @kiberon-labs/behave-graph-flow@3.0.0 build /home/runner/work/behave-graph/behave-graph/packages/flow
|
|
3
|
+
> tsdown
|
|
4
|
+
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.16.5[22m powered by rolldown [2mv1.0.0-beta.50[22m
|
|
6
|
+
[34mℹ[39m Using tsdown config: [4m/home/runner/work/behave-graph/behave-graph/packages/flow/tsdown.config.ts[24m
|
|
7
|
+
[34mℹ[39m Build start
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
# @kiberon-labs/behave-graph-flow
|
|
2
|
+
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- cf72d27: Multiple graph tabs, subgraphs, auto-convert, and persisted editor settings.
|
|
8
|
+
|
|
9
|
+
## `@kiberon-labs/behave-graph-flow`
|
|
10
|
+
|
|
11
|
+
### Multiple isolated graphs
|
|
12
|
+
|
|
13
|
+
- Split the single `System` god-object into an editor-level system (shared:
|
|
14
|
+
settings, registry, specs, menubar, tabs, conversions, …) and a per-graph
|
|
15
|
+
`GraphSession` (nodes, edges, variables, selection, traces, layers, logs, undo,
|
|
16
|
+
a private pubsub). Pubsub split into `EditorPubSys` / `GraphPubSys`.
|
|
17
|
+
- New providers/hooks: `GraphProvider`/`useGraph`, `useActiveGraph`, `useEditor`.
|
|
18
|
+
- Multiple graph tabs can be open at once (`graph:<id>` tabs), each fully
|
|
19
|
+
isolated; panels follow the focused graph. New/close graph actions; sessions
|
|
20
|
+
are created/disposed with their tabs.
|
|
21
|
+
- **Breaking:** per-graph store factories and the transformers `flowToBehave`
|
|
22
|
+
and `buildUIGraphJSON` now take a `GraphSession` instead of `System`.
|
|
23
|
+
|
|
24
|
+
### Per-session execution
|
|
25
|
+
|
|
26
|
+
- Execution is per-graph: a shared `GraphRunner` connection plus a per-session
|
|
27
|
+
`GraphRunController`; server messages are routed back to the originating graph
|
|
28
|
+
by run id, so multiple graphs run independently. Run controls live in each
|
|
29
|
+
graph's toolbar.
|
|
30
|
+
|
|
31
|
+
### Subgraphs (graph invokes graph)
|
|
32
|
+
|
|
33
|
+
- New `Call Subgraph` node plus `graph/input` / `graph/output` boundary nodes; a
|
|
34
|
+
graph's contract (`graphInputs`/`graphOutputs`) is authored from the boundary
|
|
35
|
+
nodes and serialized.
|
|
36
|
+
- Subgraph output (and input) socket display names are editable without breaking
|
|
37
|
+
wiring (stable id + display label).
|
|
38
|
+
|
|
39
|
+
### Auto-convert transformer
|
|
40
|
+
|
|
41
|
+
- When connecting different-but-convertible value types (with the auto-convert
|
|
42
|
+
setting on), a conversion node is automatically spliced in. Conversions are a
|
|
43
|
+
configurable registry (`registerConversion`, edited in System Settings) that
|
|
44
|
+
overrides a generic spec-derived default, so custom profiles can define their
|
|
45
|
+
own.
|
|
46
|
+
|
|
47
|
+
### Graph & editor properties
|
|
48
|
+
|
|
49
|
+
- New Graph Properties panel for the graph name (reactive tab title) + arbitrary
|
|
50
|
+
graph metadata.
|
|
51
|
+
- Editor settings (UI toggles + custom conversions) are serializable via
|
|
52
|
+
`serializeSettings()` / `applySettings()` and persist through
|
|
53
|
+
`enableSettingsPersistence()` (pluggable storage; localStorage by default).
|
|
54
|
+
|
|
55
|
+
## `@kiberon-labs/behave-graph`
|
|
56
|
+
|
|
57
|
+
- Subgraph runtime: `graph/input`, `graph/output`, `flow/callSubgraph` core nodes
|
|
58
|
+
plus `runSubgraph()` and the `IGraphApi` / `ISubgraphRun` dependencies. A
|
|
59
|
+
subgraph behaves like a function — it returns once at the first output, and
|
|
60
|
+
recursion/cycles are guarded by a call-stack + depth limit.
|
|
61
|
+
- `Engine.dispose()` now also clears pending async nodes so execution winds down
|
|
62
|
+
after disposal.
|
|
63
|
+
|
|
64
|
+
### Minor Changes
|
|
65
|
+
|
|
66
|
+
- cf72d27: New AI nodes package (agents, conversations, tools, multimodal), plus the
|
|
67
|
+
realtime-preview and chat-panel plumbing that powers it.
|
|
68
|
+
|
|
69
|
+
## @kiberon-labs/behave-graph-nodes-ai (new package)
|
|
70
|
+
|
|
71
|
+
A node package for building AI agents in the graph, on the [Vercel AI SDK](https://ai-sdk.dev)
|
|
72
|
+
(`ai` + `@ai-sdk/openai` + `@ai-sdk/anthropic`).
|
|
73
|
+
|
|
74
|
+
- **Agents & providers**: `ai/provider` (OpenAI / OpenRouter / custom
|
|
75
|
+
OpenAI-compatible / Anthropic), `ai/agent`, `ai/tool`. `createModel` maps a
|
|
76
|
+
serializable config onto an SDK `LanguageModel`.
|
|
77
|
+
- **Conversation runtime**: `ConversationRuntime` bridges headless graph
|
|
78
|
+
execution to the editor's chat panel via an injected `IConversationService`
|
|
79
|
+
dependency (the same pattern the scene package uses for `IScene`), mirroring
|
|
80
|
+
the focused conversation into `system.chatStore` and driving `streamText`.
|
|
81
|
+
Streaming and the multi-step tool loop are the SDK's job; graph-defined tools
|
|
82
|
+
become SDK tools whose `execute` bridges to `ai/onToolCall` / `ai/toolResult`.
|
|
83
|
+
- **Conversation as a graph value + exploration**: `aiConversation` handles flow
|
|
84
|
+
through sockets. `ai/conversation` + `ai/forkConversation` branch an
|
|
85
|
+
exploration (forks clone history and are independent); `ai/sendMessage` /
|
|
86
|
+
`ai/onMessage` / `ai/setupConversation` take an optional `conversation` input.
|
|
87
|
+
A **Conversations tree panel** (the `conversations` tab) visualizes branches
|
|
88
|
+
and switches focus.
|
|
89
|
+
- **Per-conversation agents**: each branch has its own agent, so you can run the
|
|
90
|
+
same prompt down two branches with two different models; forks inherit the
|
|
91
|
+
parent's agent and the chat panel follows the focused branch.
|
|
92
|
+
- **Multimodal**: `ai/generateImage` emits an `image` value into the graph
|
|
93
|
+
(visualized via the image package's preview / Image Output panel,
|
|
94
|
+
name-coupled); `ai/sendMessage` takes an optional `image` input for vision.
|
|
95
|
+
- **Credential injection (no keys in the graph)**: the `ai/provider` node carries
|
|
96
|
+
only a non-secret `credentialRef`; the host resolves it to a real key at the
|
|
97
|
+
API-call boundary via an injected `IAICredentials` dependency. Keys never live
|
|
98
|
+
in node params or saved graph JSON.
|
|
99
|
+
|
|
100
|
+
## @kiberon-labs/behave-graph-flow
|
|
101
|
+
|
|
102
|
+
- **Realtime preview runner**: evaluate every _watched_ node output (pull the
|
|
103
|
+
upstream function graph on demand), so live previews work for pure data graphs
|
|
104
|
+
(e.g. image nodes) that no flow fiber drives. Previously only nodes carrying a
|
|
105
|
+
`ui.realtime` annotation , which nothing set , were computed.
|
|
106
|
+
- **Registry**: `updateRegistry` now merges node specs by type instead of
|
|
107
|
+
replacing them, so layering multiple profiles/plugins (core + image + ai + …)
|
|
108
|
+
no longer clobbers previously-registered node types.
|
|
109
|
+
- **Conversation panel / chat store**: a `chat:userMessage` editor pubsub topic
|
|
110
|
+
(fixing a standing type error), and a `ChatAttachment` / `attachments` field on
|
|
111
|
+
chat messages with the `ConversationPanel` rendering image thumbnails , so a
|
|
112
|
+
host AI subsystem can drive a multimodal chat.
|
|
113
|
+
|
|
114
|
+
## @kiberon-labs/behave-graph-nodes-image
|
|
115
|
+
|
|
116
|
+
- The image plugin now builds an execution registry for the realtime preview
|
|
117
|
+
runner (accepting an optional `registry`), so inline node previews and the
|
|
118
|
+
Image Output panel actually render. Previously the runner had no registry and
|
|
119
|
+
never built an engine.
|
|
120
|
+
- The inline preview matches any node with an `image` output socket (value-type
|
|
121
|
+
coupling) instead of only `image/*` node types, so image-producing nodes from
|
|
122
|
+
other packages (e.g. `ai/generateImage`) get the inline preview for free.
|
|
123
|
+
|
|
124
|
+
- cf72d27: Abstract the editor's design system behind an intermediary `--ds-*` token layer
|
|
125
|
+
so theming no longer hard-codes VS Code variables.
|
|
126
|
+
|
|
127
|
+
- `css/vars.css` now defines a `--ds-*` "theme bridge" (canonical VS Code-dark
|
|
128
|
+
defaults), and the semantic tokens (`--colors-*`, `--color-neutral-*`, …)
|
|
129
|
+
resolve through it. Components reference `--ds-*` only — the ~283 raw
|
|
130
|
+
`var(--vscode-*)` references across the component CSS were migrated, and the
|
|
131
|
+
bundled `css/vscode.css` defaults file was removed.
|
|
132
|
+
- VS Code coupling now lives in a single mapping the host owns: the extension
|
|
133
|
+
re-declares the `--ds-*` layer as `var(--vscode-*, …)`, so the editor still
|
|
134
|
+
tracks the user's active VS Code theme. (The lone remaining `--vscode-*`
|
|
135
|
+
reference in the components is `--vscode-tree-item-padding`, a
|
|
136
|
+
`@vscode-elements` component API var, not a theme token.)
|
|
137
|
+
|
|
138
|
+
Migration note for VS Code webview hosts: map the editor's `--ds-*` tokens from
|
|
139
|
+
`--vscode-*` in a small `:root` rule so the chrome follows the active VS Code
|
|
140
|
+
theme. Standalone hosts (web, Storybook, tests) need no setup — they get the
|
|
141
|
+
canonical dark defaults.
|
|
142
|
+
|
|
143
|
+
- cf72d27: Editor extensibility (plugin registries + session extensions), runner
|
|
144
|
+
consolidation, declarative config, reactivity/trace fixes, and a UI polish pass.
|
|
145
|
+
|
|
146
|
+
## Plugin & extension system
|
|
147
|
+
|
|
148
|
+
- **Session extensions** for per-graph state: `system.registerSessionExtension`
|
|
149
|
+
runs against every graph (existing + future) and may return a cleanup;
|
|
150
|
+
`GraphSession.onDispose()` and a typed `decorate()` (augment `IGraphSession`)
|
|
151
|
+
attach plugin-owned per-graph state. The graph runner's per-session
|
|
152
|
+
`runController` now attaches through this hook, so core no longer depends on the
|
|
153
|
+
runner plugin.
|
|
154
|
+
- **Command registry**: `system.commandStore` + `system.runCommand(id, ctx?)`
|
|
155
|
+
with built-in editor/view/selection commands. Hotkeys, the menu bar and context
|
|
156
|
+
menus all dispatch by command id (one implementation, many entry points). Fixes
|
|
157
|
+
the previously no-op Edit ▸ Copy/Paste menu items.
|
|
158
|
+
- **Context-menu registry**: `system.contextMenuStore` (targets `node` / `edge` /
|
|
159
|
+
`selection` / `pane`); the built-in menus are migrated onto it so hosts can
|
|
160
|
+
add/override items by id.
|
|
161
|
+
- **`registerDefaults(system)`** (idempotent) bootstraps built-in content
|
|
162
|
+
(default socket generators + the subgraph contract sync); fixes a latent
|
|
163
|
+
double-registration when multiple graph tabs were open.
|
|
164
|
+
- The **web-worker graph runner** plugin (`webWorkerGraphRunnerPlugin` /
|
|
165
|
+
`WorkerTransport`) is now exported from the package root.
|
|
166
|
+
|
|
167
|
+
## Runner consolidation
|
|
168
|
+
|
|
169
|
+
- New `IExecutionControl` capability interface (+ `supportsExecutionControl`
|
|
170
|
+
guard) for pause/resume/step; `LocalTransport` implements it and the run
|
|
171
|
+
controller uses it instead of reaching into transport internals.
|
|
172
|
+
- The local transport now reuses the shared execution utilities (tracing,
|
|
173
|
+
registry preparation, the `ActiveRun` shape) rather than duplicating them,
|
|
174
|
+
removing drift between the local and web-worker runners.
|
|
175
|
+
|
|
176
|
+
## Declarative configuration
|
|
177
|
+
|
|
178
|
+
- The editor settings store is derived from a single schema (state, setters and
|
|
179
|
+
the persisted-key list). Fixes: `inlineValues` now round-trips on load and
|
|
180
|
+
`setShowMenu` is properly typed.
|
|
181
|
+
- Hotkeys are defined by one declarative binding table that dispatches commands;
|
|
182
|
+
fixes the `ZOOM_RESET` (Ctrl+0) keymap/handler mismatch and makes Toggle
|
|
183
|
+
Minimap work.
|
|
184
|
+
|
|
185
|
+
## Auto-convert
|
|
186
|
+
|
|
187
|
+
- Conversion rules can pin the converter node's input/output **ports**
|
|
188
|
+
(`inputKey` / `outputKey`), with type-aware port resolution for multi-port
|
|
189
|
+
converters and matching port pickers in the System Settings editor.
|
|
190
|
+
|
|
191
|
+
## Call Subgraph reactivity
|
|
192
|
+
|
|
193
|
+
- Call Subgraph nodes stay in sync with their referenced graph's contract:
|
|
194
|
+
adding, removing, renaming or retyping a subgraph input/output now propagates to
|
|
195
|
+
every caller across open graphs without re-selecting the graph.
|
|
196
|
+
|
|
197
|
+
## Trace panel fixes (web-worker runner)
|
|
198
|
+
|
|
199
|
+
- Fixed duplicate spans (double client-listener registration), incorrect/huge
|
|
200
|
+
timeline timestamps (relative tick labels; preserve `0` start times), invisible
|
|
201
|
+
zero-duration spans (minimum visual length), and the inability to zoom out past
|
|
202
|
+
the captured range.
|
|
203
|
+
|
|
204
|
+
## Editor UI
|
|
205
|
+
|
|
206
|
+
- A VS Code-style density/theming pass: shared compact section headers across
|
|
207
|
+
panels, tighter node/socket density, floating toolbar and menus re-themed to
|
|
208
|
+
`--vscode-*` tokens, a fixed (oversized) dock resize divider, settings-panel and
|
|
209
|
+
Node Inputs cleanup, consistent Variables/Events headers, consolidated design
|
|
210
|
+
tokens with the vscode theme backfilled, and Storybook defaulting to dark mode.
|
|
211
|
+
|
|
212
|
+
- cf72d27: Add a Kiberon Labs theme — an opt-in alternate theme for the editor.
|
|
213
|
+
|
|
214
|
+
- `css/themes/kiberon.css` re-declares the `--ds-*` bridge with the Kiberon Labs
|
|
215
|
+
design tokens (dark, brand-canonical): crystal-purple accents, Geist type, and
|
|
216
|
+
the brand surfaces/shadows. It is scoped (`[data-flow-theme="kiberon"]` /
|
|
217
|
+
`.flow-theme-kiberon`) and ships inert in the bundle, so it coexists with the
|
|
218
|
+
built-in theme rather than replacing it.
|
|
219
|
+
- Graph node category accents are now themeable tokens (`--ds-node-*`); the
|
|
220
|
+
Kiberon theme recolors them to the crystal palette and rounds the node corners.
|
|
221
|
+
- A Storybook toolbar **Theme** toggle switches Default ↔ Kiberon for previewing.
|
|
222
|
+
|
|
223
|
+
Activate by putting `data-flow-theme="kiberon"` (or `class="flow-theme-kiberon"`)
|
|
224
|
+
on the editor's root container or `<html>`. Fonts fall back gracefully when Geist
|
|
225
|
+
isn't loaded by the host.
|
|
226
|
+
|
|
227
|
+
- cf72d27: Static package-manifest system: let editors and tooling discover the nodes,
|
|
228
|
+
value types, UI contributions and host requirements a package provides
|
|
229
|
+
**without importing or executing the package's code**.
|
|
230
|
+
|
|
231
|
+
Previously the only way to learn what a package offered was to call its
|
|
232
|
+
`registerProfile`, which imports and runs every node implementation (closures,
|
|
233
|
+
side effects, even WASM init) — a security and performance cost just to list
|
|
234
|
+
nodes. A manifest is the persisted, on-disk form of the static projection the
|
|
235
|
+
editor already renders from (`NodeSpecJSON` + value display metadata), so the
|
|
236
|
+
executable half (node `exec`, value serializers, React components, a persistent
|
|
237
|
+
backend) is loaded only by a runner or on explicit, trust-gated demand.
|
|
238
|
+
|
|
239
|
+
## `@kiberon-labs/behave-graph`
|
|
240
|
+
|
|
241
|
+
New `Manifest/` module (exported from the package root), all additive:
|
|
242
|
+
|
|
243
|
+
- **Schema** (`ManifestJSON`): function-free `ValueTypeSpecJSON`, `NodeManifestEntry`
|
|
244
|
+
(the existing `NodeSpecJSON` plus optional authoring extras), `ContributionSpec`
|
|
245
|
+
/ `ContributionKind` (control, specific, panel, socketGenerator, conversion,
|
|
246
|
+
command, contextMenu, valueType), open-ended `categories` (`PackageCategory`
|
|
247
|
+
constants are advisory), and `requirements` (`PackageRequirement`, discriminated
|
|
248
|
+
by `kind` with known `backendService` / `config` kinds **plus an open escape
|
|
249
|
+
hatch** so hosts tolerate kinds not yet modelled).
|
|
250
|
+
- **Generation** (build time): `writeManifest` (reuses `writeNodeSpecsToJSON`, so
|
|
251
|
+
node specs are identical to runtime), `writeValueTypesToJSON` (function-free
|
|
252
|
+
display + `serialize(creator())` default), `defineManifestSource` /
|
|
253
|
+
`runManifestSource`, and a `behave-graph-manifest` CLI bin.
|
|
254
|
+
- **Validation**: `parseManifest`, a dependency-free well-formedness gate a host
|
|
255
|
+
runs on an untrusted manifest before consuming it.
|
|
256
|
+
- **Conventions**: `MANIFEST_FILE_NAME` (`behave-graph.manifest.json` — a plain
|
|
257
|
+
`.json` file, the canonical name; a directory `--out` writes it there) and
|
|
258
|
+
`MANIFEST_PACKAGE_FIELD` (`behaveGraph`, the `package.json` field pointing at
|
|
259
|
+
the manifest).
|
|
260
|
+
|
|
261
|
+
## `@kiberon-labs/behave-graph-flow`
|
|
262
|
+
|
|
263
|
+
New `manifest/` module for consuming a manifest in the editor:
|
|
264
|
+
|
|
265
|
+
- `loadManifest` / `manifestPlugin`: always register node specs + value types from
|
|
266
|
+
JSON with **zero code execution** (the palette renders from JSON alone); surface
|
|
267
|
+
declared host requirements via `onRequirement`; and load code contributions
|
|
268
|
+
**only under an explicit `trust` flag + a host-provided `resolve`r** (the host
|
|
269
|
+
owns module resolution because a bundler must know the concrete module). A
|
|
270
|
+
failing contribution is logged and skipped, never aborting the rest.
|
|
271
|
+
- `passthroughValueType`: synthesises a working `ValueTypeMetadata` from a
|
|
272
|
+
function-free spec (identity (de)serialize, cloned default) so existing UI call
|
|
273
|
+
sites keep working until a trusted `valueType` contribution swaps in the real
|
|
274
|
+
implementation.
|
|
275
|
+
- `contributionRegistry`: maps each `ContributionKind` to its editor store.
|
|
276
|
+
|
|
277
|
+
## `@kiberon-labs/behave-graph-nodes-image` and `@kiberon-labs/behave-graph-scene`
|
|
278
|
+
|
|
279
|
+
Both packages now generate a `behave-graph.manifest.json` at build time as
|
|
280
|
+
reference implementations:
|
|
281
|
+
|
|
282
|
+
- A side-effect-light `src/manifest.source.ts` (`defineManifestSource`) declares
|
|
283
|
+
the registry builder, `runtime` entry, category and contributions; the package
|
|
284
|
+
`build` runs `behave-graph-manifest`, and `package.json#behaveGraph.manifest`
|
|
285
|
+
points at the output. Spec generation runs no node code (image needs no WASM
|
|
286
|
+
init; scene is fed a `DummyScene` for `IScene`).
|
|
287
|
+
- **image**: 13 nodes + the `image` value type, with control / specific / panel /
|
|
288
|
+
valueType contributions. `ui.tsx` now re-exports `ImageControl`,
|
|
289
|
+
`imagePreviewSpecific` and an extracted `imageOutputTab` loader so a host can
|
|
290
|
+
resolve them from the manifest.
|
|
291
|
+
- **scene**: ~191 nodes + 8 value types (`vec2`…`mat4`), the `vec3` control and a
|
|
292
|
+
`valueType` contribution per scene type.
|
|
293
|
+
|
|
294
|
+
Also (private packages, no version bump): the VS Code extension gains
|
|
295
|
+
`discoverManifests`, which statically scans `node_modules` for
|
|
296
|
+
`package.json#behaveGraph.manifest` and reads/validates the JSON without importing
|
|
297
|
+
package code; and the documentation site gains a dedicated "Package Manifests"
|
|
298
|
+
section.
|
|
299
|
+
|
|
300
|
+
- cf72d27: Make the Settings panel schema-driven so plugins can contribute their own
|
|
301
|
+
settings, VS Code style.
|
|
302
|
+
|
|
303
|
+
- **Schema registry** (`store/settingsSchema.ts`): the panel is auto-generated
|
|
304
|
+
from `SettingDescriptor`s (`boolean` / `number` / `string` / `enum` / `custom`),
|
|
305
|
+
grouped by section, with a search/filter box and a per-row reset-to-default +
|
|
306
|
+
"modified" indicator. Built-in settings are seeded as descriptors, so the
|
|
307
|
+
rendered panel is unchanged.
|
|
308
|
+
- **Plugin API** on the editor `System`: `registerSetting(descriptor)` /
|
|
309
|
+
`registerSettings([...])` auto-render in the panel; `getSetting` / `setSetting`
|
|
310
|
+
read and write values. Plugin-contributed settings persist alongside the
|
|
311
|
+
built-ins (the host storage adapter is unaffected). Typed access to built-in
|
|
312
|
+
settings (`settings.edgeType`, `settings.setShowGrid`, …) is preserved.
|
|
313
|
+
|
|
314
|
+
Descriptors are plain, JSON-serializable data, so a declarative manifest
|
|
315
|
+
`contributes.configuration` section can feed the same registry as a follow-up.
|
|
316
|
+
|
|
317
|
+
### Patch Changes
|
|
318
|
+
|
|
319
|
+
- cf72d27: Fix the Local Graph Runner staying in a "Running" state after a graph finishes.
|
|
320
|
+
|
|
321
|
+
The local runner's `executeGraph` defaulted `autoEnd` to `true` but gated run
|
|
322
|
+
completion on `!autoEnd`, so the completion path — which marks the run finished,
|
|
323
|
+
emits the `completed` message, disposes the engine, and clears the panel's
|
|
324
|
+
running / active-runs state — never executed. A graph that ran out of fibers
|
|
325
|
+
reached the `completed` phase yet the run stayed `running` and the panel kept
|
|
326
|
+
showing "Running". Completion now fires when the run actually reaches the
|
|
327
|
+
completed phase (and isn't paused), and the manual step-through path syncs the
|
|
328
|
+
panel state on completion too.
|
|
329
|
+
|
|
330
|
+
The local transport kept its own copy of the run lifecycle that had drifted from
|
|
331
|
+
the shared `executeGraphLifecycle` used by the web-worker runner (with inverted
|
|
332
|
+
`autoEnd` logic). Both runners now share that single lifecycle implementation —
|
|
333
|
+
the runner-specific behaviour (pause-aware fiber stepping, tick timing, and the
|
|
334
|
+
on-complete / on-error side effects) is injected via hooks — so the completion
|
|
335
|
+
logic can't drift between them again.
|
|
336
|
+
|
|
337
|
+
- cf72d27: Make `@vscode-elements` controls follow the active theme, and fix a few panel UI
|
|
338
|
+
inconsistencies.
|
|
339
|
+
|
|
340
|
+
- **Themeable vscode-elements**: `css/vscode-elements.css` feeds the `--vscode-*`
|
|
341
|
+
custom properties that `VscodeButton` / `VscodeTextfield` / `VscodeCheckbox` /
|
|
342
|
+
`VscodeSingleSelect` / etc. read from the editor's `--ds-*` tokens, so they
|
|
343
|
+
follow the active theme (e.g. Kiberon purple) instead of falling back to their
|
|
344
|
+
built-in VS Code blue. Native checkbox / range / radio controls pick up the
|
|
345
|
+
theme accent via `accent-color`. (Inert in the real extension, where VS Code's
|
|
346
|
+
injected `--vscode-*` win.)
|
|
347
|
+
- **Menu density**: tighter dropdown menu item padding.
|
|
348
|
+
- **Panel overflow**: vscode-elements form fields cap to their container width,
|
|
349
|
+
fixing horizontal overflow in narrow panels (e.g. Graph Properties).
|
|
350
|
+
- **Checkbox consistency**: the Layers panel's "Visible" checkbox now uses
|
|
351
|
+
`VscodeCheckbox`, matching Settings and the rest of the editor (it was a native
|
|
352
|
+
browser checkbox).
|
|
353
|
+
- **Logs toolbar cleanup**: the toolbar action icons (auto-scroll / timestamps /
|
|
354
|
+
export / clear) are sized to fit their buttons, and the active toggles use a
|
|
355
|
+
boxless accent (solid icon + accent color) instead of a filled outlined box —
|
|
356
|
+
ghost icon buttons throughout.
|
|
357
|
+
- **Local Graph Runner panel** now follows the shared panel conventions
|
|
358
|
+
(`BasePanel` + `SectionTitle` + `VscodeDivider` + the design-system spacing/type
|
|
359
|
+
scale) instead of its own card-style sections and bespoke headers, matching the
|
|
360
|
+
Settings/Logs panels. Also added to the panel visual-regression suite.
|
|
361
|
+
- **Dock tabs**: dropped the bright focus-color top-accent line on the active dock
|
|
362
|
+
tab, which read as a stray-line artifact when repeated across panels. The active
|
|
363
|
+
tab is still set off by its lighter, content-colored background (the VS Code
|
|
364
|
+
look).
|
|
365
|
+
|
|
366
|
+
- Updated dependencies [cf72d27]
|
|
367
|
+
- Updated dependencies [cf72d27]
|
|
368
|
+
- @kiberon-labs/behave-graph@1.2.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Internet Systems Consortium license
|
|
2
|
+
Copyright (c) 2022 behave-graph authors
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
5
|
+
|
|
6
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Behave Flow
|
|
2
|
-
|
|
1
|
+
# Behave Flow
|
|
2
|
+
|
|
3
3
|
This is a set of UI components for making a UI for the behave flow graphs
|