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.
- package/dist/accounts.d.ts +146 -1
- package/dist/automations/index.d.ts +174 -0
- package/dist/automations/index.js +194 -0
- package/dist/automations/nodes/account.d.ts +18 -0
- package/dist/automations/nodes/account.js +29 -0
- package/dist/automations/nodes/auto-caption.d.ts +64 -0
- package/dist/automations/nodes/auto-caption.js +46 -0
- package/dist/automations/nodes/auto-post.d.ts +81 -0
- package/dist/automations/nodes/auto-post.js +54 -0
- package/dist/automations/nodes/branch.d.ts +58 -0
- package/dist/automations/nodes/branch.js +50 -0
- package/dist/automations/nodes/collect.d.ts +16 -0
- package/dist/automations/nodes/collect.js +56 -0
- package/dist/automations/nodes/compose-workflow.d.ts +21 -0
- package/dist/automations/nodes/compose-workflow.js +42 -0
- package/dist/automations/nodes/create-dm.d.ts +96 -0
- package/dist/automations/nodes/create-dm.js +88 -0
- package/dist/automations/nodes/custom-model.d.ts +19 -0
- package/dist/automations/nodes/custom-model.js +52 -0
- package/dist/automations/nodes/deduplicate.d.ts +8 -0
- package/dist/automations/nodes/deduplicate.js +36 -0
- package/dist/automations/nodes/destructure.d.ts +25 -0
- package/dist/automations/nodes/destructure.js +65 -0
- package/dist/automations/nodes/for-each.d.ts +23 -0
- package/dist/automations/nodes/for-each.js +84 -0
- package/dist/automations/nodes/generate-image.d.ts +16 -0
- package/dist/automations/nodes/generate-image.js +45 -0
- package/dist/automations/nodes/generate-video.d.ts +16 -0
- package/dist/automations/nodes/generate-video.js +45 -0
- package/dist/automations/nodes/if.d.ts +22 -0
- package/dist/automations/nodes/if.js +44 -0
- package/dist/automations/nodes/image-composer.d.ts +33 -0
- package/dist/automations/nodes/image-composer.js +95 -0
- package/dist/automations/nodes/index.d.ts +20 -0
- package/dist/automations/nodes/index.js +93 -0
- package/dist/automations/nodes/llm.d.ts +27 -0
- package/dist/automations/nodes/llm.js +85 -0
- package/dist/automations/nodes/manual-trigger.d.ts +34 -0
- package/dist/automations/nodes/manual-trigger.js +32 -0
- package/dist/automations/nodes/media.d.ts +17 -0
- package/dist/automations/nodes/media.js +40 -0
- package/dist/automations/nodes/not.d.ts +6 -0
- package/dist/automations/nodes/not.js +35 -0
- package/dist/automations/nodes/output.d.ts +30 -0
- package/dist/automations/nodes/output.js +32 -0
- package/dist/automations/nodes/random-route.d.ts +52 -0
- package/dist/automations/nodes/random-route.js +53 -0
- package/dist/automations/nodes/random.d.ts +16 -0
- package/dist/automations/nodes/random.js +50 -0
- package/dist/automations/nodes/recurrence.d.ts +69 -0
- package/dist/automations/nodes/recurrence.js +50 -0
- package/dist/automations/nodes/save-to-media.d.ts +32 -0
- package/dist/automations/nodes/save-to-media.js +31 -0
- package/dist/automations/nodes/screenshot-animation.d.ts +7 -0
- package/dist/automations/nodes/screenshot-animation.js +36 -0
- package/dist/automations/nodes/social-audio.d.ts +8 -0
- package/dist/automations/nodes/social-audio.js +30 -0
- package/dist/automations/nodes/text.d.ts +7 -0
- package/dist/automations/nodes/text.js +41 -0
- package/dist/automations/nodes/transcript.d.ts +6 -0
- package/dist/automations/nodes/transcript.js +46 -0
- package/dist/automations/nodes/types.d.ts +178 -0
- package/dist/automations/nodes/types.js +22 -0
- package/dist/automations/nodes/video-composer.d.ts +25 -0
- package/dist/automations/nodes/video-composer.js +71 -0
- package/dist/automations/nodes/video-import.d.ts +27 -0
- package/dist/automations/nodes/video-import.js +37 -0
- package/dist/automations/types.d.ts +544 -0
- package/dist/automations/types.js +101 -0
- package/dist/automations.d.ts +5 -33
- package/dist/automations.js +6 -647
- package/dist/comments.d.ts +26 -1
- package/dist/comments.js +3 -0
- package/dist/graph-controller.d.ts +194 -0
- package/dist/graph-controller.js +623 -0
- package/dist/index.d.ts +38 -9
- package/dist/index.js +43 -23
- package/dist/internal-utils.d.ts +8 -0
- package/dist/internal-utils.js +22 -0
- package/dist/media.d.ts +135 -1
- package/dist/nodes/account.d.ts +7 -0
- package/dist/nodes/account.js +29 -0
- package/dist/nodes/auto-caption.d.ts +17 -0
- package/dist/nodes/auto-caption.js +46 -0
- package/dist/nodes/auto-post.d.ts +21 -0
- package/dist/nodes/auto-post.js +54 -0
- package/dist/nodes/branch.d.ts +12 -0
- package/dist/nodes/branch.js +50 -0
- package/dist/nodes/collect.d.ts +6 -0
- package/dist/nodes/collect.js +56 -0
- package/dist/nodes/compose-workflow.d.ts +21 -0
- package/dist/nodes/compose-workflow.js +42 -0
- package/dist/nodes/create-dm.d.ts +40 -0
- package/dist/nodes/create-dm.js +88 -0
- package/dist/nodes/custom-model.d.ts +19 -0
- package/dist/nodes/custom-model.js +52 -0
- package/dist/nodes/deduplicate.d.ts +8 -0
- package/dist/nodes/deduplicate.js +36 -0
- package/dist/nodes/destructure.d.ts +25 -0
- package/dist/nodes/destructure.js +65 -0
- package/dist/nodes/for-each.d.ts +23 -0
- package/dist/nodes/for-each.js +84 -0
- package/dist/nodes/generate-image.d.ts +16 -0
- package/dist/nodes/generate-image.js +45 -0
- package/dist/nodes/generate-video.d.ts +16 -0
- package/dist/nodes/generate-video.js +45 -0
- package/dist/nodes/if.d.ts +22 -0
- package/dist/nodes/if.js +44 -0
- package/dist/nodes/image-composer.d.ts +14 -0
- package/dist/nodes/image-composer.js +95 -0
- package/dist/nodes/index.d.ts +20 -0
- package/dist/nodes/index.js +93 -0
- package/dist/nodes/llm.d.ts +27 -0
- package/dist/nodes/llm.js +85 -0
- package/dist/nodes/manual-trigger.d.ts +16 -0
- package/dist/nodes/manual-trigger.js +32 -0
- package/dist/nodes/media.d.ts +17 -0
- package/dist/nodes/media.js +40 -0
- package/dist/nodes/not.d.ts +6 -0
- package/dist/nodes/not.js +35 -0
- package/dist/nodes/output.d.ts +9 -0
- package/dist/nodes/output.js +32 -0
- package/dist/nodes/random-route.d.ts +3 -0
- package/dist/nodes/random-route.js +50 -0
- package/dist/nodes/random.d.ts +3 -0
- package/dist/nodes/random.js +48 -0
- package/dist/nodes/recurrence.d.ts +3 -0
- package/dist/nodes/recurrence.js +45 -0
- package/dist/nodes/save-to-media.d.ts +3 -0
- package/dist/nodes/save-to-media.js +26 -0
- package/dist/nodes/screenshot-animation.d.ts +7 -0
- package/dist/nodes/screenshot-animation.js +36 -0
- package/dist/nodes/social-audio.d.ts +3 -0
- package/dist/nodes/social-audio.js +26 -0
- package/dist/nodes/text.d.ts +3 -0
- package/dist/nodes/text.js +38 -0
- package/dist/nodes/transcript.d.ts +3 -0
- package/dist/nodes/transcript.js +42 -0
- package/dist/nodes/types.d.ts +146 -0
- package/dist/nodes/types.js +22 -0
- package/dist/nodes/video-composer.d.ts +3 -0
- package/dist/nodes/video-composer.js +67 -0
- package/dist/nodes/video-import.d.ts +3 -0
- package/dist/nodes/video-import.js +35 -0
- package/dist/org.d.ts +13 -1
- package/dist/ports.js +3 -9
- package/dist/posts.d.ts +88 -1
- package/dist/render/compositions/IMessageDmComposition/types.d.ts +20 -20
- package/dist/render/types/video.d.ts +2 -2
- package/dist/stats.d.ts +128 -1
- package/dist/tasks.d.ts +20 -1
- package/dist/types.d.ts +1 -2216
- package/dist/types.js +2 -124
- package/package.json +1 -1
|
@@ -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
|
+
'output': 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
|
+
}
|
|
@@ -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,16 @@
|
|
|
1
|
+
import type { EnumOption } from '../types';
|
|
2
|
+
import { type ObjectSchemaField } from './types';
|
|
3
|
+
interface ManualTriggerOutput {
|
|
4
|
+
id: string;
|
|
5
|
+
type: string;
|
|
6
|
+
isArray?: boolean;
|
|
7
|
+
objectSchema?: ObjectSchemaField[];
|
|
8
|
+
enumOptions?: EnumOption[];
|
|
9
|
+
}
|
|
10
|
+
declare const definition: import("./types").NodeDefinition<"trigger", {
|
|
11
|
+
outputs: ManualTriggerOutput[];
|
|
12
|
+
outputMode: null;
|
|
13
|
+
selectionMode: null;
|
|
14
|
+
}>;
|
|
15
|
+
export default definition;
|
|
16
|
+
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,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,9 @@
|
|
|
1
|
+
import type { OutputInput } from '../types';
|
|
2
|
+
declare const definition: import("./types").NodeDefinition<"terminal", {
|
|
3
|
+
inputs: OutputInput[];
|
|
4
|
+
mainPreviewInputId: string | undefined;
|
|
5
|
+
outputMode: null;
|
|
6
|
+
selectionMode: null;
|
|
7
|
+
}>;
|
|
8
|
+
export default definition;
|
|
9
|
+
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,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const definition = {
|
|
4
|
+
nodeId: 'random-route',
|
|
5
|
+
label: 'Random Branch',
|
|
6
|
+
description: 'Route inputs to a randomly selected branch',
|
|
7
|
+
type: 'generator',
|
|
8
|
+
category: 'Control Flow',
|
|
9
|
+
getDefaultConfig: () => ({
|
|
10
|
+
randomRouteConfig: {
|
|
11
|
+
branches: [
|
|
12
|
+
{ id: 'branch-1', probability: 50 },
|
|
13
|
+
{ id: 'branch-2', probability: 50 },
|
|
14
|
+
],
|
|
15
|
+
passthroughInputs: [{ id: 'input', type: 'image', isArray: false, isVariable: false }],
|
|
16
|
+
},
|
|
17
|
+
outputMode: 'single',
|
|
18
|
+
}),
|
|
19
|
+
computePorts: ({ config }) => {
|
|
20
|
+
const routeConfig = config?.randomRouteConfig;
|
|
21
|
+
const branches = routeConfig?.branches ?? [];
|
|
22
|
+
const passthroughInputs = routeConfig?.passthroughInputs ?? [];
|
|
23
|
+
const inputs = [];
|
|
24
|
+
const outputs = [];
|
|
25
|
+
// Input ports: only passthroughs where isVariable is true
|
|
26
|
+
for (const passthrough of passthroughInputs) {
|
|
27
|
+
if (passthrough.isVariable) {
|
|
28
|
+
inputs.push({
|
|
29
|
+
id: passthrough.id,
|
|
30
|
+
type: passthrough.type,
|
|
31
|
+
isArray: passthrough.isArray ?? false,
|
|
32
|
+
required: true,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Output ports: {branch.id}-{passthrough.id} for each combination
|
|
37
|
+
for (const branch of branches) {
|
|
38
|
+
for (const passthrough of passthroughInputs) {
|
|
39
|
+
outputs.push({
|
|
40
|
+
id: `${branch.id}-${passthrough.id}`,
|
|
41
|
+
type: passthrough.type,
|
|
42
|
+
isArray: passthrough.isArray ?? false,
|
|
43
|
+
required: true,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return { inputs, outputs };
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
exports.default = definition;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const definition = {
|
|
4
|
+
nodeId: 'random',
|
|
5
|
+
label: 'Random Select',
|
|
6
|
+
description: 'Randomly select from an array or weighted inputs',
|
|
7
|
+
type: 'generator',
|
|
8
|
+
category: 'Control Flow',
|
|
9
|
+
getDefaultConfig: () => ({
|
|
10
|
+
randomConfig: {
|
|
11
|
+
mode: 'array',
|
|
12
|
+
valueType: 'object',
|
|
13
|
+
exposeIndex: false,
|
|
14
|
+
},
|
|
15
|
+
outputMode: 'single',
|
|
16
|
+
}),
|
|
17
|
+
computePorts: ({ config }) => {
|
|
18
|
+
const randomConfig = config?.randomConfig;
|
|
19
|
+
const mode = randomConfig?.mode ?? 'array';
|
|
20
|
+
const valueType = (randomConfig?.valueType ?? 'object');
|
|
21
|
+
const exposeIndex = randomConfig?.exposeIndex ?? false;
|
|
22
|
+
const inputPorts = randomConfig?.inputPorts ?? [];
|
|
23
|
+
const inputs = [];
|
|
24
|
+
const outputs = [];
|
|
25
|
+
if (mode === 'array') {
|
|
26
|
+
inputs.push({ id: 'array', type: 'object', isArray: false, required: true });
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// Multi-input mode: only add ports where isVariable is true
|
|
30
|
+
for (const port of inputPorts) {
|
|
31
|
+
if (port.isVariable) {
|
|
32
|
+
inputs.push({
|
|
33
|
+
id: port.id,
|
|
34
|
+
type: valueType,
|
|
35
|
+
isArray: false,
|
|
36
|
+
required: true,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
outputs.push({ id: 'output', type: valueType, isArray: false, required: true });
|
|
42
|
+
if (mode === 'array' && exposeIndex) {
|
|
43
|
+
outputs.push({ id: 'index', type: 'number', isArray: false, required: true });
|
|
44
|
+
}
|
|
45
|
+
return { inputs, outputs };
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
exports.default = definition;
|