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,27 @@
1
+ import { type ObjectSchemaField } from './types';
2
+ declare const LLMProviders: readonly ["groq", "openai", "claude", "gemini"];
3
+ type LLMProvider = typeof LLMProviders[number];
4
+ interface LLMApiKeys {
5
+ openai?: string;
6
+ claude?: string;
7
+ gemini?: string;
8
+ groq?: string;
9
+ }
10
+ declare const definition: import("./types").NodeDefinition<"generator", {
11
+ provider: LLMProvider;
12
+ model: string;
13
+ temperature: number;
14
+ maxTokens: number | undefined;
15
+ systemPrompt: string;
16
+ outputFields: ObjectSchemaField[];
17
+ useStructuredOutput: boolean;
18
+ imageInputRefs: string[];
19
+ videoInputRefs: string[];
20
+ apiKeys: LLMApiKeys | undefined;
21
+ outputMode: "per-input";
22
+ selectionMode: null;
23
+ }>;
24
+ export default definition;
25
+ export { LLMProviders };
26
+ export type { LLMProvider, LLMApiKeys };
27
+ export type LLMConfig = typeof definition.defaults;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LLMProviders = void 0;
4
+ const internal_utils_1 = require("../../internal-utils");
5
+ const types_1 = require("./types");
6
+ const LLMProviders = ['groq', 'openai', 'claude', 'gemini'];
7
+ exports.LLMProviders = LLMProviders;
8
+ const definition = (0, types_1.defineNode)({
9
+ nodeId: 'llm',
10
+ label: 'LLM',
11
+ description: 'Generate LLM output',
12
+ type: 'generator',
13
+ category: 'AI Generation',
14
+ outputModes: ['per-input', 'single'],
15
+ selectionModes: null,
16
+ defaults: {
17
+ provider: 'claude',
18
+ model: 'claude-sonnet-4-5',
19
+ temperature: 0.7,
20
+ maxTokens: undefined,
21
+ systemPrompt: '',
22
+ outputFields: [{ name: 'output', type: 'string' }],
23
+ useStructuredOutput: true,
24
+ imageInputRefs: [],
25
+ videoInputRefs: [],
26
+ apiKeys: undefined,
27
+ outputMode: 'per-input',
28
+ selectionMode: null,
29
+ },
30
+ computePorts: ({ config }) => {
31
+ // Input ports from template variables + media refs
32
+ const systemPrompt = config?.systemPrompt ?? '';
33
+ const variables = (0, internal_utils_1.extractTemplateVariables)([systemPrompt]);
34
+ const imageInputRefs = config?.imageInputRefs ?? [];
35
+ const videoInputRefs = config?.videoInputRefs ?? [];
36
+ const inputs = [
37
+ ...variables.map(v => ({
38
+ id: v,
39
+ type: ['text', 'object', 'boolean'],
40
+ isArray: false,
41
+ required: true,
42
+ })),
43
+ ...imageInputRefs.map(ref => ({
44
+ id: ref,
45
+ type: 'image',
46
+ isArray: false,
47
+ required: true,
48
+ })),
49
+ ...videoInputRefs.map(ref => ({
50
+ id: ref,
51
+ type: 'video',
52
+ isArray: false,
53
+ required: true,
54
+ })),
55
+ ];
56
+ // Output ports from outputFields
57
+ const outputFields = (config?.outputFields ?? [{ name: 'output', type: 'string' }]);
58
+ const outputs = outputFields.map(f => {
59
+ let pType;
60
+ let pIsArray;
61
+ if (f.type === 'array') {
62
+ pType = f.items === 'object' ? 'object' : 'text';
63
+ pIsArray = true;
64
+ }
65
+ else if (f.type === 'object') {
66
+ pType = 'object';
67
+ pIsArray = false;
68
+ }
69
+ else {
70
+ pType = 'text';
71
+ pIsArray = false;
72
+ }
73
+ return {
74
+ id: f.name,
75
+ type: pType,
76
+ isArray: pIsArray,
77
+ required: f.required ?? true,
78
+ // Include objectSchema for object/array-of-object types
79
+ ...(f.objectSchema && { objectSchema: f.objectSchema }),
80
+ };
81
+ });
82
+ return { inputs, outputs };
83
+ },
84
+ });
85
+ exports.default = definition;
@@ -0,0 +1,34 @@
1
+ import type { EnumOption } from '../types';
2
+ import { type ObjectSchemaField } from './types';
3
+ interface ManualTriggerOutputLocal {
4
+ id: string;
5
+ type: string;
6
+ isArray?: boolean;
7
+ objectSchema?: ObjectSchemaField[];
8
+ enumOptions?: EnumOption[];
9
+ }
10
+ /**
11
+ * Manual Trigger node output definition
12
+ */
13
+ export interface ManualTriggerOutput {
14
+ id: string;
15
+ type: 'image' | 'video' | 'audio' | 'text' | 'social_audio' | 'account' | 'boolean' | 'object' | 'enum';
16
+ isArray?: boolean;
17
+ /** Schema for object types - describes the structure of the object */
18
+ objectSchema?: ObjectSchemaField[];
19
+ /** Options for enum types */
20
+ enumOptions?: EnumOption[];
21
+ }
22
+ /**
23
+ * Manual Trigger node configuration - defines outputs that users provide when running
24
+ */
25
+ export interface ManualTriggerNodeConfig {
26
+ outputs: ManualTriggerOutput[];
27
+ }
28
+ declare const definition: import("./types").NodeDefinition<"trigger", {
29
+ outputs: ManualTriggerOutputLocal[];
30
+ outputMode: null;
31
+ selectionMode: null;
32
+ }>;
33
+ export default definition;
34
+ export type ManualTriggerConfig = typeof definition.defaults;
@@ -0,0 +1,32 @@
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: 'manual-trigger',
6
+ label: 'Manual Trigger',
7
+ description: 'Trigger manually',
8
+ type: 'trigger',
9
+ category: 'Triggers',
10
+ outputModes: null,
11
+ selectionModes: null,
12
+ defaults: {
13
+ outputs: [{ id: 'input-1', type: 'image' }],
14
+ outputMode: null,
15
+ selectionMode: null,
16
+ },
17
+ computePorts: ({ config }) => {
18
+ const configOutputs = (config?.outputs ?? []);
19
+ const outputs = configOutputs.map(output => ({
20
+ id: output.id,
21
+ type: output.type,
22
+ isArray: output.isArray ?? false,
23
+ required: true,
24
+ ...(output.type === 'enum' && output.enumOptions ? { enumOptions: output.enumOptions } : {}),
25
+ }));
26
+ return {
27
+ inputs: [],
28
+ outputs,
29
+ };
30
+ },
31
+ });
32
+ exports.default = definition;
@@ -0,0 +1,17 @@
1
+ import { type SelectionConfig } from './types';
2
+ type MediaNodeEnabledType = 'image' | 'video' | 'audio';
3
+ declare const definition: import("./types").NodeDefinition<"source", {
4
+ outputs: {
5
+ id: string;
6
+ type: MediaNodeEnabledType;
7
+ isArray: boolean;
8
+ selectedMediaIds: string[];
9
+ selectionConfig: SelectionConfig | undefined;
10
+ }[];
11
+ outputMode: "per-input";
12
+ selectionMode: "random";
13
+ }>;
14
+ export default definition;
15
+ export type { MediaNodeEnabledType };
16
+ export type MediaConfig = typeof definition.defaults;
17
+ export type MediaNodeOutput = MediaConfig['outputs'][number];
@@ -0,0 +1,40 @@
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: 'media',
6
+ label: 'Media',
7
+ description: 'Use saved media',
8
+ type: 'source',
9
+ category: 'Sources',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: ['random', 'sequential'],
12
+ defaults: {
13
+ outputs: [{
14
+ id: 'image-1',
15
+ type: 'image',
16
+ isArray: false,
17
+ selectedMediaIds: [],
18
+ selectionConfig: undefined,
19
+ }],
20
+ outputMode: 'per-input',
21
+ selectionMode: 'random',
22
+ },
23
+ computePorts: ({ config }) => {
24
+ const outputConfigs = config?.outputs ?? [];
25
+ // Generate output ports from config (only those with selected media)
26
+ const outputs = outputConfigs
27
+ .filter(o => o.selectedMediaIds.length > 0)
28
+ .map(o => ({
29
+ id: o.id,
30
+ type: o.type,
31
+ isArray: o.isArray,
32
+ required: true,
33
+ }));
34
+ return {
35
+ inputs: [],
36
+ outputs,
37
+ };
38
+ },
39
+ });
40
+ exports.default = definition;
@@ -0,0 +1,6 @@
1
+ declare const definition: import("./types").NodeDefinition<"generator", {
2
+ outputMode: "per-input";
3
+ selectionMode: null;
4
+ }>;
5
+ export default definition;
6
+ export type NotConfig = typeof definition.defaults;
@@ -0,0 +1,35 @@
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: 'not',
6
+ label: 'Not',
7
+ description: 'Invert a boolean value',
8
+ type: 'generator',
9
+ category: 'Control Flow',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ outputMode: 'per-input',
14
+ selectionMode: null,
15
+ },
16
+ computePorts: () => ({
17
+ inputs: [
18
+ {
19
+ id: 'input',
20
+ type: 'boolean',
21
+ isArray: false,
22
+ required: true,
23
+ },
24
+ ],
25
+ outputs: [
26
+ {
27
+ id: 'output',
28
+ type: 'boolean',
29
+ isArray: false,
30
+ required: true,
31
+ },
32
+ ],
33
+ }),
34
+ });
35
+ exports.default = definition;
@@ -0,0 +1,30 @@
1
+ import { type ObjectSchemaField } from './types';
2
+ /**
3
+ * Output node input definition
4
+ */
5
+ export interface OutputInput {
6
+ id: string;
7
+ type: 'image' | 'video' | 'audio' | 'text' | 'social_audio' | 'account' | 'boolean' | 'object';
8
+ /** Individual tag for this input (overrides global tag) */
9
+ tag?: string;
10
+ /** Whether this input accepts an array */
11
+ isArray?: boolean;
12
+ /** Schema of object properties (when type is object) */
13
+ objectSchema?: ObjectSchemaField[];
14
+ }
15
+ /**
16
+ * Output node configuration
17
+ */
18
+ export interface OutputNodeConfig {
19
+ inputs: OutputInput[];
20
+ /** Which input is the main visual preview for the workflow */
21
+ mainPreviewInputId?: string;
22
+ }
23
+ declare const definition: import("./types").NodeDefinition<"terminal", {
24
+ inputs: OutputInput[];
25
+ mainPreviewInputId: string | undefined;
26
+ outputMode: null;
27
+ selectionMode: null;
28
+ }>;
29
+ export default definition;
30
+ export type PassthroughConfig = typeof definition.defaults;
@@ -0,0 +1,32 @@
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: 'passthrough',
6
+ label: 'Pass-Through',
7
+ description: 'Pass data to parent workflow',
8
+ type: 'terminal',
9
+ category: 'Output',
10
+ outputModes: null,
11
+ selectionModes: null,
12
+ defaults: {
13
+ inputs: [{ id: 'result', type: 'image' }],
14
+ mainPreviewInputId: undefined,
15
+ outputMode: null,
16
+ selectionMode: null,
17
+ },
18
+ computePorts: ({ config }) => {
19
+ const configInputs = config?.inputs ?? [];
20
+ const inputs = configInputs.map(input => ({
21
+ id: input.id,
22
+ type: input.type,
23
+ isArray: input.isArray ?? false,
24
+ required: false,
25
+ }));
26
+ return {
27
+ inputs,
28
+ outputs: [],
29
+ };
30
+ },
31
+ });
32
+ exports.default = definition;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Random Branch branch definition
3
+ */
4
+ export interface RandomRouteBranch {
5
+ /** Unique ID for this branch (e.g., "branch-1") */
6
+ id: string;
7
+ /** Probability weight (0-100, all branches must sum to 100) */
8
+ probability: number;
9
+ }
10
+ /**
11
+ * Object field definition for Random Branch passthrough input default values
12
+ */
13
+ export interface RandomRouteObjectField {
14
+ /** Field name */
15
+ name: string;
16
+ /** Field type */
17
+ type: 'string' | 'number' | 'boolean';
18
+ }
19
+ /**
20
+ * Random Branch passthrough input definition
21
+ */
22
+ export interface RandomRoutePassthroughInput {
23
+ /** The input port ID (lowercase, hyphens/underscores only) */
24
+ id: string;
25
+ /** The value type */
26
+ type: 'image' | 'video' | 'audio' | 'text' | 'number' | 'boolean' | 'account' | 'object';
27
+ /** Whether this is an array type */
28
+ isArray?: boolean;
29
+ /** Whether this input comes from a variable (input port) vs static default value. Defaults to false. */
30
+ isVariable?: boolean;
31
+ /** Default value when isVariable is false (type depends on type field) */
32
+ defaultValue?: unknown;
33
+ /** Object schema for object type (when type is 'object') */
34
+ objectSchema?: RandomRouteObjectField[];
35
+ }
36
+ /**
37
+ * Random Branch node configuration - routes inputs to a randomly selected branch based on probability
38
+ */
39
+ export interface RandomRouteNodeConfig {
40
+ /** Output branches with probability weights (must sum to 100) */
41
+ branches: RandomRouteBranch[];
42
+ /** Passthrough inputs that get routed to one branch's outputs */
43
+ passthroughInputs: RandomRoutePassthroughInput[];
44
+ }
45
+ declare const definition: import("./types").NodeDefinition<"generator", {
46
+ branches: RandomRouteBranch[];
47
+ passthroughInputs: RandomRoutePassthroughInput[];
48
+ outputMode: "single";
49
+ selectionMode: null;
50
+ }>;
51
+ export default definition;
52
+ export type RandomRouteConfig = typeof definition.defaults;
@@ -0,0 +1,53 @@
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: 'random-route',
6
+ label: 'Random Branch',
7
+ description: 'Route inputs to a randomly selected branch',
8
+ type: 'generator',
9
+ category: 'Control Flow',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ branches: [
14
+ { id: 'branch-1', probability: 50 },
15
+ { id: 'branch-2', probability: 50 },
16
+ ],
17
+ passthroughInputs: [
18
+ { id: 'input', type: 'image', isArray: false, isVariable: false },
19
+ ],
20
+ outputMode: 'single',
21
+ selectionMode: null,
22
+ },
23
+ computePorts: ({ config }) => {
24
+ const branches = (config?.branches ?? []);
25
+ const passthroughInputs = (config?.passthroughInputs ?? []);
26
+ const inputs = [];
27
+ const outputs = [];
28
+ // Input ports: only passthroughs where isVariable is true
29
+ for (const passthrough of passthroughInputs) {
30
+ if (passthrough.isVariable) {
31
+ inputs.push({
32
+ id: passthrough.id,
33
+ type: passthrough.type,
34
+ isArray: passthrough.isArray ?? false,
35
+ required: true,
36
+ });
37
+ }
38
+ }
39
+ // Output ports: {branch.id}-{passthrough.id} for each combination
40
+ for (const branch of branches) {
41
+ for (const passthrough of passthroughInputs) {
42
+ outputs.push({
43
+ id: `${branch.id}-${passthrough.id}`,
44
+ type: passthrough.type,
45
+ isArray: passthrough.isArray ?? false,
46
+ required: true,
47
+ });
48
+ }
49
+ }
50
+ return { inputs, outputs };
51
+ },
52
+ });
53
+ exports.default = definition;
@@ -0,0 +1,16 @@
1
+ export interface RandomInputPort {
2
+ id: string;
3
+ probability: number;
4
+ isVariable: boolean;
5
+ defaultValue?: unknown;
6
+ }
7
+ declare const definition: import("./types").NodeDefinition<"generator", {
8
+ mode: "array" | "multi-input";
9
+ valueType: string;
10
+ exposeIndex: boolean;
11
+ inputPorts: RandomInputPort[];
12
+ outputMode: "single";
13
+ selectionMode: null;
14
+ }>;
15
+ export default definition;
16
+ export type RandomConfig = typeof definition.defaults;
@@ -0,0 +1,50 @@
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: 'random',
6
+ label: 'Random Select',
7
+ description: 'Randomly select from an array or weighted inputs',
8
+ type: 'generator',
9
+ category: 'Control Flow',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ mode: 'array',
14
+ valueType: 'object',
15
+ exposeIndex: false,
16
+ inputPorts: [],
17
+ outputMode: 'single',
18
+ selectionMode: null,
19
+ },
20
+ computePorts: ({ config }) => {
21
+ const mode = config?.mode ?? 'array';
22
+ const valueType = (config?.valueType ?? 'object');
23
+ const exposeIndex = config?.exposeIndex ?? false;
24
+ const inputPorts = (config?.inputPorts ?? []);
25
+ const inputs = [];
26
+ const outputs = [];
27
+ if (mode === 'array') {
28
+ inputs.push({ id: 'array', type: 'object', isArray: false, required: true });
29
+ }
30
+ else {
31
+ // Multi-input mode: only add ports where isVariable is true
32
+ for (const port of inputPorts) {
33
+ if (port.isVariable) {
34
+ inputs.push({
35
+ id: port.id,
36
+ type: valueType,
37
+ isArray: false,
38
+ required: true,
39
+ });
40
+ }
41
+ }
42
+ }
43
+ outputs.push({ id: 'output', type: valueType, isArray: false, required: true });
44
+ if (mode === 'array' && exposeIndex) {
45
+ outputs.push({ id: 'index', type: 'number', isArray: false, required: true });
46
+ }
47
+ return { inputs, outputs };
48
+ },
49
+ });
50
+ exports.default = definition;
@@ -0,0 +1,69 @@
1
+ import { type TriggerCollectionConfig } from './types';
2
+ /**
3
+ * Days of the week for recurrence scheduling
4
+ */
5
+ export type DayOfWeek = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
6
+ /**
7
+ * Recurrence media output port definition
8
+ * Each output is a named port with a specific media type and its own selection config
9
+ */
10
+ export interface RecurrenceMediaOutput {
11
+ /** Unique ID for this output port (e.g., "background-image", "overlay") */
12
+ id: string;
13
+ /** Media type for this port */
14
+ type: 'image' | 'video' | 'audio' | 'text' | 'social_audio';
15
+ /** Selection mode for this output's media source */
16
+ selectionMode: 'specific' | 'by-tag';
17
+ /** Media IDs for this output (used when selectionMode is 'specific') */
18
+ selectedMediaIds?: string[];
19
+ /** Tag to query media by at runtime (used when selectionMode is 'by-tag') */
20
+ mediaTag?: string;
21
+ }
22
+ /**
23
+ * Media input configuration for recurrence nodes
24
+ * Each output has its own selection configuration
25
+ */
26
+ export interface RecurrenceMediaConfig {
27
+ /** Whether media input is enabled */
28
+ enabled: boolean;
29
+ /** Named output ports - each has its own selection config */
30
+ outputs: RecurrenceMediaOutput[];
31
+ }
32
+ /**
33
+ * Recurrence node configuration - defines when the automation runs on a schedule
34
+ */
35
+ export interface RecurrenceNodeConfig {
36
+ frequencyType: 'per-day' | 'periodic';
37
+ runsPerDay: number;
38
+ periodDays: number;
39
+ daysOfWeek: DayOfWeek[];
40
+ timingType: 'specific' | 'random-window';
41
+ specificTimes: string[];
42
+ randomWindowStart: string;
43
+ randomWindowEnd: string;
44
+ timezone: string;
45
+ collectionInput?: TriggerCollectionConfig;
46
+ mediaInput?: RecurrenceMediaConfig;
47
+ }
48
+ /**
49
+ * Recurrence media enabled type
50
+ * Includes all media types that can be output from recurrence nodes
51
+ */
52
+ export type RecurrenceMediaEnabledType = 'image' | 'video' | 'audio' | 'text' | 'social_audio';
53
+ declare const definition: import("./types").NodeDefinition<"trigger", {
54
+ frequencyType: "per-day" | "periodic";
55
+ runsPerDay: number;
56
+ periodDays: number;
57
+ daysOfWeek: DayOfWeek[];
58
+ timingType: "specific" | "random-window";
59
+ specificTimes: string[];
60
+ randomWindowStart: string;
61
+ randomWindowEnd: string;
62
+ timezone: string;
63
+ collectionInput: TriggerCollectionConfig | undefined;
64
+ mediaInput: RecurrenceMediaConfig | undefined;
65
+ outputMode: null;
66
+ selectionMode: null;
67
+ }>;
68
+ export default definition;
69
+ export type RecurrenceConfig = typeof definition.defaults;
@@ -0,0 +1,50 @@
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: 'recurrence',
6
+ label: 'Recurring',
7
+ description: 'Run continuously',
8
+ type: 'trigger',
9
+ category: 'Triggers',
10
+ outputModes: null,
11
+ selectionModes: null,
12
+ defaults: {
13
+ frequencyType: 'per-day',
14
+ runsPerDay: 1,
15
+ periodDays: 7,
16
+ daysOfWeek: ['monday', 'tuesday', 'wednesday', 'thursday', 'friday'],
17
+ timingType: 'random-window',
18
+ specificTimes: ['09:00'],
19
+ randomWindowStart: '09:00',
20
+ randomWindowEnd: '17:00',
21
+ timezone: 'America/New_York',
22
+ collectionInput: undefined,
23
+ mediaInput: undefined,
24
+ outputMode: null,
25
+ selectionMode: null,
26
+ },
27
+ computePorts: ({ config }) => {
28
+ const collectionInputEnabled = config?.collectionInput?.enabled;
29
+ const mediaOutputs = (config?.mediaInput?.outputs ?? []);
30
+ const outputs = [];
31
+ // Add account output if collection input is enabled
32
+ if (collectionInputEnabled) {
33
+ outputs.push({ id: 'account', type: 'account', isArray: false, required: true });
34
+ }
35
+ // Add media outputs
36
+ for (const output of mediaOutputs) {
37
+ outputs.push({
38
+ id: output.id,
39
+ type: output.type,
40
+ isArray: false,
41
+ required: true,
42
+ });
43
+ }
44
+ return {
45
+ inputs: [],
46
+ outputs,
47
+ };
48
+ },
49
+ });
50
+ exports.default = definition;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Save To Media node input definition
3
+ */
4
+ export interface SaveToMediaInput {
5
+ id: string;
6
+ type: 'image' | 'video' | 'audio' | 'text';
7
+ /** Optional individual tag for this input (overrides global tag) */
8
+ tag?: string;
9
+ }
10
+ /**
11
+ * Save To Media node configuration - saves outputs to media library
12
+ */
13
+ export interface SaveToMediaNodeConfig {
14
+ /** Dynamic inputs to save */
15
+ inputs: SaveToMediaInput[];
16
+ /** Global tag applied to all saved items */
17
+ globalTag?: string;
18
+ /** If true, append date in mm-dd-yy format to tag */
19
+ includeDateTag?: boolean;
20
+ /** If true, append run ID to make tags unique */
21
+ makeUnique?: boolean;
22
+ }
23
+ declare const definition: import("./types").NodeDefinition<"terminal", {
24
+ inputs: SaveToMediaInput[];
25
+ globalTag: string | undefined;
26
+ includeDateTag: boolean;
27
+ makeUnique: boolean;
28
+ outputMode: null;
29
+ selectionMode: null;
30
+ }>;
31
+ export default definition;
32
+ export type SaveToMediaConfig = typeof definition.defaults;