Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
67 lines (62 loc) · 2.21 KB
/
Copy pathtypes.ts
File metadata and controls
67 lines (62 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import type { BlockRetryConfig } from '@sim/workflow-types/workflow'
import type { OutputFieldDefinition, ParamType } from '@/blocks/types'
import type { Position } from '@/stores/workflows/workflow/types'
export interface SerializedWorkflow {
version: string
blocks: SerializedBlock[]
connections: SerializedConnection[]
loops: Record<string, SerializedLoop>
parallels?: Record<string, SerializedParallel>
}
export interface SerializedConnection {
source: string
target: string
sourceHandle?: string
targetHandle?: string
condition?: {
type: 'if' | 'else' | 'else if'
expression?: string // JavaScript expression to evaluate
}
}
export interface SerializedBlock {
id: string
position: Position
config: {
tool: string
params: Record<string, unknown>
}
inputs: Record<string, ParamType>
outputs: Record<string, OutputFieldDefinition>
metadata?: {
id: string
name?: string
description?: string
category?: string
icon?: string
color?: string
}
enabled: boolean
/** Canonical mode overrides from block.data (used by agent handler for tool param resolution) */
canonicalModes?: Record<string, 'basic' | 'advanced'>
/** Server-only lifecycle input ids omitted from execution-log projections. */
privateInputIds?: string[]
/** Opt-in retry for failed tries; absent means the block runs exactly once. */
retry?: BlockRetryConfig
}
export interface SerializedLoop {
id: string
nodes: string[]
iterations: number
loopType?: 'for' | 'forEach' | 'while' | 'doWhile'
forEachItems?: any[] | Record<string, any> | string // Items to iterate over or expression to evaluate
whileCondition?: string // JS expression that evaluates to boolean (for while loops)
doWhileCondition?: string // JS expression that evaluates to boolean (for do-while loops)
}
export interface SerializedParallel {
id: string
nodes: string[]
distribution?: any[] | Record<string, any> | string // Items to distribute or expression to evaluate
count?: number // Number of parallel executions for count-based parallel
parallelType?: 'count' | 'collection' // Explicit parallel type to avoid inference bugs
batchSize?: number // Maximum number of branches to run concurrently per batch
}