ugcinc 4.1.21 → 4.1.23
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/automations/nodes/branch.d.ts +7 -4
- package/dist/automations/nodes/branch.js +25 -4
- package/dist/automations/nodes/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/automations.d.ts +0 -173
- package/dist/automations.js +0 -194
- package/dist/node-runtime.d.ts +0 -57
- package/dist/node-runtime.js +0 -6
- package/dist/nodes/account.d.ts +0 -7
- package/dist/nodes/account.js +0 -29
- package/dist/nodes/auto-caption.d.ts +0 -17
- package/dist/nodes/auto-caption.js +0 -46
- package/dist/nodes/auto-post.d.ts +0 -21
- package/dist/nodes/auto-post.js +0 -54
- package/dist/nodes/branch.d.ts +0 -12
- package/dist/nodes/branch.js +0 -50
- package/dist/nodes/collect.d.ts +0 -6
- package/dist/nodes/collect.js +0 -56
- package/dist/nodes/compose-workflow.d.ts +0 -21
- package/dist/nodes/compose-workflow.js +0 -42
- package/dist/nodes/create-dm.d.ts +0 -40
- package/dist/nodes/create-dm.js +0 -88
- package/dist/nodes/custom-model.d.ts +0 -19
- package/dist/nodes/custom-model.js +0 -52
- package/dist/nodes/deduplicate.d.ts +0 -8
- package/dist/nodes/deduplicate.js +0 -36
- package/dist/nodes/destructure.d.ts +0 -25
- package/dist/nodes/destructure.js +0 -65
- package/dist/nodes/for-each.d.ts +0 -23
- package/dist/nodes/for-each.js +0 -84
- package/dist/nodes/generate-image.d.ts +0 -16
- package/dist/nodes/generate-image.js +0 -45
- package/dist/nodes/generate-video.d.ts +0 -16
- package/dist/nodes/generate-video.js +0 -45
- package/dist/nodes/if.d.ts +0 -22
- package/dist/nodes/if.js +0 -44
- package/dist/nodes/image-composer.d.ts +0 -14
- package/dist/nodes/image-composer.js +0 -95
- package/dist/nodes/index.d.ts +0 -20
- package/dist/nodes/index.js +0 -93
- package/dist/nodes/llm.d.ts +0 -27
- package/dist/nodes/llm.js +0 -85
- package/dist/nodes/manual-trigger.d.ts +0 -16
- package/dist/nodes/manual-trigger.js +0 -32
- package/dist/nodes/media.d.ts +0 -17
- package/dist/nodes/media.js +0 -40
- package/dist/nodes/not.d.ts +0 -6
- package/dist/nodes/not.js +0 -35
- package/dist/nodes/output.d.ts +0 -9
- package/dist/nodes/output.js +0 -32
- package/dist/nodes/random-route.d.ts +0 -3
- package/dist/nodes/random-route.js +0 -50
- package/dist/nodes/random.d.ts +0 -3
- package/dist/nodes/random.js +0 -48
- package/dist/nodes/recurrence.d.ts +0 -3
- package/dist/nodes/recurrence.js +0 -45
- package/dist/nodes/save-to-media.d.ts +0 -3
- package/dist/nodes/save-to-media.js +0 -26
- package/dist/nodes/screenshot-animation.d.ts +0 -7
- package/dist/nodes/screenshot-animation.js +0 -36
- package/dist/nodes/social-audio.d.ts +0 -3
- package/dist/nodes/social-audio.js +0 -26
- package/dist/nodes/text.d.ts +0 -3
- package/dist/nodes/text.js +0 -38
- package/dist/nodes/transcript.d.ts +0 -3
- package/dist/nodes/transcript.js +0 -42
- package/dist/nodes/types.d.ts +0 -146
- package/dist/nodes/types.js +0 -22
- package/dist/nodes/video-composer.d.ts +0 -3
- package/dist/nodes/video-composer.js +0 -67
- package/dist/nodes/video-import.d.ts +0 -3
- package/dist/nodes/video-import.js +0 -35
- package/dist/ports.d.ts +0 -54
- package/dist/ports.js +0 -327
package/dist/nodes/media.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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];
|
package/dist/nodes/media.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
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;
|
package/dist/nodes/not.d.ts
DELETED
package/dist/nodes/not.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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;
|
package/dist/nodes/output.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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;
|
package/dist/nodes/output.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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;
|
|
@@ -1,50 +0,0 @@
|
|
|
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;
|
package/dist/nodes/random.d.ts
DELETED
package/dist/nodes/random.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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;
|
package/dist/nodes/recurrence.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const definition = {
|
|
4
|
-
nodeId: 'recurrence',
|
|
5
|
-
label: 'Recurring',
|
|
6
|
-
description: 'Run continuously',
|
|
7
|
-
type: 'trigger',
|
|
8
|
-
category: 'Triggers',
|
|
9
|
-
getDefaultConfig: () => ({
|
|
10
|
-
recurrenceConfig: {
|
|
11
|
-
frequencyType: 'per-day',
|
|
12
|
-
runsPerDay: 1,
|
|
13
|
-
periodDays: 7,
|
|
14
|
-
daysOfWeek: ['monday', 'tuesday', 'wednesday', 'thursday', 'friday'],
|
|
15
|
-
timingType: 'random-window',
|
|
16
|
-
specificTimes: ['09:00'],
|
|
17
|
-
randomWindowStart: '09:00',
|
|
18
|
-
randomWindowEnd: '17:00',
|
|
19
|
-
timezone: 'America/New_York',
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
computePorts: ({ config }) => {
|
|
23
|
-
const recurrenceConfig = config?.recurrenceConfig;
|
|
24
|
-
const outputs = [];
|
|
25
|
-
// Add account output if collection input is enabled
|
|
26
|
-
if (recurrenceConfig?.collectionInput?.enabled) {
|
|
27
|
-
outputs.push({ id: 'account', type: 'account', isArray: false, required: true });
|
|
28
|
-
}
|
|
29
|
-
// Add media outputs
|
|
30
|
-
const mediaOutputs = recurrenceConfig?.mediaInput?.outputs ?? [];
|
|
31
|
-
for (const output of mediaOutputs) {
|
|
32
|
-
outputs.push({
|
|
33
|
-
id: output.id,
|
|
34
|
-
type: output.type,
|
|
35
|
-
isArray: false,
|
|
36
|
-
required: true,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
inputs: [],
|
|
41
|
-
outputs,
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
exports.default = definition;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const definition = {
|
|
4
|
-
nodeId: 'save-to-media',
|
|
5
|
-
label: 'Save To Media',
|
|
6
|
-
description: 'Save outputs to media library',
|
|
7
|
-
type: 'terminal',
|
|
8
|
-
category: 'Output',
|
|
9
|
-
getDefaultConfig: () => ({
|
|
10
|
-
saveToMediaConfig: {
|
|
11
|
-
inputs: [{ id: 'input', type: 'image' }],
|
|
12
|
-
},
|
|
13
|
-
}),
|
|
14
|
-
computePorts: ({ config }) => {
|
|
15
|
-
const saveConfig = config?.saveToMediaConfig;
|
|
16
|
-
const configInputs = saveConfig?.inputs ?? [];
|
|
17
|
-
const inputs = configInputs.map(input => ({
|
|
18
|
-
id: input.id,
|
|
19
|
-
type: input.type,
|
|
20
|
-
isArray: false,
|
|
21
|
-
required: true,
|
|
22
|
-
}));
|
|
23
|
-
return { inputs, outputs: [] };
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
exports.default = definition;
|
|
@@ -1,36 +0,0 @@
|
|
|
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: 'screenshot-animation',
|
|
6
|
-
label: 'Animate Screenshot',
|
|
7
|
-
description: 'Create an iPhone screenshot animation from an image',
|
|
8
|
-
type: 'generator',
|
|
9
|
-
category: 'Generation',
|
|
10
|
-
outputModes: ['per-input', 'single'],
|
|
11
|
-
selectionModes: null,
|
|
12
|
-
defaults: {
|
|
13
|
-
holdDurationMs: 500,
|
|
14
|
-
outputMode: 'per-input',
|
|
15
|
-
selectionMode: null,
|
|
16
|
-
},
|
|
17
|
-
computePorts: () => ({
|
|
18
|
-
inputs: [
|
|
19
|
-
{
|
|
20
|
-
id: 'image',
|
|
21
|
-
type: 'image',
|
|
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;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const definition = {
|
|
4
|
-
nodeId: 'social-audio',
|
|
5
|
-
label: 'Social Audio',
|
|
6
|
-
description: 'Select trending audio for posts',
|
|
7
|
-
type: 'source',
|
|
8
|
-
category: 'Sources',
|
|
9
|
-
getDefaultConfig: () => ({
|
|
10
|
-
urls: [],
|
|
11
|
-
selectedMediaIds: [],
|
|
12
|
-
selectionConfig: { mode: 'random' },
|
|
13
|
-
}),
|
|
14
|
-
computePorts: () => ({
|
|
15
|
-
inputs: [],
|
|
16
|
-
outputs: [
|
|
17
|
-
{
|
|
18
|
-
id: 'social-audio',
|
|
19
|
-
type: 'social_audio',
|
|
20
|
-
isArray: false,
|
|
21
|
-
required: true,
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
}),
|
|
25
|
-
};
|
|
26
|
-
exports.default = definition;
|
package/dist/nodes/text.d.ts
DELETED
package/dist/nodes/text.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const internal_utils_1 = require("../internal-utils");
|
|
4
|
-
const definition = {
|
|
5
|
-
nodeId: 'text',
|
|
6
|
-
label: 'Text',
|
|
7
|
-
description: 'Use text collections',
|
|
8
|
-
type: 'source',
|
|
9
|
-
category: 'Sources',
|
|
10
|
-
getDefaultConfig: () => ({
|
|
11
|
-
textOptions: [],
|
|
12
|
-
selectionConfig: { mode: 'random' },
|
|
13
|
-
outputMode: 'per-input',
|
|
14
|
-
}),
|
|
15
|
-
computePorts: ({ config }) => {
|
|
16
|
-
const textOptions = (config?.textOptions ?? []);
|
|
17
|
-
const variables = (0, internal_utils_1.extractTemplateVariables)(textOptions);
|
|
18
|
-
// Generate inputs from template variables
|
|
19
|
-
const inputs = variables.map(variable => ({
|
|
20
|
-
id: variable,
|
|
21
|
-
type: 'text',
|
|
22
|
-
isArray: false,
|
|
23
|
-
required: false,
|
|
24
|
-
}));
|
|
25
|
-
return {
|
|
26
|
-
inputs,
|
|
27
|
-
outputs: [
|
|
28
|
-
{
|
|
29
|
-
id: 'text',
|
|
30
|
-
type: 'text',
|
|
31
|
-
isArray: false,
|
|
32
|
-
required: true,
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
exports.default = definition;
|
package/dist/nodes/transcript.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const definition = {
|
|
4
|
-
nodeId: 'transcript',
|
|
5
|
-
label: 'Transcribe',
|
|
6
|
-
description: 'Transcribe video or audio with timestamps',
|
|
7
|
-
type: 'generator',
|
|
8
|
-
category: 'Generation',
|
|
9
|
-
getDefaultConfig: () => ({
|
|
10
|
-
outputMode: 'per-input',
|
|
11
|
-
}),
|
|
12
|
-
computePorts: () => ({
|
|
13
|
-
inputs: [
|
|
14
|
-
{
|
|
15
|
-
id: 'media',
|
|
16
|
-
type: ['video', 'audio'],
|
|
17
|
-
isArray: false,
|
|
18
|
-
required: true,
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
outputs: [
|
|
22
|
-
{
|
|
23
|
-
id: 'text',
|
|
24
|
-
type: 'text',
|
|
25
|
-
isArray: false,
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: 'segments',
|
|
30
|
-
type: 'object',
|
|
31
|
-
isArray: false,
|
|
32
|
-
required: true,
|
|
33
|
-
objectSchema: [
|
|
34
|
-
{ name: 'text', type: 'string' },
|
|
35
|
-
{ name: 'start', type: 'number' },
|
|
36
|
-
{ name: 'end', type: 'number' },
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
}),
|
|
41
|
-
};
|
|
42
|
-
exports.default = definition;
|
package/dist/nodes/types.d.ts
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node Definition Types
|
|
3
|
-
*
|
|
4
|
-
* This file contains shared types for node definitions.
|
|
5
|
-
* Each node file imports from here and defines its behavior.
|
|
6
|
-
*/
|
|
7
|
-
import type { NodePort, BasePortType } from '../types';
|
|
8
|
-
export type NodeCategory = 'trigger' | 'source' | 'generator' | 'terminal';
|
|
9
|
-
export type OutputMode = 'per-input' | 'single';
|
|
10
|
-
export type SelectionMode = 'random' | 'sequential';
|
|
11
|
-
export type ExhaustionBehavior = 'restart' | 'error';
|
|
12
|
-
export type InputType = 'static' | 'variable';
|
|
13
|
-
type PrimitiveType = 'string' | 'number' | 'boolean';
|
|
14
|
-
/**
|
|
15
|
-
* Generic type for object schema fields with compile-time depth enforcement.
|
|
16
|
-
*
|
|
17
|
-
* - Level 1 (default): Can have 'object' or 'array' types, arrays can contain objects
|
|
18
|
-
* - Level 2: Can have 'object' or 'array' types, arrays cannot contain objects
|
|
19
|
-
* - Level 3: Only primitive types allowed
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // Level 1 field (top-level)
|
|
23
|
-
* const field: SchemaField = { name: 'users', type: 'array', items: 'object', objectSchema: [...] };
|
|
24
|
-
*
|
|
25
|
-
* // Level 2 field (inside objectSchema)
|
|
26
|
-
* const nested: SchemaField<true, false> = { name: 'tags', type: 'array', items: 'string' };
|
|
27
|
-
*
|
|
28
|
-
* // Level 3 field (deepest level)
|
|
29
|
-
* const leaf: SchemaField<false, false> = { name: 'id', type: 'string' };
|
|
30
|
-
*/
|
|
31
|
-
/**
|
|
32
|
-
* Schema field type with compile-time depth enforcement for array items.
|
|
33
|
-
*
|
|
34
|
-
* - Level 1 (default): Arrays can contain objects (`items: 'object'`)
|
|
35
|
-
* - Level 2+: Arrays can only contain primitives
|
|
36
|
-
*
|
|
37
|
-
* The `objectSchema` property is always `ObjectSchemaField[]` so it can be
|
|
38
|
-
* passed directly to ports without type mismatches.
|
|
39
|
-
*/
|
|
40
|
-
export type SchemaField<CanNestObjects extends boolean = true> = {
|
|
41
|
-
name: string;
|
|
42
|
-
description?: string;
|
|
43
|
-
type: PrimitiveType | 'object' | 'array';
|
|
44
|
-
items?: PrimitiveType | (CanNestObjects extends true ? 'object' : never);
|
|
45
|
-
objectSchema?: ObjectSchemaField[];
|
|
46
|
-
length?: number;
|
|
47
|
-
minLength?: number;
|
|
48
|
-
maxLength?: number;
|
|
49
|
-
required?: boolean;
|
|
50
|
-
};
|
|
51
|
-
/** Top-level schema field - arrays can contain objects */
|
|
52
|
-
export type ObjectSchemaField = SchemaField<true>;
|
|
53
|
-
/** Nested schema field (inside objectSchema) - arrays can only contain primitives */
|
|
54
|
-
export type NestedSchemaField = SchemaField<false>;
|
|
55
|
-
export interface BranchValueConfig {
|
|
56
|
-
inputType?: InputType;
|
|
57
|
-
}
|
|
58
|
-
export interface PassthroughInput {
|
|
59
|
-
id: string;
|
|
60
|
-
type: string;
|
|
61
|
-
isArray?: boolean;
|
|
62
|
-
branchValues?: Record<string, BranchValueConfig>;
|
|
63
|
-
}
|
|
64
|
-
export interface SelectionConfig {
|
|
65
|
-
mode?: SelectionMode;
|
|
66
|
-
enforceUniqueness?: boolean;
|
|
67
|
-
exhaustionBehavior?: ExhaustionBehavior;
|
|
68
|
-
}
|
|
69
|
-
export interface SelectionState {
|
|
70
|
-
usedIndices: number[];
|
|
71
|
-
currentIndex: number;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Computes the required outputMode/selectionMode types based on node category.
|
|
75
|
-
* - trigger/terminal: both null
|
|
76
|
-
* - generator: outputMode required, selectionMode null
|
|
77
|
-
* - source: both required
|
|
78
|
-
*/
|
|
79
|
-
type DefaultsForCategory<T extends NodeCategory, TCustom extends Record<string, unknown>> = T extends 'source' ? TCustom & {
|
|
80
|
-
outputMode: OutputMode;
|
|
81
|
-
selectionMode: SelectionMode;
|
|
82
|
-
} : T extends 'generator' ? TCustom & {
|
|
83
|
-
outputMode: OutputMode;
|
|
84
|
-
selectionMode: null;
|
|
85
|
-
} : TCustom & {
|
|
86
|
-
outputMode: null;
|
|
87
|
-
selectionMode: null;
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* Computes the outputModes array type based on node category.
|
|
91
|
-
*/
|
|
92
|
-
type OutputModesForCategory<T extends NodeCategory> = T extends 'source' | 'generator' ? OutputMode[] : null;
|
|
93
|
-
/**
|
|
94
|
-
* Computes the selectionModes array type based on node category.
|
|
95
|
-
*/
|
|
96
|
-
type SelectionModesForCategory<T extends NodeCategory> = T extends 'source' ? SelectionMode[] : null;
|
|
97
|
-
export interface NodeDefinition<T extends NodeCategory = NodeCategory, TDefaults extends Record<string, unknown> = Record<string, unknown>> {
|
|
98
|
-
nodeId: string;
|
|
99
|
-
label: string;
|
|
100
|
-
description: string;
|
|
101
|
-
type: T;
|
|
102
|
-
category: string;
|
|
103
|
-
outputModes: OutputModesForCategory<T>;
|
|
104
|
-
selectionModes: SelectionModesForCategory<T>;
|
|
105
|
-
defaults: DefaultsForCategory<T, TDefaults>;
|
|
106
|
-
computePorts: (params: {
|
|
107
|
-
config: DefaultsForCategory<T, TDefaults>;
|
|
108
|
-
getConnectedOutput?: (inputId: string) => {
|
|
109
|
-
type: BasePortType | BasePortType[];
|
|
110
|
-
isArray: boolean;
|
|
111
|
-
objectSchema?: ObjectSchemaField[];
|
|
112
|
-
} | null;
|
|
113
|
-
}) => {
|
|
114
|
-
inputs: NodePort[];
|
|
115
|
-
outputs: NodePort[];
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Define a node with full type inference.
|
|
120
|
-
*
|
|
121
|
-
* - outputMode/selectionMode in defaults are typed based on the node's `type`
|
|
122
|
-
* - Custom defaults are merged and available in computePorts
|
|
123
|
-
* - No manual type assertions needed
|
|
124
|
-
*/
|
|
125
|
-
export declare function defineNode<T extends NodeCategory, TCustomDefaults extends Record<string, unknown>>(def: {
|
|
126
|
-
nodeId: string;
|
|
127
|
-
label: string;
|
|
128
|
-
description: string;
|
|
129
|
-
type: T;
|
|
130
|
-
category: string;
|
|
131
|
-
outputModes: OutputModesForCategory<T>;
|
|
132
|
-
selectionModes: SelectionModesForCategory<T>;
|
|
133
|
-
defaults: DefaultsForCategory<T, TCustomDefaults>;
|
|
134
|
-
computePorts: (params: {
|
|
135
|
-
config: DefaultsForCategory<T, TCustomDefaults>;
|
|
136
|
-
getConnectedOutput?: (inputId: string) => {
|
|
137
|
-
type: BasePortType | BasePortType[];
|
|
138
|
-
isArray: boolean;
|
|
139
|
-
objectSchema?: ObjectSchemaField[];
|
|
140
|
-
} | null;
|
|
141
|
-
}) => {
|
|
142
|
-
inputs: NodePort[];
|
|
143
|
-
outputs: NodePort[];
|
|
144
|
-
};
|
|
145
|
-
}): NodeDefinition<T, TCustomDefaults>;
|
|
146
|
-
export {};
|
package/dist/nodes/types.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Node Definition Types
|
|
4
|
-
*
|
|
5
|
-
* This file contains shared types for node definitions.
|
|
6
|
-
* Each node file imports from here and defines its behavior.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.defineNode = defineNode;
|
|
10
|
-
// =============================================================================
|
|
11
|
-
// Helper Function
|
|
12
|
-
// =============================================================================
|
|
13
|
-
/**
|
|
14
|
-
* Define a node with full type inference.
|
|
15
|
-
*
|
|
16
|
-
* - outputMode/selectionMode in defaults are typed based on the node's `type`
|
|
17
|
-
* - Custom defaults are merged and available in computePorts
|
|
18
|
-
* - No manual type assertions needed
|
|
19
|
-
*/
|
|
20
|
-
function defineNode(def) {
|
|
21
|
-
return def;
|
|
22
|
-
}
|