Skip to content

Commit 97a3c00

Browse files
committed
fix: update runtime protocol
1 parent 8c7ccdb commit 97a3c00

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "UiPath Developer Console"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
8-
"uipath-runtime>=0.0.5, <0.1.0",
8+
"uipath-runtime>=0.0.7, <0.1.0",
99
"textual>=6.5.0",
1010
"pyperclip>=1.11.0",
1111
]

src/uipath/dev/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from uipath.runtime import (
2020
UiPathExecuteOptions,
2121
UiPathExecutionRuntime,
22-
UiPathRuntimeFactory,
22+
UiPathRuntimeFactoryProtocol,
2323
UiPathRuntimeStatus,
2424
)
2525
from uipath.runtime.errors import UiPathErrorContract, UiPathRuntimeError
@@ -52,7 +52,7 @@ class UiPathDeveloperConsole(App[Any]):
5252

5353
def __init__(
5454
self,
55-
runtime_factory: UiPathRuntimeFactory[Any],
55+
runtime_factory: UiPathRuntimeFactoryProtocol,
5656
trace_manager: UiPathTraceManager,
5757
**kwargs,
5858
):
@@ -207,7 +207,7 @@ async def _execute_runtime(self, run: ExecutionRun):
207207
run_id=run.id,
208208
callback=self._handle_log_message,
209209
)
210-
runtime = self.runtime_factory.new_runtime(entrypoint=run.entrypoint)
210+
runtime = await self.runtime_factory.new_runtime(entrypoint=run.entrypoint)
211211
execution_runtime = UiPathExecutionRuntime(
212212
delegate=runtime,
213213
trace_manager=self.trace_manager,

src/uipath/dev/_demo/mock_runtime.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
from opentelemetry import trace
88
from uipath.runtime import (
9-
UiPathBaseRuntime,
109
UiPathExecuteOptions,
11-
UiPathRuntimeFactory,
1210
UiPathRuntimeResult,
1311
UiPathRuntimeStatus,
1412
)
@@ -17,7 +15,7 @@
1715
logger = logging.getLogger(__name__)
1816

1917

20-
class MockRuntime(UiPathBaseRuntime):
18+
class MockRuntime:
2119
"""A mock runtime that simulates a multi-step workflow with rich telemetry."""
2220

2321
async def get_schema(self) -> UiPathRuntimeSchema:
@@ -224,18 +222,21 @@ async def execute(
224222
status=UiPathRuntimeStatus.SUCCESSFUL,
225223
)
226224

227-
async def cleanup(self) -> None:
228-
logger.info("MockRuntime: cleanup() invoked")
229-
print("[MockRuntime] cleanup() invoked")
225+
async def dispose(self) -> None:
226+
logger.info("MockRuntime: dispose() invoked")
227+
print("[MockRuntime] dispose() invoked")
230228

231229

232-
class MockRuntimeFactory(UiPathRuntimeFactory[MockRuntime]):
230+
class MockRuntimeFactory:
233231
"""Runtime factory compatible with UiPathDevTerminal expectations."""
234232

235233
# This is the method the Textual app calls here:
236-
# runtime = self.runtime_factory.new_runtime(entrypoint=run.entrypoint)
237-
def new_runtime(self, entrypoint: str) -> MockRuntime:
234+
# runtime = await self.runtime_factory.new_runtime(entrypoint=run.entrypoint)
235+
async def new_runtime(self, entrypoint: str) -> MockRuntime:
238236
return MockRuntime()
239237

240238
def discover_runtimes(self) -> list[MockRuntime]:
241239
return []
240+
241+
def discover_entrypoints(self) -> list[str]:
242+
return []

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)