ugcinc 4.1.0 → 4.1.2

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.
Files changed (64) hide show
  1. package/dist/automations/nodes/account.d.ts +3 -14
  2. package/dist/automations/nodes/auto-caption.d.ts +17 -57
  3. package/dist/automations/nodes/auto-caption.js +15 -11
  4. package/dist/automations/nodes/auto-post.d.ts +7 -65
  5. package/dist/automations/nodes/auto-post.js +3 -4
  6. package/dist/automations/nodes/branch.d.ts +9 -45
  7. package/dist/automations/nodes/branch.js +0 -3
  8. package/dist/automations/nodes/collect.d.ts +4 -12
  9. package/dist/automations/nodes/collect.js +3 -7
  10. package/dist/automations/nodes/compose-workflow.d.ts +3 -15
  11. package/dist/automations/nodes/compose-workflow.js +33 -14
  12. package/dist/automations/nodes/create-dm.d.ts +20 -80
  13. package/dist/automations/nodes/create-dm.js +28 -30
  14. package/dist/automations/nodes/custom-model.d.ts +4 -4
  15. package/dist/automations/nodes/deduplicate.d.ts +2 -2
  16. package/dist/automations/nodes/destructure.d.ts +4 -3
  17. package/dist/automations/nodes/destructure.js +1 -1
  18. package/dist/automations/nodes/for-each.d.ts +2 -2
  19. package/dist/automations/nodes/generate-image.d.ts +2 -2
  20. package/dist/automations/nodes/generate-video.d.ts +2 -2
  21. package/dist/automations/nodes/if.d.ts +2 -2
  22. package/dist/automations/nodes/image-composer.d.ts +35 -21
  23. package/dist/automations/nodes/image-composer.js +40 -0
  24. package/dist/automations/nodes/index.d.ts +299 -7
  25. package/dist/automations/nodes/index.js +6 -7
  26. package/dist/automations/nodes/internal.d.ts +8 -0
  27. package/dist/automations/nodes/internal.js +10 -0
  28. package/dist/automations/nodes/llm.d.ts +2 -2
  29. package/dist/automations/nodes/manual-trigger.d.ts +10 -29
  30. package/dist/automations/nodes/manual-trigger.js +1 -1
  31. package/dist/automations/nodes/media.d.ts +4 -7
  32. package/dist/automations/nodes/not.d.ts +2 -2
  33. package/dist/automations/nodes/output.d.ts +4 -17
  34. package/dist/automations/nodes/random-route.d.ts +4 -31
  35. package/dist/automations/nodes/random-route.js +5 -5
  36. package/dist/automations/nodes/random.d.ts +4 -3
  37. package/dist/automations/nodes/random.js +3 -3
  38. package/dist/automations/nodes/recurrence.d.ts +4 -43
  39. package/dist/automations/nodes/recurrence.js +1 -1
  40. package/dist/automations/nodes/save-to-media.d.ts +4 -20
  41. package/dist/automations/nodes/save-to-media.js +1 -1
  42. package/dist/automations/nodes/screenshot-animation.d.ts +2 -2
  43. package/dist/automations/nodes/social-audio.d.ts +2 -2
  44. package/dist/automations/nodes/text.d.ts +2 -2
  45. package/dist/automations/nodes/transcript.d.ts +2 -2
  46. package/dist/automations/nodes/types.d.ts +44 -20
  47. package/dist/automations/nodes/types.js +1 -1
  48. package/dist/automations/nodes/video-composer.d.ts +2 -10
  49. package/dist/automations/nodes/video-composer.js +65 -19
  50. package/dist/automations/nodes/video-import.d.ts +2 -19
  51. package/dist/automations/nodes/video-import.js +2 -16
  52. package/dist/automations/types.d.ts +45 -158
  53. package/dist/automations/types.js +4 -76
  54. package/dist/graph-controller.d.ts +28 -11
  55. package/dist/graph-controller.js +53 -20
  56. package/dist/index.d.ts +37 -22
  57. package/dist/index.js +9 -2
  58. package/dist/render/compositions/IMessageDmComposition/types.d.ts +6 -6
  59. package/dist/render/compositions/ImageEditorComposition.js +2 -8
  60. package/dist/render/compositions/VideoEditorComposition.js +2 -24
  61. package/dist/render/types/element.d.ts +0 -33
  62. package/dist/render/types/index.d.ts +1 -1
  63. package/dist/render.d.ts +2 -1
  64. package/package.json +1 -1
