* 可视化调试状态:断点集合 + 暂停态。 * 断点是"画布编辑态"数据(持久跟随节点);暂停态是"运行态"数据。
| 5 | * 断点是"画布编辑态"数据(持久跟随节点);暂停态是"运行态"数据。 |
| 6 | */ |
| 7 | interface DebugState { |
| 8 | breakpoints: Set<string> |
| 9 | stepMode: boolean // 是否以单步模式启动下次运行 |
| 10 | isPaused: boolean |
| 11 | pausedNodeId: string | null |
| 12 | pausedLabel: string | null |
| 13 | pausedVariables: Record<string, any> |
| 14 | pausedReason: 'breakpoint' | 'step' | null |
| 15 | |
| 16 | toggleBreakpoint: (nodeId: string) => void |
| 17 | clearBreakpoints: () => void |
| 18 | hasBreakpoint: (nodeId: string) => boolean |
| 19 | setStepMode: (v: boolean) => void |
| 20 | |
| 21 | setPaused: (info: { nodeId: string; label?: string; variables?: Record<string, any>; reason?: 'breakpoint' | 'step' }) => void |
| 22 | clearPaused: () => void |
| 23 | } |
| 24 | |
| 25 | export const useDebugStore = create<DebugState>((set, get) => ({ |
| 26 | breakpoints: new Set<string>(), |
nothing calls this directly
no outgoing calls
no test coverage detected