@goplasmatic/dataflow-ui 2.0.4 → 2.0.6
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/README.md +46 -3
- package/dist/index.cjs +547 -77
- package/dist/index.d.ts +44 -1
- package/dist/index.js +547 -77
- package/package.json +5 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
|
+
import { defaultEngineFactory } from './engines';
|
|
2
3
|
import { ErrorInfo as ErrorInfo_2 } from 'react';
|
|
3
4
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
4
5
|
import { LucideIcon } from 'lucide-react';
|
|
5
6
|
import { ReactNode } from 'react';
|
|
6
7
|
import { ReactPortal } from 'react';
|
|
8
|
+
import { WasmEngineAdapter } from './engines';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Audit trail entry for tracking changes (matches Rust AuditTrail)
|
|
@@ -68,6 +70,25 @@ export declare interface ConditionResult {
|
|
|
68
70
|
*/
|
|
69
71
|
export declare function createEmptyMessage(): Message;
|
|
70
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Interface for custom dataflow engines
|
|
75
|
+
*
|
|
76
|
+
* Implement this interface to provide a custom WASM engine for executing
|
|
77
|
+
* workflows with custom functions or plugins.
|
|
78
|
+
*/
|
|
79
|
+
export declare interface DataflowEngine {
|
|
80
|
+
/**
|
|
81
|
+
* Process a payload through the engine and return an execution trace
|
|
82
|
+
* for step-by-step debugging.
|
|
83
|
+
*/
|
|
84
|
+
processWithTrace(payload: Record<string, unknown>): Promise<ExecutionTrace>;
|
|
85
|
+
/**
|
|
86
|
+
* Optional cleanup method called when the engine is no longer needed.
|
|
87
|
+
* Use this to free WASM memory.
|
|
88
|
+
*/
|
|
89
|
+
dispose?(): void;
|
|
90
|
+
}
|
|
91
|
+
|
|
71
92
|
/**
|
|
72
93
|
* Actions for the debugger reducer
|
|
73
94
|
*/
|
|
@@ -126,6 +147,7 @@ declare interface DebuggerContextValue {
|
|
|
126
147
|
stepBackward: () => void;
|
|
127
148
|
goToStep: (index: number) => void;
|
|
128
149
|
setSpeed: (speed: number) => void;
|
|
150
|
+
runExecution: (workflows: Workflow[], payload: Record<string, unknown>) => Promise<ExecutionTrace | null>;
|
|
129
151
|
currentStep: ExecutionStep | null;
|
|
130
152
|
currentMessage: Message | null;
|
|
131
153
|
currentChanges: Change[];
|
|
@@ -134,6 +156,7 @@ declare interface DebuggerContextValue {
|
|
|
134
156
|
hasTrace: boolean;
|
|
135
157
|
progress: number;
|
|
136
158
|
totalSteps: number;
|
|
159
|
+
isEngineReady: boolean;
|
|
137
160
|
}
|
|
138
161
|
|
|
139
162
|
/**
|
|
@@ -151,7 +174,7 @@ declare interface DebuggerControlsProps {
|
|
|
151
174
|
/**
|
|
152
175
|
* Provider component for debugger state
|
|
153
176
|
*/
|
|
154
|
-
export declare function DebuggerProvider({ children, initialPayload, autoActivate, }: DebuggerProviderProps): JSX_2.Element;
|
|
177
|
+
export declare function DebuggerProvider({ children, initialPayload, autoActivate, engineFactory, }: DebuggerProviderProps): JSX_2.Element;
|
|
155
178
|
|
|
156
179
|
declare interface DebuggerProviderProps {
|
|
157
180
|
children: ReactNode;
|
|
@@ -159,6 +182,12 @@ declare interface DebuggerProviderProps {
|
|
|
159
182
|
initialPayload?: Record<string, unknown>;
|
|
160
183
|
/** Auto-start in debug mode */
|
|
161
184
|
autoActivate?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Factory function to create engine instances when workflows change.
|
|
187
|
+
* Called whenever workflows are updated to create a fresh engine.
|
|
188
|
+
* Use this for custom WASM engines with plugins.
|
|
189
|
+
*/
|
|
190
|
+
engineFactory?: EngineFactory;
|
|
162
191
|
}
|
|
163
192
|
|
|
164
193
|
/**
|
|
@@ -215,6 +244,16 @@ declare interface DebugStateBadgeProps {
|
|
|
215
244
|
size?: 'sm' | 'md';
|
|
216
245
|
}
|
|
217
246
|
|
|
247
|
+
export { defaultEngineFactory }
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Factory function type for creating engine instances.
|
|
251
|
+
*
|
|
252
|
+
* Called when workflows change to create a new engine instance
|
|
253
|
+
* configured with the current workflows.
|
|
254
|
+
*/
|
|
255
|
+
export declare type EngineFactory = (workflows: Workflow[]) => DataflowEngine;
|
|
256
|
+
|
|
218
257
|
/**
|
|
219
258
|
* Error boundary component to catch and display errors in child components
|
|
220
259
|
*/
|
|
@@ -658,6 +697,8 @@ export declare interface ValidationRule {
|
|
|
658
697
|
message: string;
|
|
659
698
|
}
|
|
660
699
|
|
|
700
|
+
export { WasmEngineAdapter }
|
|
701
|
+
|
|
661
702
|
/**
|
|
662
703
|
* Workflow definition
|
|
663
704
|
*/
|
|
@@ -670,6 +711,8 @@ export declare interface Workflow {
|
|
|
670
711
|
priority?: number;
|
|
671
712
|
/** Optional description */
|
|
672
713
|
description?: string;
|
|
714
|
+
/** Optional folder path for grouping (e.g., "orders/processing") */
|
|
715
|
+
path?: string;
|
|
673
716
|
/** JSONLogic condition (evaluated against metadata only) */
|
|
674
717
|
condition?: JsonLogicValue;
|
|
675
718
|
/** Tasks in this workflow */
|