|
7 | 7 | from uipath.runtime.debug import UiPathBreakpointResult, UiPathDebugQuitError |
8 | 8 | from uipath.runtime.events import UiPathRuntimeStateEvent |
9 | 9 | from uipath.runtime.result import UiPathRuntimeResult |
| 10 | +from uipath.runtime.resumable import UiPathResumeTriggerType |
10 | 11 |
|
11 | 12 | logger = logging.getLogger(__name__) |
12 | 13 |
|
@@ -60,6 +61,29 @@ async def emit_breakpoint_hit( |
60 | 61 | if self.on_breakpoint_hit: |
61 | 62 | self.on_breakpoint_hit(breakpoint_result) |
62 | 63 |
|
| 64 | + async def emit_execution_suspended( |
| 65 | + self, runtime_result: UiPathRuntimeResult |
| 66 | + ) -> None: |
| 67 | + """Notify debugger that execution is suspended.""" |
| 68 | + logger.debug("Execution suspended") |
| 69 | + if runtime_result.trigger is None: |
| 70 | + return |
| 71 | + |
| 72 | + if runtime_result.trigger.trigger_type == UiPathResumeTriggerType.API: |
| 73 | + if self.on_breakpoint_hit: |
| 74 | + self.on_breakpoint_hit( |
| 75 | + UiPathBreakpointResult( |
| 76 | + breakpoint_node="<suspended>", |
| 77 | + breakpoint_type="before", |
| 78 | + current_state=runtime_result.output, |
| 79 | + next_nodes=[], |
| 80 | + ) |
| 81 | + ) |
| 82 | + |
| 83 | + async def emit_execution_resumed(self, resume_data: Any) -> None: |
| 84 | + """Notify debugger that execution resumed.""" |
| 85 | + logger.debug("Execution resumed") |
| 86 | + |
63 | 87 | async def emit_execution_completed( |
64 | 88 | self, runtime_result: UiPathRuntimeResult |
65 | 89 | ) -> None: |
|
0 commit comments