ugcinc 4.1.56 → 4.1.58
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 +2 -1
- package/dist/automations/nodes/collect.d.ts +1 -1
- package/dist/automations/nodes/if.d.ts +2 -1
- package/dist/automations/nodes/index.d.ts +17 -0
- package/dist/automations/nodes/random-route.d.ts +2 -1
- package/dist/automations/types.d.ts +15 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodePort, PortValue } from '../types';
|
|
1
|
+
import type { NodePort, PortValue, FlowControlOutput } from '../types';
|
|
2
2
|
import { type InputType, type OutputMode } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Branch node inputs: required key input + dynamic branch-specific inputs.
|
|
@@ -30,6 +30,7 @@ declare const definition: import("./types").NodeDefinition<"generator", {
|
|
|
30
30
|
declare const _default: typeof definition & {
|
|
31
31
|
__TInputs: BranchNodeInputs;
|
|
32
32
|
__TOutputs: BranchNodeOutputs;
|
|
33
|
+
__TExecutorOutput: FlowControlOutput;
|
|
33
34
|
};
|
|
34
35
|
export default _default;
|
|
35
36
|
export type BranchNodeConfig = typeof definition.defaults;
|
|
@@ -20,7 +20,7 @@ export interface CollectNodeInputs {
|
|
|
20
20
|
_collectedValues?: CollectedValues;
|
|
21
21
|
}
|
|
22
22
|
export interface CollectNodeOutputs {
|
|
23
|
-
array: CollectInputValue[];
|
|
23
|
+
array: (CollectInputValue | null)[];
|
|
24
24
|
}
|
|
25
25
|
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
26
26
|
expectedCount: number | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodePort, PortValue } from '../types';
|
|
1
|
+
import type { NodePort, PortValue, FlowControlOutput } from '../types';
|
|
2
2
|
import { type OutputMode } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* If node inputs: dynamic boolean condition inputs + passthrough inputs.
|
|
@@ -25,6 +25,7 @@ declare const definition: import("./types").NodeDefinition<"generator", {
|
|
|
25
25
|
declare const _default: typeof definition & {
|
|
26
26
|
__TInputs: IfNodeInputs;
|
|
27
27
|
__TOutputs: IfNodeOutputs;
|
|
28
|
+
__TExecutorOutput: FlowControlOutput;
|
|
28
29
|
};
|
|
29
30
|
export default _default;
|
|
30
31
|
export { IfLogicOperators };
|
|
@@ -65,6 +65,7 @@ export declare const nodeDefinitions: {
|
|
|
65
65
|
}, import("./branch").BranchNodeInputs, import("./branch").BranchNodeOutputs, false> & {
|
|
66
66
|
__TInputs: import("./branch").BranchNodeInputs;
|
|
67
67
|
__TOutputs: import("./branch").BranchNodeOutputs;
|
|
68
|
+
__TExecutorOutput: import("../types").FlowControlOutput;
|
|
68
69
|
};
|
|
69
70
|
readonly collect: NodeDefinition<"generator", {
|
|
70
71
|
expectedCount: number | undefined;
|
|
@@ -187,6 +188,7 @@ export declare const nodeDefinitions: {
|
|
|
187
188
|
}, import("./if").IfNodeInputs, import("./if").IfNodeOutputs, false> & {
|
|
188
189
|
__TInputs: import("./if").IfNodeInputs;
|
|
189
190
|
__TOutputs: import("./if").IfNodeOutputs;
|
|
191
|
+
__TExecutorOutput: import("../types").FlowControlOutput;
|
|
190
192
|
};
|
|
191
193
|
readonly 'image-composer': NodeDefinition<"generator", {
|
|
192
194
|
imageEditor: {
|
|
@@ -271,6 +273,7 @@ export declare const nodeDefinitions: {
|
|
|
271
273
|
}, import("./random-route").RandomRouteNodeInputs, import("./random-route").RandomRouteNodeOutputs, false> & {
|
|
272
274
|
__TInputs: import("./random-route").RandomRouteNodeInputs;
|
|
273
275
|
__TOutputs: import("./random-route").RandomRouteNodeOutputs;
|
|
276
|
+
__TExecutorOutput: import("../types").FlowControlOutput;
|
|
274
277
|
};
|
|
275
278
|
readonly recurrence: NodeDefinition<"trigger", {
|
|
276
279
|
frequencyType: "per-day" | "periodic";
|
|
@@ -383,6 +386,10 @@ type InputsOf<T> = T extends {
|
|
|
383
386
|
type OutputsOf<T> = T extends {
|
|
384
387
|
__TOutputs: infer O;
|
|
385
388
|
} ? O : never;
|
|
389
|
+
/** Helper to extract executor output types from node definitions (falls back to __TOutputs) */
|
|
390
|
+
type ExecutorOutputsOf<T> = T extends {
|
|
391
|
+
__TExecutorOutput: infer E;
|
|
392
|
+
} ? E : OutputsOf<T>;
|
|
386
393
|
/**
|
|
387
394
|
* Input type lookup by node ID.
|
|
388
395
|
* Auto-derived from phantom types on node definitions.
|
|
@@ -401,6 +408,16 @@ export type NodeInputs = {
|
|
|
401
408
|
export type NodeOutputs = {
|
|
402
409
|
[K in UserCreatableNodeType]: OutputsOf<(typeof nodeDefinitions)[K]>;
|
|
403
410
|
};
|
|
411
|
+
/**
|
|
412
|
+
* Executor output type lookup by node ID.
|
|
413
|
+
* Auto-derived from __TExecutorOutput phantom type, falls back to __TOutputs.
|
|
414
|
+
* Flow control nodes (branch, random-route, if) return FlowControlOutput.
|
|
415
|
+
* @example ExecutorOutputs['branch'] // FlowControlOutput
|
|
416
|
+
* @example ExecutorOutputs['llm'] // Record<string, PortValue | PortValue[]>
|
|
417
|
+
*/
|
|
418
|
+
export type ExecutorOutputs = {
|
|
419
|
+
[K in UserCreatableNodeType]: ExecutorOutputsOf<(typeof nodeDefinitions)[K]>;
|
|
420
|
+
};
|
|
404
421
|
export { internalNodeTypes, type InternalNodeType };
|
|
405
422
|
export type { NodeDefinition } from './types';
|
|
406
423
|
/** Union of all node definition types */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodePort, PortValue } from '../types';
|
|
1
|
+
import type { NodePort, PortValue, FlowControlOutput } from '../types';
|
|
2
2
|
import { type InputType, type OutputMode } from './types';
|
|
3
3
|
/** Random route inputs are dynamic (passthrough inputs where inputType='variable'). */
|
|
4
4
|
export type RandomRouteNodeInputs = Record<string, PortValue | PortValue[]>;
|
|
@@ -21,6 +21,7 @@ declare const definition: import("./types").NodeDefinition<"generator", {
|
|
|
21
21
|
declare const _default: typeof definition & {
|
|
22
22
|
__TInputs: RandomRouteNodeInputs;
|
|
23
23
|
__TOutputs: RandomRouteNodeOutputs;
|
|
24
|
+
__TExecutorOutput: FlowControlOutput;
|
|
24
25
|
};
|
|
25
26
|
export default _default;
|
|
26
27
|
export type RandomRouteNodeConfig = typeof definition.defaults;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Core types for the automation system including ports, selection, and output modes.
|
|
5
5
|
*/
|
|
6
6
|
import type { ObjectSchemaField, SelectionMode, OutputMode, NodeCategory } from './nodes/types';
|
|
7
|
-
import type { NodeType, UserCreatableNodeType, WorkflowConfig, NodeInputs, NodeOutputs, InternalNodeType } from './nodes';
|
|
7
|
+
import type { NodeType, UserCreatableNodeType, WorkflowConfig, NodeInputs, NodeOutputs, ExecutorOutputs, InternalNodeType } from './nodes';
|
|
8
8
|
import type { ForEachNodeConfig, ForEachNodeInputs, ForEachNodeOutputs } from './nodes/for-each';
|
|
9
9
|
/**
|
|
10
10
|
* Config type for internal node types (created dynamically at runtime).
|
|
@@ -39,6 +39,18 @@ export type InternalNodeOutputs = {
|
|
|
39
39
|
* Combined output type lookup for all node types (user-creatable + internal).
|
|
40
40
|
*/
|
|
41
41
|
export type AllNodeOutputs = NodeOutputs & InternalNodeOutputs;
|
|
42
|
+
/**
|
|
43
|
+
* Executor output type for internal node types.
|
|
44
|
+
* for-each-value uses the same executor outputs as for-each (its parent node).
|
|
45
|
+
*/
|
|
46
|
+
export type InternalExecutorOutputs = {
|
|
47
|
+
'for-each-value': ForEachNodeOutputs;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Combined executor output type lookup for all node types (user-creatable + internal).
|
|
51
|
+
* Used by NodeExecutor to determine the return type of execute().
|
|
52
|
+
*/
|
|
53
|
+
export type AllExecutorOutputs = ExecutorOutputs & InternalExecutorOutputs;
|
|
42
54
|
/**
|
|
43
55
|
* Media type for automation nodes
|
|
44
56
|
*/
|
|
@@ -397,7 +409,7 @@ export interface ExecutorContext<TType extends NodeType = NodeType> {
|
|
|
397
409
|
* Executor for synchronous nodes.
|
|
398
410
|
* Generic on node type - config type is automatically derived.
|
|
399
411
|
*/
|
|
400
|
-
export interface NodeExecutor<TType extends NodeType, TOutput =
|
|
412
|
+
export interface NodeExecutor<TType extends NodeType, TOutput = AllExecutorOutputs[TType]> {
|
|
401
413
|
type: TType;
|
|
402
414
|
/**
|
|
403
415
|
* Execute the node and return a single output value.
|
|
@@ -421,7 +433,7 @@ export type ExecutorAsyncJobStatus<TOutput = unknown> = {
|
|
|
421
433
|
* Executor for asynchronous nodes (video-editor, generate-image, workflow).
|
|
422
434
|
* Uses submit/poll pattern for durable workflows.
|
|
423
435
|
*/
|
|
424
|
-
export interface AsyncNodeExecutor<TType extends NodeType, TOutput =
|
|
436
|
+
export interface AsyncNodeExecutor<TType extends NodeType, TOutput = AllExecutorOutputs[TType]> extends Omit<NodeExecutor<TType, TOutput>, 'execute'> {
|
|
425
437
|
isAsync: true;
|
|
426
438
|
/** Submit job - returns job ID for polling */
|
|
427
439
|
submitJob: (ctx: ExecutorContext<TType>) => Promise<{
|