@geenius/ai-workflow 0.1.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -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 +514 -0
- package/packages/react/dist/index.js +2633 -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 +533 -0
- package/packages/react-css/dist/index.js +2620 -0
- package/packages/react-css/dist/index.js.map +1 -0
- package/packages/shared/dist/index.d.ts +1305 -0
- package/packages/shared/dist/index.js +1594 -0
- package/packages/shared/dist/index.js.map +1 -0
- package/packages/solidjs/dist/index.d.ts +492 -0
- package/packages/solidjs/dist/index.js +2552 -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 +509 -0
- package/packages/solidjs-css/dist/index.js +2493 -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,514 @@
|
|
|
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, getTemplate, getTemplatesByCategory, validateRun, 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
|
+
* @property callLLM Optional LLM execution callback inherited from `WorkflowEngineOptions`.
|
|
17
|
+
* @property callWebhook Optional webhook execution callback inherited from `WorkflowEngineOptions`.
|
|
18
|
+
* @property onApprovalRequired Optional approval callback inherited from `WorkflowEngineOptions`.
|
|
19
|
+
* @property onStepComplete Optional per-step completion callback inherited from `WorkflowEngineOptions`.
|
|
20
|
+
* @property customHandlers Optional custom step-handler registry inherited from `WorkflowEngineOptions`.
|
|
21
|
+
*/
|
|
22
|
+
interface UseWorkflowOptions extends WorkflowEngineOptions {
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Result returned by `useWorkflow`.
|
|
26
|
+
*
|
|
27
|
+
* @property execute Execute a workflow definition against optional input data.
|
|
28
|
+
* @property cancel Cancel the current in-flight workflow run.
|
|
29
|
+
* @property run Latest workflow run snapshot.
|
|
30
|
+
* @property isRunning Whether a workflow run is currently in progress.
|
|
31
|
+
* @property error Latest typed workflow error.
|
|
32
|
+
* @property stepResults Step results emitted during the active run.
|
|
33
|
+
* @property reset Clear local run, error, and step-result state.
|
|
34
|
+
*/
|
|
35
|
+
interface UseWorkflowResult {
|
|
36
|
+
execute: (definition: WorkflowDefinition, input?: Record<string, unknown>) => Promise<WorkflowRun>;
|
|
37
|
+
cancel: () => void;
|
|
38
|
+
run: WorkflowRun | null;
|
|
39
|
+
isRunning: boolean;
|
|
40
|
+
error: WorkflowError | null;
|
|
41
|
+
stepResults: StepResult[];
|
|
42
|
+
reset: () => void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Execute shared workflow definitions from React stateful components.
|
|
46
|
+
*
|
|
47
|
+
* @param options Runtime integrations and callbacks for the shared workflow engine.
|
|
48
|
+
* @returns Run state, execution methods, and cancellation controls.
|
|
49
|
+
*/
|
|
50
|
+
declare function useWorkflow(options: UseWorkflowOptions): UseWorkflowResult;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @module UseWorkflowBuilder
|
|
54
|
+
* @package @geenius/ai-workflow-react
|
|
55
|
+
* @description React hook for building and editing workflow definitions in the
|
|
56
|
+
* Tailwind workflow surface, including selection and undo/redo history.
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Create workflow-builder state and mutations for the React builder UI.
|
|
61
|
+
*
|
|
62
|
+
* @param initial Optional partial workflow definition used to seed the builder.
|
|
63
|
+
* @returns Builder state, undo/redo status, and workflow mutation callbacks.
|
|
64
|
+
*/
|
|
65
|
+
declare function useWorkflowBuilder(initial?: Partial<WorkflowDefinition>): {
|
|
66
|
+
definition: WorkflowDefinition;
|
|
67
|
+
selectedStepId: string | null;
|
|
68
|
+
isDirty: boolean;
|
|
69
|
+
canUndo: boolean;
|
|
70
|
+
canRedo: boolean;
|
|
71
|
+
addStep: (step: WorkflowStepDef) => void;
|
|
72
|
+
removeStep: (stepId: string) => void;
|
|
73
|
+
updateStep: (stepId: string, updates: Partial<WorkflowStepDef>) => void;
|
|
74
|
+
addConnection: (conn: StepConnection) => void;
|
|
75
|
+
removeConnection: (fromStepId: string, toStepId: string) => void;
|
|
76
|
+
selectStep: (stepId: string | null) => void;
|
|
77
|
+
undo: () => void;
|
|
78
|
+
redo: () => void;
|
|
79
|
+
setDefinition: (def: WorkflowDefinition) => void;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @module UseWorkflowRun
|
|
84
|
+
* @package @geenius/ai-workflow-react
|
|
85
|
+
* @description React hook for tracking workflow execution progress, per-step
|
|
86
|
+
* results, and completion callbacks in the Tailwind workflow surface.
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Runtime options for workflow run tracking.
|
|
91
|
+
*
|
|
92
|
+
* @property pollIntervalMs Reserved polling interval for future remote sync.
|
|
93
|
+
* @property onStepComplete Optional callback fired whenever a step result changes.
|
|
94
|
+
* @property onRunComplete Optional callback fired when the run reaches a terminal state.
|
|
95
|
+
*/
|
|
96
|
+
interface UseWorkflowRunOptions {
|
|
97
|
+
/** Poll interval for checking run status (ms) */
|
|
98
|
+
pollIntervalMs?: number;
|
|
99
|
+
/** Callback when a step completes */
|
|
100
|
+
onStepComplete?: (result: StepResult) => void;
|
|
101
|
+
/** Callback when the run finishes */
|
|
102
|
+
onRunComplete?: (run: WorkflowRun) => void;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Track workflow execution state and emit lifecycle callbacks.
|
|
106
|
+
*
|
|
107
|
+
* @param options Optional polling and lifecycle callbacks for run updates.
|
|
108
|
+
* @returns Run state, derived flags, and update/reset helpers.
|
|
109
|
+
*/
|
|
110
|
+
declare function useWorkflowRun(options?: UseWorkflowRunOptions): {
|
|
111
|
+
run: WorkflowRun | null;
|
|
112
|
+
status: RunStatus;
|
|
113
|
+
currentStepIndex: number;
|
|
114
|
+
completedSteps: StepResult[];
|
|
115
|
+
progress: number;
|
|
116
|
+
error: string | null;
|
|
117
|
+
trackRun: (workflowRun: WorkflowRun) => void;
|
|
118
|
+
updateStep: (result: StepResult) => void;
|
|
119
|
+
reset: () => void;
|
|
120
|
+
isRunning: boolean;
|
|
121
|
+
isComplete: boolean;
|
|
122
|
+
isFailed: boolean;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @module UseWorkflowStep
|
|
127
|
+
* @package @geenius/ai-workflow-react
|
|
128
|
+
* @description React hook for tracking a single workflow step within the
|
|
129
|
+
* Tailwind workflow surface.
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
interface UseWorkflowStepResult {
|
|
133
|
+
stepDef: WorkflowStepDef;
|
|
134
|
+
status: StepStatus;
|
|
135
|
+
output: unknown;
|
|
136
|
+
error: string | null;
|
|
137
|
+
durationMs: number;
|
|
138
|
+
icon: string;
|
|
139
|
+
statusColor: string;
|
|
140
|
+
updateFromResult: (result: StepResult) => void;
|
|
141
|
+
reset: () => void;
|
|
142
|
+
isComplete: boolean;
|
|
143
|
+
isRunning: boolean;
|
|
144
|
+
isFailed: boolean;
|
|
145
|
+
isWaiting: boolean;
|
|
146
|
+
config: WorkflowStepDef["config"];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Track the transient execution state for a single workflow step.
|
|
150
|
+
*
|
|
151
|
+
* @param stepDef Shared workflow step definition to project into UI state.
|
|
152
|
+
* @returns Step execution metadata, derived badges, and reset/update actions.
|
|
153
|
+
*/
|
|
154
|
+
declare function useWorkflowStep(stepDef: WorkflowStepDef): UseWorkflowStepResult;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @module UseApprovalGate
|
|
158
|
+
* @package @geenius/ai-workflow-react
|
|
159
|
+
* @description React hook for managing human approval requests in the Tailwind
|
|
160
|
+
* workflow variant.
|
|
161
|
+
*/
|
|
162
|
+
/**
|
|
163
|
+
* Pending approval request exposed to the UI layer.
|
|
164
|
+
*
|
|
165
|
+
* @property id Stable approval-request identifier.
|
|
166
|
+
* @property stepId Workflow step awaiting the operator decision.
|
|
167
|
+
* @property message Approval prompt shown to the operator.
|
|
168
|
+
* @property requestedAt Unix timestamp for when the approval was created.
|
|
169
|
+
* @property approvers Optional list of users or roles allowed to approve.
|
|
170
|
+
*/
|
|
171
|
+
interface ApprovalRequest {
|
|
172
|
+
id: string;
|
|
173
|
+
stepId: string;
|
|
174
|
+
message: string;
|
|
175
|
+
requestedAt: number;
|
|
176
|
+
approvers?: string[];
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Manage pending approval requests and completed approval history.
|
|
180
|
+
*
|
|
181
|
+
* @returns Approval state plus request, approve, reject, and reset helpers.
|
|
182
|
+
*/
|
|
183
|
+
declare function useApprovalGate(): {
|
|
184
|
+
pendingApprovals: ApprovalRequest[];
|
|
185
|
+
history: Array<ApprovalRequest & {
|
|
186
|
+
decision: 'approved' | 'rejected';
|
|
187
|
+
decidedAt: number;
|
|
188
|
+
}>;
|
|
189
|
+
hasPending: boolean;
|
|
190
|
+
requestApproval: (stepId: string, message: string, approvers?: string[]) => string;
|
|
191
|
+
approve: (approvalId: string) => void;
|
|
192
|
+
reject: (approvalId: string) => void;
|
|
193
|
+
clearHistory: () => void;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @module UseWorkflowTemplates
|
|
198
|
+
* @package @geenius/ai-workflow-react
|
|
199
|
+
* @description React hook for filtering and instantiating shared workflow
|
|
200
|
+
* templates in the Tailwind workflow surface.
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Manage template filtering, selection, and instantiation for the builder UI.
|
|
205
|
+
*
|
|
206
|
+
* @param userId User identifier injected into cloned workflow templates.
|
|
207
|
+
* @returns Template lists, selected state, and creation helpers.
|
|
208
|
+
*/
|
|
209
|
+
declare function useWorkflowTemplates(userId: string): {
|
|
210
|
+
templates: WorkflowTemplate[];
|
|
211
|
+
allTemplates: WorkflowTemplate[];
|
|
212
|
+
selectedTemplate: WorkflowTemplate | null;
|
|
213
|
+
selectedTemplateId: string | null;
|
|
214
|
+
categories: WorkflowTemplate['category'][];
|
|
215
|
+
filterCategory: WorkflowTemplate['category'] | 'all';
|
|
216
|
+
searchQuery: string;
|
|
217
|
+
setSelectedTemplateId: (value: string | null) => void;
|
|
218
|
+
setFilterCategory: (value: WorkflowTemplate['category'] | 'all') => void;
|
|
219
|
+
setSearchQuery: (value: string) => void;
|
|
220
|
+
createFromTemplate: (templateId: string) => WorkflowDefinition | null;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Props for the workflow builder canvas.
|
|
225
|
+
*
|
|
226
|
+
* @property definition Shared workflow definition to render.
|
|
227
|
+
* @property selectedStepId Currently selected step identifier.
|
|
228
|
+
* @property onSelectStep Callback used to change the selected step.
|
|
229
|
+
* @property onMoveStep Reserved callback for future drag interactions.
|
|
230
|
+
*/
|
|
231
|
+
interface WorkflowCanvasProps {
|
|
232
|
+
definition: WorkflowDefinition;
|
|
233
|
+
selectedStepId: string | null;
|
|
234
|
+
onSelectStep: (id: string | null) => void;
|
|
235
|
+
onMoveStep?: (stepId: string, pos: {
|
|
236
|
+
x: number;
|
|
237
|
+
y: number;
|
|
238
|
+
}) => void;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Render a workflow canvas with connectors, nodes, and an empty state.
|
|
242
|
+
*
|
|
243
|
+
* @param props Canvas state and interaction callbacks.
|
|
244
|
+
* @returns The workflow canvas for the current definition.
|
|
245
|
+
*/
|
|
246
|
+
declare function WorkflowCanvas({ definition, selectedStepId, onSelectStep, onMoveStep, }: WorkflowCanvasProps): ReactElement;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Props for rendering one workflow step node.
|
|
250
|
+
*
|
|
251
|
+
* @property step Shared workflow step definition to render.
|
|
252
|
+
* @property isSelected Whether the step is currently selected in the builder.
|
|
253
|
+
* @property status Visual execution status displayed on the node.
|
|
254
|
+
* @property onClick Optional selection callback invoked from mouse or keyboard.
|
|
255
|
+
* @property className Optional class name override for outer layout composition.
|
|
256
|
+
*/
|
|
257
|
+
interface StepNodeProps {
|
|
258
|
+
step: WorkflowStepDef;
|
|
259
|
+
isSelected?: boolean;
|
|
260
|
+
status?: "pending" | "running" | "success" | "error" | "skipped" | "default";
|
|
261
|
+
onClick?: () => void;
|
|
262
|
+
className?: string;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Render one selectable workflow step node inside the builder canvas.
|
|
266
|
+
*
|
|
267
|
+
* @param props Step node rendering props.
|
|
268
|
+
* @returns A keyboard-accessible workflow step node.
|
|
269
|
+
*/
|
|
270
|
+
declare function StepNode({ step, isSelected, status, onClick, className, }: StepNodeProps): ReactElement;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* @module WorkflowStepConnector
|
|
274
|
+
* @package @geenius/ai-workflow-react
|
|
275
|
+
* @description SVG connector primitive for drawing directed edges between
|
|
276
|
+
* positioned workflow steps in the React builder canvas.
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Props for a workflow step connector path.
|
|
281
|
+
*
|
|
282
|
+
* @property from Starting node position for the connector.
|
|
283
|
+
* @property to Ending node position for the connector.
|
|
284
|
+
* @property label Optional inline label rendered above the curve.
|
|
285
|
+
* @property isActive Whether the connector should use the emphasized active style.
|
|
286
|
+
*/
|
|
287
|
+
interface StepConnectorProps {
|
|
288
|
+
from: {
|
|
289
|
+
x: number;
|
|
290
|
+
y: number;
|
|
291
|
+
};
|
|
292
|
+
to: {
|
|
293
|
+
x: number;
|
|
294
|
+
y: number;
|
|
295
|
+
};
|
|
296
|
+
label?: string;
|
|
297
|
+
isActive?: boolean;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Render a curved connector between two step positions.
|
|
301
|
+
*
|
|
302
|
+
* @param props Connector endpoints and optional label/state metadata.
|
|
303
|
+
* @returns The SVG group that draws the workflow edge.
|
|
304
|
+
*/
|
|
305
|
+
declare function StepConnector({ from, to, label, isActive }: StepConnectorProps): ReactElement;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* @module WorkflowStepConfigPanel
|
|
309
|
+
* @package @geenius/ai-workflow-react
|
|
310
|
+
* @description React side panel for inspecting and editing the currently
|
|
311
|
+
* selected workflow step. This component exposes step metadata, optional flags,
|
|
312
|
+
* and the raw configuration payload used by the builder surface.
|
|
313
|
+
*/
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Props for the workflow step configuration panel.
|
|
317
|
+
*
|
|
318
|
+
* @property step Shared workflow step being edited in the panel.
|
|
319
|
+
* @property onUpdate Callback that persists partial step updates.
|
|
320
|
+
* @property onDelete Callback that removes the selected step.
|
|
321
|
+
* @property onClose Callback that closes the panel without mutating state.
|
|
322
|
+
*/
|
|
323
|
+
interface StepConfigPanelProps {
|
|
324
|
+
step: WorkflowStepDef;
|
|
325
|
+
onUpdate: (stepId: string, updates: Partial<WorkflowStepDef>) => void;
|
|
326
|
+
onDelete: (stepId: string) => void;
|
|
327
|
+
onClose: () => void;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Render the editable side panel for a selected workflow step.
|
|
331
|
+
*
|
|
332
|
+
* @param props Selected step data and mutation callbacks from the builder.
|
|
333
|
+
* @returns The workflow step configuration panel.
|
|
334
|
+
*/
|
|
335
|
+
declare function StepConfigPanel({ step, onUpdate, onDelete, onClose }: StepConfigPanelProps): ReactElement;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Props for the workflow run panel.
|
|
339
|
+
*
|
|
340
|
+
* @property run Current workflow run snapshot or `null` when idle.
|
|
341
|
+
* @property isRunning Whether the run is still active.
|
|
342
|
+
* @property onCancel Optional callback that cancels the active run.
|
|
343
|
+
*/
|
|
344
|
+
interface WorkflowRunPanelProps {
|
|
345
|
+
run: WorkflowRun | null;
|
|
346
|
+
isRunning: boolean;
|
|
347
|
+
onCancel?: () => void;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Render execution progress and per-step status for a workflow run.
|
|
351
|
+
*
|
|
352
|
+
* @param props Run state and optional cancellation callback.
|
|
353
|
+
* @returns A run summary panel or idle placeholder.
|
|
354
|
+
*/
|
|
355
|
+
declare function WorkflowRunPanel({ run, isRunning, onCancel, }: WorkflowRunPanelProps): ReactElement;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* @module WorkflowApprovalModal
|
|
359
|
+
* @package @geenius/ai-workflow-react
|
|
360
|
+
* @description React approval dialog for human-gated workflow steps. This
|
|
361
|
+
* component traps keyboard focus, restores focus on close, and keeps the
|
|
362
|
+
* approval surface aligned with the CSS and SolidJS variants.
|
|
363
|
+
*/
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Props for the workflow approval dialog.
|
|
367
|
+
*
|
|
368
|
+
* @property request Pending approval request to render, or `null` when idle.
|
|
369
|
+
* @property onApprove Callback that approves the active request by id.
|
|
370
|
+
* @property onReject Callback that rejects the active request by id.
|
|
371
|
+
* @property onDismiss Optional callback used for Escape-key and dismiss flows.
|
|
372
|
+
*/
|
|
373
|
+
interface ApprovalModalProps {
|
|
374
|
+
request: ApprovalRequest | null;
|
|
375
|
+
onApprove: (id: string) => void;
|
|
376
|
+
onReject: (id: string) => void;
|
|
377
|
+
onDismiss?: (id: string) => void;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Render the pending approval request as an accessible modal dialog.
|
|
381
|
+
*
|
|
382
|
+
* @param props Approval dialog callbacks and the current pending request.
|
|
383
|
+
* @returns The animated approval dialog, or `null` when no approval is pending.
|
|
384
|
+
*/
|
|
385
|
+
declare function ApprovalModal(props: ApprovalModalProps): ReactElement;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* @module WorkflowToolbar
|
|
389
|
+
* @package @geenius/ai-workflow-react
|
|
390
|
+
* @description React toolbar for workflow builder actions such as save, run,
|
|
391
|
+
* cancel, undo, redo, and export. This component owns the top-level command
|
|
392
|
+
* surface shared across the builder page.
|
|
393
|
+
*/
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Props for the workflow toolbar action surface.
|
|
397
|
+
*
|
|
398
|
+
* @property workflowName Human-readable workflow name shown in the title slot.
|
|
399
|
+
* @property isDirty Whether unsaved edits are currently present.
|
|
400
|
+
* @property isRunning Whether a run is currently active.
|
|
401
|
+
* @property canUndo Whether the undo action should be enabled.
|
|
402
|
+
* @property canRedo Whether the redo action should be enabled.
|
|
403
|
+
* @property onSave Callback that persists the current workflow definition.
|
|
404
|
+
* @property onRun Callback that starts a workflow run.
|
|
405
|
+
* @property onCancel Optional callback that stops an in-flight run.
|
|
406
|
+
* @property onUndo Callback that restores the previous builder snapshot.
|
|
407
|
+
* @property onRedo Callback that reapplies the next builder snapshot.
|
|
408
|
+
* @property onExport Optional callback that exports the workflow definition.
|
|
409
|
+
* @property className Optional class-name override for the toolbar container.
|
|
410
|
+
*/
|
|
411
|
+
interface WorkflowToolbarProps {
|
|
412
|
+
workflowName: string;
|
|
413
|
+
isDirty: boolean;
|
|
414
|
+
isRunning: boolean;
|
|
415
|
+
canUndo: boolean;
|
|
416
|
+
canRedo: boolean;
|
|
417
|
+
onSave: () => void;
|
|
418
|
+
onRun: () => void;
|
|
419
|
+
onCancel?: () => void;
|
|
420
|
+
onUndo: () => void;
|
|
421
|
+
onRedo: () => void;
|
|
422
|
+
onExport?: () => void;
|
|
423
|
+
className?: string;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Render the builder command toolbar with run-state-aware actions.
|
|
427
|
+
*
|
|
428
|
+
* @param props Action callbacks and builder status flags for the toolbar.
|
|
429
|
+
* @returns The animated workflow toolbar.
|
|
430
|
+
*/
|
|
431
|
+
declare function WorkflowToolbar(props: WorkflowToolbarProps): ReactElement;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Props for the workflow step palette component.
|
|
435
|
+
*
|
|
436
|
+
* @property onAddStep Callback invoked when a step type is selected.
|
|
437
|
+
*/
|
|
438
|
+
interface StepPaletteProps {
|
|
439
|
+
onAddStep: (type: StepType) => void;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Render the workflow step palette.
|
|
443
|
+
*
|
|
444
|
+
* @param props Palette interaction props.
|
|
445
|
+
* @returns A list of available workflow step types.
|
|
446
|
+
*/
|
|
447
|
+
declare function StepPalette({ onAddStep }: StepPaletteProps): ReactElement;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* @module WorkflowBuilderPage
|
|
451
|
+
* @package @geenius/ai-workflow-react
|
|
452
|
+
* @description React page for composing, editing, and running workflow
|
|
453
|
+
* definitions. This page coordinates the shared engine with the React builder
|
|
454
|
+
* hooks and component surface.
|
|
455
|
+
*/
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Props for the React workflow builder page.
|
|
459
|
+
*
|
|
460
|
+
* @property engineOptions Shared workflow engine integrations used for execution.
|
|
461
|
+
* @property onSave Optional callback that persists the edited definition.
|
|
462
|
+
* @property className Optional class name override for outer layout composition.
|
|
463
|
+
* @property workflows Optional list of stored workflows shown in the summary strip.
|
|
464
|
+
* @property workflowRuns Optional list of stored workflow runs shown in the summary strip.
|
|
465
|
+
*/
|
|
466
|
+
interface WorkflowBuilderPageProps {
|
|
467
|
+
engineOptions: WorkflowEngineOptions;
|
|
468
|
+
onSave?: (definition: WorkflowDefinition) => void;
|
|
469
|
+
className?: string;
|
|
470
|
+
workflows?: Array<{
|
|
471
|
+
_id: string;
|
|
472
|
+
name: string;
|
|
473
|
+
}>;
|
|
474
|
+
workflowRuns?: Array<{
|
|
475
|
+
_id: string;
|
|
476
|
+
workflowId: string;
|
|
477
|
+
}>;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Render the full workflow builder page for React consumers.
|
|
481
|
+
*
|
|
482
|
+
* @param props Builder dependencies, persistence callbacks, and optional summaries.
|
|
483
|
+
* @returns The composed workflow builder page.
|
|
484
|
+
*/
|
|
485
|
+
declare function WorkflowBuilderPage({ engineOptions, onSave, className, workflows, workflowRuns, }: WorkflowBuilderPageProps): ReactElement;
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* @module WorkflowRunsPage
|
|
489
|
+
* @package @geenius/ai-workflow-react
|
|
490
|
+
* @description React page component for browsing workflow execution history in
|
|
491
|
+
* the Tailwind workflow variant.
|
|
492
|
+
*/
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Props for the workflow runs history page.
|
|
496
|
+
*
|
|
497
|
+
* @property runs Workflow run records rendered on the page.
|
|
498
|
+
* @property onSelectRun Optional callback fired when a run card is selected.
|
|
499
|
+
* @property className Optional class-name override for the page container.
|
|
500
|
+
*/
|
|
501
|
+
interface WorkflowRunsPageProps {
|
|
502
|
+
runs: WorkflowRun[];
|
|
503
|
+
onSelectRun?: (runId: string) => void;
|
|
504
|
+
className?: string;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Render the workflow run history page.
|
|
508
|
+
*
|
|
509
|
+
* @param props Workflow run records plus optional selection and layout hooks.
|
|
510
|
+
* @returns The workflow run history page.
|
|
511
|
+
*/
|
|
512
|
+
declare function WorkflowRunsPage({ runs, onSelectRun, className }: WorkflowRunsPageProps): ReactElement;
|
|
513
|
+
|
|
514
|
+
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 };
|