@geenius/ai-workflow 0.1.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.
- package/CHANGELOG.md +7 -0
- package/README.md +69 -1
- package/package.json +60 -27
- package/packages/convex/dist/index.d.ts +363 -0
- package/packages/convex/dist/index.js +200 -0
- package/packages/convex/dist/index.js.map +1 -0
- package/packages/react/dist/index.d.ts +466 -0
- package/packages/react/dist/index.js +13914 -0
- package/packages/react/dist/index.js.map +1 -0
- package/packages/react-css/{src/styles.css → dist/index.css} +107 -253
- package/packages/react-css/dist/index.css.map +1 -0
- package/packages/react-css/dist/index.d.ts +495 -0
- package/packages/react-css/dist/index.js +13901 -0
- package/packages/react-css/dist/index.js.map +1 -0
- package/packages/shared/dist/index.d.ts +1368 -0
- package/packages/shared/dist/index.js +1681 -0
- package/packages/shared/dist/index.js.map +1 -0
- package/packages/solidjs/dist/index.d.ts +452 -0
- package/packages/solidjs/dist/index.js +13830 -0
- package/packages/solidjs/dist/index.js.map +1 -0
- package/packages/solidjs-css/{src/styles.css → dist/index.css} +107 -253
- package/packages/solidjs-css/dist/index.css.map +1 -0
- package/packages/solidjs-css/dist/index.d.ts +471 -0
- package/packages/solidjs-css/dist/index.js +13774 -0
- package/packages/solidjs-css/dist/index.js.map +1 -0
- package/.changeset/config.json +0 -11
- package/.github/CODEOWNERS +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -16
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -11
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -10
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/ci.yml +0 -23
- package/.github/workflows/release.yml +0 -29
- package/.nvmrc +0 -1
- package/.project/ACCOUNT.yaml +0 -4
- package/.project/IDEAS.yaml +0 -7
- package/.project/PROJECT.yaml +0 -11
- package/.project/ROADMAP.yaml +0 -15
- package/CODE_OF_CONDUCT.md +0 -16
- package/CONTRIBUTING.md +0 -26
- package/SECURITY.md +0 -15
- package/SUPPORT.md +0 -8
- package/packages/convex/README.md +0 -1
- package/packages/convex/package.json +0 -12
- package/packages/convex/src/convex.config.ts +0 -3
- package/packages/convex/src/index.ts +0 -3
- package/packages/convex/src/mutations.ts +0 -36
- package/packages/convex/src/queries.ts +0 -19
- package/packages/convex/src/schema.ts +0 -24
- package/packages/convex/tsconfig.json +0 -25
- package/packages/react/README.md +0 -1
- package/packages/react/package.json +0 -46
- package/packages/react/src/components/ApprovalModal.tsx +0 -47
- package/packages/react/src/components/StepConfigPanel.tsx +0 -67
- package/packages/react/src/components/StepConnector.tsx +0 -47
- package/packages/react/src/components/StepNode.tsx +0 -38
- package/packages/react/src/components/StepPalette.tsx +0 -48
- package/packages/react/src/components/WorkflowCanvas.tsx +0 -42
- package/packages/react/src/components/WorkflowRunPanel.tsx +0 -64
- package/packages/react/src/components/WorkflowToolbar.tsx +0 -43
- package/packages/react/src/components/index.ts +0 -9
- package/packages/react/src/hooks/index.ts +0 -10
- package/packages/react/src/hooks/useApprovalGate.ts +0 -59
- package/packages/react/src/hooks/useWorkflow.ts +0 -39
- package/packages/react/src/hooks/useWorkflowBuilder.ts +0 -121
- package/packages/react/src/hooks/useWorkflowRun.ts +0 -75
- package/packages/react/src/hooks/useWorkflowStep.ts +0 -52
- package/packages/react/src/hooks/useWorkflowTemplates.ts +0 -54
- package/packages/react/src/index.ts +0 -16
- package/packages/react/src/pages/WorkflowBuilderPage.tsx +0 -81
- package/packages/react/src/pages/WorkflowRunsPage.tsx +0 -59
- package/packages/react/src/pages/index.ts +0 -3
- package/packages/react/tsconfig.json +0 -1
- package/packages/react/tsup.config.ts +0 -7
- package/packages/react-css/README.md +0 -1
- package/packages/react-css/package.json +0 -44
- package/packages/react-css/src/components/ApprovalModal.tsx +0 -6
- package/packages/react-css/src/components/StepConfigPanel.tsx +0 -7
- package/packages/react-css/src/components/StepConnector.tsx +0 -6
- package/packages/react-css/src/components/StepNode.tsx +0 -7
- package/packages/react-css/src/components/StepPalette.tsx +0 -6
- package/packages/react-css/src/components/WorkflowCanvas.tsx +0 -6
- package/packages/react-css/src/components/WorkflowRunPanel.tsx +0 -9
- package/packages/react-css/src/components/WorkflowToolbar.tsx +0 -4
- package/packages/react-css/src/components/index.ts +0 -9
- package/packages/react-css/src/hooks/index.ts +0 -3
- package/packages/react-css/src/hooks/useWorkflow.ts +0 -39
- package/packages/react-css/src/hooks/useWorkflowBuilder.ts +0 -121
- package/packages/react-css/src/index.ts +0 -7
- package/packages/react-css/src/pages/WorkflowBuilderPage.tsx +0 -16
- package/packages/react-css/src/pages/WorkflowRunsPage.tsx +0 -6
- package/packages/react-css/src/pages/index.ts +0 -3
- package/packages/react-css/tsconfig.json +0 -26
- package/packages/react-css/tsup.config.ts +0 -2
- package/packages/shared/README.md +0 -1
- package/packages/shared/package.json +0 -56
- package/packages/shared/src/__tests__/ai-workflow.test.ts +0 -217
- package/packages/shared/src/config.ts +0 -49
- package/packages/shared/src/convex/index.ts +0 -2
- package/packages/shared/src/convex/schemas.ts +0 -42
- package/packages/shared/src/engine.test.ts +0 -1
- package/packages/shared/src/engine.ts +0 -295
- package/packages/shared/src/index.ts +0 -43
- package/packages/shared/src/steps.ts +0 -68
- package/packages/shared/src/templates.ts +0 -172
- package/packages/shared/src/types.ts +0 -237
- package/packages/shared/src/utils/cost.ts +0 -79
- package/packages/shared/src/utils/dag.ts +0 -133
- package/packages/shared/src/utils/index.ts +0 -5
- package/packages/shared/src/utils/interpolation.ts +0 -53
- package/packages/shared/src/validators.ts +0 -215
- package/packages/shared/tsconfig.json +0 -1
- package/packages/shared/tsup.config.ts +0 -5
- package/packages/shared/vitest.config.ts +0 -4
- package/packages/solidjs/README.md +0 -1
- package/packages/solidjs/package.json +0 -45
- package/packages/solidjs/src/components/ApprovalModal.tsx +0 -18
- package/packages/solidjs/src/components/StepConfigPanel.tsx +0 -14
- package/packages/solidjs/src/components/StepConnector.tsx +0 -11
- package/packages/solidjs/src/components/StepNode.tsx +0 -12
- package/packages/solidjs/src/components/StepPalette.tsx +0 -22
- package/packages/solidjs/src/components/WorkflowCanvas.tsx +0 -23
- package/packages/solidjs/src/components/WorkflowRunPanel.tsx +0 -18
- package/packages/solidjs/src/components/WorkflowToolbar.tsx +0 -13
- package/packages/solidjs/src/components/index.ts +0 -9
- package/packages/solidjs/src/index.ts +0 -7
- package/packages/solidjs/src/pages/WorkflowBuilderPage.tsx +0 -37
- package/packages/solidjs/src/pages/WorkflowRunsPage.tsx +0 -20
- package/packages/solidjs/src/pages/index.ts +0 -3
- package/packages/solidjs/src/primitives/createApprovalGate.ts +0 -29
- package/packages/solidjs/src/primitives/createWorkflow.ts +0 -28
- package/packages/solidjs/src/primitives/createWorkflowBuilder.ts +0 -56
- package/packages/solidjs/src/primitives/createWorkflowRun.ts +0 -32
- package/packages/solidjs/src/primitives/createWorkflowStep.ts +0 -23
- package/packages/solidjs/src/primitives/createWorkflowTemplates.ts +0 -28
- package/packages/solidjs/src/primitives/index.ts +0 -8
- package/packages/solidjs/tsconfig.json +0 -1
- package/packages/solidjs/tsup.config.ts +0 -7
- package/packages/solidjs-css/README.md +0 -1
- package/packages/solidjs-css/package.json +0 -43
- package/packages/solidjs-css/src/components/ApprovalModal.tsx +0 -6
- package/packages/solidjs-css/src/components/StepConfigPanel.tsx +0 -7
- package/packages/solidjs-css/src/components/StepConnector.tsx +0 -6
- package/packages/solidjs-css/src/components/StepNode.tsx +0 -7
- package/packages/solidjs-css/src/components/StepPalette.tsx +0 -7
- package/packages/solidjs-css/src/components/WorkflowCanvas.tsx +0 -7
- package/packages/solidjs-css/src/components/WorkflowRunPanel.tsx +0 -8
- package/packages/solidjs-css/src/components/WorkflowToolbar.tsx +0 -5
- package/packages/solidjs-css/src/components/index.ts +0 -9
- package/packages/solidjs-css/src/index.ts +0 -7
- package/packages/solidjs-css/src/pages/WorkflowBuilderPage.tsx +0 -2
- package/packages/solidjs-css/src/pages/WorkflowRunsPage.tsx +0 -7
- package/packages/solidjs-css/src/pages/index.ts +0 -3
- package/packages/solidjs-css/src/primitives/createWorkflow.ts +0 -28
- package/packages/solidjs-css/src/primitives/createWorkflowBuilder.ts +0 -56
- package/packages/solidjs-css/src/primitives/index.ts +0 -1
- package/packages/solidjs-css/tsconfig.json +0 -27
- package/packages/solidjs-css/tsup.config.ts +0 -2
- package/pnpm-workspace.yaml +0 -2
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import { WorkflowEngineOptions, WorkflowDefinition, WorkflowRun, WorkflowError, StepResult, WorkflowStepDef, StepConnection, RunStatus, StepStatus, WorkflowTemplate, StepType } from '@geenius/ai-workflow-shared';
|
|
2
|
+
export { RunStatus, StepConfig, StepResult, StepStatus, StepType, WORKFLOW_TEMPLATES, WorkflowBuilderState, WorkflowDefinition, WorkflowEngine, WorkflowRun, WorkflowStatus, WorkflowStepDef, validateWorkflow } from '@geenius/ai-workflow-shared';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @module UseWorkflow
|
|
7
|
+
* @package @geenius/ai-workflow-react
|
|
8
|
+
* @description React hook for executing workflow definitions with the shared
|
|
9
|
+
* workflow engine. This file bridges engine lifecycle, run state, and typed
|
|
10
|
+
* error propagation into a stable React-friendly API.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Runtime integrations accepted by the React workflow hook.
|
|
15
|
+
*/
|
|
16
|
+
interface UseWorkflowOptions extends WorkflowEngineOptions {
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Result returned by `useWorkflow`.
|
|
20
|
+
*
|
|
21
|
+
* @property execute Execute a workflow definition against optional input data.
|
|
22
|
+
* @property cancel Cancel the current in-flight workflow run.
|
|
23
|
+
* @property run Latest workflow run snapshot.
|
|
24
|
+
* @property isRunning Whether a workflow run is currently in progress.
|
|
25
|
+
* @property error Latest typed workflow error.
|
|
26
|
+
* @property stepResults Step results emitted during the active run.
|
|
27
|
+
* @property reset Clear local run, error, and step-result state.
|
|
28
|
+
*/
|
|
29
|
+
interface UseWorkflowResult {
|
|
30
|
+
execute: (definition: WorkflowDefinition, input?: Record<string, unknown>) => Promise<WorkflowRun>;
|
|
31
|
+
cancel: () => void;
|
|
32
|
+
run: WorkflowRun | null;
|
|
33
|
+
isRunning: boolean;
|
|
34
|
+
error: WorkflowError | null;
|
|
35
|
+
stepResults: StepResult[];
|
|
36
|
+
reset: () => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Execute shared workflow definitions from React stateful components.
|
|
40
|
+
*
|
|
41
|
+
* @param options Runtime integrations and callbacks for the shared workflow engine.
|
|
42
|
+
* @returns Run state, execution methods, and cancellation controls.
|
|
43
|
+
*/
|
|
44
|
+
declare function useWorkflow(options: UseWorkflowOptions): UseWorkflowResult;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @module UseWorkflowBuilder
|
|
48
|
+
* @package @geenius/ai-workflow-react
|
|
49
|
+
* @description React hook for building and editing workflow definitions in the
|
|
50
|
+
* Tailwind workflow surface, including selection and undo/redo history.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Create workflow-builder state and mutations for the React builder UI.
|
|
55
|
+
*
|
|
56
|
+
* @param initial Optional partial workflow definition used to seed the builder.
|
|
57
|
+
* @returns Builder state, undo/redo status, and workflow mutation callbacks.
|
|
58
|
+
*/
|
|
59
|
+
declare function useWorkflowBuilder(initial?: Partial<WorkflowDefinition>): {
|
|
60
|
+
definition: WorkflowDefinition;
|
|
61
|
+
selectedStepId: string | null;
|
|
62
|
+
isDirty: boolean;
|
|
63
|
+
canUndo: boolean;
|
|
64
|
+
canRedo: boolean;
|
|
65
|
+
addStep: (step: WorkflowStepDef) => void;
|
|
66
|
+
removeStep: (stepId: string) => void;
|
|
67
|
+
updateStep: (stepId: string, updates: Partial<WorkflowStepDef>) => void;
|
|
68
|
+
addConnection: (conn: StepConnection) => void;
|
|
69
|
+
removeConnection: (fromStepId: string, toStepId: string) => void;
|
|
70
|
+
selectStep: (stepId: string | null) => void;
|
|
71
|
+
undo: () => void;
|
|
72
|
+
redo: () => void;
|
|
73
|
+
setDefinition: (def: WorkflowDefinition) => void;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @module UseWorkflowRun
|
|
78
|
+
* @package @geenius/ai-workflow-react
|
|
79
|
+
* @description React hook for tracking workflow execution progress, per-step
|
|
80
|
+
* results, and completion callbacks in the Tailwind workflow surface.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Runtime options for workflow run tracking.
|
|
85
|
+
*/
|
|
86
|
+
interface UseWorkflowRunOptions {
|
|
87
|
+
/** Poll interval for checking run status (ms) */
|
|
88
|
+
pollIntervalMs?: number;
|
|
89
|
+
/** Callback when a step completes */
|
|
90
|
+
onStepComplete?: (result: StepResult) => void;
|
|
91
|
+
/** Callback when the run finishes */
|
|
92
|
+
onRunComplete?: (run: WorkflowRun) => void;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Track workflow execution state and emit lifecycle callbacks.
|
|
96
|
+
*
|
|
97
|
+
* @param options Optional polling and lifecycle callbacks for run updates.
|
|
98
|
+
* @returns Run state, derived flags, and update/reset helpers.
|
|
99
|
+
*/
|
|
100
|
+
declare function useWorkflowRun(options?: UseWorkflowRunOptions): {
|
|
101
|
+
run: WorkflowRun | null;
|
|
102
|
+
status: RunStatus;
|
|
103
|
+
currentStepIndex: number;
|
|
104
|
+
completedSteps: StepResult[];
|
|
105
|
+
progress: number;
|
|
106
|
+
error: string | null;
|
|
107
|
+
trackRun: (workflowRun: WorkflowRun) => void;
|
|
108
|
+
updateStep: (result: StepResult) => void;
|
|
109
|
+
reset: () => void;
|
|
110
|
+
isRunning: boolean;
|
|
111
|
+
isComplete: boolean;
|
|
112
|
+
isFailed: boolean;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @module UseWorkflowStep
|
|
117
|
+
* @package @geenius/ai-workflow-react
|
|
118
|
+
* @description React hook for tracking a single workflow step within the
|
|
119
|
+
* Tailwind workflow surface.
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
interface UseWorkflowStepResult {
|
|
123
|
+
stepDef: WorkflowStepDef;
|
|
124
|
+
status: StepStatus;
|
|
125
|
+
output: unknown;
|
|
126
|
+
error: string | null;
|
|
127
|
+
durationMs: number;
|
|
128
|
+
icon: string;
|
|
129
|
+
statusColor: string;
|
|
130
|
+
updateFromResult: (result: StepResult) => void;
|
|
131
|
+
reset: () => void;
|
|
132
|
+
isComplete: boolean;
|
|
133
|
+
isRunning: boolean;
|
|
134
|
+
isFailed: boolean;
|
|
135
|
+
isWaiting: boolean;
|
|
136
|
+
config: WorkflowStepDef["config"];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Track the transient execution state for a single workflow step.
|
|
140
|
+
*
|
|
141
|
+
* @param stepDef Shared workflow step definition to project into UI state.
|
|
142
|
+
* @returns Step execution metadata, derived badges, and reset/update actions.
|
|
143
|
+
*/
|
|
144
|
+
declare function useWorkflowStep(stepDef: WorkflowStepDef): UseWorkflowStepResult;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @module UseApprovalGate
|
|
148
|
+
* @package @geenius/ai-workflow-react
|
|
149
|
+
* @description React hook for managing human approval requests in the Tailwind
|
|
150
|
+
* workflow variant.
|
|
151
|
+
*/
|
|
152
|
+
/**
|
|
153
|
+
* Pending approval request exposed to the UI layer.
|
|
154
|
+
*/
|
|
155
|
+
interface ApprovalRequest {
|
|
156
|
+
id: string;
|
|
157
|
+
stepId: string;
|
|
158
|
+
message: string;
|
|
159
|
+
requestedAt: number;
|
|
160
|
+
approvers?: string[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Manage pending approval requests and completed approval history.
|
|
164
|
+
*
|
|
165
|
+
* @returns Approval state plus request, approve, reject, and reset helpers.
|
|
166
|
+
*/
|
|
167
|
+
declare function useApprovalGate(): {
|
|
168
|
+
pendingApprovals: ApprovalRequest[];
|
|
169
|
+
history: Array<ApprovalRequest & {
|
|
170
|
+
decision: 'approved' | 'rejected';
|
|
171
|
+
decidedAt: number;
|
|
172
|
+
}>;
|
|
173
|
+
hasPending: boolean;
|
|
174
|
+
requestApproval: (stepId: string, message: string, approvers?: string[]) => string;
|
|
175
|
+
approve: (approvalId: string) => void;
|
|
176
|
+
reject: (approvalId: string) => void;
|
|
177
|
+
clearHistory: () => void;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @module UseWorkflowTemplates
|
|
182
|
+
* @package @geenius/ai-workflow-react
|
|
183
|
+
* @description React hook for filtering and instantiating shared workflow
|
|
184
|
+
* templates in the Tailwind workflow surface.
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Manage template filtering, selection, and instantiation for the builder UI.
|
|
189
|
+
*
|
|
190
|
+
* @param userId User identifier injected into cloned workflow templates.
|
|
191
|
+
* @returns Template lists, selected state, and creation helpers.
|
|
192
|
+
*/
|
|
193
|
+
declare function useWorkflowTemplates(userId: string): {
|
|
194
|
+
templates: WorkflowTemplate[];
|
|
195
|
+
allTemplates: WorkflowTemplate[];
|
|
196
|
+
selectedTemplate: WorkflowTemplate | null;
|
|
197
|
+
selectedTemplateId: string | null;
|
|
198
|
+
categories: WorkflowTemplate['category'][];
|
|
199
|
+
filterCategory: WorkflowTemplate['category'] | 'all';
|
|
200
|
+
searchQuery: string;
|
|
201
|
+
setSelectedTemplateId: (value: string | null) => void;
|
|
202
|
+
setFilterCategory: (value: WorkflowTemplate['category'] | 'all') => void;
|
|
203
|
+
setSearchQuery: (value: string) => void;
|
|
204
|
+
createFromTemplate: (templateId: string) => WorkflowDefinition | null;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Props for the workflow builder canvas.
|
|
209
|
+
*
|
|
210
|
+
* @property definition Shared workflow definition to render.
|
|
211
|
+
* @property selectedStepId Currently selected step identifier.
|
|
212
|
+
* @property onSelectStep Callback used to change the selected step.
|
|
213
|
+
* @property onMoveStep Reserved callback for future drag interactions.
|
|
214
|
+
*/
|
|
215
|
+
interface WorkflowCanvasProps {
|
|
216
|
+
definition: WorkflowDefinition;
|
|
217
|
+
selectedStepId: string | null;
|
|
218
|
+
onSelectStep: (id: string | null) => void;
|
|
219
|
+
onMoveStep?: (stepId: string, pos: {
|
|
220
|
+
x: number;
|
|
221
|
+
y: number;
|
|
222
|
+
}) => void;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Render a workflow canvas with connectors, nodes, and an empty state.
|
|
226
|
+
*
|
|
227
|
+
* @param props Canvas state and interaction callbacks.
|
|
228
|
+
* @returns The workflow canvas for the current definition.
|
|
229
|
+
*/
|
|
230
|
+
declare function WorkflowCanvas({ definition, selectedStepId, onSelectStep, onMoveStep, }: WorkflowCanvasProps): ReactElement;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Props for rendering one workflow step node.
|
|
234
|
+
*
|
|
235
|
+
* @property step Shared workflow step definition to render.
|
|
236
|
+
* @property isSelected Whether the step is currently selected in the builder.
|
|
237
|
+
* @property status Visual execution status displayed on the node.
|
|
238
|
+
* @property onClick Optional selection callback invoked from mouse or keyboard.
|
|
239
|
+
* @property className Optional class name override for outer layout composition.
|
|
240
|
+
*/
|
|
241
|
+
interface StepNodeProps {
|
|
242
|
+
step: WorkflowStepDef;
|
|
243
|
+
isSelected?: boolean;
|
|
244
|
+
status?: "pending" | "running" | "success" | "error" | "skipped" | "default";
|
|
245
|
+
onClick?: () => void;
|
|
246
|
+
className?: string;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Render one selectable workflow step node inside the builder canvas.
|
|
250
|
+
*
|
|
251
|
+
* @param props Step node rendering props.
|
|
252
|
+
* @returns A keyboard-accessible workflow step node.
|
|
253
|
+
*/
|
|
254
|
+
declare function StepNode({ step, isSelected, status, onClick, className, }: StepNodeProps): ReactElement;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @module WorkflowStepConnector
|
|
258
|
+
* @package @geenius/ai-workflow-react
|
|
259
|
+
* @description SVG connector primitive for drawing directed edges between
|
|
260
|
+
* positioned workflow steps in the React builder canvas.
|
|
261
|
+
*/
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Props for a workflow step connector path.
|
|
265
|
+
*/
|
|
266
|
+
interface StepConnectorProps {
|
|
267
|
+
from: {
|
|
268
|
+
x: number;
|
|
269
|
+
y: number;
|
|
270
|
+
};
|
|
271
|
+
to: {
|
|
272
|
+
x: number;
|
|
273
|
+
y: number;
|
|
274
|
+
};
|
|
275
|
+
label?: string;
|
|
276
|
+
isActive?: boolean;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Render a curved connector between two step positions.
|
|
280
|
+
*
|
|
281
|
+
* @param props Connector endpoints and optional label/state metadata.
|
|
282
|
+
* @returns The SVG group that draws the workflow edge.
|
|
283
|
+
*/
|
|
284
|
+
declare function StepConnector({ from, to, label, isActive }: StepConnectorProps): ReactElement;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @module WorkflowStepConfigPanel
|
|
288
|
+
* @package @geenius/ai-workflow-react
|
|
289
|
+
* @description React side panel for inspecting and editing the currently
|
|
290
|
+
* selected workflow step. This component exposes step metadata, optional flags,
|
|
291
|
+
* and the raw configuration payload used by the builder surface.
|
|
292
|
+
*/
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Props for the workflow step configuration panel.
|
|
296
|
+
*/
|
|
297
|
+
interface StepConfigPanelProps {
|
|
298
|
+
step: WorkflowStepDef;
|
|
299
|
+
onUpdate: (stepId: string, updates: Partial<WorkflowStepDef>) => void;
|
|
300
|
+
onDelete: (stepId: string) => void;
|
|
301
|
+
onClose: () => void;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Render the editable side panel for a selected workflow step.
|
|
305
|
+
*
|
|
306
|
+
* @param props Selected step data and mutation callbacks from the builder.
|
|
307
|
+
* @returns The workflow step configuration panel.
|
|
308
|
+
*/
|
|
309
|
+
declare function StepConfigPanel({ step, onUpdate, onDelete, onClose }: StepConfigPanelProps): ReactElement;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Props for the workflow run panel.
|
|
313
|
+
*
|
|
314
|
+
* @property run Current workflow run snapshot or `null` when idle.
|
|
315
|
+
* @property isRunning Whether the run is still active.
|
|
316
|
+
* @property onCancel Optional callback that cancels the active run.
|
|
317
|
+
*/
|
|
318
|
+
interface WorkflowRunPanelProps {
|
|
319
|
+
run: WorkflowRun | null;
|
|
320
|
+
isRunning: boolean;
|
|
321
|
+
onCancel?: () => void;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Render execution progress and per-step status for a workflow run.
|
|
325
|
+
*
|
|
326
|
+
* @param props Run state and optional cancellation callback.
|
|
327
|
+
* @returns A run summary panel or idle placeholder.
|
|
328
|
+
*/
|
|
329
|
+
declare function WorkflowRunPanel({ run, isRunning, onCancel, }: WorkflowRunPanelProps): ReactElement;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* @module WorkflowApprovalModal
|
|
333
|
+
* @package @geenius/ai-workflow-react
|
|
334
|
+
* @description React approval dialog for human-gated workflow steps. This
|
|
335
|
+
* component traps keyboard focus, restores focus on close, and keeps the
|
|
336
|
+
* approval surface aligned with the CSS and SolidJS variants.
|
|
337
|
+
*/
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Props for the workflow approval dialog.
|
|
341
|
+
*/
|
|
342
|
+
interface ApprovalModalProps {
|
|
343
|
+
request: ApprovalRequest | null;
|
|
344
|
+
onApprove: (id: string) => void;
|
|
345
|
+
onReject: (id: string) => void;
|
|
346
|
+
onDismiss?: (id: string) => void;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Render the pending approval request as an accessible modal dialog.
|
|
350
|
+
*
|
|
351
|
+
* @param props Approval dialog callbacks and the current pending request.
|
|
352
|
+
* @returns The animated approval dialog, or `null` when no approval is pending.
|
|
353
|
+
*/
|
|
354
|
+
declare function ApprovalModal(props: ApprovalModalProps): ReactElement;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @module WorkflowToolbar
|
|
358
|
+
* @package @geenius/ai-workflow-react
|
|
359
|
+
* @description React toolbar for workflow builder actions such as save, run,
|
|
360
|
+
* cancel, undo, redo, and export. This component owns the top-level command
|
|
361
|
+
* surface shared across the builder page.
|
|
362
|
+
*/
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Props for the workflow toolbar action surface.
|
|
366
|
+
*/
|
|
367
|
+
interface WorkflowToolbarProps {
|
|
368
|
+
workflowName: string;
|
|
369
|
+
isDirty: boolean;
|
|
370
|
+
isRunning: boolean;
|
|
371
|
+
canUndo: boolean;
|
|
372
|
+
canRedo: boolean;
|
|
373
|
+
onSave: () => void;
|
|
374
|
+
onRun: () => void;
|
|
375
|
+
onCancel?: () => void;
|
|
376
|
+
onUndo: () => void;
|
|
377
|
+
onRedo: () => void;
|
|
378
|
+
onExport?: () => void;
|
|
379
|
+
className?: string;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Render the builder command toolbar with run-state-aware actions.
|
|
383
|
+
*
|
|
384
|
+
* @param props Action callbacks and builder status flags for the toolbar.
|
|
385
|
+
* @returns The animated workflow toolbar.
|
|
386
|
+
*/
|
|
387
|
+
declare function WorkflowToolbar(props: WorkflowToolbarProps): ReactElement;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Props for the workflow step palette component.
|
|
391
|
+
*
|
|
392
|
+
* @property onAddStep Callback invoked when a step type is selected.
|
|
393
|
+
*/
|
|
394
|
+
interface StepPaletteProps {
|
|
395
|
+
onAddStep: (type: StepType) => void;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Render the workflow step palette.
|
|
399
|
+
*
|
|
400
|
+
* @param props Palette interaction props.
|
|
401
|
+
* @returns A list of available workflow step types.
|
|
402
|
+
*/
|
|
403
|
+
declare function StepPalette({ onAddStep }: StepPaletteProps): ReactElement;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* @module WorkflowBuilderPage
|
|
407
|
+
* @package @geenius/ai-workflow-react
|
|
408
|
+
* @description React page for composing, editing, and running workflow
|
|
409
|
+
* definitions. This page coordinates the shared engine with the React builder
|
|
410
|
+
* hooks and component surface.
|
|
411
|
+
*/
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Props for the React workflow builder page.
|
|
415
|
+
*
|
|
416
|
+
* @property engineOptions Shared workflow engine integrations used for execution.
|
|
417
|
+
* @property onSave Optional callback that persists the edited definition.
|
|
418
|
+
* @property className Optional class name override for outer layout composition.
|
|
419
|
+
* @property workflows Optional list of stored workflows shown in the summary strip.
|
|
420
|
+
* @property workflowRuns Optional list of stored workflow runs shown in the summary strip.
|
|
421
|
+
*/
|
|
422
|
+
interface WorkflowBuilderPageProps {
|
|
423
|
+
engineOptions: WorkflowEngineOptions;
|
|
424
|
+
onSave?: (definition: WorkflowDefinition) => void;
|
|
425
|
+
className?: string;
|
|
426
|
+
workflows?: Array<{
|
|
427
|
+
_id: string;
|
|
428
|
+
name: string;
|
|
429
|
+
}>;
|
|
430
|
+
workflowRuns?: Array<{
|
|
431
|
+
_id: string;
|
|
432
|
+
workflowId: string;
|
|
433
|
+
}>;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Render the full workflow builder page for React consumers.
|
|
437
|
+
*
|
|
438
|
+
* @param props Builder dependencies, persistence callbacks, and optional summaries.
|
|
439
|
+
* @returns The composed workflow builder page.
|
|
440
|
+
*/
|
|
441
|
+
declare function WorkflowBuilderPage({ engineOptions, onSave, className, workflows, workflowRuns, }: WorkflowBuilderPageProps): ReactElement;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* @module WorkflowRunsPage
|
|
445
|
+
* @package @geenius/ai-workflow-react
|
|
446
|
+
* @description React page component for browsing workflow execution history in
|
|
447
|
+
* the Tailwind workflow variant.
|
|
448
|
+
*/
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Props for the workflow runs history page.
|
|
452
|
+
*/
|
|
453
|
+
interface WorkflowRunsPageProps {
|
|
454
|
+
runs: WorkflowRun[];
|
|
455
|
+
onSelectRun?: (runId: string) => void;
|
|
456
|
+
className?: string;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Render the workflow run history page.
|
|
460
|
+
*
|
|
461
|
+
* @param props Workflow run records plus optional selection and layout hooks.
|
|
462
|
+
* @returns The workflow run history page.
|
|
463
|
+
*/
|
|
464
|
+
declare function WorkflowRunsPage({ runs, onSelectRun, className }: WorkflowRunsPageProps): ReactElement;
|
|
465
|
+
|
|
466
|
+
export { ApprovalModal, type ApprovalModalProps, type ApprovalRequest, StepConfigPanel, type StepConfigPanelProps, StepConnector, type StepConnectorProps, StepNode, type StepNodeProps, StepPalette, type StepPaletteProps, type UseWorkflowOptions, type UseWorkflowRunOptions, WorkflowBuilderPage, type WorkflowBuilderPageProps, WorkflowCanvas, type WorkflowCanvasProps, WorkflowRunPanel, type WorkflowRunPanelProps, WorkflowRunsPage, type WorkflowRunsPageProps, WorkflowToolbar, type WorkflowToolbarProps, useApprovalGate, useWorkflow, useWorkflowBuilder, useWorkflowRun, useWorkflowStep, useWorkflowTemplates };
|