Line data Source code
1 : import type { NodeId } from '@comfyorg/graph-model/nodeId'
2 :
3 : import type { ResolvedRoles } from './resolveTourRoles'
4 : import type { TourMediaKind } from './tourRolePins'
5 :
6 : export type TourStep =
7 : | { kind: 'upload'; nodeId: NodeId }
8 : | { kind: 'prompt'; nodeId: NodeId }
9 : | { kind: 'run' }
10 : | { kind: 'result'; nodeId: NodeId; mediaKind: TourMediaKind }
11 :
12 : /** A role that did not resolve omits its step; Run targets the toolbar, not the graph. */
13 0 : export function sequenceBuilder({
14 : source,
15 : promptHost,
16 : sink,
17 : mediaKind
18 : }: ResolvedRoles): TourStep[] {
19 0 : return [
20 : ...(source ? [{ kind: 'upload' as const, nodeId: source }] : []),
21 : ...(promptHost ? [{ kind: 'prompt' as const, nodeId: promptHost }] : []),
22 : { kind: 'run' as const },
23 : ...(sink ? [{ kind: 'result' as const, nodeId: sink, mediaKind }] : [])
24 : ]
25 : }
|