ugcinc 4.0.2 → 4.1.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.
Files changed (154) hide show
  1. package/dist/accounts.d.ts +146 -1
  2. package/dist/automations/index.d.ts +174 -0
  3. package/dist/automations/index.js +194 -0
  4. package/dist/automations/nodes/account.d.ts +18 -0
  5. package/dist/automations/nodes/account.js +29 -0
  6. package/dist/automations/nodes/auto-caption.d.ts +64 -0
  7. package/dist/automations/nodes/auto-caption.js +46 -0
  8. package/dist/automations/nodes/auto-post.d.ts +81 -0
  9. package/dist/automations/nodes/auto-post.js +54 -0
  10. package/dist/automations/nodes/branch.d.ts +58 -0
  11. package/dist/automations/nodes/branch.js +50 -0
  12. package/dist/automations/nodes/collect.d.ts +16 -0
  13. package/dist/automations/nodes/collect.js +56 -0
  14. package/dist/automations/nodes/compose-workflow.d.ts +21 -0
  15. package/dist/automations/nodes/compose-workflow.js +42 -0
  16. package/dist/automations/nodes/create-dm.d.ts +96 -0
  17. package/dist/automations/nodes/create-dm.js +88 -0
  18. package/dist/automations/nodes/custom-model.d.ts +19 -0
  19. package/dist/automations/nodes/custom-model.js +52 -0
  20. package/dist/automations/nodes/deduplicate.d.ts +8 -0
  21. package/dist/automations/nodes/deduplicate.js +36 -0
  22. package/dist/automations/nodes/destructure.d.ts +25 -0
  23. package/dist/automations/nodes/destructure.js +65 -0
  24. package/dist/automations/nodes/for-each.d.ts +23 -0
  25. package/dist/automations/nodes/for-each.js +84 -0
  26. package/dist/automations/nodes/generate-image.d.ts +16 -0
  27. package/dist/automations/nodes/generate-image.js +45 -0
  28. package/dist/automations/nodes/generate-video.d.ts +16 -0
  29. package/dist/automations/nodes/generate-video.js +45 -0
  30. package/dist/automations/nodes/if.d.ts +22 -0
  31. package/dist/automations/nodes/if.js +44 -0
  32. package/dist/automations/nodes/image-composer.d.ts +33 -0
  33. package/dist/automations/nodes/image-composer.js +95 -0
  34. package/dist/automations/nodes/index.d.ts +20 -0
  35. package/dist/automations/nodes/index.js +93 -0
  36. package/dist/automations/nodes/llm.d.ts +27 -0
  37. package/dist/automations/nodes/llm.js +85 -0
  38. package/dist/automations/nodes/manual-trigger.d.ts +34 -0
  39. package/dist/automations/nodes/manual-trigger.js +32 -0
  40. package/dist/automations/nodes/media.d.ts +17 -0
  41. package/dist/automations/nodes/media.js +40 -0
  42. package/dist/automations/nodes/not.d.ts +6 -0
  43. package/dist/automations/nodes/not.js +35 -0
  44. package/dist/automations/nodes/output.d.ts +30 -0
  45. package/dist/automations/nodes/output.js +32 -0
  46. package/dist/automations/nodes/random-route.d.ts +52 -0
  47. package/dist/automations/nodes/random-route.js +53 -0
  48. package/dist/automations/nodes/random.d.ts +16 -0
  49. package/dist/automations/nodes/random.js +50 -0
  50. package/dist/automations/nodes/recurrence.d.ts +69 -0
  51. package/dist/automations/nodes/recurrence.js +50 -0
  52. package/dist/automations/nodes/save-to-media.d.ts +32 -0
  53. package/dist/automations/nodes/save-to-media.js +31 -0
  54. package/dist/automations/nodes/screenshot-animation.d.ts +7 -0
  55. package/dist/automations/nodes/screenshot-animation.js +36 -0
  56. package/dist/automations/nodes/social-audio.d.ts +8 -0
  57. package/dist/automations/nodes/social-audio.js +30 -0
  58. package/dist/automations/nodes/text.d.ts +7 -0
  59. package/dist/automations/nodes/text.js +41 -0
  60. package/dist/automations/nodes/transcript.d.ts +6 -0
  61. package/dist/automations/nodes/transcript.js +46 -0
  62. package/dist/automations/nodes/types.d.ts +178 -0
  63. package/dist/automations/nodes/types.js +22 -0
  64. package/dist/automations/nodes/video-composer.d.ts +25 -0
  65. package/dist/automations/nodes/video-composer.js +71 -0
  66. package/dist/automations/nodes/video-import.d.ts +27 -0
  67. package/dist/automations/nodes/video-import.js +37 -0
  68. package/dist/automations/types.d.ts +544 -0
  69. package/dist/automations/types.js +101 -0
  70. package/dist/automations.d.ts +5 -33
  71. package/dist/automations.js +6 -647
  72. package/dist/comments.d.ts +26 -1
  73. package/dist/comments.js +3 -0
  74. package/dist/graph-controller.d.ts +194 -0
  75. package/dist/graph-controller.js +623 -0
  76. package/dist/index.d.ts +38 -9
  77. package/dist/index.js +43 -23
  78. package/dist/internal-utils.d.ts +8 -0
  79. package/dist/internal-utils.js +22 -0
  80. package/dist/media.d.ts +135 -1
  81. package/dist/nodes/account.d.ts +7 -0
  82. package/dist/nodes/account.js +29 -0
  83. package/dist/nodes/auto-caption.d.ts +17 -0
  84. package/dist/nodes/auto-caption.js +46 -0
  85. package/dist/nodes/auto-post.d.ts +21 -0
  86. package/dist/nodes/auto-post.js +54 -0
  87. package/dist/nodes/branch.d.ts +12 -0
  88. package/dist/nodes/branch.js +50 -0
  89. package/dist/nodes/collect.d.ts +6 -0
  90. package/dist/nodes/collect.js +56 -0
  91. package/dist/nodes/compose-workflow.d.ts +21 -0
  92. package/dist/nodes/compose-workflow.js +42 -0
  93. package/dist/nodes/create-dm.d.ts +40 -0
  94. package/dist/nodes/create-dm.js +88 -0
  95. package/dist/nodes/custom-model.d.ts +19 -0
  96. package/dist/nodes/custom-model.js +52 -0
  97. package/dist/nodes/deduplicate.d.ts +8 -0
  98. package/dist/nodes/deduplicate.js +36 -0
  99. package/dist/nodes/destructure.d.ts +25 -0
  100. package/dist/nodes/destructure.js +65 -0
  101. package/dist/nodes/for-each.d.ts +23 -0
  102. package/dist/nodes/for-each.js +84 -0
  103. package/dist/nodes/generate-image.d.ts +16 -0
  104. package/dist/nodes/generate-image.js +45 -0
  105. package/dist/nodes/generate-video.d.ts +16 -0
  106. package/dist/nodes/generate-video.js +45 -0
  107. package/dist/nodes/if.d.ts +22 -0
  108. package/dist/nodes/if.js +44 -0
  109. package/dist/nodes/image-composer.d.ts +14 -0
  110. package/dist/nodes/image-composer.js +95 -0
  111. package/dist/nodes/index.d.ts +20 -0
  112. package/dist/nodes/index.js +93 -0
  113. package/dist/nodes/llm.d.ts +27 -0
  114. package/dist/nodes/llm.js +85 -0
  115. package/dist/nodes/manual-trigger.d.ts +16 -0
  116. package/dist/nodes/manual-trigger.js +32 -0
  117. package/dist/nodes/media.d.ts +17 -0
  118. package/dist/nodes/media.js +40 -0
  119. package/dist/nodes/not.d.ts +6 -0
  120. package/dist/nodes/not.js +35 -0
  121. package/dist/nodes/output.d.ts +9 -0
  122. package/dist/nodes/output.js +32 -0
  123. package/dist/nodes/random-route.d.ts +3 -0
  124. package/dist/nodes/random-route.js +50 -0
  125. package/dist/nodes/random.d.ts +3 -0
  126. package/dist/nodes/random.js +48 -0
  127. package/dist/nodes/recurrence.d.ts +3 -0
  128. package/dist/nodes/recurrence.js +45 -0
  129. package/dist/nodes/save-to-media.d.ts +3 -0
  130. package/dist/nodes/save-to-media.js +26 -0
  131. package/dist/nodes/screenshot-animation.d.ts +7 -0
  132. package/dist/nodes/screenshot-animation.js +36 -0
  133. package/dist/nodes/social-audio.d.ts +3 -0
  134. package/dist/nodes/social-audio.js +26 -0
  135. package/dist/nodes/text.d.ts +3 -0
  136. package/dist/nodes/text.js +38 -0
  137. package/dist/nodes/transcript.d.ts +3 -0
  138. package/dist/nodes/transcript.js +42 -0
  139. package/dist/nodes/types.d.ts +146 -0
  140. package/dist/nodes/types.js +22 -0
  141. package/dist/nodes/video-composer.d.ts +3 -0
  142. package/dist/nodes/video-composer.js +67 -0
  143. package/dist/nodes/video-import.d.ts +3 -0
  144. package/dist/nodes/video-import.js +35 -0
  145. package/dist/org.d.ts +13 -1
  146. package/dist/ports.js +3 -9
  147. package/dist/posts.d.ts +88 -1
  148. package/dist/render/compositions/IMessageDmComposition/types.d.ts +20 -20
  149. package/dist/render/types/video.d.ts +2 -2
  150. package/dist/stats.d.ts +128 -1
  151. package/dist/tasks.d.ts +20 -1
  152. package/dist/types.d.ts +1 -2216
  153. package/dist/types.js +2 -124
  154. package/package.json +1 -1
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const definition = (0, types_1.defineNode)({
5
+ nodeId: 'deduplicate',
6
+ label: 'Mass Repost',
7
+ description: 'Make videos unique for safe reposting',
8
+ type: 'generator',
9
+ category: 'Generation',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ deduplication: 'level3',
14
+ outputMode: 'per-input',
15
+ selectionMode: null,
16
+ },
17
+ computePorts: () => ({
18
+ inputs: [
19
+ {
20
+ id: 'video',
21
+ type: 'video',
22
+ isArray: false,
23
+ required: true,
24
+ },
25
+ ],
26
+ outputs: [
27
+ {
28
+ id: 'output',
29
+ type: 'video',
30
+ isArray: false,
31
+ required: true,
32
+ },
33
+ ],
34
+ }),
35
+ });
36
+ exports.default = definition;
@@ -0,0 +1,25 @@
1
+ type IndexExpression = {
2
+ type: 'single';
3
+ index: number;
4
+ } | {
5
+ type: 'range';
6
+ start: number;
7
+ end: number;
8
+ } | {
9
+ type: 'list';
10
+ indexes: number[];
11
+ };
12
+ interface DestructureSelection {
13
+ portId: string;
14
+ indexExpr: IndexExpression;
15
+ isVariable?: boolean;
16
+ propertyPath?: string;
17
+ }
18
+ declare const definition: import("./types").NodeDefinition<"generator", {
19
+ selections: DestructureSelection[];
20
+ outputMode: "per-input";
21
+ selectionMode: null;
22
+ }>;
23
+ export default definition;
24
+ export type { DestructureSelection, IndexExpression };
25
+ export type DestructureConfig = typeof definition.defaults;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const definition = (0, types_1.defineNode)({
5
+ nodeId: 'destructure',
6
+ label: 'Destructure',
7
+ description: 'Extract specific elements from an array by index or range',
8
+ type: 'generator',
9
+ category: 'Control Flow',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ selections: [],
14
+ outputMode: 'per-input',
15
+ selectionMode: null,
16
+ },
17
+ computePorts: ({ config, getConnectedOutput }) => {
18
+ const selections = config?.selections ?? [];
19
+ // Input accepts any array type
20
+ const inputTypes = ['image', 'video', 'audio', 'text', 'object'];
21
+ const inputs = [
22
+ {
23
+ id: 'array',
24
+ type: inputTypes,
25
+ isArray: true,
26
+ required: true,
27
+ },
28
+ ];
29
+ const outputs = [];
30
+ // Determine base type from connected input
31
+ let baseType = 'object';
32
+ if (getConnectedOutput) {
33
+ const connectedOutput = getConnectedOutput('array');
34
+ if (connectedOutput?.type && connectedOutput.isArray) {
35
+ const connType = connectedOutput.type;
36
+ if (!Array.isArray(connType)) {
37
+ baseType = connType;
38
+ }
39
+ }
40
+ }
41
+ for (const selection of selections) {
42
+ // If variable, add input port for index expression
43
+ if (selection.isVariable) {
44
+ inputs.push({
45
+ id: `idx-${selection.portId}`,
46
+ type: 'text',
47
+ isArray: false,
48
+ required: true,
49
+ });
50
+ }
51
+ // Output type depends on index expression:
52
+ // - 'single' -> single item (isArray: false)
53
+ // - 'range' or 'list' -> array of items (isArray: true)
54
+ const outputIsArray = selection.indexExpr.type !== 'single';
55
+ outputs.push({
56
+ id: selection.portId,
57
+ type: baseType,
58
+ isArray: outputIsArray,
59
+ required: true,
60
+ });
61
+ }
62
+ return { inputs, outputs };
63
+ },
64
+ });
65
+ exports.default = definition;
@@ -0,0 +1,23 @@
1
+ import type { BasePortType } from '../types';
2
+ interface ForEachOutputProperty {
3
+ portId: string;
4
+ propertyPath: string;
5
+ type: BasePortType;
6
+ isArray: boolean;
7
+ }
8
+ interface ForEachInputPort {
9
+ id: string;
10
+ type: BasePortType;
11
+ isArray: boolean;
12
+ }
13
+ declare const definition: import("./types").NodeDefinition<"generator", {
14
+ outputProperties: ForEachOutputProperty[];
15
+ inputPorts: ForEachInputPort[];
16
+ exposeItem: boolean;
17
+ exposeIndex: boolean;
18
+ outputMode: "per-input";
19
+ selectionMode: null;
20
+ }>;
21
+ export default definition;
22
+ export type { ForEachOutputProperty, ForEachInputPort };
23
+ export type ForEachConfig = typeof definition.defaults;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const definition = (0, types_1.defineNode)({
5
+ nodeId: 'for-each',
6
+ label: 'For Each',
7
+ description: 'Iterate over an array, executing downstream nodes for each item',
8
+ type: 'generator',
9
+ category: 'Control Flow',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ outputProperties: [],
14
+ inputPorts: [],
15
+ exposeItem: false,
16
+ exposeIndex: false,
17
+ outputMode: 'per-input',
18
+ selectionMode: null,
19
+ },
20
+ computePorts: ({ config, getConnectedOutput }) => {
21
+ const outputProperties = config?.outputProperties ?? [];
22
+ const inputPorts = config?.inputPorts ?? [];
23
+ const exposeItem = config?.exposeItem ?? false;
24
+ const exposeIndex = config?.exposeIndex ?? false;
25
+ // Inputs: array + passthrough inputs
26
+ const inputs = [
27
+ { id: 'array', type: 'object', isArray: false, required: true },
28
+ ];
29
+ for (const port of inputPorts) {
30
+ inputs.push({
31
+ id: port.id,
32
+ type: port.type,
33
+ isArray: port.isArray,
34
+ required: false,
35
+ });
36
+ }
37
+ // Outputs
38
+ const outputs = [];
39
+ // Determine item type from connected array input
40
+ let itemType = 'object';
41
+ if (getConnectedOutput) {
42
+ const connectedOutput = getConnectedOutput('array');
43
+ if (connectedOutput?.objectSchema) {
44
+ // Has objectSchema - it's an object array, use object type
45
+ itemType = 'object';
46
+ }
47
+ else if (connectedOutput?.type && connectedOutput.isArray) {
48
+ // Connected to an array type - extract the base type
49
+ const connType = connectedOutput.type;
50
+ if (!Array.isArray(connType)) {
51
+ itemType = connType;
52
+ }
53
+ }
54
+ }
55
+ // Add item output if exposed
56
+ if (exposeItem) {
57
+ outputs.push({ id: 'item', type: itemType, isArray: false, required: true });
58
+ }
59
+ // Add index output if exposed
60
+ if (exposeIndex) {
61
+ outputs.push({ id: 'index', type: 'number', isArray: false, required: true });
62
+ }
63
+ // Add configured property outputs
64
+ for (const prop of outputProperties) {
65
+ outputs.push({
66
+ id: prop.portId,
67
+ type: prop.type,
68
+ isArray: prop.isArray,
69
+ required: true,
70
+ });
71
+ }
72
+ // Add passthrough outputs (same value for all iterations)
73
+ for (const port of inputPorts) {
74
+ outputs.push({
75
+ id: port.id,
76
+ type: port.type,
77
+ isArray: port.isArray,
78
+ required: true,
79
+ });
80
+ }
81
+ return { inputs, outputs };
82
+ },
83
+ });
84
+ exports.default = definition;
@@ -0,0 +1,16 @@
1
+ type ImageGenerationTextModel = 'fal-ai/gemini-3-pro-image-preview' | 'fal-ai/nano-banana-pro' | 'fal-ai/nano-banana' | 'fal-ai/gpt-image-1/text-to-image';
2
+ type ImageGenerationEditModel = 'fal-ai/gemini-3-pro-image-preview/edit' | 'fal-ai/nano-banana-pro/edit' | 'fal-ai/nano-banana/edit' | 'fal-ai/gpt-image-1/edit-image';
3
+ type ImageGenerationModel = ImageGenerationTextModel | ImageGenerationEditModel;
4
+ declare function isEditModel(model: ImageGenerationModel): model is ImageGenerationEditModel;
5
+ declare const definition: import("./types").NodeDefinition<"generator", {
6
+ model: ImageGenerationModel;
7
+ aspectRatio: string;
8
+ numImages: number;
9
+ apiKey: string | undefined;
10
+ outputMode: "per-input";
11
+ selectionMode: null;
12
+ }>;
13
+ export default definition;
14
+ export { isEditModel };
15
+ export type { ImageGenerationTextModel, ImageGenerationEditModel, ImageGenerationModel };
16
+ export type GenerateImageConfig = typeof definition.defaults;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEditModel = isEditModel;
4
+ const types_1 = require("./types");
5
+ function isEditModel(model) {
6
+ return model.includes('/edit') || model.includes('/edit-image');
7
+ }
8
+ const definition = (0, types_1.defineNode)({
9
+ nodeId: 'generate-image',
10
+ label: 'Generate Image',
11
+ description: 'Generate images with AI',
12
+ type: 'generator',
13
+ category: 'AI Generation',
14
+ outputModes: ['per-input', 'single'],
15
+ selectionModes: null,
16
+ defaults: {
17
+ model: 'fal-ai/nano-banana',
18
+ aspectRatio: '1:1',
19
+ numImages: 1,
20
+ apiKey: undefined,
21
+ outputMode: 'per-input',
22
+ selectionMode: null,
23
+ },
24
+ computePorts: ({ config }) => {
25
+ const model = (config?.model ?? 'fal-ai/nano-banana');
26
+ const inputs = [
27
+ { id: 'prompt', type: 'text', isArray: false, required: true },
28
+ ];
29
+ if (isEditModel(model)) {
30
+ inputs.push({ id: 'image', type: 'image', isArray: false, required: true });
31
+ }
32
+ return {
33
+ inputs,
34
+ outputs: [
35
+ {
36
+ id: 'output',
37
+ type: 'image',
38
+ isArray: false,
39
+ required: true,
40
+ },
41
+ ],
42
+ };
43
+ },
44
+ });
45
+ exports.default = definition;
@@ -0,0 +1,16 @@
1
+ type VideoGenerationTextToVideoModel = 'fal-ai/veo3.1' | 'fal-ai/veo3' | 'fal-ai/veo3/fast' | 'fal-ai/kling-video/v2.6/pro/text-to-video' | 'fal-ai/kling-video/v2.5/pro/text-to-video' | 'fal-ai/luma-dream-machine/ray-2' | 'fal-ai/luma-dream-machine/ray-2-flash' | 'fal-ai/minimax/hailuo-2.3/pro/text-to-video' | 'wan/v2.6/text-to-video' | 'fal-ai/sora-2/text-to-video';
2
+ type VideoGenerationImageToVideoModel = 'fal-ai/veo3.1/image-to-video' | 'fal-ai/veo3/image-to-video' | 'fal-ai/kling-video/v2.6/pro/image-to-video' | 'fal-ai/kling-video/v2.5/pro/image-to-video' | 'fal-ai/luma-dream-machine/ray-2/image-to-video' | 'fal-ai/luma-dream-machine/ray-2-flash/image-to-video' | 'fal-ai/minimax/hailuo-2.3/pro/image-to-video' | 'wan/v2.6/image-to-video' | 'fal-ai/sora-2/image-to-video/pro';
3
+ type VideoGenerationModel = VideoGenerationTextToVideoModel | VideoGenerationImageToVideoModel;
4
+ declare function isImageToVideoModel(model: VideoGenerationModel): model is VideoGenerationImageToVideoModel;
5
+ declare const definition: import("./types").NodeDefinition<"generator", {
6
+ model: VideoGenerationModel;
7
+ aspectRatio: string;
8
+ duration: number;
9
+ apiKey: string | undefined;
10
+ outputMode: "per-input";
11
+ selectionMode: null;
12
+ }>;
13
+ export default definition;
14
+ export { isImageToVideoModel };
15
+ export type { VideoGenerationTextToVideoModel, VideoGenerationImageToVideoModel, VideoGenerationModel };
16
+ export type GenerateVideoConfig = typeof definition.defaults;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isImageToVideoModel = isImageToVideoModel;
4
+ const types_1 = require("./types");
5
+ function isImageToVideoModel(model) {
6
+ return model.includes('/image-to-video');
7
+ }
8
+ const definition = (0, types_1.defineNode)({
9
+ nodeId: 'generate-video',
10
+ label: 'Generate Video',
11
+ description: 'Generate videos with AI',
12
+ type: 'generator',
13
+ category: 'AI Generation',
14
+ outputModes: ['per-input', 'single'],
15
+ selectionModes: null,
16
+ defaults: {
17
+ model: 'fal-ai/kling-video/v2.6/pro/text-to-video',
18
+ aspectRatio: '16:9',
19
+ duration: 5,
20
+ apiKey: undefined,
21
+ outputMode: 'per-input',
22
+ selectionMode: null,
23
+ },
24
+ computePorts: ({ config }) => {
25
+ const model = (config?.model ?? 'fal-ai/kling-video/v2.6/pro/text-to-video');
26
+ const inputs = [
27
+ { id: 'prompt', type: 'text', isArray: false, required: true },
28
+ ];
29
+ if (isImageToVideoModel(model)) {
30
+ inputs.push({ id: 'image', type: 'image', isArray: false, required: true });
31
+ }
32
+ return {
33
+ inputs,
34
+ outputs: [
35
+ {
36
+ id: 'output',
37
+ type: 'video',
38
+ isArray: false,
39
+ required: true,
40
+ },
41
+ ],
42
+ };
43
+ },
44
+ });
45
+ exports.default = definition;
@@ -0,0 +1,22 @@
1
+ import type { BasePortType } from '../types';
2
+ declare const IfLogicOperators: readonly ["and", "or", "xor", "nor"];
3
+ type IfLogicOperator = typeof IfLogicOperators[number];
4
+ interface IfBooleanInput {
5
+ id: string;
6
+ }
7
+ interface IfPassthroughInput {
8
+ id: string;
9
+ type: BasePortType;
10
+ isArray: boolean;
11
+ }
12
+ declare const definition: import("./types").NodeDefinition<"generator", {
13
+ logicOperator: IfLogicOperator;
14
+ booleanInputs: IfBooleanInput[];
15
+ passthroughInputs: IfPassthroughInput[];
16
+ outputMode: "per-input";
17
+ selectionMode: null;
18
+ }>;
19
+ export default definition;
20
+ export { IfLogicOperators };
21
+ export type { IfLogicOperator, IfBooleanInput, IfPassthroughInput };
22
+ export type IfConfig = typeof definition.defaults;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IfLogicOperators = void 0;
4
+ const types_1 = require("./types");
5
+ const IfLogicOperators = ['and', 'or', 'xor', 'nor'];
6
+ exports.IfLogicOperators = IfLogicOperators;
7
+ const definition = (0, types_1.defineNode)({
8
+ nodeId: 'if',
9
+ label: 'If',
10
+ description: 'Conditional branching based on boolean logic',
11
+ type: 'generator',
12
+ category: 'Control Flow',
13
+ outputModes: ['per-input', 'single'],
14
+ selectionModes: null,
15
+ defaults: {
16
+ logicOperator: 'and',
17
+ booleanInputs: [{ id: 'condition-1' }],
18
+ passthroughInputs: [{
19
+ id: 'value',
20
+ type: 'image',
21
+ isArray: false,
22
+ }],
23
+ outputMode: 'per-input',
24
+ selectionMode: null,
25
+ },
26
+ computePorts: ({ config }) => {
27
+ const booleanInputs = config?.booleanInputs ?? [];
28
+ const passthroughInputs = config?.passthroughInputs ?? [];
29
+ const inputs = [];
30
+ const outputs = [];
31
+ // Boolean condition inputs
32
+ for (const boolInput of booleanInputs) {
33
+ inputs.push({ id: boolInput.id, type: 'boolean', isArray: false, required: true });
34
+ }
35
+ // Passthrough inputs and true/false outputs
36
+ for (const passthrough of passthroughInputs) {
37
+ inputs.push({ id: passthrough.id, type: passthrough.type, isArray: passthrough.isArray, required: true });
38
+ outputs.push({ id: `true-${passthrough.id}`, type: passthrough.type, isArray: passthrough.isArray, required: true });
39
+ outputs.push({ id: `false-${passthrough.id}`, type: passthrough.type, isArray: passthrough.isArray, required: true });
40
+ }
41
+ return { inputs, outputs };
42
+ },
43
+ });
44
+ exports.default = definition;
@@ -0,0 +1,33 @@
1
+ import type { NodeOutputValues } from '../types';
2
+ import type { ImageEditorNodeConfig } from '../../render/types';
3
+ declare const definition: import("./types").NodeDefinition<"generator", {
4
+ imageEditor: {
5
+ width: number;
6
+ height: number;
7
+ aspectRatio: string;
8
+ dimensionPreset: string;
9
+ backgroundType: string;
10
+ elements: never[];
11
+ };
12
+ outputMode: "per-input";
13
+ selectionMode: null;
14
+ }>;
15
+ export default definition;
16
+ export type ImageComposerConfig = typeof definition.defaults;
17
+ /**
18
+ * Input to the image-composer node executor
19
+ */
20
+ export interface ImageEditorNodeInput extends Record<string, unknown> {
21
+ type: 'image-composer';
22
+ config: ImageEditorNodeConfig;
23
+ imageUrls: Record<string, string>;
24
+ textValues: Record<string, string>;
25
+ }
26
+ /**
27
+ * Output from the image-composer node executor
28
+ */
29
+ export interface ImageEditorNodeOutput extends Record<string, unknown>, NodeOutputValues {
30
+ width?: number;
31
+ height?: number;
32
+ aspectRatio?: string;
33
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const definition = (0, types_1.defineNode)({
5
+ nodeId: 'image-composer',
6
+ label: 'Image Composer',
7
+ description: 'Create templated images',
8
+ type: 'generator',
9
+ category: 'Generation',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ imageEditor: {
14
+ width: 1080,
15
+ height: 1920,
16
+ aspectRatio: '9:16',
17
+ dimensionPreset: '9:16',
18
+ backgroundType: 'image',
19
+ elements: [],
20
+ },
21
+ outputMode: 'per-input',
22
+ selectionMode: null,
23
+ },
24
+ computePorts: ({ config }) => {
25
+ const editorConfig = config?.imageEditor;
26
+ const inputs = [];
27
+ if (editorConfig) {
28
+ // Add background input if backgroundType is not 'color'
29
+ if (editorConfig.backgroundType !== 'color') {
30
+ inputs.push({
31
+ id: 'background',
32
+ type: 'image',
33
+ isArray: false,
34
+ required: true,
35
+ });
36
+ }
37
+ // Add inputs for each element with inputId or textInputId
38
+ editorConfig.elements.forEach(elem => {
39
+ if (elem.type === 'image' && elem.inputId) {
40
+ inputs.push({
41
+ id: elem.inputId,
42
+ type: 'image',
43
+ isArray: false,
44
+ required: true,
45
+ });
46
+ }
47
+ else if (elem.type === 'text' && elem.textInputId) {
48
+ inputs.push({
49
+ id: elem.textInputId,
50
+ type: 'text',
51
+ isArray: false,
52
+ required: true,
53
+ });
54
+ }
55
+ });
56
+ // Build enum options from element IDs for crop boundary inputs
57
+ const elementEnumOptions = editorConfig.elements.map(elem => ({
58
+ label: elem.id,
59
+ value: elem.id,
60
+ }));
61
+ // Add crop boundary inputs as enum type (not required)
62
+ const addedCropInputs = new Set();
63
+ const cropConfig = editorConfig.dynamicCrop;
64
+ [
65
+ cropConfig?.vertical?.startBoundary?.inputRef,
66
+ cropConfig?.vertical?.endBoundary?.inputRef,
67
+ cropConfig?.horizontal?.startBoundary?.inputRef,
68
+ cropConfig?.horizontal?.endBoundary?.inputRef,
69
+ ].forEach(inputRef => {
70
+ if (inputRef && !addedCropInputs.has(inputRef)) {
71
+ addedCropInputs.add(inputRef);
72
+ inputs.push({
73
+ id: inputRef,
74
+ type: 'enum',
75
+ isArray: false,
76
+ required: false,
77
+ enumOptions: elementEnumOptions,
78
+ });
79
+ }
80
+ });
81
+ }
82
+ return {
83
+ inputs,
84
+ outputs: [
85
+ {
86
+ id: 'output',
87
+ type: 'image',
88
+ isArray: false,
89
+ required: true,
90
+ },
91
+ ],
92
+ };
93
+ },
94
+ });
95
+ exports.default = definition;
@@ -0,0 +1,20 @@
1
+ import type { UserCreatableNodeType } from '../types';
2
+ import type { NodeDefinition } from './types';
3
+ type AnyNodeDefinition = NodeDefinition<any, any>;
4
+ /**
5
+ * Registry of all user-creatable node definitions.
6
+ * This is the single source of truth for node types.
7
+ *
8
+ * Note: Internal executor types like 'for-each-value' are not included here
9
+ * as they are created dynamically during execution, not by users.
10
+ */
11
+ export declare const nodeDefinitions: Record<UserCreatableNodeType, AnyNodeDefinition>;
12
+ /**
13
+ * Get all node definitions as an array
14
+ */
15
+ export declare function getAllNodeDefinitions(): AnyNodeDefinition[];
16
+ /**
17
+ * Get a node definition by its nodeId
18
+ */
19
+ export declare function getNodeDefinition(nodeId: UserCreatableNodeType): AnyNodeDefinition | undefined;
20
+ export {};
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.nodeDefinitions = void 0;
7
+ exports.getAllNodeDefinitions = getAllNodeDefinitions;
8
+ exports.getNodeDefinition = getNodeDefinition;
9
+ // Import all node definitions
10
+ const account_1 = __importDefault(require("./account"));
11
+ const auto_caption_1 = __importDefault(require("./auto-caption"));
12
+ const auto_post_1 = __importDefault(require("./auto-post"));
13
+ const branch_1 = __importDefault(require("./branch"));
14
+ const collect_1 = __importDefault(require("./collect"));
15
+ const compose_workflow_1 = __importDefault(require("./compose-workflow"));
16
+ const create_dm_1 = __importDefault(require("./create-dm"));
17
+ const custom_model_1 = __importDefault(require("./custom-model"));
18
+ const deduplicate_1 = __importDefault(require("./deduplicate"));
19
+ const destructure_1 = __importDefault(require("./destructure"));
20
+ const for_each_1 = __importDefault(require("./for-each"));
21
+ const generate_image_1 = __importDefault(require("./generate-image"));
22
+ const generate_video_1 = __importDefault(require("./generate-video"));
23
+ const if_1 = __importDefault(require("./if"));
24
+ const image_composer_1 = __importDefault(require("./image-composer"));
25
+ const llm_1 = __importDefault(require("./llm"));
26
+ const manual_trigger_1 = __importDefault(require("./manual-trigger"));
27
+ const media_1 = __importDefault(require("./media"));
28
+ const not_1 = __importDefault(require("./not"));
29
+ const output_1 = __importDefault(require("./output"));
30
+ const random_1 = __importDefault(require("./random"));
31
+ const random_route_1 = __importDefault(require("./random-route"));
32
+ const recurrence_1 = __importDefault(require("./recurrence"));
33
+ const save_to_media_1 = __importDefault(require("./save-to-media"));
34
+ const screenshot_animation_1 = __importDefault(require("./screenshot-animation"));
35
+ const social_audio_1 = __importDefault(require("./social-audio"));
36
+ const text_1 = __importDefault(require("./text"));
37
+ const transcript_1 = __importDefault(require("./transcript"));
38
+ const video_composer_1 = __importDefault(require("./video-composer"));
39
+ const video_import_1 = __importDefault(require("./video-import"));
40
+ /**
41
+ * Registry of all user-creatable node definitions.
42
+ * This is the single source of truth for node types.
43
+ *
44
+ * Note: Internal executor types like 'for-each-value' are not included here
45
+ * as they are created dynamically during execution, not by users.
46
+ */
47
+ exports.nodeDefinitions = {
48
+ 'account': account_1.default,
49
+ 'auto-caption': auto_caption_1.default,
50
+ 'auto-post': auto_post_1.default,
51
+ 'branch': branch_1.default,
52
+ 'collect': collect_1.default,
53
+ 'compose-workflow': compose_workflow_1.default,
54
+ 'create-dm': create_dm_1.default,
55
+ 'custom-model': custom_model_1.default,
56
+ 'deduplicate': deduplicate_1.default,
57
+ 'destructure': destructure_1.default,
58
+ 'for-each': for_each_1.default,
59
+ 'generate-image': generate_image_1.default,
60
+ 'generate-video': generate_video_1.default,
61
+ 'if': if_1.default,
62
+ 'image-composer': image_composer_1.default,
63
+ 'llm': llm_1.default,
64
+ 'manual-trigger': manual_trigger_1.default,
65
+ 'media': media_1.default,
66
+ 'not': not_1.default,
67
+ 'passthrough': output_1.default,
68
+ 'random': random_1.default,
69
+ 'random-route': random_route_1.default,
70
+ 'recurrence': recurrence_1.default,
71
+ 'save-to-media': save_to_media_1.default,
72
+ 'screenshot-animation': screenshot_animation_1.default,
73
+ 'social-audio': social_audio_1.default,
74
+ 'text': text_1.default,
75
+ 'transcript': transcript_1.default,
76
+ 'video-composer': video_composer_1.default,
77
+ 'video-import': video_import_1.default,
78
+ };
79
+ // =============================================================================
80
+ // Getters
81
+ // =============================================================================
82
+ /**
83
+ * Get all node definitions as an array
84
+ */
85
+ function getAllNodeDefinitions() {
86
+ return Object.values(exports.nodeDefinitions);
87
+ }
88
+ /**
89
+ * Get a node definition by its nodeId
90
+ */
91
+ function getNodeDefinition(nodeId) {
92
+ return exports.nodeDefinitions[nodeId];
93
+ }