@@ -31,26 +31,32 @@ const definition = (0, types_1.defineNode)({
31
31
  if (editorConfig) {
32
32
  editorConfig.channels.forEach(channel => {
33
33
  channel.segments.forEach(segment => {
34
- if (segment.inputRef && !addedIds.has(segment.inputRef)) {
35
- addedIds.add(segment.inputRef);
36
- const inputType = segment.type === 'video' ? 'video'
37
- : segment.type === 'audio' ? 'audio'
38
- : 'image';
39
- inputs.push({
40
- id: segment.inputRef,
41
- type: inputType,
42
- isArray: false,
43
- required: segment.required ?? true,
44
- });
34
+ // inputRef exists on all segments except 'text'
35
+ if (segment.type !== 'text') {
36
+ if (segment.inputRef && !addedIds.has(segment.inputRef)) {
37
+ addedIds.add(segment.inputRef);
38
+ const inputType = segment.type === 'video' || segment.type === 'video-sequence' ? 'video'
39
+ : segment.type === 'audio' ? 'audio'
40
+ : 'image';
41
+ inputs.push({
42
+ id: segment.inputRef,
43
+ type: inputType,
44
+ isArray: segment.type === 'image-sequence' || segment.type === 'video-sequence',
45
+ required: segment.required ?? true,
46
+ });
47
+ }
45
48
  }
46
- if (segment.textInputRef && !addedIds.has(segment.textInputRef)) {
47
- addedIds.add(segment.textInputRef);
48
- inputs.push({
49
- id: segment.textInputRef,
50
- type: 'text',
51
- isArray: false,
52
- required: segment.required ?? true,
53
- });
49
+ // textInputRef only exists on 'text' segments
50
+ if (segment.type === 'text') {
51
+ if (segment.textInputRef && !addedIds.has(segment.textInputRef)) {
52
+ addedIds.add(segment.textInputRef);
53
+ inputs.push({
54
+ id: segment.textInputRef,
55
+ type: 'text',
56
+ isArray: false,
57
+ required: segment.required ?? true,
58
+ });
59
+ }
54
60
  }
55
61
  });
56
62
  });
@@ -67,5 +73,45 @@ const definition = (0, types_1.defineNode)({
67
73
  ],
68
74
  };
69
75
  },
76
+ resolvePreview: (config) => {
77
+ const editorConfig = config?.videoEditor;
78
+ if (!editorConfig)
79
+ return null;
80
+ const sources = {};
81
+ const textContent = {};
82
+ // Resolve segments: inputRef/textInputRef -> segment.id
83
+ for (const channel of editorConfig.channels) {
84
+ for (const segment of channel.segments) {
85
+ if (segment.type !== 'text') {
86
+ // Media segments with inputRef
87
+ if (segment.inputRef) {
88
+ const url = editorConfig.previewUrls?.[segment.inputRef];
89
+ if (url) {
90
+ sources[segment.id] = url;
91
+ }
92
+ }
93
+ }
94
+ else {
95
+ // Text segments with textInputRef
96
+ if (segment.textInputRef) {
97
+ const text = editorConfig.previewTextValues?.[segment.textInputRef];
98
+ if (text) {
99
+ textContent[segment.id] = text;
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+ return {
106
+ renderConfig: {
107
+ width: editorConfig.width,
108
+ height: editorConfig.height,
109
+ fps: editorConfig.fps,
110
+ channels: editorConfig.channels,
111
+ },
112
+ sources,
113
+ textContent,
114
+ };
115
+ },
70
116
  });
71
117
  exports.default = definition;
@@ -1,27 +1,10 @@
1
- /**
2
- * Supported platforms for video import
3
- * Note: YouTube is not yet implemented
4
- */
5
1
  export type VideoImportPlatform = 'youtube' | 'tiktok' | 'instagram';
6
- /**
7
- * Video quality options for video import
8
- */
9
2
  export type VideoImportQuality = '360' | '480' | '720' | '1080' | '1440' | '2160';
10
- /**
11
- * Video Import node configuration - imports videos from social media platforms
12
- * Note: URL is received via input port, not stored in config
13
- */
14
- export interface VideoImportNodeConfig {
15
- /** Platform to import from */
16
- platform: VideoImportPlatform;
17
- /** Video quality preference */
18
- videoQuality?: VideoImportQuality;
19
- }
20
3
  declare const definition: import("./types").NodeDefinition<"source", {
21
4
  platform: VideoImportPlatform;
22
5
  videoQuality: VideoImportQuality;
23
6
  outputMode: "per-input";
24
7
  selectionMode: "random";
25
- }>;
8
+ }, false>;
26
9
  export default definition;
27
- export type VideoImportConfig = typeof definition.defaults;
10
+ export type VideoImportNodeConfig = typeof definition.defaults;
@@ -16,22 +16,8 @@ const definition = (0, types_1.defineNode)({
16
16
  selectionMode: 'random',
17
17
  },
18
18
  computePorts: () => ({
19
- inputs: [
20
- {
21
- id: 'url',
22
- type: 'text',
23
- isArray: false,
24
- required: true,
25
- },
26
- ],
27
- outputs: [
28
- {
29
- id: 'video',
30
- type: 'video',
31
- isArray: false,
32
- required: true,
33
- },
34
- ],
19
+ inputs: [{ id: 'url', type: 'text', isArray: false, required: true }],
20
+ outputs: [{ id: 'video', type: 'video', isArray: false, required: true }],
35
21
  }),
36
22
  });
37
23
  exports.default = definition;
@@ -3,21 +3,8 @@
3
3
  *
4
4
  * Core types for the automation system including ports, selection, and output modes.
5
5
  */
6
- import type { ObjectSchemaField } from './nodes/types';
7
- import type { VideoEditorNodeConfig, ImageEditorNodeConfig } from '../render/types';
8
- import type { ManualTriggerNodeConfig } from './nodes/manual-trigger';
9
- import type { RecurrenceNodeConfig } from './nodes/recurrence';
10
- import type { OutputNodeConfig } from './nodes/output';
11
- import type { AccountNodeConfig } from './nodes/account';
12
- import type { AutoPostNodeConfig } from './nodes/auto-post';
13
- import type { SaveToMediaNodeConfig } from './nodes/save-to-media';
14
- import type { VideoImportNodeConfig } from './nodes/video-import';
15
- import type { RandomRouteNodeConfig } from './nodes/random-route';
16
- import type { BranchNodeConfig } from './nodes/branch';
17
- import type { AutoCaptionNodeConfig } from './nodes/auto-caption';
18
- import type { ScreenshotAnimationConfig } from './nodes/screenshot-animation';
19
- import type { CreateDmNodeConfig } from './nodes/create-dm';
20
- import type { CollectNodeConfig } from './nodes/collect';
6
+ import type { ObjectSchemaField, SelectionMode, OutputMode, NodeCategory } from './nodes/types';
7
+ import type { NodeType, UserCreatableNodeType, WorkflowConfig, InternalNodeType } from './nodes';
21
8
  /**
22
9
  * Media type for automation nodes
23
10
  */
@@ -37,26 +24,6 @@ export interface EnumOption {
37
24
  * Format a port type for display (e.g., 'image' with isArray=true -> 'image[]')
38
25
  */
39
26
  export declare function formatPortType(type: BasePortType | BasePortType[], isArray: boolean): string;
40
- /**
41
- * Selection order configuration for media nodes
42
- */
43
- export type SelectionMode = 'random' | 'sequential';
44
- export type ExhaustionBehavior = 'restart' | 'error';
45
- export interface SelectionConfig {
46
- mode?: SelectionMode;
47
- enforceUniqueness?: boolean;
48
- exhaustionBehavior?: ExhaustionBehavior;
49
- }
50
- export interface SelectionState {
51
- usedIndices: number[];
52
- currentIndex: number;
53
- }
54
- /**
55
- * Output mode for source nodes (image, video, audio, text)
56
- * - 'per-input': Generate a unique value for each consumer input (default)
57
- * - 'single': Use the same value for all consumer inputs
58
- */
59
- export type OutputMode = 'per-input' | 'single';
60
27
  /**
61
28
  * Standard node output format.
62
29
  * All nodes output their values in the _values array.
@@ -101,37 +68,14 @@ export interface ResolvedPorts {
101
68
  inputs: ResolvedPort[];
102
69
  outputs: ResolvedPort[];
103
70
  }
71
+ export type { NodeType, UserCreatableNodeType, NodeConfig, WorkflowConfig, InternalNodeType, NodeDefinition } from './nodes';
72
+ export { nodeDefinitions, internalNodeTypes } from './nodes';
104
73
  /**
105
- * Node types array for runtime use
106
- */
107
- export declare const NodeTypes: readonly ["social-audio", "text", "media", "video-import", "image-composer", "video-composer", "generate-image", "generate-video", "custom-model", "llm", "passthrough", "manual-trigger", "recurrence", "compose-workflow", "account", "auto-post", "save-to-media", "deduplicate", "for-each", "for-each-value", "transcript", "auto-caption", "screenshot-animation", "random", "random-route", "branch", "if", "not", "create-dm", "collect", "destructure"];
108
- /**
109
- * Node type enum derived from NodeTypes const array
110
- * This is the canonical type - use this instead of the string union NodeTypeEnum
111
- */
112
- export type NodeType = typeof NodeTypes[number];
113
- /**
114
- * User-creatable node types (excludes internal executor types like 'for-each-value')
115
- * These are the nodes that appear in the node picker and have definitions.
116
- */
117
- export declare const UserCreatableNodeTypes: readonly ["social-audio", "text", "media", "video-import", "image-composer", "video-composer", "generate-image", "generate-video", "custom-model", "llm", "passthrough", "manual-trigger", "recurrence", "compose-workflow", "account", "auto-post", "save-to-media", "deduplicate", "for-each", "transcript", "auto-caption", "screenshot-animation", "random", "random-route", "branch", "if", "not", "create-dm", "collect", "destructure"];
118
- /**
119
- * Type for user-creatable nodes only
74
+ * Pre-computed node definition with static ports.
75
+ * Returned by getAllNodes() and getNodeByType() for consumer convenience.
76
+ * Ports are pre-computed from the node's defaults - consumers don't need to call computePorts.
120
77
  */
121
- export type UserCreatableNodeType = typeof UserCreatableNodeTypes[number];
122
- /**
123
- * @deprecated Use NodeType instead - this is a duplicate string union
124
- */
125
- export type NodeTypeEnum = 'social-audio' | 'text' | 'media' | 'video-import' | 'image-composer' | 'video-composer' | 'generate-image' | 'generate-video' | 'custom-model' | 'llm' | 'passthrough' | 'manual-trigger' | 'recurrence' | 'compose-workflow' | 'account' | 'auto-post' | 'save-to-media' | 'deduplicate' | 'for-each' | 'for-each-value' | 'random' | 'random-route' | 'branch' | 'if' | 'not' | 'transcript' | 'auto-caption' | 'screenshot-animation' | 'create-dm' | 'collect' | 'destructure';
126
- /**
127
- * Functional category for automation nodes
128
- * - trigger: Nodes that start an automation (manual-trigger, recurrence)
129
- * - source: Nodes that provide input data (image, video, audio, social-audio, text, account)
130
- * - generator: Nodes that transform or generate content (image-composer, video-composer, generate-image, llm, compose-workflow)
131
- * - terminal: Nodes that end an automation (output, auto-post, save-to-media)
132
- */
133
- export type NodeCategory = 'trigger' | 'source' | 'generator' | 'terminal';
134
- export interface NodeControlConfig {
78
+ export interface ComputedNode {
135
79
  /** Node type identifier (e.g., 'collect', 'for-each', 'llm') */
136
80
  nodeId: string;
137
81
  /** Display label for the node */
@@ -142,7 +86,9 @@ export interface NodeControlConfig {
142
86
  category: string;
143
87
  /** Functional type for node behavior classification */
144
88
  type: NodeCategory;
89
+ /** Pre-computed input ports based on defaults */
145
90
  inputs: NodePort[];
91
+ /** Pre-computed output ports based on defaults */
146
92
  outputs: NodePort[];
147
93
  /** Available output modes, or null if not applicable */
148
94
  outputModes: OutputMode[] | null;
@@ -151,59 +97,14 @@ export interface NodeControlConfig {
151
97
  /** Default config values for this node */
152
98
  defaults: Record<string, unknown>;
153
99
  }
154
- /**
155
- * Node definition for the centralized graph controller.
156
- * Each node type defines its default config and port computation logic.
157
- */
158
- export interface NodeDefinition {
159
- /** Node type identifier - must match UserCreatableNodeType (e.g., 'collect', 'for-each', 'llm') */
160
- nodeId: UserCreatableNodeType;
161
- /** Display label for the node */
162
- label: string;
163
- /** Description shown in add node modal */
164
- description: string;
165
- /** Functional type for node behavior classification */
166
- type: NodeCategory;
167
- /** UI display category for grouping in add node modal */
168
- category: string;
169
- /**
170
- * If true, this node supports generating multiple unique outputs per run
171
- * when outputMode is 'per-input'. Used for source nodes like media, text.
172
- */
173
- supportsPerInputMode?: boolean;
174
- /**
175
- * Returns the default configuration when a node of this type is created.
176
- * Should return a valid config that produces valid ports.
177
- */
178
- getDefaultConfig: () => Record<string, unknown>;
179
- /**
180
- * Computes the input and output ports for this node based on its config.
181
- *
182
- * @param config - The node's current configuration
183
- * @param getConnectedOutput - Optional callback to get the output port of a connected source node.
184
- * Used for objectSchema propagation through passthrough nodes.
185
- * @returns The computed input and output ports
186
- */
187
- computePorts: (params: {
188
- config: Record<string, unknown>;
189
- getConnectedOutput?: (inputId: string) => {
190
- type: BasePortType | BasePortType[];
191
- isArray: boolean;
192
- objectSchema?: ObjectSchemaField[];
193
- } | null;
194
- }) => {
195
- inputs: NodePort[];
196
- outputs: NodePort[];
197
- };
198
- }
199
100
  export interface OutputSchemaProperty {
200
101
  type: 'string' | 'number' | 'boolean' | 'array' | 'object';
201
102
  items?: 'string' | 'number' | 'boolean';
202
103
  properties?: Record<string, OutputSchemaProperty>;
203
104
  }
204
- export interface WorkflowNodeDefinition {
105
+ /** Base fields shared by all workflow nodes */
106
+ type WorkflowNodeDefinitionBase = {
205
107
  id: string;
206
- type: NodeTypeEnum;
207
108
  name?: string;
208
109
  x?: number;
209
110
  y?: number;
@@ -211,46 +112,17 @@ export interface WorkflowNodeDefinition {
211
112
  sourceNodeId: string;
212
113
  sourceOutputId: string;
213
114
  }>;
214
- config?: {
215
- urls?: string[];
216
- selectionConfig?: SelectionConfig;
217
- selectionState?: SelectionState;
218
- outputMode?: OutputMode;
219
- outputs?: Array<{
220
- id: string;
221
- type: string;
222
- isArray: boolean;
223
- selectedMediaIds: string[];
224
- }>;
225
- textOptions?: string[];
226
- videoEditor?: VideoEditorNodeConfig;
227
- imageEditor?: ImageEditorNodeConfig;
228
- outputSchema?: Record<string, OutputSchemaProperty>;
229
- provider?: 'groq' | 'openai' | 'claude' | 'gemini';
230
- model?: string;
231
- temperature?: number;
232
- maxTokens?: number;
233
- useWebSearch?: boolean;
234
- useStructuredOutput?: boolean;
235
- manualTriggerConfig?: ManualTriggerNodeConfig;
236
- recurrenceConfig?: RecurrenceNodeConfig;
237
- workflowTemplateId?: string;
238
- workflowVariableNameToIdMap?: Record<string, string>;
239
- /** Resolved ports from the sub-workflow template (for validation) */
240
- resolvedPorts?: ResolvedPorts;
241
- outputConfig?: OutputNodeConfig;
242
- accountConfig?: AccountNodeConfig;
243
- autoPostConfig?: AutoPostNodeConfig;
244
- saveToMediaConfig?: SaveToMediaNodeConfig;
245
- videoImportConfig?: VideoImportNodeConfig;
246
- randomRouteConfig?: RandomRouteNodeConfig;
247
- branchConfig?: BranchNodeConfig;
248
- autoCaptionConfig?: AutoCaptionNodeConfig;
249
- screenshotAnimationConfig?: ScreenshotAnimationConfig;
250
- createDmConfig?: CreateDmNodeConfig;
251
- collectConfig?: CollectNodeConfig;
115
+ };
116
+ /**
117
+ * Discriminated union of workflow node definitions.
118
+ * Each node type has its specific config type, enabling automatic type narrowing.
119
+ */
120
+ export type WorkflowNodeDefinition = {
121
+ [K in UserCreatableNodeType]: WorkflowNodeDefinitionBase & {
122
+ type: K;
123
+ config: WorkflowConfig[K];
252
124
  };
253
- }
125
+ }[UserCreatableNodeType];
254
126
  export interface CanvasState {
255
127
  zoom: number;
256
128
  panX: number;
@@ -260,14 +132,11 @@ export interface WorkflowDefinition {
260
132
  nodes: WorkflowNodeDefinition[];
261
133
  canvasState?: CanvasState;
262
134
  }
263
- /**
264
- * Template node as stored in the database
265
- */
266
- export interface TemplateNode {
135
+ /** Base fields shared by all template nodes */
136
+ type TemplateNodeBase = {
267
137
  id: string;
268
138
  template_id: string;
269
139
  node_id: string;
270
- type: NodeTypeEnum;
271
140
  name: string | null;
272
141
  x: number;
273
142
  y: number;
@@ -275,7 +144,6 @@ export interface TemplateNode {
275
144
  sourceNodeId: string;
276
145
  sourceOutputId: string;
277
146
  }>;
278
- config: WorkflowNodeDefinition['config'] | null;
279
147
  cached_output: Record<string, unknown> | null;
280
148
  cached_at: string | null;
281
149
  cached_run_id: string | null;
@@ -283,7 +151,26 @@ export interface TemplateNode {
283
151
  preview_outputs: Record<string, string> | null;
284
152
  created_at: string;
285
153
  updated_at: string;
286
- }
154
+ };
155
+ /** User-creatable template nodes have typed config */
156
+ type UserCreatableTemplateNode = {
157
+ [K in UserCreatableNodeType]: TemplateNodeBase & {
158
+ type: K;
159
+ config: WorkflowConfig[K] | null;
160
+ };
161
+ }[UserCreatableNodeType];
162
+ /** Internal template nodes (created during execution) have no config */
163
+ type InternalTemplateNode = {
164
+ [K in InternalNodeType]: TemplateNodeBase & {
165
+ type: K;
166
+ config: null;
167
+ };
168
+ }[InternalNodeType];
169
+ /**
170
+ * Template node as stored in the database.
171
+ * Discriminated union enabling automatic type narrowing based on node type.
172
+ */
173
+ export type TemplateNode = UserCreatableTemplateNode | InternalTemplateNode;
287
174
  export interface AutomationTemplate {
288
175
  id: string;
289
176
  org_id: string;
@@ -323,7 +210,7 @@ export interface ExecutorNode {
323
210
  id: string;
324
211
  template_node_id: string;
325
212
  executor_index: number;
326
- type: NodeTypeEnum;
213
+ type: NodeType;
327
214
  status: 'pending' | 'running' | 'completed' | 'failed';
328
215
  output_value: unknown | null;
329
216
  error_message: string | null;
@@ -5,7 +5,7 @@
5
5
  * Core types for the automation system including ports, selection, and output modes.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.UserCreatableNodeTypes = exports.NodeTypes = void 0;
8
+ exports.internalNodeTypes = exports.nodeDefinitions = void 0;
9
9
  exports.formatPortType = formatPortType;
10
10
  exports.isAsyncExecutor = isAsyncExecutor;
11
11
  /**
@@ -18,81 +18,9 @@ function formatPortType(type, isArray) {
18
18
  }
19
19
  return isArray ? `${type}[]` : type;
20
20
  }
21
- // =============================================================================
22
- // Node Type Enums
23
- // =============================================================================
24
- /**
25
- * Node types array for runtime use
26
- */
27
- exports.NodeTypes = [
28
- 'social-audio',
29
- 'text',
30
- 'media',
31
- 'video-import',
32
- 'image-composer',
33
- 'video-composer',
34
- 'generate-image',
35
- 'generate-video',
36
- 'custom-model',
37
- 'llm',
38
- 'passthrough',
39
- 'manual-trigger',
40
- 'recurrence',
41
- 'compose-workflow',
42
- 'account',
43
- 'auto-post',
44
- 'save-to-media',
45
- 'deduplicate',
46
- 'for-each',
47
- 'for-each-value',
48
- 'transcript',
49
- 'auto-caption',
50
- 'screenshot-animation',
51
- 'random',
52
- 'random-route',
53
- 'branch',
54
- 'if',
55
- 'not',
56
- 'create-dm',
57
- 'collect',
58
- 'destructure',
59
- ];
60
- /**
61
- * User-creatable node types (excludes internal executor types like 'for-each-value')
62
- * These are the nodes that appear in the node picker and have definitions.
63
- */
64
- exports.UserCreatableNodeTypes = [
65
- 'social-audio',
66
- 'text',
67
- 'media',
68
- 'video-import',
69
- 'image-composer',
70
- 'video-composer',
71
- 'generate-image',
72
- 'generate-video',
73
- 'custom-model',
74
- 'llm',
75
- 'passthrough',
76
- 'manual-trigger',
77
- 'recurrence',
78
- 'compose-workflow',
79
- 'account',
80
- 'auto-post',
81
- 'save-to-media',
82
- 'deduplicate',
83
- 'for-each',
84
- 'transcript',
85
- 'auto-caption',
86
- 'screenshot-animation',
87
- 'random',
88
- 'random-route',
89
- 'branch',
90
- 'if',
91
- 'not',
92
- 'create-dm',
93
- 'collect',
94
- 'destructure',
95
- ];
21
+ var nodes_1 = require("./nodes");
22
+ Object.defineProperty(exports, "nodeDefinitions", { enumerable: true, get: function () { return nodes_1.nodeDefinitions; } });
23
+ Object.defineProperty(exports, "internalNodeTypes", { enumerable: true, get: function () { return nodes_1.internalNodeTypes; } });
96
24
  /**
97
25
  * Type guard to check if an executor is async
98
26
  */
@@ -10,8 +10,9 @@
10
10
  *
11
11
  * All functions work with WorkflowNodeDefinition[] (embedded connection format).
12
12
  */
13
- import type { WorkflowNodeDefinition, NodeControlConfig, NodePort, BasePortType, ValidationError, UserCreatableNodeType } from './automations/types';
14
- import type { ObjectSchemaField } from './automations/nodes/types';
13
+ import type { WorkflowNodeDefinition, ComputedNode, NodePort, BasePortType, ValidationError, UserCreatableNodeType } from './automations/types';
14
+ import type { ObjectSchemaField, ResolvedPreview } from './automations/nodes/types';
15
+ import type { AutomationsClient } from './automations';
15
16
  /**
16
17
  * Connection extracted from embedded inputs format for internal processing
17
18
  */
@@ -45,29 +46,31 @@ export declare function areTypesCompatible({ sourceType, sourceIsArray, targetTy
45
46
  *
46
47
  * @param nodeType - The type of the node
47
48
  * @param config - The node's configuration object
49
+ * @param client - Optional AutomationsClient for nodes that need to fetch data
48
50
  * @param getConnectedOutput - Optional function to get connected output port info (for dynamic ports)
49
51
  */
50
- export declare function computePortsForNode({ nodeType, config, getConnectedOutput, }: {
52
+ export declare function computePortsForNode({ nodeType, config, client, getConnectedOutput, }: {
51
53
  nodeType: UserCreatableNodeType;
52
54
  config?: Record<string, unknown>;
55
+ client?: AutomationsClient;
53
56
  getConnectedOutput?: (inputId: string) => {
54
57
  type: BasePortType | BasePortType[];
55
58
  isArray: boolean;
56
59
  objectSchema?: ObjectSchemaField[];
57
60
  } | null;
58
- }): {
61
+ }): Promise<{
59
62
  inputs: NodePort[];
60
63
  outputs: NodePort[];
61
- };
64
+ }>;
62
65
  /**
63
66
  * Get all available automation nodes.
64
- * Converts node definitions from the registry into NodeControlConfig format.
67
+ * Converts node definitions from the registry into ComputedNode format.
65
68
  */
66
- export declare function getAllNodes(): NodeControlConfig[];
69
+ export declare function getAllNodes(client?: AutomationsClient): Promise<ComputedNode[]>;
67
70
  /**
68
71
  * Get a specific node by nodeId
69
72
  */
70
- export declare function getNodeByType(nodeId: string): NodeControlConfig | undefined;
73
+ export declare function getNodeByType(nodeId: string, client?: AutomationsClient): Promise<ComputedNode | undefined>;
71
74
  /**
72
75
  * Get the schema of array items for a node's output port.
73
76
  * Returns null if schema is unknown or the output is not an array.
@@ -75,13 +78,15 @@ export declare function getNodeByType(nodeId: string): NodeControlConfig | undef
75
78
  * @param nodeType - The type of the node (e.g., 'transcript', 'llm')
76
79
  * @param nodeConfig - The node's configuration object
77
80
  * @param outputPortId - The ID of the output port to get schema for
81
+ * @param client - Optional AutomationsClient for nodes that need to fetch data
78
82
  * @returns The schema of array items, or null if unknown
79
83
  */
80
- export declare function getOutputSchema({ nodeType, nodeConfig, outputPortId, }: {
84
+ export declare function getOutputSchema({ nodeType, nodeConfig, outputPortId, client, }: {
81
85
  nodeType: string;
82
86
  nodeConfig: Record<string, unknown> | undefined;
83
87
  outputPortId: string;
84
- }): ObjectSchemaField[] | null;
88
+ client?: AutomationsClient;
89
+ }): Promise<ObjectSchemaField[] | null>;
85
90
  /**
86
91
  * Derive Connection[] array from nodes for canvas rendering
87
92
  *
@@ -162,7 +167,7 @@ export declare function checkCrossContextViolation({ sourceNodeId, targetNodeId,
162
167
  */
163
168
  export declare function validateWorkflow({ nodes, }: {
164
169
  nodes: WorkflowNodeDefinition[];
165
- }): ValidationError[];
170
+ }): Promise<ValidationError[]>;
166
171
  /**
167
172
  * Get node IDs that have errors
168
173
  */
@@ -191,4 +196,16 @@ export declare function hasMissingTriggerError({ errors }: {
191
196
  export declare function hasMissingTerminalError({ errors }: {
192
197
  errors: ValidationError[];
193
198
  }): boolean;
199
+ /**
200
+ * Resolve preview data for a node.
201
+ * Converts node config with refs (inputId/textInputId) to render-ready format.
202
+ * Delegates to the node definition's resolvePreview function if available.
203
+ *
204
+ * @returns ResolvedPreview with render-ready config, sources, and textContent,
205
+ * or null if the node doesn't support preview or config is invalid.
206
+ */
207
+ export declare function resolveNodePreview({ nodes, nodeId, }: {
208
+ nodes: WorkflowNodeDefinition[];
209
+ nodeId: string;
210
+ }): ResolvedPreview | null;
194
211
  export {};