@genfeedai/workflow-ui 0.1.3 → 0.1.4
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/dist/canvas.d.mts +16 -2
- package/dist/canvas.mjs +10 -8
- package/dist/chunk-6PSJTBNV.mjs +638 -0
- package/dist/chunk-7H3WJJYS.mjs +52 -0
- package/dist/{chunk-HCXI63ME.mjs → chunk-AUQGOJOQ.mjs} +27 -4
- package/dist/{chunk-AOTUCJMA.mjs → chunk-GWBGK3KL.mjs} +2 -2
- package/dist/chunk-JTPADIUO.mjs +130 -0
- package/dist/{chunk-SQK4JDYY.mjs → chunk-LT3ZJJL6.mjs} +9 -2
- package/dist/{chunk-7P2JWDC7.mjs → chunk-O5II6BOJ.mjs} +1198 -254
- package/dist/{chunk-AUZR6REQ.mjs → chunk-OQREHJXK.mjs} +1 -1
- package/dist/chunk-OY7BRSGG.mjs +60 -0
- package/dist/{chunk-E3YBVMYZ.mjs → chunk-PANZDSP6.mjs} +274 -305
- package/dist/chunk-PCIWWD37.mjs +90 -0
- package/dist/{chunk-RIGVIEYB.mjs → chunk-R727OFBR.mjs} +11 -1
- package/dist/chunk-ZD2BADZO.mjs +1294 -0
- package/dist/contextMenuStore-DMg0hJQ1.d.mts +22 -0
- package/dist/hooks.d.mts +53 -244
- package/dist/hooks.mjs +6 -6
- package/dist/index.d.mts +11 -7
- package/dist/index.mjs +13 -11
- package/dist/lib.d.mts +250 -4
- package/dist/lib.mjs +562 -2
- package/dist/nodes.d.mts +3 -1
- package/dist/nodes.mjs +6 -6
- package/dist/panels.mjs +3 -4
- package/dist/{promptLibraryStore-zqb59nsu.d.mts → promptLibraryStore-Bgw5LzvD.d.mts} +33 -5
- package/dist/provider.d.mts +2 -2
- package/dist/provider.mjs +0 -1
- package/dist/stores.d.mts +4 -3
- package/dist/stores.mjs +3 -40
- package/dist/toolbar.d.mts +3 -1
- package/dist/toolbar.mjs +5 -4
- package/dist/{types-ipAnBzAJ.d.mts → types-CF6DPx0P.d.mts} +8 -3
- package/dist/ui.d.mts +1 -1
- package/dist/ui.mjs +0 -1
- package/dist/{hooks.d.ts → useCommentNavigation-NzJjkaj2.d.mts} +15 -2
- package/dist/workflowStore-UAAKOOIK.mjs +2 -0
- package/package.json +30 -24
- package/dist/canvas.d.ts +0 -27
- package/dist/canvas.js +0 -45
- package/dist/chunk-3SPPKCWR.js +0 -458
- package/dist/chunk-3TMV3K34.js +0 -534
- package/dist/chunk-3YFFDHC5.js +0 -300
- package/dist/chunk-4MZ62VMF.js +0 -37
- package/dist/chunk-5HJFQVUR.js +0 -61
- package/dist/chunk-5LQ4QBR5.js +0 -2
- package/dist/chunk-6DOEUDD5.js +0 -254
- package/dist/chunk-AXFOCPPP.js +0 -998
- package/dist/chunk-BMFRA6GK.js +0 -1546
- package/dist/chunk-E323WAZG.mjs +0 -272
- package/dist/chunk-ECD5J2BA.js +0 -6022
- package/dist/chunk-EMGXUNBL.js +0 -120
- package/dist/chunk-EMUMKW5C.js +0 -107
- package/dist/chunk-FOMOOERN.js +0 -2
- package/dist/chunk-IASLG6IA.mjs +0 -118
- package/dist/chunk-IHF35QZD.js +0 -1095
- package/dist/chunk-JLWKW3G5.js +0 -2
- package/dist/chunk-KDIWRSYV.js +0 -375
- package/dist/chunk-L5TF4EHW.mjs +0 -1
- package/dist/chunk-RJ262NXS.js +0 -24
- package/dist/chunk-RXNEDWK2.js +0 -141
- package/dist/chunk-SEV2DWKF.js +0 -744
- package/dist/chunk-ZJWP5KGZ.mjs +0 -33
- package/dist/hooks.js +0 -56
- package/dist/index.d.ts +0 -29
- package/dist/index.js +0 -180
- package/dist/lib.d.ts +0 -164
- package/dist/lib.js +0 -144
- package/dist/nodes.d.ts +0 -128
- package/dist/nodes.js +0 -151
- package/dist/panels.d.ts +0 -22
- package/dist/panels.js +0 -21
- package/dist/promptLibraryStore-BZnfmEkc.d.ts +0 -464
- package/dist/provider.d.ts +0 -29
- package/dist/provider.js +0 -17
- package/dist/stores.d.ts +0 -96
- package/dist/stores.js +0 -113
- package/dist/toolbar.d.ts +0 -73
- package/dist/toolbar.js +0 -34
- package/dist/types-ipAnBzAJ.d.ts +0 -46
- package/dist/ui.d.ts +0 -67
- package/dist/ui.js +0 -84
- package/dist/workflowStore-7SDJC4UR.mjs +0 -3
- package/dist/workflowStore-LNJQ5RZG.js +0 -12
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
import * as zustand from 'zustand';
|
|
2
|
-
import * as zundo from 'zundo';
|
|
3
|
-
import * as _genfeedai_types from '@genfeedai/types';
|
|
4
|
-
import { WorkflowNode, WorkflowEdge, NodeGroup, EdgeStyle, NodeType, WorkflowNodeData, GroupColor, WorkflowFile, ValidationResult, ProviderType, IPrompt, PromptCategory, IQueryPrompts, ICreatePrompt } from '@genfeedai/types';
|
|
5
|
-
import { XYPosition, NodeChange, EdgeChange, Connection } from '@xyflow/react';
|
|
6
|
-
import { P as PromptLibraryService } from './types-ipAnBzAJ.js';
|
|
7
|
-
|
|
8
|
-
type ModalType = 'templates' | 'cost' | 'welcome' | 'settings' | 'promptLibrary' | 'modelBrowser' | 'nodeDetail' | 'shortcutHelp' | 'nodeSearch' | null;
|
|
9
|
-
type NodeDetailTab = 'preview' | 'history';
|
|
10
|
-
interface UIStore {
|
|
11
|
-
showPalette: boolean;
|
|
12
|
-
showMinimap: boolean;
|
|
13
|
-
showAIGenerator: boolean;
|
|
14
|
-
showDebugPanel: boolean;
|
|
15
|
-
selectedNodeId: string | null;
|
|
16
|
-
selectedEdgeId: string | null;
|
|
17
|
-
highlightedNodeIds: string[];
|
|
18
|
-
activeModal: ModalType;
|
|
19
|
-
nodeDetailNodeId: string | null;
|
|
20
|
-
nodeDetailActiveTab: NodeDetailTab;
|
|
21
|
-
nodeDetailStartIndex: number;
|
|
22
|
-
notifications: Notification[];
|
|
23
|
-
togglePalette: () => void;
|
|
24
|
-
toggleMinimap: () => void;
|
|
25
|
-
toggleAIGenerator: () => void;
|
|
26
|
-
toggleDebugPanel: () => void;
|
|
27
|
-
setShowDebugPanel: (show: boolean) => void;
|
|
28
|
-
selectNode: (nodeId: string | null) => void;
|
|
29
|
-
selectEdge: (edgeId: string | null) => void;
|
|
30
|
-
setHighlightedNodeIds: (ids: string[]) => void;
|
|
31
|
-
openModal: (modal: ModalType) => void;
|
|
32
|
-
closeModal: () => void;
|
|
33
|
-
openNodeDetailModal: (nodeId: string, tab?: NodeDetailTab, startIndex?: number) => void;
|
|
34
|
-
closeNodeDetailModal: () => void;
|
|
35
|
-
setNodeDetailTab: (tab: NodeDetailTab) => void;
|
|
36
|
-
addNotification: (notification: Omit<Notification, 'id'>) => void;
|
|
37
|
-
removeNotification: (id: string) => void;
|
|
38
|
-
}
|
|
39
|
-
interface Notification {
|
|
40
|
-
id: string;
|
|
41
|
-
type: 'success' | 'error' | 'warning' | 'info';
|
|
42
|
-
title: string;
|
|
43
|
-
message?: string;
|
|
44
|
-
duration?: number;
|
|
45
|
-
}
|
|
46
|
-
declare const useUIStore: zustand.UseBoundStore<zustand.StoreApi<UIStore>>;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* EditOperation type inlined from @/lib/chat/editOperations.
|
|
50
|
-
* The consuming app provides the actual applyEditOperations implementation.
|
|
51
|
-
*/
|
|
52
|
-
interface EditOperation {
|
|
53
|
-
type: 'add_node' | 'remove_node' | 'update_node' | 'add_edge' | 'remove_edge';
|
|
54
|
-
[key: string]: unknown;
|
|
55
|
-
}
|
|
56
|
-
interface WorkflowSnapshot {
|
|
57
|
-
nodes: WorkflowNode[];
|
|
58
|
-
edges: WorkflowEdge[];
|
|
59
|
-
groups: NodeGroup[];
|
|
60
|
-
edgeStyle: EdgeStyle;
|
|
61
|
-
}
|
|
62
|
-
interface SnapshotSlice {
|
|
63
|
-
previousWorkflowSnapshot: WorkflowSnapshot | null;
|
|
64
|
-
manualChangeCount: number;
|
|
65
|
-
captureSnapshot: () => void;
|
|
66
|
-
revertToSnapshot: () => void;
|
|
67
|
-
clearSnapshot: () => void;
|
|
68
|
-
incrementManualChangeCount: () => void;
|
|
69
|
-
applyEditOperations: (operations: EditOperation[]) => {
|
|
70
|
-
applied: number;
|
|
71
|
-
skipped: string[];
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
interface ChatMessage {
|
|
76
|
-
id: string;
|
|
77
|
-
role: 'user' | 'assistant';
|
|
78
|
-
content: string;
|
|
79
|
-
timestamp: number;
|
|
80
|
-
}
|
|
81
|
-
interface ChatSlice {
|
|
82
|
-
chatMessages: ChatMessage[];
|
|
83
|
-
isChatOpen: boolean;
|
|
84
|
-
addChatMessage: (role: 'user' | 'assistant', content: string) => void;
|
|
85
|
-
clearChatMessages: () => void;
|
|
86
|
-
toggleChat: () => void;
|
|
87
|
-
setChatOpen: (open: boolean) => void;
|
|
88
|
-
applyChatEditOperations: (operations: EditOperation[]) => {
|
|
89
|
-
applied: number;
|
|
90
|
-
skipped: string[];
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
interface WorkflowData {
|
|
95
|
-
_id: string;
|
|
96
|
-
name: string;
|
|
97
|
-
nodes: WorkflowNode[];
|
|
98
|
-
edges: WorkflowEdge[];
|
|
99
|
-
edgeStyle: string;
|
|
100
|
-
groups?: NodeGroup[];
|
|
101
|
-
createdAt?: string;
|
|
102
|
-
updatedAt?: string;
|
|
103
|
-
}
|
|
104
|
-
interface WorkflowState {
|
|
105
|
-
nodes: WorkflowNode[];
|
|
106
|
-
edges: WorkflowEdge[];
|
|
107
|
-
edgeStyle: EdgeStyle;
|
|
108
|
-
workflowName: string;
|
|
109
|
-
workflowId: string | null;
|
|
110
|
-
isDirty: boolean;
|
|
111
|
-
isSaving: boolean;
|
|
112
|
-
isLoading: boolean;
|
|
113
|
-
groups: NodeGroup[];
|
|
114
|
-
selectedNodeIds: string[];
|
|
115
|
-
viewedCommentIds: Set<string>;
|
|
116
|
-
navigationTargetId: string | null;
|
|
117
|
-
}
|
|
118
|
-
interface NodeActions {
|
|
119
|
-
addNode: (type: NodeType, position: XYPosition) => string;
|
|
120
|
-
addNodesAndEdges: (nodes: WorkflowNode[], edges: WorkflowEdge[]) => void;
|
|
121
|
-
updateNodeData: <T extends WorkflowNodeData>(nodeId: string, data: Partial<T>) => void;
|
|
122
|
-
removeNode: (nodeId: string) => void;
|
|
123
|
-
duplicateNode: (nodeId: string) => string | null;
|
|
124
|
-
propagateOutputsDownstream: (sourceNodeId: string, outputValue?: string) => void;
|
|
125
|
-
}
|
|
126
|
-
interface ReactFlowActions {
|
|
127
|
-
onNodesChange: (changes: NodeChange<WorkflowNode>[]) => void;
|
|
128
|
-
onEdgesChange: (changes: EdgeChange<WorkflowEdge>[]) => void;
|
|
129
|
-
onConnect: (connection: Connection) => void;
|
|
130
|
-
}
|
|
131
|
-
interface EdgeActions {
|
|
132
|
-
removeEdge: (edgeId: string) => void;
|
|
133
|
-
setEdgeStyle: (style: EdgeStyle) => void;
|
|
134
|
-
toggleEdgePause: (edgeId: string) => void;
|
|
135
|
-
}
|
|
136
|
-
interface LockingActions {
|
|
137
|
-
_setNodeLockState: (predicate: (nodeId: string) => boolean, lock: boolean) => void;
|
|
138
|
-
toggleNodeLock: (nodeId: string) => void;
|
|
139
|
-
lockNode: (nodeId: string) => void;
|
|
140
|
-
unlockNode: (nodeId: string) => void;
|
|
141
|
-
lockMultipleNodes: (nodeIds: string[]) => void;
|
|
142
|
-
unlockMultipleNodes: (nodeIds: string[]) => void;
|
|
143
|
-
unlockAllNodes: () => void;
|
|
144
|
-
isNodeLocked: (nodeId: string) => boolean;
|
|
145
|
-
}
|
|
146
|
-
interface GroupActions {
|
|
147
|
-
createGroup: (nodeIds: string[], name?: string) => string;
|
|
148
|
-
deleteGroup: (groupId: string) => void;
|
|
149
|
-
addToGroup: (groupId: string, nodeIds: string[]) => void;
|
|
150
|
-
removeFromGroup: (groupId: string, nodeIds: string[]) => void;
|
|
151
|
-
toggleGroupLock: (groupId: string) => void;
|
|
152
|
-
renameGroup: (groupId: string, name: string) => void;
|
|
153
|
-
setGroupColor: (groupId: string, color: GroupColor) => void;
|
|
154
|
-
getGroupByNodeId: (nodeId: string) => NodeGroup | undefined;
|
|
155
|
-
getGroupById: (groupId: string) => NodeGroup | undefined;
|
|
156
|
-
}
|
|
157
|
-
interface SelectionActions {
|
|
158
|
-
setSelectedNodeIds: (nodeIds: string[]) => void;
|
|
159
|
-
addToSelection: (nodeId: string) => void;
|
|
160
|
-
removeFromSelection: (nodeId: string) => void;
|
|
161
|
-
clearSelection: () => void;
|
|
162
|
-
}
|
|
163
|
-
interface LocalWorkflowActions {
|
|
164
|
-
loadWorkflow: (workflow: WorkflowFile) => void;
|
|
165
|
-
clearWorkflow: () => void;
|
|
166
|
-
exportWorkflow: () => WorkflowFile;
|
|
167
|
-
}
|
|
168
|
-
interface ApiActions {
|
|
169
|
-
saveWorkflow: (signal?: AbortSignal) => Promise<WorkflowData>;
|
|
170
|
-
loadWorkflowById: (id: string, signal?: AbortSignal) => Promise<void>;
|
|
171
|
-
listWorkflows: (signal?: AbortSignal) => Promise<WorkflowData[]>;
|
|
172
|
-
deleteWorkflow: (id: string, signal?: AbortSignal) => Promise<void>;
|
|
173
|
-
duplicateWorkflowApi: (id: string, signal?: AbortSignal) => Promise<WorkflowData>;
|
|
174
|
-
createNewWorkflow: (signal?: AbortSignal) => Promise<string>;
|
|
175
|
-
setWorkflowName: (name: string) => void;
|
|
176
|
-
}
|
|
177
|
-
interface HelperActions$1 {
|
|
178
|
-
getNodeById: (id: string) => WorkflowNode | undefined;
|
|
179
|
-
getConnectedInputs: (nodeId: string) => Map<string, string | string[]>;
|
|
180
|
-
getConnectedNodeIds: (nodeIds: string[]) => string[];
|
|
181
|
-
validateWorkflow: () => ValidationResult;
|
|
182
|
-
isValidConnection: (connection: Connection) => boolean;
|
|
183
|
-
findCompatibleHandle: (sourceNodeId: string, sourceHandleId: string | null, targetNodeId: string) => string | null;
|
|
184
|
-
setDirty: (dirty: boolean) => void;
|
|
185
|
-
}
|
|
186
|
-
interface CommentNavigationActions {
|
|
187
|
-
getNodesWithComments: () => WorkflowNode[];
|
|
188
|
-
markCommentViewed: (nodeId: string) => void;
|
|
189
|
-
setNavigationTarget: (nodeId: string | null) => void;
|
|
190
|
-
getUnviewedCommentCount: () => number;
|
|
191
|
-
}
|
|
192
|
-
interface WorkflowStore extends WorkflowState, NodeActions, ReactFlowActions, EdgeActions, LockingActions, GroupActions, SelectionActions, LocalWorkflowActions, ApiActions, HelperActions$1, CommentNavigationActions, SnapshotSlice, ChatSlice {
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
declare const useWorkflowStore: zustand.UseBoundStore<Omit<zustand.StoreApi<WorkflowStore>, "temporal"> & {
|
|
196
|
-
temporal: zustand.StoreApi<zundo.TemporalState<{
|
|
197
|
-
nodes: _genfeedai_types.WorkflowNode[];
|
|
198
|
-
edges: _genfeedai_types.WorkflowEdge[];
|
|
199
|
-
groups: _genfeedai_types.NodeGroup[];
|
|
200
|
-
}>>;
|
|
201
|
-
}>;
|
|
202
|
-
|
|
203
|
-
interface DebugPayload {
|
|
204
|
-
nodeId: string;
|
|
205
|
-
nodeName: string;
|
|
206
|
-
nodeType: string;
|
|
207
|
-
model: string;
|
|
208
|
-
input: Record<string, unknown>;
|
|
209
|
-
timestamp: string;
|
|
210
|
-
}
|
|
211
|
-
interface Job {
|
|
212
|
-
nodeId: string;
|
|
213
|
-
predictionId: string;
|
|
214
|
-
status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'canceled';
|
|
215
|
-
progress: number;
|
|
216
|
-
output: unknown | null;
|
|
217
|
-
error: string | null;
|
|
218
|
-
createdAt: string;
|
|
219
|
-
}
|
|
220
|
-
interface NodeExecution {
|
|
221
|
-
executionId: string;
|
|
222
|
-
nodeIds: string[];
|
|
223
|
-
eventSource: EventSource;
|
|
224
|
-
}
|
|
225
|
-
interface ExecutionState {
|
|
226
|
-
isRunning: boolean;
|
|
227
|
-
executionId: string | null;
|
|
228
|
-
currentNodeId: string | null;
|
|
229
|
-
/** Node IDs being executed (for partial execution). Empty = all nodes */
|
|
230
|
-
executingNodeIds: string[];
|
|
231
|
-
validationErrors: ValidationResult | null;
|
|
232
|
-
eventSource: EventSource | null;
|
|
233
|
-
lastFailedNodeId: string | null;
|
|
234
|
-
pausedAtNodeId: string | null;
|
|
235
|
-
jobs: Map<string, Job>;
|
|
236
|
-
estimatedCost: number;
|
|
237
|
-
actualCost: number;
|
|
238
|
-
debugPayloads: DebugPayload[];
|
|
239
|
-
/** Independent per-node executions (Generate button clicks) */
|
|
240
|
-
activeNodeExecutions: Map<string, NodeExecution>;
|
|
241
|
-
}
|
|
242
|
-
interface ExecutionActions {
|
|
243
|
-
executeWorkflow: () => Promise<void>;
|
|
244
|
-
executeSelectedNodes: () => Promise<void>;
|
|
245
|
-
executeNode: (nodeId: string) => Promise<void>;
|
|
246
|
-
resumeFromFailed: () => Promise<void>;
|
|
247
|
-
stopExecution: () => void;
|
|
248
|
-
stopNodeExecution: (nodeId: string) => void;
|
|
249
|
-
isNodeExecuting: (nodeId: string) => boolean;
|
|
250
|
-
clearValidationErrors: () => void;
|
|
251
|
-
}
|
|
252
|
-
interface JobActions {
|
|
253
|
-
addJob: (nodeId: string, predictionId: string) => void;
|
|
254
|
-
updateJob: (predictionId: string, updates: Partial<Job>) => void;
|
|
255
|
-
getJobByNodeId: (nodeId: string) => Job | undefined;
|
|
256
|
-
}
|
|
257
|
-
interface HelperActions {
|
|
258
|
-
resetExecution: () => void;
|
|
259
|
-
canResumeFromFailed: () => boolean;
|
|
260
|
-
setEstimatedCost: (cost: number) => void;
|
|
261
|
-
addDebugPayload: (payload: DebugPayload) => void;
|
|
262
|
-
clearDebugPayloads: () => void;
|
|
263
|
-
}
|
|
264
|
-
interface ExecutionStore extends ExecutionState, ExecutionActions, JobActions, HelperActions {
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Execution Store
|
|
269
|
-
*
|
|
270
|
-
* Manages workflow execution state including jobs, validation, and SSE subscriptions.
|
|
271
|
-
* Split into slices for maintainability:
|
|
272
|
-
*
|
|
273
|
-
* - executionSlice: Core execution operations (run, stop, resume)
|
|
274
|
-
* - jobSlice: Job tracking and management
|
|
275
|
-
*/
|
|
276
|
-
declare const useExecutionStore: zustand.UseBoundStore<zustand.StoreApi<ExecutionStore>>;
|
|
277
|
-
|
|
278
|
-
interface ProviderConfig {
|
|
279
|
-
apiKey: string | null;
|
|
280
|
-
enabled: boolean;
|
|
281
|
-
}
|
|
282
|
-
interface ProviderSettings {
|
|
283
|
-
replicate: ProviderConfig;
|
|
284
|
-
fal: ProviderConfig;
|
|
285
|
-
huggingface: ProviderConfig;
|
|
286
|
-
'genfeed-ai': ProviderConfig;
|
|
287
|
-
}
|
|
288
|
-
interface DefaultModelSettings {
|
|
289
|
-
imageModel: string;
|
|
290
|
-
imageProvider: ProviderType;
|
|
291
|
-
videoModel: string;
|
|
292
|
-
videoProvider: ProviderType;
|
|
293
|
-
}
|
|
294
|
-
interface RecentModel {
|
|
295
|
-
id: string;
|
|
296
|
-
displayName: string;
|
|
297
|
-
provider: ProviderType;
|
|
298
|
-
timestamp: number;
|
|
299
|
-
}
|
|
300
|
-
interface SettingsStore {
|
|
301
|
-
providers: ProviderSettings;
|
|
302
|
-
defaults: DefaultModelSettings;
|
|
303
|
-
edgeStyle: EdgeStyle;
|
|
304
|
-
showMinimap: boolean;
|
|
305
|
-
autoSaveEnabled: boolean;
|
|
306
|
-
recentModels: RecentModel[];
|
|
307
|
-
hasSeenWelcome: boolean;
|
|
308
|
-
debugMode: boolean;
|
|
309
|
-
toggleAutoSave: () => void;
|
|
310
|
-
setDebugMode: (enabled: boolean) => void;
|
|
311
|
-
setProviderKey: (provider: ProviderType, key: string | null) => void;
|
|
312
|
-
setProviderEnabled: (provider: ProviderType, enabled: boolean) => void;
|
|
313
|
-
setDefaultModel: (type: 'image' | 'video', model: string, provider: ProviderType) => void;
|
|
314
|
-
setEdgeStyle: (style: EdgeStyle) => void;
|
|
315
|
-
setShowMinimap: (show: boolean) => void;
|
|
316
|
-
addRecentModel: (model: Omit<RecentModel, 'timestamp'>) => void;
|
|
317
|
-
clearProviderKey: (provider: ProviderType) => void;
|
|
318
|
-
clearAllKeys: () => void;
|
|
319
|
-
setHasSeenWelcome: (seen: boolean) => void;
|
|
320
|
-
isProviderConfigured: (provider: ProviderType) => boolean;
|
|
321
|
-
getProviderHeader: (provider: ProviderType) => Record<string, string>;
|
|
322
|
-
isSyncing: boolean;
|
|
323
|
-
syncFromServer: () => Promise<void>;
|
|
324
|
-
syncToServer: () => Promise<void>;
|
|
325
|
-
}
|
|
326
|
-
declare const useSettingsStore: zustand.UseBoundStore<zustand.StoreApi<SettingsStore>>;
|
|
327
|
-
declare const PROVIDER_INFO: Record<ProviderType, {
|
|
328
|
-
name: string;
|
|
329
|
-
description: string;
|
|
330
|
-
docsUrl: string;
|
|
331
|
-
}>;
|
|
332
|
-
|
|
333
|
-
interface PromptEditorStore {
|
|
334
|
-
isOpen: boolean;
|
|
335
|
-
nodeId: string | null;
|
|
336
|
-
prompt: string;
|
|
337
|
-
fontSize: number;
|
|
338
|
-
openEditor: (nodeId: string, prompt: string) => void;
|
|
339
|
-
closeEditor: () => void;
|
|
340
|
-
setPrompt: (prompt: string) => void;
|
|
341
|
-
setFontSize: (size: number) => void;
|
|
342
|
-
saveAndClose: () => {
|
|
343
|
-
nodeId: string;
|
|
344
|
-
prompt: string;
|
|
345
|
-
} | null;
|
|
346
|
-
}
|
|
347
|
-
declare const usePromptEditorStore: zustand.UseBoundStore<zustand.StoreApi<PromptEditorStore>>;
|
|
348
|
-
|
|
349
|
-
type AnnotationTool = 'select' | 'rectangle' | 'circle' | 'arrow' | 'freehand' | 'text';
|
|
350
|
-
interface ToolOptions {
|
|
351
|
-
strokeColor: string;
|
|
352
|
-
strokeWidth: number;
|
|
353
|
-
fillColor: string | null;
|
|
354
|
-
fontSize: number;
|
|
355
|
-
}
|
|
356
|
-
interface BaseShape {
|
|
357
|
-
id: string;
|
|
358
|
-
type: AnnotationTool;
|
|
359
|
-
strokeColor: string;
|
|
360
|
-
strokeWidth: number;
|
|
361
|
-
fillColor: string | null;
|
|
362
|
-
}
|
|
363
|
-
interface RectangleShape extends BaseShape {
|
|
364
|
-
type: 'rectangle';
|
|
365
|
-
x: number;
|
|
366
|
-
y: number;
|
|
367
|
-
width: number;
|
|
368
|
-
height: number;
|
|
369
|
-
}
|
|
370
|
-
interface CircleShape extends BaseShape {
|
|
371
|
-
type: 'circle';
|
|
372
|
-
x: number;
|
|
373
|
-
y: number;
|
|
374
|
-
radius: number;
|
|
375
|
-
}
|
|
376
|
-
interface ArrowShape extends BaseShape {
|
|
377
|
-
type: 'arrow';
|
|
378
|
-
points: number[];
|
|
379
|
-
}
|
|
380
|
-
interface FreehandShape extends BaseShape {
|
|
381
|
-
type: 'freehand';
|
|
382
|
-
points: number[];
|
|
383
|
-
}
|
|
384
|
-
interface TextShape extends BaseShape {
|
|
385
|
-
type: 'text';
|
|
386
|
-
x: number;
|
|
387
|
-
y: number;
|
|
388
|
-
text: string;
|
|
389
|
-
fontSize: number;
|
|
390
|
-
}
|
|
391
|
-
type AnnotationShape = RectangleShape | CircleShape | ArrowShape | FreehandShape | TextShape;
|
|
392
|
-
interface AnnotationStore {
|
|
393
|
-
isOpen: boolean;
|
|
394
|
-
nodeId: string | null;
|
|
395
|
-
sourceImage: string | null;
|
|
396
|
-
shapes: AnnotationShape[];
|
|
397
|
-
selectedShapeId: string | null;
|
|
398
|
-
currentTool: AnnotationTool;
|
|
399
|
-
toolOptions: ToolOptions;
|
|
400
|
-
history: AnnotationShape[][];
|
|
401
|
-
historyIndex: number;
|
|
402
|
-
isDrawing: boolean;
|
|
403
|
-
drawingShape: Partial<AnnotationShape> | null;
|
|
404
|
-
openAnnotation: (nodeId: string, image: string, existingShapes?: AnnotationShape[]) => void;
|
|
405
|
-
closeAnnotation: () => void;
|
|
406
|
-
saveAndClose: () => {
|
|
407
|
-
nodeId: string;
|
|
408
|
-
shapes: AnnotationShape[];
|
|
409
|
-
} | null;
|
|
410
|
-
addShape: (shape: AnnotationShape) => void;
|
|
411
|
-
updateShape: (id: string, updates: Partial<AnnotationShape>) => void;
|
|
412
|
-
deleteShape: (id: string) => void;
|
|
413
|
-
selectShape: (id: string | null) => void;
|
|
414
|
-
clearShapes: () => void;
|
|
415
|
-
setTool: (tool: AnnotationTool) => void;
|
|
416
|
-
setToolOptions: (options: Partial<ToolOptions>) => void;
|
|
417
|
-
startDrawing: (shape: Partial<AnnotationShape>) => void;
|
|
418
|
-
updateDrawing: (updates: Partial<AnnotationShape>) => void;
|
|
419
|
-
finishDrawing: () => void;
|
|
420
|
-
cancelDrawing: () => void;
|
|
421
|
-
undo: () => void;
|
|
422
|
-
redo: () => void;
|
|
423
|
-
canUndo: () => boolean;
|
|
424
|
-
canRedo: () => boolean;
|
|
425
|
-
}
|
|
426
|
-
declare const useAnnotationStore: zustand.UseBoundStore<zustand.StoreApi<AnnotationStore>>;
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* Configure the prompt library store with an API service.
|
|
430
|
-
* Called by WorkflowUIProvider when a promptLibrary service is provided.
|
|
431
|
-
*
|
|
432
|
-
* This pattern is used because Zustand stores exist outside the React tree
|
|
433
|
-
* and cannot use useContext directly.
|
|
434
|
-
*/
|
|
435
|
-
declare function configurePromptLibrary(api: PromptLibraryService): void;
|
|
436
|
-
interface PromptLibraryStore {
|
|
437
|
-
items: IPrompt[];
|
|
438
|
-
featuredItems: IPrompt[];
|
|
439
|
-
selectedItem: IPrompt | null;
|
|
440
|
-
isLoading: boolean;
|
|
441
|
-
error: string | null;
|
|
442
|
-
searchQuery: string;
|
|
443
|
-
categoryFilter: PromptCategory | null;
|
|
444
|
-
isPickerOpen: boolean;
|
|
445
|
-
isCreateModalOpen: boolean;
|
|
446
|
-
editingItem: IPrompt | null;
|
|
447
|
-
setSearchQuery: (query: string) => void;
|
|
448
|
-
setCategoryFilter: (category: PromptCategory | null) => void;
|
|
449
|
-
setSelectedItem: (item: IPrompt | null) => void;
|
|
450
|
-
openPicker: () => void;
|
|
451
|
-
closePicker: () => void;
|
|
452
|
-
openCreateModal: (editItem?: IPrompt) => void;
|
|
453
|
-
closeCreateModal: () => void;
|
|
454
|
-
loadItems: (query?: IQueryPrompts, signal?: AbortSignal) => Promise<void>;
|
|
455
|
-
loadFeatured: (signal?: AbortSignal) => Promise<void>;
|
|
456
|
-
createItem: (data: ICreatePrompt, signal?: AbortSignal) => Promise<IPrompt>;
|
|
457
|
-
updateItem: (id: string, data: Partial<ICreatePrompt>, signal?: AbortSignal) => Promise<IPrompt>;
|
|
458
|
-
deleteItem: (id: string, signal?: AbortSignal) => Promise<void>;
|
|
459
|
-
duplicateItem: (id: string, signal?: AbortSignal) => Promise<IPrompt>;
|
|
460
|
-
recordItemUsage: (id: string, signal?: AbortSignal) => Promise<IPrompt>;
|
|
461
|
-
}
|
|
462
|
-
declare const usePromptLibraryStore: zustand.UseBoundStore<zustand.StoreApi<PromptLibraryStore>>;
|
|
463
|
-
|
|
464
|
-
export { type AnnotationTool as A, type BaseShape as B, type CircleShape as C, type DebugPayload as D, type ExecutionStore as E, type FreehandShape as F, type Job as J, type ModalType as M, type NodeDetailTab as N, type ProviderConfig as P, type RecentModel as R, type ToolOptions as T, type WorkflowStore as W, useWorkflowStore as a, useExecutionStore as b, useSettingsStore as c, usePromptEditorStore as d, useAnnotationStore as e, usePromptLibraryStore as f, configurePromptLibrary as g, type WorkflowData as h, type WorkflowState as i, type ProviderSettings as j, type DefaultModelSettings as k, PROVIDER_INFO as l, type RectangleShape as m, type ArrowShape as n, type TextShape as o, type AnnotationShape as p, useUIStore as u };
|
package/dist/provider.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { W as WorkflowUIConfig } from './types-ipAnBzAJ.js';
|
|
4
|
-
export { F as FileUploadService, M as ModelBrowserModalProps, b as ModelSchemaService, P as PromptLibraryService, a as PromptPickerProps } from './types-ipAnBzAJ.js';
|
|
5
|
-
import '@genfeedai/types';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Provider that injects app-specific dependencies into workflow-ui components.
|
|
9
|
-
*
|
|
10
|
-
* Nodes use `useWorkflowUIConfig()` to access:
|
|
11
|
-
* - File upload service (ImageInputNode, VideoInputNode)
|
|
12
|
-
* - Model schema service (AI gen nodes)
|
|
13
|
-
* - Prompt library service (PromptNode)
|
|
14
|
-
* - ModelBrowserModal component (ImageGenNode, VideoGenNode, LLMNode)
|
|
15
|
-
* - PromptPicker component (PromptNode)
|
|
16
|
-
*
|
|
17
|
-
* Components gracefully degrade when services are not provided.
|
|
18
|
-
*/
|
|
19
|
-
declare function WorkflowUIProvider({ config, children, }: {
|
|
20
|
-
config: WorkflowUIConfig;
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
}): react_jsx_runtime.JSX.Element;
|
|
23
|
-
/**
|
|
24
|
-
* Hook to access the workflow UI configuration from the provider.
|
|
25
|
-
* Returns an empty config object if used outside a WorkflowUIProvider.
|
|
26
|
-
*/
|
|
27
|
-
declare function useWorkflowUIConfig(): WorkflowUIConfig;
|
|
28
|
-
|
|
29
|
-
export { WorkflowUIConfig, WorkflowUIProvider, useWorkflowUIConfig };
|
package/dist/provider.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require('./chunk-5LQ4QBR5.js');
|
|
4
|
-
var chunkRJ262NXS_js = require('./chunk-RJ262NXS.js');
|
|
5
|
-
require('./chunk-RXNEDWK2.js');
|
|
6
|
-
require('./chunk-4MZ62VMF.js');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, "WorkflowUIProvider", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () { return chunkRJ262NXS_js.WorkflowUIProvider; }
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "useWorkflowUIConfig", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return chunkRJ262NXS_js.useWorkflowUIConfig; }
|
|
17
|
-
});
|
package/dist/stores.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { W as WorkflowStore } from './promptLibraryStore-BZnfmEkc.js';
|
|
2
|
-
export { p as AnnotationShape, A as AnnotationTool, n as ArrowShape, B as BaseShape, C as CircleShape, D as DebugPayload, k as DefaultModelSettings, E as ExecutionStore, F as FreehandShape, J as Job, M as ModalType, N as NodeDetailTab, l as PROVIDER_INFO, P as ProviderConfig, j as ProviderSettings, R as RecentModel, m as RectangleShape, o as TextShape, T as ToolOptions, h as WorkflowData, i as WorkflowState, g as configurePromptLibrary, e as useAnnotationStore, b as useExecutionStore, d as usePromptEditorStore, f as usePromptLibraryStore, c as useSettingsStore, u as useUIStore, a as useWorkflowStore } from './promptLibraryStore-BZnfmEkc.js';
|
|
3
|
-
import * as _xyflow_react from '@xyflow/react';
|
|
4
|
-
import * as _genfeedai_types from '@genfeedai/types';
|
|
5
|
-
import 'zustand';
|
|
6
|
-
import 'zundo';
|
|
7
|
-
import './types-ipAnBzAJ.js';
|
|
8
|
-
import 'react';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Stable Zustand Selectors
|
|
12
|
-
*
|
|
13
|
-
* Pre-defined selectors to avoid inline function recreation in components.
|
|
14
|
-
* Using stable selector references prevents unnecessary re-subscriptions
|
|
15
|
-
* and improves React Flow performance.
|
|
16
|
-
*
|
|
17
|
-
* Usage:
|
|
18
|
-
* import { selectNodes, selectUpdateNodeData } from '../stores/workflow/selectors';
|
|
19
|
-
* const nodes = useWorkflowStore(selectNodes);
|
|
20
|
-
* const updateNodeData = useWorkflowStore(selectUpdateNodeData);
|
|
21
|
-
*/
|
|
22
|
-
/** Select all nodes */
|
|
23
|
-
declare const selectNodes: (state: WorkflowStore) => _genfeedai_types.WorkflowNode[];
|
|
24
|
-
/** Select all edges */
|
|
25
|
-
declare const selectEdges: (state: WorkflowStore) => _genfeedai_types.WorkflowEdge[];
|
|
26
|
-
/** Select all groups */
|
|
27
|
-
declare const selectGroups: (state: WorkflowStore) => _genfeedai_types.NodeGroup[];
|
|
28
|
-
/** Select selected node IDs */
|
|
29
|
-
declare const selectSelectedNodeIds: (state: WorkflowStore) => string[];
|
|
30
|
-
/** Select workflow name */
|
|
31
|
-
declare const selectWorkflowName: (state: WorkflowStore) => string;
|
|
32
|
-
/** Select workflow ID */
|
|
33
|
-
declare const selectWorkflowId: (state: WorkflowStore) => string | null;
|
|
34
|
-
/** Select dirty state */
|
|
35
|
-
declare const selectIsDirty: (state: WorkflowStore) => boolean;
|
|
36
|
-
/** Select saving state */
|
|
37
|
-
declare const selectIsSaving: (state: WorkflowStore) => boolean;
|
|
38
|
-
/** Select loading state */
|
|
39
|
-
declare const selectIsLoading: (state: WorkflowStore) => boolean;
|
|
40
|
-
/** Select edge style */
|
|
41
|
-
declare const selectEdgeStyle: (state: WorkflowStore) => "default" | "smoothstep" | "straight";
|
|
42
|
-
/** Select navigation target ID */
|
|
43
|
-
declare const selectNavigationTargetId: (state: WorkflowStore) => string | null;
|
|
44
|
-
/** Select updateNodeData action */
|
|
45
|
-
declare const selectUpdateNodeData: (state: WorkflowStore) => <T extends _genfeedai_types.WorkflowNodeData>(nodeId: string, data: Partial<T>) => void;
|
|
46
|
-
/** Select addNode action */
|
|
47
|
-
declare const selectAddNode: (state: WorkflowStore) => (type: _genfeedai_types.NodeType, position: _xyflow_react.XYPosition) => string;
|
|
48
|
-
/** Select removeNode action */
|
|
49
|
-
declare const selectRemoveNode: (state: WorkflowStore) => (nodeId: string) => void;
|
|
50
|
-
/** Select duplicateNode action */
|
|
51
|
-
declare const selectDuplicateNode: (state: WorkflowStore) => (nodeId: string) => string | null;
|
|
52
|
-
/** Select onNodesChange action */
|
|
53
|
-
declare const selectOnNodesChange: (state: WorkflowStore) => (changes: _xyflow_react.NodeChange<_genfeedai_types.WorkflowNode>[]) => void;
|
|
54
|
-
/** Select onEdgesChange action */
|
|
55
|
-
declare const selectOnEdgesChange: (state: WorkflowStore) => (changes: _xyflow_react.EdgeChange<_genfeedai_types.WorkflowEdge>[]) => void;
|
|
56
|
-
/** Select onConnect action */
|
|
57
|
-
declare const selectOnConnect: (state: WorkflowStore) => (connection: _xyflow_react.Connection) => void;
|
|
58
|
-
/** Select setSelectedNodeIds action */
|
|
59
|
-
declare const selectSetSelectedNodeIds: (state: WorkflowStore) => (nodeIds: string[]) => void;
|
|
60
|
-
/** Select toggleNodeLock action */
|
|
61
|
-
declare const selectToggleNodeLock: (state: WorkflowStore) => (nodeId: string) => void;
|
|
62
|
-
/** Select createGroup action */
|
|
63
|
-
declare const selectCreateGroup: (state: WorkflowStore) => (nodeIds: string[], name?: string) => string;
|
|
64
|
-
/** Select deleteGroup action */
|
|
65
|
-
declare const selectDeleteGroup: (state: WorkflowStore) => (groupId: string) => void;
|
|
66
|
-
/** Select unlockAllNodes action */
|
|
67
|
-
declare const selectUnlockAllNodes: (state: WorkflowStore) => () => void;
|
|
68
|
-
/** Select setDirty action */
|
|
69
|
-
declare const selectSetDirty: (state: WorkflowStore) => (dirty: boolean) => void;
|
|
70
|
-
/** Select removeEdge action */
|
|
71
|
-
declare const selectRemoveEdge: (state: WorkflowStore) => (edgeId: string) => void;
|
|
72
|
-
/** Select addNodesAndEdges action */
|
|
73
|
-
declare const selectAddNodesAndEdges: (state: WorkflowStore) => (nodes: _genfeedai_types.WorkflowNode[], edges: _genfeedai_types.WorkflowEdge[]) => void;
|
|
74
|
-
/** Select getNodeById helper */
|
|
75
|
-
declare const selectGetNodeById: (state: WorkflowStore) => (id: string) => _genfeedai_types.WorkflowNode | undefined;
|
|
76
|
-
/** Select getConnectedNodeIds helper */
|
|
77
|
-
declare const selectGetConnectedNodeIds: (state: WorkflowStore) => (nodeIds: string[]) => string[];
|
|
78
|
-
/** Select isValidConnection helper */
|
|
79
|
-
declare const selectIsValidConnection: (state: WorkflowStore) => (connection: _xyflow_react.Connection) => boolean;
|
|
80
|
-
/** Select findCompatibleHandle helper */
|
|
81
|
-
declare const selectFindCompatibleHandle: (state: WorkflowStore) => (sourceNodeId: string, sourceHandleId: string | null, targetNodeId: string) => string | null;
|
|
82
|
-
/**
|
|
83
|
-
* Create a selector for a specific node by ID
|
|
84
|
-
* Note: Creates new function each call - memoize at call site if needed
|
|
85
|
-
*/
|
|
86
|
-
declare const createSelectNodeById: (id: string) => (state: WorkflowStore) => _genfeedai_types.WorkflowNode | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* Create a selector for checking if a node is in selection
|
|
89
|
-
*/
|
|
90
|
-
declare const createSelectIsNodeSelected: (id: string) => (state: WorkflowStore) => boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Create a selector for a group containing a node
|
|
93
|
-
*/
|
|
94
|
-
declare const createSelectGroupByNodeId: (nodeId: string) => (state: WorkflowStore) => _genfeedai_types.NodeGroup | undefined;
|
|
95
|
-
|
|
96
|
-
export { WorkflowStore, createSelectGroupByNodeId, createSelectIsNodeSelected, createSelectNodeById, selectAddNode, selectAddNodesAndEdges, selectCreateGroup, selectDeleteGroup, selectDuplicateNode, selectEdgeStyle, selectEdges, selectFindCompatibleHandle, selectGetConnectedNodeIds, selectGetNodeById, selectGroups, selectIsDirty, selectIsLoading, selectIsSaving, selectIsValidConnection, selectNavigationTargetId, selectNodes, selectOnConnect, selectOnEdgesChange, selectOnNodesChange, selectRemoveEdge, selectRemoveNode, selectSelectedNodeIds, selectSetDirty, selectSetSelectedNodeIds, selectToggleNodeLock, selectUnlockAllNodes, selectUpdateNodeData, selectWorkflowId, selectWorkflowName };
|